Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

qgar::Maer Class Reference

#include <qgarlib/Maer.H>

List of all members.


Detailed Description

Minimum-Area Encasing Rectangle (MAER).

Compute a MAER from a given list of points, typically supposed to determine the contour of an image component. See [Freeman and Shapira, 1975]

In both cases, the MAER area is equal to 0.

The computing is performed using double numbers, and the MAER features are also stored as double numbers.

Warning:
No copy constructor is defined.
Author:
Gérald Masini
Date:
May 13, 2004 11:30
Since:
Qgar 2.1

Definition at line 108 of file Maer.H.

Public Member Functions

Constructors
 Maer (const std::list< DPoint > &aPtList)
 Default constructor.Create from a list of points having double coordinates.
template<class T>
 Maer (const std::list< GenPoint< T > > &aPtList)
 Create from a list of points having a coordinate type different from double.
 Maer (const FreemanChain &aCh)
 Create from a Freeman chain (representing the contour of an image component).
 Maer (const Maer &aMaer)
 Copy constructor.
Destructor
 ~Maer ()
 Non-virtual destructor: The class is not supposed to be derived.
Access
const std::list< DPoint > & accessVertices () const
 Get the list including the 4 corners of the MAER.
std::list< DPointvertices () const
 Get a copy of the list including the 4 corners of the MAER.
double area () const
 Get area.
Operators
Maeroperator= (const Maer &aMaer)
 Assignment.

Protected Attributes

MAER features
std::list< DPoint_vertices
 The four corners.
double _area
 The area.

Private Member Functions

void PRIVATEcomputeMaer (const std::list< DPoint > &aPtList)
 Auxiliary function to compute the MAER from a list of points having double coordinates.
Auxiliaries
template<class T>
GenPoint< double > PRIVATEtoDPoint (const GenPoint< T > &aPt)
 To convert a point having coordinates of any type into a point having double coordinates.


Constructor & Destructor Documentation

qgar::Maer::Maer const std::list< DPoint > &  aPtList  ) 
 

Default constructor.Create from a list of points having double coordinates.

Parameters:
aPtList a list of double points

Definition at line 66 of file Maer.C.

References PRIVATEcomputeMaer().

template<class T>
qgar::Maer::Maer const std::list< GenPoint< T > > &  aPtList  ) 
 

Create from a list of points having a coordinate type different from double.

Parameters:
aPtList a list of points
Warning:
As computing is performed using double numbers, the use of this constructor implies the conversion of each given point into a point having double coordinates, i.e. the duplication of the given list.

Definition at line 75 of file Maer.C.

References PRIVATEcomputeMaer(), and PRIVATEtoDPoint().

qgar::Maer::Maer const FreemanChain aCh  ) 
 

Create from a Freeman chain (representing the contour of an image component).

Parameters:
aCh a Freeman Chain

Definition at line 89 of file Maer.C.

References PRIVATEcomputeMaer(), and qgar::FreemanChain::toDPointList().

qgar::Maer::Maer const Maer aMaer  ) 
 

Copy constructor.

Parameters:
aMaer a MAER

Definition at line 96 of file Maer.C.

qgar::Maer::~Maer  ) 
 

Non-virtual destructor: The class is not supposed to be derived.

Definition at line 115 of file Maer.C.


Member Function Documentation

const std::list< DPoint > & qgar::Maer::accessVertices  )  const
 

Get the list including the 4 corners of the MAER.

Definition at line 130 of file Maer.C.

References _vertices.

Referenced by qgar::Component::PRIVATEcomputeMaer().

double qgar::Maer::area  )  const [inline]
 

Get area.

Definition at line 292 of file Maer.H.

References _area.

Maer & qgar::Maer::operator= const Maer aMaer  ) 
 

Assignment.

Parameters:
aMaer a Minimum-Area Enclosing Rectangle

Definition at line 154 of file Maer.C.

References _area, and _vertices.

void qgar::Maer::PRIVATEcomputeMaer const std::list< DPoint > &  aPtList  )  [private]
 

Auxiliary function to compute the MAER from a list of points having double coordinates.

Parameters:
aPtList a list of double points

Definition at line 175 of file Maer.C.

References _area, _vertices, qgar::GenConvexHull< T >::accessPivot(), qgar::GenConvexHull< T >::accessVertices(), qgar::Math::QG_2PI, and qgar::GenConvexHull< T >::size().

Referenced by Maer().

template<class T>
GenPoint< double > qgar::Maer::PRIVATEtoDPoint const GenPoint< T > &  aPt  )  [private]
 

To convert a point having coordinates of any type into a point having double coordinates.

To be used as a functor in STL algorithms (see function qgar::Maer::Maer(const std::list< GenPoint<T> >&) for example).

Parameters:
aPt a point

Definition at line 307 of file Maer.H.

Referenced by Maer().

std::list< DPoint > qgar::Maer::vertices  )  const
 

Get a copy of the list including the 4 corners of the MAER.

Definition at line 138 of file Maer.C.

References _vertices.


Member Data Documentation

double qgar::Maer::_area [protected]
 

The area.

Definition at line 230 of file Maer.H.

Referenced by area(), operator=(), and PRIVATEcomputeMaer().

std::list<DPoint> qgar::Maer::_vertices [protected]
 

The four corners.

Definition at line 225 of file Maer.H.

Referenced by accessVertices(), operator=(), PRIVATEcomputeMaer(), and vertices().


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