31 #if defined(DigitalSurface_RECURSES) 32 #error Recursive header files inclusion detected in DigitalSurface.h 33 #else // defined(DigitalSurface_RECURSES) 35 #define DigitalSurface_RECURSES 37 #if !defined DigitalSurface_h 39 #define DigitalSurface_h 47 #include <boost/graph/graph_traits.hpp> 48 #include <boost/graph/properties.hpp> 49 #include "DGtal/base/Common.h" 50 #include "DGtal/base/CountedPtr.h" 51 #include "DGtal/kernel/CWithGradientMap.h" 52 #include "DGtal/topology/CCellEmbedder.h" 53 #include "DGtal/topology/CSCellEmbedder.h" 54 #include "DGtal/topology/CDigitalSurfaceContainer.h" 55 #include "DGtal/topology/CDigitalSurfaceTracker.h" 56 #include "DGtal/topology/UmbrellaComputer.h" 64 :
public virtual adjacency_graph_tag,
65 public virtual vertex_list_graph_tag,
66 public virtual incidence_graph_tag,
67 public virtual edge_list_graph_tag { };
120 template <
typename TDigitalSurfaceContainer>
141 typedef typename DigitalSurfaceContainer::KSpace
KSpace;
143 typedef typename DigitalSurfaceContainer::SCell
SCell;
144 typedef typename DigitalSurfaceContainer::Surfel
Surfel;
145 typedef typename DigitalSurfaceContainer::SurfelConstIterator
ConstIterator;
160 typedef typename KSpace::Size
Size;
181 Edge(
const Vertex & v1,
const Vertex & v2 )
196 return ( vertices[ 0 ] == other.
vertices[ 0 ] )
197 && ( vertices[ 1 ] == other.
vertices[ 1 ] );
201 return ( vertices[ 0 ] < other.
vertices[ 0 ] )
202 || ( ( vertices[ 0 ] == other.
vertices[ 0 ] )
203 && ( vertices[ 1 ] < other.
vertices[ 1 ] ) );
227 : base(), k( 0 ), epsilon( false ) {}
229 : base( theTail ), k( aK ), epsilon( aEpsilon ) {}
232 return ( base == other.
base )
233 && ( k == other.
k ) && ( epsilon == other.
epsilon );
237 return ( base < other.
base )
238 || ( ( base == other.
base )
240 || ( ( k == other.
k )
241 && ( epsilon < other.
epsilon ) ) ) );
245 return ( base != other.
base )
246 || ( k != other.
k ) || ( epsilon != other.
epsilon );
261 unsigned int nbVertices;
264 inline Face(
const UmbrellaState & aState,
265 unsigned int nb,
bool aIsClosed )
266 : state( aState ), nbVertices( nb ), closed( aIsClosed )
272 return state == other.
state;
276 return state < other.
state;
330 const DigitalSurfaceContainer & container()
const;
336 DigitalSurfaceContainer & container();
383 ConstIterator begin()
const;
388 ConstIterator end()
const;
398 Size degree(
const Vertex & v )
const;
408 Size bestCapacity()
const;
424 template <
typename OutputIterator>
425 void writeNeighbors( OutputIterator & it,
426 const Vertex & v )
const;
447 template <
typename OutputIterator,
typename VertexPredicate>
448 void writeNeighbors( OutputIterator & it,
450 const VertexPredicate & pred )
const;
460 ArcRange outArcs(
const Vertex & v )
const;
466 ArcRange inArcs(
const Vertex & v )
const;
473 FaceRange facesAroundVertex(
const Vertex & v )
const;
479 Vertex head(
const Arc & a )
const;
485 Vertex tail(
const Arc & a )
const;
491 Arc opposite(
const Arc & a )
const;
500 Arc arc(
const Vertex & tail,
const Vertex & head )
const;
509 FaceRange facesAroundArc(
const Arc & a )
const;
520 VertexRange verticesAroundFace(
const Face & f )
const;
526 FaceSet allFaces()
const;
532 FaceSet allClosedFaces()
const;
539 FaceSet allOpenFaces()
const;
545 Face computeFace( UmbrellaState state )
const;
552 SCell separator(
const Arc & a )
const;
561 SCell pivot(
const Face & f )
const;
571 void selfDisplay ( std::ostream & out )
const;
577 bool isValid()
const;
585 void exportSurfaceAs3DOFF ( std::ostream & out )
const;
597 template <
typename CellEmbedder>
598 void exportEmbeddedSurfaceAs3DOFF ( std::ostream & out,
599 const CellEmbedder & cembedder )
const;
611 template <
typename CellEmbedder>
612 void exportEmbeddedSurfaceAs3DNOFF ( std::ostream & out,
613 const CellEmbedder & cembedder )
const;
626 template <
typename SCellEmbedderWithGradientMap>
627 void exportAs3DNOFF( std::ostream & out,
628 const SCellEmbedderWithGradientMap & scembedder )
const;
638 template <
typename CellEmbedder>
639 void exportEmbeddedIteratedSurfaceAs3DNOFF ( std::ostream & out,
640 const CellEmbedder & cembedder )
const;
678 template <
typename TDigitalSurfaceContainer>
680 operator<< ( std::ostream & out,
688 #include "DGtal/topology/DigitalSurface.ih" 693 #endif // !defined DigitalSurface_h 695 #undef DigitalSurface_RECURSES 696 #endif // else defined(DigitalSurface_RECURSES) UmbrellaComputer< DigitalSurfaceTracker > myUmbrellaComputer
This object is used to compute umbrellas over the surface.
bool operator<(const Face &other) const
boost::disallow_parallel_edge_tag edge_parallel_category
the graph does not allow parallel edges.
MyDigitalSurface::SurfelSet SurfelSet
std::vector< Vertex > VertexRange
The range of vertices is defined as a vector.
DigitalSurface< DigitalSurfaceContainer > Self
std::vector< Arc > ArcRange
The range of arcs is defined as a vector.
DigitalSurfaceContainer::SurfelConstIterator ConstIterator
bool operator<(const Arc &other) const
DGtal::uint32_t Dimension
Vertex vertices[2]
The two vertices.
KSpace::SurfelSet SurfelSet
KSpace::template SurfelMap< Value >::Type Type
CountedPtr< DigitalSurfaceContainer > myContainer
a smart pointer on the container.
Aim: Represents a set of n-1-cells in a nD space, together with adjacency relation between these cell...
DigitalSurfaceContainer::DigitalSurfaceTracker DigitalSurfaceTracker
std::set< Face > FaceSet
The set of faces is defined as set.
KSpace::template SurfelMap< Value >::Type Type
DigitalSurfaceContainer::SCell SCell
Arc(const Vertex &theTail, Dimension aK, bool aEpsilon)
TDigitalSurfaceContainer DigitalSurfaceContainer
std::vector< Face > FaceRange
The range of faces is defined as a vector.
DigitalSurfaceContainer::Cell Cell
bool operator==(const Arc &other) const
bool operator==(const Face &other) const
bool operator==(const Edge &other) const
Edge(const Vertex &v1, const Vertex &v2)
DigitalSurfaceTracker * myTracker
a pointer on a tracker.
Surfel Vertex
Defines the type for a vertex.
bool closed
tells if the face is closed or open.
Dimension k
direction toward the head surfel
DGtal is the top-level namespace which contains all DGtal functions and types.
DigitalSurfaceContainer::KSpace KSpace
Umbrella::State UmbrellaState
std::pair< typename graph_traits< DGtal::DigitalSurface< TDigitalSurfaceContainer > >::vertex_iterator, typename graph_traits< DGtal::DigitalSurface< TDigitalSurfaceContainer > >::vertex_iterator > vertices(const DGtal::DigitalSurface< TDigitalSurfaceContainer > &digSurf)
boost::undirected_tag directed_category
the graph is undirected.
KSpace::SurfelSet VertexSet
Defines how to represent a set of vertex.
bool operator!=(const Arc &other) const
bool epsilon
orientation toward the head surfel
bool operator<(const Edge &other) const
boost::DigitalSurface_graph_traversal_category traversal_category
the graph satisfies AdjacencyListGraph and VertexListGraph concepts.
Aim: The digital surface container concept describes a minimal set of inner types and methods so as t...
UmbrellaComputer< DigitalSurfaceTracker > Umbrella
This define a utility class for computing umbrellas.
DigitalSurfaceContainer::Surfel Surfel
Face(const UmbrellaState &aState, unsigned int nb, bool aIsClosed)
KSpace::Size Size
Defines how to represent a size (unsigned integral type).