SIVIC API  0.9.26
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
svkPlotLine.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2009-2014 The Regents of the University of California.
3  * All Rights Reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * • Redistributions of source code must retain the above copyright notice,
8  * this list of conditions and the following disclaimer.
9  * • Redistributions in binary form must reproduce the above copyright notice,
10  * this list of conditions and the following disclaimer in the documentation
11  * and/or other materials provided with the distribution.
12  * • None of the names of any campus of the University of California, the name
13  * "The Regents of the University of California," or the names of any of its
14  * contributors may be used to endorse or promote products derived from this
15  * software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20  * IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
21  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
26  * OF SUCH DAMAGE.
27  */
28 
29 
30 
31 /*
32  * $URL$
33  * $Rev$
34  * $Author$
35  * $Date$
36  *
37  * Authors:
38  * Jason C. Crane, Ph.D.
39  * Beck Olson
40  */
41 
42 #ifndef SVK_PLOT_LINE_H
43 #define SVK_PLOT_LINE_H
44 
45 #include <vtkObjectFactory.h>
46 #include <vtkPoints.h>
47 #include <vtkDataArray.h>
48 #include <vtkPolyLine.h>
49 #include <vector>
50 
51 
52 namespace svk {
53 
54 using namespace vtkstd;
55 
62 class svkPlotLine : public vtkObject
63 {
64  friend class svkPlotLineGrid;
65 
66  public:
67 
69  REAL = 0,
71  MAGNITUDE
72  };
73 
74  typedef enum {
75  ROW_COLUMN = 0,
80  COLUMN_SLICE
81  } PlotDirection;
82 
83 
84  vtkTypeMacro( svkPlotLine, vtkObject );
85 
86  static svkPlotLine* New();
87 
88  svkPlotLine();
89  ~svkPlotLine();
90 
91  void SetData( vtkDataArray* plotData );
92  //void SetPlotAreaBounds( double* bounds );
93  void SetPointRange( int startPt, int endPt );
94  void SetValueRange( double minValue, double maxValue );
95  double* GetBounds();
96  void SetComponent( PlotComponent component );
97  float* GetDataPoints();
98  void SetDataPoints(float* polyLinePoints);
99  double* GetOrigin();
100  void SetOrigin( double* origin );
101  double* GetSpacing();
102  void SetSpacing( double* spacing );
103  void GetDcos( double dcos[3][3] );
104  void SetInvertPlots( bool invertPlots );
105  void SetMirrorPlots( bool mirrorPlots );
106  void SetPlotDirection( int amplitudeDirection, int plotDirection );
107  void Modified();
108 
109  void SetDcos(vector< vector<double> >* dcos);
110 
111  // vtk macros
112  void SetGeneratePolyData( bool generatePolyData );
113  bool GetGeneratePolyData( );
114 
115  template <class T>
116  void GeneratePolyDataTemplated( T* castDataPtr );
117 
118  protected:
119 
120  //Members:
121 
124 
126  double plotAreaBounds[6];
127 
129  int startPt;
130 
132  int endPt;
133 
136 
139 
141 
143  double minValue;
144 
146  double maxValue;
147 
149  vtkDataArray* plotData;
150 
151  void* dataPtr;
152 
153  int dataType;
154 
157 
160 
163 
165 
166  void GeneratePolyData();
167 
168 
171 
174 
176  float scale[2];
177 
180 
182  double origin[3];
183 
185  double spacing[3];
186 
188  vector< vector<double> >* dcos;
189 
190  void RecalculateScale();
191  void RecalculatePlotAreaBounds();
192 
193 };
194 
195 
196 } //svk
197 
198 
199 #endif //SVK_PLOT_LINE_H
vector< vector< double > > * dcos
The dcos of the dataset.
Definition: svkPlotLine.h:188
Definition: svkPlotLine.h:79
int numComponents
The number of components.
Definition: svkPlotLine.h:138
int startPt
The index of the first point in the plotData to be plotted.
Definition: svkPlotLine.h:129
vtkDataArray * plotData
The data to be plotted.
Definition: svkPlotLine.h:149
int dataType
Definition: svkPlotLine.h:153
double minValue
The minimum value to be plotted.
Definition: svkPlotLine.h:143
Definition: svkPlotLine.h:78
Definition: svkPlotLine.h:62
Definition: svkPlotLineGrid.h:84
void * dataPtr
Definition: svkPlotLine.h:151
Definition: svkPlotLine.h:70
float * polyLinePoints
The points that make up the line.
Definition: svkPlotLine.h:156
Definition: svkPlotLine.h:76
Definition: svkPlotLine.h:77
int endPt
The index of the last point in the plotData to be plotted.
Definition: svkPlotLine.h:132
int pointIndex
Which index should map to frequency/points.
Definition: svkPlotLine.h:173
bool invertPlots
Should the plots be inverted?
Definition: svkPlotLine.h:159
PlotComponent
Definition: svkPlotLine.h:68
PlotDirection
Definition: svkPlotLine.h:74
int numPoints
The number of points in the plotData.
Definition: svkPlotLine.h:135
bool mirrorPlots
Should the plots be flipped Left-Right?
Definition: svkPlotLine.h:162
int componentOffset
Definition: svkPlotLine.h:140
PlotDirection plotDirection
Definition: svkPlotLine.h:164
int amplitudeIndex
Which index should map to amplitude.
Definition: svkPlotLine.h:170
double maxValue
The maximum value to be plotted.
Definition: svkPlotLine.h:146
PlotComponent plotComponent
Which component should we plot?
Definition: svkPlotLine.h:179
bool generatePolyData
when modified should this object regenerate the poly data.
Definition: svkPlotLine.h:123