bump product version to 4.1.6.2
[LibreOffice.git] / include / basegfx / polygon / b3dpolypolygon.hxx
blobd67da6ad690b850e9b1fa48be664eab582fef128
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef _BGFX_POLYGON_B3DPOLYPOLYGON_HXX
21 #define _BGFX_POLYGON_B3DPOLYPOLYGON_HXX
23 #include <sal/types.h>
24 #include <o3tl/cow_wrapper.hxx>
25 #include <basegfx/basegfxdllapi.h>
27 // predeclarations
28 class ImplB3DPolyPolygon;
30 namespace basegfx
32 class B3DPolygon;
33 class B3DHomMatrix;
34 class B2DHomMatrix;
35 } // end of namespace basegfx
37 //////////////////////////////////////////////////////////////////////////////
39 namespace basegfx
41 class BASEGFX_DLLPUBLIC B3DPolyPolygon
43 public:
44 typedef o3tl::cow_wrapper< ImplB3DPolyPolygon > ImplType;
46 private:
47 ImplType mpPolyPolygon;
49 public:
50 B3DPolyPolygon();
51 B3DPolyPolygon(const B3DPolyPolygon& rPolyPolygon);
52 explicit B3DPolyPolygon(const B3DPolygon& rPolygon);
53 ~B3DPolyPolygon();
55 // assignment operator
56 B3DPolyPolygon& operator=(const B3DPolyPolygon& rPolyPolygon);
58 // compare operators
59 bool operator==(const B3DPolyPolygon& rPolyPolygon) const;
60 bool operator!=(const B3DPolyPolygon& rPolyPolygon) const;
62 // polygon interface
63 sal_uInt32 count() const;
65 // B3DPolygon interface
66 B3DPolygon getB3DPolygon(sal_uInt32 nIndex) const;
67 void setB3DPolygon(sal_uInt32 nIndex, const B3DPolygon& rPolygon);
69 // BColor interface
70 bool areBColorsUsed() const;
71 void clearBColors();
73 // Normals interface
74 void transformNormals(const B3DHomMatrix& rMatrix);
75 bool areNormalsUsed() const;
76 void clearNormals();
78 // TextureCoordinate interface
79 void transformTextureCoordiantes(const B2DHomMatrix& rMatrix);
80 bool areTextureCoordinatesUsed() const;
81 void clearTextureCoordinates();
83 // append single polygon
84 void append(const B3DPolygon& rPolygon, sal_uInt32 nCount = 1);
86 // append multiple polygons
87 void append(const B3DPolyPolygon& rPolyPolygon);
89 // remove
90 void remove(sal_uInt32 nIndex, sal_uInt32 nCount = 1);
92 // reset to empty state
93 void clear();
95 // flip polygon direction
96 void flip();
98 // test if PolyPolygon has double points
99 bool hasDoublePoints() const;
101 // remove double points, at the begin/end and follow-ups, too
102 void removeDoublePoints();
104 // apply transformation given in matrix form to the polygon
105 void transform(const basegfx::B3DHomMatrix& rMatrix);
107 // polygon iterators (same iterator validity conditions as for vector)
108 const B3DPolygon* begin() const;
109 const B3DPolygon* end() const;
110 B3DPolygon* begin();
111 B3DPolygon* end();
113 } // end of namespace basegfx
115 #endif /* _BGFX_POLYGON_B3DPOLYPOLYGON_HXX */
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */