MCPcopy Create free account
hub / github.com/MITK/MITK / SetData

Method SetData

Modules/Core/src/DataManagement/mitkDataNode.cpp:54–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54void mitk::DataNode::SetData(mitk::BaseData *baseData)
55{
56 if (m_Data != baseData)
57 {
58 m_Mappers.clear();
59 m_Mappers.resize(10);
60
61 if (m_Data.IsNotNull() && baseData != nullptr)
62 {
63 // Do previous and new data have same type? Keep existing properties.
64 if (0 == strcmp(m_Data->GetNameOfClass(), baseData->GetNameOfClass()))
65 {
66 m_Data = baseData;
67 }
68 else
69 {
70 m_Data = baseData;
71 this->GetPropertyList()->Clear();
72 mitk::CoreObjectFactory::GetInstance()->SetDefaultProperties(this);
73 }
74 }
75 else
76 {
77 m_Data = baseData;
78 mitk::CoreObjectFactory::GetInstance()->SetDefaultProperties(this);
79 }
80
81 m_DataReferenceChangedTime.Modified();
82 Modified();
83 }
84}
85
86mitk::DataNode::DataNode()
87 : m_PropertyList(PropertyList::New()),

Callers 15

TestDataSettingMethod · 0.45
TestGetMTimeMethod · 0.45
setUpMethod · 0.45
setUpMethod · 0.45
AddPointInteractionMethod · 0.45
setUpMethod · 0.45
setUpMethod · 0.45

Calls 8

GetPropertyListMethod · 0.95
ModifiedFunction · 0.85
IsNotNullMethod · 0.80
clearMethod · 0.45
GetNameOfClassMethod · 0.45
ClearMethod · 0.45
SetDefaultPropertiesMethod · 0.45
ModifiedMethod · 0.45

Tested by 15

TestDataSettingMethod · 0.36
TestGetMTimeMethod · 0.36
setUpMethod · 0.36
setUpMethod · 0.36
AddPointInteractionMethod · 0.36
setUpMethod · 0.36
setUpMethod · 0.36