Classes | Defines | Functions
core/vgl/vgl_polygon.h File Reference
#include <vcl_iosfwd.h>
#include <vgl/vgl_point_2d.h>
#include <vcl_vector.h>
#include <vcl_utility.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...

Defines

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

Functions

template<class T >
void vgl_selfintersections (vgl_polygon< T > const &p, vcl_vector< vcl_pair< unsigned, unsigned > > &e1, vcl_vector< vcl_pair< unsigned, unsigned > > &e2, vcl_vector< vgl_point_2d< T > > &ip)
 Compute all self-intersections between all edges on all sheets.
template<class T >
vcl_ostream & operator<< (vcl_ostream &os, vgl_polygon< T > const &p)

Detailed Description

Author:
awf@robots.ox.ac.uk
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.


Define Documentation

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

Definition at line 169 of file vgl_polygon.h.


Function Documentation

template<class T >
vcl_ostream& operator<< ( vcl_ostream &  os,
vgl_polygon< T > const &  p 
)

Definition at line 167 of file vgl_polygon.h.

template<class T >
void vgl_selfintersections ( vgl_polygon< T > const &  p,
vcl_vector< vcl_pair< unsigned, unsigned > > &  e1,
vcl_vector< vcl_pair< unsigned, unsigned > > &  e2,
vcl_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].