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