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

DGtal::DigitalSetBySTLSet< Domain > Class Template Reference

Aim: More...

#include <DigitalSetBySTLSet.h>

Data Structures

struct  DefaultDrawStyle

Public Types

typedef Domain DomainType
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 Domain & domain () 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< Domain > computeComplement () 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 Domain & myDomain
std::set< PointmySet

Detailed Description

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

Aim:

Description of template class 'DigitalSetBySTLSet'


Member Typedef Documentation

template<typename Domain>
typedef std::set<Point>::const_iterator DGtal::DigitalSetBySTLSet< Domain >::ConstIterator
template<typename Domain>
typedef Domain DGtal::DigitalSetBySTLSet< Domain >::DomainType
template<typename Domain>
typedef std::set<Point>::iterator DGtal::DigitalSetBySTLSet< Domain >::Iterator
template<typename Domain>
typedef Domain::Point DGtal::DigitalSetBySTLSet< Domain >::Point
template<typename Domain>
typedef Domain::Size DGtal::DigitalSetBySTLSet< Domain >::Size

Constructor & Destructor Documentation

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

Destructor.

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

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

Parameters:
d any domain.
template<typename Domain>
DGtal::DigitalSetBySTLSet< Domain >::DigitalSetBySTLSet ( const DigitalSetBySTLSet< Domain > &  other  ) 

Copy constructor.

Parameters:
other the object to clone.
template<typename Domain>
DGtal::DigitalSetBySTLSet< Domain >::DigitalSetBySTLSet (  )  [protected]

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


Member Function Documentation

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

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

Parameters:
other_set defines the set whose complement is assigned to 'this'.
template<typename Domain>
ConstIterator DGtal::DigitalSetBySTLSet< Domain >::begin (  )  const
Returns:
a const iterator on the first element in this set.

Referenced by testIVViewer(), and testSimplePoints2D().

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

Clears the set.

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

Computes the bounding box of this set.

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

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

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

Default drawing style object.

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

Referenced by testIVViewer(), and testSimplePoints2D().

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

Removes point [p] from the set.

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

Referenced by testSimplePoints2D(), and testSimplePoints3D().

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

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

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

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

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

Adds point [p] to this set.

Parameters:
p any digital point.
Precondition:
p should belong to the associated domain.
template<typename Domain>
template<typename PointInputIterator >
void DGtal::DigitalSetBySTLSet< Domain >::insert ( PointInputIterator  first,
PointInputIterator  last 
)

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

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

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

Parameters:
first the start point in the collection of Point.
last the 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 Domain>
void DGtal::DigitalSetBySTLSet< Domain >::insertNew ( const Point p  ) 

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

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

Referenced by testObject3D(), and testSimplePoints3D().

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

Checks the validity/consistency of the object.

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

set union to left.

Parameters:
aSet any other set.
template<typename Domain>
DigitalSetBySTLSet& DGtal::DigitalSetBySTLSet< Domain >::operator= ( const DigitalSetBySTLSet< Domain > &  other  ) 

Assignment.

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

Writes/Displays the object on an output stream.

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

Draw the object on a DGtalBoard board.

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

Field Documentation

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

The associated domain;

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

The container storing the points of the set.


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