DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes
DGtal::GridCurve< TKSpace > Class Template Reference

Aim: describes, in a cellular space of dimension n, a closed or open sequence of signed d-cells (or d-scells), d being either equal to 1 or (n-1). More...

#include <DGtal/geometry/curves/GridCurve.h>

Public Types

typedef TKSpace KSpace
 
typedef KSpace::Point Point
 
typedef KSpace::Point Vector
 
typedef KSpace::SCell SCell
 
typedef std::vector< SCellStorage
 
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, functors::Identity, SCellSCellsRange
 
typedef ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToPoint< KSpace >, PointPointsRange
 
typedef ConstRangeAdapter< typename Storage::const_iterator, CanonicSCellEmbedder< KSpace >, typename KSpace::Space::RealPoint > MidPointsRange
 
typedef ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToArrow< KSpace >, std::pair< Point, Vector > > ArrowsRange
 
typedef ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToInnerPoint< KSpace >, PointInnerPointsRange
 
typedef ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToOuterPoint< KSpace >, PointOuterPointsRange
 
typedef ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToIncidentPoints< KSpace >, std::pair< Point, Point > > IncidentPointsRange
 
typedef ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToCode< KSpace >, char > CodesRange
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CCellularGridSpaceND< KSpace >))
 
 ~GridCurve ()
 
 GridCurve (ConstAlias< KSpace > aKSpace)
 
 GridCurve ()
 
 GridCurve (const GridCurve &other)
 
GridCurveoperator= (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 KSpacemyKPtr
 
bool myFlagIsOwned
 
Storage mySCells
 

Detailed Description

template<typename TKSpace = KhalimskySpaceND<2>>
class DGtal::GridCurve< TKSpace >

Aim: describes, in a cellular space of dimension n, a closed or 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.

Template Parameters
TKSpaceKhalimsky space, a model of CCellularGridSpaceND

Using the namespace Z2i, defined in StdDefs.h, you can instanciate a grid curve as follows:

//default construction
Curve c1;
//from a Khalimsky space
K2 ks; ks.init( lowerBound, upperBound, true );
Curve c2( ks );
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.

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:

fstream inputStream;
inputStream.open (square.c_str(), ios::in);
c1.initFromVectorStream(inputStream);
inputStream.close();

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:

vector<SCell> contour; //contour
SurfelAdjacency<K2::dimension> sAdj( true ); //adjacency
//tracking and init grid curve
SCell s = Surfaces<KSpace>::findABel( ks, set, 1000 );
Surfaces<KSpace>::track2DBoundary( contour, ks, sAdj, set, s );
c2.initFromSCellsVector( contour );
static SCell findABel(const KSpace &K, const PointPredicate &pp, unsigned int nbtries=1000)
static void track2DBoundary(std::vector< SCell > &aSCellContour2D, const KSpace &K, const SurfelAdjacency< KSpace::dimension > &surfel_adj, const PointPredicate &pp, const SCell &start_surfel)
Aim: Represent adjacencies between surfel elements, telling if it follows an interior to exterior ord...
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.

To save a grid curve in a data file, GridCurve provides the special method writeVectorToStream():

ofstream outputStream("myGridCurve.dat");
if (outputStream.is_open())
c2.writeVectorToStream(outputStream);
outputStream.close();

The stream mechanism is used to display the true content of the grid curve:

trace.info() << c1 << std::endl;
std::ostream & info()
Trace trace
Definition: Common.h:154

In 2d, the grid curve can be drawn in a vector graphics file as follows:

Board2D aBoard;
aBoard << c2;
aBoard.saveEPS( "myGridCurve.eps", Board2D::BoundingBox, 5000 );
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Definition: Board2D.h:71
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition: Board.cpp:805
void setUnit(Unit unit)
Definition: Board.cpp:240

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:

Curve::IncidentPointsRange r = c1.getIncidentPointsRange();
trace.info() << r << endl;
aBoard << SetMode(aDomain.className(), "Grid") << aDomain;
aBoard << r;
aBoard.saveEPS( "MyIncidentPointsRange.eps", Board2D::BoundingBox, 5000 );
Modifier class in a Board2D stream. Useful to choose your own mode for a given class....
Definition: Board2D.h:247

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:

trace.info() << "\t iterate over the range" << endl;
Range::ConstIterator it = r.begin();
Range::ConstIterator itEnd = r.end();
for ( ; it != itEnd; ++it)
{
trace.info() << *it;
}
trace.info() << endl;
trace.info() << "\t iterate over the range in the reverse way" << endl;
Range::ConstReverseIterator rit = r.rbegin();
Range::ConstReverseIterator ritEnd = r.rend();
for ( ; rit != ritEnd; ++rit)
{
trace.info() << *rit;
}
trace.info() << endl;
trace.info() << "\t iterate over the range in a circular way" << endl;
//set the starting element wherever you want...
for (unsigned i = 0; i < 20; ++i) ++c;
//... and circulate
do
{
trace.info() << *c;
c++;
} while (c!=cend);
trace.info() << endl;
DGtal::Circulator< ConstIterator > ConstCirculator
std::reverse_iterator< ConstIterator > ConstReverseIterator
See also
exampleGridCurve2d.cpp testGridCurve.cpp
Examples
geometry/curves/estimation/exampleCurvature.cpp, geometry/curves/exampleGridCurve3d-2.cpp, geometry/curves/exampleGridCurve3d.cpp, geometry/surfaces/dvcm-2d-curvature.cpp, and geometry/tools/exampleAlphaShape.cpp.

Definition at line 172 of file GridCurve.h.

Member Typedef Documentation

◆ ArrowsRange

template<typename TKSpace = KhalimskySpaceND<2>>
typedef ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToArrow<KSpace>, std::pair<Point,Vector> > DGtal::GridCurve< TKSpace >::ArrowsRange

Definition at line 445 of file GridCurve.h.

◆ CodesRange

template<typename TKSpace = KhalimskySpaceND<2>>
typedef ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToCode<KSpace>, char > DGtal::GridCurve< TKSpace >::CodesRange

Definition at line 491 of file GridCurve.h.

◆ const_iterator

template<typename TKSpace = KhalimskySpaceND<2>>
typedef Storage::const_iterator DGtal::GridCurve< TKSpace >::const_iterator

Definition at line 313 of file GridCurve.h.

◆ const_reverse_iterator

template<typename TKSpace = KhalimskySpaceND<2>>
typedef Storage::const_reverse_iterator DGtal::GridCurve< TKSpace >::const_reverse_iterator

Definition at line 315 of file GridCurve.h.

◆ ConstIterator

template<typename TKSpace = KhalimskySpaceND<2>>
typedef Storage::const_iterator DGtal::GridCurve< TKSpace >::ConstIterator

Definition at line 314 of file GridCurve.h.

◆ ConstReverseIterator

template<typename TKSpace = KhalimskySpaceND<2>>
typedef Storage::const_reverse_iterator DGtal::GridCurve< TKSpace >::ConstReverseIterator

Definition at line 316 of file GridCurve.h.

◆ IncidentPointsRange

template<typename TKSpace = KhalimskySpaceND<2>>
typedef ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToIncidentPoints<KSpace>, std::pair<Point, Point> > DGtal::GridCurve< TKSpace >::IncidentPointsRange

Definition at line 481 of file GridCurve.h.

◆ InnerPointsRange

template<typename TKSpace = KhalimskySpaceND<2>>
typedef ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToInnerPoint<KSpace>, Point > DGtal::GridCurve< TKSpace >::InnerPointsRange

Definition at line 457 of file GridCurve.h.

◆ KSpace

template<typename TKSpace = KhalimskySpaceND<2>>
typedef TKSpace DGtal::GridCurve< TKSpace >::KSpace

Definition at line 176 of file GridCurve.h.

◆ MidPointsRange

template<typename TKSpace = KhalimskySpaceND<2>>
typedef ConstRangeAdapter< typename Storage::const_iterator, CanonicSCellEmbedder<KSpace>, typename KSpace::Space::RealPoint > DGtal::GridCurve< TKSpace >::MidPointsRange

Definition at line 433 of file GridCurve.h.

◆ OuterPointsRange

template<typename TKSpace = KhalimskySpaceND<2>>
typedef ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToOuterPoint<KSpace>, Point > DGtal::GridCurve< TKSpace >::OuterPointsRange

Definition at line 469 of file GridCurve.h.

◆ Point

template<typename TKSpace = KhalimskySpaceND<2>>
typedef KSpace::Point DGtal::GridCurve< TKSpace >::Point

Definition at line 179 of file GridCurve.h.

◆ PointsRange

template<typename TKSpace = KhalimskySpaceND<2>>
typedef ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToPoint<KSpace>, Point > DGtal::GridCurve< TKSpace >::PointsRange

Definition at line 421 of file GridCurve.h.

◆ SCell

template<typename TKSpace = KhalimskySpaceND<2>>
typedef KSpace::SCell DGtal::GridCurve< TKSpace >::SCell

Definition at line 182 of file GridCurve.h.

◆ SCellsRange

template<typename TKSpace = KhalimskySpaceND<2>>
typedef ConstRangeAdapter< typename Storage::const_iterator, functors::Identity, SCell > DGtal::GridCurve< TKSpace >::SCellsRange

Definition at line 410 of file GridCurve.h.

◆ Storage

template<typename TKSpace = KhalimskySpaceND<2>>
typedef std::vector<SCell> DGtal::GridCurve< TKSpace >::Storage

Definition at line 183 of file GridCurve.h.

◆ Vector

template<typename TKSpace = KhalimskySpaceND<2>>
typedef KSpace::Point DGtal::GridCurve< TKSpace >::Vector

Definition at line 180 of file GridCurve.h.

Constructor & Destructor Documentation

◆ ~GridCurve()

template<typename TKSpace = KhalimskySpaceND<2>>
DGtal::GridCurve< TKSpace >::~GridCurve ( )

Destructor.

◆ GridCurve() [1/3]

template<typename TKSpace = KhalimskySpaceND<2>>
DGtal::GridCurve< TKSpace >::GridCurve ( ConstAlias< KSpace aKSpace)

Constructor.

Parameters
aKSpacethe Khalimsky space where the grid curve lies.

◆ GridCurve() [2/3]

template<typename TKSpace = KhalimskySpaceND<2>>
DGtal::GridCurve< TKSpace >::GridCurve ( )

Default Constructor. (the underlying Khalimsky space is default constructed).

◆ GridCurve() [3/3]

template<typename TKSpace = KhalimskySpaceND<2>>
DGtal::GridCurve< TKSpace >::GridCurve ( const GridCurve< TKSpace > &  other)

Copy constructor.

Parameters
otherthe object to clone.

Member Function Documentation

◆ back()

template<typename TKSpace = KhalimskySpaceND<2>>
SCell DGtal::GridCurve< TKSpace >::back ( ) const
Returns
last scell

◆ begin()

template<typename TKSpace = KhalimskySpaceND<2>>
ConstIterator DGtal::GridCurve< TKSpace >::begin ( ) const
Returns
begin iterator on scells

Referenced by testL1LengthEstimator().

◆ BOOST_CONCEPT_ASSERT()

template<typename TKSpace = KhalimskySpaceND<2>>
DGtal::GridCurve< TKSpace >::BOOST_CONCEPT_ASSERT ( (concepts::CCellularGridSpaceND< KSpace >)  )

◆ className()

template<typename TKSpace = KhalimskySpaceND<2>>
std::string DGtal::GridCurve< TKSpace >::className ( ) const
Returns
the style name used for drawing this object.

Referenced by testDigitization().

◆ end()

template<typename TKSpace = KhalimskySpaceND<2>>
ConstIterator DGtal::GridCurve< TKSpace >::end ( ) const
Returns
end iterator on scells

Referenced by testL1LengthEstimator().

◆ getArrowsRange()

template<typename TKSpace = KhalimskySpaceND<2>>
ArrowsRange DGtal::GridCurve< TKSpace >::getArrowsRange ( ) const
inline
Returns
an instance of ArrowsRange
Examples
geometry/curves/exampleGridCurve3d.cpp.

Definition at line 450 of file GridCurve.h.

450 {
451 return ArrowsRange(mySCells.begin(), mySCells.end(), new functors::SCellToArrow<KSpace>(*myKPtr) );
452 }
const KSpace * myKPtr
Definition: GridCurve.h:367
Storage mySCells
Definition: GridCurve.h:377
ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToArrow< KSpace >, std::pair< Point, Vector > > ArrowsRange
Definition: GridCurve.h:445

References DGtal::GridCurve< TKSpace >::myKPtr, and DGtal::GridCurve< TKSpace >::mySCells.

Referenced by main(), testL1LengthEstimator(), and testSegmentation().

◆ getCodesRange()

template<typename TKSpace = KhalimskySpaceND<2>>
GridCurve::CodesRange DGtal::GridCurve< TKSpace >::getCodesRange ( ) const
inline
Returns
an instance of CodesRange

Definition at line 496 of file GridCurve.h.

496 {
497 return CodesRange( mySCells.begin(), mySCells.end(), new functors::SCellToCode<KSpace>(*myKPtr) );
498 }
ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToCode< KSpace >, char > CodesRange
Definition: GridCurve.h:491

References DGtal::GridCurve< TKSpace >::myKPtr, and DGtal::GridCurve< TKSpace >::mySCells.

Referenced by main().

◆ getIncidentPointsRange()

template<typename TKSpace = KhalimskySpaceND<2>>
IncidentPointsRange DGtal::GridCurve< TKSpace >::getIncidentPointsRange ( ) const
inline
Returns
an instance of IncidentPointsRange
Examples
geometry/curves/estimation/exampleCurvature.cpp, and geometry/curves/exampleGridCurve3d-2.cpp.

Definition at line 486 of file GridCurve.h.

486 {
487 return IncidentPointsRange(mySCells.begin(), mySCells.end(), new functors::SCellToIncidentPoints<KSpace>(*myKPtr) );
488 }
ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToIncidentPoints< KSpace >, std::pair< Point, Point > > IncidentPointsRange
Definition: GridCurve.h:481

References DGtal::GridCurve< TKSpace >::myKPtr, and DGtal::GridCurve< TKSpace >::mySCells.

Referenced by estimatorOnShapeDigitization(), main(), and testDisplayDTFromCircle().

◆ getInnerPointsRange()

template<typename TKSpace = KhalimskySpaceND<2>>
InnerPointsRange DGtal::GridCurve< TKSpace >::getInnerPointsRange ( ) const
inline
Returns
an instance of ArrowsRange
Examples
geometry/curves/exampleGridCurve3d-2.cpp, and geometry/tools/exampleAlphaShape.cpp.

Definition at line 462 of file GridCurve.h.

462 {
463 return InnerPointsRange(mySCells.begin(), mySCells.end(), new functors::SCellToInnerPoint<KSpace>(*myKPtr) );
464 }
ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToInnerPoint< KSpace >, Point > InnerPointsRange
Definition: GridCurve.h:457

References DGtal::GridCurve< TKSpace >::myKPtr, and DGtal::GridCurve< TKSpace >::mySCells.

Referenced by alphaShape(), main(), and testDisplayDTFromCircle().

◆ getMidPointsRange()

template<typename TKSpace = KhalimskySpaceND<2>>
MidPointsRange DGtal::GridCurve< TKSpace >::getMidPointsRange ( ) const
inline
Returns
an instance of MidPointsRange
Examples
geometry/curves/exampleGridCurve3d.cpp.

Definition at line 438 of file GridCurve.h.

438 {
439 return MidPointsRange(mySCells.begin(), mySCells.end(), new CanonicSCellEmbedder<KSpace>(*myKPtr) );
440 }
ConstRangeAdapter< typename Storage::const_iterator, CanonicSCellEmbedder< KSpace >, typename KSpace::Space::RealPoint > MidPointsRange
Definition: GridCurve.h:433

References DGtal::GridCurve< TKSpace >::myKPtr, and DGtal::GridCurve< TKSpace >::mySCells.

Referenced by main().

◆ getOuterPointsRange()

template<typename TKSpace = KhalimskySpaceND<2>>
OuterPointsRange DGtal::GridCurve< TKSpace >::getOuterPointsRange ( ) const
inline
Returns
an instance of OuterPointsRange
Examples
geometry/curves/exampleGridCurve3d-2.cpp.

Definition at line 474 of file GridCurve.h.

474 {
475 return OuterPointsRange(mySCells.begin(), mySCells.end(), new functors::SCellToOuterPoint<KSpace>(*myKPtr) );
476 }
ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToOuterPoint< KSpace >, Point > OuterPointsRange
Definition: GridCurve.h:469

References DGtal::GridCurve< TKSpace >::myKPtr, and DGtal::GridCurve< TKSpace >::mySCells.

Referenced by main(), and testDisplayDTFromCircle().

◆ getPointsRange()

template<typename TKSpace = KhalimskySpaceND<2>>
PointsRange DGtal::GridCurve< TKSpace >::getPointsRange ( ) const
inline
Returns
an instance of PointsRange
Examples
geometry/curves/exampleGridCurve3d.cpp.

Definition at line 426 of file GridCurve.h.

426 {
427 return PointsRange(mySCells.begin(), mySCells.end(), new functors::SCellToPoint<KSpace>(*myKPtr) );
428 }
ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToPoint< KSpace >, Point > PointsRange
Definition: GridCurve.h:421

References DGtal::GridCurve< TKSpace >::myKPtr, and DGtal::GridCurve< TKSpace >::mySCells.

Referenced by compare(), main(), testCompareEstimator(), testL1LengthEstimator(), testSegmentation(), and testTrueLocalEstimatorOnShapeDigitization().

◆ getSCellsRange()

template<typename TKSpace = KhalimskySpaceND<2>>
SCellsRange DGtal::GridCurve< TKSpace >::getSCellsRange ( ) const
inline
Returns
an instance of SCellsRange
Examples
geometry/curves/exampleGridCurve3d.cpp.

Definition at line 415 of file GridCurve.h.

415 {
416 return SCellsRange(mySCells.begin(), mySCells.end(), new functors::Identity() );
417 }
ConstRangeAdapter< typename Storage::const_iterator, functors::Identity, SCell > SCellsRange
Definition: GridCurve.h:410

References DGtal::GridCurve< TKSpace >::mySCells.

Referenced by main().

◆ initFromPointsRange()

template<typename TKSpace = KhalimskySpaceND<2>>
template<typename TIterator >
bool DGtal::GridCurve< TKSpace >::initFromPointsRange ( const TIterator &  itb,
const TIterator &  ite 
)

Init from a range of points.

Parameters
itbbegin iterator
iteend iterator

Referenced by compare(), and main().

◆ initFromPointsVector()

template<typename TKSpace = KhalimskySpaceND<2>>
bool DGtal::GridCurve< TKSpace >::initFromPointsVector ( const std::vector< Point > &  aVectorOfPoints)

Init from a STL vector of points.

Parameters
aVectorOfPointsthe vector containing a sequence of grid points (digital coordinates).
See also
initFromPointsRange

Referenced by testContourHelper().

◆ initFromSCellsRange()

template<typename TKSpace = KhalimskySpaceND<2>>
template<typename TIterator >
bool DGtal::GridCurve< TKSpace >::initFromSCellsRange ( const TIterator &  itb,
const TIterator &  ite 
)

Init from a range of signed cells.

Parameters
itbbegin iterator
iteend iterator
Examples
geometry/curves/exampleGridCurve3d-2.cpp.

Referenced by main().

◆ initFromSCellsVector()

template<typename TKSpace = KhalimskySpaceND<2>>
bool DGtal::GridCurve< TKSpace >::initFromSCellsVector ( const std::vector< SCell > &  aVectorOfSCells)

Init from a STL vector of signed cells.

Parameters
aVectorOfSCellsthe vector containing the sequence of signed cells.
See also
initFromSCellsRange

Referenced by main().

◆ initFromVector()

template<typename TKSpace = KhalimskySpaceND<2>>
bool DGtal::GridCurve< TKSpace >::initFromVector ( const std::vector< Point > &  aVectorOfPoints)

Deprecated name, use initFromPointsVector instead Init.

Parameters
aVectorOfPointsthe vector containing a sequence of grid points (digital coordinates).
See also
initFromPointsRange
Examples
geometry/curves/estimation/exampleCurvature.cpp.

Referenced by ballGenerator(), estimatorOnShapeDigitization(), testCompareEstimator(), testDigitization(), testSegmentation(), and testTrueLocalEstimatorOnShapeDigitization().

◆ initFromVectorStream()

template<typename TKSpace = KhalimskySpaceND<2>>
bool DGtal::GridCurve< TKSpace >::initFromVectorStream ( std::istream &  in)

Init.

Parameters
inany input stream,
Examples
geometry/curves/exampleGridCurve3d.cpp.

Referenced by main(), testEval(), testFP(), testL1LengthEstimator(), and testTrueLocalEstimator().

◆ isClosed()

template<typename TKSpace = KhalimskySpaceND<2>>
bool DGtal::GridCurve< TKSpace >::isClosed ( ) const

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.

Returns
'true' if grid curve is closed, 'false' otherwise

◆ isInside()

template<typename TKSpace = KhalimskySpaceND<2>>
bool DGtal::GridCurve< TKSpace >::isInside ( const SCell aSCell) const
private
Parameters
aSCellany signed cell
Returns
'true' if aSCell is within the underlying Khalimsky space and 'false' otherwise

◆ isOpen()

template<typename TKSpace = KhalimskySpaceND<2>>
bool DGtal::GridCurve< TKSpace >::isOpen ( ) const
Returns
'true' if the grid curve is not closed, 'false' otherwise
See also
isClosed
Examples
geometry/curves/estimation/exampleCurvature.cpp.

Referenced by estimatorOnShapeDigitization().

◆ isValid()

template<typename TKSpace = KhalimskySpaceND<2>>
bool DGtal::GridCurve< TKSpace >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ operator=()

template<typename TKSpace = KhalimskySpaceND<2>>
GridCurve & DGtal::GridCurve< TKSpace >::operator= ( const GridCurve< TKSpace > &  other)

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.

◆ PointVectorTo1SCell()

template<typename TKSpace = KhalimskySpaceND<2>>
SCell DGtal::GridCurve< TKSpace >::PointVectorTo1SCell ( const Point aPoint,
const Vector aVector 
)
private
Parameters
aPointany point
aVectorany vector of L1 norm equal to 1
Returns
the signed 1-cell associated to a pair point - shift vector (both in digital coordinates)

◆ push_back()

template<typename TKSpace = KhalimskySpaceND<2>>
void DGtal::GridCurve< TKSpace >::push_back ( const SCell aSCell)

Back insertion of aSCell

Parameters
aSCellany signed cell
See also
pushBack NB: this alias is kept for STL compliance

◆ pushBack()

template<typename TKSpace = KhalimskySpaceND<2>>
void DGtal::GridCurve< TKSpace >::pushBack ( const SCell aSCell)

Back insertion of aSCell

Parameters
aSCellany signed cell
Examples
geometry/tools/exampleAlphaShape.cpp.

Referenced by alphaShape().

◆ rbegin()

template<typename TKSpace = KhalimskySpaceND<2>>
ConstReverseIterator DGtal::GridCurve< TKSpace >::rbegin ( ) const
Returns
reverse begin iterator on scells

◆ rend()

template<typename TKSpace = KhalimskySpaceND<2>>
ConstReverseIterator DGtal::GridCurve< TKSpace >::rend ( ) const
Returns
reverse end iterator on scells

◆ selfDisplay()

template<typename TKSpace = KhalimskySpaceND<2>>
void DGtal::GridCurve< TKSpace >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ size()

template<typename TKSpace = KhalimskySpaceND<2>>
Storage::size_type DGtal::GridCurve< TKSpace >::size ( ) const
Returns
number of scells

◆ writeVectorToStream()

template<typename TKSpace = KhalimskySpaceND<2>>
void DGtal::GridCurve< TKSpace >::writeVectorToStream ( std::ostream &  out)

Outputs the grid curve to the stream out.

Parameters
outany output stream,

Referenced by main().

Field Documentation

◆ myFlagIsOwned

template<typename TKSpace = KhalimskySpaceND<2>>
bool DGtal::GridCurve< TKSpace >::myFlagIsOwned
private

bool equal to 'true' if this owns the Khalimsky space but 'false' otherwise

Definition at line 372 of file GridCurve.h.

◆ myKPtr

template<typename TKSpace = KhalimskySpaceND<2>>
const KSpace* DGtal::GridCurve< TKSpace >::myKPtr
private

◆ mySCells

template<typename TKSpace = KhalimskySpaceND<2>>
Storage DGtal::GridCurve< TKSpace >::mySCells
private

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