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_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX 29 #define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX 30 31 #include <drawinglayer/drawinglayerdllapi.h> 32 #include <drawinglayer/primitive3d/textureprimitive3d.hxx> 33 #include <drawinglayer/attribute/fillhatchattribute.hxx> 34 35 ////////////////////////////////////////////////////////////////////////////// 36 37 namespace drawinglayer 38 { 39 namespace primitive3d 40 { 41 /** HatchTexturePrimitive3D class 42 43 HatchTexturePrimitive3D is derived from GroupPrimitive3D, but implements 44 a decomposition which is complicated enough for buffering. Since the group 45 primitive has no default buffering, it is necessary here to add a local 46 buffering mechanism for the decomposition 47 */ 48 class DRAWINGLAYER_DLLPUBLIC HatchTexturePrimitive3D : public TexturePrimitive3D 49 { 50 private: 51 /// the hatch definition 52 attribute::FillHatchAttribute maHatch; 53 54 /// the buffered decomposed hatch 55 Primitive3DSequence maBuffered3DDecomposition; 56 57 protected: 58 /// helper: local decomposition 59 Primitive3DSequence impCreate3DDecomposition() const; 60 61 /// local access methods to maBufferedDecomposition 62 const Primitive3DSequence& getBuffered3DDecomposition() const { return maBuffered3DDecomposition; } 63 void setBuffered3DDecomposition(const Primitive3DSequence& rNew) { maBuffered3DDecomposition = rNew; } 64 65 public: 66 /// constructor 67 HatchTexturePrimitive3D( 68 const attribute::FillHatchAttribute& rHatch, 69 const Primitive3DSequence& rChildren, 70 const basegfx::B2DVector& rTextureSize, 71 bool bModulate, 72 bool bFilter); 73 74 /// data read access 75 const attribute::FillHatchAttribute& getHatch() const { return maHatch; } 76 77 /// compare operator 78 virtual bool operator==(const BasePrimitive3D& rPrimitive) const; 79 80 /// local decomposition. 81 virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const; 82 83 /// provide unique ID 84 DeclPrimitrive3DIDBlock() 85 }; 86 } // end of namespace primitive3d 87 } // end of namespace drawinglayer 88 89 ////////////////////////////////////////////////////////////////////////////// 90 91 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX 92 93 ////////////////////////////////////////////////////////////////////////////// 94 // eof 95