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 INCLUDED_BASEGFX_POLYGON_B3DPOLYGON_HXX
21 #define INCLUDED_BASEGFX_POLYGON_B3DPOLYGON_HXX
23 #include <sal/types.h>
24 #include <o3tl/cow_wrapper.hxx>
25 #include <basegfx/basegfxdllapi.h>
40 } // end of namespace basegfx
46 class BASEGFX_DLLPUBLIC B3DPolygon
49 typedef o3tl::cow_wrapper
< ImplB3DPolygon
> ImplType
;
57 B3DPolygon(const B3DPolygon
& rPolygon
);
60 // assignment operator
61 B3DPolygon
& operator=(const B3DPolygon
& rPolygon
);
64 bool operator==(const B3DPolygon
& rPolygon
) const;
65 bool operator!=(const B3DPolygon
& rPolygon
) const;
68 sal_uInt32
count() const;
70 // Coordinate interface
71 B3DPoint
getB3DPoint(sal_uInt32 nIndex
) const;
72 void setB3DPoint(sal_uInt32 nIndex
, const B3DPoint
& rValue
);
75 void append(const B3DPoint
& rPoint
, sal_uInt32 nCount
= 1);
78 BColor
getBColor(sal_uInt32 nIndex
) const;
79 void setBColor(sal_uInt32 nIndex
, const BColor
& rValue
);
80 bool areBColorsUsed() const;
84 B3DVector
getNormal() const; // plane normal
85 B3DVector
getNormal(sal_uInt32 nIndex
) const; // normal in each point
86 void setNormal(sal_uInt32 nIndex
, const B3DVector
& rValue
);
87 void transformNormals(const B3DHomMatrix
& rMatrix
);
88 bool areNormalsUsed() const;
91 // TextureCoordinate interface
92 B2DPoint
getTextureCoordinate(sal_uInt32 nIndex
) const;
93 void setTextureCoordinate(sal_uInt32 nIndex
, const B2DPoint
& rValue
);
94 void transformTextureCoordiantes(const B2DHomMatrix
& rMatrix
);
95 bool areTextureCoordinatesUsed() const;
96 void clearTextureCoordinates();
98 // append other 2D polygons
99 void append(const B3DPolygon
& rPoly
, sal_uInt32 nIndex
= 0, sal_uInt32 nCount
= 0);
102 void remove(sal_uInt32 nIndex
, sal_uInt32 nCount
= 1);
108 bool isClosed() const;
109 void setClosed(bool bNew
);
111 // flip polygon direction
114 // test if Polygon has double points
115 bool hasDoublePoints() const;
117 // remove double points, at the begin/end and follow-ups, too
118 void removeDoublePoints();
120 // apply transformation given in matrix form to the polygon
121 void transform(const B3DHomMatrix
& rMatrix
);
123 } // end of namespace basegfx
128 #endif // INCLUDED_BASEGFX_POLYGON_B3DPOLYGON_HXX
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */