VTKFIG  0.20.20181114
Easy VTK based in situ visualization
void vtkfig::Figure::SetRange ( )
protected

Obtain the data range from the relevant dataset.

Definition at line 87 of file vtkfigFigure.cxx.

88  {
89 
90  if (SubClassName()=="GridView") return;
91  if (SubClassName()=="XYPlot") return;
92  if (SubClassName()=="ChartXY") return;
93  if (SubClassName()=="FigureBase") return;
94  if (SubClassName()=="Surf2D") return;
95 
96  auto data=vtkDataSet::SafeDownCast(data_producer->GetOutputDataObject(0));
97 
98  auto values=vtkDoubleArray::SafeDownCast(data->GetPointData()->GetAbstractArray(dataname.c_str()));
99 
100  if (!values) return;
101 
102  double vrange[2];
103  // If comp (2nd argument) is -1, the range of the magnitude (L2 norm) over all
104  // components will be provided. The range is computed and then
105  // cached, and will not be re-computed on subsequent calls to
106  // GetRange() unless the array is modified or the requested component
107  // changes. THIS METHOD IS NOT THREAD SAFE.
108  values->GetRange(vrange,-1);
109  state.data_vmin=vrange[0];
110  state.data_vmax=vrange[1];
111  }
std::string dataname
Name of data item in data set.
Definition: vtkfigFigure.h:256
vtkSmartPointer< vtkTrivialProducer > data_producer
Data producer for grid dataset.
Definition: vtkfigFigure.h:247
struct vtkfig::Figure::@0 state
figure state
virtual std::string SubClassName()
Get subclass name (for s-c communication, should be replaced by tag.
Definition: vtkfigFigure.h:384

+ Here is the call graph for this function: