Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
127 void *callData) override;
128
130 void SetSceneReferences() override;
131
134 void UpdateReferences() override;
135
137 void UpdateScene(vtkMRMLScene *scene) override;
138
140 void UpdateReferenceID(const char *oldID, const char *newID) override;
141
144 vtkSetVector3Macro(Color, double);
147 vtkGetVector3Macro(Color, double);
148
151 vtkSetVector3Macro(EdgeColor, double);
154 vtkGetVector3Macro(EdgeColor, double);
155
158 vtkSetVector3Macro(SelectedColor, double);
161 vtkGetVector3Macro(SelectedColor, double);
162
165 vtkSetMacro(SelectedAmbient, double);
168 vtkGetMacro(SelectedAmbient, double);
169
172 vtkSetMacro(SelectedSpecular, double);
175 vtkGetMacro(SelectedSpecular, double);
176
179 vtkSetMacro(PointSize, double);
182 vtkGetMacro(PointSize, double);
183
186 vtkSetMacro(LineWidth, double);
189 vtkGetMacro(LineWidth, double);
190
193 vtkSetMacro(Representation, int);
196 vtkGetMacro(Representation, int);
197
200 vtkSetMacro(Opacity, double);
203 vtkGetMacro(Opacity, double);
204
207 vtkSetMacro(SliceIntersectionOpacity, double);
210 vtkGetMacro(SliceIntersectionOpacity, double);
211
214 vtkSetMacro(Ambient, double);
217 vtkGetMacro(Ambient, double);
218
221 vtkSetMacro(Diffuse, double);
224 vtkGetMacro(Diffuse, double);
225
228 vtkSetMacro(Specular, double);
231 vtkGetMacro(Specular, double);
232
235 vtkSetMacro(Power, double);
238 vtkGetMacro(Power, double);
239
241
243 vtkSetMacro(Metallic, double);
244 vtkGetMacro(Metallic, double);
246
248
250 vtkSetMacro(Roughness, double);
251 vtkGetMacro(Roughness, double);
253
256 vtkSetMacro(Visibility, int);
259 vtkGetMacro(Visibility, int);
262 vtkBooleanMacro(Visibility, int);
270 virtual bool GetVisibility(const char* viewNodeID);
271
275 vtkSetMacro(Visibility2D, int);
279 vtkGetMacro(Visibility2D, int);
283 vtkBooleanMacro(Visibility2D, int);
284
288 vtkSetMacro(Visibility3D, int);
292 vtkGetMacro(Visibility3D, int);
296 vtkBooleanMacro(Visibility3D, int);
297
300 vtkSetMacro(EdgeVisibility, int);
301 vtkBooleanMacro(EdgeVisibility, int);
304 vtkGetMacro(EdgeVisibility, int);
305
308 vtkSetMacro(Clipping, int);
311 vtkGetMacro(Clipping, int);
314 vtkBooleanMacro(Clipping, int);
315
340
343 vtkSetMacro(SliceIntersectionThickness, int);
346 vtkGetMacro(SliceIntersectionThickness, int);
347
349
356 vtkSetMacro(FrontfaceCulling, int);
357 vtkGetMacro(FrontfaceCulling, int);
358 vtkBooleanMacro(FrontfaceCulling, int);
359 vtkSetMacro(BackfaceCulling, int);
360 vtkGetMacro(BackfaceCulling, int);
361 vtkBooleanMacro(BackfaceCulling, int);
363
367 vtkSetMacro(Lighting, int);
371 vtkGetMacro(Lighting, int);
374 vtkBooleanMacro(Lighting, int);
375
378 vtkSetMacro(Interpolation, int);
381 vtkGetMacro(Interpolation, int);
382
385 vtkSetMacro(Shading, int);
388 vtkGetMacro(Shading, int);
389
393 vtkSetMacro(ScalarVisibility, int);
397 vtkGetMacro(ScalarVisibility, int);
400 vtkBooleanMacro(ScalarVisibility, int);
401
405 vtkSetMacro(VectorVisibility, int);
409 vtkGetMacro(VectorVisibility, int);
412 vtkBooleanMacro(VectorVisibility, int);
413
417 vtkSetMacro(TensorVisibility, int);
421 vtkGetMacro(TensorVisibility, int);
424 vtkBooleanMacro(TensorVisibility, int);
425
445 virtual void UpdateAssignedAttribute() {};
449 virtual void UpdateScalarRange();
450
453 vtkSetVector2Macro(ScalarRange, double);
456 vtkGetVector2Macro(ScalarRange, double);
457
461 virtual void SetScalarRangeFlag(int flag);
464 vtkGetMacro(ScalarRangeFlag, int);
470 void SetScalarRangeFlagFromString(const char* str);
471
480 vtkBooleanMacro(FolderDisplayOverrideAllowed, bool);
481
483
491 vtkSetMacro(ShowMode, int);
492 vtkGetMacro(ShowMode, int);
495
497
499 static const char* GetShowModeAsString(int flag);
500 static int GetShowModeFromString(const char* name);
502
505 virtual void SetTextureImageDataConnection(vtkAlgorithmOutput *ImageDataConnection);
508 vtkGetObjectMacro(TextureImageDataConnection, vtkAlgorithmOutput);
509
513 vtkSetMacro(InterpolateTexture, int);
517 vtkGetMacro(InterpolateTexture, int);
520 vtkBooleanMacro(InterpolateTexture, int);
521
524 virtual void SetAndObserveColorNodeID(const char *ColorNodeID);
528 void SetAndObserveColorNodeID(const std::string& ColorNodeID);
531 vtkGetStringMacro(ColorNodeID);
532
537
540 vtkSetStringMacro(ActiveScalarName);
543 vtkGetStringMacro(ActiveScalarName);
544
548 vtkSetMacro(ActiveAttributeLocation, int);
551 vtkGetMacro(ActiveAttributeLocation, int);
562 virtual void SetActiveScalar(const char *scalarName, int location);
563
566 virtual vtkDataSet* GetScalarDataSet() { return nullptr; };
569 virtual vtkDataArray* GetActiveScalarArray() { return nullptr; };
570
573 void AddViewNodeID(const char* viewNodeID);
581 void RemoveViewNodeID(char* viewNodeID);
588 inline int GetNumberOfViewNodeIDs()const;
592 const char* GetNthViewNodeID(unsigned int index);
596 inline std::vector< std::string > GetViewNodeIDs()const;
600 bool IsViewNodeIDPresent(const char* viewNodeID)const;
605 bool IsDisplayableInView(const char* viewNodeID)const;
610 void SetDisplayableOnlyInView(const char *viewNodeID);
614 void SetViewNodeIDs(const std::vector< std::string >& viewNodeIDs);
615
617 static const char* GetAttributeLocationAsString(int id);
619 static int GetAttributeLocationFromString(const char* name);
620
623 static std::string GetTextPropertyAsString(vtkTextProperty* property);
624
627 static void UpdateTextPropertyFromString(std::string inputString, vtkTextProperty* property);
628
630 virtual void SetAndObserveClipNodeID(const char* id);
632 virtual const char* GetClipNodeReferenceRole() const;
633
634protected:
639
644 virtual void SetColorNodeInternal(vtkMRMLColorNode* newColorNode);
645
648 static void GetColorFromString(const std::string& colorString, double color[4]);
649
655 vtkAlgorithmOutput *TextureImageDataConnection;
656
670
685
690 double Opacity;
700 double Ambient;
705 double Diffuse;
710 double Specular;
715 double Power;
720
721 double Metallic;
722 double Roughness;
723
730
734 double PointSize;
735
739 double LineWidth;
740
745
751
760
766
838
844 double ScalarRange[2];
845
850 double Color[3];
856 double EdgeColor[3];
861 double SelectedColor[3];
862
872 std::vector< std::string > ViewNodeIDs;
873
880
885
888
890 vtkWeakPointer<vtkMRMLDisplayableNode> LastFoundDisplayableNode;
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
std::vector< std::string > ViewNodeIDs
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
void SetSceneReferences() override
Mark the color and views nodes as references.
void SetScalarRangeFlagFromString(const char *str)
virtual vtkDataArray * GetActiveScalarArray()
friend class vtkMRMLScene