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)
 
 INTERSECTION_VISITOR (const INTERSECTABLE_GEOM &aOtherGeometry, std::vector< VECTOR2I > &aIntersections, INTERSECTION_CONTACT &aContact)
 
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 SHAPE_ELLIPSE &aEllipse) const
 
void operator() (const BOX2I &aArc) const
 

Private Attributes

const INTERSECTABLE_GEOMm_otherGeometry
 
std::vector< VECTOR2I > & m_intersections
 
INTERSECTION_CONTACTm_contact = nullptr
 

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 67 of file intersection.h.

Constructor & Destructor Documentation

◆ INTERSECTION_VISITOR() [1/2]

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 431 of file intersection.cpp.

References m_intersections, and m_otherGeometry.

◆ INTERSECTION_VISITOR() [2/2]

INTERSECTION_VISITOR::INTERSECTION_VISITOR ( const INTERSECTABLE_GEOM & aOtherGeometry,
std::vector< VECTOR2I > & aIntersections,
INTERSECTION_CONTACT & aContact )
Parameters
aContactReceives how the geometries meet. Flags are only set, never cleared, so one contact accumulates across visits.

Definition at line 438 of file intersection.cpp.

References m_contact, m_intersections, and m_otherGeometry.

Member Function Documentation

◆ operator()() [1/7]

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

Definition at line 668 of file intersection.cpp.

References KIGEOM::BoxToSegs().

◆ operator()() [2/7]

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

Definition at line 559 of file intersection.cpp.

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

◆ operator()() [3/7]

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

Definition at line 521 of file intersection.cpp.

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

◆ operator()() [4/7]

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

Definition at line 484 of file intersection.cpp.

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

◆ operator()() [5/7]

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

Definition at line 454 of file intersection.cpp.

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

◆ operator()() [6/7]

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

Definition at line 597 of file intersection.cpp.

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

◆ operator()() [7/7]

void INTERSECTION_VISITOR::operator() ( const SHAPE_ELLIPSE & aEllipse) const

Definition at line 636 of file intersection.cpp.

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

Member Data Documentation

◆ m_contact

INTERSECTION_CONTACT* INTERSECTION_VISITOR::m_contact = nullptr
private

◆ m_intersections

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

◆ m_otherGeometry

const INTERSECTABLE_GEOM& INTERSECTION_VISITOR::m_otherGeometry
private

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