Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLPlotChartNode.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Copyright (c) Kapteyn Astronomical Institute
4  University of Groningen, Groningen, Netherlands. All Rights Reserved.
5 
6  See COPYRIGHT.txt
7  or http://www.slicer.org/copyright/copyright.txt for details.
8 
9  Unless required by applicable law or agreed to in writing, software
10  distributed under the License is distributed on an "AS IS" BASIS,
11  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  See the License for the specific language governing permissions and
13  limitations under the License.
14 
15  This file was originally developed by Davide Punzo, Kapteyn Astronomical Institute,
16  and was supported through the European Research Council grant nr. 291531.
17 
18 ==============================================================================*/
19 
20 #ifndef __vtkMRMLPlotChartNode_h
21 #define __vtkMRMLPlotChartNode_h
22 
23 #include "vtkMRMLNode.h"
24 
25 class vtkCollection;
26 class vtkDataObject;
28 class vtkStringArray;
29 
30 #include <string>
31 
33 class VTK_MRML_EXPORT vtkMRMLPlotChartNode : public vtkMRMLNode
34 {
35  public:
36  //----------------------------------------------------------------
38  //----------------------------------------------------------------
39 
40  static vtkMRMLPlotChartNode *New();
42 
43  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
44 
45  virtual vtkMRMLNode* CreateNodeInstance() VTK_OVERRIDE;
46 
49  virtual void ReadXMLAttributes( const char** atts) VTK_OVERRIDE;
50 
53  virtual void WriteXML(ostream& of, int indent) VTK_OVERRIDE;
54 
57  virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE;
58 
61  virtual const char* GetNodeTagName() VTK_OVERRIDE {return "PlotChart";};
62 
65  virtual void ProcessMRMLEvents(vtkObject *caller,
66  unsigned long event,
67  void *callData) VTK_OVERRIDE;
68 
77  enum
78  {
79  PlotModifiedEvent = 17000,
80  };
81 
84  {
88  PlotMarkerStyle
89  };
90 
91  //----------------------------------------------------------------
93  //----------------------------------------------------------------
94 
98  const char *GetPlotSeriesNodeID();
99 
103  vtkMRMLPlotSeriesNode* GetPlotSeriesNode();
104 
107  const char *GetNthPlotSeriesNodeID(int n);
108 
113  vtkMRMLPlotSeriesNode* GetNthPlotSeriesNode(int n);
114 
118  int GetPlotSeriesNodeIndexFromID(const char* plotSeriesNodeID);
119 
122  virtual int GetPlotSeriesNodeIDs(std::vector<std::string> &plotSeriesNodeIDs);
123 
126  virtual int GetPlotSeriesNodeNames(std::vector<std::string> &plotSeriesNodeNames);
127 
131  int GetNumberOfPlotSeriesNodes();
132 
136  void AddAndObservePlotSeriesNodeID(const char *plotSeriesNodeID);
137 
141  void SetAndObservePlotSeriesNodeID(const char *plotSeriesNodeID);
142 
150  void SetAndObserveNthPlotSeriesNodeID(int n, const char *plotSeriesNodeID);
151 
155  void RemovePlotSeriesNodeID(const char *plotSeriesNodeID);
156 
160  void RemoveNthPlotSeriesNodeID(int n);
161 
164  void RemoveAllPlotSeriesNodeIDs();
165 
168  bool HasPlotSeriesNodeID(const char* plotSeriesNodeID);
169 
170 
172  vtkSetStringMacro(Title);
173  vtkGetStringMacro(Title);
174 
176  vtkSetMacro(TitleFontSize, int);
177  vtkGetMacro(TitleFontSize, int);
178 
180  vtkBooleanMacro(TitleVisibility, bool);
181  vtkGetMacro(TitleVisibility, bool);
182  vtkSetMacro(TitleVisibility, bool);
183 
185  vtkBooleanMacro(GridVisibility, bool);
186  vtkGetMacro(GridVisibility, bool);
187  vtkSetMacro(GridVisibility, bool);
188 
190  vtkBooleanMacro(LegendVisibility, bool);
191  vtkGetMacro(LegendVisibility, bool);
192  vtkSetMacro(LegendVisibility, bool);
193 
195  vtkSetMacro(LegendFontSize, int);
196  vtkGetMacro(LegendFontSize, int);
197 
198  vtkGetMacro(XAxisRangeAuto, bool);
199  vtkSetMacro(XAxisRangeAuto, bool);
200  vtkBooleanMacro(XAxisRangeAuto, bool);
201 
202  vtkGetMacro(YAxisRangeAuto, bool);
203  vtkSetMacro(YAxisRangeAuto, bool);
204  vtkBooleanMacro(YAxisRangeAuto, bool);
205 
206  vtkGetVector2Macro(XAxisRange, double);
207  vtkSetVector2Macro(XAxisRange, double);
208 
209  vtkGetVector2Macro(YAxisRange, double);
210  vtkSetVector2Macro(YAxisRange, double);
211 
214  vtkGetMacro(XAxisLogScale, bool);
215  vtkSetMacro(XAxisLogScale, bool);
216  vtkBooleanMacro(XAxisLogScale, bool);
217 
220  vtkGetMacro(YAxisLogScale, bool);
221  vtkSetMacro(YAxisLogScale, bool);
222  vtkBooleanMacro(YAxisLogScale, bool);
223 
225  vtkSetStringMacro(XAxisTitle);
226  vtkGetStringMacro(XAxisTitle);
227 
229  vtkBooleanMacro(XAxisTitleVisibility, bool);
230  vtkGetMacro(XAxisTitleVisibility, bool);
231  vtkSetMacro(XAxisTitleVisibility, bool);
232 
234  vtkSetStringMacro(YAxisTitle);
235  vtkGetStringMacro(YAxisTitle);
236 
238  vtkBooleanMacro(YAxisTitleVisibility, bool);
239  vtkGetMacro(YAxisTitleVisibility, bool);
240  vtkSetMacro(YAxisTitleVisibility, bool);
241 
243  vtkSetMacro(AxisTitleFontSize, int);
244  vtkGetMacro(AxisTitleFontSize, int);
245 
247  vtkSetMacro(AxisLabelFontSize, int);
248  vtkGetMacro(AxisLabelFontSize, int);
249 
251  vtkSetStringMacro(FontType);
252  vtkGetStringMacro(FontType);
253 
256  vtkBooleanMacro(EnablePointMoveAlongX, bool);
257  vtkGetMacro(EnablePointMoveAlongX, bool);
258  vtkSetMacro(EnablePointMoveAlongX, bool);
259 
262  vtkBooleanMacro(EnablePointMoveAlongY, bool);
263  vtkGetMacro(EnablePointMoveAlongY, bool);
264  vtkSetMacro(EnablePointMoveAlongY, bool);
265 
267  virtual const char* GetPlotSeriesNodeReferenceRole();
268 
270  void SetPropertyToAllPlotSeriesNodes(PlotSeriesNodeProperty plotProperty, const char* value);
271 
275  bool GetPropertyFromAllPlotSeriesNodes(PlotSeriesNodeProperty plotProperty, std::string& value);
276 
277  protected:
278  //----------------------------------------------------------------
280  //----------------------------------------------------------------
284  void operator=(const vtkMRMLPlotChartNode&);
285 
288  virtual void OnNodeReferenceAdded(vtkMRMLNodeReference *reference) VTK_OVERRIDE;
289 
292  virtual void OnNodeReferenceModified(vtkMRMLNodeReference *reference) VTK_OVERRIDE;
293 
296  virtual void OnNodeReferenceRemoved(vtkMRMLNodeReference *reference) VTK_OVERRIDE;
297 
298  static const char* PlotSeriesNodeReferenceRole;
299 
300  char *Title;
308  double XAxisRange[2];
309  double YAxisRange[2];
312  char* XAxisTitle;
314  char* YAxisTitle;
318  char* FontType;
321 };
322 
323 #endif
MRML node for referencing a collection of data to plot.
MRML node to represent a vtkPlot object.
void operator=(const vtkMRMLNode &)
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
virtual void OnNodeReferenceModified(vtkMRMLNodeReference *reference)
Called when a referenced node pointer is modified.
Definition: vtkMRMLNode.h:871
virtual void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData)
Propagate events generated in mrml.
virtual void OnNodeReferenceRemoved(vtkMRMLNodeReference *reference)
Called when a referenced node pointer is removed (set to NULL).
Definition: vtkMRMLNode.h:877
PlotSeriesNodeProperty
Properties used by SetPropertyToAllPlotSeriesNodes() and GetPropertyFromAllPlotSeriesNodes() methods...
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual void OnNodeReferenceAdded(vtkMRMLNodeReference *reference)
Definition: vtkMRMLNode.h:865
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:138
static const char * PlotSeriesNodeReferenceRole