39 return ( aPoint.
x > topLeft.
x && aPoint.
y > topLeft.
y &&
40 aPoint.
x < bottomRight.
x && aPoint.
y < bottomRight.
y );
58 if( point.WithinPoint( aLocation, size ) )
65 if( line.WithinPoint( aLocation, size ) )
79 if( idx >= aPointIdx )
93 if( idx >= aPointIdx )
105 if( idx + 1 == aPointIdx )
109 if( idx > aPointIdx )
113 return ( aPointIdx == 0 );
121 if( idx == aPointIdx )
125 if( idx > aPointIdx )
130 return ( aPointIdx == (
int)
m_points.size() - 1 );
136 for(
unsigned int i = 0; i <
m_points.size(); ++i )
156 for(
unsigned int i = 0; i <
m_lines.size(); ++i )
173 for(
unsigned int i = 0; i <
m_points.size(); ++i )
193 for(
unsigned int i = 0; i <
m_lines.size(); ++i )
222 box.
Merge( point.GetPosition() );
226 for(
const auto& line :
m_lines )
230 box.
SetOrigin( line.GetOrigin().GetPosition() );
231 box.
SetEnd( line.GetEnd().GetPosition() );
236 box.
Merge( line.GetOrigin().GetPosition() );
237 box.
Merge( line.GetEnd().GetPosition() );
261 if( brightness > 0.5 )
266 else if( brightness > 0.2 )
289 [&](
const EDIT_POINT& aPoint,
bool aDrawCircle = false )
314 drawPoint( line,
true );
virtual void SetFillColor(const COLOR4D &aColor)
Set the fill color.
double GetMinDepth() const
Return the minimum depth in the currently used range (the top).
virtual void DrawRectangle(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a rectangle.
COLOR4D & Invert()
Makes the color inverted, alpha remains the same.
Auxiliary items (guides, rule, etc)
double GetBrightness() const
Returns the brightness value of the color ranged from 0.0 to 1.0.
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
virtual void SetLayerDepth(double aLayerDepth)
Set the depth of the layer (position on the z-axis)
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
virtual void SetLineWidth(float aLineWidth)
Set the line width.
COLOR4D Brightened(double aFactor) const
Return a color that is brighter by a given factor, without modifying object.
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.
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
void PopDepth()
Restore previously stored drawing depth for the depth stack.
int GetContourStartIdx(int aPointIdx) const
Return index of the contour origin for a point with given index.
double Distance(const COLOR4D &other) const
Returns the distance (in RGB space) between two colors.
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
const COLOR4D & GetClearColor() const
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.
virtual void SetStrokeColor(const COLOR4D &aColor)
Set the stroke color.
void PushDepth()
Store current drawing depth on the depth stack.
virtual void DrawCircle(const VECTOR2D &aCenterPoint, double aRadius)
Draw a circle using world coordinates.
void SetOrigin(const Vec &pos)
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...
virtual void SetIsStroke(bool aIsStrokeEnabled)
Enable/disable stroked outlines.
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.
Abstract interface for drawing on a 2D-surface.
A color representation with 4 components: red, green, blue, alpha.