7 #ifndef __FWDATA_LANDMARKS_HPP__ 8 #define __FWDATA_LANDMARKS_HPP__ 10 #include "fwData/config.hpp" 11 #include "fwData/factory/new.hpp" 12 #include "fwData/Object.hpp" 18 fwCampAutoDeclareDataMacro((
fwData)(Landmarks), FWDATA_API);
30 typedef std::array< float, 4 > ColorType;
31 typedef std::array< double, 3 > PointType;
32 typedef float SizeType;
33 typedef std::vector< PointType > PointContainer;
34 typedef std::vector< std::string > GroupNameContainer;
44 LandmarksGroup(ColorType color, SizeType size, Shape shape,
bool visibility) :
48 m_visibility(visibility)
56 PointContainer m_points;
73 FWDATA_API
void shallowCopy(
const Object::csptr& _source )
override;
76 FWDATA_API
void cachedDeepCopy(
const Object::csptr& _source, DeepCopyCacheType& cache)
override;
83 FWDATA_API
void addGroup(
const std::string& name,
const ColorType& color = {{1.0f, 1.0f, 1.0f, 1.0f}},
84 const SizeType size = 1.0f,
const Shape shape = Shape::SPHERE,
85 const bool visibility =
true);
88 FWDATA_API
const GroupNameContainer getGroupNames()
const;
95 FWDATA_API
const LandmarksGroup& getGroup(
const std::string& name)
const;
109 FWDATA_API
void renameGroup(
const std::string& oldName,
const std::string& newName);
116 FWDATA_API
void removeGroup(
const std::string& name);
125 FWDATA_API
void setGroupColor(
const std::string& name,
const ColorType& color);
132 FWDATA_API
void setGroupSize(
const std::string& name,
const SizeType size);
139 FWDATA_API
void setGroupShape(
const std::string& name,
const Shape shape);
146 FWDATA_API
void setGroupVisibility(
const std::string& name,
const bool visibility);
153 FWDATA_API
void addPoint(
const std::string& name,
const PointType&
point);
160 FWDATA_API
void insertPoint(
const std::string& name,
const size_t index,
const PointType&
point);
167 FWDATA_API
const PointType& getPoint(
const std::string& name,
size_t index)
const;
174 FWDATA_API PointType& getPoint(
const std::string& name,
size_t index);
181 FWDATA_API
const PointContainer& getPoints(
const std::string& name)
const;
188 FWDATA_API
void removePoint(
const std::string& name,
size_t index);
195 FWDATA_API
void clearPoints(
const std::string& name);
198 size_t getNumberOfGroups()
const;
201 FWDATA_API
size_t getNumberOfPoints()
const;
204 FWDATA_API
size_t getNumberOfPoints(
const std::string& name)
const;
256 typedef std::map< std::string, LandmarksGroup > LandmarksContainer;
257 LandmarksContainer m_landmarks;
264 return m_landmarks.size();
269 #endif // __FWDATA_LANDMARKS_HPP__ static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_POINT_INSERTED_SIG
Type of signal when a group is added.
This class defines a list of 3D points inside groups.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_POINT_DESELECTED_SIG
Type of signal when a group is added.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_GROUP_ADDED_SIG
Type of signal when a group is added.
::fwCom::Signal< void(std::string name) > GroupRemovedSignalType
Type of signal when a group is removed.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_GROUP_REMOVED_SIG
Type of signal when a group is added.
::fwCom::Signal< void(std::string oldName, std::string newName) > GroupRenamedSignalType
Type of signal when a group is renamed.
::fwCom::Signal< void(std::string name) > GroupModifiedSignalType
Type of signal when group properties changed.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_POINT_SELECTED_SIG
Type of signal when a group is added.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_POINT_ADDED_SIG
Type of signal when a group is added.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_GROUP_RENAMED_SIG
Type of signal when a group is added.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
::fwCom::Signal< void(std::string name, size_t index) > PointInsertedSignalType
Type of signal when a point is inserted.
Base class for each data object.
::fwCom::Signal< void(std::string name, size_t index) > PointSelectedSignalType
Type of signal when point is selected.
Contains the representation of the data objects used in the framework.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_POINT_MODIFIED_SIG
Type of signal when a group is added.
::fwCom::Signal< void(std::string name) > PointAddedSignalType
Type of signal when a point is added.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_GROUP_MODIFIED_SIG
Type of signal when a group is added.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_POINT_REMOVED_SIG
Type of signal when a group is added.
size_t getNumberOfGroups() const
Return the number of groups.
::fwCom::Signal< void(std::string name, size_t index) > PointDeselectedSignalType
Type of signal when point is deselected.
::fwCom::Signal< void(std::string name, size_t index) > PointRemovedSignalType
Type of signal when a point is removed.
::fwCom::Signal< void(std::string name, size_t index) > PointModifiedSigType
Type of signal when a point is modified.