46    m_drawables.push_back( { aItem, aPersistent, aLineWidth } );
 
 
   85    const int  minSnapLineLength = 10;
 
   89    const auto drawLineIfNotAlsoSnapLine =
 
   90            [&]( 
const SEG& aLine )
 
   92                if( !haveSnapLine || !aLine.ApproxCollinear( *
m_snapLine, 1 ) )
 
  105                [&]( 
const auto& visited )
 
  107                    using ItemType = std::decay_t<
decltype( visited )>;
 
  109                    if constexpr( std::is_same_v<ItemType, LINE> )
 
  112                        std::optional<SEG> segToBoundary =
 
  117                            drawLineIfNotAlsoSnapLine( *segToBoundary );
 
  120                    else if constexpr( std::is_same_v<ItemType, HALF_LINE> )
 
  123                        std::optional<SEG> segToBoundary =
 
  128                            drawLineIfNotAlsoSnapLine( *segToBoundary );
 
  131                    else if constexpr( std::is_same_v<ItemType, SEG> )
 
  133                        drawLineIfNotAlsoSnapLine( visited );
 
  135                    else if constexpr( std::is_same_v<ItemType, CIRCLE> )
 
  137                        gal.
DrawCircle( visited.Center, visited.Radius );
 
  139                    else if constexpr( std::is_same_v<ItemType, SHAPE_ARC> )
 
  141                        gal.
DrawArc( visited.GetCenter(), visited.GetRadius(),
 
  142                                     visited.GetStartAngle(), visited.GetCentralAngle() );
 
  144                    else if constexpr( std::is_same_v<ItemType, VECTOR2I> )
 
  154        const SEG& segment = guide.Segment;
 
  156        if( segment.
A == segment.
B )
 
  166        gal.
DrawLine( clipped->A, clipped->B );
 
  174        const int dashSizeBasis = aView->
ToWorld( 12 );
 
  175        const int snapOriginMarkerSize = aView->
ToWorld( 16 );
 
  178        const int omitStartMarkerIfWithinLength = aView->
ToWorld( 8 );
 
 
constexpr BOX2I BOX2ISafe(const BOX2D &aInput)
 
constexpr void SetMaximum()
 
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
 
A color representation with 4 components: red, green, blue, alpha.
 
void AddDrawable(const DRAWABLE &aItem, bool aIsPersistent, int aLineWidth=1)
 
std::optional< SEG > m_snapLine
 
std::vector< SNAP_GUIDE > m_snapGuides
 
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
 
void SetSnapGuides(std::vector< SNAP_GUIDE > aGuides)
 
COLOR4D m_persistentColor
 
std::vector< DRAWABLE_INFO > m_drawables
 
std::variant< SEG, LINE, HALF_LINE, CIRCLE, SHAPE_ARC, VECTOR2I > DRAWABLE
 
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
 
void ViewDraw(int aLayer, VIEW *aView) const override
Draw the parts of the object belonging to layer aLayer.
 
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.
 
virtual void DrawArc(const VECTOR2D &aCenterPoint, double aRadius, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &aAngle)
Draw an arc.
 
double GetWorldScale() const
Get the world scale.
 
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
 
BOX2D GetViewport() const
Return the current viewport visible area rectangle.
 
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.
 
Utility functions for drawing compound items (i.e.
 
std::optional< SEG > ClipHalfLineToBox(const HALF_LINE &aRay, const BOX2I &aBox)
Get the segment of a half-line that is inside a box, if any.
 
std::optional< SEG > ClipLineToBox(const LINE &aLine, const BOX2I &aBox)
Get the segment of a line that is inside a box, if any.
 
The Cairo implementation of the graphics abstraction layer.
 
void DrawCross(GAL &aGal, const VECTOR2I &aPosition, int aSize)
Draw a cross at a given position.
 
void DrawDashedLine(GAL &aGal, const SEG &aSeg, double aDashSize)
Draw a dashed line.
 
Utility functions for working with shapes.
 
@ NOT_USED
the 3d code uses this value