62 m_markerType( aType ),
65 m_scalingFactor( aScalingFactor )
68 VECTOR2I start( point_shape->
x, point_shape->
y );
74 start.
x = std::min( start.
x, point_shape->
x );
75 start.
y = std::min( start.
y, point_shape->
y );
76 end.
x = std::max( end.
x, point_shape->
x );
77 end.
y = std::max( end.
y, point_shape->
y );
96 bool hit = bbox.
Contains( aHitPosition );
116 aPolygon.
Append( corner * aScale );
139 std::vector<VECTOR2I> shape;
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
BASE_SCREEN class implementation.
void SetOrigin(const Vec &pos)
const Vec & GetPosition() const
bool Contains(const Vec &aPoint) const
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
const Vec & GetSize() const
void SetEnd(coord_type x, coord_type y)
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
wxDC * GetPrintDC() const
MARKER_BASE(int aScalingFactor, std::shared_ptr< RC_ITEM > aItem, TYPEMARKER aType=MARKER_UNSPEC)
void PrintMarker(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset)
Print the shape is the polygon defined in m_Corners (array of VECTOR2Is).
bool HitTestMarker(const VECTOR2I &aHitPosition, int aAccuracy) const
Test if the given VECTOR2I is within the bounds of this object.
virtual KIGFX::COLOR4D getColor() const =0
int MarkerScale() const
The scaling factor to convert polygonal shape coordinates to internal units.
VECTOR2I m_Pos
position of the marker
void ShapeToPolygon(SHAPE_LINE_CHAIN &aPolygon, int aScale=-1) const
Return the shape polygon in internal units in a SHAPE_LINE_CHAIN the coordinates are relatives to the...
BOX2I GetBoundingBoxMarker() const
Return the orthogonal, bounding box of this object for display purposes.
bool PointInside(const VECTOR2I &aPt, int aAccuracy=0, bool aUseBBoxCache=false) const
Check if point aP lies inside a polygon (any type) defined by the line chain.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
void SetClosed(bool aClosed)
Mark the line chain as closed (i.e.
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
void GRClosedPoly(wxDC *DC, int n, const VECTOR2I *Points, bool Fill, const COLOR4D &Color)
Draw a closed polyline and fill it if Fill, in object space.
static const VECTOR2I MarkerShapeCorners[]
const unsigned CORNERS_COUNT