Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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{
35public:
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, unsigned long event, void* callData) override;
66
75 enum
76 {
78 };
79
88
89 //----------------------------------------------------------------
91 //----------------------------------------------------------------
92
96 const char* GetPlotSeriesNodeID();
97
102
105 const char* GetNthPlotSeriesNodeID(int n);
106
112
116 int GetPlotSeriesNodeIndexFromID(const char* plotSeriesNodeID);
117
120 virtual int GetPlotSeriesNodeIDs(std::vector<std::string>& plotSeriesNodeIDs);
121
124 virtual int GetPlotSeriesNodeNames(std::vector<std::string>& plotSeriesNodeNames);
125
130
134 void AddAndObservePlotSeriesNodeID(const char* plotSeriesNodeID);
135
139 void SetAndObservePlotSeriesNodeID(const char* plotSeriesNodeID);
140
148 void SetAndObserveNthPlotSeriesNodeID(int n, const char* plotSeriesNodeID);
149
153 void RemovePlotSeriesNodeID(const char* plotSeriesNodeID);
154
159
163
166 bool HasPlotSeriesNodeID(const char* plotSeriesNodeID);
167
169 vtkSetStringMacro(Title);
170 vtkGetStringMacro(Title);
171
173 vtkSetMacro(TitleFontSize, int);
174 vtkGetMacro(TitleFontSize, int);
175
177 vtkBooleanMacro(TitleVisibility, bool);
178 vtkGetMacro(TitleVisibility, bool);
179 vtkSetMacro(TitleVisibility, bool);
180
182 vtkBooleanMacro(GridVisibility, bool);
183 vtkGetMacro(GridVisibility, bool);
184 vtkSetMacro(GridVisibility, bool);
185
187 vtkBooleanMacro(LegendVisibility, bool);
188 vtkGetMacro(LegendVisibility, bool);
189 vtkSetMacro(LegendVisibility, bool);
190
192 vtkSetMacro(LegendFontSize, int);
193 vtkGetMacro(LegendFontSize, int);
194
195 vtkGetMacro(XAxisRangeAuto, bool);
196 vtkSetMacro(XAxisRangeAuto, bool);
197 vtkBooleanMacro(XAxisRangeAuto, bool);
198
199 vtkGetMacro(YAxisRangeAuto, bool);
200 vtkSetMacro(YAxisRangeAuto, bool);
201 vtkBooleanMacro(YAxisRangeAuto, bool);
202
203 vtkGetVector2Macro(XAxisRange, double);
204 vtkSetVector2Macro(XAxisRange, double);
205
206 vtkGetVector2Macro(YAxisRange, double);
207 vtkSetVector2Macro(YAxisRange, double);
208
211 vtkGetMacro(XAxisLogScale, bool);
212 vtkSetMacro(XAxisLogScale, bool);
213 vtkBooleanMacro(XAxisLogScale, bool);
214
217 vtkGetMacro(YAxisLogScale, bool);
218 vtkSetMacro(YAxisLogScale, bool);
219 vtkBooleanMacro(YAxisLogScale, bool);
220
222 vtkSetStringMacro(XAxisTitle);
223 vtkGetStringMacro(XAxisTitle);
224
226 vtkBooleanMacro(XAxisTitleVisibility, bool);
227 vtkGetMacro(XAxisTitleVisibility, bool);
228 vtkSetMacro(XAxisTitleVisibility, bool);
229
231 vtkSetStringMacro(YAxisTitle);
232 vtkGetStringMacro(YAxisTitle);
233
235 vtkBooleanMacro(YAxisTitleVisibility, bool);
236 vtkGetMacro(YAxisTitleVisibility, bool);
237 vtkSetMacro(YAxisTitleVisibility, bool);
238
240 vtkSetMacro(AxisTitleFontSize, int);
241 vtkGetMacro(AxisTitleFontSize, int);
242
244 vtkSetMacro(AxisLabelFontSize, int);
245 vtkGetMacro(AxisLabelFontSize, int);
246
248 vtkSetStringMacro(FontType);
249 vtkGetStringMacro(FontType);
250
253 vtkBooleanMacro(EnablePointMoveAlongX, bool);
254 vtkGetMacro(EnablePointMoveAlongX, bool);
255 vtkSetMacro(EnablePointMoveAlongX, bool);
256
259 vtkBooleanMacro(EnablePointMoveAlongY, bool);
260 vtkGetMacro(EnablePointMoveAlongY, bool);
261 vtkSetMacro(EnablePointMoveAlongY, bool);
262
264 virtual const char* GetPlotSeriesNodeReferenceRole();
265
267 void SetPropertyToAllPlotSeriesNodes(PlotSeriesNodeProperty plotProperty, const char* value);
268
272 bool GetPropertyFromAllPlotSeriesNodes(PlotSeriesNodeProperty plotProperty, std::string& value);
273
274protected:
275 //----------------------------------------------------------------
277 //----------------------------------------------------------------
282
286
290
294
295 static const char* PlotSeriesNodeReferenceRole;
296
297 char* Title{ nullptr };
298 int TitleFontSize{ 20 };
299 bool TitleVisibility{ true };
300 bool GridVisibility{ true };
301 bool LegendVisibility{ true };
302 int LegendFontSize{ 16 };
303 bool XAxisRangeAuto{ true };
304 bool YAxisRangeAuto{ true };
305 double XAxisRange[2];
306 double YAxisRange[2];
307 bool XAxisLogScale{ false };
308 bool YAxisLogScale{ false };
309 char* XAxisTitle{ nullptr };
311 char* YAxisTitle{ nullptr };
315 char* FontType{ nullptr };
318};
319
320#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.