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