Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVE2DTOOLS_HXX
30 : : #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVE2DTOOLS_HXX
31 : :
32 : : #include <drawinglayer/drawinglayerdllapi.h>
33 : :
34 : : #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
35 : : #include <basegfx/matrix/b2dhommatrix.hxx>
36 : :
37 : : //////////////////////////////////////////////////////////////////////////////
38 : :
39 : : namespace drawinglayer
40 : : {
41 : : namespace primitive2d
42 : : {
43 : : /** DiscreteMetricDependentPrimitive2D class
44 : :
45 : : tooling class for BufferedDecompositionPrimitive2D baseed classes which are view-dependent
46 : : regarding the size of a discrete unit. The implementation of get2DDecomposition
47 : : guards the buffered local decomposition and ensures that a create2DDecomposition
48 : : implementation may use an up-to-date DiscreteUnit accessible using getDiscreteUnit()
49 : : */
50 [ - + ]: 8122 : class DRAWINGLAYER_DLLPUBLIC DiscreteMetricDependentPrimitive2D : public BufferedDecompositionPrimitive2D
51 : : {
52 : : private:
53 : : /** the last used fDiscreteUnit definitions for decomposition. Since this
54 : : is checked and updated from get2DDecomposition() it will be current and
55 : : usable in create2DDecomposition()
56 : : */
57 : : double mfDiscreteUnit;
58 : :
59 : : public:
60 : : /// constructor
61 : 8128 : DiscreteMetricDependentPrimitive2D()
62 : : : BufferedDecompositionPrimitive2D(),
63 : 8128 : mfDiscreteUnit(0.0)
64 : : {
65 : 8128 : }
66 : :
67 : : /// data read access
68 : 41168 : double getDiscreteUnit() const { return mfDiscreteUnit; }
69 : :
70 : : /// get local decomposition. Overloaded since this decomposition is view-dependent
71 : : virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
72 : : };
73 : : } // end of namespace primitive2d
74 : : } // end of namespace drawinglayer
75 : :
76 : : //////////////////////////////////////////////////////////////////////////////
77 : :
78 : : namespace drawinglayer
79 : : {
80 : : namespace primitive2d
81 : : {
82 : : /** ViewportDependentPrimitive2D class
83 : :
84 : : tooling class for BufferedDecompositionPrimitive2D baseed classes which are view-dependent
85 : : regarding the viewport. The implementation of get2DDecomposition
86 : : guards the buffered local decomposition and ensures that a create2DDecomposition
87 : : implementation may use an up-to-date Viewport accessible using getViewport()
88 : : */
89 [ # # ]: 0 : class DRAWINGLAYER_DLLPUBLIC ViewportDependentPrimitive2D : public BufferedDecompositionPrimitive2D
90 : : {
91 : : private:
92 : : /** the last used Viewport definition for decomposition. Since this
93 : : is checked and updated from get2DDecomposition() it will be current and
94 : : usable in create2DDecomposition()
95 : : */
96 : : basegfx::B2DRange maViewport;
97 : :
98 : : public:
99 : : /// constructor
100 : 0 : ViewportDependentPrimitive2D()
101 : : : BufferedDecompositionPrimitive2D(),
102 [ # # ]: 0 : maViewport()
103 : : {
104 : 0 : }
105 : :
106 : : /// data read access
107 : 0 : const basegfx::B2DRange& getViewport() const { return maViewport; }
108 : :
109 : : /// get local decomposition. Overloaded since this decomposition is view-dependent
110 : : virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
111 : : };
112 : : } // end of namespace primitive2d
113 : : } // end of namespace drawinglayer
114 : :
115 : : //////////////////////////////////////////////////////////////////////////////
116 : :
117 : : namespace drawinglayer
118 : : {
119 : : namespace primitive2d
120 : : {
121 : : /** ViewTransformationDependentPrimitive2D class
122 : :
123 : : tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
124 : : regarding the complete Viewtransformation. The implementation of get2DDecomposition
125 : : guards the buffered local decomposition and ensures that a create2DDecomposition
126 : : implementation may use an up-to-date ViewTransformation accessible using getViewTransformation()
127 : : */
128 [ # # ][ # # ]: 0 : class DRAWINGLAYER_DLLPUBLIC ViewTransformationDependentPrimitive2D : public BufferedDecompositionPrimitive2D
129 : : {
130 : : private:
131 : : /** the last used ViewTransformation definition for decomposition. Since this
132 : : is checked and updated from get2DDecomposition() it will be current and
133 : : usable in create2DDecomposition()
134 : : */
135 : : basegfx::B2DHomMatrix maViewTransformation;
136 : :
137 : : public:
138 : : /// constructor
139 : 0 : ViewTransformationDependentPrimitive2D()
140 : : : BufferedDecompositionPrimitive2D(),
141 [ # # ]: 0 : maViewTransformation()
142 : : {
143 : 0 : }
144 : :
145 : : /// data read access
146 : 0 : const basegfx::B2DHomMatrix& getViewTransformation() const { return maViewTransformation; }
147 : :
148 : : /// get local decomposition. Overloaded since this decomposition is view-dependent
149 : : virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
150 : : };
151 : : } // end of namespace primitive2d
152 : : } // end of namespace drawinglayer
153 : :
154 : : //////////////////////////////////////////////////////////////////////////////
155 : :
156 : : namespace drawinglayer
157 : : {
158 : : namespace primitive2d
159 : : {
160 : : /** ObjectAndViewTransformationDependentPrimitive2D class
161 : :
162 : : tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
163 : : and Object-Transform dependent. The implementation of get2DDecomposition
164 : : guards the buffered local decomposition and ensures that a create2DDecomposition
165 : : implementation may use an up-to-date ViewTransformation accessible using getViewTransformation()
166 : : and an object transformation via getObjectTransformation()
167 : : */
168 [ # # ][ # # ]: 0 : class DRAWINGLAYER_DLLPUBLIC ObjectAndViewTransformationDependentPrimitive2D : public BufferedDecompositionPrimitive2D
[ # # ]
169 : : {
170 : : private:
171 : : /** the last used ViewTransformation and the last ObjectTransformation
172 : : definition for decomposition. Since this is checked and updated from
173 : : get2DDecomposition() it will be current and usable in create2DDecomposition()
174 : : */
175 : : basegfx::B2DHomMatrix maViewTransformation;
176 : : basegfx::B2DHomMatrix maObjectTransformation;
177 : :
178 : : public:
179 : : /// constructor
180 : 0 : ObjectAndViewTransformationDependentPrimitive2D()
181 : : : BufferedDecompositionPrimitive2D(),
182 : : maViewTransformation(),
183 [ # # ][ # # ]: 0 : maObjectTransformation()
184 : : {
185 : 0 : }
186 : :
187 : : /// data read access
188 : 0 : const basegfx::B2DHomMatrix& getViewTransformation() const { return maViewTransformation; }
189 : 0 : const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
190 : :
191 : : /// get local decomposition. Overloaded since this decomposition is view-dependent
192 : : virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
193 : : };
194 : : } // end of namespace primitive2d
195 : : } // end of namespace drawinglayer
196 : :
197 : : //////////////////////////////////////////////////////////////////////////////
198 : :
199 : : #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_PRIMITIVE2DTOOLS_HXX
200 : :
201 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|