VTK  9.0.3
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 -------------------------------------------------------------------------*/
29 #ifndef vtkStringToNumeric_h
30 #define vtkStringToNumeric_h
31 
32 #include "vtkDataObjectAlgorithm.h"
33 #include "vtkInfovisCoreModule.h" // For export macro
34 
35 class VTKINFOVISCORE_EXPORT vtkStringToNumeric : public vtkDataObjectAlgorithm
36 {
37 public:
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
43 
47  vtkSetMacro(ForceDouble, bool);
48  vtkGetMacro(ForceDouble, bool);
49  vtkBooleanMacro(ForceDouble, bool);
51 
53 
56  vtkSetMacro(DefaultIntegerValue, int);
57  vtkGetMacro(DefaultIntegerValue, int);
59 
61 
64  vtkSetMacro(DefaultDoubleValue, double);
65  vtkGetMacro(DefaultDoubleValue, double);
67 
69 
83  vtkSetMacro(TrimWhitespacePriorToNumericConversion, bool);
84  vtkGetMacro(TrimWhitespacePriorToNumericConversion, bool);
85  vtkBooleanMacro(TrimWhitespacePriorToNumericConversion, bool);
87 
89 
92  vtkSetMacro(ConvertFieldData, bool);
93  vtkGetMacro(ConvertFieldData, bool);
94  vtkBooleanMacro(ConvertFieldData, bool);
96 
98 
101  vtkSetMacro(ConvertPointData, bool);
102  vtkGetMacro(ConvertPointData, bool);
103  vtkBooleanMacro(ConvertPointData, bool);
105 
107 
110  vtkSetMacro(ConvertCellData, bool);
111  vtkGetMacro(ConvertCellData, bool);
112  vtkBooleanMacro(ConvertCellData, bool);
114 
118  virtual void SetConvertVertexData(bool b) { this->SetConvertPointData(b); }
119  virtual bool GetConvertVertexData() { return this->GetConvertPointData(); }
120  vtkBooleanMacro(ConvertVertexData, bool);
121 
125  virtual void SetConvertEdgeData(bool b) { this->SetConvertCellData(b); }
126  virtual bool GetConvertEdgeData() { return this->GetConvertCellData(); }
127  vtkBooleanMacro(ConvertEdgeData, bool);
128 
132  virtual void SetConvertRowData(bool b) { this->SetConvertPointData(b); }
133  virtual bool GetConvertRowData() { return this->GetConvertPointData(); }
134  vtkBooleanMacro(ConvertRowData, bool);
135 
140  vtkInformationVector* outputVector) override;
141 
142 protected:
145 
150  vtkInformationVector* outputVector) override;
151 
155  void ConvertArrays(vtkFieldData* fieldData);
156 
164 
171 
172  // These keep track of our progress
175 
177 
178 private:
179  vtkStringToNumeric(const vtkStringToNumeric&) = delete;
180  void operator=(const vtkStringToNumeric&) = delete;
181 };
182 
183 #endif
Superclass for algorithms that produce only data object as output.
represent and manipulate fields of data
Definition: vtkFieldData.h:54
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Converts string arrays to numeric arrays.
int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Creates the same output type as the input type.
bool TrimWhitespacePriorToNumericConversion
int CountItemsToConvert(vtkFieldData *fieldData)
Count the total number of items (array components) that will need to be converted in the given vtkFie...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
virtual void SetConvertRowData(bool b)
Whether to detect and convert row data arrays.
void ConvertArrays(vtkFieldData *fieldData)
Tries to convert string arrays to integer or double arrays.
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is required to capture REQUEST_DATA_OBJECT requests.
virtual void SetConvertEdgeData(bool b)
Whether to detect and convert edge data arrays.
virtual bool GetConvertEdgeData()
virtual bool GetConvertVertexData()
static vtkStringToNumeric * New()
virtual bool GetConvertRowData()
virtual void SetConvertVertexData(bool b)
Whether to detect and convert vertex data arrays.
~vtkStringToNumeric() override
int vtkTypeBool
Definition: vtkABI.h:69