7 #include "fwMDSemanticPatch/V1/V2/MedicalWorkspacePatcher.hpp" 9 #include <fwAtoms/Object.hpp> 10 #include <fwAtoms/Object.hxx> 11 #include <fwAtoms/Map.hpp> 13 #include <fwAtomsPatch/IPatch.hpp> 14 #include <fwAtomsPatch/IStructuralPatch.hpp> 15 #include <fwAtomsPatch/StructuralPatchDB.hpp> 16 #include <fwAtomsPatch/patcher/registry/macros.hpp> 17 #include <fwAtomsPatch/helper/functions.hpp> 42 const std::string &context,
43 const std::string ¤tVersion,
44 const std::string &targetVersion)
47 return ::fwAtomsPatch::patcher::DefaultPatcher::transformObject(
object,context,currentVersion, targetVersion);
56 ::fwAtoms::Map::sptr values =
object->getAttribute<
::fwAtoms::Map >(
"values");
57 if((*values)[
"patientDB"] && (*values)[
"planningDB"] && (*values)[
"processingDB"])
59 object->setMetaInfo(
"compositeType",
"MedicalWorkspace");
63 for( ::fwAtoms::Object::AttributesType::value_type elem : object->getAttributes() )
65 ::fwAtoms::Object::sptr att = ::fwAtoms::Object::dynamicCast(elem.second);
FWATOMSPATCH_API std::string getClassname(const ::fwAtoms::Object::sptr &obj)
Get classname of an object.
FWMDSEMANTICPATCH_API void addCompositeTypes(::fwAtoms::Object::sptr object)
Adds a meta info "compositeType" if the object is a composite with a special type.
Contains the semantic patches within the context "MedicalData".
virtual FWMDSEMANTICPATCH_API ~MedicalWorkspacePatcher()
Destructor.
Contains base functionalities used to transform objects from a version to another.
virtual FWMDSEMANTICPATCH_API::fwAtoms::Object::sptr transformObject(::fwAtoms::Object::sptr object, const std::string &context, const std::string ¤tVersion, const std::string &targetVersion) override
Applies the patch to the specified object.
Map is a container for mapping representation.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
This patcher adds required meta infos on composites describing a 'Medical workspace'.
FWMDSEMANTICPATCH_API MedicalWorkspacePatcher(::fwAtomsPatch::patcher::IPatcher::Key key)
Constructor.