1*4bfbcde8SAndrew Rist /**************************************************************
2*4bfbcde8SAndrew Rist  *
3*4bfbcde8SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*4bfbcde8SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*4bfbcde8SAndrew Rist  * distributed with this work for additional information
6*4bfbcde8SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*4bfbcde8SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*4bfbcde8SAndrew Rist  * "License"); you may not use this file except in compliance
9*4bfbcde8SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*4bfbcde8SAndrew Rist  *
11*4bfbcde8SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*4bfbcde8SAndrew Rist  *
13*4bfbcde8SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*4bfbcde8SAndrew Rist  * software distributed under the License is distributed on an
15*4bfbcde8SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*4bfbcde8SAndrew Rist  * KIND, either express or implied.  See the License for the
17*4bfbcde8SAndrew Rist  * specific language governing permissions and limitations
18*4bfbcde8SAndrew Rist  * under the License.
19*4bfbcde8SAndrew Rist  *
20*4bfbcde8SAndrew Rist  *************************************************************/
21cdf0e10cSrcweir 
22cdf0e10cSrcweir #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX
23cdf0e10cSrcweir #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX
24cdf0e10cSrcweir 
25090f0eb8SEike Rathke #include <drawinglayer/drawinglayerdllapi.h>
26cdf0e10cSrcweir #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
27cdf0e10cSrcweir 
28cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
29cdf0e10cSrcweir 
30cdf0e10cSrcweir namespace drawinglayer
31cdf0e10cSrcweir {
32cdf0e10cSrcweir 	namespace primitive2d
33cdf0e10cSrcweir 	{
34cdf0e10cSrcweir         /** UnifiedTransparencePrimitive2D class
35cdf0e10cSrcweir 
36cdf0e10cSrcweir             This primitive encapsualtes a child hierarchy and defines
37cdf0e10cSrcweir             that it shall be visualized with the given transparency. That
38cdf0e10cSrcweir             transparency is unique for all contained geometry, so that
39cdf0e10cSrcweir             e.g. overlapping polygons in the child geometry will not show
40cdf0e10cSrcweir             regions of combined transparency, but be all rendered with the
41cdf0e10cSrcweir             defined, single transparency.
42cdf0e10cSrcweir          */
43090f0eb8SEike Rathke 		class DRAWINGLAYER_DLLPUBLIC UnifiedTransparencePrimitive2D : public GroupPrimitive2D
44cdf0e10cSrcweir 		{
45cdf0e10cSrcweir 		private:
46cdf0e10cSrcweir             /// the unified transparence
47cdf0e10cSrcweir 			double								mfTransparence;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 		public:
50cdf0e10cSrcweir             /// constructor
51cdf0e10cSrcweir 			UnifiedTransparencePrimitive2D(
52cdf0e10cSrcweir 				const Primitive2DSequence& rChildren,
53cdf0e10cSrcweir 				double fTransparence);
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 			/// data read access
getTransparence() const56cdf0e10cSrcweir 			double getTransparence() const { return mfTransparence; }
57cdf0e10cSrcweir 
58cdf0e10cSrcweir 			/// compare operator
59cdf0e10cSrcweir 			virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 			/// own getB2DRange implementation to include transparent geometries to BoundRect calculations
62cdf0e10cSrcweir 			virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
63cdf0e10cSrcweir 
64cdf0e10cSrcweir             /// create decomposition
65cdf0e10cSrcweir 			virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
66cdf0e10cSrcweir 
67cdf0e10cSrcweir 			/// provide unique ID
68cdf0e10cSrcweir 			DeclPrimitrive2DIDBlock()
69cdf0e10cSrcweir 		};
70cdf0e10cSrcweir 	} // end of namespace primitive2d
71cdf0e10cSrcweir } // end of namespace drawinglayer
72cdf0e10cSrcweir 
73cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
74cdf0e10cSrcweir 
75cdf0e10cSrcweir #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX
76cdf0e10cSrcweir 
77cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
78cdf0e10cSrcweir // eof
79