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_POINTARRAYPRIMITIVE2D_HXX 25 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POINTARRAYPRIMITIVE2D_HXX 26 27 #include <drawinglayer/drawinglayerdllapi.h> 28 #include <drawinglayer/primitive2d/baseprimitive2d.hxx> 29 #include <basegfx/color/bcolor.hxx> 30 31 ////////////////////////////////////////////////////////////////////////////// 32 // PointArrayPrimitive2D class 33 34 namespace drawinglayer 35 { 36 namespace primitive2d 37 { 38 /** PointArrayPrimitive2D class 39 40 This primitive defines single,discrete 'pixels' for the given 41 positions in the given color. This makes it view-dependent since 42 the logic size of a 'pixel' depends on the view transformation. 43 44 This is one of the non-decomposable primitives, so a renderer 45 should proccess it (Currently it is only used for grid visualisation, 46 but this may change). 47 */ 48 class DRAWINGLAYER_DLLPUBLIC PointArrayPrimitive2D : public BasePrimitive2D 49 { 50 private: 51 /// the array of positions 52 std::vector< basegfx::B2DPoint > maPositions; 53 54 /// the color to use 55 basegfx::BColor maRGBColor; 56 57 /// #i96669# add simple range buffering for this primitive 58 basegfx::B2DRange maB2DRange; 59 60 public: 61 /// constructor 62 PointArrayPrimitive2D( 63 const std::vector< basegfx::B2DPoint >& rPositions, 64 const basegfx::BColor& rRGBColor); 65 66 /// data read access getPositions() const67 const std::vector< basegfx::B2DPoint >& getPositions() const { return maPositions; } getRGBColor() const68 const basegfx::BColor& getRGBColor() const { return maRGBColor; } 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_POINTARRAYPRIMITIVE2D_HXX 85 86 ////////////////////////////////////////////////////////////////////////////// 87 // eof 88