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 .
22 #include <sal/types.h>
23 #include <o3tl/cow_wrapper.hxx>
24 #include <basegfx/basegfxdllapi.h>
40 class BASEGFX_DLLPUBLIC B3DPolygon
43 typedef o3tl::cow_wrapper
< ImplB3DPolygon
, o3tl::ThreadSafeRefCountingPolicy
> ImplType
;
51 B3DPolygon(const B3DPolygon
& rPolygon
);
52 B3DPolygon(B3DPolygon
&& rPolygon
);
55 // assignment operator
56 B3DPolygon
& operator=(const B3DPolygon
& rPolygon
);
57 B3DPolygon
& operator=(B3DPolygon
&& rPolygon
);
60 bool operator==(const B3DPolygon
& rPolygon
) const;
61 bool operator!=(const B3DPolygon
& rPolygon
) const;
64 sal_uInt32
count() const;
66 // Coordinate interface
67 B3DPoint
const & getB3DPoint(sal_uInt32 nIndex
) const;
68 void setB3DPoint(sal_uInt32 nIndex
, const B3DPoint
& rValue
);
71 void append(const B3DPoint
& rPoint
, sal_uInt32 nCount
= 1);
74 BColor
const & getBColor(sal_uInt32 nIndex
) const;
75 void setBColor(sal_uInt32 nIndex
, const BColor
& rValue
);
76 bool areBColorsUsed() const;
80 B3DVector
const & getNormal() const; // plane normal
81 B3DVector
const & getNormal(sal_uInt32 nIndex
) const; // normal in each point
82 void setNormal(sal_uInt32 nIndex
, const B3DVector
& rValue
);
83 void transformNormals(const B3DHomMatrix
& rMatrix
);
84 bool areNormalsUsed() const;
87 // TextureCoordinate interface
88 B2DPoint
const & getTextureCoordinate(sal_uInt32 nIndex
) const;
89 void setTextureCoordinate(sal_uInt32 nIndex
, const B2DPoint
& rValue
);
90 void transformTextureCoordinates(const B2DHomMatrix
& rMatrix
);
91 bool areTextureCoordinatesUsed() const;
92 void clearTextureCoordinates();
94 // append other 2D polygons
95 void append(const B3DPolygon
& rPoly
, sal_uInt32 nIndex
= 0, sal_uInt32 nCount
= 0);
98 void remove(sal_uInt32 nIndex
, sal_uInt32 nCount
= 1);
104 bool isClosed() const;
105 void setClosed(bool bNew
);
107 // flip polygon direction
110 // test if Polygon has double points
111 bool hasDoublePoints() const;
113 // remove double points, at the begin/end and follow-ups, too
114 void removeDoublePoints();
116 // apply transformation given in matrix form to the polygon
117 void transform(const B3DHomMatrix
& rMatrix
);
119 } // end of namespace basegfx
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */