KiCad PCB EDA Suite
hetriang.cpp File Reference
#include <ttl/halfedge/hetriang.h>
#include <ttl/halfedge/hetraits.h>
#include <ttl/ttl.h>
#include <algorithm>
#include <fstream>
#include <limits>
#include <class_board_connected_item.h>
#include <memory>

Go to the source code of this file.

Functions

static EDGE_PTR getLeadingEdgeInTriangle (const EDGE_PTR &aEdge)
 
static void getLimits (NODES_CONTAINER::iterator aFirst, NODES_CONTAINER::iterator aLast, int &aXmin, int &aYmin, int &aXmax, int &aYmax)
 

Function Documentation

static EDGE_PTR getLeadingEdgeInTriangle ( const EDGE_PTR aEdge)
static

Definition at line 70 of file hetriang.cpp.

Referenced by hed::TRIANGULATION::RemoveTriangle(), and hed::TRIANGULATION::ReverseSplitTriangle().

71 {
72  EDGE_PTR edge = aEdge;
73 
74  // Code: 3EF (assumes triangle)
75  if( !edge->IsLeadingEdge() )
76  {
77  edge = edge->GetNextEdgeInFace();
78 
79  if( !edge->IsLeadingEdge() )
80  edge = edge->GetNextEdgeInFace();
81  }
82 
83  if( !edge->IsLeadingEdge() )
84  {
85  return EDGE_PTR();
86  }
87 
88  return edge;
89 }
std::shared_ptr< EDGE > EDGE_PTR
Definition: hetriang.h:75
static void getLimits ( NODES_CONTAINER::iterator  aFirst,
NODES_CONTAINER::iterator  aLast,
int &  aXmin,
int &  aYmin,
int &  aXmax,
int &  aYmax 
)
static

Definition at line 92 of file hetriang.cpp.

References max, and min.

Referenced by hed::TRIANGULATION::InitTwoEnclosingTriangles().

94 {
95  aXmin = aYmin = std::numeric_limits<int>::min();
96  aXmax = aYmax = std::numeric_limits<int>::max();
97 
98  NODES_CONTAINER::iterator it;
99 
100  for( it = aFirst; it != aLast; ++it )
101  {
102  aXmin = std::min( aXmin, ( *it )->GetX() );
103  aYmin = std::min( aYmin, ( *it )->GetY() );
104  aXmax = std::max( aXmax, ( *it )->GetX() );
105  aYmax = std::max( aYmax, ( *it )->GetY() );
106  }
107 }
#define max(a, b)
Definition: auxiliary.h:86
#define min(a, b)
Definition: auxiliary.h:85