7 #include <fwAtoms/Object.hpp> 8 #include <fwAtoms/Object.hxx> 9 #include <fwAtoms/Map.hpp> 11 #include <fwAtomsPatch/helper/Object.hpp> 12 #include <fwAtomsPatch/helper/functions.hpp> 14 #include <fwAtomsFilter/registry/macros.hpp> 16 #include "filterVRRender/MedicalDataV1.hpp" 31 void clearMapAttribute(
const std::string& key, const ::fwAtoms::Map::sptr& values)
33 if(values->find(key) != values->end())
35 ::fwAtoms::Object::sptr obj = ::fwAtoms::Object::dynamicCast( (*values)[key] );
36 SLM_ASSERT(
"Failed to retrieve key '" + key +
"' from atom", obj);
38 ::fwAtoms::Map::sptr objValues = obj->getAttribute<
::fwAtoms::Map >(
"values");
39 SLM_ASSERT(
"Failed to retrieve 'values' attribute as ::fwAtoms::Map", objValues);
48 SLM_ASSERT(
"Unable to filter atom : invalid object", atom);
50 const std::string&
classname = ::fwAtomsPatch::helper::getClassname(atom);
51 FW_RAISE_IF(
"Unable to filter atom of class '" << classname <<
"'. Expected class is '::fwData::Composite'",
52 classname !=
"::fwData::Composite");
55 SLM_ASSERT(
"Failed to retrieve 'values' attribute as ::fwAtoms::Map", values);
57 clearMapAttribute(
"processingDB", values);
58 clearMapAttribute(
"planningDB", values);
#define SLM_TRACE_FUNC()
Trace contextual function signature.
FWATOMS_API Base::sptr getAttribute(const std::string &key) const
Returns requested attribute if exists, empty sptr else.
Class represented a fwData::Object.
virtual FILTERVRRENDER_API void apply(const std::shared_ptr< ::fwAtoms::Object > &atom)
Apply filter onto given atom object.
static const std::string & classname()
return object's classname without its namespace, i.e. BaseObject
Filter associated to context "MedicalData" version "V1" in VR-Render.
Map is a container for mapping representation.
The namespace filterVRRender contains filters for atoms: it allows to keep only the known atom object...
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
MedicalDataV1(::fwAtomsFilter::IFilter::Key key)
Constructor.
~MedicalDataV1()
Destructor.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.