DGtal
1.5.beta
|
Aim: Realizes the concept CDigitalSet by using the STL container std::vector. More...
#include <DGtal/kernel/sets/DigitalSetBySTLVector.h>
Public Types | |
typedef TDomain | Domain |
typedef DigitalSetBySTLVector< Domain > | Self |
typedef Domain::Space | Space |
typedef Domain::Point | Point |
typedef Domain::Size | Size |
typedef std::vector< Point > | Container |
typedef std::vector< Point >::iterator | Iterator |
typedef std::vector< Point >::const_iterator | ConstIterator |
typedef std::vector< Point >::iterator | MutableIterator |
Public Member Functions | |
~DigitalSetBySTLVector () | |
DigitalSetBySTLVector (Clone< Domain > d) | |
DigitalSetBySTLVector (const DigitalSetBySTLVector &other) | |
DigitalSetBySTLVector & | operator= (const DigitalSetBySTLVector &other) |
const Domain & | domain () const |
CowPtr< Domain > | domainPointer () 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 () |
const Container & | container () const |
Container & | container () |
DigitalSetBySTLVector< Domain > & | operator+= (const DigitalSetBySTLVector< Domain > &aSet) |
bool | operator() (const Point &p) const |
template<typename TOutputIterator > | |
void | computeComplement (TOutputIterator &ito) const |
void | assignFromComplement (const DigitalSetBySTLVector< Domain > &other_set) |
void | computeBoundingBox (Point &lower, Point &upper) const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
std::string | className () const |
Protected Member Functions | |
DigitalSetBySTLVector () | |
Protected Attributes | |
CowPtr< Domain > | myDomain |
std::vector< Point > | myVector |
Aim: Realizes the concept CDigitalSet by using the STL container std::vector.
Description of template class 'DigitalSetBySTLVector'
It thus describes a modifiable set of points within the given domain [Domain].
TDomain | a realization of the concept CDomain. |
Definition at line 80 of file DigitalSetBySTLVector.h.
typedef std::vector<Point>::const_iterator DGtal::DigitalSetBySTLVector< TDomain >::ConstIterator |
Definition at line 90 of file DigitalSetBySTLVector.h.
typedef std::vector<Point> DGtal::DigitalSetBySTLVector< TDomain >::Container |
Definition at line 88 of file DigitalSetBySTLVector.h.
typedef TDomain DGtal::DigitalSetBySTLVector< TDomain >::Domain |
Definition at line 83 of file DigitalSetBySTLVector.h.
typedef std::vector<Point>::iterator DGtal::DigitalSetBySTLVector< TDomain >::Iterator |
Definition at line 89 of file DigitalSetBySTLVector.h.
typedef std::vector<Point>::iterator DGtal::DigitalSetBySTLVector< TDomain >::MutableIterator |
Definition at line 91 of file DigitalSetBySTLVector.h.
typedef Domain::Point DGtal::DigitalSetBySTLVector< TDomain >::Point |
Definition at line 86 of file DigitalSetBySTLVector.h.
typedef DigitalSetBySTLVector<Domain> DGtal::DigitalSetBySTLVector< TDomain >::Self |
Definition at line 84 of file DigitalSetBySTLVector.h.
typedef Domain::Size DGtal::DigitalSetBySTLVector< TDomain >::Size |
Definition at line 87 of file DigitalSetBySTLVector.h.
typedef Domain::Space DGtal::DigitalSetBySTLVector< TDomain >::Space |
Definition at line 85 of file DigitalSetBySTLVector.h.
DGtal::DigitalSetBySTLVector< TDomain >::~DigitalSetBySTLVector | ( | ) |
Destructor.
DGtal::DigitalSetBySTLVector< TDomain >::DigitalSetBySTLVector | ( | Clone< Domain > | d | ) |
Constructor. Creates the empty set in the domain [d].
d | any domain. |
DGtal::DigitalSetBySTLVector< TDomain >::DigitalSetBySTLVector | ( | const DigitalSetBySTLVector< TDomain > & | other | ) |
Copy constructor.
other | the object to clone. |
|
protected |
Default Constructor. Forbidden since a Domain is necessary for defining a set.
void DGtal::DigitalSetBySTLVector< TDomain >::assignFromComplement | ( | const DigitalSetBySTLVector< Domain > & | other_set | ) |
Builds the complement in the domain of the set [other_set] in this.
other_set | defines the set whose complement is assigned to 'this'. |
Iterator DGtal::DigitalSetBySTLVector< TDomain >::begin | ( | ) |
ConstIterator DGtal::DigitalSetBySTLVector< TDomain >::begin | ( | ) | const |
std::string DGtal::DigitalSetBySTLVector< TDomain >::className | ( | ) | const |
void DGtal::DigitalSetBySTLVector< TDomain >::clear | ( | ) |
Clears the set.
void DGtal::DigitalSetBySTLVector< TDomain >::computeBoundingBox | ( | Point & | lower, |
Point & | upper | ||
) | const |
Computes the bounding box of this set.
lower | the first point of the bounding box (lowest in all directions). |
upper | the last point of the bounding box (highest in all directions). |
void DGtal::DigitalSetBySTLVector< TDomain >::computeComplement | ( | TOutputIterator & | ito | ) | const |
Computes the complement in the domain of this set
ito | an output iterator |
TOutputIterator | a model of output iterator |
Container& DGtal::DigitalSetBySTLVector< TDomain >::container | ( | ) |
const Container& DGtal::DigitalSetBySTLVector< TDomain >::container | ( | ) | const |
Give access to the underlying container.
const Domain& DGtal::DigitalSetBySTLVector< TDomain >::domain | ( | ) | const |
CowPtr<Domain> DGtal::DigitalSetBySTLVector< TDomain >::domainPointer | ( | ) | const |
bool DGtal::DigitalSetBySTLVector< TDomain >::empty | ( | ) | const |
Iterator DGtal::DigitalSetBySTLVector< TDomain >::end | ( | ) |
ConstIterator DGtal::DigitalSetBySTLVector< TDomain >::end | ( | ) | const |
Size DGtal::DigitalSetBySTLVector< TDomain >::erase | ( | const Point & | p | ) |
Removes point [p] from the set.
p | the point to remove. |
void DGtal::DigitalSetBySTLVector< TDomain >::erase | ( | Iterator | first, |
Iterator | last | ||
) |
Removes the collection of points specified by the two iterators from this set.
first | the start point in this set. |
last | the last point in this set. |
void DGtal::DigitalSetBySTLVector< TDomain >::erase | ( | Iterator | it | ) |
Removes the point pointed by [it] from the set.
it | an iterator on this set. |
Iterator DGtal::DigitalSetBySTLVector< TDomain >::find | ( | const Point & | p | ) |
p | any digital point. |
ConstIterator DGtal::DigitalSetBySTLVector< TDomain >::find | ( | const Point & | p | ) | const |
p | any digital point. |
void DGtal::DigitalSetBySTLVector< TDomain >::insert | ( | const Point & | p | ) |
Adds point [p] to this set.
p | any digital point. |
void DGtal::DigitalSetBySTLVector< TDomain >::insert | ( | PointInputIterator | first, |
PointInputIterator | last | ||
) |
Adds the collection of points specified by the two iterators to this set.
first | the start point in the collection of Point. |
last | the last point in the collection of Point. |
void DGtal::DigitalSetBySTLVector< TDomain >::insertNew | ( | const Point & | p | ) |
Adds point [p] to this set if the point is not already in the set. There is no defined behavior if the point is already in the set (for instance, may be present twice).
p | any digital point. |
void DGtal::DigitalSetBySTLVector< TDomain >::insertNew | ( | PointInputIterator | first, |
PointInputIterator | last | ||
) |
Adds the collection of points specified by the two iterators to this set. The collection should contain distinct points. Each of these points should also not belong already to the set. set. There is no defined behavior if the preceding requisites are not satisfied (for instance, points may be present several times in the set).
first | the start point in the collection of Point. |
last | the last point in the collection of Point. |
bool DGtal::DigitalSetBySTLVector< TDomain >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
bool DGtal::DigitalSetBySTLVector< TDomain >::operator() | ( | const Point & | p | ) | const |
p | any point. |
DigitalSetBySTLVector<Domain>& DGtal::DigitalSetBySTLVector< TDomain >::operator+= | ( | const DigitalSetBySTLVector< Domain > & | aSet | ) |
set union to left.
aSet | any other set. |
DigitalSetBySTLVector& DGtal::DigitalSetBySTLVector< TDomain >::operator= | ( | const DigitalSetBySTLVector< TDomain > & | other | ) |
Assignment.
other | the object to copy. |
void DGtal::DigitalSetBySTLVector< TDomain >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Size DGtal::DigitalSetBySTLVector< TDomain >::size | ( | ) | const |
|
protected |
The associated domain. The pointed domain may be changed but it remains valid during the lifetime of the set.
Definition at line 331 of file DigitalSetBySTLVector.h.
|
protected |
The container storing the points of the set.
Definition at line 336 of file DigitalSetBySTLVector.h.