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
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
25class vtkCollection;
26class vtkDataObject;
28class vtkStringArray;
29
30#include <string>
31
33class VTK_MRML_EXPORT vtkMRMLPlotChartNode : public vtkMRMLNode
34{
35 public:
36 //----------------------------------------------------------------
38 //----------------------------------------------------------------
39
42
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
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 {
80 };
81
90
91 //----------------------------------------------------------------
93 //----------------------------------------------------------------
94
98 const char *GetPlotSeriesNodeID();
99
104
107 const char *GetNthPlotSeriesNodeID(int n);
108
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
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
161
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 //----------------------------------------------------------------
285
289
293
297
298 static const char* PlotSeriesNodeReferenceRole;
299
300 char *Title{nullptr};
302 bool TitleVisibility{true};
303 bool GridVisibility{true};
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};
314 char* YAxisTitle{nullptr};
318 char* FontType{nullptr};
321};
322
323#endif
Class to hold information about a node reference.
void AddAndObservePlotSeriesNodeID(const char *plotSeriesNodeID)
const char * GetPlotSeriesNodeID()
Access methods.
virtual int GetPlotSeriesNodeNames(std::vector< std::string > &plotSeriesNodeNames)
Get names of all associated plot data nodes.
const char * GetNthPlotSeriesNodeID(int n)
Return the ID of n-th plot data node ID. Or 0 if no such node exist.
PlotSeriesNodeProperty
Properties used by SetPropertyToAllPlotSeriesNodes() and GetPropertyFromAllPlotSeriesNodes() methods.
vtkMRMLCopyContentMacro(vtkMRMLPlotChartNode)
int GetNumberOfPlotSeriesNodes()
static const char * PlotSeriesNodeReferenceRole
virtual int GetPlotSeriesNodeIDs(std::vector< std::string > &plotSeriesNodeIDs)
Get IDs of all associated plot data nodes.
bool HasPlotSeriesNodeID(const char *plotSeriesNodeID)
Return true if PlotSeriesNodeID is in the plot node ID list.
void RemoveNthPlotSeriesNodeID(int n)
void ReadXMLAttributes(const char **atts) override
Set node attributes.
vtkMRMLPlotSeriesNode * GetNthPlotSeriesNode(int n)
void SetPropertyToAllPlotSeriesNodes(PlotSeriesNodeProperty plotProperty, const char *value)
Helper function to set common properties for all associated plot data nodes.
static vtkMRMLPlotChartNode * New()
Standard methods for MRML nodes.
void OnNodeReferenceAdded(vtkMRMLNodeReference *reference) override
Called when a node reference ID is added (list size increased).
virtual const char * GetPlotSeriesNodeReferenceRole()
Node reference role used for storing plot data node references.
void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) override
Method to propagate events generated in mrml.
void SetAndObserveNthPlotSeriesNodeID(int n, const char *plotSeriesNodeID)
void SetAndObservePlotSeriesNodeID(const char *plotSeriesNodeID)
int GetPlotSeriesNodeIndexFromID(const char *plotSeriesNodeID)
void PrintSelf(ostream &os, vtkIndent indent) override
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model).
vtkMRMLPlotSeriesNode * GetPlotSeriesNode()
void operator=(const vtkMRMLPlotChartNode &)
void RemovePlotSeriesNodeID(const char *plotSeriesNodeID)
vtkMRMLNode * CreateNodeInstance() override
Create instance of the default node. Like New only virtual.
~vtkMRMLPlotChartNode() override
void OnNodeReferenceModified(vtkMRMLNodeReference *reference) override
Called when a node reference ID is modified.
vtkMRMLPlotChartNode()
Constructor and destructor.
vtkMRMLPlotChartNode(const vtkMRMLPlotChartNode &)
void OnNodeReferenceRemoved(vtkMRMLNodeReference *reference) override
Called after a node reference ID is removed (list size decreased).
void RemoveAllPlotSeriesNodeIDs()
Remove all plot data nodes from the chart.
bool GetPropertyFromAllPlotSeriesNodes(PlotSeriesNodeProperty plotProperty, std::string &value)
MRML node to represent a vtkPlot object.