1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
28 class ImplB3DPolyPolygon
;
35 } // end of namespace basegfx
37 //////////////////////////////////////////////////////////////////////////////
41 class BASEGFX_DLLPUBLIC B3DPolyPolygon
44 typedef o3tl::cow_wrapper
< ImplB3DPolyPolygon
> ImplType
;
47 ImplType mpPolyPolygon
;
51 B3DPolyPolygon(const B3DPolyPolygon
& rPolyPolygon
);
52 explicit B3DPolyPolygon(const B3DPolygon
& rPolygon
);
55 // assignment operator
56 B3DPolyPolygon
& operator=(const B3DPolyPolygon
& rPolyPolygon
);
59 bool operator==(const B3DPolyPolygon
& rPolyPolygon
) const;
60 bool operator!=(const B3DPolyPolygon
& rPolyPolygon
) const;
63 sal_uInt32
count() const;
65 // B3DPolygon interface
66 B3DPolygon
getB3DPolygon(sal_uInt32 nIndex
) const;
67 void setB3DPolygon(sal_uInt32 nIndex
, const B3DPolygon
& rPolygon
);
70 bool areBColorsUsed() const;
74 void transformNormals(const B3DHomMatrix
& rMatrix
);
75 bool areNormalsUsed() const;
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
);
90 void remove(sal_uInt32 nIndex
, sal_uInt32 nCount
= 1);
92 // reset to empty state
95 // flip polygon direction
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;
113 } // end of namespace basegfx
115 #endif /* _BGFX_POLYGON_B3DPOLYPOLYGON_HXX */
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */