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/processor3d/baseprocessor3d.hxx>
32 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
33 #include <basegfx/matrix/b2dhommatrix.hxx>
34 #include <basegfx/matrix/b3dhommatrix.hxx>
35 #include <basegfx/color/bcolormodifier.hxx>
36 
37 //////////////////////////////////////////////////////////////////////////////
38 
39 namespace drawinglayer
40 {
41 	namespace processor3d
42 	{
43         /** Geometry2DExtractingProcessor class
44 
45             This processor extracts the 2D geometry (projected geometry) of all feeded primitives.
46             It is e.g. used as sub-processor for contour extraction where 3D geometry is only
47             useful as 2D projected geometry.
48          */
49 		class Geometry2DExtractingProcessor : public BaseProcessor3D
50 		{
51 		private:
52 			/// result holding vector (2D)
53 			primitive2d::Primitive2DSequence				maPrimitive2DSequence;
54 
55 			/// object transformation for scene for 2d definition
56 			basegfx::B2DHomMatrix							maObjectTransformation;
57 
58 			/// the modifiedColorPrimitive stack
59 			basegfx::BColorModifierStack					maBColorModifierStack;
60 
61 			/*  as tooling, the process() implementation takes over API handling and calls this
62 			    virtual render method when the primitive implementation is BasePrimitive3D-based.
63              */
64 			virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
65 
66 		public:
67 			Geometry2DExtractingProcessor(
68 				const geometry::ViewInformation3D& rViewInformation,
69 				const basegfx::B2DHomMatrix& rObjectTransformation);
70 
71 			// data read access
72 			const primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; }
73 			const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
74 			const basegfx::BColorModifierStack& getBColorModifierStack() const { return maBColorModifierStack; }
75 		};
76 	} // end of namespace processor3d
77 } // end of namespace drawinglayer
78 
79 #endif //INCLUDED_DRAWINGLAYER_PROCESSOR3D_GEOMETRY2DEXTRACTOR_HXX
80 
81 // eof
82