43 m_endsSwapped( false ),
48 m_rectangleHeight( 0 ),
49 m_rectangleWidth( 0 ),
68 case SHAPE_T::SEGMENT:
return _(
"Thermal Spoke" );
69 case SHAPE_T::RECTANGLE:
return _(
"Number Box" );
70 default:
return wxT(
"??" );
77 case SHAPE_T::SEGMENT:
return _(
"Line" );
78 case SHAPE_T::RECTANGLE:
return _(
"Rect" );
79 case SHAPE_T::ARC:
return _(
"Arc" );
80 case SHAPE_T::CIRCLE:
return _(
"Circle" );
81 case SHAPE_T::BEZIER:
return _(
"Bezier Curve" );
82 case SHAPE_T::POLY:
return _(
"Polygon" );
83 default:
return wxT(
"??" );
93 case SHAPE_T::SEGMENT:
return wxS(
"S_SEGMENT" );
94 case SHAPE_T::RECTANGLE:
return wxS(
"S_RECT" );
95 case SHAPE_T::ARC:
return wxS(
"S_ARC" );
96 case SHAPE_T::CIRCLE:
return wxS(
"S_CIRCLE" );
97 case SHAPE_T::POLY:
return wxS(
"S_POLYGON" );
98 case SHAPE_T::BEZIER:
return wxS(
"S_CURVE" );
99 case SHAPE_T::UNDEFINED:
return wxS(
"UNDEFINED" );
102 return wxEmptyString;
116 else if(
m_shape == SHAPE_T::POLY )
129 case SHAPE_T::BEZIER:
135 case SHAPE_T::SEGMENT:
157 case SHAPE_T::RECTANGLE:
170 case SHAPE_T::RECTANGLE:
183 case SHAPE_T::SEGMENT:
195 case SHAPE_T::RECTANGLE:
209 case SHAPE_T::RECTANGLE:
223 case SHAPE_T::RECTANGLE:
238 case SHAPE_T::SEGMENT:
251 case SHAPE_T::CIRCLE:
252 case SHAPE_T::RECTANGLE:
256 case SHAPE_T::SEGMENT:
265 case SHAPE_T::BEZIER:
287 case SHAPE_T::SEGMENT:
288 case SHAPE_T::RECTANGLE:
289 case SHAPE_T::CIRCLE:
291 m_end += aMoveVector;
298 case SHAPE_T::BEZIER:
300 m_end += aMoveVector;
320 pt.x =
KiROUND( pt.x * aScale );
321 pt.y =
KiROUND( pt.y * aScale );
330 case SHAPE_T::SEGMENT:
331 case SHAPE_T::RECTANGLE:
336 case SHAPE_T::CIRCLE:
344 std::vector<VECTOR2I> pts;
350 pts.emplace_back( pt );
351 scalePt( pts.back() );
359 case SHAPE_T::BEZIER:
378 case SHAPE_T::SEGMENT:
379 case SHAPE_T::CIRCLE:
390 case SHAPE_T::RECTANGLE:
413 case SHAPE_T::BEZIER:
435 case SHAPE_T::SEGMENT:
436 case SHAPE_T::RECTANGLE:
449 case SHAPE_T::CIRCLE:
480 m_poly.
Mirror( aFlipLeftRight, !aFlipLeftRight, aCentre );
483 case SHAPE_T::BEZIER:
512 if(
m_shape != SHAPE_T::BEZIER )
525 std::vector<VECTOR2I> bezierPoints;
530 converter.
GetPoly( bezierPoints, aMaxError );
543 case SHAPE_T::CIRCLE:
546 case SHAPE_T::SEGMENT:
551 case SHAPE_T::RECTANGLE:
552 case SHAPE_T::BEZIER:
570 case SHAPE_T::CIRCLE:
602 if( aEndAngle == aStartAngle )
605 while( aEndAngle < aStartAngle )
620 case SHAPE_T::CIRCLE:
629 return std::max( 1,
KiROUND( radius ) );
687 return endAngle - startAngle;
715 if( aCheckNegativeAngle && aAngle <
ANGLE_0 )
729 case SHAPE_T::RECTANGLE:
return _(
"Pad Number Box" );
730 case SHAPE_T::SEGMENT:
return _(
"Thermal Spoke Template" );
731 default:
return _(
"Unrecognized" );
738 case SHAPE_T::CIRCLE:
return _(
"Circle" );
739 case SHAPE_T::ARC:
return _(
"Arc" );
740 case SHAPE_T::BEZIER:
return _(
"Curve" );
741 case SHAPE_T::POLY:
return _(
"Polygon" );
742 case SHAPE_T::RECTANGLE:
return _(
"Rectangle" );
743 case SHAPE_T::SEGMENT:
return _(
"Segment" );
744 default:
return _(
"Unrecognized" );
754 wxString shape =
_(
"Shape" );
759 case SHAPE_T::CIRCLE:
765 aList.emplace_back(
_(
"Angle" ), msg );
770 case SHAPE_T::BEZIER:
775 msg.Printf( wxS(
"%d" ),
GetPolyShape().Outline(0).PointCount() );
776 aList.emplace_back(
_(
"Points" ), msg );
779 case SHAPE_T::RECTANGLE:
780 aList.emplace_back(
_(
"Width" ),
783 aList.emplace_back(
_(
"Height" ),
787 case SHAPE_T::SEGMENT:
789 aList.emplace_back(
_(
"Length" ),
813 case SHAPE_T::RECTANGLE:
819 case SHAPE_T::SEGMENT:
824 case SHAPE_T::CIRCLE:
842 case SHAPE_T::BEZIER:
863 double maxdist = aAccuracy;
870 case SHAPE_T::CIRCLE:
876 return dist <= radius + maxdist;
878 return abs( radius - dist ) <= maxdist;
896 if( dist > radius + maxdist )
902 if( abs( radius - dist ) > maxdist )
917 if( endAngle > startAngle )
918 return relPosAngle >= startAngle && relPosAngle <= endAngle;
920 return relPosAngle >= startAngle || relPosAngle <= endAngle;
923 case SHAPE_T::BEZIER:
926 std::vector<VECTOR2I> updatedBezierPoints;
931 converter.
GetPoly( updatedBezierPoints, aAccuracy / 2 );
932 pts = &updatedBezierPoints;
935 for(
unsigned int i = 1; i < pts->size(); i++ )
937 if(
TestSegmentHit( aPosition, ( *pts )[i - 1], ( *pts )[i], maxdist ) )
943 case SHAPE_T::SEGMENT:
946 case SHAPE_T::RECTANGLE:
955 return poly.
Collide( aPosition, maxdist );
973 copy.Outline( 0 ).Append(
copy.Outline( 0 ).CPoint( 0 ) );
974 return copy.Collide( aPosition, maxdist );
1003 case SHAPE_T::CIRCLE:
1042 case SHAPE_T::RECTANGLE:
1059 case SHAPE_T::SEGMENT:
1091 for(
int jj = 0; jj < count; jj++ )
1099 if( jj + 1 < count )
1121 case SHAPE_T::BEZIER:
1136 std::vector<VECTOR2I> updatedBezierPoints;
1141 converter.
GetPoly( updatedBezierPoints, aAccuracy / 2 );
1142 pts = &updatedBezierPoints;
1145 for(
unsigned ii = 1; ii < pts->size(); ii++ )
1147 VECTOR2I vertex = ( *pts )[ii - 1];
1148 VECTOR2I vertexNext = ( *pts )[ii];
1171 std::vector<VECTOR2I> pts;
1175 pts.emplace_back( topLeft );
1176 pts.emplace_back( botRight.
x, topLeft.
y );
1177 pts.emplace_back( botRight );
1178 pts.emplace_back( topLeft.
x, botRight.
y );
1205 if( t1 < ANGLE_0 && t2 >
ANGLE_0 )
1208 if( t1 < ANGLE_90 && t2 >
ANGLE_90 )
1219 if( t1 < ANGLE_0 || t2 >
ANGLE_0 )
1222 if( t1 < ANGLE_90 || t2 >
ANGLE_90 )
1246 std::vector<SHAPE*> effectiveShapes;
1255 case SHAPE_T::SEGMENT:
1259 case SHAPE_T::RECTANGLE:
1264 effectiveShapes.emplace_back(
new SHAPE_SIMPLE( pts ) );
1266 if( width > 0 || !
IsFilled() || aEdgeOnly )
1268 effectiveShapes.emplace_back(
new SHAPE_SEGMENT( pts[0], pts[1], width ) );
1269 effectiveShapes.emplace_back(
new SHAPE_SEGMENT( pts[1], pts[2], width ) );
1270 effectiveShapes.emplace_back(
new SHAPE_SEGMENT( pts[2], pts[3], width ) );
1271 effectiveShapes.emplace_back(
new SHAPE_SEGMENT( pts[3], pts[0], width ) );
1276 case SHAPE_T::CIRCLE:
1281 if( width > 0 || !
IsFilled() || aEdgeOnly )
1287 case SHAPE_T::BEZIER:
1290 VECTOR2I start_pt = bezierPoints[0];
1292 for(
unsigned int jj = 1; jj < bezierPoints.size(); jj++ )
1294 VECTOR2I end_pt = bezierPoints[jj];
1295 effectiveShapes.emplace_back(
new SHAPE_SEGMENT( start_pt, end_pt, width ) );
1314 if( width > 0 || !
IsFilled() || aEdgeOnly )
1318 if( aLineChainOnly && l.
IsClosed() )
1321 for(
int jj = 0; jj < segCount; jj++ )
1333 return effectiveShapes;
1345 aBuffer.reserve( pointCount );
1348 aBuffer.emplace_back( iter->x, iter->y );
1373 case SHAPE_T::SEGMENT:
1374 case SHAPE_T::CIRCLE:
1375 case SHAPE_T::RECTANGLE:
1385 case SHAPE_T::BEZIER:
1415 case SHAPE_T::SEGMENT:
1416 case SHAPE_T::CIRCLE:
1417 case SHAPE_T::RECTANGLE:
1420 case SHAPE_T::BEZIER:
1433 poly.
Append( aPosition,
true );
1446#define sq( x ) pow( x, 2 )
1450 case SHAPE_T::SEGMENT:
1451 case SHAPE_T::CIRCLE:
1452 case SHAPE_T::RECTANGLE:
1456 case SHAPE_T::BEZIER:
1517 if( chordBefore > 0 )
1518 ratio = chordAfter / chordBefore;
1521 radius = std::max( sqrt(
sq( radius ) * ratio ), sqrt( chordAfter ) / 2 );
1529 radius = ( radialA + radialB ) / 2.0;
1543 double sqRadDiff = ( radius * radius ) - ( l * l ) / 4.0;
1548 if( l > 0 && sqRadDiff >= 0 )
1603 case SHAPE_T::SEGMENT:
1604 case SHAPE_T::CIRCLE:
1605 case SHAPE_T::RECTANGLE:
1606 case SHAPE_T::BEZIER:
1640 #define SWAPITEM( x ) std::swap( x, image->x )
1662#define TEST( a, b ) { if( a != b ) return a - b; }
1663#define TEST_E( a, b ) { if( abs( a - b ) > EPSILON ) return a - b; }
1664#define TEST_PT( a, b ) { TEST_E( a.x, b.x ); TEST_E( a.y, b.y ); }
1675 else if(
m_shape == SHAPE_T::BEZIER )
1680 else if(
m_shape == SHAPE_T::POLY )
1700 ERROR_LOC aErrorLoc,
bool ignoreLineWidth )
const
1702 int width = ignoreLineWidth ? 0 :
GetWidth();
1704 width += 2 * aClearance;
1708 case SHAPE_T::CIRCLE:
1720 case SHAPE_T::RECTANGLE:
1748 case SHAPE_T::SEGMENT:
1770 int inflate = width / 2;
1775 tmp.
Inflate( inflate, CORNER_STRATEGY::ROUND_ALL_CORNERS, aError );
1787 for(
int jj = 0; jj < (int) poly.
SegmentCount(); ++jj )
1798 case SHAPE_T::BEZIER:
1802 std::vector<VECTOR2I> poly;
1803 converter.
GetPoly( poly, aError );
1805 for(
unsigned ii = 1; ii < poly.size(); ii++ )
1829 return LINE_STYLE::SOLID;
1883 double similarity = 1.0;
1918 similarity *= std::pow( 0.9, m + n - 2 * longest );
1924 std::vector<VECTOR2I> poly;
1925 std::vector<VECTOR2I> otherPoly;
1933 for(
int ii = 0; ii < m; ++ii )
1941 for(
int ii = 0; ii < n; ++ii )
1943 otherPoly.emplace_back( lastPt - aOther.
m_poly.
CVertex( ii ) );
1949 similarity *= std::pow( 0.9, m + n - 2 * longest );
1974 if( plotDashTypeEnum.Choices().GetCount() == 0 )
1987 auto isNotPolygonOrCircle = [](
INSPECTABLE* aItem ) ->
bool
2005 auto isRectangle = [](
INSPECTABLE* aItem ) ->
bool
2014 const wxString shapeProps =
_HKI(
"Shape Properties" );
2085 .SetIsHiddenFromRulesEditor();
2090 angle->SetAvailableFunc(
2100 auto fillAvailable =
2113 switch( edaShape->GetShape() )
2131 .SetAvailableFunc( fillAvailable );
2136 .SetAvailableFunc( fillAvailable )
Bezier curves to polygon converter.
void GetPoly(std::vector< VECTOR2I > &aOutput, int aMaxError=10)
Convert a Bezier curve to a polygon.
void SetOrigin(const Vec &pos)
BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
bool Intersects(const BOX2< Vec > &aRect) const
bool IntersectsCircleEdge(const Vec &aCenter, const int aRadius, const int aWidth) 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.
void SetEnd(coord_type x, coord_type y)
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
EDA_ANGLE GetArcAngle() const
const VECTOR2I & GetBezierC2() const
void SetBezierC2(const VECTOR2I &aPt)
void move(const VECTOR2I &aMoveVector)
void SetCenter(const VECTOR2I &aCenter)
VECTOR2I getCenter() const
void SetLength(const double &aLength)
void rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle)
const std::vector< VECTOR2I > buildBezierToSegmentsPointsList(int aMaxError) const
void flip(const VECTOR2I &aCentre, bool aFlipLeftRight)
long long int m_rectangleHeight
virtual int GetEffectiveWidth() const
COLOR4D GetLineColor() const
int GetRectangleWidth() const
void SetLineStyle(const LINE_STYLE aStyle)
void calcEdit(const VECTOR2I &aPosition)
SHAPE_POLY_SET & GetPolyShape()
void CalcArcAngles(EDA_ANGLE &aStartAngle, EDA_ANGLE &aEndAngle) const
Calc arc start and end angles such that aStartAngle < aEndAngle.
void ShapeGetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
void SetFilled(bool aFlag)
bool operator==(const EDA_SHAPE &aOther) const
void SetRectangleHeight(const int &aHeight)
virtual bool IsFilledForHitTesting() const
bool continueEdit(const VECTOR2I &aPosition)
wxString ShowShape() const
void SetFillColor(const COLOR4D &aColor)
std::vector< SHAPE * > makeEffectiveShapes(bool aEdgeOnly, bool aLineChainOnly=false) const
Make a set of SHAPE objects representing the EDA_SHAPE.
bool hitTest(const VECTOR2I &aPosition, int aAccuracy=0) const
void SetCachedArcData(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd, const VECTOR2I &aCenter)
Set the data used for mid point caching.
void RebuildBezierToSegmentsPointsList(int aMaxError)
Rebuild the m_bezierPoints vertex list that approximate the Bezier curve by a list of segments.
EDA_SHAPE(SHAPE_T aType, int aLineWidth, FILL_T aFill)
void beginEdit(const VECTOR2I &aStartPoint)
int GetPointCount() const
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
void SetStart(const VECTOR2I &aStart)
void DupPolyPointsList(std::vector< VECTOR2I > &aBuffer) const
Duplicate the list of corners in a std::vector<VECTOR2I>
LINE_STYLE GetLineStyle() const
void endEdit(bool aClosed=true)
Finishes editing the shape.
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
void SetLineColor(const COLOR4D &aColor)
COLOR4D GetFillColor() const
void SetRectangle(const long long int &aHeight, const long long int &aWidth)
void SwapShape(EDA_SHAPE *aImage)
std::vector< VECTOR2I > GetRectCorners() const
void SetSegmentAngle(const EDA_ANGLE &aAngle)
std::vector< VECTOR2I > m_bezierPoints
void setPosition(const VECTOR2I &aPos)
virtual bool IsProxyItem() const
void computeArcBBox(BOX2I &aBBox) const
void SetEnd(const VECTOR2I &aEnd)
void SetRectangleWidth(const int &aWidth)
void SetBezierC1(const VECTOR2I &aPt)
void SetArcGeometry(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
Set the three controlling points for an arc.
wxString SHAPE_T_asString() const
void scale(double aScale)
double Similarity(const EDA_SHAPE &aOther) const
const VECTOR2I & GetBezierC1() const
const BOX2I getBoundingBox() const
void SetArcAngleAndEnd(const EDA_ANGLE &aAngle, bool aCheckNegativeAngle=false)
Set the end point from the angle center and start.
int GetRectangleHeight() const
virtual int GetWidth() const
VECTOR2I getPosition() const
bool IsClockwiseArc() const
void SetPolyPoints(const std::vector< VECTOR2I > &aPoints)
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const
Convert the shape to a closed polygon.
wxString getFriendlyName() const
void SetWidth(int aWidth)
EDA_ANGLE GetSegmentAngle() const
long long int m_rectangleWidth
bool IsPolyShapeValid() const
int Compare(const EDA_SHAPE *aOther) const
VECTOR2I GetArcMid() const
static ENUM_MAP< T > & Instance()
Class that other classes need to inherit from, in order to be inspectable.
A color representation with 4 components: red, green, blue, alpha.
PROPERTY_BASE & SetAvailableFunc(std::function< bool(INSPECTABLE *)> aFunc)
Set a callback function to determine whether an object provides this property.
PROPERTY_BASE & SetIsHiddenFromRulesEditor(bool aHide=true)
Provide class metadata.Helper macro to map type hashes to names.
static PROPERTY_MANAGER & Instance()
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
int Length() const
Return the length (this).
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
bool IsClosed() const override
virtual const VECTOR2I GetPoint(int aIndex) const override
void SetPoint(int aIndex, const VECTOR2I &aPos)
Move a point to a specific location.
void SetClosed(bool aClosed)
Mark the line chain as closed (i.e.
int PointCount() const
Return the number of points (vertices) in this line chain.
virtual size_t GetPointCount() const override
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
virtual const SEG GetSegment(int aIndex) const override
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
int SegmentCount() const
Return the number of segments in this line chain.
const VECTOR2I & CLastPoint() const
Return the last point in the line chain.
void Remove(int aStartIndex, int aEndIndex)
Remove the range of points [start_index, end_index] from the line chain.
const SEG CSegment(int aIndex) const
Return a constant copy of the aIndex segment in the line chain.
const std::vector< VECTOR2I > & CPoints() const
Represent a set of closed polygons.
void Rotate(const EDA_ANGLE &aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
Rotate all vertices by a given angle.
void RemoveAllContours()
Remove all outlines & holes (clears) the polygon set.
bool CollideEdge(const VECTOR2I &aPoint, VERTEX_INDEX *aClosestVertex=nullptr, int aClearance=0) const
Check whether aPoint collides with any edge of any of the contours of the polygon.
int VertexCount(int aOutline=-1, int aHole=-1) const
Return the number of vertices in a given outline/hole.
bool IsEmpty() const
Return true if the set is empty (no polygons at all)
CONST_ITERATOR CIterate(int aFirst, int aLast, bool aIterateHoles=false) const
bool Collide(const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if the boundary of shape (this) lies closer to the shape aShape than aClearance,...
int TotalVertices() const
Return total number of vertices stored in the set.
void Inflate(int aAmount, CORNER_STRATEGY aCornerStrategy, int aMaxError, bool aSimplify=false)
Perform outline inflation/deflation.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline)
void Mirror(bool aX=true, bool aY=false, const VECTOR2I &aRef={ 0, 0 })
Mirror the line points about y or x (or both)
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.
const VECTOR2I & CVertex(int aIndex, int aOutline, int aHole) const
Return the index-th vertex in a given hole outline within a given outline.
int OutlineCount() const
Return the number of outlines in the set.
void Move(const VECTOR2I &aVector) override
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
void SetLineStyle(LINE_STYLE aLineStyle)
void GetMsgPanelInfo(UNITS_PROVIDER *aUnitsProvider, std::vector< MSG_PANEL_ITEM > &aList, bool aIncludeStyle=true, bool aIncludeWidth=true)
LINE_STYLE GetLineStyle() const
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
extended_type SquaredEuclideanNorm() const
Compute the squared euclidean norm of the vector, which is defined as (x ** 2 + y ** 2).
double Distance(const VECTOR2< extended_type > &aVector) const
Compute the distance between two vectors.
T EuclideanNorm() const
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
void TransformRingToPolygon(SHAPE_POLY_SET &aBuffer, const VECTOR2I &aCentre, int aRadius, int aWidth, int aError, ERROR_LOC aErrorLoc)
Convert arcs to multiple straight segments.
void TransformCircleToPolygon(SHAPE_LINE_CHAIN &aBuffer, const VECTOR2I &aCenter, int aRadius, int aError, ERROR_LOC aErrorLoc, int aMinSegCount=0)
Convert a circle to a polygon, using multiple straight lines.
void TransformArcToPolygon(SHAPE_POLY_SET &aBuffer, const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd, int aWidth, int aError, ERROR_LOC aErrorLoc)
Convert arc to multiple straight segments.
void TransformOvalToPolygon(SHAPE_POLY_SET &aBuffer, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, int aError, ERROR_LOC aErrorLoc, int aMinSegCount=0)
Convert a oblong shape to a polygon, using multiple segments.
static constexpr EDA_ANGLE ANGLE_0
static constexpr EDA_ANGLE ANGLE_90
static constexpr EDA_ANGLE ANGLE_270
static constexpr EDA_ANGLE ANGLE_360
static constexpr EDA_ANGLE ANGLE_180
static struct EDA_SHAPE_DESC _EDA_SHAPE_DESC
@ ARC
use RECTANGLE instead of RECT to avoid collision in a Windows header
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
This file contains miscellaneous commonly used macros and functions.
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
#define UNIMPLEMENTED_FOR(type)
KICOMMON_API wxString MessageTextFromValue(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, double aValue, bool aAddUnitsText=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A helper to convert the double length aValue to a string in inches, millimeters, or unscaled units.
size_t longest_common_subset(const _Container &__c1, const _Container &__c2)
Returns the length of the longest common subset of values between two containers.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
#define IMPLEMENT_ENUM_TO_WXANY(type)
#define NO_SETTER(owner, type)
@ PT_COORD
Coordinate expressed in distance units (mm/inch)
@ PT_DECIDEGREE
Angle expressed in decidegrees.
@ PT_SIZE
Size expressed in distance units (mm/inch)
LINE_STYLE
Dashed line types.
bool TestSegmentHit(const VECTOR2I &aRefPoint, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aDist)
Test if aRefPoint is with aDistance on the line defined by aStart and aEnd.
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
const VECTOR2I CalcArcCenter(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
Determine the center of an arc or circle given three points on its circumference.
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
constexpr ret_type KiROUND(fp_type v, bool aQuiet=false)
Round a floating point number to an integer using "round halfway cases away from zero".
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D