KiCad PCB EDA Suite
FractureEdge Struct Reference

Public Member Functions

 FractureEdge (bool connected, SHAPE_LINE_CHAIN *owner, int index)
 
 FractureEdge (int y=0)
 
 FractureEdge (bool connected, const VECTOR2I &p1, const VECTOR2I &p2)
 
bool matches (int y) const
 

Public Attributes

bool m_connected
 
VECTOR2I m_p1
 
VECTOR2I m_p2
 
FractureEdgem_next
 

Detailed Description

Definition at line 614 of file shape_poly_set.cpp.

Constructor & Destructor Documentation

◆ FractureEdge() [1/3]

FractureEdge::FractureEdge ( bool  connected,
SHAPE_LINE_CHAIN owner,
int  index 
)
inline

Definition at line 616 of file shape_poly_set.cpp.

References SHAPE_LINE_CHAIN::CPoint(), m_p1, and m_p2.

616  :
617  m_connected( connected ),
618  m_next( NULL )
619  {
620  m_p1 = owner->CPoint( index );
621  m_p2 = owner->CPoint( index + 1 );
622  }
const VECTOR2I & CPoint(int aIndex) const
Function CPoint()
FractureEdge * m_next

◆ FractureEdge() [2/3]

FractureEdge::FractureEdge ( int  y = 0)
inline

Definition at line 624 of file shape_poly_set.cpp.

References m_p1, m_p2, VECTOR2< T >::x, and VECTOR2< T >::y.

624  :
625  m_connected( false ),
626  m_next( NULL )
627  {
628  m_p1.x = m_p2.y = y;
629  }
FractureEdge * m_next

◆ FractureEdge() [3/3]

FractureEdge::FractureEdge ( bool  connected,
const VECTOR2I p1,
const VECTOR2I p2 
)
inline

Definition at line 631 of file shape_poly_set.cpp.

631  :
632  m_connected( connected ),
633  m_p1( p1 ),
634  m_p2( p2 ),
635  m_next( NULL )
636  {
637  }
FractureEdge * m_next

Member Function Documentation

◆ matches()

bool FractureEdge::matches ( int  y) const
inline

Definition at line 639 of file shape_poly_set.cpp.

References m_p1, m_p2, max, min, and VECTOR2< T >::y.

640  {
641  int y_min = std::min( m_p1.y, m_p2.y );
642  int y_max = std::max( m_p1.y, m_p2.y );
643 
644  return ( y >= y_min ) && ( y <= y_max );
645  }
#define max(a, b)
Definition: auxiliary.h:86
#define min(a, b)
Definition: auxiliary.h:85

Member Data Documentation

◆ m_connected

bool FractureEdge::m_connected

Definition at line 647 of file shape_poly_set.cpp.

Referenced by SHAPE_POLY_SET::fractureSingle(), and processEdge().

◆ m_next

FractureEdge* FractureEdge::m_next

Definition at line 649 of file shape_poly_set.cpp.

Referenced by SHAPE_POLY_SET::fractureSingle(), and processEdge().

◆ m_p1

VECTOR2I FractureEdge::m_p1

◆ m_p2

VECTOR2I FractureEdge::m_p2

Definition at line 648 of file shape_poly_set.cpp.

Referenced by FractureEdge(), matches(), and processEdge().


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