54 m_rect(
std::
move( aRect ) ), m_radius( aRadius )
58 throw std::invalid_argument(
59 "Roundrect radius is larger than the rectangle's major dimension" );
64 throw std::invalid_argument(
"Roundrect radius must be non-negative" );
92 wxASSERT( x_edge >= 0 );
93 wxASSERT( y_edge >= 0 );
106 else if( x_edge == 0 && y_edge == 0 )
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
Directions
Available directions, there are 8 of them, as on a rectilinear map (north = up) + an extra undefined ...
A round rectangle shape, based on a rectangle and a radius.
static ROUNDRECT OutsetFrom(const SHAPE_RECT &aRect, int aOutset)
ROUNDRECT GetInflated(int aOutset) const
Get the roundrect with the size increased by aOutset in all directions.
void TransformToPolygon(SHAPE_POLY_SET &aBuffer, int aError, ERROR_LOC aErrorLoc) const
Get the polygonal representation of the roundrect.
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.
Represent a set of closed polygons.
SHAPE_LINE_CHAIN & Outline(int aIndex)
Return the reference to aIndex-th outline in the set.
int NewOutline()
Creates a new empty polygon in the set and returns its index.
SHAPE_RECT GetInflated(int aOffset) const
Return a rectangle that is larger by aOffset in all directions, but still centered on the original re...
const VECTOR2I & GetPosition() const
int MajorDimension() const
static constexpr EDA_ANGLE ANGLE_360
VECTOR2I GetPoint(const SHAPE_RECT &aRect, DIRECTION_45::Directions aDir, int aOutset=0)
Get the point on a rectangle that corresponds to a given direction.
SHAPE_ARC MakeArcCw180(const VECTOR2I &aCenter, int aRadius, DIRECTION_45::Directions aDir)
Get a SHAPE_ARC representing a 180-degree arc in the clockwise direction with the midpoint in the giv...
SHAPE_ARC MakeArcCw90(const VECTOR2I &aCenter, int aRadius, DIRECTION_45::Directions aDir)
Get a SHAPE_ARC representing a 90-degree arc in the clockwise direction with the midpoint in the give...
Utility functions for working with shapes.
VECTOR2< int32_t > VECTOR2I