xref: /AOO41X/main/drawinglayer/inc/drawinglayer/primitive2d/maskprimitive2d.hxx (revision 6da5f31158a7dd09f46f041b4f15bb7ae3eb92a4)
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_PRIMITIVE2D_MASKPRIMITIVE2D_HXX
29 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MASKPRIMITIVE2D_HXX
30 
31 #include <drawinglayer/drawinglayerdllapi.h>
32 #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
33 #include <basegfx/polygon/b2dpolypolygon.hxx>
34 
35 //////////////////////////////////////////////////////////////////////////////
36 
37 namespace drawinglayer
38 {
39 	namespace primitive2d
40 	{
41         /** MaskPrimitive2D class
42 
43             This is the central masking primitive. It's a grouping
44             primitive and contains a PolyPolygon which defines the visible
45             area. Only visualisation parts of the Child primitive sequence
46             inside of the mask PolyPolygon is defined to be visible.
47 
48             This primitive should be handled by a renderer. If it is not handled,
49             it decomposes to it's Child content, and thus the visualisation would
50             contaiun no clips.
51 
52             The geometrc range of this primitive is completely defined by the Mask
53             PolyPolygon since by definition nothing outside of the mask is visible.
54          */
55 		class DRAWINGLAYER_DLLPUBLIC MaskPrimitive2D : public GroupPrimitive2D
56 		{
57 		private:
58             /// the mask PolyPolygon
59 			basegfx::B2DPolyPolygon					maMask;
60 
61 		public:
62             /// constructor
63 			MaskPrimitive2D(
64 				const basegfx::B2DPolyPolygon& rMask,
65 				const Primitive2DSequence& rChildren);
66 
67 			/// data read access
68 			const basegfx::B2DPolyPolygon& getMask() const { return maMask; }
69 
70 			/// compare operator
71 			virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
72 
73 			/// get range
74 			virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
75 
76             /// provide unique ID
77 			DeclPrimitrive2DIDBlock()
78 		};
79 	} // end of namespace primitive2d
80 } // end of namespace drawinglayer
81 
82 //////////////////////////////////////////////////////////////////////////////
83 
84 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MASKPRIMITIVE2D_HXX
85 
86 //////////////////////////////////////////////////////////////////////////////
87 // eof
88