19 #include <vtkTransform.h>
55 if (m_Data != baseData)
60 if (m_Data.IsNotNull() && baseData !=
nullptr)
63 if (0 == strcmp(m_Data->GetNameOfClass(), baseData->GetNameOfClass()))
70 this->GetPropertyList()->
Clear();
80 m_DataReferenceChangedTime.Modified();
99 if (m_PropertyList.IsNotNull())
100 m_PropertyList->RemoveObserver(m_PropertyListModifiedObserverTag);
120 #if (_MSC_VER > 1200) || !defined(_MSC_VER)
123 #if ((defined(_MSC_VER)) && (_MSC_VER <= 1200))
133 #if (_MSC_VER > 1200) || !defined(_MSC_VER)
136 #if ((defined(_MSC_VER)) && (_MSC_VER <= 1200))
141 if (dtn->GetData() != NULL)
142 o << dtn->GetData()->GetNameOfClass();
150 m_Mappers[id] = mapper;
158 if (this->GetSource())
160 this->GetSource()->UpdateOutputInformation();
186 for (
auto entries : m_MapOfPropertyLists)
187 result.push_back(entries.first);
197 if (renderer == NULL)
198 return m_PropertyList;
200 return this->GetPropertyList(renderer->
GetName());
205 if (rendererName.empty())
206 return m_PropertyList;
210 if (propertyList.IsNull())
213 assert(m_MapOfPropertyLists[rendererName].IsNotNull());
220 m_PropertyList->ConcatenatePropertyList(pList, replace);
225 if (propertyKey == NULL)
231 std::string rendererName = renderer->
GetName();
233 MapOfPropertyLists::const_iterator it;
235 it = m_MapOfPropertyLists.find(rendererName);
236 if (it != m_MapOfPropertyLists.end())
239 property = it->second->GetProperty(propertyKey);
240 if (property.IsNotNull())
243 return m_PropertyList->GetProperty(propertyKey);
248 return m_PropertyList->GetProperty(propertyKey);
254 property = m_PropertyList->GetProperty(propertyKey);
255 if (property.IsNotNull())
268 for (PropertyList::PropertyMap::const_iterator groupIter =
269 propertyMap->begin();
270 groupIter != propertyMap->end();
274 if (dynamic_cast<const GroupTagProperty *>(bp))
276 groups.insert(groupIter->first);
286 if (boolprop.IsNull())
289 boolValue = boolprop->GetValue();
296 if (intprop.IsNull())
299 intValue = intprop->GetValue();
308 if (floatprop.IsNull())
311 floatValue = floatprop->GetValue();
320 if (doubleprop.IsNull())
323 float floatValue = 0;
324 if (this->GetFloatProperty(propertyKey, floatValue, renderer))
326 doubleValue = floatValue;
332 doubleValue = doubleprop->GetValue();
341 if (stringProp.IsNull())
348 string = stringProp->GetValue();
356 if (colorprop.IsNull())
359 memcpy(rgb, colorprop->GetColor().GetDataPointer(), 3 *
sizeof(float));
366 if (opacityprop.IsNull())
369 opacity = opacityprop->GetValue();
375 const char *propertyKey)
const
379 if (levWinProp.IsNull())
382 levelWindow = levWinProp->GetLevelWindow();
390 GetPropertyList(renderer)->SetProperty(propertyKey, prop);
394 float red,
float green,
float blue,
const mitk::BaseRenderer *renderer,
const char *propertyKey)
400 SetColor(color, renderer, propertyKey);
407 GetPropertyList(renderer)->SetProperty(propertyKey, prop);
414 GetPropertyList(renderer)->SetProperty(propertyKey, prop);
421 GetPropertyList(renderer)->SetProperty(propertyKey, prop);
426 const char *propertyKey)
430 GetPropertyList(renderer)->SetProperty(propertyKey, prop);
448 if (dynamic_cast<DoubleProperty *>(this->GetProperty(propertyKey, renderer)) != NULL)
450 MITK_WARN <<
"Setting float property " << propertyKey
451 <<
" although a double property with the same name already exists";
458 if (dynamic_cast<FloatProperty *>(this->GetProperty(propertyKey, renderer)) != NULL)
460 MITK_WARN <<
"Setting double property " << propertyKey
461 <<
" although a float property with the same name already exists";
477 GetPropertyList(renderer)->SetProperty(propertyKey, propertyValue);
484 GetPropertyList(renderer)->ReplaceProperty(propertyKey, propertyValue);
492 if ((overwrite) || (GetProperty(propertyKey, renderer) == NULL))
494 SetProperty(propertyKey, propertyValue, renderer);
500 assert(m_Data.IsNotNull());
504 if (geometry == NULL)
512 unsigned long time = Superclass::GetMTime();
513 if (m_Data.IsNotNull())
515 if ((time < m_Data->GetMTime()) || ((m_Data->GetSource().IsNotNull()) && (time < m_Data->GetSource()->GetMTime())))
518 return Superclass::GetMTime();
528 if (selectedProperty.IsNull())
531 selectedProperty->SetValue(
false);
532 SetProperty(
"selected", selectedProperty, renderer);
535 if (selectedProperty->GetValue() != selected)
537 selectedProperty->SetValue(selected);
538 itk::ModifiedEvent event;
573 if (!GetBoolProperty(
"selected", selected, renderer))
581 if (m_DataInteractor == interactor)
584 m_DataInteractor = interactor;
587 mitk::DataNode::InteractorChangedEvent changedEvent;
588 this->InvokeEvent(changedEvent);
593 return m_DataInteractor;
void SetIntProperty(const char *propertyKey, int intValue, const mitk::BaseRenderer *renderer=nullptr)
Convenience method for setting int properties (instances of IntProperty)
mitk::PropertyList * GetPropertyList(const mitk::BaseRenderer *renderer=nullptr) const
Get the PropertyList of the renderer. If renderer is NULL, the BaseRenderer-independent PropertyList ...
itk::SmartPointer< Self > Pointer
mitk::DataNode & operator=(const DataNode &right)
MapperVector m_Mappers
Mapper-slots.
The LevelWindowProperty class Property for the mitk::LevelWindow.
std::set< std::string > GroupTagList
void SetVisibility(bool visible, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="visible")
Convenience method for setting visibility properties (instances of BoolProperty)
MITKCORE_EXPORT std::ostream & operator<<(std::ostream &o, DataNode::Pointer &dtn)
std::vector< MapOfPropertyLists::key_type > PropertyListKeyNames
virtual void SetMapper(MapperSlotId id, mitk::Mapper *mapper)
Base of all data objects.
void ReplaceProperty(const char *propertyKey, BaseProperty *property, const mitk::BaseRenderer *renderer=nullptr)
Replace the property (instance of BaseProperty) with key propertyKey in the PropertyList of the rende...
bool GetIntProperty(const char *propertyKey, int &intValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for int properties (instances of IntProperty)
static Pointer GetInstance()
virtual void SetData(mitk::BaseData *baseData)
Set the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
PropertyList::Pointer m_PropertyList
BaseRenderer-independent PropertyList.
Organizes the rendering process.
virtual void CopyInformation(const itk::DataObject *data) override
bool GetBoolProperty(const char *propertyKey, bool &boolValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for bool properties (instances of BoolProperty)
virtual void SetDataNode(DataNode *_arg)
Set the DataNode containing the data to map.
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
Key-value list holding instances of BaseProperty.
mitk::BaseProperty * GetProperty(const char *propertyKey, const mitk::BaseRenderer *renderer=nullptr) const
Get the property (instance of BaseProperty) with key propertyKey from the PropertyList of the rendere...
virtual unsigned long GetMTime() const override
Get the timestamp of the last change of the contents of this node or the referenced BaseData...
Base class of all mappers, Vtk as well as OpenGL mappers.
virtual void SetRequestedRegionToLargestPossibleRegion() override
bool GetDoubleProperty(const char *propertyKey, double &doubleValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for double properties (instances of DoubleProperty)
MITKCORE_EXPORT std::istream & operator>>(std::istream &i, DataNode::Pointer &dtn)
virtual DataInteractor::Pointer GetDataInteractor() const
bool GetStringProperty(const char *propertyKey, std::string &string, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for string properties (instances of StringProperty)
PropertyListKeyNames GetPropertyListNames() const
The "names" used for (renderer-specific) PropertyLists in GetPropertyList(string).
The LevelWindow class Class to store level/window values.
void ConcatenatePropertyList(PropertyList *pList, bool replace=false)
Add values from another PropertyList.
The ColorProperty class RGB color property.
void SetFloatProperty(const char *propertyKey, float floatValue, const mitk::BaseRenderer *renderer=nullptr)
Convenience method for setting float properties (instances of FloatProperty)
Abstract base class for properties.
void AddProperty(const char *propertyKey, BaseProperty *property, const mitk::BaseRenderer *renderer=nullptr, bool overwrite=false)
Add the property (instance of BaseProperty) if it does not exist (or always ifoverwrite istrue) with ...
bool GetOpacity(float &opacity, const mitk::BaseRenderer *renderer, const char *propertyKey="opacity") const
Convenience access method for opacity properties (instances of FloatProperty)
std::map< std::string, BaseProperty::Pointer > PropertyMap
unsigned long m_PropertyListModifiedObserverTag
void SetOpacity(float opacity, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="opacity")
Convenience method for setting opacity properties (instances of FloatProperty)
bool IsSelected(const mitk::BaseRenderer *renderer=nullptr)
set the node as selected
bool GetFloatProperty(const char *propertyKey, float &floatValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for float properties (instances of FloatProperty)
virtual bool VerifyRequestedRegion() override
void SetColor(const mitk::Color &color, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="color")
Convenience method for setting color properties (instances of ColorProperty)
virtual void UpdateOutputInformation() override
void SetDoubleProperty(const char *propertyKey, double doubleValue, const mitk::BaseRenderer *renderer=nullptr)
Convenience method for setting double properties (instances of DoubleProperty)
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
void SetSelected(bool selected, const mitk::BaseRenderer *renderer=nullptr)
set the node as selected
vtkLinearTransform * GetVtkTransform(int t=0) const
Get the transformation applied prior to displaying the data as a vtkTransform.
void SetBoolProperty(const char *propertyKey, bool boolValue, const mitk::BaseRenderer *renderer=nullptr)
Convenience method for setting boolean properties (instances of BoolProperty)
virtual void Clear()
Calls ClearData() and InitializeEmpty();.
virtual void PropertyListModified(const itk::Object *caller, const itk::EventObject &event)
Invoked when the property list was modified. Calls Modified() of the DataNode.
const char * GetName() const
get the name of the Renderer
mitk::Mapper * GetMapper(MapperSlotId id) const
void SetStringProperty(const char *propertyKey, const char *string, const mitk::BaseRenderer *renderer=nullptr)
Convenience method for setting string properties (instances of StringProperty)
static const char * replace[]
This is a dictionary to replace long names of classes, modules, etc. to shorter versions in the conso...
void SetLevelWindow(mitk::LevelWindow levelWindow, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="levelwindow")
Convenience method for setting level-window properties (instances of LevelWindowProperty) ...
bool GetLevelWindow(mitk::LevelWindow &levelWindow, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="levelwindow") const
Convenience access method for level-window properties (instances of LevelWindowProperty) ...
GroupTagList GetGroupTags() const
Get a set of all group tags from this node's property list.
virtual void SetRequestedRegion(const itk::DataObject *data) override
void SetProperty(const char *propertyKey, BaseProperty *property, const mitk::BaseRenderer *renderer=nullptr)
Set the property (instance of BaseProperty) with key propertyKey in the PropertyList of the renderer ...
virtual bool RequestedRegionIsOutsideOfTheBufferedRegion() override
virtual void SetDataInteractor(const DataInteractor::Pointer interactor)
Set the Interactor.
vtkLinearTransform * GetVtkTransform() const
Get the m_IndexToWorldTransform as a vtkLinearTransform.
bool GetColor(float rgb[3], const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="color") const
Convenience access method for color properties (instances of ColorProperty)
unsigned int MapperSlotId
BaseGeometry Describes the geometry of a data object.
Class for nodes of the DataTree.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.