Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkDataNode.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include "mitkDataNode.h"
18 #include "mitkCoreObjectFactory.h"
19 #include <vtkTransform.h>
20 
21 #include "mitkGroupTagProperty.h"
22 #include "mitkProperties.h"
24 #include "mitkStringProperty.h"
25 //#include "mitkMaterialProperty.h"
26 #include "mitkColorProperty.h"
27 #include "mitkCoreObjectFactory.h"
28 #include "mitkGenericProperty.h"
29 #include "mitkGeometry3D.h"
30 #include "mitkImageSource.h"
32 #include "mitkRenderingManager.h"
33 
35 {
36  if ((id >= m_Mappers.size()) || (m_Mappers[id].IsNull()))
37  {
38  if (id >= m_Mappers.capacity())
39  {
40  // int i, size=id-m_Mappers.capacity()+10;
41  m_Mappers.resize(id + 10);
42  }
43  m_Mappers[id] = CoreObjectFactory::GetInstance()->CreateMapper(const_cast<DataNode *>(this), id);
44  }
45  return m_Mappers[id];
46 }
47 
49 {
50  return m_Data;
51 }
52 
54 {
55  if (m_Data != baseData)
56  {
57  m_Mappers.clear();
58  m_Mappers.resize(10);
59 
60  if (m_Data.IsNotNull() && baseData != nullptr)
61  {
62  // Do previous and new data have same type? Keep existing properties.
63  if (0 == strcmp(m_Data->GetNameOfClass(), baseData->GetNameOfClass()))
64  {
65  m_Data = baseData;
66  }
67  else
68  {
69  m_Data = baseData;
70  this->GetPropertyList()->Clear();
71  mitk::CoreObjectFactory::GetInstance()->SetDefaultProperties(this);
72  }
73  }
74  else
75  {
76  m_Data = baseData;
77  mitk::CoreObjectFactory::GetInstance()->SetDefaultProperties(this);
78  }
79 
80  m_DataReferenceChangedTime.Modified();
81  Modified();
82  }
83 }
84 
85 mitk::DataNode::DataNode() : m_PropertyListModifiedObserverTag(0)
86 {
87  m_Mappers.resize(10);
88 
90 
91  // subscribe for modified event
93  _PropertyListModifiedCommand->SetCallbackFunction(this, &mitk::DataNode::PropertyListModified);
94  m_PropertyListModifiedObserverTag = m_PropertyList->AddObserver(itk::ModifiedEvent(), _PropertyListModifiedCommand);
95 }
96 
98 {
99  if (m_PropertyList.IsNotNull())
100  m_PropertyList->RemoveObserver(m_PropertyListModifiedObserverTag);
101 
102  m_Mappers.clear();
103  m_Data = nullptr;
104 }
105 
107 {
109  node->SetData(right.GetData());
110  return *node;
111 }
112 
114 {
116  node->SetData(right);
117  return *node;
118 }
119 
120 #if (_MSC_VER > 1200) || !defined(_MSC_VER)
121 MBI_STD::istream &mitk::operator>>(MBI_STD::istream &i, mitk::DataNode::Pointer &dtn)
122 #endif
123 #if ((defined(_MSC_VER)) && (_MSC_VER <= 1200))
124  MBI_STD::istream &
125  operator>>(MBI_STD::istream &i, mitk::DataNode::Pointer &dtn)
126 #endif
127 {
128  dtn = mitk::DataNode::New();
129  // i >> av.get();
130  return i;
131 }
132 
133 #if (_MSC_VER > 1200) || !defined(_MSC_VER)
134 MBI_STD::ostream &mitk::operator<<(MBI_STD::ostream &o, mitk::DataNode::Pointer &dtn)
135 #endif
136 #if ((defined(_MSC_VER)) && (_MSC_VER <= 1200))
137  MBI_STD::ostream &
138  operator<<(MBI_STD::ostream &o, mitk::DataNode::Pointer &dtn)
139 #endif
140 {
141  if (dtn->GetData() != NULL)
142  o << dtn->GetData()->GetNameOfClass();
143  else
144  o << "empty data";
145  return o;
146 }
147 
149 {
150  m_Mappers[id] = mapper;
151 
152  if (mapper != NULL)
153  mapper->SetDataNode(this);
154 }
155 
157 {
158  if (this->GetSource())
159  {
160  this->GetSource()->UpdateOutputInformation();
161  }
162 }
163 
165 {
166 }
167 
169 {
170  return false;
171 }
172 
174 {
175  return true;
176 }
177 
178 void mitk::DataNode::SetRequestedRegion(const itk::DataObject * /*data*/)
179 {
180 }
181 
183 {
184  PropertyListKeyNames result;
185 
186  for (auto entries : m_MapOfPropertyLists)
187  result.push_back(entries.first);
188 
189  return result;
190 }
191 
192 void mitk::DataNode::CopyInformation(const itk::DataObject * /*data*/)
193 {
194 }
196 {
197  if (renderer == NULL)
198  return m_PropertyList;
199 
200  return this->GetPropertyList(renderer->GetName());
201 }
202 
203 mitk::PropertyList *mitk::DataNode::GetPropertyList(const std::string &rendererName) const
204 {
205  if (rendererName.empty())
206  return m_PropertyList;
207 
208  mitk::PropertyList::Pointer &propertyList = m_MapOfPropertyLists[rendererName];
209 
210  if (propertyList.IsNull())
211  propertyList = mitk::PropertyList::New();
212 
213  assert(m_MapOfPropertyLists[rendererName].IsNotNull());
214 
215  return propertyList;
216 }
217 
219 {
220  m_PropertyList->ConcatenatePropertyList(pList, replace);
221 }
222 
223 mitk::BaseProperty *mitk::DataNode::GetProperty(const char *propertyKey, const mitk::BaseRenderer *renderer) const
224 {
225  if (propertyKey == NULL)
226  return NULL;
227 
228  // renderer specified?
229  if (renderer)
230  {
231  std::string rendererName = renderer->GetName();
232 
233  MapOfPropertyLists::const_iterator it;
234  // check for the renderer specific property
235  it = m_MapOfPropertyLists.find(rendererName);
236  if (it != m_MapOfPropertyLists.end()) // found
237  {
239  property = it->second->GetProperty(propertyKey);
240  if (property.IsNotNull()) // found an enabled property in the render specific list
241  return property;
242  else // found a renderer specific list, but not the desired property
243  return m_PropertyList->GetProperty(propertyKey); // return renderer unspecific property
244  }
245  else // didn't find the property list of the given renderer
246  {
247  // return the renderer unspecific property if there is one
248  return m_PropertyList->GetProperty(propertyKey);
249  }
250  }
251  else // no specific renderer given; use the renderer independent one
252  {
254  property = m_PropertyList->GetProperty(propertyKey);
255  if (property.IsNotNull())
256  return property;
257  }
258 
259  // only to satisfy compiler!
260  return NULL;
261 }
262 
264 {
265  GroupTagList groups;
266  const PropertyList::PropertyMap *propertyMap = m_PropertyList->GetMap();
267 
268  for (PropertyList::PropertyMap::const_iterator groupIter =
269  propertyMap->begin(); // m_PropertyList is created in the constructor, so we don't check it here
270  groupIter != propertyMap->end();
271  ++groupIter)
272  {
273  const BaseProperty *bp = groupIter->second;
274  if (dynamic_cast<const GroupTagProperty *>(bp))
275  {
276  groups.insert(groupIter->first);
277  }
278  }
279 
280  return groups;
281 }
282 
283 bool mitk::DataNode::GetBoolProperty(const char *propertyKey, bool &boolValue, const mitk::BaseRenderer *renderer) const
284 {
285  mitk::BoolProperty::Pointer boolprop = dynamic_cast<mitk::BoolProperty *>(GetProperty(propertyKey, renderer));
286  if (boolprop.IsNull())
287  return false;
288 
289  boolValue = boolprop->GetValue();
290  return true;
291 }
292 
293 bool mitk::DataNode::GetIntProperty(const char *propertyKey, int &intValue, const mitk::BaseRenderer *renderer) const
294 {
295  mitk::IntProperty::Pointer intprop = dynamic_cast<mitk::IntProperty *>(GetProperty(propertyKey, renderer));
296  if (intprop.IsNull())
297  return false;
298 
299  intValue = intprop->GetValue();
300  return true;
301 }
302 
303 bool mitk::DataNode::GetFloatProperty(const char *propertyKey,
304  float &floatValue,
305  const mitk::BaseRenderer *renderer) const
306 {
307  mitk::FloatProperty::Pointer floatprop = dynamic_cast<mitk::FloatProperty *>(GetProperty(propertyKey, renderer));
308  if (floatprop.IsNull())
309  return false;
310 
311  floatValue = floatprop->GetValue();
312  return true;
313 }
314 
315 bool mitk::DataNode::GetDoubleProperty(const char *propertyKey,
316  double &doubleValue,
317  const mitk::BaseRenderer *renderer) const
318 {
319  mitk::DoubleProperty::Pointer doubleprop = dynamic_cast<mitk::DoubleProperty *>(GetProperty(propertyKey, renderer));
320  if (doubleprop.IsNull())
321  {
322  // try float instead
323  float floatValue = 0;
324  if (this->GetFloatProperty(propertyKey, floatValue, renderer))
325  {
326  doubleValue = floatValue;
327  return true;
328  }
329  return false;
330  }
331 
332  doubleValue = doubleprop->GetValue();
333  return true;
334 }
335 
336 bool mitk::DataNode::GetStringProperty(const char *propertyKey,
337  std::string &string,
338  const mitk::BaseRenderer *renderer) const
339 {
340  mitk::StringProperty::Pointer stringProp = dynamic_cast<mitk::StringProperty *>(GetProperty(propertyKey, renderer));
341  if (stringProp.IsNull())
342  {
343  return false;
344  }
345  else
346  {
347  // memcpy((void*)string, stringProp->GetValue(), strlen(stringProp->GetValue()) + 1 ); // looks dangerous
348  string = stringProp->GetValue();
349  return true;
350  }
351 }
352 
353 bool mitk::DataNode::GetColor(float rgb[3], const mitk::BaseRenderer *renderer, const char *propertyKey) const
354 {
355  mitk::ColorProperty::Pointer colorprop = dynamic_cast<mitk::ColorProperty *>(GetProperty(propertyKey, renderer));
356  if (colorprop.IsNull())
357  return false;
358 
359  memcpy(rgb, colorprop->GetColor().GetDataPointer(), 3 * sizeof(float));
360  return true;
361 }
362 
363 bool mitk::DataNode::GetOpacity(float &opacity, const mitk::BaseRenderer *renderer, const char *propertyKey) const
364 {
365  mitk::FloatProperty::Pointer opacityprop = dynamic_cast<mitk::FloatProperty *>(GetProperty(propertyKey, renderer));
366  if (opacityprop.IsNull())
367  return false;
368 
369  opacity = opacityprop->GetValue();
370  return true;
371 }
372 
374  const mitk::BaseRenderer *renderer,
375  const char *propertyKey) const
376 {
378  dynamic_cast<mitk::LevelWindowProperty *>(GetProperty(propertyKey, renderer));
379  if (levWinProp.IsNull())
380  return false;
381 
382  levelWindow = levWinProp->GetLevelWindow();
383  return true;
384 }
385 
386 void mitk::DataNode::SetColor(const mitk::Color &color, const mitk::BaseRenderer *renderer, const char *propertyKey)
387 {
389  prop = mitk::ColorProperty::New(color);
390  GetPropertyList(renderer)->SetProperty(propertyKey, prop);
391 }
392 
394  float red, float green, float blue, const mitk::BaseRenderer *renderer, const char *propertyKey)
395 {
396  float color[3];
397  color[0] = red;
398  color[1] = green;
399  color[2] = blue;
400  SetColor(color, renderer, propertyKey);
401 }
402 
403 void mitk::DataNode::SetColor(const float rgb[3], const mitk::BaseRenderer *renderer, const char *propertyKey)
404 {
406  prop = mitk::ColorProperty::New(rgb);
407  GetPropertyList(renderer)->SetProperty(propertyKey, prop);
408 }
409 
410 void mitk::DataNode::SetVisibility(bool visible, const mitk::BaseRenderer *renderer, const char *propertyKey)
411 {
413  prop = mitk::BoolProperty::New(visible);
414  GetPropertyList(renderer)->SetProperty(propertyKey, prop);
415 }
416 
417 void mitk::DataNode::SetOpacity(float opacity, const mitk::BaseRenderer *renderer, const char *propertyKey)
418 {
420  prop = mitk::FloatProperty::New(opacity);
421  GetPropertyList(renderer)->SetProperty(propertyKey, prop);
422 }
423 
425  const mitk::BaseRenderer *renderer,
426  const char *propertyKey)
427 {
429  prop = mitk::LevelWindowProperty::New(levelWindow);
430  GetPropertyList(renderer)->SetProperty(propertyKey, prop);
431 }
432 
433 void mitk::DataNode::SetIntProperty(const char *propertyKey, int intValue, const mitk::BaseRenderer *renderer)
434 {
435  GetPropertyList(renderer)->SetProperty(propertyKey, mitk::IntProperty::New(intValue));
436 }
437 void mitk::DataNode::SetBoolProperty(const char *propertyKey,
438  bool boolValue,
439  const mitk::BaseRenderer *renderer /*=NULL*/)
440 {
441  GetPropertyList(renderer)->SetProperty(propertyKey, mitk::BoolProperty::New(boolValue));
442 }
443 
444 void mitk::DataNode::SetFloatProperty(const char *propertyKey,
445  float floatValue,
446  const mitk::BaseRenderer *renderer /*=NULL*/)
447 {
448  if (dynamic_cast<DoubleProperty *>(this->GetProperty(propertyKey, renderer)) != NULL)
449  {
450  MITK_WARN << "Setting float property " << propertyKey
451  << " although a double property with the same name already exists";
452  }
453  GetPropertyList(renderer)->SetProperty(propertyKey, mitk::FloatProperty::New(floatValue));
454 }
455 
456 void mitk::DataNode::SetDoubleProperty(const char *propertyKey, double doubleValue, const mitk::BaseRenderer *renderer)
457 {
458  if (dynamic_cast<FloatProperty *>(this->GetProperty(propertyKey, renderer)) != NULL)
459  {
460  MITK_WARN << "Setting double property " << propertyKey
461  << " although a float property with the same name already exists";
462  }
463  GetPropertyList(renderer)->SetProperty(propertyKey, mitk::DoubleProperty::New(doubleValue));
464 }
465 
466 void mitk::DataNode::SetStringProperty(const char *propertyKey,
467  const char *stringValue,
468  const mitk::BaseRenderer *renderer /*=NULL*/)
469 {
470  GetPropertyList(renderer)->SetProperty(propertyKey, mitk::StringProperty::New(stringValue));
471 }
472 
473 void mitk::DataNode::SetProperty(const char *propertyKey,
474  BaseProperty *propertyValue,
475  const mitk::BaseRenderer *renderer)
476 {
477  GetPropertyList(renderer)->SetProperty(propertyKey, propertyValue);
478 }
479 
480 void mitk::DataNode::ReplaceProperty(const char *propertyKey,
481  BaseProperty *propertyValue,
482  const mitk::BaseRenderer *renderer)
483 {
484  GetPropertyList(renderer)->ReplaceProperty(propertyKey, propertyValue);
485 }
486 
487 void mitk::DataNode::AddProperty(const char *propertyKey,
488  BaseProperty *propertyValue,
489  const mitk::BaseRenderer *renderer,
490  bool overwrite)
491 {
492  if ((overwrite) || (GetProperty(propertyKey, renderer) == NULL))
493  {
494  SetProperty(propertyKey, propertyValue, renderer);
495  }
496 }
497 
498 vtkLinearTransform *mitk::DataNode::GetVtkTransform(int t) const
499 {
500  assert(m_Data.IsNotNull());
501 
502  mitk::BaseGeometry *geometry = m_Data->GetGeometry(t);
503 
504  if (geometry == NULL)
505  return NULL;
506 
507  return geometry->GetVtkTransform();
508 }
509 
510 unsigned long mitk::DataNode::GetMTime() const
511 {
512  unsigned long time = Superclass::GetMTime();
513  if (m_Data.IsNotNull())
514  {
515  if ((time < m_Data->GetMTime()) || ((m_Data->GetSource().IsNotNull()) && (time < m_Data->GetSource()->GetMTime())))
516  {
517  Modified();
518  return Superclass::GetMTime();
519  }
520  }
521  return time;
522 }
523 
524 void mitk::DataNode::SetSelected(bool selected, const mitk::BaseRenderer *renderer)
525 {
526  mitk::BoolProperty::Pointer selectedProperty = dynamic_cast<mitk::BoolProperty *>(GetProperty("selected"));
527 
528  if (selectedProperty.IsNull())
529  {
530  selectedProperty = mitk::BoolProperty::New();
531  selectedProperty->SetValue(false);
532  SetProperty("selected", selectedProperty, renderer);
533  }
534 
535  if (selectedProperty->GetValue() != selected)
536  {
537  selectedProperty->SetValue(selected);
538  itk::ModifiedEvent event;
539  InvokeEvent(event);
540  }
541 }
542 
543 /*
544 class SelectedEvent : public itk::ModifiedEvent
545 {
546 public:
547  typedef SelectedEvent Self;
548  typedef itk::ModifiedEvent Superclass;
549 
550  SelectedEvent(DataNode* dataNode)
551  { m_DataNode = dataNode; };
552  DataNode* GetDataNode()
553  { return m_DataNode; };
554  virtual const char * GetEventName() const
555  { return "SelectedEvent"; }
556  virtual bool CheckEvent(const ::itk::EventObject* e) const
557  { return dynamic_cast<const Self*>(e); }
558  virtual ::itk::EventObject* MakeObject() const
559  { return new Self(m_DataNode); }
560 private:
561  DataNode* m_DataNode;
562  SelectedEvent(const Self& event)
563  { m_DataNode = event.m_DataNode; };
564  void operator=(const Self& event)
565  { m_DataNode = event.m_DataNode; }
566 };
567 */
568 
570 {
571  bool selected;
572 
573  if (!GetBoolProperty("selected", selected, renderer))
574  return false;
575 
576  return selected;
577 }
578 
580 {
581  if (m_DataInteractor == interactor)
582  return;
583 
584  m_DataInteractor = interactor;
585  this->Modified();
586 
587  mitk::DataNode::InteractorChangedEvent changedEvent;
588  this->InvokeEvent(changedEvent);
589 }
590 
592 {
593  return m_DataInteractor;
594 }
595 
596 void mitk::DataNode::PropertyListModified(const itk::Object * /*caller*/, const itk::EventObject &)
597 {
598  Modified();
599 }
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 ...
static Pointer New()
itk::SmartPointer< Self > Pointer
static Pointer New()
mitk::DataNode & operator=(const DataNode &right)
MapperVector m_Mappers
Mapper-slots.
Definition: mitkDataNode.h:557
The LevelWindowProperty class Property for the mitk::LevelWindow.
std::set< std::string > GroupTagList
Definition: mitkDataNode.h:73
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
Definition: mitkDataNode.h:72
signed integer value
Definition: jsoncpp.h:348
virtual void SetMapper(MapperSlotId id, mitk::Mapper *mapper)
Base of all data objects.
Definition: mitkBaseData.h:39
static Pointer New()
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 New()
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.
Definition: mitkDataNode.h:571
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.
Definition: mitkMapper.h:54
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.
static Pointer New()
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 ...
#define MITK_WARN
Definition: mitkLogMacros.h:23
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
Definition: mitkDataNode.h:581
void SetOpacity(float opacity, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="opacity")
Convenience method for setting opacity properties (instances of FloatProperty)
static Pointer New()
virtual ~DataNode()
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.
static Pointer New()
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.
static Pointer New()
const char * GetName() const
get the name of the Renderer
UTF-8 string value.
Definition: jsoncpp.h:351
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 ...
Property for strings.
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
Definition: mitkCommon.h:37
static Pointer New()
BaseGeometry Describes the geometry of a data object.
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.