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>
26 class ImplB3DPolyPolygon
;
37 class BASEGFX_DLLPUBLIC B3DPolyPolygon
40 typedef o3tl::cow_wrapper
< ImplB3DPolyPolygon
, o3tl::ThreadSafeRefCountingPolicy
> ImplType
;
43 ImplType mpPolyPolygon
;
47 B3DPolyPolygon(const B3DPolyPolygon
& rPolyPolygon
);
48 B3DPolyPolygon(B3DPolyPolygon
&& rPolygon
);
49 explicit B3DPolyPolygon(const B3DPolygon
& rPolygon
);
52 // assignment operator
53 B3DPolyPolygon
& operator=(const B3DPolyPolygon
& rPolyPolygon
);
54 B3DPolyPolygon
& operator=(B3DPolyPolygon
&& rPolyPolygon
);
57 bool operator==(const B3DPolyPolygon
& rPolyPolygon
) const;
60 sal_uInt32
count() const;
62 // B3DPolygon interface
63 B3DPolygon
const & getB3DPolygon(sal_uInt32 nIndex
) const;
64 void setB3DPolygon(sal_uInt32 nIndex
, const B3DPolygon
& rPolygon
);
67 bool areBColorsUsed() const;
71 void transformNormals(const B3DHomMatrix
& rMatrix
);
72 bool areNormalsUsed() const;
75 // TextureCoordinate interface
76 void transformTextureCoordinates(const B2DHomMatrix
& rMatrix
);
77 bool areTextureCoordinatesUsed() const;
78 void clearTextureCoordinates();
80 // append single polygon
81 void append(const B3DPolygon
& rPolygon
, sal_uInt32 nCount
= 1);
83 // append multiple polygons
84 void append(const B3DPolyPolygon
& rPolyPolygon
);
87 void remove(sal_uInt32 nIndex
, sal_uInt32 nCount
= 1);
89 // reset to empty state
92 // flip polygon direction
95 // test if tools::PolyPolygon has double points
96 bool hasDoublePoints() const;
98 // remove double points, at the begin/end and follow-ups, too
99 void removeDoublePoints();
101 // apply transformation given in matrix form to the polygon
102 void transform(const basegfx::B3DHomMatrix
& rMatrix
);
104 // polygon iterators (same iterator validity conditions as for vector)
105 const B3DPolygon
* begin() const;
106 const B3DPolygon
* end() const;
110 } // end of namespace basegfx
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */