64 m_markerType( aType ),
67 m_scalingFactor( aScalingFactor )
70 VECTOR2I start( point_shape->
x, point_shape->
y );
76 start.
x = std::min( start.
x, point_shape->
x );
77 start.
y = std::min( start.
y, point_shape->
y );
78 end.
x = std::max(
end.
x, point_shape->
x );
79 end.
y = std::max(
end.
y, point_shape->
y );
92 bool hit = bbox.
Contains( aHitPosition );
123 aPolygon.
Append( corner * aScale );
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)
constexpr bool Intersects(const BOX2< Vec > &aRect) const
bool HitTestMarker(const VECTOR2I &aHitPosition, int aAccuracy) const
Test if the given VECTOR2I is within the bounds of this object.
int m_scalingFactor
Scaling factor to convert corners coordinates to internal units coordinates.
int MarkerScale() const
The scaling factor to convert polygonal shape coordinates to internal units.
VECTOR2I m_Pos
Position of the marker.
BOX2I m_shapeBoundingBox
Bounding box of the graphic symbol relative to the position of the shape in marker shape units.
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.
static const VECTOR2I MarkerShapeCorners[]
The graphic shape of markers is a polygon.
const unsigned CORNERS_COUNT
VECTOR2< int32_t > VECTOR2I