84 aOvl->
Rectangle( lbl.m_bbox.GetOrigin(), lbl.m_bbox.GetEnd() );
87 aOvl->
Line( lbl.m_target, nearest );
98 int bestDist = INT_MAX;
101 for(
int i = 0; i < 4; i++ )
103 int dist = ( ptest[i] - p ).EuclideanNorm();
105 if( dist < bestDist )
126 int bestDist = INT_MAX;
132 for(
int i = 0; i < 4; i++ )
142 for(
int j = 0; j < 4; j++ )
151 if( dist < bestDist )
170 while( iterLimit > 0 )
173 bool collisionsFound =
false;
175 for(
int i = 0; i <
m_labels.size(); i++ )
177 for(
int j = 0; j <
m_labels.size(); j++ )
185 bb_i.Inflate( 100000 );
186 bb_j.Inflate( 100000 );
192 collisionsFound =
true;
197 if( !collisionsFound )
constexpr const Vec & GetPosition() const
constexpr const Vec GetEnd() const
constexpr void SetOrigin(const Vec &pos)
constexpr BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
constexpr size_type GetWidth() const
constexpr void SetSize(const SizeVec &size)
constexpr size_type GetHeight() const
constexpr bool Contains(const Vec &aPoint) const
constexpr void Move(const Vec &aMoveVector)
Move the rectangle by the aMoveVector.
constexpr bool Intersects(const BOX2< Vec > &aRect) const
FONT is an abstract base class for both outline and stroke fonts.
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false, const std::vector< wxString > *aEmbeddedFiles=nullptr, bool aForDrawingSheet=false)
VECTOR2I StringBoundaryLimits(const wxString &aText, const VECTOR2I &aSize, int aThickness, bool aBold, bool aItalic, const METRICS &aFontMetrics) const
Compute the boundary limits of aText (the bounding box of all shapes).
static const METRICS & Default()
A color representation with 4 components: red, green, blue, alpha.
Abstract interface for drawing on a 2D-surface.
void SetGlyphSize(const VECTOR2I aSize)
void SetLineWidth(double aLineWidth)
void Rectangle(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
void BitmapText(const wxString &aText, const VECTOR2I &aPosition, const EDA_ANGLE &aAngle)
void SetIsFill(bool aIsFillEnabled)
void Line(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
void SetIsStroke(bool aIsStrokeEnabled)
void SetStrokeColor(const COLOR4D &aColor)
VECTOR2I boxMtv(BOX2I b1, BOX2I b2)
std::vector< LABEL > m_labels
void Add(VECTOR2I target, wxString msg, KIGFX::COLOR4D color)
void Redraw(KIGFX::VIEW_OVERLAY *aOvl)
LABEL_MANAGER(KIGFX::GAL *aGal)
VECTOR2I nearestBoxCorner(BOX2I b, VECTOR2I p)
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int PointCount() const
Return the number of points (vertices) in this line chain.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
T EuclideanNorm() const
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
static constexpr EDA_ANGLE ANGLE_HORIZONTAL
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D