summaryrefslogtreecommitdiff
path: root/include/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'include/drawinglayer/primitive2d/polypolygonprimitive2d.hxx')
-rw-r--r--include/drawinglayer/primitive2d/polypolygonprimitive2d.hxx65
1 files changed, 65 insertions, 0 deletions
diff --git a/include/drawinglayer/primitive2d/polypolygonprimitive2d.hxx b/include/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
index 0679ce4deb8c..4afb5edf501d 100644
--- a/include/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
@@ -30,6 +30,7 @@
#include <drawinglayer/attribute/linestartendattribute.hxx>
#include <drawinglayer/attribute/fillgradientattribute.hxx>
#include <drawinglayer/attribute/fillhatchattribute.hxx>
+#include <drawinglayer/primitive2d/primitivetools2d.hxx>
#include <basegfx/color/bcolor.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -376,6 +377,70 @@ namespace drawinglayer
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
+// PolyPolygonSelectionPrimitive2D class
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** PolyPolygonSelectionPrimitive2D class
+
+ This primitive defines a PolyPolygon which gets filled with a defined color
+ and a defined transparence, but also gets extended ('grown') by the given
+ discrete size (thus being a view-dependent primitive)
+ */
+ class DRAWINGLAYER_DLLPUBLIC PolyPolygonSelectionPrimitive2D : public DiscreteMetricDependentPrimitive2D
+ {
+ private:
+ /// the PolyPolygon geometry
+ basegfx::B2DPolyPolygon maPolyPolygon;
+
+ /// the color
+ basegfx::BColor maColor;
+
+ /// the transparence [0.0 .. 1.0]
+ double mfTransparence;
+
+ /// the discrete grow size ('pixels'), only posivive values allowed
+ double mfDiscreteGrow;
+
+ /// bitfield
+ /// draw polygons filled when fill is set
+ bool mbFill : 1;
+
+ protected:
+ /// local decomposition.
+ virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ public:
+ /// constructor
+ PolyPolygonSelectionPrimitive2D(
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const basegfx::BColor& rColor,
+ double fTransparence,
+ double fDiscreteGrow,
+ bool bFill);
+
+ /// data read access
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
+ const basegfx::BColor& getColor() const { return maColor; }
+ double getTransparence() const { return mfTransparence; }
+ double getDiscreteGrow() const { return mfDiscreteGrow; }
+ bool getFill() const { return mbFill; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// get range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX