37 return ( aPoint.
x > topLeft.
x && aPoint.
y > topLeft.
y &&
38 aPoint.
x < bottomRight.
x && aPoint.
y < bottomRight.
y );
56 if( point.WithinPoint( aLocation, size ) )
63 if( line.WithinPoint( aLocation, size ) )
77 if( idx >= aPointIdx )
91 if( idx >= aPointIdx )
103 if( idx + 1 == aPointIdx )
107 if( idx > aPointIdx )
111 return ( aPointIdx == 0 );
119 if( idx == aPointIdx )
123 if( idx > aPointIdx )
128 return ( aPointIdx == (
int)
m_points.size() - 1 );
134 for(
unsigned int i = 0; i <
m_points.size(); ++i )
154 for(
unsigned int i = 0; i <
m_lines.size(); ++i )
171 for(
unsigned int i = 0; i <
m_points.size(); ++i )
191 for(
unsigned int i = 0; i <
m_lines.size(); ++i )
220 box.
Merge( point.GetPosition() );
224 for(
const auto& line :
m_lines )
228 box.
SetOrigin( line.GetOrigin().GetPosition() );
229 box.
SetEnd( line.GetEnd().GetPosition() );
234 box.
Merge( line.GetOrigin().GetPosition() );
235 box.
Merge( line.GetEnd().GetPosition() );
245 auto gal = aView->
GetGAL();
253 gal->SetFillColor( drawColor );
254 gal->SetStrokeColor( bgColor );
255 gal->SetIsFill(
true );
256 gal->SetIsStroke(
true );
258 gal->SetLayerDepth( gal->GetMinDepth() );
265 [&](
const EDIT_POINT& aPoint,
bool aDrawCircle = false )
269 gal->SetStrokeColor( highlightColor );
270 gal->SetLineWidth( hoverSize );
274 gal->SetStrokeColor( bgColor );
275 gal->SetLineWidth( borderSize );
278 gal->SetFillColor( aPoint.
IsActive() ? highlightColor : drawColor );
290 drawPoint( line,
true );
int GetContourEndIdx(int aPointIdx) const
Return index of the contour finish for a point with given index.
std::list< int > m_contours
Indices of end contour points.
std::deque< EDIT_POINT > m_points
EDIT_POINTs for modifying m_parent.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Converts a screen space point/vector to a point/vector in world space coordinates.
std::deque< EDIT_LINE > m_lines
EDIT_LINEs for modifying m_parent.
the 3d code uses this value
Represent a line connecting two EDIT_POINTs.
EDIT_POINT * Next(const EDIT_POINT &aPoint, bool aTraverseContours=true)
Return the point that is before the given point in the list.
virtual const BOX2I ViewBBox() const override
static const int BORDER_SIZE
Border size when hovering.
bool m_allowPoints
If false, only allow editing of EDIT_LINES.
bool IsContourStart(int aPointIdx) const
Check if a point with given index is a contour origin.
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
COLOR4D WithAlpha(double aAlpha) const
Return a color with the same color, but the given alpha.
GAL * GetGAL() const
Return the #GAL this view is using to draw graphical primitives.
bool IsContourEnd(int aPointIdx) const
Check is a point with given index is a contour finish.
COLOR4D Darkened(double aFactor) const
Return a color that is darker by a given factor, without modifying object.
virtual void ViewDraw(int aLayer, KIGFX::VIEW *aView) const override
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Auxiliary items (guides, rule, etc)
EDIT_POINT * FindPoint(const VECTOR2I &aLocation, KIGFX::VIEW *aView)
Return a point that is at given coordinates or NULL if there is no such point.
virtual VECTOR2I GetPosition() const
Return coordinates of an EDIT_POINT.
int GetContourStartIdx(int aPointIdx) const
Return index of the contour origin for a point with given index.
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Function Merge modifies the position and size of the rectangle in order to contain aRect.
void SetEnd(coord_type x, coord_type y)
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
void SetOrigin(const Vec &pos)
currently selected items overlay
static bool empty(const wxTextEntryBase *aCtrl)
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
EDIT_POINTS(EDA_ITEM *aParent)
A base class for most all the KiCad significant classes used in schematics and boards.
static const int POINT_SIZE
Border size when not hovering.
EDIT_POINT * Previous(const EDIT_POINT &aPoint, bool aTraverseContours=true)
Return the point that is after the given point in the list.
Represent a single point that can be used for modifying items.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
static const int HOVER_SIZE
bool WithinPoint(const VECTOR2I &aPoint, unsigned int aSize) const
Check if given point is within a square centered in the EDIT_POINT position.
A color representation with 4 components: red, green, blue, alpha.