LibreOffice Module basegfx (master) 1
b3dpolygon.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <sal/types.h>
23#include <o3tl/cow_wrapper.hxx>
25
26class ImplB3DPolygon;
27
28namespace basegfx
29{
30 class B3DPoint;
31 class B3DHomMatrix;
32 class B3DVector;
33 class B2DPoint;
34 class B2DHomMatrix;
35 class BColor;
36}
37
38namespace basegfx
39{
41 {
42 public:
44
45 private:
46 // internal data.
48
49 public:
50 B3DPolygon();
51 B3DPolygon(const B3DPolygon& rPolygon);
54
55 // assignment operator
56 B3DPolygon& operator=(const B3DPolygon& rPolygon);
58
59 // compare operators
60 bool operator==(const B3DPolygon& rPolygon) const;
61 bool operator!=(const B3DPolygon& rPolygon) const;
62
63 // member count
64 sal_uInt32 count() const;
65
66 // Coordinate interface
67 B3DPoint const & getB3DPoint(sal_uInt32 nIndex) const;
68 void setB3DPoint(sal_uInt32 nIndex, const B3DPoint& rValue);
69
70 // Coordinate append
71 void append(const B3DPoint& rPoint, sal_uInt32 nCount = 1);
72
73 // BColor interface
74 BColor const & getBColor(sal_uInt32 nIndex) const;
75 void setBColor(sal_uInt32 nIndex, const BColor& rValue);
76 bool areBColorsUsed() const;
77 void clearBColors();
78
79 // Normals interface
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;
85 void clearNormals();
86
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();
93
94 // append other 2D polygons
95 void append(const B3DPolygon& rPoly, sal_uInt32 nIndex = 0, sal_uInt32 nCount = 0);
96
97 // remove
98 void remove(sal_uInt32 nIndex, sal_uInt32 nCount = 1);
99
100 // clear all points
101 void clear();
102
103 // closed state
104 bool isClosed() const;
105 void setClosed(bool bNew);
106
107 // flip polygon direction
108 void flip();
109
110 // test if Polygon has double points
111 bool hasDoublePoints() const;
112
113 // remove double points, at the begin/end and follow-ups, too
114 void removeDoublePoints();
115
116 // apply transformation given in matrix form to the polygon
117 void transform(const B3DHomMatrix& rMatrix);
118 };
119} // end of namespace basegfx
120
121/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define BASEGFX_DLLPUBLIC
Definition: basegfxdllapi.h:35
Base Point class with two double values.
Definition: b2dpoint.hxx:42
Base Point class with three double values.
Definition: b3dpoint.hxx:38
B3DPolygon & operator=(const B3DPolygon &rPolygon)
B3DPolygon(const B3DPolygon &rPolygon)
B3DPolygon(B3DPolygon &&rPolygon)
o3tl::cow_wrapper< ImplB3DPolygon, o3tl::ThreadSafeRefCountingPolicy > ImplType
Definition: b3dpolygon.hxx:43
B3DPolygon & operator=(B3DPolygon &&rPolygon)
Base Point class with three double values.
Definition: b3dvector.hxx:38
Base Color class with three double values.
Definition: bcolor.hxx:41
OUStringBuffer & remove(OUStringBuffer &rIn, sal_Unicode c)
bool operator!=(const XclExpString &rLeft, const XclExpString &rRight)
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)