8 #include "filterVRRender/MedicalDataV2.hpp" 10 #include <fwAtoms/Base.hpp> 11 #include <fwAtoms/Object.hpp> 12 #include <fwAtoms/Object.hxx> 13 #include <fwAtoms/Sequence.hpp> 14 #include <fwAtomsFilter/functions.hpp> 16 #include <fwAtomsFilter/registry/macros.hpp> 18 #include <fwAtomsPatch/helper/functions.hpp> 37 SLM_ASSERT(
"Unable to filter atom : invalid object", atom);
39 const std::string expName =
"::fwMedData::SeriesDB";
40 const std::string&
classname = ::fwAtomsPatch::helper::getClassname(atom);
41 FW_RAISE_IF(
"Unable to filter atom of class '" << classname <<
"'. Expected class is '" + expName +
"'",
42 classname != expName);
45 SLM_ASSERT(
"Failed to retrieve 'values' attribute as ::fwAtoms::Sequence", series);
47 ::fwAtoms::Sequence::sptr knownSeries = ::fwAtoms::Sequence::New();
48 for(::fwAtoms::Base::sptr serie : series->getValue())
50 ::fwAtoms::Object::sptr obj = ::fwAtoms::Object::dynamicCast(serie);
51 SLM_ASSERT(
"Failed to cast sequence element as ::fwAtoms::Object", obj);
55 knownSeries->push_back(serie);
60 for(::fwAtoms::Base::sptr serie : knownSeries->getValue())
62 series->push_back(serie);
#define SLM_TRACE_FUNC()
Trace contextual function signature.
FWATOMSFILTER_API bool isSeriesKnown(const std::shared_ptr< ::fwAtoms::Object > &series)
Returns true if given atom matches a defined fwMedData::Series implementations.
FWATOMS_API Base::sptr getAttribute(const std::string &key) const
Returns requested attribute if exists, empty sptr else.
Filter associated to context "MedicalData" version "V2" in VR-Render.
virtual FILTERVRRENDER_API void apply(const std::shared_ptr< ::fwAtoms::Object > &atom)
Apply filter onto given atom object.
Class represented a fwData::Object.
static const std::string & classname()
return object's classname without its namespace, i.e. BaseObject
MedicalDataV2(::fwAtomsFilter::IFilter::Key key)
Constructor.
~MedicalDataV2()
Destructor.
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) ...
Sequence represented a list of meta object.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.