Slicer  5.3
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) override;
44 
45  vtkMRMLNode* CreateNodeInstance() override;
46 
49  void ReadXMLAttributes( const char** atts) override;
50 
53  void WriteXML(ostream& of, int indent) override;
54 
58 
61  const char* GetNodeTagName() override {return "PlotChart";};
62 
65  void ProcessMRMLEvents(vtkObject *caller,
66  unsigned long event,
67  void *callData) 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  //----------------------------------------------------------------
282  ~vtkMRMLPlotChartNode() override;
284  void operator=(const vtkMRMLPlotChartNode&);
285 
288  void OnNodeReferenceAdded(vtkMRMLNodeReference *reference) override;
289 
292  void OnNodeReferenceModified(vtkMRMLNodeReference *reference) override;
293 
296  void OnNodeReferenceRemoved(vtkMRMLNodeReference *reference) override;
297 
298  static const char* PlotSeriesNodeReferenceRole;
299 
300  char *Title{nullptr};
301  int TitleFontSize{20};
302  bool TitleVisibility{true};
303  bool GridVisibility{true};
304  bool LegendVisibility{true};
305  int LegendFontSize{16};
306  bool XAxisRangeAuto{true};
307  bool YAxisRangeAuto{true};
308  double XAxisRange[2];
309  double YAxisRange[2];
310  bool XAxisLogScale{false};
311  bool YAxisLogScale{false};
312  char* XAxisTitle{nullptr};
313  bool XAxisTitleVisibility{true};
314  char* YAxisTitle{nullptr};
315  bool YAxisTitleVisibility{true};
316  int AxisTitleFontSize{16};
317  int AxisLabelFontSize{12};
318  char* FontType{nullptr};
319  bool EnablePointMoveAlongX{true};
320  bool EnablePointMoveAlongY{true};
321 };
322 
323 #endif
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model).
MRML node for referencing a collection of data to plot.
MRML node to represent a vtkPlot object.
virtual void ReadXMLAttributes(const char **atts)
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:936
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 nullptr).
Definition: vtkMRMLNode.h:942
PlotSeriesNodeProperty
Properties used by SetPropertyToAllPlotSeriesNodes() and GetPropertyFromAllPlotSeriesNodes() methods...
virtual void WriteXML(ostream &of, int indent)
void PrintSelf(ostream &os, vtkIndent indent) override
#define vtkMRMLCopyContentMacro(thisClassName)
Definition: vtkMRMLNode.h:142
virtual void OnNodeReferenceAdded(vtkMRMLNodeReference *reference)
Definition: vtkMRMLNode.h:930
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
static const char * PlotSeriesNodeReferenceRole