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