Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
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 class vtkMRMLColorNode;
22 
23 // VTK includes
24 class vtkAlgorithmOutput;
25 class vtkImageData;
26 class vtkPolyData;
27 
28 // STD includes
29 #include <vector>
30 
37 class VTK_MRML_EXPORT vtkMRMLDisplayNode : public vtkMRMLNode
38 {
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
42 
45  typedef enum {
46  PointsRepresentation = 0,
48  SurfaceRepresentation
50 
53  typedef enum {
54  FlatInterpolation = 0,
56  PhongInterpolation
58 
70  typedef enum {
71  UseManualScalarRange = 0,
76 
79  const char* GetScalarRangeFlagTypeAsString(int flag);
80 
83  virtual vtkMRMLDisplayableNode* GetDisplayableNode();
84 
87  virtual void ReadXMLAttributes( const char** atts) VTK_OVERRIDE;
88 
91  virtual void WriteXML(ostream& of, int indent) VTK_OVERRIDE;
92 
94  virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE;
95 
99  virtual void ProcessMRMLEvents(vtkObject *caller, unsigned long event,
100  void *callData) VTK_OVERRIDE;
101 
103  virtual void SetSceneReferences() VTK_OVERRIDE;
104 
107  virtual void UpdateReferences() VTK_OVERRIDE;
108 
110  virtual void UpdateScene(vtkMRMLScene *scene) VTK_OVERRIDE;
111 
113  virtual void UpdateReferenceID(const char *oldID, const char *newID) VTK_OVERRIDE;
114 
117  vtkSetVector3Macro(Color, double);
120  vtkGetVector3Macro(Color, double);
121 
124  vtkSetVector3Macro(EdgeColor, double);
127  vtkGetVector3Macro(EdgeColor, double);
128 
131  vtkSetVector3Macro(SelectedColor, double);
134  vtkGetVector3Macro(SelectedColor, double);
135 
138  vtkSetMacro(SelectedAmbient, double);
141  vtkGetMacro(SelectedAmbient, double);
142 
145  vtkSetMacro(SelectedSpecular, double);
148  vtkGetMacro(SelectedSpecular, double);
149 
152  vtkSetMacro(PointSize, double);
155  vtkGetMacro(PointSize, double);
156 
159  vtkSetMacro(LineWidth, double);
162  vtkGetMacro(LineWidth, double);
163 
166  vtkSetMacro(Representation, int);
169  vtkGetMacro(Representation, int);
170 
173  vtkSetMacro(Opacity, double);
176  vtkGetMacro(Opacity, double);
177 
180  vtkSetMacro(SliceIntersectionOpacity, double);
183  vtkGetMacro(SliceIntersectionOpacity, double);
184 
187  vtkSetMacro(Ambient, double);
190  vtkGetMacro(Ambient, double);
191 
194  vtkSetMacro(Diffuse, double);
197  vtkGetMacro(Diffuse, double);
198 
201  vtkSetMacro(Specular, double);
204  vtkGetMacro(Specular, double);
205 
208  vtkSetMacro(Power, double);
211  vtkGetMacro(Power, double);
212 
215  vtkSetMacro(Visibility, int);
218  vtkGetMacro(Visibility, int);
221  vtkBooleanMacro(Visibility, int);
227  virtual bool GetVisibility(const char* viewNodeID);
228 
231  vtkSetMacro(EdgeVisibility, int);
232  vtkBooleanMacro(EdgeVisibility, int);
235  vtkGetMacro(EdgeVisibility, int);
236 
239  vtkSetMacro(Clipping, int);
242  vtkGetMacro(Clipping, int);
245  vtkBooleanMacro(Clipping, int);
246 
250  vtkSetMacro(SliceIntersectionVisibility, int);
254  vtkGetMacro(SliceIntersectionVisibility, int);
258  vtkBooleanMacro(SliceIntersectionVisibility, int);
259 
262  vtkSetMacro(SliceIntersectionThickness, int);
265  vtkGetMacro(SliceIntersectionThickness, int);
266 
270  vtkSetMacro(FrontfaceCulling, int);
274  vtkGetMacro(FrontfaceCulling, int);
277  vtkBooleanMacro(FrontfaceCulling, int);
281  vtkSetMacro(BackfaceCulling, int);
285  vtkGetMacro(BackfaceCulling, int);
288  vtkBooleanMacro(BackfaceCulling, int);
289 
293  vtkSetMacro(Lighting, int);
297  vtkGetMacro(Lighting, int);
300  vtkBooleanMacro(Lighting, int);
301 
304  vtkSetMacro(Interpolation, int);
307  vtkGetMacro(Interpolation, int);
308 
311  vtkSetMacro(Shading, int);
314  vtkGetMacro(Shading, int);
315 
319  vtkSetMacro(ScalarVisibility, int);
323  vtkGetMacro(ScalarVisibility, int);
326  vtkBooleanMacro(ScalarVisibility, int);
327 
331  vtkSetMacro(VectorVisibility, int);
335  vtkGetMacro(VectorVisibility, int);
338  vtkBooleanMacro(VectorVisibility, int);
339 
343  vtkSetMacro(TensorVisibility, int);
347  vtkGetMacro(TensorVisibility, int);
350  vtkBooleanMacro(TensorVisibility, int);
351 
356  void SetAutoScalarRange(int b);
361  int GetAutoScalarRange();
365  void AutoScalarRangeOn();
366  void AutoScalarRangeOff();
367 
370  vtkSetVector2Macro(ScalarRange, double);
373  vtkGetVector2Macro(ScalarRange, double);
374 
377  vtkSetMacro(ScalarRangeFlag, int);
380  vtkGetMacro(ScalarRangeFlag, int);
381 
384  virtual void SetTextureImageDataConnection(vtkAlgorithmOutput *ImageDataConnection);
387  vtkGetObjectMacro(TextureImageDataConnection, vtkAlgorithmOutput);
388 
392  vtkSetMacro(InterpolateTexture, int);
396  vtkGetMacro(InterpolateTexture, int);
399  vtkBooleanMacro(InterpolateTexture, int);
400 
403  virtual void SetAndObserveColorNodeID(const char *ColorNodeID);
407  void SetAndObserveColorNodeID(const std::string& ColorNodeID);
410  vtkGetStringMacro(ColorNodeID);
411 
415  virtual vtkMRMLColorNode* GetColorNode();
416 
419  vtkSetStringMacro(ActiveScalarName);
422  vtkGetStringMacro(ActiveScalarName);
423 
427  vtkSetMacro(ActiveAttributeLocation, int);
430  vtkGetMacro(ActiveAttributeLocation, int);
431 
434  void AddViewNodeID(const char* viewNodeID);
437  void RemoveViewNodeID(char* viewNodeID);
440  void RemoveAllViewNodeIDs();
444  inline int GetNumberOfViewNodeIDs()const;
448  const char* GetNthViewNodeID(unsigned int index);
452  inline std::vector< std::string > GetViewNodeIDs()const;
456  bool IsViewNodeIDPresent(const char* viewNodeID)const;
461  bool IsDisplayableInView(const char* viewNodeID)const;
466  void SetDisplayableOnlyInView(const char *viewNodeID);
470  void SetViewNodeIDs(const std::vector< std::string >& viewNodeIDs);
471 
473  static const char* GetAttributeLocationAsString(int id);
474 
476  static int GetAttributeLocationFromString(const char* name);
477 
478 protected:
480  ~vtkMRMLDisplayNode();
481  vtkMRMLDisplayNode(const vtkMRMLDisplayNode&);
482  void operator=(const vtkMRMLDisplayNode&);
483 
488  virtual void SetColorNodeInternal(vtkMRMLColorNode* newColorNode);
489 
495  vtkAlgorithmOutput *TextureImageDataConnection;
496 
504  char *ColorNodeID;
509  vtkMRMLColorNode *ColorNode;
510 
518  char *ActiveScalarName;
524  int ActiveAttributeLocation;
525 
530  double Opacity;
535  double SliceIntersectionOpacity;
540  double Ambient;
545  double Diffuse;
550  double Specular;
555  double Power;
560  double SelectedAmbient;
565  double SelectedSpecular;
566 
570  double PointSize;
571 
575  double LineWidth;
576 
580  int Representation;
581 
586  int Lighting;
587 
595  int Interpolation;
596 
601  int Shading;
602 
607  int Visibility;
614  int EdgeVisibility;
619  int Clipping;
626  int SliceIntersectionVisibility;
633  int SliceIntersectionThickness;
639  int FrontfaceCulling;
645  int BackfaceCulling;
652  int ScalarVisibility;
659  int VectorVisibility;
666  int TensorVisibility;
672  int InterpolateTexture;
673 
679  double ScalarRange[2];
680 
685  double Color[3];
691  double EdgeColor[3];
696  double SelectedColor[3];
697 
707  std::vector< std::string > ViewNodeIDs;
708 
714  int ScalarRangeFlag;
715 
717  vtkWeakPointer<vtkMRMLDisplayableNode> LastFoundDisplayableNode;
718 private:
719  void SetColorNodeID(const char* id);
720 };
721 
722 //----------------------------------------------------------------------------
723 int vtkMRMLDisplayNode::GetNumberOfViewNodeIDs()const
724 {
725  return static_cast<int>(this->ViewNodeIDs.size());
726 }
727 
728 //----------------------------------------------------------------------------
729 std::vector< std::string > vtkMRMLDisplayNode::GetViewNodeIDs()const
730 {
731  return this->ViewNodeIDs;
732 }
733 
734 #endif
LRU Cache.
virtual void ReadXMLAttributes(const char **atts)
virtual void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData)
Propagate events generated in mrml.
std::vector< std::string > GetViewNodeIDs() const
virtual void SetSceneReferences()
Update the references of the node to the scene.
virtual void Copy(vtkMRMLNode *node)
Copy parameters (not including ID and Scene) from another node of the same type.
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:54
Abstract MRML node to represent color information.
virtual void WriteXML(ostream &of, int indent)
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
Abstract class that contains graphical display properties for displayable nodes.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135