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

qgar::RWSegmentVector Class Reference
[Polygonal approximations]

#include <qgarlib/RWSegmentVector.H>

List of all members.


Detailed Description

Recursive polygonal approximation of a chain.

The approximation is performed using the algorithm proposed by David Lowe and further refined by P. Rosin and G. West [Rosin and West, 1989].

Author:
Karl Tombre
Date:
July 3, 2001 16:37
Since:
Qgar 1.0

Definition at line 380 of file RWSegmentVector.H.

Public Member Functions

Constructors
 RWSegmentVector (AbstractGenPointChain< int > &aChain, double minDeviation=1.9)
 Construct a polygonal approximation of a given chain.
Destructor
virtual ~RWSegmentVector ()
 Virtual destructor.

Private Member Functions

Auxiliary functions
RWTreebuildTree (std::vector< Point > &, int, int, double)
 Build the tree.
void searchBestApproximation (RWTree *aNode)
 Search for the best approximation in the tree.
void addSegmentIfTerminalNode (RWTree *aNode, std::vector< Point > &)
 Add a segment when on a terminal node.
double significance (int i)
 Get i-th significance.

Private Attributes

Auxiliary data
std::vector< int > _indexes
 Associated vector of indexes in chain.
std::vector< double > _significance
 Associated vector of significances.
RWTree_root
 Root of the chain tree.


Constructor & Destructor Documentation

qgar::RWSegmentVector::RWSegmentVector AbstractGenPointChain< int > &  aChain,
double  minDeviation = 1.9
 

Construct a polygonal approximation of a given chain.

Parameters:
aChain chain to approximate
minDeviation minimum deviation considered as good (default 1.9, which is an ad hoc value)

Definition at line 149 of file RWSegmentVector.C.

References _indexes, _root, qgar::AbstractGenPointChain< T >::accessCurrent(), addSegmentIfTerminalNode(), buildTree(), qgar::AbstractGenPointChain< T >::empty(), qgar::AbstractGenPointChain< T >::isAtEnd(), qgar::AbstractGenPointChain< T >::moveNext(), and qgar::AbstractGenPointChain< T >::setToBegin().

qgar::RWSegmentVector::~RWSegmentVector  )  [virtual]
 

Virtual destructor.

Definition at line 199 of file RWSegmentVector.C.


Member Function Documentation

void qgar::RWSegmentVector::addSegmentIfTerminalNode RWTree aNode,
std::vector< Point > & 
[private]
 

Add a segment when on a terminal node.

Referenced by RWSegmentVector().

RWTree* qgar::RWSegmentVector::buildTree std::vector< Point > &  ,
int  ,
int  ,
double 
[private]
 

Build the tree.

Referenced by RWSegmentVector().

void qgar::RWSegmentVector::searchBestApproximation RWTree aNode  )  [private]
 

Search for the best approximation in the tree.

Definition at line 287 of file RWSegmentVector.C.

References qgar::RWTree::leftChild(), qgar::RWTree::rightChild(), qgar::RWTree::setLeftChild(), qgar::RWTree::setRightChild(), qgar::RWTree::setSignificance(), significance(), and qgar::RWTree::significance().

double qgar::RWSegmentVector::significance int  i  )  [inline, private]
 

Get i-th significance.

Definition at line 487 of file RWSegmentVector.H.

References _significance.

Referenced by searchBestApproximation().


Member Data Documentation

std::vector<int> qgar::RWSegmentVector::_indexes [private]
 

Associated vector of indexes in chain.

Definition at line 430 of file RWSegmentVector.H.

Referenced by RWSegmentVector().

RWTree* qgar::RWSegmentVector::_root [private]
 

Root of the chain tree.

Definition at line 440 of file RWSegmentVector.H.

Referenced by RWSegmentVector().

std::vector<double> qgar::RWSegmentVector::_significance [private]
 

Associated vector of significances.

Definition at line 435 of file RWSegmentVector.H.

Referenced by significance().


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