Page MenuHomePhabricator

copyinfo.patch

Authored By
schwarzt
Jun 3 2009, 5:05 PM
Size
3 KB
Referenced Files
None
Subscribers
None

copyinfo.patch

Index: Core/Code/DataManagement/mitkBaseData.cpp
===================================================================
--- Core/Code/DataManagement/mitkBaseData.cpp (revision 17557)
+++ Core/Code/DataManagement/mitkBaseData.cpp (working copy)
@@ -304,6 +304,24 @@
return time;
}
+void mitk::BaseData::CopyInformation( const itk::DataObject* data )
+{
+ const Self* bd = dynamic_cast<const Self*>(data);
+ if (bd != NULL)
+ {
+ m_TimeSlicedGeometry = dynamic_cast<TimeSlicedGeometry*>(bd->GetTimeSlicedGeometry()->Clone().GetPointer());
+ m_PropertyList = bd->GetPropertyList()->Clone();
+ }
+ else
+ {
+ // pointer could not be cast back down
+ itkExceptionMacro(<< "mitk::BaseData::CopyInformation() cannot cast "
+ << typeid(data).name() << " to "
+ << typeid(Self*).name() );
+ }
+
+}
+
bool mitk::BaseData::IsInitialized() const
{
return m_Initialized;
Index: Core/Code/DataManagement/mitkBaseData.h
===================================================================
--- Core/Code/DataManagement/mitkBaseData.h (revision 17557)
+++ Core/Code/DataManagement/mitkBaseData.h (working copy)
@@ -178,11 +178,11 @@
//## BaseProcess will copy meta-data from the first input to all of its
//## outputs. See ProcessObject::GenerateOutputInformation(). Each
//## subclass of DataObject is responsible for being able to copy
- //## whatever meta-data it needs from from another DataObject.
- //## The default implementation of this method is empty. If a subclass
- //## overrides this method, it should always call its superclass'
- //## version.
- void CopyInformation(const itk::DataObject*) {};
+ //## whatever meta-data it needs from another DataObject.
+ //## The default implementation of this method copies the time sliced geometry
+ //## and the property list of an object. If a subclass overrides this
+ //## method, it should always call its superclass' version.
+ void CopyInformation(const itk::DataObject* data);
//##Documentation
//## @brief Check whether the data has been initialized, i.e.,
Index: Core/Code/DataManagement/mitkSlicedData.cpp
===================================================================
--- Core/Code/DataManagement/mitkSlicedData.cpp (revision 17557)
+++ Core/Code/DataManagement/mitkSlicedData.cpp (working copy)
@@ -208,7 +208,6 @@
if (slicedData)
{
m_LargestPossibleRegion = slicedData->GetLargestPossibleRegion();
- SetGeometry(dynamic_cast<Geometry3D*>(GetTimeSlicedGeometry()->Clone().GetPointer()));//new SlicedGeometry3D(*slicedData->GetGeometry().GetPointer());
}
else
{
Index: Core/Testing/CMakeLists.txt
===================================================================
--- Core/Testing/CMakeLists.txt (revision 17557)
+++ Core/Testing/CMakeLists.txt (working copy)
@@ -19,6 +19,7 @@
mitkImageDataItemTest.cpp
#mitkImageMapper2DTest.cpp
mitkImageTest.cpp
+ mitkBaseDataTest.cpp
#mitkImageToItkTest.cpp
mitkInteractorTest.cpp
mitkITKThreadingTest.cpp
Index: Modules/MitkExt/DataManagement/mitkUnstructuredGrid.cpp
===================================================================
--- Modules/MitkExt/DataManagement/mitkUnstructuredGrid.cpp (revision 17557)
+++ Modules/MitkExt/DataManagement/mitkUnstructuredGrid.cpp (working copy)
@@ -212,8 +212,10 @@
}
}
-void mitk::UnstructuredGrid::CopyInformation( const itk::DataObject * )
-{}
+void mitk::UnstructuredGrid::CopyInformation( const itk::DataObject * data )
+{
+ Superclass::CopyInformation(data);
+}
void mitk::UnstructuredGrid::Update()
{

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
214
Default Alt Text
copyinfo.patch (3 KB)

Event Timeline