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_CUTFINDPROCESSOR3D_HXX
25 #define INCLUDED_DRAWINGLAYER_PROCESSOR3D_CUTFINDPROCESSOR3D_HXX
26 
27 #include <drawinglayer/drawinglayerdllapi.h>
28 #include <drawinglayer/processor3d/defaultprocessor3d.hxx>
29 
30 //////////////////////////////////////////////////////////////////////////////
31 
32 namespace drawinglayer
33 {
34 	namespace processor3d
35 	{
36         /** CutFindProcessor class
37 
38             This processor extracts all cuts of 3D plane geometries in the feeded primitives
39             with the given cut vector, based on the ViewInformation3D given.
40          */
41 		class DRAWINGLAYER_DLLPUBLIC CutFindProcessor : public BaseProcessor3D
42 		{
43 		private:
44             /// the start and stop point for the cut vector
45             basegfx::B3DPoint                       maFront;
46             basegfx::B3DPoint                       maBack;
47 
48             /// the found cut points
49             ::std::vector< basegfx::B3DPoint >      maResult;
50 
51             /*  #i102956# the transformation change from TransformPrimitive3D processings
52                 needs to be remembered to be able to transform found cuts to the
53                 basic coordinate system the processor starts with
54              */
55             basegfx::B3DHomMatrix                   maCombinedTransform;
56 
57             /// bitfield
58             bool                                    mbAnyHit : 1;
59 
60 			/*  this flag decides if primitives which are invisible will be taken into account for
61                 HitTesting or not.
62              */
63 			bool                                    mbUseInvisiblePrimitiveContent : 1;
64 
65             /*  as tooling, the process() implementation takes over API handling and calls this
66 			    virtual render method when the primitive implementation is BasePrimitive3D-based.
67              */
68 			virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
69 
70 		public:
71 			CutFindProcessor(const geometry::ViewInformation3D& rViewInformation,
72                 const basegfx::B3DPoint& rFront,
73                 const basegfx::B3DPoint& rBack,
74                 bool bAnyHit);
75 
76 			/// data write access
setUseInvisiblePrimitiveContent(bool bNew)77 			void setUseInvisiblePrimitiveContent(bool bNew)
78 			{
79 				if((bool)mbUseInvisiblePrimitiveContent != bNew) mbUseInvisiblePrimitiveContent = bNew;
80 			}
81 
82             /// data read access
getCutPoints() const83             const ::std::vector< basegfx::B3DPoint >& getCutPoints() const { return maResult; }
getAnyHit() const84             bool getAnyHit() const { return mbAnyHit; }
getUseInvisiblePrimitiveContent() const85 			bool getUseInvisiblePrimitiveContent() const { return mbUseInvisiblePrimitiveContent;}
86 		};
87 	} // end of namespace processor3d
88 } // end of namespace drawinglayer
89 
90 //////////////////////////////////////////////////////////////////////////////
91 
92 #endif //INCLUDED_DRAWINGLAYER_PROCESSOR3D_CUTFINDPROCESSOR3D_HXX
93 
94 // eof
95