DGtal 2.1.0
Loading...
Searching...
No Matches
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 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

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:804
void setUnit(Unit unit)
Definition Board.cpp:239

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:

  • SCellsRange to iterate over the d-scells
  • PointsRange to iterate over the digital coordinates of the 0-scells that are directly incident to the d-scells
  • MidPointsRange to iterate over the real coordinates of the d-scells
  • ArrowsRange to iterate over the arrows coding the 1-scells. Note that an arrow is a pair point-vector: the point codes the digital coordinates of the 1-scell, the vector gives the topology and sign of the 1-scell.
  • InnerPointsRange to iterate over the digital coordinates of the n-scells that are directly incident to the (n-1)-scells.
    • OuterPointsRange to iterate over the digital coordinates of the n-scells that are indirectly incident to the (n-1)-scells.
  • IncidentPointsRange to iterate over the pairs of inner and outer points (defined as above)
  • CodesRange to iterate over the codes {0,1,2,3} of the 1-scells (only available if n = 2)

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:

  • ConstIterator
  • ConstReverseIterator
  • ConstCirculator
  • ConstReverseCirculator

And each range provides these (circular)iterator services:

  • begin() : begin ConstIterator
  • end() : end ConstIterator
  • rbegin() : begin ConstReverseIterator
  • rend() : end ConstReverseIterator
  • c() : ConstCirculator
  • rc() : ConstReverseCirculator

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;
Range::ConstCirculator c = r.c();
//set the starting element wherever you want...
for (unsigned i = 0; i < 20; ++i) ++c;
//... and circulate
Range::ConstCirculator cend( c );
do
{
trace.info() << *c;
c++;
} while (c!=cend);
trace.info() << endl;
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 437 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 483 of file GridCurve.h.

◆ const_iterator

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

Definition at line 305 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 307 of file GridCurve.h.

◆ ConstIterator

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

Definition at line 306 of file GridCurve.h.

◆ ConstReverseIterator

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

Definition at line 308 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 473 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 449 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 425 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 461 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 413 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 402 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 442 of file GridCurve.h.

442 {
443 return ArrowsRange(mySCells.begin(), mySCells.end(), new functors::SCellToArrow<KSpace>(*myKPtr) );
444 }
const KSpace * myKPtr
Definition GridCurve.h:359
ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToArrow< KSpace >, std::pair< Point, Vector > > ArrowsRange
Definition GridCurve.h:437

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

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

◆ getCodesRange()

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

Definition at line 488 of file GridCurve.h.

488 {
489 return CodesRange( mySCells.begin(), mySCells.end(), new functors::SCellToCode<KSpace>(*myKPtr) );
490 }
ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToCode< KSpace >, char > CodesRange
Definition GridCurve.h:483

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 478 of file GridCurve.h.

478 {
479 return IncidentPointsRange(mySCells.begin(), mySCells.end(), new functors::SCellToIncidentPoints<KSpace>(*myKPtr) );
480 }
ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToIncidentPoints< KSpace >, std::pair< Point, Point > > IncidentPointsRange
Definition GridCurve.h:473

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

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

◆ 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 454 of file GridCurve.h.

454 {
455 return InnerPointsRange(mySCells.begin(), mySCells.end(), new functors::SCellToInnerPoint<KSpace>(*myKPtr) );
456 }
ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToInnerPoint< KSpace >, Point > InnerPointsRange
Definition GridCurve.h:449

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

Referenced by alphaShape(), main(), 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 430 of file GridCurve.h.

430 {
431 return MidPointsRange(mySCells.begin(), mySCells.end(), new CanonicSCellEmbedder<KSpace>(*myKPtr) );
432 }
ConstRangeAdapter< typename Storage::const_iterator, CanonicSCellEmbedder< KSpace >, typename KSpace::Space::RealPoint > MidPointsRange
Definition GridCurve.h:425

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 466 of file GridCurve.h.

466 {
467 return OuterPointsRange(mySCells.begin(), mySCells.end(), new functors::SCellToOuterPoint<KSpace>(*myKPtr) );
468 }
ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToOuterPoint< KSpace >, Point > OuterPointsRange
Definition GridCurve.h:461

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 418 of file GridCurve.h.

418 {
419 return PointsRange(mySCells.begin(), mySCells.end(), new functors::SCellToPoint<KSpace>(*myKPtr) );
420 }
ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToPoint< KSpace >, Point > PointsRange
Definition GridCurve.h:413

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

Referenced by compare(), main(), main(), testCompareEstimator(), testEval(), testFP(), testL1LengthEstimator(), testSegmentation(), testSegmentationLarger(), testTrueLocalEstimator(), 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 407 of file GridCurve.h.

407 {
408 return SCellsRange(mySCells.begin(), mySCells.end(), new functors::Identity() );
409 }
ConstRangeAdapter< typename Storage::const_iterator, functors::Identity, SCell > SCellsRange
Definition GridCurve.h:402

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(), main(), 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
Examples
geometry/curves/estimation/exampleCurvature.cpp.

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

◆ 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(), and main().

◆ initFromVectorStream()

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

◆ 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

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

◆ 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

Referenced by testSegmentationLarger().

◆ 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 364 of file GridCurve.h.

◆ myKPtr

◆ mySCells


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