Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLDisplayNode.h
Go to the documentation of this file.
1/*=auto=========================================================================
2
3 Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4
5 See COPYRIGHT.txt
6 or http://www.slicer.org/copyright/copyright.txt for details.
7
8 Program: 3D Slicer
9 Module: $RCSfile: vtkMRMLDisplayNode.h,v $
10 Date: $Date: 2006/03/19 17:12:29 $
11 Version: $Revision: 1.3 $
12
13=========================================================================auto=*/
14
15#ifndef __vtkMRMLDisplayNode_h
16#define __vtkMRMLDisplayNode_h
17
18// MRML includes
19#include "vtkMRMLNode.h"
20
21// STD includes
22#include <vector>
23
24class vtkAlgorithmOutput;
25class vtkMRMLClipNode;
26class vtkDataSet;
27class vtkImageData;
30class vtkPolyData;
31class vtkTextProperty;
32
39class VTK_MRML_EXPORT vtkMRMLDisplayNode : public vtkMRMLNode
40{
41public:
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
53
63
86
94
95 enum
96 {
97 MenuEvent = 16100,
99 };
100
103 static const char* GetScalarRangeFlagTypeAsString(int flag);
105 static int GetScalarRangeFlagTypeFromString(const char* name);
106
110
113 void ReadXMLAttributes(const char** atts) override;
114
117 void WriteXML(ostream& of, int indent) override;
118
122
126 void ProcessMRMLEvents(vtkObject* caller, unsigned long event, void* callData) override;
127
129 void SetSceneReferences() override;
130
133 void UpdateReferences() override;
134
136 void UpdateScene(vtkMRMLScene* scene) override;
137
139 void UpdateReferenceID(const char* oldID, const char* newID) override;
140
143 vtkSetVector3Macro(Color, double);
146 vtkGetVector3Macro(Color, double);
147
150 vtkSetVector3Macro(EdgeColor, double);
153 vtkGetVector3Macro(EdgeColor, double);
154
157 vtkSetVector3Macro(SelectedColor, double);
160 vtkGetVector3Macro(SelectedColor, double);
161
164 vtkSetMacro(SelectedAmbient, double);
167 vtkGetMacro(SelectedAmbient, double);
168
171 vtkSetMacro(SelectedSpecular, double);
174 vtkGetMacro(SelectedSpecular, double);
175
178 vtkSetMacro(PointSize, double);
181 vtkGetMacro(PointSize, double);
182
185 vtkSetMacro(LineWidth, double);
188 vtkGetMacro(LineWidth, double);
189
192 vtkSetMacro(Representation, int);
195 vtkGetMacro(Representation, int);
196
199 vtkSetMacro(Opacity, double);
202 vtkGetMacro(Opacity, double);
203
206 vtkSetMacro(SliceIntersectionOpacity, double);
209 vtkGetMacro(SliceIntersectionOpacity, double);
210
213 vtkSetMacro(Ambient, double);
216 vtkGetMacro(Ambient, double);
217
220 vtkSetMacro(Diffuse, double);
223 vtkGetMacro(Diffuse, double);
224
227 vtkSetMacro(Specular, double);
230 vtkGetMacro(Specular, double);
231
234 vtkSetMacro(Power, double);
237 vtkGetMacro(Power, double);
238
240
242 vtkSetMacro(Metallic, double);
243 vtkGetMacro(Metallic, double);
245
247
249 vtkSetMacro(Roughness, double);
250 vtkGetMacro(Roughness, double);
252
255 vtkSetMacro(Visibility, int);
258 vtkGetMacro(Visibility, int);
261 vtkBooleanMacro(Visibility, int);
269 virtual bool GetVisibility(const char* viewNodeID);
270
274 vtkSetMacro(Visibility2D, int);
278 vtkGetMacro(Visibility2D, int);
282 vtkBooleanMacro(Visibility2D, int);
283
287 vtkSetMacro(Visibility3D, int);
291 vtkGetMacro(Visibility3D, int);
295 vtkBooleanMacro(Visibility3D, int);
296
299 vtkSetMacro(EdgeVisibility, int);
300 vtkBooleanMacro(EdgeVisibility, int);
303 vtkGetMacro(EdgeVisibility, int);
304
307 vtkSetMacro(Clipping, int);
310 vtkGetMacro(Clipping, int);
313 vtkBooleanMacro(Clipping, int);
314
339
342 vtkSetMacro(SliceIntersectionThickness, int);
345 vtkGetMacro(SliceIntersectionThickness, int);
346
348
355 vtkSetMacro(FrontfaceCulling, int);
356 vtkGetMacro(FrontfaceCulling, int);
357 vtkBooleanMacro(FrontfaceCulling, int);
358 vtkSetMacro(BackfaceCulling, int);
359 vtkGetMacro(BackfaceCulling, int);
360 vtkBooleanMacro(BackfaceCulling, int);
362
366 vtkSetMacro(Lighting, int);
370 vtkGetMacro(Lighting, int);
373 vtkBooleanMacro(Lighting, int);
374
377 vtkSetMacro(Interpolation, int);
380 vtkGetMacro(Interpolation, int);
381
384 vtkSetMacro(Shading, int);
387 vtkGetMacro(Shading, int);
388
392 vtkSetMacro(ScalarVisibility, int);
396 vtkGetMacro(ScalarVisibility, int);
399 vtkBooleanMacro(ScalarVisibility, int);
400
404 vtkSetMacro(VectorVisibility, int);
408 vtkGetMacro(VectorVisibility, int);
411 vtkBooleanMacro(VectorVisibility, int);
412
416 vtkSetMacro(TensorVisibility, int);
420 vtkGetMacro(TensorVisibility, int);
423 vtkBooleanMacro(TensorVisibility, int);
424
444 virtual void UpdateAssignedAttribute() {};
448 virtual void UpdateScalarRange();
449
452 vtkSetVector2Macro(ScalarRange, double);
455 vtkGetVector2Macro(ScalarRange, double);
456
460 virtual void SetScalarRangeFlag(int flag);
463 vtkGetMacro(ScalarRangeFlag, int);
469 void SetScalarRangeFlagFromString(const char* str);
470
479 vtkBooleanMacro(FolderDisplayOverrideAllowed, bool);
480
482
490 vtkSetMacro(ShowMode, int);
491 vtkGetMacro(ShowMode, int);
494
496
498 static const char* GetShowModeAsString(int flag);
499 static int GetShowModeFromString(const char* name);
501
504 virtual void SetTextureImageDataConnection(vtkAlgorithmOutput* ImageDataConnection);
507 vtkGetObjectMacro(TextureImageDataConnection, vtkAlgorithmOutput);
508
512 vtkSetMacro(InterpolateTexture, int);
516 vtkGetMacro(InterpolateTexture, int);
519 vtkBooleanMacro(InterpolateTexture, int);
520
523 virtual void SetAndObserveColorNodeID(const char* ColorNodeID);
527 void SetAndObserveColorNodeID(const std::string& ColorNodeID);
530 vtkGetStringMacro(ColorNodeID);
531
536
539 vtkSetStringMacro(ActiveScalarName);
542 vtkGetStringMacro(ActiveScalarName);
543
547 vtkSetMacro(ActiveAttributeLocation, int);
550 vtkGetMacro(ActiveAttributeLocation, int);
561 virtual void SetActiveScalar(const char* scalarName, int location);
562
565 virtual vtkDataSet* GetScalarDataSet() { return nullptr; };
568 virtual vtkDataArray* GetActiveScalarArray() { return nullptr; };
569
572 void AddViewNodeID(const char* viewNodeID);
580 void RemoveViewNodeID(char* viewNodeID);
587 inline int GetNumberOfViewNodeIDs() const;
591 const char* GetNthViewNodeID(unsigned int index);
595 inline std::vector<std::string> GetViewNodeIDs() const;
599 bool IsViewNodeIDPresent(const char* viewNodeID) const;
604 bool IsDisplayableInView(const char* viewNodeID) const;
609 void SetDisplayableOnlyInView(const char* viewNodeID);
613 void SetViewNodeIDs(const std::vector<std::string>& viewNodeIDs);
614
616 static const char* GetAttributeLocationAsString(int id);
618 static int GetAttributeLocationFromString(const char* name);
619
622 static std::string GetTextPropertyAsString(vtkTextProperty* property);
623
626 static void UpdateTextPropertyFromString(std::string inputString, vtkTextProperty* property);
627
629 virtual void SetAndObserveClipNodeID(const char* id);
631 virtual const char* GetClipNodeReferenceRole() const;
632
633protected:
638
643 virtual void SetColorNodeInternal(vtkMRMLColorNode* newColorNode);
644
647 static void GetColorFromString(const std::string& colorString, double color[4]);
648
654 vtkAlgorithmOutput* TextureImageDataConnection;
655
669
684
689 double Opacity;
699 double Ambient;
704 double Diffuse;
709 double Specular;
714 double Power;
719
720 double Metallic;
721 double Roughness;
722
729
733 double PointSize;
734
738 double LineWidth;
739
744
750
759
765
837
843 double ScalarRange[2];
844
849 double Color[3];
855 double EdgeColor[3];
860 double SelectedColor[3];
861
871 std::vector<std::string> ViewNodeIDs;
872
879
884
887
889 vtkWeakPointer<vtkMRMLDisplayableNode> LastFoundDisplayableNode;
890
891private:
892 void SetColorNodeID(const char* id);
893};
894
895//----------------------------------------------------------------------------
897{
898 return static_cast<int>(this->ViewNodeIDs.size());
899}
900
901//----------------------------------------------------------------------------
902std::vector<std::string> vtkMRMLDisplayNode::GetViewNodeIDs() const
903{
904 return this->ViewNodeIDs;
905}
906
907#endif
MRML node to represent three clipping planes.
Abstract MRML node to represent color information.
void PrintSelf(ostream &os, vtkIndent indent) override
vtkWeakPointer< vtkMRMLDisplayableNode > LastFoundDisplayableNode
Cached value of last found displayable node (it is expensive to determine it)
void SetAutoScalarRange(int b)
void UpdateReferenceID(const char *oldID, const char *newID) override
Update the stored reference to another node in the scene.
virtual void SetActiveScalar(const char *scalarName, int location)
vtkAlgorithmOutput * TextureImageDataConnection
virtual vtkMRMLColorNode * GetColorNode()
void ReadXMLAttributes(const char **atts) override
int GetSliceIntersectionVisibility()
virtual void UpdateScalarRange()
int GetNumberOfViewNodeIDs() const
bool IsViewNodeIDPresent(const char *viewNodeID) const
void operator=(const vtkMRMLDisplayNode &)
ShowModeType
Enumerated values for ShowMode.
@ ShowDefault
set visibility of this node if user requests show of the displayable node
@ ShowIgnore
set visibility manually, useful for non-essential display nodes (e.g., color legend)
const char * GetNthViewNodeID(unsigned int index)
virtual void SetAndObserveClipNodeID(const char *id)
Set the clip node ID of the display node.
void SetActiveAttributeLocationFromString(const char *str)
void SetSliceIntersectionVisibility(int on)
static const char * GetScalarRangeFlagTypeAsString(int flag)
static std::string GetTextPropertyAsString(vtkTextProperty *property)
const char * GetScalarRangeFlagAsString()
vtkMRMLDisplayNode(const vtkMRMLDisplayNode &)
void SliceIntersectionVisibilityOff()
void RemoveAllViewNodeIDs()
void AddViewNodeID(const char *viewNodeID)
static int GetScalarRangeFlagTypeFromString(const char *name)
Gets scalar range flag type from string.
vtkMRMLCopyContentMacro(vtkMRMLDisplayNode)
virtual int GetShowMode()
void SetDisplayableOnlyInView(const char *viewNodeID)
void SetAndObserveColorNodeID(const std::string &ColorNodeID)
void RemoveViewNodeID(char *viewNodeID)
void WriteXML(ostream &of, int indent) override
static int GetAttributeLocationFromString(const char *name)
Gets attribute location (point or cell data) from string.
static void UpdateTextPropertyFromString(std::string inputString, vtkTextProperty *property)
static int GetShowModeFromString(const char *name)
virtual void UpdateAssignedAttribute()
void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) override
void SliceIntersectionVisibilityOn()
virtual const char * GetClipNodeReferenceRole() const
void SetViewNodeIDs(const std::vector< std::string > &viewNodeIDs)
static void GetColorFromString(const std::string &colorString, double color[4])
void UpdateScene(vtkMRMLScene *scene) override
Finds the storage node and read the data.
const char * GetActiveAttributeLocationAsString()
virtual void SetAndObserveColorNodeID(const char *ColorNodeID)
virtual vtkMRMLDisplayableNode * GetDisplayableNode()
virtual vtkMRMLClipNode * GetClipNode()
vtkMRMLColorNode * ColorNode
static const char * GetAttributeLocationAsString(int id)
Converts attribute location (point or cell data) to string.
virtual void SetScalarRangeFlag(int flag)
virtual vtkDataSet * GetScalarDataSet()
bool IsDisplayableInView(const char *viewNodeID) const
virtual bool GetVisibility(const char *viewNodeID)
void UpdateReferences() override
std::vector< std::string > GetViewNodeIDs() const
virtual void SetTextureImageDataConnection(vtkAlgorithmOutput *ImageDataConnection)
virtual void SetColorNodeInternal(vtkMRMLColorNode *newColorNode)
static const char * GetShowModeAsString(int flag)
~vtkMRMLDisplayNode() override
std::vector< std::string > ViewNodeIDs
void SetSceneReferences() override
Mark the color and views nodes as references.
void SetScalarRangeFlagFromString(const char *str)
virtual vtkDataArray * GetActiveScalarArray()
friend class vtkMRMLScene