KiCad PCB EDA Suite
Loading...
Searching...
No Matches
INTERSECTION_VISITOR Struct Reference

A visitor that visits INTERSECTABLE_GEOM variant objects with another (which is held as state: m_otherGeometry). More...

#include <intersection.h>

Public Member Functions

 INTERSECTION_VISITOR (const INTERSECTABLE_GEOM &aOtherGeometry, std::vector< VECTOR2I > &aIntersections)
 
void operator() (const SEG &aSeg) const
 
void operator() (const LINE &aLine) const
 
void operator() (const HALF_LINE &aLine) const
 
void operator() (const CIRCLE &aCircle) const
 
void operator() (const SHAPE_ARC &aArc) const
 
void operator() (const BOX2I &aArc) const
 

Private Attributes

const INTERSECTABLE_GEOMm_otherGeometry
 
std::vector< VECTOR2I > & m_intersections
 

Detailed Description

A visitor that visits INTERSECTABLE_GEOM variant objects with another (which is held as state: m_otherGeometry).

This provides a unified way to intersect any supported geometry with any other supported geometry.

Definition at line 52 of file intersection.h.

Constructor & Destructor Documentation

◆ INTERSECTION_VISITOR()

INTERSECTION_VISITOR::INTERSECTION_VISITOR ( const INTERSECTABLE_GEOM aOtherGeometry,
std::vector< VECTOR2I > &  aIntersections 
)
Parameters
aOtherGeometryThe other geometry to intersect the visited geometry with.
aIntersectionsA vector to store the intersections in. Does not have to be empty, the visitor will append to it.

Definition at line 201 of file intersection.cpp.

Member Function Documentation

◆ operator()() [1/6]

void INTERSECTION_VISITOR::operator() ( const BOX2I aArc) const

Definition at line 394 of file intersection.cpp.

References KIGEOM::BoxToSegs().

◆ operator()() [2/6]

void INTERSECTION_VISITOR::operator() ( const CIRCLE aCircle) const

Definition at line 317 of file intersection.cpp.

References KIGEOM::BoxToSegs(), m_intersections, and m_otherGeometry.

◆ operator()() [3/6]

void INTERSECTION_VISITOR::operator() ( const HALF_LINE aLine) const

Definition at line 279 of file intersection.cpp.

References KIGEOM::BoxToSegs(), m_intersections, and m_otherGeometry.

◆ operator()() [4/6]

void INTERSECTION_VISITOR::operator() ( const LINE aLine) const

Definition at line 241 of file intersection.cpp.

References KIGEOM::BoxToSegs(), m_intersections, and m_otherGeometry.

◆ operator()() [5/6]

void INTERSECTION_VISITOR::operator() ( const SEG aSeg) const

Definition at line 216 of file intersection.cpp.

References KIGEOM::BoxToSegs(), m_intersections, and m_otherGeometry.

◆ operator()() [6/6]

void INTERSECTION_VISITOR::operator() ( const SHAPE_ARC aArc) const

Definition at line 355 of file intersection.cpp.

References KIGEOM::BoxToSegs(), m_intersections, and m_otherGeometry.

Member Data Documentation

◆ m_intersections

std::vector<VECTOR2I>& INTERSECTION_VISITOR::m_intersections
private

Definition at line 77 of file intersection.h.

Referenced by operator()().

◆ m_otherGeometry

const INTERSECTABLE_GEOM& INTERSECTION_VISITOR::m_otherGeometry
private

Definition at line 76 of file intersection.h.

Referenced by operator()().


The documentation for this struct was generated from the following files: