|
DGtal
1.5.beta
|
Aim: An adapter for viewing an associative image container like ImageContainerBySTLMap as a simple digital set. This class is merely based on an aliasing pointer on the image, which must exists elsewhere.
More...
#include <DGtal/kernel/sets/DigitalSetFromMap.h>
Public Types | |
| typedef TMapImage | Image |
| typedef Image | Container |
| typedef std::pair< const typename Image::Point, typename Image::Value > | Pair |
| typedef DigitalSetFromMap< Image > | Self |
| typedef Image::Domain | Domain |
| typedef Domain::Point | Point |
| typedef Domain::Size | Size |
| typedef functors::Pair1st< Point > | Functor |
| typedef ConstIteratorAdapter< typename Image::ConstIterator, Functor, Point > | ConstIterator |
| typedef ConstIteratorAdapter< typename Image::ConstIterator, Functor, Point > | Iterator |
Public Member Functions | |
| ~DigitalSetFromMap () | |
| DigitalSetFromMap (Image &aImage, const typename Image::Value &aDefaultValue=0) | |
| DigitalSetFromMap (const DigitalSetFromMap &other) | |
| DigitalSetFromMap & | operator= (const DigitalSetFromMap &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 () |
| template<typename TDigitalSet > | |
| Self & | operator+= (const TDigitalSet &aSet) |
| bool | operator() (const Point &p) const |
| template<typename TOutputIterator > | |
| void | computeComplement (TOutputIterator &ito) const |
| template<typename TDigitalSet > | |
| void | assignFromComplement (const TDigitalSet &otherSet) |
| void | computeBoundingBox (Point &lower, Point &upper) const |
| void | selfDisplay (std::ostream &out) const |
| bool | isValid () const |
| std::string | className () const |
Protected Member Functions | |
| DigitalSetFromMap () | |
Protected Attributes | |
| Image * | myImgPtr |
| Functor | myFun |
| Image::Value | myDefault |
Aim: An adapter for viewing an associative image container like ImageContainerBySTLMap as a simple digital set. This class is merely based on an aliasing pointer on the image, which must exists elsewhere.
Description of template class 'DigitalSetFromMap'
Model of CDigitalSet.
| TMapImage | type of associative image container |
Definition at line 74 of file DigitalSetFromMap.h.
| typedef ConstIteratorAdapter<typename Image::ConstIterator, Functor, Point> DGtal::DigitalSetFromMap< TMapImage >::ConstIterator |
Definition at line 90 of file DigitalSetFromMap.h.
| typedef Image DGtal::DigitalSetFromMap< TMapImage >::Container |
Definition at line 79 of file DigitalSetFromMap.h.
| typedef Image::Domain DGtal::DigitalSetFromMap< TMapImage >::Domain |
Definition at line 85 of file DigitalSetFromMap.h.
| typedef functors::Pair1st<Point> DGtal::DigitalSetFromMap< TMapImage >::Functor |
Definition at line 89 of file DigitalSetFromMap.h.
| typedef TMapImage DGtal::DigitalSetFromMap< TMapImage >::Image |
Definition at line 78 of file DigitalSetFromMap.h.
| typedef ConstIteratorAdapter<typename Image::ConstIterator, Functor, Point> DGtal::DigitalSetFromMap< TMapImage >::Iterator |
Definition at line 91 of file DigitalSetFromMap.h.
| typedef std::pair<const typename Image::Point, typename Image::Value> DGtal::DigitalSetFromMap< TMapImage >::Pair |
Definition at line 81 of file DigitalSetFromMap.h.
| typedef Domain::Point DGtal::DigitalSetFromMap< TMapImage >::Point |
Definition at line 86 of file DigitalSetFromMap.h.
| typedef DigitalSetFromMap<Image> DGtal::DigitalSetFromMap< TMapImage >::Self |
Definition at line 82 of file DigitalSetFromMap.h.
| typedef Domain::Size DGtal::DigitalSetFromMap< TMapImage >::Size |
Definition at line 87 of file DigitalSetFromMap.h.
| DGtal::DigitalSetFromMap< TMapImage >::~DigitalSetFromMap | ( | ) |
Destructor.
| DGtal::DigitalSetFromMap< TMapImage >::DigitalSetFromMap | ( | Image & | aImage, |
| const typename Image::Value & | aDefaultValue = 0 |
||
| ) |
Constructor. Link the adapter to an existing image.
| aImage | any associative image container. |
| aDefaultValue | value assigned to new points in the underlying image (0 by default). |
| DGtal::DigitalSetFromMap< TMapImage >::DigitalSetFromMap | ( | const DigitalSetFromMap< TMapImage > & | other | ) |
Copy constructor.
| other | the object to clone. |
|
protected |
Default Constructor. Forbidden since a Domain is necessary for defining a set.
| void DGtal::DigitalSetFromMap< TMapImage >::assignFromComplement | ( | const TDigitalSet & | otherSet | ) |
Builds the complement in the domain of the set [other_set] in this.
| otherSet | defines the set whose complement is assigned to 'this'. |
| TDigitalSet | a model of digital set. |
| Iterator DGtal::DigitalSetFromMap< TMapImage >::begin | ( | ) |
| ConstIterator DGtal::DigitalSetFromMap< TMapImage >::begin | ( | ) | const |
| std::string DGtal::DigitalSetFromMap< TMapImage >::className | ( | ) | const |
| void DGtal::DigitalSetFromMap< TMapImage >::clear | ( | ) |
Clears the set.
| void DGtal::DigitalSetFromMap< TMapImage >::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::DigitalSetFromMap< TMapImage >::computeComplement | ( | TOutputIterator & | ito | ) | const |
Fill a given set through the output iterator ito with the complement of this set in the domain.
| ito | the output iterator |
| TOutputIterator | a model of output iterator |
|
inline |
Give access to the underlying container.
Definition at line 282 of file DigitalSetFromMap.h.
References DGtal::DigitalSetFromMap< TMapImage >::myImgPtr.
|
inline |
Give access to the underlying container.
Definition at line 277 of file DigitalSetFromMap.h.
References DGtal::DigitalSetFromMap< TMapImage >::myImgPtr.
| const Domain& DGtal::DigitalSetFromMap< TMapImage >::domain | ( | ) | const |
| CowPtr<Domain> DGtal::DigitalSetFromMap< TMapImage >::domainPointer | ( | ) | const |
| bool DGtal::DigitalSetFromMap< TMapImage >::empty | ( | ) | const |
| Iterator DGtal::DigitalSetFromMap< TMapImage >::end | ( | ) |
| ConstIterator DGtal::DigitalSetFromMap< TMapImage >::end | ( | ) | const |
| Size DGtal::DigitalSetFromMap< TMapImage >::erase | ( | const Point & | p | ) |
Removes point [p] from the set.
| p | the point to remove. |
| void DGtal::DigitalSetFromMap< TMapImage >::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::DigitalSetFromMap< TMapImage >::erase | ( | Iterator | it | ) |
Removes the point pointed by [it] from the set.
| it | an iterator on this set. Note: generally faster than giving just the point. |
| Iterator DGtal::DigitalSetFromMap< TMapImage >::find | ( | const Point & | p | ) |
| p | any digital point. |
| ConstIterator DGtal::DigitalSetFromMap< TMapImage >::find | ( | const Point & | p | ) | const |
| p | any digital point. |
| void DGtal::DigitalSetFromMap< TMapImage >::insert | ( | const Point & | p | ) |
Adds point [p] to this set.
| p | any digital point. |
| void DGtal::DigitalSetFromMap< TMapImage >::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::DigitalSetFromMap< TMapImage >::insertNew | ( | const Point & | p | ) |
Adds point [p] to this set if the point is not already in the set.
| p | any digital point. |
| void DGtal::DigitalSetFromMap< TMapImage >::insertNew | ( | 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. |
| bool DGtal::DigitalSetFromMap< TMapImage >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
| bool DGtal::DigitalSetFromMap< TMapImage >::operator() | ( | const Point & | p | ) | const |
| p | any point. |
| Self& DGtal::DigitalSetFromMap< TMapImage >::operator+= | ( | const TDigitalSet & | aSet | ) |
set union to left.
| aSet | any other set. |
| TDigitalSet | a model of digital set. |
| DigitalSetFromMap& DGtal::DigitalSetFromMap< TMapImage >::operator= | ( | const DigitalSetFromMap< TMapImage > & | other | ) |
Assignment.
| other | the object to copy. |
| void DGtal::DigitalSetFromMap< TMapImage >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
| out | the output stream where the object is written. |
| Size DGtal::DigitalSetFromMap< TMapImage >::size | ( | ) | const |
|
protected |
Default value for point insertion
Definition at line 109 of file DigitalSetFromMap.h.
|
protected |
Functor transforming pairs point-value into points
Definition at line 104 of file DigitalSetFromMap.h.
|
protected |
Aliasing pointer on the image
Definition at line 99 of file DigitalSetFromMap.h.
Referenced by DGtal::DigitalSetFromMap< TMapImage >::container().