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