nss: upgrade to release 3.73
[LibreOffice.git] / include / drawinglayer / primitive2d / primitivetools2d.hxx
blobdb22a59b0eee766f967d422f898c2d5207e5008b
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 #pragma once
22 #include <drawinglayer/drawinglayerdllapi.h>
24 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
25 #include <basegfx/matrix/b2dhommatrix.hxx>
28 namespace drawinglayer::primitive2d
30 /** DiscreteMetricDependentPrimitive2D class
32 tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
33 regarding the size of a discrete unit. The implementation of get2DDecomposition
34 guards the buffered local decomposition and ensures that a create2DDecomposition
35 implementation may use an up-to-date DiscreteUnit accessible using getDiscreteUnit()
37 class DRAWINGLAYER_DLLPUBLIC DiscreteMetricDependentPrimitive2D : public BufferedDecompositionPrimitive2D
39 private:
40 /** the last used fDiscreteUnit definitions for decomposition. Since this
41 is checked and updated from get2DDecomposition() it will be current and
42 usable in create2DDecomposition()
44 double mfDiscreteUnit;
46 public:
47 /// constructor
48 DiscreteMetricDependentPrimitive2D()
49 : BufferedDecompositionPrimitive2D(),
50 mfDiscreteUnit(0.0)
54 /// data read access
55 double getDiscreteUnit() const { return mfDiscreteUnit; }
57 /// Override standard getDecomposition to be view-dependent here
58 virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override;
61 /** ViewportDependentPrimitive2D class
63 tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
64 regarding the viewport. The implementation of get2DDecomposition
65 guards the buffered local decomposition and ensures that a create2DDecomposition
66 implementation may use an up-to-date Viewport accessible using getViewport()
68 class DRAWINGLAYER_DLLPUBLIC ViewportDependentPrimitive2D : public BufferedDecompositionPrimitive2D
70 private:
71 /** the last used Viewport definition for decomposition. Since this
72 is checked and updated from get2DDecomposition() it will be current and
73 usable in create2DDecomposition()
75 basegfx::B2DRange maViewport;
77 public:
78 /// constructor
79 ViewportDependentPrimitive2D()
80 : BufferedDecompositionPrimitive2D(),
81 maViewport()
85 /// data read access
86 const basegfx::B2DRange& getViewport() const { return maViewport; }
88 /// Override standard getDecomposition to be view-dependent here
89 virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override;
92 /** ViewTransformationDependentPrimitive2D class
94 tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
95 regarding the complete Viewtransformation. The implementation of get2DDecomposition
96 guards the buffered local decomposition and ensures that a create2DDecomposition
97 implementation may use an up-to-date ViewTransformation accessible using getViewTransformation()
99 class DRAWINGLAYER_DLLPUBLIC ViewTransformationDependentPrimitive2D : public BufferedDecompositionPrimitive2D
101 private:
102 /** the last used ViewTransformation definition for decomposition. Since this
103 is checked and updated from get2DDecomposition() it will be current and
104 usable in create2DDecomposition()
106 basegfx::B2DHomMatrix maViewTransformation;
108 public:
109 /// constructor
110 ViewTransformationDependentPrimitive2D()
111 : BufferedDecompositionPrimitive2D(),
112 maViewTransformation()
116 /// data read access
117 const basegfx::B2DHomMatrix& getViewTransformation() const { return maViewTransformation; }
119 /// Override standard getDecomposition to be view-dependent here
120 virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override;
123 /** ObjectAndViewTransformationDependentPrimitive2D class
125 tooling class for BufferedDecompositionPrimitive2D based classes which are view-dependent
126 and Object-Transform dependent. The implementation of get2DDecomposition
127 guards the buffered local decomposition and ensures that a create2DDecomposition
128 implementation may use an up-to-date ViewTransformation accessible using getViewTransformation()
129 and an object transformation via getObjectTransformation()
131 class DRAWINGLAYER_DLLPUBLIC ObjectAndViewTransformationDependentPrimitive2D : public BufferedDecompositionPrimitive2D
133 private:
134 /** the last used ViewTransformation and the last ObjectTransformation
135 definition for decomposition. Since this is checked and updated from
136 get2DDecomposition() it will be current and usable in create2DDecomposition()
138 basegfx::B2DHomMatrix maViewTransformation;
139 basegfx::B2DHomMatrix maObjectTransformation;
141 public:
142 /// constructor
143 ObjectAndViewTransformationDependentPrimitive2D()
144 : BufferedDecompositionPrimitive2D(),
145 maViewTransformation(),
146 maObjectTransformation()
150 /// data read access
151 const basegfx::B2DHomMatrix& getViewTransformation() const { return maViewTransformation; }
152 const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
154 /// Override standard getDecomposition to be view-dependent here
155 virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override;
157 } // end of namespace drawinglayer::primitive2d
159 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */