OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Static Public Member Functions | Static Protected Attributes | Private Attributes | List of all members
WDataSetFiberClustering Class Reference

This is a dataset which represent a clustering of fibers. More...

#include <WDataSetFiberClustering.h>

+ Inheritance diagram for WDataSetFiberClustering:
+ Collaboration diagram for WDataSetFiberClustering:

Public Types

typedef std::shared_ptr< WDataSetFiberClusteringSPtr
 Convenience typedef for a std::shared_ptr< WDataSetFiberClustering >. More...
 
typedef std::shared_ptr< const WDataSetFiberClusteringConstSPtr
 Convenience typedef for a std::shared_ptr< const WDataSetFiberClustering >. More...
 
typedef std::map< size_t, WFiberCluster::SPtrClusterMap
 The type of the cluster map. More...
 

Public Member Functions

 WDataSetFiberClustering ()
 Default constructor. More...
 
 WDataSetFiberClustering (const ClusterMap &clustering)
 constructor with cluster list. More...
 
virtual ~WDataSetFiberClustering ()
 Destructor. More...
 
virtual const std::string getName () const
 The name of this transferable. More...
 
virtual const std::string getDescription () const
 The description of this transferable. More...
 
virtual void setCluster (size_t id, WFiberCluster::SPtr cluster)
 Sets the cluster at the given ID. More...
 
virtual WFiberCluster::SPtr getCluster (size_t id)
 Returns the cluster with the given ID. More...
 
virtual WFiberCluster::ConstSPtr getCluster (size_t id) const
 Returns the cluster with the given ID. More...
 
virtual WFiberCluster::SPtr getOrCreateCluster (size_t id)
 Returns the cluster with the given ID. More...
 
virtual void removeCluster (size_t id)
 Removes the cluster with the specified ID. More...
 
ClusterMap::const_iterator begin () const
 The begin iterator of the clustering for const iteration. More...
 
ClusterMap::iterator begin ()
 The begin iterator of the clustering for non-const iteration. More...
 
ClusterMap::const_iterator end () const
 The end iterator of the clustering for const iteration. More...
 
ClusterMap::iterator end ()
 The end iterator of the clustering for non-const iteration. More...
 
size_t size () const
 Returns the amount of clusters in the clustering. More...
 
- Public Member Functions inherited from WTransferable
 WTransferable ()
 Default constructor. More...
 
virtual ~WTransferable ()
 Destructor. More...
 
- Public Member Functions inherited from WPrototyped
 WPrototyped ()
 Default constructor. More...
 
virtual ~WPrototyped ()
 Destructor. More...
 
template<typename T >
bool isA ()
 Checks whether the actual prototype has the specified runtime type. More...
 

Static Public Member Functions

static std::shared_ptr< WPrototypedgetPrototype ()
 Returns a prototype instantiated with the true type of the deriving class. More...
 

Static Protected Attributes

static std::shared_ptr< WPrototypedm_prototype = std::shared_ptr< WPrototyped >()
 Prototype for this dataset. More...
 

Private Attributes

std::map< size_t, WFiberCluster::SPtrm_clusters
 The map between ID and cluster. More...
 

Detailed Description

This is a dataset which represent a clustering of fibers.

It does not itself contain the fiber-data. This dataset only contains the indices of fibers belonging to the clusters.

Each cluster has its own ID. A mapping between names and IDs is possible.

Definition at line 43 of file WDataSetFiberClustering.h.

Member Typedef Documentation

◆ ClusterMap

The type of the cluster map.

Definition at line 59 of file WDataSetFiberClustering.h.

◆ ConstSPtr

Convenience typedef for a std::shared_ptr< const WDataSetFiberClustering >.

Definition at line 54 of file WDataSetFiberClustering.h.

◆ SPtr

Convenience typedef for a std::shared_ptr< WDataSetFiberClustering >.

Definition at line 49 of file WDataSetFiberClustering.h.

Constructor & Destructor Documentation

◆ WDataSetFiberClustering() [1/2]

WDataSetFiberClustering::WDataSetFiberClustering ( )

Default constructor.

Definition at line 34 of file WDataSetFiberClustering.cpp.

Referenced by getPrototype().

+ Here is the caller graph for this function:

◆ WDataSetFiberClustering() [2/2]

WDataSetFiberClustering::WDataSetFiberClustering ( const ClusterMap clustering)
explicit

constructor with cluster list.

Parameters
clusteringthe cluster map defining the clustering

Definition at line 39 of file WDataSetFiberClustering.cpp.

References m_clusters.

◆ ~WDataSetFiberClustering()

WDataSetFiberClustering::~WDataSetFiberClustering ( )
virtual

Destructor.

Definition at line 45 of file WDataSetFiberClustering.cpp.

Member Function Documentation

◆ begin() [1/2]

WDataSetFiberClustering::ClusterMap::iterator WDataSetFiberClustering::begin ( )

The begin iterator of the clustering for non-const iteration.

Returns
the begin iterator

Definition at line 121 of file WDataSetFiberClustering.cpp.

References m_clusters.

◆ begin() [2/2]

WDataSetFiberClustering::ClusterMap::const_iterator WDataSetFiberClustering::begin ( ) const

The begin iterator of the clustering for const iteration.

Returns
the begin iterator

Definition at line 116 of file WDataSetFiberClustering.cpp.

References m_clusters.

◆ end() [1/2]

WDataSetFiberClustering::ClusterMap::iterator WDataSetFiberClustering::end ( )

The end iterator of the clustering for non-const iteration.

Returns
the end iterator

Definition at line 131 of file WDataSetFiberClustering.cpp.

References m_clusters.

◆ end() [2/2]

WDataSetFiberClustering::ClusterMap::const_iterator WDataSetFiberClustering::end ( ) const

The end iterator of the clustering for const iteration.

Returns
the begin iterator

Definition at line 126 of file WDataSetFiberClustering.cpp.

References m_clusters.

◆ getCluster() [1/2]

WFiberCluster::SPtr WDataSetFiberClustering::getCluster ( size_t  id)
virtual

Returns the cluster with the given ID.

Exceptions
WInvalidIDif the ID is not known.
Parameters
idthe ID of the cluster to get
Returns
the cluster

Definition at line 74 of file WDataSetFiberClustering.cpp.

References m_clusters.

◆ getCluster() [2/2]

WFiberCluster::ConstSPtr WDataSetFiberClustering::getCluster ( size_t  id) const
virtual

Returns the cluster with the given ID.

Exceptions
WInvalidIDif the ID is not known.
Parameters
idthe ID of the cluster to get
Returns
the cluster

Definition at line 84 of file WDataSetFiberClustering.cpp.

References m_clusters.

◆ getDescription()

const std::string WDataSetFiberClustering::getDescription ( ) const
virtual

The description of this transferable.

This is useful information for the users.

Returns
A description

Implements WPrototyped.

Definition at line 64 of file WDataSetFiberClustering.cpp.

◆ getName()

const std::string WDataSetFiberClustering::getName ( ) const
virtual

The name of this transferable.

This is useful information for the users.

Returns
the name.

Implements WPrototyped.

Definition at line 59 of file WDataSetFiberClustering.cpp.

◆ getOrCreateCluster()

WFiberCluster::SPtr WDataSetFiberClustering::getOrCreateCluster ( size_t  id)
virtual

Returns the cluster with the given ID.

If there is no cluster with this ID, an empty one is returned.

Parameters
idthe ID of the cluster to get
Returns
the cluster

Definition at line 94 of file WDataSetFiberClustering.cpp.

References m_clusters.

◆ getPrototype()

std::shared_ptr< WPrototyped > WDataSetFiberClustering::getPrototype ( )
static

Returns a prototype instantiated with the true type of the deriving class.

Returns
the prototype.

Definition at line 50 of file WDataSetFiberClustering.cpp.

References m_prototype, and WDataSetFiberClustering().

+ Here is the call graph for this function:

◆ removeCluster()

void WDataSetFiberClustering::removeCluster ( size_t  id)
virtual

Removes the cluster with the specified ID.

If it does not exist, nothing happens.

Parameters
idthe id of the cluster

Definition at line 107 of file WDataSetFiberClustering.cpp.

References m_clusters.

◆ setCluster()

void WDataSetFiberClustering::setCluster ( size_t  id,
WFiberCluster::SPtr  cluster 
)
virtual

Sets the cluster at the given ID.

If there is a cluster at this ID, it is replaced.

Parameters
idthe ID of the cluster
clusterthe cluster

Definition at line 69 of file WDataSetFiberClustering.cpp.

References m_clusters.

◆ size()

size_t WDataSetFiberClustering::size ( ) const

Returns the amount of clusters in the clustering.

Returns
the amount of clusters in the clustering

Definition at line 136 of file WDataSetFiberClustering.cpp.

References m_clusters.

Member Data Documentation

◆ m_clusters

std::map< size_t, WFiberCluster::SPtr > WDataSetFiberClustering::m_clusters
private

The map between ID and cluster.

Definition at line 190 of file WDataSetFiberClustering.h.

Referenced by begin(), end(), getCluster(), getOrCreateCluster(), removeCluster(), setCluster(), size(), and WDataSetFiberClustering().

◆ m_prototype

std::shared_ptr< WPrototyped > WDataSetFiberClustering::m_prototype = std::shared_ptr< WPrototyped >()
staticprotected

Prototype for this dataset.

Definition at line 185 of file WDataSetFiberClustering.h.

Referenced by getPrototype().


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