DGtal
0.6.devel
|
#include <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::ArithmeticalDSS < TIterator, TInteger, connectivity > | DSSComputer |
typedef DGtal::ArithmeticalDSS < DGtal::Circulator< TIterator > , TInteger, connectivity > | DSSComputerInLoop |
typedef std::list< Point > | Polygon |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((CInteger< TInteger >)) | |
FP (const TIterator &itb, const TIterator &ite) throw ( InputException ) | |
FP (const TIterator &itb, const TIterator &ite, const bool &isClosed) throw ( InputException ) | |
~FP () | |
const Polygon & | polygon () const |
bool | flagIsClosed () 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 DSS , typename Adapter > | |
bool | initConvexityConcavity (DSS &aDSS, Adapter *&anAdapter, const typename DSS::ConstIterator &i) |
template<typename DSS , typename Adapter > | |
void | mainAlgorithm (DSS ¤tDSS, Adapter *adapter, bool isConvex, typename DSS::ConstIterator i, const typename DSS::ConstIterator &end) throw ( InputException ) |
RealPoint | getRealPoint (const Point &a, const Point &b, const Point &c) const |
bool | quadrant (const Vector &v, const int &q) const |
FP (const FP &other) | |
FP & | operator= (const FP &other) |
Private Attributes | |
Polygon | myPolygon |
bool | myFlagIsClosed |
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' | type of scalars used for the DSS parameters (satisfying CInteger) |
'connectivity' | an integer equal to 4 for standard (4-connected) DSS or 8 for naive (8-connected) DSS. (Any other integers act as 8). |
typedef DGtal::ArithmeticalDSS<TIterator,TInteger,connectivity> DGtal::FP< TIterator, TInteger, connectivity >::DSSComputer |
typedef DGtal::ArithmeticalDSS<DGtal::Circulator<TIterator>,TInteger,connectivity> DGtal::FP< TIterator, TInteger, connectivity >::DSSComputerInLoop |
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 |
|
inline |
|
inline |
Constructor.
itb | begin iterator |
ite | end iterator |
isClosed | 'true' if the range has to be considered as circular, 'false' otherwise. |
Definition at line 161 of file FP.ih.
References DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::extendBackward(), DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::extendForward(), DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::getLf(), and DGtal::ArithmeticalDSS< TIterator, TInteger, connectivity >::getUf().
|
private |
Copy constructor.
other | the object to clone. Forbidden by default. |
DGtal::FP< TIterator, TInteger, connectivity >::BOOST_CONCEPT_ASSERT | ( | (CInteger< TInteger >) | ) |
|
inline |
Default drawing style object.
mode | the drawing mode. |
Definition at line 466 of file FP.ih.
Referenced by DGtal::Display2DFactory::draw().
|
inline |
|
inline |
Definition at line 346 of file FP.ih.
Referenced by DGtal::MLPLengthEstimator< TConstIterator >::init().
|
inline |
Definition at line 282 of file FP.h.
References DGtal::FP< TIterator, TInteger, connectivity >::myFlagIsClosed.
Referenced by DGtal::Display2DFactory::drawAsPolygon().
|
inlineprivate |
Gets a MLP vertex from three consecutive vertices of the FP.
Definition at line 397 of file FP.ih.
|
inlineprivate |
A DSS adapter is chosen according to the local convexity/concavity
aDSS | a DSS lying on the range to process |
anAdapter | an Adapter to aDSS for convex part when 'true' is returned, for concave part otherwise |
i | an iterator pointing after the front of aDSS |
Definition at line 47 of file FP.ih.
|
inline |
|
inlineprivate |
Main algorithm
currentDSS | a DSS lying on the range to process |
adapter | an Adapter to currentDSS |
isConvex,'true' | if currentDSS is in a convex part, 'false' otherwise |
i | an iterator pointing after the front of currentDSS |
end | iterator used to stop the algorithm (when i == end ) |
Definition at line 67 of file FP.ih.
|
private |
Assignment.
other | the object to copy. |
|
inline |
Definition at line 274 of file FP.h.
References DGtal::FP< TIterator, TInteger, connectivity >::myPolygon.
Referenced by DGtal::Display2DFactory::drawAsPolygon().
|
inlineprivate |
Returns the quadrant number of a vector
v | any ector |
q | a quandrant number (0,1,2 or 3) |
Definition at line 443 of file FP.ih.
|
inline |
|
inline |
Definition at line 324 of file FP.ih.
Referenced by DGtal::FPLengthEstimator< TConstIterator >::init(), and DGtal::MLPLengthEstimator< TConstIterator >::init().
|
private |
Definition at line 330 of file FP.h.
Referenced by DGtal::FP< TIterator, TInteger, connectivity >::flagIsClosed().
|
private |
Definition at line 324 of file FP.h.
Referenced by DGtal::FP< TIterator, TInteger, connectivity >::polygon().