Macros | Functions
vgl_polygon.hxx File Reference
#include <iostream>
#include <set>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <string>
#include "vgl_polygon.h"
#include <vnl/vnl_math.h>
#include "vgl_intersection.h"
#include "vgl_line_2d.h"
#include "vgl_tolerance.h"
#include <cassert>

Go to the source code of this file.

Macros

#define VGL_POLYGON_INSTANTIATE(T)
 

Functions

template<class T >
void vgl_selfintersections (vgl_polygon< T > const &p, std::vector< std::pair< unsigned int, unsigned int > > &e1, std::vector< std::pair< unsigned int, unsigned int > > &e2, std::vector< vgl_point_2d< T > > &ip)
 Compute all self-intersections between all edges on all sheets. More...
 
template<class T >
vgl_polygon< T > vgl_reorient_polygon (vgl_polygon< T > const &p)
 
template<class T >
bool vgl_polygon_sheet_is_counter_clockwise (std::vector< vgl_point_2d< T > > verts)
 

Macro Definition Documentation

◆ VGL_POLYGON_INSTANTIATE

#define VGL_POLYGON_INSTANTIATE (   T)
Value:
template class vgl_polygon<T >; \
template std::ostream& operator<<(std::ostream&,vgl_polygon<T > const&); \
template std::istream& operator>>(std::istream&,vgl_polygon<T >&); \
template void vgl_selfintersections(vgl_polygon<T > const& p, \
std::vector<std::pair<unsigned int,unsigned int> >& e1, \
std::vector<std::pair<unsigned int,unsigned int> >& e2, \
std::vector<vgl_point_2d<T > >& ip); \
template bool vgl_polygon_sheet_is_counter_clockwise(std::vector<vgl_point_2d<T > > verts)
vgl_polygon< T > vgl_reorient_polygon(vgl_polygon< T > const &p)
bool vgl_polygon_sheet_is_counter_clockwise(std::vector< vgl_point_2d< T > > verts)
std::ostream & operator<<(std::ostream &s, vgl_orient_box_3d< Type > const &p)
Write box to stream.
void vgl_selfintersections(vgl_polygon< T > const &p, std::vector< std::pair< unsigned int, unsigned int > > &e1, std::vector< std::pair< unsigned int, unsigned int > > &e2, std::vector< vgl_point_2d< T > > &ip)
Compute all self-intersections between all edges on all sheets.
A commonly required (single-sheet) polygon representation.
Definition: vgl_polygon.h:142
std::istream & operator>>(std::istream &is, vgl_orient_box_3d< Type > &p)
Read box from stream.
Store a polygon.
Definition: vgl_area.h:6

Definition at line 387 of file vgl_polygon.hxx.

Function Documentation

◆ vgl_polygon_sheet_is_counter_clockwise()

template<class T >
bool vgl_polygon_sheet_is_counter_clockwise ( std::vector< vgl_point_2d< T > >  verts)

Definition at line 362 of file vgl_polygon.hxx.

◆ vgl_reorient_polygon()

template<class T >
vgl_polygon<T> vgl_reorient_polygon ( vgl_polygon< T > const &  p)

Definition at line 327 of file vgl_polygon.hxx.

◆ vgl_selfintersections()

template<class T >
void vgl_selfintersections ( vgl_polygon< T > const &  p,
std::vector< std::pair< unsigned int, unsigned int > > &  e1,
std::vector< std::pair< unsigned int, unsigned int > > &  e2,
std::vector< vgl_point_2d< T > > &  ip 
)

Compute all self-intersections between all edges on all sheets.

Returns
three arrays e1, e2, and ip of equal size. Corresponding elements from these arrays describe an intersection. e1[k].first is the sheet index containing edge (e1[k].second, e1[k].second+1) involved in the k-th intersection. Similarly, e2[k] indexes the other edge involved in the k-th intersection. The corresponding intersection point is returned in ip[k].

Definition at line 220 of file vgl_polygon.hxx.