build fix: no comphelper/profilezone.hxx in this branch
[LibreOffice.git] / include / drawinglayer / primitive2d / primitivetools2d.hxx
blob289fc77de01880ba9126d0a365fe260d7bc2e8d7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVETOOLS2D_HXX
21 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVETOOLS2D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
26 #include <basegfx/matrix/b2dhommatrix.hxx>
29 namespace drawinglayer
31 namespace primitive2d
33 /** DiscreteMetricDependentPrimitive2D class
35 tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
36 regarding the size of a discrete unit. The implementation of get2DDecomposition
37 guards the buffered local decomposition and ensures that a create2DDecomposition
38 implementation may use an up-to-date DiscreteUnit accessible using getDiscreteUnit()
40 class DRAWINGLAYER_DLLPUBLIC DiscreteMetricDependentPrimitive2D : public BufferedDecompositionPrimitive2D
42 private:
43 /** the last used fDiscreteUnit definitions for decomposition. Since this
44 is checked and updated from get2DDecomposition() it will be current and
45 usable in create2DDecomposition()
47 double mfDiscreteUnit;
49 public:
50 /// constructor
51 DiscreteMetricDependentPrimitive2D()
52 : BufferedDecompositionPrimitive2D(),
53 mfDiscreteUnit(0.0)
57 /// data read access
58 double getDiscreteUnit() const { return mfDiscreteUnit; }
60 /// Override standard getDecomposition to be view-dependent here
61 virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
63 } // end of namespace primitive2d
64 } // end of namespace drawinglayer
67 namespace drawinglayer
69 namespace primitive2d
71 /** ViewportDependentPrimitive2D class
73 tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
74 regarding the viewport. The implementation of get2DDecomposition
75 guards the buffered local decomposition and ensures that a create2DDecomposition
76 implementation may use an up-to-date Viewport accessible using getViewport()
78 class DRAWINGLAYER_DLLPUBLIC ViewportDependentPrimitive2D : public BufferedDecompositionPrimitive2D
80 private:
81 /** the last used Viewport definition for decomposition. Since this
82 is checked and updated from get2DDecomposition() it will be current and
83 usable in create2DDecomposition()
85 basegfx::B2DRange maViewport;
87 public:
88 /// constructor
89 ViewportDependentPrimitive2D()
90 : BufferedDecompositionPrimitive2D(),
91 maViewport()
95 /// data read access
96 const basegfx::B2DRange& getViewport() const { return maViewport; }
98 /// Override standard getDecomposition to be view-dependent here
99 virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
101 } // end of namespace primitive2d
102 } // end of namespace drawinglayer
105 namespace drawinglayer
107 namespace primitive2d
109 /** ViewTransformationDependentPrimitive2D class
111 tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
112 regarding the complete Viewtransformation. The implementation of get2DDecomposition
113 guards the buffered local decomposition and ensures that a create2DDecomposition
114 implementation may use an up-to-date ViewTransformation accessible using getViewTransformation()
116 class DRAWINGLAYER_DLLPUBLIC ViewTransformationDependentPrimitive2D : public BufferedDecompositionPrimitive2D
118 private:
119 /** the last used ViewTransformation definition for decomposition. Since this
120 is checked and updated from get2DDecomposition() it will be current and
121 usable in create2DDecomposition()
123 basegfx::B2DHomMatrix maViewTransformation;
125 public:
126 /// constructor
127 ViewTransformationDependentPrimitive2D()
128 : BufferedDecompositionPrimitive2D(),
129 maViewTransformation()
133 /// data read access
134 const basegfx::B2DHomMatrix& getViewTransformation() const { return maViewTransformation; }
136 /// Override standard getDecomposition to be view-dependent here
137 virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
139 } // end of namespace primitive2d
140 } // end of namespace drawinglayer
143 namespace drawinglayer
145 namespace primitive2d
147 /** ObjectAndViewTransformationDependentPrimitive2D class
149 tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
150 and Object-Transform dependent. The implementation of get2DDecomposition
151 guards the buffered local decomposition and ensures that a create2DDecomposition
152 implementation may use an up-to-date ViewTransformation accessible using getViewTransformation()
153 and an object transformation via getObjectTransformation()
155 class DRAWINGLAYER_DLLPUBLIC ObjectAndViewTransformationDependentPrimitive2D : public BufferedDecompositionPrimitive2D
157 private:
158 /** the last used ViewTransformation and the last ObjectTransformation
159 definition for decomposition. Since this is checked and updated from
160 get2DDecomposition() it will be current and usable in create2DDecomposition()
162 basegfx::B2DHomMatrix maViewTransformation;
163 basegfx::B2DHomMatrix maObjectTransformation;
165 public:
166 /// constructor
167 ObjectAndViewTransformationDependentPrimitive2D()
168 : BufferedDecompositionPrimitive2D(),
169 maViewTransformation(),
170 maObjectTransformation()
174 /// data read access
175 const basegfx::B2DHomMatrix& getViewTransformation() const { return maViewTransformation; }
176 const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
178 /// Override standard getDecomposition to be view-dependent here
179 virtual void get2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
181 } // end of namespace primitive2d
182 } // end of namespace drawinglayer
185 #endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVETOOLS2D_HXX
187 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */