core/vgl/vgl_area.h
Go to the documentation of this file.
00001 #ifndef vgl_area_h_
00002 #define vgl_area_h_
00003 //:
00004 // \file
00005 
00006 template <class T> class vgl_polygon;
00007 template <class T> class vgl_point_2d;
00008 
00009 //: Computes the signed area of a polygon.
00010 // The sign is positive if the polygon is oriented counter-clockwise
00011 // (in RH coordinate system) and negative otherwise. For "polygons"
00012 // consisting of more than one contour, the result is valid only if
00013 // the contours are oriented consistently. That is, an enclosed
00014 // contour must have opposite orientation to the enclosing contour.
00015 // \sa vgl_area
00016 // \relatesalso vgl_polygon
00017 template <class T> T vgl_area_signed(vgl_polygon<T> const& poly);
00018 
00019 //: The area of a polygon.
00020 // \sa vgl_area_signed
00021 // \relatesalso vgl_polygon
00022 template <class T> T vgl_area(vgl_polygon<T> const& poly);
00023 
00024 //: The orientation enforced area of a polygon.
00025 // \note This method assumes that the polygon is simple (i.e. no crossings)
00026 //  and the correct orientation is 'enforced' on the polygon (i.e. holes are
00027 //  given negative area) to ensure that the resultant area is correct
00028 // \sa vgl_area
00029 // \relatesalso vgl_polygon
00030 template <class T> T vgl_area_enforce_orientation(vgl_polygon<T> const& poly);
00031 
00032 //: The area weighted center of a polygon
00033 //  In general this is different than the mean of the polygon's vertices
00034 // \relatesalso vgl_polygon
00035 template <class T> vgl_point_2d<T> vgl_centroid(vgl_polygon<T> const& poly);
00036 
00037 #define VGL_AREA_INSTANTIATE(T) extern "please include vgl/vgl_area.txx instead"
00038 
00039 #endif // vgl_area_h_