39 return ( aPoint.
x > topLeft.
x && aPoint.
y > topLeft.
y &&
40 aPoint.
x < bottomRight.
x && aPoint.
y < bottomRight.
y );
62 if( point.WithinPoint( aLocation, size ) )
69 if( line.WithinPoint( aLocation, size ) )
83 if( idx >= aPointIdx )
97 if( idx >= aPointIdx )
109 if( idx + 1 == aPointIdx )
113 if( idx > aPointIdx )
117 return ( aPointIdx == 0 );
125 if( idx == aPointIdx )
129 if( idx > aPointIdx )
134 return ( aPointIdx == (
int)
m_points.size() - 1 );
140 for(
unsigned int i = 0; i <
m_points.size(); ++i )
160 for(
unsigned int i = 0; i <
m_lines.size(); ++i )
177 for(
unsigned int i = 0; i <
m_points.size(); ++i )
197 for(
unsigned int i = 0; i <
m_lines.size(); ++i )
226 box.
Merge( point.GetPosition() );
230 for(
const auto& line :
m_lines )
234 box.
SetOrigin( line.GetOrigin().GetPosition() );
235 box.
SetEnd( line.GetEnd().GetPosition() );
240 box.
Merge( line.GetOrigin().GetPosition() );
241 box.
Merge( line.GetEnd().GetPosition() );
265 if( brightness > 0.5 )
270 else if( brightness > 0.2 )
293 [&](
const EDIT_POINT& aPoint,
bool aDrawCircle = false )
319 if( line.HasCenterPoint() )
321 drawPoint( line.GetPosition(),
true );
324 if( line.DrawLine() )
328 gal->
DrawLine( line.GetOrigin().GetPosition(), line.GetEnd().GetPosition() );
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
constexpr void SetOrigin(const Vec &pos)
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
constexpr void SetEnd(coord_type x, coord_type y)
A base class for most all the KiCad significant classes used in schematics and boards.
Represent a line connecting two EDIT_POINTs.
bool IsContourStart(int aPointIdx) const
Check if a point with given index is a contour origin.
bool m_allowPoints
If false, only allow editing of EDIT_LINES.
int GetContourEndIdx(int aPointIdx) const
Return index of the contour finish for a point with given index.
virtual const BOX2I ViewBBox() const override
EDIT_POINT * Previous(const EDIT_POINT &aPoint, bool aTraverseContours=true)
Return the point that is after the given point in the list.
EDIT_POINT * Next(const EDIT_POINT &aPoint, bool aTraverseContours=true)
Return the point that is before the given point in the list.
std::deque< EDIT_LINE > m_lines
EDIT_LINEs for modifying m_parent.
std::list< int > m_contours
Indices of end contour points.
EDIT_POINTS(EDA_ITEM *aParent)
bool IsContourEnd(int aPointIdx) const
Check is a point with given index is a contour finish.
std::deque< EDIT_POINT > m_points
EDIT_POINTs for modifying m_parent.
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.
int GetContourStartIdx(int aPointIdx) const
Return index of the contour origin for a point with given index.
virtual void ViewDraw(int aLayer, KIGFX::VIEW *aView) const override
Represent a single point that can be used for modifying items.
static const int HOVER_SIZE
Border size when hovering.
static const int POINT_SIZE
virtual VECTOR2I GetPosition() const
Return coordinates of an EDIT_POINT.
bool WithinPoint(const VECTOR2I &aPoint, unsigned int aSize) const
Check if given point is within a square centered in the EDIT_POINT position.
static const int BORDER_SIZE
Border size when not hovering.
A color representation with 4 components: red, green, blue, alpha.
COLOR4D WithAlpha(double aAlpha) const
Return a color with the same color, but the given alpha.
COLOR4D & Invert()
Makes the color inverted, alpha remains the same.
COLOR4D Darkened(double aFactor) const
Return a color that is darker by a given factor, without modifying object.
double GetBrightness() const
Returns the brightness value of the color ranged from 0.0 to 1.0.
COLOR4D Brightened(double aFactor) const
Return a color that is brighter by a given factor, without modifying object.
double Distance(const COLOR4D &other) const
Returns the distance (in RGB space) between two colors.
Attribute save/restore for GAL attributes.
Abstract interface for drawing on a 2D-surface.
virtual void SetLayerDepth(double aLayerDepth)
Set the depth of the layer (position on the z-axis)
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
virtual void DrawRectangle(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a rectangle.
virtual void SetFillColor(const COLOR4D &aColor)
Set the fill color.
virtual void DrawCircle(const VECTOR2D &aCenterPoint, double aRadius)
Draw a circle using world coordinates.
virtual void SetLineWidth(float aLineWidth)
Set the line width.
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
virtual void DrawLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a line.
const COLOR4D & GetClearColor() const
double GetMinDepth() const
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
GAL * GetGAL() const
Return the #GAL this view is using to draw graphical primitives.
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Converts a screen space point/vector to a point/vector in world space coordinates.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
static bool empty(const wxTextEntryBase *aCtrl)
@ LAYER_AUX_ITEMS
Auxiliary items (guides, rule, etc)
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
@ NOT_USED
the 3d code uses this value