DGtal 0.3.0
Data Structures | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

DGtal::DigitalSetBySTLSet< TDomain > Class Template Reference

Aim: More...

#include <DigitalSetBySTLSet.h>

Collaboration diagram for DGtal::DigitalSetBySTLSet< TDomain >:
Collaboration graph
[legend]

Data Structures

struct  DefaultDrawStyle

Public Types

typedef TDomain Domain
typedef Domain::Point Point
typedef Domain::Size Size
typedef std::set< Point >::iterator Iterator
typedef std::set< Point >
::const_iterator 
ConstIterator

Public Member Functions

 ~DigitalSetBySTLSet ()
 DigitalSetBySTLSet (const Domain &d)
 DigitalSetBySTLSet (const DigitalSetBySTLSet &other)
DigitalSetBySTLSetoperator= (const DigitalSetBySTLSet &other)
const Domaindomain () const
Size size () const
bool empty () const
void insert (const Point &p)
template<typename PointInputIterator >
void insert (PointInputIterator first, PointInputIterator last)
void insertNew (const Point &p)
template<typename PointInputIterator >
void insertNew (PointInputIterator first, PointInputIterator last)
Size erase (const Point &p)
void erase (Iterator it)
void erase (Iterator first, Iterator last)
void clear ()
ConstIterator find (const Point &p) const
Iterator find (const Point &p)
ConstIterator begin () const
ConstIterator end () const
Iterator begin ()
Iterator end ()
DigitalSetBySTLSet< Domain > & operator+= (const DigitalSetBySTLSet< Domain > &aSet)
DigitalSetBySTLSet< DomaincomputeComplement () const
void assignFromComplement (const DigitalSetBySTLSet< Domain > &other_set)
void computeBoundingBox (Point &lower, Point &upper) const
void selfDisplay (std::ostream &out) const
bool isValid () const
DrawableWithDGtalBoarddefaultStyle (std::string mode="") const
std::string styleName () const
void selfDraw (DGtalBoard &board) const

Protected Member Functions

 DigitalSetBySTLSet ()

Protected Attributes

const DomainmyDomain
std::set< PointmySet

Detailed Description

template<typename TDomain>
class DGtal::DigitalSetBySTLSet< TDomain >

Aim:

Description of template class 'DigitalSetBySTLSet'

Examples:

3dBorderExtraction.cpp, 3dBorderExtractionImg.cpp, and digitalSetFromVol.cpp.

Definition at line 67 of file DigitalSetBySTLSet.h.


Member Typedef Documentation

template<typename TDomain>
typedef std::set<Point>::const_iterator DGtal::DigitalSetBySTLSet< TDomain >::ConstIterator

Definition at line 74 of file DigitalSetBySTLSet.h.

template<typename TDomain>
typedef TDomain DGtal::DigitalSetBySTLSet< TDomain >::Domain

Definition at line 70 of file DigitalSetBySTLSet.h.

template<typename TDomain>
typedef std::set<Point>::iterator DGtal::DigitalSetBySTLSet< TDomain >::Iterator

Definition at line 73 of file DigitalSetBySTLSet.h.

template<typename TDomain>
typedef Domain::Point DGtal::DigitalSetBySTLSet< TDomain >::Point

Definition at line 71 of file DigitalSetBySTLSet.h.

template<typename TDomain>
typedef Domain::Size DGtal::DigitalSetBySTLSet< TDomain >::Size

Definition at line 72 of file DigitalSetBySTLSet.h.


Constructor & Destructor Documentation

template<typename TDomain>
DGtal::DigitalSetBySTLSet< TDomain >::~DigitalSetBySTLSet ( )

Destructor.

template<typename TDomain>
DGtal::DigitalSetBySTLSet< TDomain >::DigitalSetBySTLSet ( const Domain d)

Constructor. Creates the empty set in the domain [d].

Parameters:
dany domain.
template<typename TDomain>
DGtal::DigitalSetBySTLSet< TDomain >::DigitalSetBySTLSet ( const DigitalSetBySTLSet< TDomain > &  other)

Copy constructor.

Parameters:
otherthe object to clone.
template<typename TDomain>
DGtal::DigitalSetBySTLSet< TDomain >::DigitalSetBySTLSet ( ) [protected]

Default Constructor. Forbidden since a Domain is necessary for defining a set.


Member Function Documentation

template<typename TDomain>
void DGtal::DigitalSetBySTLSet< TDomain >::assignFromComplement ( const DigitalSetBySTLSet< Domain > &  other_set)

Builds the complement in the domain of the set [other_set] in this.

Parameters:
other_setdefines the set whose complement is assigned to 'this'.

Referenced by testLayers(), and testSimpleExpander().

template<typename TDomain>
ConstIterator DGtal::DigitalSetBySTLSet< TDomain >::begin ( ) const
Returns:
a const iterator on the first element in this set.

Referenced by testIVViewer(), and testSimplePoints2D().

template<typename TDomain>
Iterator DGtal::DigitalSetBySTLSet< TDomain >::begin ( )
Returns:
an iterator on the first element in this set.
template<typename TDomain>
void DGtal::DigitalSetBySTLSet< TDomain >::clear ( )

Clears the set.

Postcondition:
this set is empty.
template<typename TDomain>
void DGtal::DigitalSetBySTLSet< TDomain >::computeBoundingBox ( Point lower,
Point upper 
) const

Computes the bounding box of this set.

Parameters:
lowerthe first point of the bounding box (lowest in all directions).
upperthe last point of the bounding box (highest in all directions).
template<typename TDomain>
DigitalSetBySTLSet<Domain> DGtal::DigitalSetBySTLSet< TDomain >::computeComplement ( ) const
Returns:
the complement of this set in the domain.

NB: be aware of the overhead cost when returning the object.

template<typename TDomain>
DrawableWithDGtalBoard* DGtal::DigitalSetBySTLSet< TDomain >::defaultStyle ( std::string  mode = "") const

Default drawing style object.

Returns:
the dyn. alloc. default style for this object.
template<typename TDomain>
const Domain& DGtal::DigitalSetBySTLSet< TDomain >::domain ( ) const
Returns:
the embedding domain.
template<typename TDomain>
bool DGtal::DigitalSetBySTLSet< TDomain >::empty ( ) const
Returns:
'true' iff the set is empty (no element).
template<typename TDomain>
ConstIterator DGtal::DigitalSetBySTLSet< TDomain >::end ( ) const
Returns:
a const iterator on the element after the last in this set.

Referenced by testIVViewer(), and testSimplePoints2D().

template<typename TDomain>
Iterator DGtal::DigitalSetBySTLSet< TDomain >::end ( )
Returns:
a iterator on the element after the last in this set.
template<typename TDomain>
Size DGtal::DigitalSetBySTLSet< TDomain >::erase ( const Point p)

Removes point [p] from the set.

Parameters:
pthe point to remove.
Returns:
the number of removed elements (0 or 1).

Referenced by testSimplePoints2D(), and testSimplePoints3D().

template<typename TDomain>
void DGtal::DigitalSetBySTLSet< TDomain >::erase ( Iterator  it)

Removes the point pointed by [it] from the set.

Parameters:
itan iterator on this set. Note: generally faster than giving just the point.
template<typename TDomain>
void DGtal::DigitalSetBySTLSet< TDomain >::erase ( Iterator  first,
Iterator  last 
)

Removes the collection of points specified by the two iterators from this set.

Parameters:
firstthe start point in this set.
lastthe last point in this set.
template<typename TDomain>
ConstIterator DGtal::DigitalSetBySTLSet< TDomain >::find ( const Point p) const
Parameters:
pany digital point.
template<typename TDomain>
Iterator DGtal::DigitalSetBySTLSet< TDomain >::find ( const Point p)
Parameters:
pany digital point.
Returns:
an iterator pointing on [p] if found, otherwise end().
template<typename TDomain>
void DGtal::DigitalSetBySTLSet< TDomain >::insert ( const Point p)

Adds point [p] to this set.

Parameters:
pany digital point.
Precondition:
p should belong to the associated domain.

Referenced by testImagesSetsUtilities(), testLayers(), and testSimpleExpander().

template<typename TDomain>
template<typename PointInputIterator >
void DGtal::DigitalSetBySTLSet< TDomain >::insert ( PointInputIterator  first,
PointInputIterator  last 
)

Adds the collection of points specified by the two iterators to this set.

Parameters:
firstthe start point in the collection of Point.
lastthe last point in the collection of Point.
Precondition:
all points should belong to the associated domain.
template<typename TDomain>
template<typename PointInputIterator >
void DGtal::DigitalSetBySTLSet< TDomain >::insertNew ( PointInputIterator  first,
PointInputIterator  last 
)

Adds the collection of points specified by the two iterators to this set.

Parameters:
firstthe start point in the collection of Point.
lastthe last point in the collection of Point.
Precondition:
all points should belong to the associated domain.
each point should not belong to this.
template<typename TDomain>
void DGtal::DigitalSetBySTLSet< TDomain >::insertNew ( const Point p)

Adds point [p] to this set if the point is not already in the set.

Parameters:
pany digital point.
Precondition:
p should belong to the associated domain.
p should not belong to this.

Referenced by testObject3D(), and testSimplePoints3D().

template<typename TDomain>
bool DGtal::DigitalSetBySTLSet< TDomain >::isValid ( ) const

Checks the validity/consistency of the object.

Returns:
'true' if the object is valid, 'false' otherwise.
template<typename TDomain>
DigitalSetBySTLSet<Domain>& DGtal::DigitalSetBySTLSet< TDomain >::operator+= ( const DigitalSetBySTLSet< Domain > &  aSet)

set union to left.

Parameters:
aSetany other set.
template<typename TDomain>
DigitalSetBySTLSet& DGtal::DigitalSetBySTLSet< TDomain >::operator= ( const DigitalSetBySTLSet< TDomain > &  other)

Assignment.

Parameters:
otherthe object to copy.
Returns:
a reference on 'this'.
template<typename TDomain>
void DGtal::DigitalSetBySTLSet< TDomain >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters:
outthe output stream where the object is written.
template<typename TDomain>
void DGtal::DigitalSetBySTLSet< TDomain >::selfDraw ( DGtalBoard board) const

Draw the object on a DGtalBoard board.

Parameters:
boardthe output board where the object is drawn.
template<typename TDomain>
Size DGtal::DigitalSetBySTLSet< TDomain >::size ( ) const
Returns:
the number of elements in the set.
template<typename TDomain>
std::string DGtal::DigitalSetBySTLSet< TDomain >::styleName ( ) const
Returns:
the style name used for drawing this object.

Field Documentation

template<typename TDomain>
const Domain& DGtal::DigitalSetBySTLSet< TDomain >::myDomain [protected]

The associated domain;

Definition at line 285 of file DigitalSetBySTLSet.h.

template<typename TDomain>
std::set<Point> DGtal::DigitalSetBySTLSet< TDomain >::mySet [protected]

The container storing the points of the set.

Definition at line 290 of file DigitalSetBySTLSet.h.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines