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 );
95 bool hit = bbox.
Contains( aHitPosition );
115 aPolygon.
Append( corner * aScale );
138 std::vector<VECTOR2I> shape;
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
BASE_SCREEN class implementation.
constexpr const Vec & GetPosition() const
constexpr void SetOrigin(const Vec &pos)
constexpr bool Contains(const Vec &aPoint) const
constexpr BOX2< Vec > GetInflated(coord_type aDx, coord_type aDy) const
Get a new rectangle that is this one, inflated by aDx and aDy.
constexpr const SizeVec & GetSize() const
constexpr 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
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...
MARKER_BASE(int aScalingFactor, std::shared_ptr< RC_ITEM > aItem, MARKER_T aType=MARKER_UNSPEC)
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 override
Check if point aP lies inside a closed shape.
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
VECTOR2< int32_t > VECTOR2I