DGtal
0.6.devel
|
#include <GridCurve.h>
Public Types | |
typedef TKSpace | KSpace |
typedef KSpace::Point | Point |
typedef KSpace::Point | Vector |
typedef KSpace::SCell | SCell |
typedef std::vector< SCell > | Storage |
typedef Storage::const_iterator | const_iterator |
typedef Storage::const_iterator | ConstIterator |
typedef Storage::const_reverse_iterator | const_reverse_iterator |
typedef Storage::const_reverse_iterator | ConstReverseIterator |
typedef ConstRangeAdapter < typename Storage::const_iterator, DefaultFunctor, SCell > | SCellsRange |
typedef ConstRangeAdapter < typename Storage::const_iterator, SCellToPoint< KSpace >, Point > | PointsRange |
typedef ConstRangeAdapter < typename Storage::const_iterator, SCellToMidPoint< KSpace > , typename KSpace::Space::RealPoint > | MidPointsRange |
typedef ConstRangeAdapter < typename Storage::const_iterator, SCellToArrow< KSpace > , std::pair< Point, Vector > > | ArrowsRange |
typedef ConstRangeAdapter < typename Storage::const_iterator, SCellToInnerPoint< KSpace > , Point > | InnerPointsRange |
typedef ConstRangeAdapter < typename Storage::const_iterator, SCellToOuterPoint< KSpace > , Point > | OuterPointsRange |
typedef ConstRangeAdapter < typename Storage::const_iterator, SCellToIncidentPoints< KSpace > , std::pair< Point, Point > > | IncidentPointsRange |
typedef ConstRangeAdapter < typename Storage::const_iterator, SCellToCode< KSpace >, char > | CodesRange |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((CCellularGridSpaceND< KSpace >)) | |
~GridCurve () | |
GridCurve (const KSpace &aKSpace) | |
GridCurve () | |
GridCurve (const GridCurve &other) | |
GridCurve & | operator= (const GridCurve &other) |
std::string | className () const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
bool | initFromVectorStream (std::istream &in) |
void | writeVectorToStream (std::ostream &out) |
bool | initFromVector (const std::vector< Point > &aVectorOfPoints) |
bool | initFromPointsVector (const std::vector< Point > &aVectorOfPoints) |
template<typename TIterator > | |
bool | initFromPointsRange (const TIterator &itb, const TIterator &ite) |
bool | initFromSCellsVector (const std::vector< SCell > &aVectorOfSCells) |
template<typename TIterator > | |
bool | initFromSCellsRange (const TIterator &itb, const TIterator &ite) |
bool | isClosed () const |
bool | isOpen () const |
ConstIterator | begin () const |
ConstIterator | end () const |
ConstReverseIterator | rbegin () const |
ConstReverseIterator | rend () const |
SCell | back () const |
void | push_back (const SCell &aSCell) |
void | pushBack (const SCell &aSCell) |
Storage::size_type | size () const |
SCellsRange | getSCellsRange () const |
PointsRange | getPointsRange () const |
MidPointsRange | getMidPointsRange () const |
ArrowsRange | getArrowsRange () const |
InnerPointsRange | getInnerPointsRange () const |
OuterPointsRange | getOuterPointsRange () const |
IncidentPointsRange | getIncidentPointsRange () const |
GridCurve::CodesRange | getCodesRange () const |
Private Member Functions | |
SCell | PointVectorTo1SCell (const Point &aPoint, const Vector &aVector) |
bool | isInside (const SCell &aSCell) const |
Private Attributes | |
const KSpace * | myKPtr |
bool | myFlagIsOwned |
Storage | mySCells |
Aim: describes, in a cellular space of dimension n, a closed of open sequence of signed d-cells (or d-scells), d being either equal to 1 or (n-1).
For instance, the topological boundary of a simply connected digital set is a closed sequence of 1-scells in 2d.
TKSpace | Khalimsky space, a model of CCellularGridSpaceND |
Using the namespace Z2i, defined in StdDefs.h, you can instanciate a grid curve as follows:
This object provides several IO services. For instance, you can read a grid curve from a data file, which contains the (digital) coordinates of the 0-cells (pointels) in nd:
Note that if the first and last 0-scells of the file have the same coordinates (i) or if only one of their coordinates differ by 1 (ii), then the grid curve is considered as closed, ie. scells directly incident to the last signed cell and indirectly incident to the first signed cell are the same.
You can also build a grid curve from the contour of a digital set as follows:
To save a grid curve in a data file, GridCurve provides the special method writeVectorToStream():
The stream mechanism is used to display the true content of the grid curve:
In 2d, the grid curve can be drawn in a vector graphics file as follows:
See Board2D: a stream mechanism for displaying 2D digital objects to learn more about the 2d drawing mechanism used in DGtal.
Moreover, this object provides several ranges as nested types:
You can get an access to these eight ranges through the following methods:
Each range can be displayed in the standard output or can be drawn (except CodesRange) in a vector graphics file as shown in the following snippet:
Moreover, each range has the following inner types:
And each range provides these (circular)iterator services:
You can use these services to iterate over the elements of a given range as follows:
Definition at line 170 of file GridCurve.h.
typedef ConstRangeAdapter< typename Storage::const_iterator, SCellToArrow<KSpace>, std::pair<Point,Vector> > DGtal::GridCurve< TKSpace >::ArrowsRange |
Definition at line 443 of file GridCurve.h.
typedef ConstRangeAdapter< typename Storage::const_iterator, SCellToCode<KSpace>, char > DGtal::GridCurve< TKSpace >::CodesRange |
Definition at line 489 of file GridCurve.h.
typedef Storage::const_iterator DGtal::GridCurve< TKSpace >::const_iterator |
Definition at line 311 of file GridCurve.h.
typedef Storage::const_reverse_iterator DGtal::GridCurve< TKSpace >::const_reverse_iterator |
Definition at line 313 of file GridCurve.h.
typedef Storage::const_iterator DGtal::GridCurve< TKSpace >::ConstIterator |
Definition at line 312 of file GridCurve.h.
typedef Storage::const_reverse_iterator DGtal::GridCurve< TKSpace >::ConstReverseIterator |
Definition at line 314 of file GridCurve.h.
typedef ConstRangeAdapter< typename Storage::const_iterator, SCellToIncidentPoints<KSpace>, std::pair<Point, Point> > DGtal::GridCurve< TKSpace >::IncidentPointsRange |
Definition at line 479 of file GridCurve.h.
typedef ConstRangeAdapter< typename Storage::const_iterator, SCellToInnerPoint<KSpace>, Point > DGtal::GridCurve< TKSpace >::InnerPointsRange |
Definition at line 455 of file GridCurve.h.
typedef TKSpace DGtal::GridCurve< TKSpace >::KSpace |
Definition at line 174 of file GridCurve.h.
typedef ConstRangeAdapter< typename Storage::const_iterator, SCellToMidPoint<KSpace>, typename KSpace::Space::RealPoint > DGtal::GridCurve< TKSpace >::MidPointsRange |
Definition at line 431 of file GridCurve.h.
typedef ConstRangeAdapter< typename Storage::const_iterator, SCellToOuterPoint<KSpace>, Point > DGtal::GridCurve< TKSpace >::OuterPointsRange |
Definition at line 467 of file GridCurve.h.
typedef KSpace::Point DGtal::GridCurve< TKSpace >::Point |
Definition at line 177 of file GridCurve.h.
typedef ConstRangeAdapter< typename Storage::const_iterator, SCellToPoint<KSpace>, Point > DGtal::GridCurve< TKSpace >::PointsRange |
Definition at line 419 of file GridCurve.h.
typedef KSpace::SCell DGtal::GridCurve< TKSpace >::SCell |
Definition at line 180 of file GridCurve.h.
typedef ConstRangeAdapter< typename Storage::const_iterator, DefaultFunctor, SCell > DGtal::GridCurve< TKSpace >::SCellsRange |
Definition at line 408 of file GridCurve.h.
typedef std::vector<SCell> DGtal::GridCurve< TKSpace >::Storage |
Definition at line 181 of file GridCurve.h.
typedef KSpace::Point DGtal::GridCurve< TKSpace >::Vector |
Definition at line 178 of file GridCurve.h.
DGtal::GridCurve< TKSpace >::~GridCurve | ( | ) |
DGtal::GridCurve< TKSpace >::GridCurve | ( | const KSpace & | aKSpace | ) |
Constructor.
aKSpace | the Khalimsky space where the grid curve lies. |
Definition at line 57 of file GridCurve.ih.
DGtal::GridCurve< TKSpace >::GridCurve | ( | ) |
Default Constructor. (the underlying Khalimsky space is default constructed).
Definition at line 51 of file GridCurve.ih.
DGtal::GridCurve< TKSpace >::GridCurve | ( | const GridCurve< TKSpace > & | other | ) |
Copy constructor.
other | the object to clone. |
Definition at line 63 of file GridCurve.ih.
References DGtal::GridCurve< TKSpace >::myFlagIsOwned, and DGtal::GridCurve< TKSpace >::myKPtr.
|
inline |
Definition at line 358 of file GridCurve.ih.
References DGtal::GridCurve< TKSpace >::back().
Referenced by DGtal::GridCurve< TKSpace >::back().
|
inline |
Definition at line 326 of file GridCurve.ih.
References DGtal::GridCurve< TKSpace >::begin().
Referenced by DGtal::GridCurve< TKSpace >::begin(), and DGtal::GridCurve< TKSpace >::isClosed().
DGtal::GridCurve< TKSpace >::BOOST_CONCEPT_ASSERT | ( | (CCellularGridSpaceND< KSpace >) | ) |
|
inline |
Definition at line 405 of file GridCurve.ih.
|
inline |
Definition at line 334 of file GridCurve.ih.
References DGtal::GridCurve< TKSpace >::end().
Referenced by DGtal::GridCurve< TKSpace >::end().
|
inline |
Definition at line 448 of file GridCurve.h.
References DGtal::GridCurve< TKSpace >::mySCells.
|
inline |
Definition at line 494 of file GridCurve.h.
References DGtal::GridCurve< TKSpace >::mySCells.
|
inline |
Definition at line 484 of file GridCurve.h.
References DGtal::GridCurve< TKSpace >::mySCells.
|
inline |
Definition at line 460 of file GridCurve.h.
References DGtal::GridCurve< TKSpace >::mySCells.
|
inline |
Definition at line 436 of file GridCurve.h.
References DGtal::GridCurve< TKSpace >::mySCells.
|
inline |
Definition at line 472 of file GridCurve.h.
References DGtal::GridCurve< TKSpace >::mySCells.
|
inline |
Definition at line 424 of file GridCurve.h.
References DGtal::GridCurve< TKSpace >::mySCells.
|
inline |
Definition at line 413 of file GridCurve.h.
References DGtal::GridCurve< TKSpace >::mySCells.
Referenced by DGtal::Display3DFactory::draw().
|
inline |
Init from a range of points.
itb | begin iterator |
ite | end iterator |
Definition at line 164 of file GridCurve.ih.
|
inline |
Init from a STL vector of points.
aVectorOfPoints | the vector containing a sequence of grid points (digital coordinates). |
Definition at line 147 of file GridCurve.ih.
|
inline |
Init from a range of signed cells.
itb | begin iterator |
ite | end iterator |
Definition at line 223 of file GridCurve.ih.
References DGtal::GridCurve< TKSpace >::push_back().
|
inline |
Init from a STL vector of signed cells.
aVectorOfSCells | the vector containing the sequence of signed cells. |
Definition at line 206 of file GridCurve.ih.
|
inline |
Deprecated name, use initFromPointsVector instead Init.
aVectorOfPoints | the vector containing a sequence of grid points (digital coordinates). |
Definition at line 139 of file GridCurve.ih.
|
inline |
Init.
in | any input stream, |
Definition at line 264 of file GridCurve.ih.
References DGtal::PointListReader< TPoint >::getPointsFromInputStream().
|
inline |
Checks whether the grid curve is open or closed. Signed cells directly incident to the last scell and indirectly incident to the first scell should be the same in case of a closed grid curve.
Definition at line 305 of file GridCurve.ih.
References DGtal::GridCurve< TKSpace >::begin().
|
inlineprivate |
aSCell | any signed cell |
Definition at line 123 of file GridCurve.ih.
|
inline |
Definition at line 317 of file GridCurve.ih.
|
inline |
Checks the validity/consistency of the object.
Definition at line 96 of file GridCurve.ih.
DGtal::GridCurve< TKSpace > & DGtal::GridCurve< TKSpace >::operator= | ( | const GridCurve< TKSpace > & | other | ) |
Assignment.
other | the object to copy. |
Definition at line 74 of file GridCurve.ih.
References DGtal::GridCurve< TKSpace >::myFlagIsOwned, DGtal::GridCurve< TKSpace >::myKPtr, and DGtal::GridCurve< TKSpace >::mySCells.
|
inlineprivate |
aPoint | any point |
aVector | any vector of L1 norm equal to 1 |
Definition at line 109 of file GridCurve.ih.
|
inline |
Back insertion of aSCell
aSCell | any signed cell |
Definition at line 366 of file GridCurve.ih.
Referenced by DGtal::GridCurve< TKSpace >::initFromSCellsRange(), and DGtal::GridCurve< TKSpace >::pushBack().
|
inline |
Back insertion of aSCell
aSCell | any signed cell |
Definition at line 374 of file GridCurve.ih.
References DGtal::GridCurve< TKSpace >::push_back().
|
inline |
Definition at line 342 of file GridCurve.ih.
References DGtal::GridCurve< TKSpace >::rbegin().
Referenced by DGtal::GridCurve< TKSpace >::rbegin().
|
inline |
Definition at line 350 of file GridCurve.ih.
References DGtal::GridCurve< TKSpace >::rend().
Referenced by DGtal::GridCurve< TKSpace >::rend().
|
inline |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Definition at line 392 of file GridCurve.ih.
Referenced by DGtal::operator<<().
|
inline |
Definition at line 382 of file GridCurve.ih.
References DGtal::GridCurve< TKSpace >::size().
Referenced by DGtal::GridCurve< TKSpace >::size().
|
inline |
Outputs the grid curve to the stream out.
out | any output stream, |
Definition at line 286 of file GridCurve.ih.
References DGtal::ConstRangeAdapter< TIterator, TFunctor, TReturnType >::begin(), and DGtal::ConstRangeAdapter< TIterator, TFunctor, TReturnType >::end().
|
private |
bool equal to 'true' if this owns the Khalimsky space but 'false' otherwise
Definition at line 370 of file GridCurve.h.
Referenced by DGtal::GridCurve< TKSpace >::GridCurve(), and DGtal::GridCurve< TKSpace >::operator=().
|
private |
Pointer on a Khalimsky space
Definition at line 365 of file GridCurve.h.
Referenced by DGtal::GridCurve< TKSpace >::GridCurve(), and DGtal::GridCurve< TKSpace >::operator=().
|
private |
list of signed cells
Definition at line 375 of file GridCurve.h.
Referenced by DGtal::GridCurve< TKSpace >::getArrowsRange(), DGtal::GridCurve< TKSpace >::getCodesRange(), DGtal::GridCurve< TKSpace >::getIncidentPointsRange(), DGtal::GridCurve< TKSpace >::getInnerPointsRange(), DGtal::GridCurve< TKSpace >::getMidPointsRange(), DGtal::GridCurve< TKSpace >::getOuterPointsRange(), DGtal::GridCurve< TKSpace >::getPointsRange(), DGtal::GridCurve< TKSpace >::getSCellsRange(), and DGtal::GridCurve< TKSpace >::operator=().