fw4spl
fwData::Landmarks Class Reference

This class defines a list of 3D points inside groups. More...

#include <Landmarks.hpp>

+ Inheritance diagram for fwData::Landmarks:
+ Collaboration diagram for fwData::Landmarks:

Classes

struct  LandmarksGroup
 

Public Types

enum  Shape { SPHERE, CUBE }
 
typedef std::array< float, 4 > ColorType
 
typedef std::array< double, 3 > PointType
 
typedef float SizeType
 
typedef std::vector< PointType > PointContainer
 
typedef std::vector< std::string > GroupNameContainer
 
- Public Types inherited from fwData::Object
typedef ::fwData::factory::Key Key
 
typedef std::string FieldNameType
 
typedef std::vector< FieldNameType > FieldNameVectorType
 
typedef ::std::unordered_map< FieldNameType,::fwData::Object::sptr > FieldMapType
 
typedef ::std::unordered_map< ::fwData::Object::csptr,::fwData::Object::sptr > DeepCopyCacheType
 
typedef ::fwCom::Signal< void() > ModifiedSignalType
 Type of signal m_sigModified.
 
typedef std::map< std::string,::fwData::Object::sptr > FieldsContainerType
 Type of signal m_sigModified.
 
typedef ::fwCom::Signal< void(FieldsContainerType) > AddedFieldsSignalType
 Type of signal when objects are added.
 
typedef ::fwCom::Signal< void(FieldsContainerType, FieldsContainerType) > ChangedFieldsSignalType
 Type of signal when objects are changed (newObjects, oldObjects)
 
typedef ::fwCom::Signal< void(FieldsContainerType) > RemovedFieldsSignalType
 Type of signal when objects are removed.
 
- Public Types inherited from fwCom::HasSignals
typedef std::shared_ptr< HasSignalssptr
 
typedef std::shared_ptr< const HasSignalscsptr
 

Public Member Functions

virtual bool isA (const std::string &type) const override
 
FWDATA_API Landmarks (::fwData::Object::Key key)
 Constructor. More...
 
virtual FWDATA_API ~Landmarks ()
 Destructor.
 
FWDATA_API void shallowCopy (const Object::csptr &_source) override
 Defines shallow copy.
 
FWDATA_API void cachedDeepCopy (const Object::csptr &_source, DeepCopyCacheType &cache) override
 Defines deep copy.
 
FWDATA_API void addGroup (const std::string &name, const ColorType &color={{1.0f, 1.0f, 1.0f, 1.0f}}, const SizeType size=1.0f, const Shape shape=Shape::SPHERE, const bool visibility=true)
 Add a new landmark group. More...
 
FWDATA_API const GroupNameContainer getGroupNames () const
 Return all group names.
 
FWDATA_API const LandmarksGroupgetGroup (const std::string &name) const
 Get the group properties. More...
 
FWDATA_API LandmarksGroupgetGroup (const std::string &name)
 Get the group properties. More...
 
FWDATA_API void renameGroup (const std::string &oldName, const std::string &newName)
 Rename the group. More...
 
FWDATA_API void removeGroup (const std::string &name)
 Remove the group. More...
 
FWDATA_API void setGroupColor (const std::string &name, const ColorType &color)
 Set the group's color. More...
 
FWDATA_API void setGroupSize (const std::string &name, const SizeType size)
 Set the group's landmark size. More...
 
FWDATA_API void setGroupShape (const std::string &name, const Shape shape)
 Set the group's shape (SPHERE or CUBE) More...
 
FWDATA_API void setGroupVisibility (const std::string &name, const bool visibility)
 Set the group's visibility. More...
 
FWDATA_API void addPoint (const std::string &name, const PointType &point)
 Add a point to the group. More...
 
FWDATA_API void insertPoint (const std::string &name, const size_t index, const PointType &point)
 Insert a point to the group at the given index. More...
 
FWDATA_API const PointType & getPoint (const std::string &name, size_t index) const
 Get the point at the given index. More...
 
FWDATA_API PointType & getPoint (const std::string &name, size_t index)
 Get the point at the given index. More...
 
FWDATA_API const PointContainer & getPoints (const std::string &name) const
 Get all group's points. More...
 
FWDATA_API void removePoint (const std::string &name, size_t index)
 Remove the point at the given index. More...
 
FWDATA_API void clearPoints (const std::string &name)
 Remove all the group's points. More...
 
size_t getNumberOfGroups () const
 Return the number of groups.
 
FWDATA_API size_t getNumberOfPoints () const
 Return the number of points in the entire structure.
 
FWDATA_API size_t getNumberOfPoints (const std::string &name) const
 Return the number of points in the group.
 
- Public Member Functions inherited from fwData::Object
FWDATA_API::fwData::Object::sptr getField (const FieldNameType &name,::fwData::Object::sptr defaultValue=::fwData::Object::sptr()) const
 Returns a pointer of corresponding field (null if non exist). More...
 
template<typename DATA_TYPE >
std::shared_ptr< DATA_TYPE > getField (const FieldNameType &name) const
 Returns a pointer of corresponding field. More...
 
template<typename DATA_TYPE >
std::shared_ptr< DATA_TYPE > getField (const FieldNameType &name, std::shared_ptr< DATA_TYPE > defaultValue) const
 Returns a pointer of corresponding field. More...
 
template<typename DATA_TYPE >
std::shared_ptr< DATA_TYPE > setDefaultField (const FieldNameType &name, std::shared_ptr< DATA_TYPE > defaultValue)
 Returns a pointer of corresponding field. If field did not exist, it is set to defaultValue if defaultValue is not null. More...
 
FWDATA_API::fwData::Object::csptr getConstField (const FieldNameType &name) const
 Returns a pointer of corresponding field (null if non exist). More...
 
FWDATA_API const FieldMapType & getFields () const
 Returns fields map.
 
FWDATA_API FieldNameVectorType getFieldNames () const
 Returns vector of field names.
 
FWDATA_API void setField (const FieldNameType &name,::fwData::Object::sptr obj)
 Register field with specified name. If the name does already exist, the matching field will be replaced. More...
 
FWDATA_API void setFields (const FieldMapType &fieldMap)
 Replace the field map content.
 
FWDATA_API void removeField (const FieldNameType &name)
 Removes field with specified name. More...
 
virtual FWDATA_API void shallowCopy (const ::fwData::Object::csptr &source)
 A shallow copy of fields (objects in m_children) More...
 
FWDATA_API void deepCopy (const ::fwData::Object::csptr &source)
 Make a deep copy from the source Calling this method may invalidate any DumpLock, RescursiveLock or helper on the object. Prefer using fwData::Object::copy instead.
 
FWDATA_API void fieldShallowCopy (const ::fwData::Object::csptr &source)
 A shallow copy of fields (objects in m_children) More...
 
FWDATA_API void fieldDeepCopy (const ::fwData::Object::csptr &source)
 A deep copy of fields (objects in m_children) More...
 
::fwCore::mt::ReadWriteMutexgetMutex () const
 Returns the object's mutex.
 
- Public Member Functions inherited from fwTools::Object
- Public Member Functions inherited from fwCore::BaseObject
- Public Member Functions inherited from fwCom::HasSignals
std::shared_ptr< SignalBasesignal (const Signals::SignalKeyType &key) const
 
template<typename SignalType >
std::shared_ptr< SignalType > signal (const Signals::SignalKeyType &key) const
 
template<typename SignalType >
std::shared_ptr< SignalType > newSignal (const Signals::SignalKeyType &key)
 

Static Public Member Functions

static bool isTypeOf (const std::string &type)
 
- Static Public Member Functions inherited from fwData::Object
static bool isTypeOf (const std::string &type)
 
static FWDATA_API::fwData::Object::sptr copy (const ::fwData::Object::csptr &source)
 return a copy of the source. if source is a null pointer, return a null pointer.
 
template<typename DATA_TYPE >
static std::shared_ptr< DATA_TYPE > copy (const std::shared_ptr< const DATA_TYPE > &source)
 return a copy of the source. if source is a null pointer, return a null pointer.
 
template<typename DATA_TYPE >
static std::shared_ptr< DATA_TYPE > copy (const std::shared_ptr< DATA_TYPE > &source)
 return a copy of the source. if source is a null pointer, return a null pointer.
 
static const std::string & classname ()
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
- Static Public Member Functions inherited from fwTools::Object
static bool isTypeOf (const std::string &type)
 
static const std::string & classname ()
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
- Static Public Member Functions inherited from fwCore::BaseObject
static bool isTypeOf (const std::string &type)
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Friends

template<class , class , class >
class ::fwTools::ClassFactory
 
class ::fwTools::Factory
 

Demangling methods

virtual const std::string & getLeafClassname () const override
 return object's classname without its namespace, i.e. BaseObject
 
virtual const std::string & getClassname () const override
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Signals

typedef ::fwCom::Signal< void(std::string name) > GroupAddedSignalType
 Type of signal when a group is added.
 
typedef ::fwCom::Signal< void(std::string name) > GroupRemovedSignalType
 Type of signal when a group is removed.
 
typedef ::fwCom::Signal< void(std::string name) > PointAddedSignalType
 Type of signal when a point is added.
 
typedef ::fwCom::Signal< void(std::string name, size_t index) > PointRemovedSignalType
 Type of signal when a point is removed.
 
typedef ::fwCom::Signal< void(std::string name, size_t index) > PointInsertedSignalType
 Type of signal when a point is inserted.
 
typedef ::fwCom::Signal< void(std::string name, size_t index) > PointModifiedSigType
 Type of signal when a point is modified.
 
typedef ::fwCom::Signal< void(std::string name) > GroupModifiedSignalType
 Type of signal when group properties changed.
 
typedef ::fwCom::Signal< void(std::string oldName, std::string newName) > GroupRenamedSignalType
 Type of signal when a group is renamed.
 
typedef ::fwCom::Signal< void(std::string name, size_t index) > PointSelectedSignalType
 Type of signal when point is selected.
 
typedef ::fwCom::Signal< void(std::string name, size_t index) > PointDeselectedSignalType
 Type of signal when point is deselected.
 
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_GROUP_ADDED_SIG = "groupAdded"
 Type of signal when a group is added.
 
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_GROUP_REMOVED_SIG = "groupemoved"
 Type of signal when a group is added.
 
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_POINT_ADDED_SIG = "pointAdded"
 Type of signal when a group is added.
 
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_POINT_REMOVED_SIG = "pointRemoved"
 Type of signal when a group is added.
 
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_POINT_INSERTED_SIG = "pointInserted"
 Type of signal when a group is added.
 
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_POINT_MODIFIED_SIG = "pointModified"
 Type of signal when a group is added.
 
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_GROUP_MODIFIED_SIG = "groupModified"
 Type of signal when a group is added.
 
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_GROUP_RENAMED_SIG = "groupRenamed"
 Type of signal when a group is added.
 
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_POINT_SELECTED_SIG = "pointSelected"
 Type of signal when a group is added.
 
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_POINT_DESELECTED_SIG = "pointDeselected"
 Type of signal when a group is added.
 

Additional Inherited Members

- Static Public Attributes inherited from fwData::Object
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_MODIFIED_SIG = "modified"
 Key in m_signals map of signal m_sigModified.
 
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_ADDED_FIELDS_SIG = "addedFields"
 Type of signal m_sigModified.
 
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_CHANGED_FIELDS_SIG = "changedFields"
 Type of signal m_sigModified.
 
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_REMOVED_FIELDS_SIG = "removedFields"
 Type of signal m_sigModified.
 
- Protected Types inherited from fwTools::fwID
enum  Policy { EMPTY = 1, GENERATE, MUST_EXIST }
 
typedef std::string IDType
 
- Protected Member Functions inherited from fwData::Object
FWDATA_API void fieldDeepCopy (const ::fwData::Object::csptr &source, DeepCopyCacheType &cache)
 Internal-use methods to implement Object's deepCopy.
 
virtual FWDATA_API void cachedDeepCopy (const ::fwData::Object::csptr &source, DeepCopyCacheType &cache)=0
 Internal-use methods to implement Object's deepCopy.
 
- Protected Member Functions inherited from fwTools::fwID
FWTOOLS_API bool hasID () const
 Return true if the object has an id set. More...
 
FWTOOLS_API IDType getID (Policy policy=GENERATE) const
 Returns the id of the object. If it is not set and the policy value is. More...
 
virtual FWTOOLS_API void setID (IDType newID)
 Set a newID for the object, (newID must not exist in fwID), the oldest one is released. More...
 
FWTOOLS_API void resetID ()
 Release the id for the object. More...
 
 fwID ()
 Constructor : does nothing.
 
- Protected Member Functions inherited from fwCom::HasSignals
 HasSignals (const HasSignals &)
 Copy constructor forbidden.
 
HasSignalsoperator= (const HasSignals &)
 Copy operator forbidden.
 
- Static Protected Member Functions inherited from fwData::Object
static FWDATA_API::fwData::Object::sptr copy (const ::fwData::Object::csptr &source, DeepCopyCacheType &cache)
 Internal-use methods to implement Object's deepCopy.
 
template<typename DATA_TYPE >
static std::shared_ptr< DATA_TYPE > copy (const std::shared_ptr< const DATA_TYPE > &source, DeepCopyCacheType &cache)
 Internal-use methods to implement Object's deepCopy.
 
template<typename DATA_TYPE >
static std::shared_ptr< DATA_TYPE > copy (const std::shared_ptr< DATA_TYPE > &source, DeepCopyCacheType &cache)
 Internal-use methods to implement Object's deepCopy.
 
- Static Protected Member Functions inherited from fwTools::fwID
static bool isTypeOf (const std::string &type)
 
static FWTOOLS_API bool exist (IDType _id)
 
static FWTOOLS_API std::shared_ptr< ::fwTools::ObjectgetObject (IDType requestID)
 Retrieve the object attached to the given id. Return a null sptr if no correspondence exist. More...
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 
- Protected Attributes inherited from fwData::Object
FieldMapType m_fields
 Fields.
 
mutable::fwCore::mt::ReadWriteMutex m_mutex
 Mutex to protect object access.
 
- Protected Attributes inherited from fwTools::Object
std::shared_ptr< ::fwTools::UUIDm_uuid
 UUID used to identify the object, notably for serialization.
 
- Protected Attributes inherited from fwCom::HasSignals
Signals m_signals
 

Detailed Description

This class defines a list of 3D points inside groups.

Definition at line 25 of file fwData/include/fwData/Landmarks.hpp.

Constructor & Destructor Documentation

Member Function Documentation

void fwData::Landmarks::addGroup ( const std::string &  name,
const ColorType &  color = {{1.0f, 1.0f, 1.0f, 1.0f}},
const SizeType  size = 1.0f,
const Shape  shape = Shape::SPHERE,
const bool  visibility = true 
)

Add a new landmark group.

Exceptions
fwData::Exceptionif a group exists with the given name

Definition at line 81 of file fwData/src/fwData/Landmarks.cpp.

void fwData::Landmarks::addPoint ( const std::string &  name,
const PointType &  point 
)

Add a point to the group.

Exceptions
fwData::Exceptionif the group does not exist

Definition at line 184 of file fwData/src/fwData/Landmarks.cpp.

References getGroup().

+ Here is the call graph for this function:

void fwData::Landmarks::clearPoints ( const std::string &  name)

Remove all the group's points.

Exceptions
fwData::Exceptionif the group does not exist

Definition at line 238 of file fwData/src/fwData/Landmarks.cpp.

References getGroup().

+ Here is the call graph for this function:

const Landmarks::LandmarksGroup & fwData::Landmarks::getGroup ( const std::string &  name) const

Get the group properties.

Exceptions
fwData::Exceptionif the group does not exist

Definition at line 107 of file fwData/src/fwData/Landmarks.cpp.

Referenced by addPoint(), clearPoints(), getNumberOfPoints(), getPoint(), getPoints(), insertPoint(), removePoint(), setGroupColor(), setGroupShape(), setGroupSize(), and setGroupVisibility().

+ Here is the caller graph for this function:

Landmarks::LandmarksGroup & fwData::Landmarks::getGroup ( const std::string &  name)

Get the group properties.

Exceptions
fwData::Exceptionif the group does not exist

Definition at line 117 of file fwData/src/fwData/Landmarks.cpp.

const Landmarks::PointType & fwData::Landmarks::getPoint ( const std::string &  name,
size_t  index 
) const

Get the point at the given index.

Exceptions
fwData::Exceptionif the group does not exist

Definition at line 201 of file fwData/src/fwData/Landmarks.cpp.

References getGroup().

+ Here is the call graph for this function:

Landmarks::PointType & fwData::Landmarks::getPoint ( const std::string &  name,
size_t  index 
)

Get the point at the given index.

Exceptions
fwData::Exceptionif the group does not exist

Definition at line 209 of file fwData/src/fwData/Landmarks.cpp.

References getGroup().

+ Here is the call graph for this function:

const Landmarks::PointContainer & fwData::Landmarks::getPoints ( const std::string &  name) const

Get all group's points.

Exceptions
fwData::Exceptionif the group does not exist

Definition at line 217 of file fwData/src/fwData/Landmarks.cpp.

References getGroup().

+ Here is the call graph for this function:

void fwData::Landmarks::insertPoint ( const std::string &  name,
const size_t  index,
const PointType &  point 
)

Insert a point to the group at the given index.

Exceptions
fwData::Exceptionif the group does not exist

Definition at line 192 of file fwData/src/fwData/Landmarks.cpp.

References getGroup().

+ Here is the call graph for this function:

void fwData::Landmarks::removeGroup ( const std::string &  name)

Remove the group.

Exceptions
fwData::Exceptionif the group does not exist

Definition at line 142 of file fwData/src/fwData/Landmarks.cpp.

void fwData::Landmarks::removePoint ( const std::string &  name,
size_t  index 
)

Remove the point at the given index.

Exceptions
fwData::Exceptionif the group does not exist

Definition at line 225 of file fwData/src/fwData/Landmarks.cpp.

References getGroup().

+ Here is the call graph for this function:

void fwData::Landmarks::renameGroup ( const std::string &  oldName,
const std::string &  newName 
)

Rename the group.

Exceptions
fwData::Exceptionif the group does not exist or if a group exists with the new name

Definition at line 128 of file fwData/src/fwData/Landmarks.cpp.

void fwData::Landmarks::setGroupColor ( const std::string &  name,
const ColorType &  color 
)

Set the group's color.

The color is encoded as a rgba float array ranging from 0 to 1

Exceptions
fwData::Exceptionif the group does not exist

Definition at line 152 of file fwData/src/fwData/Landmarks.cpp.

References getGroup().

+ Here is the call graph for this function:

void fwData::Landmarks::setGroupShape ( const std::string &  name,
const Shape  shape 
)

Set the group's shape (SPHERE or CUBE)

Exceptions
fwData::Exceptionif the group does not exist

Definition at line 168 of file fwData/src/fwData/Landmarks.cpp.

References getGroup().

+ Here is the call graph for this function:

void fwData::Landmarks::setGroupSize ( const std::string &  name,
const SizeType  size 
)

Set the group's landmark size.

Exceptions
fwData::Exceptionif the group does not exist

Definition at line 160 of file fwData/src/fwData/Landmarks.cpp.

References getGroup().

+ Here is the call graph for this function:

void fwData::Landmarks::setGroupVisibility ( const std::string &  name,
const bool  visibility 
)

Set the group's visibility.

Exceptions
fwData::Exceptionif the group does not exist

Definition at line 176 of file fwData/src/fwData/Landmarks.cpp.

References getGroup().

+ Here is the call graph for this function:


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