Macros | Functions
vgl_area.hxx File Reference
#include "vgl_area.h"
#include <vgl/vgl_polygon.h>
#include <vgl/vgl_point_2d.h>
#include <vgl/vgl_box_2d.h>
#include <vgl/vgl_oriented_box_2d.h>

Go to the source code of this file.

Macros

#define VGL_AREA_INSTANTIATE(T)
 

Functions

template<class T >
vgl_area_signed (vgl_polygon< T > const &poly)
 Computes the signed area of a polygon. More...
 
template<class T >
vgl_point_2d< T > vgl_centroid (vgl_polygon< T > const &poly)
 The area weighted center of a polygon. More...
 
template<class T >
vgl_area (const vgl_polygon< T > &poly)
 The area of a polygon. More...
 
template<class T >
vgl_area_enforce_orientation (vgl_polygon< T > const &poly)
 The orientation enforced area of a polygon. More...
 
template<class T >
vgl_area (const vgl_box_2d< T > &box)
 The area of an axis-aligned box. More...
 
template<class T >
vgl_area (const vgl_oriented_box_2d< T > &obox)
 area of an oriented box. More...
 

Macro Definition Documentation

◆ VGL_AREA_INSTANTIATE

#define VGL_AREA_INSTANTIATE (   T)
Value:
template T vgl_area(vgl_polygon<T > const&); \
template T vgl_area_signed(vgl_polygon<T > const&); \
template T vgl_area( const vgl_box_2d<T>& box ); \
template T vgl_area( const vgl_oriented_box_2d<T>& obox )
vgl_point_2d< T > vgl_centroid(vgl_polygon< T > const &poly)
The area weighted center of a polygon.
T vgl_area_signed(vgl_polygon< T > const &poly)
Computes the signed area of a polygon.
T vgl_area_enforce_orientation(vgl_polygon< T > const &poly)
The orientation enforced area of a polygon.
Definition: vgl_area.hxx:61
Store a polygon.
Definition: vgl_area.h:6
T vgl_area(vgl_polygon< T > const &poly)
The area of a polygon.

Definition at line 120 of file vgl_area.hxx.

Function Documentation

◆ vgl_area() [1/3]

template<class T >
T vgl_area ( vgl_polygon< T > const &  poly)

The area of a polygon.

See also
vgl_area_signed

Definition at line 49 of file vgl_area.hxx.

◆ vgl_area() [2/3]

template<class T >
T vgl_area ( const vgl_box_2d< T > &  box)

The area of an axis-aligned box.

Definition at line 110 of file vgl_area.hxx.

◆ vgl_area() [3/3]

template<class T >
T vgl_area ( const vgl_oriented_box_2d< T > &  obox)

area of an oriented box.

Definition at line 114 of file vgl_area.hxx.

◆ vgl_area_enforce_orientation()

template<class T >
T vgl_area_enforce_orientation ( vgl_polygon< T > const &  poly)

The orientation enforced area of a polygon.

Note
This method assumes that the polygon is simple (i.e. no crossings) and the correct orientation is 'enforced' on the polygon (i.e. holes are given negative area) to ensure that the resultant area is correct
See also
vgl_area

Definition at line 61 of file vgl_area.hxx.

◆ vgl_area_signed()

template<class T >
T vgl_area_signed ( vgl_polygon< T > const &  poly)

Computes the signed area of a polygon.

The sign is positive if the polygon is oriented counter-clockwise (in RH coordinate system) and negative otherwise. For "polygons" consisting of more than one contour, the result is valid only if the contours are oriented consistently. That is, an enclosed contour must have opposite orientation to the enclosing contour.

See also
vgl_area

Definition at line 14 of file vgl_area.hxx.

◆ vgl_centroid()

template<class T >
vgl_point_2d<T> vgl_centroid ( vgl_polygon< T > const &  poly)

The area weighted center of a polygon.

In general this is different than the mean of the polygon's vertices

Definition at line 28 of file vgl_area.hxx.