DGtal 1.3.0
|
Aim: Computes the faithful polygon (FP) of a range of 4/8-connected 2D Points. More...
#include <DGtal/geometry/curves/FP.h>
Public Types | |
typedef DGtal::PointVector< 2, TInteger > | Point |
typedef DGtal::PointVector< 2, TInteger > | Vector |
typedef DGtal::PointVector< 2, double > | RealPoint |
typedef DGtal::PointVector< 2, double > | RealVector |
typedef DGtal::ArithmeticalDSSComputer< TIterator, TInteger, connectivity > | DSSComputer |
typedef std::list< Point > | Polygon |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((concepts::CInteger< TInteger >)) | |
FP (const TIterator &itb, const TIterator &ite) | |
~FP () | |
const Polygon & | polygon () const |
bool | isClosed () const |
bool | isValid () const |
Polygon::size_type | size () const |
template<typename OutputIterator > | |
OutputIterator | copyFP (OutputIterator result) const |
template<typename OutputIterator > | |
OutputIterator | copyMLP (OutputIterator result) const |
void | selfDisplay (std::ostream &out) const |
std::string | className () const |
Private Member Functions | |
template<typename Adapter > | |
Adapter * | initConvexityConcavity (typename Adapter::DSS &aDSS) |
template<typename Adapter > | |
bool | removingStep (Adapter *adapter) |
template<typename Adapter > | |
bool | addingStep (Adapter *adapter, const typename Adapter::DSS::ConstIterator &itEnd) |
template<typename Adapter > | |
void | addingStep (Adapter *adapter) |
void | algorithm (const TIterator &itb, const TIterator &ite) |
void | algorithm (const TIterator &itb, const TIterator &ite, IteratorType) |
void | algorithm (const TIterator &itb, const TIterator &ite, CirculatorType) |
bool | isValid (const Point &a, const Point &b, const Point &c) const |
bool | quadrant (const Vector &v, const int &q) const |
RealPoint | getRealPoint (const Point &a, const Point &b, const Point &c) const |
FP (const FP &other) | |
FP & | operator= (const FP &other) |
Private Attributes | |
Polygon | myPolygon |
Aim: Computes the faithful polygon (FP) of a range of 4/8-connected 2D Points.
The FP has several interesting properties:
It is computed in the course of the maximal digital straight segments computation, because in convex parts (resp. concave parts), the first and last upper (resp. lower) leaning points of segments that are maximal at the front or at the back are also vertices of the FP.
Usage:
Once the FP is computed, copyFP() is a way of geting its vertices. In the same way, copyMLP() is a way of getting the vertices of the MLP.
TIterator | type ConstIterator on 2D points, |
TInteger | (satisfying CInteger) |
connectivity | 4 for standard (4-connected) DSS or 8 for naive (8-connected) DSS. (Any other integers act as 8). |
typedef DGtal::ArithmeticalDSSComputer<TIterator,TInteger,connectivity> DGtal::FP< TIterator, TInteger, connectivity >::DSSComputer |
typedef DGtal::PointVector<2,TInteger> DGtal::FP< TIterator, TInteger, connectivity >::Point |
typedef DGtal::PointVector<2, double> DGtal::FP< TIterator, TInteger, connectivity >::RealPoint |
typedef DGtal::PointVector<2, double> DGtal::FP< TIterator, TInteger, connectivity >::RealVector |
typedef DGtal::PointVector<2,TInteger> DGtal::FP< TIterator, TInteger, connectivity >::Vector |
DGtal::FP< TIterator, TInteger, connectivity >::FP | ( | const TIterator & | itb, |
const TIterator & | ite | ||
) |
Constructor.
itb | begin iterator |
ite | end iterator |
DGtal::FP< TIterator, TInteger, connectivity >::~FP | ( | ) |
Destructor.
|
private |
Copy constructor.
other | the object to clone. Forbidden by default. |
|
private |
Adding step in the closed case
adapter | an Adapter to the current DSS |
Adapter | type that adapts a DSS computer |
|
private |
Adding step in the open case
adapter | an Adapter to the current DSS |
itEnd | end iterator used to stop the algorithm (when currentDSS.end() == itEnd ) |
Adapter | type that adapts a DSS computer |
|
private |
Main algorithm
itb | begin iterator |
ite | end iterator |
|
private |
Main algorithm overloading for circular iterator types (process as closed)
itb | begin iterator |
ite | end iterator |
|
private |
Main algorithm overloading for classic iterator types (process as open)
itb | begin iterator |
ite | end iterator |
DGtal::FP< TIterator, TInteger, connectivity >::BOOST_CONCEPT_ASSERT | ( | (concepts::CInteger< TInteger >) | ) |
std::string DGtal::FP< TIterator, TInteger, connectivity >::className | ( | ) | const |
OutputIterator DGtal::FP< TIterator, TInteger, connectivity >::copyFP | ( | OutputIterator | result | ) | const |
OutputIterator DGtal::FP< TIterator, TInteger, connectivity >::copyMLP | ( | OutputIterator | result | ) | const |
|
private |
A DSS adapter is returned according to the local convexity/concavity
aDSS | a DSS lying on the range to process |
Adapter | type that adapts a DSS computer |
bool DGtal::FP< TIterator, TInteger, connectivity >::isClosed | ( | ) | const |
bool DGtal::FP< TIterator, TInteger, connectivity >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
Referenced by testFP().
|
private |
Assignment.
other | the object to copy. |
const Polygon & DGtal::FP< TIterator, TInteger, connectivity >::polygon | ( | ) | const |
|
private |
Returns the quadrant number of a vector
v | any vector |
q | a quandrant number (0,1,2 or 3) |
|
private |
Removing step
adapter | an Adapter to the current DSS |
Adapter | type that adapts a DSS computer |
void DGtal::FP< TIterator, TInteger, connectivity >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Polygon::size_type DGtal::FP< TIterator, TInteger, connectivity >::size | ( | ) | const |