Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLLayoutNode.h
Go to the documentation of this file.
1 #ifndef __vtkMRMLLayoutNode_h
2 #define __vtkMRMLLayoutNode_h
3 
4 // MRML includes
6 
7 class vtkXMLDataElement;
9 
14 class VTK_MRML_EXPORT vtkMRMLLayoutNode : public vtkMRMLAbstractLayoutNode
15 {
16 public:
17  static vtkMRMLLayoutNode *New();
19  vtkMRMLNode* CreateNodeInstance() override;
20  void PrintSelf(ostream& os, vtkIndent indent) override;
21 
22  //--------------------------------------------------------------------------
24  //--------------------------------------------------------------------------
25 
27  void ReadXMLAttributes( const char** atts) override;
28 
30  void WriteXML(ostream& of, int indent) override;
31 
33  void Copy(vtkMRMLNode *node) override;
34 
36  void Reset(vtkMRMLNode* defaultNode) override;
37 
39  vtkGetMacro(ViewArrangement, int);
40  virtual void SetViewArrangement(int);
41 
42  vtkGetMacro(GUIPanelVisibility, int);
43  vtkSetMacro(GUIPanelVisibility, int);
44 
45  vtkGetMacro(BottomPanelVisibility, int);
46  vtkSetMacro(BottomPanelVisibility, int);
47 
49  vtkGetMacro(GUIPanelLR, int);
50  vtkSetMacro(GUIPanelLR, int);
51 
53  vtkGetMacro(CollapseSliceControllers, int);
54  vtkSetMacro(CollapseSliceControllers, int);
55 
57  vtkGetMacro(NumberOfCompareViewRows, int);
58  vtkSetClampMacro(NumberOfCompareViewRows, int, 1, 50);
59  vtkGetMacro(NumberOfCompareViewColumns, int);
60  vtkSetClampMacro(NumberOfCompareViewColumns, int, 1, 50);
61 
63  vtkGetMacro(NumberOfCompareViewLightboxRows, int);
64  vtkSetClampMacro(NumberOfCompareViewLightboxRows, int, 1, 50);
65  vtkGetMacro(NumberOfCompareViewLightboxColumns, int);
66  vtkSetClampMacro(NumberOfCompareViewLightboxColumns, int, 1, 50);
67 
70  vtkGetMacro(MainPanelSize, int);
71  vtkSetMacro(MainPanelSize, int);
72  vtkGetMacro(SecondaryPanelSize, int);
73  vtkSetMacro(SecondaryPanelSize, int);
74 
76  vtkGetStringMacro(SelectedModule);
77  vtkSetStringMacro(SelectedModule);
78 
80  vtkMRMLAbstractViewNode* GetMaximizedViewNode();
81  void SetMaximizedViewNode(vtkMRMLAbstractViewNode* maximizedViewNode);
82 
84  const char* GetNodeTagName() override {return "Layout";}
85 
87  {
88  SlicerLayoutInitialView = 0,
89  SlicerLayoutDefaultView = 1,
90  SlicerLayoutConventionalView = 2,
91  SlicerLayoutFourUpView = 3,
92  SlicerLayoutOneUp3DView = 4,
93  SlicerLayoutOneUpRedSliceView = 6,
94  SlicerLayoutOneUpYellowSliceView = 7,
95  SlicerLayoutOneUpGreenSliceView = 8,
96  SlicerLayoutTabbed3DView = 9,
97  SlicerLayoutTabbedSliceView = 10,
98  SlicerLayoutCompareView = 12,
99  SlicerLayoutNone = 14,
100  SlicerLayoutDual3DView = 15,
101  SlicerLayoutConventionalWidescreenView = 16,
102  SlicerLayoutCompareWidescreenView = 17,
103  SlicerLayoutTriple3DEndoscopyView = 19, // Up to here, all layouts are Slicer 3 compatible
104  SlicerLayoutThreeOverThreeView = 21,
105  SlicerLayoutFourOverFourView = 22,
106  SlicerLayoutCompareGridView = 23,
107  SlicerLayoutTwoOverTwoView = 27,
108  SlicerLayoutSideBySideView = 29,
109  SlicerLayoutFourByThreeSliceView = 30,
110  SlicerLayoutFourByTwoSliceView = 31,
111  SlicerLayoutFiveByTwoSliceView = 32,
112  SlicerLayoutThreeByThreeSliceView = 33,
113  SlicerLayoutFourUpTableView = 34,
114  SlicerLayout3DTableView = 35,
115  SlicerLayoutConventionalPlotView = 36,
116  SlicerLayoutFourUpPlotView = 37,
117  SlicerLayoutFourUpPlotTableView = 38,
118  SlicerLayoutOneUpPlotView = 39,
119  SlicerLayoutThreeOverThreePlotView = 40,
120  SlicerLayoutDicomBrowserView = 41,
121  SlicerLayoutFinalView, // special value, must be placed after the last standard view (used for iterating through all the views)
122 
123  SlicerLayoutMaximizedView = 98,
124  SlicerLayoutCustomView = 99,
125  SlicerLayoutUserView = 100
126  };
127 
131  bool AddLayoutDescription(int layout, const char* layoutDescription);
132 
136  bool SetLayoutDescription(int layout, const char* layoutDescription);
137 
139  bool IsLayoutDescription(int layout);
140 
143  std::string GetLayoutDescription(int layout);
144 
145  // Get the layout description currently displayed. Used
146  // internally. This is XML description corresponding to the ivar
147  // ViewArrangement which is the integer identifier for the
148  // layout. ViewArrangement and CurrentViewDescription may not
149  // correspond while a view is being switched.
150  vtkGetStringMacro(CurrentLayoutDescription);
151 
152  // Get the XML data model of the CurrentViewDescription
153  vtkGetObjectMacro(LayoutRootElement, vtkXMLDataElement);
154 
155  // You are responsible to delete the returned dataElement.
156  static vtkXMLDataElement* ParseLayout(const char* description);
157 
158 protected:
159  void UpdateCurrentLayoutDescription();
160  void SetAndParseCurrentLayoutDescription(const char* description);
161  vtkSetStringMacro(CurrentLayoutDescription);
162 
163 protected:
165  ~vtkMRMLLayoutNode() override;
167  void operator=(const vtkMRMLLayoutNode&);
168 
178 
180 
183 
184  std::map<int, std::string> Layouts;
186  vtkXMLDataElement* LayoutRootElement;
187 };
188 
189 #endif
virtual void Reset(vtkMRMLNode *defaultNode)
Reset node attributes to the initial state as defined in the constructor or the passed default node...
void WriteXML(ostream &of, int indent) override
Write this node&#39;s information to a MRML file in XML format.
vtkXMLDataElement * LayoutRootElement
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
Node that describes the view layout of the application.
std::map< int, std::string > Layouts
Abstract MRML node to represent a view. The class holds the properties common to any view type (3D...
void operator=(const vtkMRMLAbstractLayoutNode &)
void ReadXMLAttributes(const char **atts) override
Set node attributes.
Node that describes the view layout of the application.
void Copy(vtkMRMLNode *node) override
Copy the node&#39;s attributes to this object.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
void PrintSelf(ostream &os, vtkIndent indent) override
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)