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 <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

◆ getLeadingEdgeInTriangle()

static EDGE_PTR getLeadingEdgeInTriangle ( const EDGE_PTR aEdge)
static

Definition at line 69 of file hetriang.cpp.

70 {
71  EDGE_PTR edge = aEdge;
72 
73  // Code: 3EF (assumes triangle)
74  if( !edge->IsLeadingEdge() )
75  {
76  edge = edge->GetNextEdgeInFace();
77 
78  if( !edge->IsLeadingEdge() )
79  edge = edge->GetNextEdgeInFace();
80  }
81 
82  if( !edge->IsLeadingEdge() )
83  {
84  return EDGE_PTR();
85  }
86 
87  return edge;
88 }
std::shared_ptr< EDGE > EDGE_PTR
Definition: hetriang.h:75

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

◆ getLimits()

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

Definition at line 91 of file hetriang.cpp.

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

References max, and min.

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