VTK
vtkStringToNumeric.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkStringToNumeric.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
35 #ifndef vtkStringToNumeric_h
36 #define vtkStringToNumeric_h
37 
38 #include "vtkInfovisCoreModule.h" // For export macro
39 #include "vtkDataObjectAlgorithm.h"
40 
41 class VTKINFOVISCORE_EXPORT vtkStringToNumeric : public vtkDataObjectAlgorithm
42 {
43 public:
46  void PrintSelf(ostream& os, vtkIndent indent);
47 
49 
53  vtkSetMacro(ForceDouble, bool);
54  vtkGetMacro(ForceDouble, bool);
55  vtkBooleanMacro(ForceDouble, bool);
57 
59 
62  vtkSetMacro(DefaultIntegerValue, int);
63  vtkGetMacro(DefaultIntegerValue, int);
65 
67 
70  vtkSetMacro(DefaultDoubleValue, double);
71  vtkGetMacro(DefaultDoubleValue, double);
73 
75 
89  vtkSetMacro(TrimWhitespacePriorToNumericConversion, bool);
90  vtkGetMacro(TrimWhitespacePriorToNumericConversion, bool);
91  vtkBooleanMacro(TrimWhitespacePriorToNumericConversion, bool);
93 
95 
98  vtkSetMacro(ConvertFieldData, bool);
99  vtkGetMacro(ConvertFieldData, bool);
100  vtkBooleanMacro(ConvertFieldData, bool);
102 
104 
107  vtkSetMacro(ConvertPointData, bool);
108  vtkGetMacro(ConvertPointData, bool);
109  vtkBooleanMacro(ConvertPointData, bool);
111 
113 
116  vtkSetMacro(ConvertCellData, bool);
117  vtkGetMacro(ConvertCellData, bool);
118  vtkBooleanMacro(ConvertCellData, bool);
120 
124  virtual void SetConvertVertexData(bool b)
125  { this->SetConvertPointData(b); }
126  virtual bool GetConvertVertexData()
127  { return this->GetConvertPointData(); }
128  vtkBooleanMacro(ConvertVertexData, bool);
129 
133  virtual void SetConvertEdgeData(bool b)
134  { this->SetConvertCellData(b); }
135  virtual bool GetConvertEdgeData()
136  { return this->GetConvertCellData(); }
137  vtkBooleanMacro(ConvertEdgeData, bool);
138 
142  virtual void SetConvertRowData(bool b)
143  { this->SetConvertPointData(b); }
144  virtual bool GetConvertRowData()
145  { return this->GetConvertPointData(); }
146  vtkBooleanMacro(ConvertRowData, bool);
147 
151  virtual int ProcessRequest(vtkInformation* request,
152  vtkInformationVector** inputVector,
153  vtkInformationVector* outputVector);
154 
155 protected:
158 
162  virtual int RequestDataObject(vtkInformation* request,
163  vtkInformationVector** inputVector,
164  vtkInformationVector* outputVector);
165 
169  void ConvertArrays(vtkFieldData* fieldData);
170 
178 
185 
186  // These keep track of our progress
189 
194 
195 private:
196  vtkStringToNumeric(const vtkStringToNumeric&) VTK_DELETE_FUNCTION;
197  void operator=(const vtkStringToNumeric&) VTK_DELETE_FUNCTION;
198 };
199 
200 #endif
201 
vtkStringToNumeric::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkStringToNumeric::vtkStringToNumeric
vtkStringToNumeric()
vtkStringToNumeric::DefaultDoubleValue
double DefaultDoubleValue
Definition: vtkStringToNumeric.h:176
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkStringToNumeric::SetConvertVertexData
virtual void SetConvertVertexData(bool b)
Whether to detect and convert vertex data arrays.
Definition: vtkStringToNumeric.h:124
vtkStringToNumeric::ConvertPointData
bool ConvertPointData
Definition: vtkStringToNumeric.h:172
vtkDataObjectAlgorithm
Superclass for algorithms that produce only data object as output.
Definition: vtkDataObjectAlgorithm.h:44
vtkStringToNumeric::TrimWhitespacePriorToNumericConversion
bool TrimWhitespacePriorToNumericConversion
Definition: vtkStringToNumeric.h:177
vtkStringToNumeric::~vtkStringToNumeric
~vtkStringToNumeric()
vtkFieldData
represent and manipulate fields of data
Definition: vtkFieldData.h:57
vtkStringToNumeric
Converts string arrays to numeric arrays.
Definition: vtkStringToNumeric.h:42
vtkStringToNumeric::SetConvertEdgeData
virtual void SetConvertEdgeData(bool b)
Whether to detect and convert edge data arrays.
Definition: vtkStringToNumeric.h:133
vtkStringToNumeric::GetConvertVertexData
virtual bool GetConvertVertexData()
Definition: vtkStringToNumeric.h:126
vtkStringToNumeric::GetConvertRowData
virtual bool GetConvertRowData()
Definition: vtkStringToNumeric.h:144
vtkStringToNumeric::RequestDataObject
virtual int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Creates the same output type as the input type.
vtkStringToNumeric::ConvertFieldData
bool ConvertFieldData
Definition: vtkStringToNumeric.h:171
vtkStringToNumeric::ItemsToConvert
int ItemsToConvert
Definition: vtkStringToNumeric.h:187
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkStringToNumeric::ConvertCellData
bool ConvertCellData
Definition: vtkStringToNumeric.h:173
vtkStringToNumeric::DefaultIntegerValue
int DefaultIntegerValue
Definition: vtkStringToNumeric.h:175
vtkStringToNumeric::ItemsConverted
int ItemsConverted
Definition: vtkStringToNumeric.h:188
vtkStringToNumeric::New
static vtkStringToNumeric * New()
vtkStringToNumeric::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkStringToNumeric::CountItemsToConvert
int CountItemsToConvert(vtkFieldData *fieldData)
Count the total number of items (array components) that will need to be converted in the given vtkFie...
vtkStringToNumeric::ConvertArrays
void ConvertArrays(vtkFieldData *fieldData)
Tries to convert string arrays to integer or double arrays.
vtkStringToNumeric::SetConvertRowData
virtual void SetConvertRowData(bool b)
Whether to detect and convert row data arrays.
Definition: vtkStringToNumeric.h:142
vtkDataObjectAlgorithm.h
vtkStringToNumeric::ForceDouble
bool ForceDouble
Definition: vtkStringToNumeric.h:174
vtkStringToNumeric::GetConvertEdgeData
virtual bool GetConvertEdgeData()
Definition: vtkStringToNumeric.h:135
vtkStringToNumeric::ProcessRequest
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is required to capture REQUEST_DATA_OBJECT requests.