Classes | Macros | Functions
vgl_polygon.h File Reference
#include <iosfwd>
#include <utility>
#include <vector>
#include <vgl/vgl_point_2d.h>

Go to the source code of this file.

Classes

class  vgl_polygon< T >
 Store a polygon. More...
 
struct  vgl_polygon_sheet_as_array< T >
 A commonly required (single-sheet) polygon representation. More...
 

Macros

#define VGL_POLYGON_INSTANTIATE(T)   extern "please include vgl/vgl_polygon.hxx instead"
 

Functions

template<class T >
void vgl_selfintersections (vgl_polygon< T > const &p, std::vector< std::pair< unsigned, unsigned > > &e1, std::vector< std::pair< unsigned, unsigned > > &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)
 
template<class T >
std::ostream & operator<< (std::ostream &os, vgl_polygon< T > const &p)
 
template<class T >
std::istream & operator>> (std::istream &is, vgl_polygon< T > &p)
 

Detailed Description

Author
awf@r.nosp@m.obot.nosp@m.s.ox..nosp@m.ac.u.nosp@m.k
Date
02 Apr 2000
  Modifications
   Binary IO added and documentation tidied up NPC, 20/03/01
   Feb.2002 - Peter Vanroose - brief doxygen comment placed on single line
   Nov.2003 - Peter Vanroose - made vgl_polygon a templated class and added lost of documentation
   Nov.2003 - Peter Vanroose - added constructor (to replace new_polygon from test_driver)
   May.2009 - Matt Leotta - added a function to find self-intersections

Definition in file vgl_polygon.h.

Macro Definition Documentation

◆ VGL_POLYGON_INSTANTIATE

#define VGL_POLYGON_INSTANTIATE (   T)    extern "please include vgl/vgl_polygon.hxx instead"

Definition at line 187 of file vgl_polygon.h.

Function Documentation

◆ operator<<()

template<class T >
std::ostream& operator<< ( std::ostream &  os,
vgl_polygon< T > const &  p 
)

Definition at line 182 of file vgl_polygon.h.

◆ operator>>()

template<class T >
std::istream& operator>> ( std::istream &  is,
vgl_polygon< T > &  p 
)

Definition at line 185 of file vgl_polygon.h.

◆ 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, unsigned > > &  e1,
std::vector< std::pair< unsigned, unsigned > > &  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].