LibreOffice Module basegfx (master) 1
b3dpolypolygon.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <sal/types.h>
23#include <o3tl/cow_wrapper.hxx>
25
27
28namespace basegfx
29{
30 class B3DPolygon;
31 class B3DHomMatrix;
32 class B2DHomMatrix;
33}
34
35namespace basegfx
36{
38 {
39 public:
41
42 private:
44
45 public:
47 B3DPolyPolygon(const B3DPolyPolygon& rPolyPolygon);
49 explicit B3DPolyPolygon(const B3DPolygon& rPolygon);
51
52 // assignment operator
55
56 // compare operators
57 bool operator==(const B3DPolyPolygon& rPolyPolygon) const;
58 bool operator!=(const B3DPolyPolygon& rPolyPolygon) const;
59
60 // polygon interface
61 sal_uInt32 count() const;
62
63 // B3DPolygon interface
64 B3DPolygon const & getB3DPolygon(sal_uInt32 nIndex) const;
65 void setB3DPolygon(sal_uInt32 nIndex, const B3DPolygon& rPolygon);
66
67 // BColor interface
68 bool areBColorsUsed() const;
69 void clearBColors();
70
71 // Normals interface
72 void transformNormals(const B3DHomMatrix& rMatrix);
73 bool areNormalsUsed() const;
74 void clearNormals();
75
76 // TextureCoordinate interface
77 void transformTextureCoordinates(const B2DHomMatrix& rMatrix);
78 bool areTextureCoordinatesUsed() const;
79 void clearTextureCoordinates();
80
81 // append single polygon
82 void append(const B3DPolygon& rPolygon, sal_uInt32 nCount = 1);
83
84 // append multiple polygons
85 void append(const B3DPolyPolygon& rPolyPolygon);
86
87 // remove
88 void remove(sal_uInt32 nIndex, sal_uInt32 nCount = 1);
89
90 // reset to empty state
91 void clear();
92
93 // flip polygon direction
94 void flip();
95
96 // test if tools::PolyPolygon has double points
97 bool hasDoublePoints() const;
98
99 // remove double points, at the begin/end and follow-ups, too
100 void removeDoublePoints();
101
102 // apply transformation given in matrix form to the polygon
103 void transform(const basegfx::B3DHomMatrix& rMatrix);
104
105 // polygon iterators (same iterator validity conditions as for vector)
106 const B3DPolygon* begin() const;
107 const B3DPolygon* end() const;
108 B3DPolygon* begin();
109 B3DPolygon* end();
110 };
111} // end of namespace basegfx
112
113/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define BASEGFX_DLLPUBLIC
Definition: basegfxdllapi.h:35
B3DPolyPolygon & operator=(B3DPolyPolygon &&rPolyPolygon)
o3tl::cow_wrapper< ImplB3DPolyPolygon, o3tl::ThreadSafeRefCountingPolicy > ImplType
B3DPolyPolygon(B3DPolyPolygon &&rPolygon)
B3DPolyPolygon & operator=(const B3DPolyPolygon &rPolyPolygon)
B3DPolyPolygon(const B3DPolyPolygon &rPolyPolygon)
OUStringBuffer & remove(OUStringBuffer &rIn, sal_Unicode c)
enumrange< T >::Iterator begin(enumrange< T >)
end
bool operator!=(const XclExpString &rLeft, const XclExpString &rRight)
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)