1*4f506f19SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*4f506f19SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*4f506f19SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*4f506f19SAndrew Rist  * distributed with this work for additional information
6*4f506f19SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*4f506f19SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*4f506f19SAndrew Rist  * "License"); you may not use this file except in compliance
9*4f506f19SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*4f506f19SAndrew Rist  *
11*4f506f19SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*4f506f19SAndrew Rist  *
13*4f506f19SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*4f506f19SAndrew Rist  * software distributed under the License is distributed on an
15*4f506f19SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*4f506f19SAndrew Rist  * KIND, either express or implied.  See the License for the
17*4f506f19SAndrew Rist  * specific language governing permissions and limitations
18*4f506f19SAndrew Rist  * under the License.
19*4f506f19SAndrew Rist  *
20*4f506f19SAndrew Rist  *************************************************************/
21*4f506f19SAndrew Rist 
22*4f506f19SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MASKPRIMITIVE2D_HXX
25cdf0e10cSrcweir #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MASKPRIMITIVE2D_HXX
26cdf0e10cSrcweir 
27090f0eb8SEike Rathke #include <drawinglayer/drawinglayerdllapi.h>
28cdf0e10cSrcweir #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
29cdf0e10cSrcweir #include <basegfx/polygon/b2dpolypolygon.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
32cdf0e10cSrcweir 
33cdf0e10cSrcweir namespace drawinglayer
34cdf0e10cSrcweir {
35cdf0e10cSrcweir 	namespace primitive2d
36cdf0e10cSrcweir 	{
37cdf0e10cSrcweir         /** MaskPrimitive2D class
38cdf0e10cSrcweir 
39cdf0e10cSrcweir             This is the central masking primitive. It's a grouping
40cdf0e10cSrcweir             primitive and contains a PolyPolygon which defines the visible
41cdf0e10cSrcweir             area. Only visualisation parts of the Child primitive sequence
42cdf0e10cSrcweir             inside of the mask PolyPolygon is defined to be visible.
43cdf0e10cSrcweir 
44cdf0e10cSrcweir             This primitive should be handled by a renderer. If it is not handled,
45cdf0e10cSrcweir             it decomposes to it's Child content, and thus the visualisation would
46cdf0e10cSrcweir             contaiun no clips.
47cdf0e10cSrcweir 
48cdf0e10cSrcweir             The geometrc range of this primitive is completely defined by the Mask
49cdf0e10cSrcweir             PolyPolygon since by definition nothing outside of the mask is visible.
50cdf0e10cSrcweir          */
51090f0eb8SEike Rathke 		class DRAWINGLAYER_DLLPUBLIC MaskPrimitive2D : public GroupPrimitive2D
52cdf0e10cSrcweir 		{
53cdf0e10cSrcweir 		private:
54cdf0e10cSrcweir             /// the mask PolyPolygon
55cdf0e10cSrcweir 			basegfx::B2DPolyPolygon					maMask;
56cdf0e10cSrcweir 
57cdf0e10cSrcweir 		public:
58cdf0e10cSrcweir             /// constructor
59cdf0e10cSrcweir 			MaskPrimitive2D(
60cdf0e10cSrcweir 				const basegfx::B2DPolyPolygon& rMask,
61cdf0e10cSrcweir 				const Primitive2DSequence& rChildren);
62cdf0e10cSrcweir 
63cdf0e10cSrcweir 			/// data read access
getMask() const64cdf0e10cSrcweir 			const basegfx::B2DPolyPolygon& getMask() const { return maMask; }
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 			/// compare operator
67cdf0e10cSrcweir 			virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 			/// get range
70cdf0e10cSrcweir 			virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
71cdf0e10cSrcweir 
72cdf0e10cSrcweir             /// provide unique ID
73cdf0e10cSrcweir 			DeclPrimitrive2DIDBlock()
74cdf0e10cSrcweir 		};
75cdf0e10cSrcweir 	} // end of namespace primitive2d
76cdf0e10cSrcweir } // end of namespace drawinglayer
77cdf0e10cSrcweir 
78cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
79cdf0e10cSrcweir 
80cdf0e10cSrcweir #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MASKPRIMITIVE2D_HXX
81cdf0e10cSrcweir 
82cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
83cdf0e10cSrcweir // eof
84