Commit abe4f693 authored by emilie.harquel's avatar emilie.harquel
Browse files

Added V06AGO version, change Mesh version to '3'.

 * Added graphlink from V04AGO and V05AFG to V06AGO.
 * Added structural patch from Mesh '1' to '3' and '2' to '3'.

--HG--
branch : fw4spl_0.10.0
parent 87f78fdf
......@@ -40,7 +40,7 @@
<id>MDAtomsConfig</id>
<desc>reader/writer config to read/write an atom representing a medical data</desc>
<config>
<patcher context="MedicalData" version="V04AGO" />
<patcher context="MedicalData" version="V06AGO" />
<filter>VRRenderMedicalDataV2</filter>
</config>
</extension>
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2013.
* FW4SPL - Copyright (C) IRCAD, 2009-2015.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......@@ -122,7 +122,7 @@ void PatchTest::patchMedicalDataTest()
//<patcher context="..." version="..." />
::fwRuntime::EConfigurationElement::sptr patcherCfg = ::fwRuntime::EConfigurationElement::New("patcher");
patcherCfg->setAttributeValue("context","MedicalData");
patcherCfg->setAttributeValue("version","V04AGO");
patcherCfg->setAttributeValue("version","V06AGO");
srvCfg->addConfigurationElement(patcherCfg);
::fwMedData::SeriesDB::sptr sdb = read< ::fwMedData::SeriesDB >(srvCfg, "::ioAtoms::SReader" );
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2012.
* FW4SPL - Copyright (C) IRCAD, 2009-2015.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......@@ -10,7 +10,7 @@
fwCampImplementDataMacro((fwData)(Mesh))
{
builder
.tag("object_version", "2")
.tag("object_version", "3")
.tag("lib_name", "fwData")
.base< ::fwData::Object>()
.property("nb_points" , &::fwData::Mesh::m_nbPoints)
......
......@@ -3,5 +3,10 @@
"origin_version" : "V03AGO",
"target_version" : "V04AGO",
"patcher" : "DefaultPatcher",
"links" : []
"links" : [
{
"::fwData::Mesh" : "1",
"::fwData::Mesh" : "3"
}
]
}
......@@ -17,7 +17,7 @@
"::fwData::Line": "1",
"::fwData::List": "1",
"::fwData::Material": "2",
"::fwData::Mesh": "2",
"::fwData::Mesh": "3",
"::fwData::Node": "1",
"::fwData::Plane": "1",
"::fwData::PlaneList": "1",
......
{
"context" : "MedicalData",
"origin_version" : "V04AGO",
"target_version" : "V06AGO",
"patcher" : "DefaultPatcher",
"links" : []
}
{
"context" : "MedicalData",
"origin_version" : "V05AFG",
"target_version" : "V06AGO",
"patcher" : "DefaultPatcher",
"links" : [
{
"::fwData::Mesh" : "2",
"::fwData::Mesh" : "3"
}
]
}
{
"context": "MedicalData",
"version_name": "V06AGO",
"versions": {
"::fwData::Array": "1",
"::fwData::Boolean": "1",
"::fwData::Camera": "2",
"::fwData::Color": "1",
"::fwData::Composite": "1",
"::fwData::Edge": "1",
"::fwData::Float": "1",
"::fwData::Graph": "1",
"::fwData::Histogram": "1",
"::fwData::Image": "2",
"::fwData::Integer": "1",
"::fwData::Line": "1",
"::fwData::List": "1",
"::fwData::Material": "2",
"::fwData::Mesh": "3",
"::fwData::Node": "1",
"::fwData::Plane": "1",
"::fwData::PlaneList": "1",
"::fwData::Point": "1",
"::fwData::PointList": "1",
"::fwData::Port": "1",
"::fwData::ProcessObject": "1",
"::fwData::ROITraits": "1",
"::fwData::Reconstruction": "3",
"::fwData::ReconstructionTraits": "1",
"::fwData::Resection": "1",
"::fwData::ResectionDB": "1",
"::fwData::String": "1",
"::fwData::StructureTraits": "1",
"::fwData::StructureTraitsDictionary": "1",
"::fwData::Tag": "1",
"::fwData::TransferFunction": "1",
"::fwData::TransformationMatrix3D": "1",
"::fwData::Vector": "1",
"::fwData::Video": "1",
"::fwData::location::Folder": "1",
"::fwData::location::SingleFile": "1",
"::fwMedData::ActivitySeries": "1",
"::fwMedData::Equipment": "1",
"::fwMedData::ImageSeries": "1",
"::fwMedData::ModelSeries": "1",
"::fwMedData::Patient": "1",
"::fwMedData::Series": "1",
"::fwMedData::SeriesDB": "1",
"::fwMedData::Study": "1"
}
}
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2015.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#ifndef __FWSTRUCTURALPATCH_FWDATA_MESH_V1TOV3_HPP__
#define __FWSTRUCTURALPATCH_FWDATA_MESH_V1TOV3_HPP__
#include <fwAtomsPatch/IStructuralPatch.hpp>
#include "fwStructuralPatch/config.hpp"
namespace fwStructuralPatch
{
namespace fwData
{
namespace Mesh
{
/// Structural patch to convert a fwData::Mesh from version '1' to version '3'.
class FWSTRUCTURALPATCH_CLASS_API V1ToV3 : public ::fwAtomsPatch::IStructuralPatch
{
public:
fwCoreClassDefinitionsWithFactoryMacro(
(V1ToV3)(::fwStructuralPatch::fwData::Mesh::V1ToV3), (()), new V1ToV3) ;
/// Constructor
FWSTRUCTURALPATCH_API V1ToV3();
/// Destructor
FWSTRUCTURALPATCH_API ~V1ToV3();
/// Copy constructor
FWSTRUCTURALPATCH_API V1ToV3( const V1ToV3 &cpy );
/**
* @brief Applies patch
*
* Added new map of additional array.
*/
FWSTRUCTURALPATCH_API virtual void apply(
const ::fwAtoms::Object::sptr& previous,
const ::fwAtoms::Object::sptr& current,
::fwAtomsPatch::IPatch::NewVersionsType& newVersions);
};
} // namespace Mesh
} // namespace fwData
} // namespace fwStructuralPatch
#endif /* __FWSTRUCTURALPATCH_FWDATA_MESH_V1TOV3_HPP__ */
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2015.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#ifndef __FWSTRUCTURALPATCH_FWDATA_MESH_V2TOV3_HPP__
#define __FWSTRUCTURALPATCH_FWDATA_MESH_V2TOV3_HPP__
#include <fwAtomsPatch/IStructuralPatch.hpp>
#include "fwStructuralPatch/config.hpp"
namespace fwStructuralPatch
{
namespace fwData
{
namespace Mesh
{
/// Structural patch to convert a fwData::Mesh from version '2' to version '3'.
class FWSTRUCTURALPATCH_CLASS_API V2ToV3 : public ::fwAtomsPatch::IStructuralPatch
{
public:
fwCoreClassDefinitionsWithFactoryMacro(
(V2ToV3)(::fwStructuralPatch::fwData::Mesh::V2ToV3), (()), new V2ToV3) ;
/// Constructor
FWSTRUCTURALPATCH_API V2ToV3();
/// Destructor
FWSTRUCTURALPATCH_API ~V2ToV3();
/// Copy constructor
FWSTRUCTURALPATCH_API V2ToV3( const V2ToV3 &cpy );
/**
* @brief Applies patch
*
* Added new map of additional array.
*/
FWSTRUCTURALPATCH_API virtual void apply(
const ::fwAtoms::Object::sptr& previous,
const ::fwAtoms::Object::sptr& current,
::fwAtomsPatch::IPatch::NewVersionsType& newVersions);
};
} // namespace Mesh
} // namespace fwData
} // namespace fwStructuralPatch
#endif /* __FWSTRUCTURALPATCH_FWDATA_MESH_V2TOV3_HPP__ */
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2014.
* FW4SPL - Copyright (C) IRCAD, 2009-2015.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......@@ -15,12 +15,14 @@
#include "fwStructuralPatch/fwData/Image/V1ToV2.hpp"
#include "fwStructuralPatch/fwData/Material/V1ToV2.hpp"
#include "fwStructuralPatch/fwData/Mesh/V1ToV2.hpp"
#include "fwStructuralPatch/fwData/Mesh/V1ToV3.hpp"
#include "fwStructuralPatch/fwData/Mesh/V2ToV3.hpp"
namespace fwStructuralPatch
{
/// Registers structural patches dedicated to conversions from version '1' to version '2'.
/// Registers structural patches dedicated to data conversions.
struct runner
{
runner()
......@@ -34,6 +36,8 @@ struct runner
structuralPatches->registerPatch(::fwStructuralPatch::fwData::Image::V1ToV2::New());
structuralPatches->registerPatch(::fwStructuralPatch::fwData::Material::V1ToV2::New());
structuralPatches->registerPatch(::fwStructuralPatch::fwData::Mesh::V1ToV2::New());
structuralPatches->registerPatch(::fwStructuralPatch::fwData::Mesh::V1ToV3::New());
structuralPatches->registerPatch(::fwStructuralPatch::fwData::Mesh::V2ToV3::New());
}
static runner r;
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2014.
* FW4SPL - Copyright (C) IRCAD, 2009-2015.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
......@@ -52,8 +52,6 @@ void V1ToV2::apply( const ::fwAtoms::Object::sptr& previous,
// Create helper
::fwAtomsPatch::helper::Object helper(current);
helper.addAttribute("point_tex_coords", ::fwAtoms::Object::sptr() );
helper.addAttribute("cell_tex_coords", ::fwAtoms::Object::sptr() );
helper.addAttribute("array_map", ::fwAtoms::Map::New() );
}
......
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2015.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#include <fwAtoms/String.hpp>
#include <fwAtoms/Map.hpp>
#include <fwAtomsPatch/StructuralCreatorDB.hpp>
#include "fwStructuralPatch/fwData/Mesh/V1ToV3.hpp"
namespace fwStructuralPatch
{
namespace fwData
{
namespace Mesh
{
V1ToV3::V1ToV3() : ::fwAtomsPatch::IStructuralPatch()
{
m_originClassname = "::fwData::Mesh";
m_targetClassname = "::fwData::Mesh";
m_originVersion = "1";
m_targetVersion = "3";
}
// ----------------------------------------------------------------------------
V1ToV3::~V1ToV3()
{
}
// ----------------------------------------------------------------------------
V1ToV3::V1ToV3( const V1ToV3 &cpy ) : ::fwAtomsPatch::IStructuralPatch(cpy)
{
}
// ----------------------------------------------------------------------------
void V1ToV3::apply( const ::fwAtoms::Object::sptr& previous,
const ::fwAtoms::Object::sptr& current,
::fwAtomsPatch::IPatch::NewVersionsType& newVersions)
{
IStructuralPatch::apply(previous, current, newVersions);
// Update object version
this->updateVersion(current);
// Create helper
::fwAtomsPatch::helper::Object helper(current);
helper.addAttribute("point_tex_coords", ::fwAtoms::Object::sptr() );
helper.addAttribute("cell_tex_coords", ::fwAtoms::Object::sptr() );
helper.addAttribute("array_map", ::fwAtoms::Map::New() );
}
} // namespace Mesh
} // namespace fwData
} // namespace fwStructuralPatch
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2015.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#include <fwAtoms/String.hpp>
#include <fwAtoms/Map.hpp>
#include <fwAtomsPatch/StructuralCreatorDB.hpp>
#include "fwStructuralPatch/fwData/Mesh/V2ToV3.hpp"
namespace fwStructuralPatch
{
namespace fwData
{
namespace Mesh
{
V2ToV3::V2ToV3() : ::fwAtomsPatch::IStructuralPatch()
{
m_originClassname = "::fwData::Mesh";
m_targetClassname = "::fwData::Mesh";
m_originVersion = "2";
m_targetVersion = "3";
}
// ----------------------------------------------------------------------------
V2ToV3::~V2ToV3()
{
}
// ----------------------------------------------------------------------------
V2ToV3::V2ToV3( const V2ToV3 &cpy ) : ::fwAtomsPatch::IStructuralPatch(cpy)
{
}
// ----------------------------------------------------------------------------
void V2ToV3::apply( const ::fwAtoms::Object::sptr& previous,
const ::fwAtoms::Object::sptr& current,
::fwAtomsPatch::IPatch::NewVersionsType& newVersions)
{
IStructuralPatch::apply(previous, current, newVersions);
// Update object version
this->updateVersion(current);
// Create helper
::fwAtomsPatch::helper::Object helper(current);
if (current->getAttributes().find("point_tex_coords") == current->getAttributes().end())
{
helper.addAttribute("point_tex_coords", ::fwAtoms::Object::sptr() );
}
if (current->getAttributes().find("cell_tex_coords") == current->getAttributes().end())
{
helper.addAttribute("cell_tex_coords", ::fwAtoms::Object::sptr() );
}
}
} // namespace Mesh
} // namespace fwData
} // namespace fwStructuralPatch
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment