xref: /AOO42X/main/drawinglayer/inc/drawinglayer/processor3d/geometry2dextractor.hxx (revision e1d5bd03a6ea7ac2b26b792c9e2a94e9f347a43b)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_GEOMETRY2DEXTRACTOR_HXX
29 #define INCLUDED_DRAWINGLAYER_PROCESSOR3D_GEOMETRY2DEXTRACTOR_HXX
30 
31 #include <drawinglayer/drawinglayerdllapi.h>
32 #include <drawinglayer/processor3d/baseprocessor3d.hxx>
33 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
34 #include <basegfx/matrix/b2dhommatrix.hxx>
35 #include <basegfx/matrix/b3dhommatrix.hxx>
36 #include <basegfx/color/bcolormodifier.hxx>
37 
38 //////////////////////////////////////////////////////////////////////////////
39 
40 namespace drawinglayer
41 {
42     namespace processor3d
43     {
44         /** Geometry2DExtractingProcessor class
45 
46             This processor extracts the 2D geometry (projected geometry) of all feeded primitives.
47             It is e.g. used as sub-processor for contour extraction where 3D geometry is only
48             useful as 2D projected geometry.
49          */
50         class DRAWINGLAYER_DLLPUBLIC Geometry2DExtractingProcessor : public BaseProcessor3D
51         {
52         private:
53             /// result holding vector (2D)
54             primitive2d::Primitive2DSequence                maPrimitive2DSequence;
55 
56             /// object transformation for scene for 2d definition
57             basegfx::B2DHomMatrix                           maObjectTransformation;
58 
59             /// the modifiedColorPrimitive stack
60             basegfx::BColorModifierStack                    maBColorModifierStack;
61 
62             /*  as tooling, the process() implementation takes over API handling and calls this
63                 virtual render method when the primitive implementation is BasePrimitive3D-based.
64              */
65             virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
66 
67         public:
68             Geometry2DExtractingProcessor(
69                 const geometry::ViewInformation3D& rViewInformation,
70                 const basegfx::B2DHomMatrix& rObjectTransformation);
71 
72             // data read access
73             const primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; }
74             const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
75             const basegfx::BColorModifierStack& getBColorModifierStack() const { return maBColorModifierStack; }
76         };
77     } // end of namespace processor3d
78 } // end of namespace drawinglayer
79 
80 #endif //INCLUDED_DRAWINGLAYER_PROCESSOR3D_GEOMETRY2DEXTRACTOR_HXX
81 
82 // eof
83