Public Member Functions | Protected Attributes | Friends
gst_polygon_2d Class Reference

#include <gst_polygon_2d.h>

Inheritance diagram for gst_polygon_2d:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 gst_polygon_2d ()
 ~gst_polygon_2d ()
 gst_polygon_2d (gst_polygon_2d const &p)
unsigned int size () const
gst_edge_2d_sptr operator[] (unsigned int i) const
void add (gst_edge_2d_sptr edge)
bool check_validity () const
 check closure of edges.
bool inside (const double x, const double y) const
bool inside (const gst_vertex_2d_sptr v) const
double get_centroid_x () const
double get_centroid_y () const
double area () const
void ref ()
void unref ()
int get_references () const
bool is_referenced () const

Protected Attributes

vcl_vector< gst_edge_2d_sptredges_
 unordered, but oriented, list of edges.

Friends

vcl_ostream & operator<< (vcl_ostream &os, gst_polygon_2d &p)

Detailed Description

Definition at line 16 of file gst_polygon_2d.h.


Constructor & Destructor Documentation

gst_polygon_2d::gst_polygon_2d ( ) [inline]

Definition at line 21 of file gst_polygon_2d.h.

gst_polygon_2d::~gst_polygon_2d ( ) [inline]

Definition at line 22 of file gst_polygon_2d.h.

gst_polygon_2d::gst_polygon_2d ( gst_polygon_2d const &  p) [inline]

Definition at line 24 of file gst_polygon_2d.h.


Member Function Documentation

void gst_polygon_2d::add ( gst_edge_2d_sptr  edge) [inline]

Definition at line 29 of file gst_polygon_2d.h.

double gst_polygon_2d::area ( ) const

Definition at line 74 of file gst_polygon_2d.cxx.

bool gst_polygon_2d::check_validity ( ) const

check closure of edges.

returns false if the edges are not closed or if there is more than one possible cycle

Definition at line 13 of file gst_polygon_2d.cxx.

double gst_polygon_2d::get_centroid_x ( ) const

Definition at line 51 of file gst_polygon_2d.cxx.

double gst_polygon_2d::get_centroid_y ( ) const

Definition at line 61 of file gst_polygon_2d.cxx.

bool gst_polygon_2d::inside ( const double  x,
const double  y 
) const

Definition at line 96 of file gst_polygon_2d.cxx.

bool gst_polygon_2d::inside ( const gst_vertex_2d_sptr  v) const

Definition at line 119 of file gst_polygon_2d.cxx.

gst_edge_2d_sptr gst_polygon_2d::operator[] ( unsigned int  i) const [inline]

Definition at line 28 of file gst_polygon_2d.h.

unsigned int gst_polygon_2d::size ( ) const [inline]

Definition at line 27 of file gst_polygon_2d.h.


Friends And Related Function Documentation

vcl_ostream& operator<< ( vcl_ostream &  os,
gst_polygon_2d p 
) [friend]

Definition at line 125 of file gst_polygon_2d.cxx.


Member Data Documentation

vcl_vector<gst_edge_2d_sptr> gst_polygon_2d::edges_ [protected]

unordered, but oriented, list of edges.

Definition at line 50 of file gst_polygon_2d.h.


The documentation for this class was generated from the following files: