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 78 of file hetriang.cpp.

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

79 {
80  EDGE_PTR edge = aEdge;
81 
82  // Code: 3EF (assumes triangle)
83  if( !edge->IsLeadingEdge() )
84  {
85  edge = edge->GetNextEdgeInFace();
86 
87  if( !edge->IsLeadingEdge() )
88  edge = edge->GetNextEdgeInFace();
89  }
90 
91  if( !edge->IsLeadingEdge() )
92  {
93  return EDGE_PTR();
94  }
95 
96  return edge;
97 }
std::shared_ptr< EDGE > EDGE_PTR
Definition: hetriang.h:73
static void getLimits ( NODES_CONTAINER::iterator  aFirst,
NODES_CONTAINER::iterator  aLast,
int &  aXmin,
int &  aYmin,
int &  aXmax,
int &  aYmax 
)
static

Definition at line 100 of file hetriang.cpp.

References max, and min.

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

102 {
103  aXmin = aYmin = std::numeric_limits<int>::min();
104  aXmax = aYmax = std::numeric_limits<int>::max();
105 
106  NODES_CONTAINER::iterator it;
107 
108  for( it = aFirst; it != aLast; ++it )
109  {
110  aXmin = std::min( aXmin, ( *it )->GetX() );
111  aYmin = std::min( aYmin, ( *it )->GetY() );
112  aXmax = std::max( aXmax, ( *it )->GetX() );
113  aYmax = std::max( aYmax, ( *it )->GetY() );
114  }
115 }
#define max(a, b)
Definition: auxiliary.h:86
#define min(a, b)
Definition: auxiliary.h:85