1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef INCLUDED_DRAWINGLAYER_PROCESSOR3D_GEOMETRY2DEXTRACTOR_HXX 25 #define INCLUDED_DRAWINGLAYER_PROCESSOR3D_GEOMETRY2DEXTRACTOR_HXX 26 27 #include <drawinglayer/drawinglayerdllapi.h> 28 #include <drawinglayer/processor3d/baseprocessor3d.hxx> 29 #include <drawinglayer/primitive2d/baseprimitive2d.hxx> 30 #include <basegfx/matrix/b2dhommatrix.hxx> 31 #include <basegfx/matrix/b3dhommatrix.hxx> 32 #include <basegfx/color/bcolormodifier.hxx> 33 34 ////////////////////////////////////////////////////////////////////////////// 35 36 namespace drawinglayer 37 { 38 namespace processor3d 39 { 40 /** Geometry2DExtractingProcessor class 41 42 This processor extracts the 2D geometry (projected geometry) of all feeded primitives. 43 It is e.g. used as sub-processor for contour extraction where 3D geometry is only 44 useful as 2D projected geometry. 45 */ 46 class DRAWINGLAYER_DLLPUBLIC Geometry2DExtractingProcessor : public BaseProcessor3D 47 { 48 private: 49 /// result holding vector (2D) 50 primitive2d::Primitive2DSequence maPrimitive2DSequence; 51 52 /// object transformation for scene for 2d definition 53 basegfx::B2DHomMatrix maObjectTransformation; 54 55 /// the modifiedColorPrimitive stack 56 basegfx::BColorModifierStack maBColorModifierStack; 57 58 /* as tooling, the process() implementation takes over API handling and calls this 59 virtual render method when the primitive implementation is BasePrimitive3D-based. 60 */ 61 virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate); 62 63 public: 64 Geometry2DExtractingProcessor( 65 const geometry::ViewInformation3D& rViewInformation, 66 const basegfx::B2DHomMatrix& rObjectTransformation); 67 68 // data read access getPrimitive2DSequence() const69 const primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; } getObjectTransformation() const70 const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; } getBColorModifierStack() const71 const basegfx::BColorModifierStack& getBColorModifierStack() const { return maBColorModifierStack; } 72 }; 73 } // end of namespace processor3d 74 } // end of namespace drawinglayer 75 76 #endif //INCLUDED_DRAWINGLAYER_PROCESSOR3D_GEOMETRY2DEXTRACTOR_HXX 77 78 // eof 79