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 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX 23 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX 24 25 #include <drawinglayer/drawinglayerdllapi.h> 26 #include <drawinglayer/primitive2d/groupprimitive2d.hxx> 27 28 ////////////////////////////////////////////////////////////////////////////// 29 30 namespace drawinglayer 31 { 32 namespace primitive2d 33 { 34 /** UnifiedTransparencePrimitive2D class 35 36 This primitive encapsualtes a child hierarchy and defines 37 that it shall be visualized with the given transparency. That 38 transparency is unique for all contained geometry, so that 39 e.g. overlapping polygons in the child geometry will not show 40 regions of combined transparency, but be all rendered with the 41 defined, single transparency. 42 */ 43 class DRAWINGLAYER_DLLPUBLIC UnifiedTransparencePrimitive2D : public GroupPrimitive2D 44 { 45 private: 46 /// the unified transparence 47 double mfTransparence; 48 49 public: 50 /// constructor 51 UnifiedTransparencePrimitive2D( 52 const Primitive2DSequence& rChildren, 53 double fTransparence); 54 55 /// data read access getTransparence() const56 double getTransparence() const { return mfTransparence; } 57 58 /// compare operator 59 virtual bool operator==(const BasePrimitive2D& rPrimitive) const; 60 61 /// own getB2DRange implementation to include transparent geometries to BoundRect calculations 62 virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; 63 64 /// create decomposition 65 virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; 66 67 /// provide unique ID 68 DeclPrimitrive2DIDBlock() 69 }; 70 } // end of namespace primitive2d 71 } // end of namespace drawinglayer 72 73 ////////////////////////////////////////////////////////////////////////////// 74 75 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX 76 77 ////////////////////////////////////////////////////////////////////////////// 78 // eof 79