7 #include "fwStructuralPatch/fwData/Material/V4ToV3.hpp" 9 #include <fwAtoms/Boolean.hpp> 10 #include <fwAtoms/Numeric.hpp> 11 #include <fwAtoms/Numeric.hxx> 12 #include <fwAtoms/Object.hpp> 13 #include <fwAtoms/Object.hxx> 14 #include <fwAtoms/Sequence.hpp> 15 #include <fwAtoms/String.hpp> 49 const ::fwAtoms::Object::sptr& current,
50 ::fwAtomsPatch::IPatch::NewVersionsType& newVersions)
52 IStructuralPatch::apply(previous, current, newVersions);
61 ::fwAtoms::String::sptr shadingMode = previous->getAttribute<
::fwAtoms::String >(
"shading_mode");
62 std::string shading = shadingMode->getValue();
65 if (shading ==
"AMBIENT")
75 ::fwAtoms::Object::sptr ambient = current->getAttribute<
::fwAtoms::Object >(
"ambient");
83 ::fwAtoms::String::sptr optionMode = previous->getAttribute<
::fwAtoms::String >(
"options_mode");
84 std::string option = optionMode->getValue();
85 if (option ==
"CELLS_NORMALS")
FWSTRUCTURALPATCH_API V4ToV3()
Constructor.
FWATOMSPATCH_API void updateVersion(std::shared_ptr< ::fwAtoms::Object > current)
Updates the version of the patched object.
static FWATOMS_API String::sptr New(std::string value)
Construct a new Object represented a string.
FWATOMS_API Base::sptr getAttribute(const std::string &key) const
Returns requested attribute if exists, empty sptr else.
virtual FWSTRUCTURALPATCH_API void apply(const ::fwAtoms::Object::sptr &previous, const ::fwAtoms::Object::sptr ¤t,::fwAtomsPatch::IPatch::NewVersionsType &newVersions) override
Applies patch.
Contains base functionalities used to transform objects from a version to another.
Class represented a fwData::Object.
std::string m_targetClassname
Target type.
FWATOMSPATCH_API IStructuralPatch()
Constructor.
std::string m_originClassname
Origin classname of the object.
Contains creators and structural patches.
Structural patch to convert a fwData::Material from version '4' to version '3'.
FWSTRUCTURALPATCH_API ~V4ToV3()
Destructor.
FWATOMSPATCH_API void replaceAttribute(const std::string &name,::fwAtoms::Base::sptr newValue, conditions::Abstract::sptr condition=conditions::Abstract::New())
Replaces an attribute.
std::string m_originVersion
Origin version of the object.
FWATOMSPATCH_API void addAttribute(const std::string &name,::fwAtoms::Base::sptr value, conditions::Abstract::sptr condition=conditions::Abstract::New())
Adds a new attribute in the current object.
std::string m_targetVersion
Target version.
Contains the representation of the data objects used in the framework.
Class represented a String.
static FWATOMS_API Boolean::sptr New(std::string value)
Construct an object storing a bool value.