36 m_position( aPosition ),
47 m_position( aPosition ),
50 m_style( NO_GRAPHIC ),
110 double theta = atan2( end.
y - start.
y, end.
x - start.
x );
111 std::array<double,2> strokes = { scaledSize.
x, scaledSize.
x / 2 };
113 for(
size_t i = 0; i < 10000; ++i )
116 start.
y + strokes[ i % 2 ] * sin( theta ) );
122 if(
ClipLine( &clip, segStart.
x, segStart.
y, segEnd.
x, segEnd.
y ) )
124 else if( i % 2 == 0 )
137 scaledSize.
y = -scaledSize.
y;
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
constexpr void SetMaximum()
constexpr BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
A base class for most all the KiCad significant classes used in schematics and boards.
void SetFlags(EDA_ITEM_FLAGS aMask)
A color representation with 4 components: red, green, blue, alpha.
Abstract interface for drawing on a 2D-surface.
virtual void SetIsFill(bool aIsFillEnabled)
Enable/disable fill.
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.
ORIGIN_VIEWITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
COLOR4D m_color
Marker symbol.
VECTOR2D m_position
< Marker coordinates.
void ViewDraw(int aLayer, VIEW *aView) const override
Draw the parts of the object belonging to layer aLayer.
ORIGIN_VIEWITEM(const COLOR4D &aColor=COLOR4D(1.0, 1.0, 1.0, 1.0), MARKER_STYLE aStyle=CIRCLE_X, int aSize=16, const VECTOR2D &aPosition=VECTOR2D(0, 0))
MARKER_STYLE m_style
If set, the marker will be drawn even if its position is 0,0.
VECTOR2D m_end
Marker size (in pixels).
MARKER_STYLE
< Marker symbol styles
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
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.
std::uint32_t EDA_ITEM_FLAGS
a few functions useful in geometry calculations.
bool ClipLine(const BOX2I *aClipBox, int &x1, int &y1, int &x2, int &y2)
Test if any part of a line falls within the bounds of a rectangle.
The Cairo implementation of the graphics abstraction layer.
@ NOT_USED
the 3d code uses this value
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D