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