VTK  9.3.20240425
vtkStringToNumeric.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
19#ifndef vtkStringToNumeric_h
20#define vtkStringToNumeric_h
21
23#include "vtkInfovisCoreModule.h" // For export macro
24
25VTK_ABI_NAMESPACE_BEGIN
26class VTKINFOVISCORE_EXPORT vtkStringToNumeric : public vtkDataObjectAlgorithm
27{
28public:
31 void PrintSelf(ostream& os, vtkIndent indent) override;
32
34
38 vtkSetMacro(ForceDouble, bool);
39 vtkGetMacro(ForceDouble, bool);
40 vtkBooleanMacro(ForceDouble, bool);
42
44
47 vtkSetMacro(DefaultIntegerValue, int);
48 vtkGetMacro(DefaultIntegerValue, int);
50
52
55 vtkSetMacro(DefaultDoubleValue, double);
56 vtkGetMacro(DefaultDoubleValue, double);
58
60
74 vtkSetMacro(TrimWhitespacePriorToNumericConversion, bool);
75 vtkGetMacro(TrimWhitespacePriorToNumericConversion, bool);
76 vtkBooleanMacro(TrimWhitespacePriorToNumericConversion, bool);
78
80
83 vtkSetMacro(ConvertFieldData, bool);
84 vtkGetMacro(ConvertFieldData, bool);
85 vtkBooleanMacro(ConvertFieldData, bool);
87
89
92 vtkSetMacro(ConvertPointData, bool);
93 vtkGetMacro(ConvertPointData, bool);
94 vtkBooleanMacro(ConvertPointData, bool);
96
98
101 vtkSetMacro(ConvertCellData, bool);
102 vtkGetMacro(ConvertCellData, bool);
103 vtkBooleanMacro(ConvertCellData, bool);
105
109 virtual void SetConvertVertexData(bool b) { this->SetConvertPointData(b); }
110 virtual bool GetConvertVertexData() { return this->GetConvertPointData(); }
111 vtkBooleanMacro(ConvertVertexData, bool);
112
116 virtual void SetConvertEdgeData(bool b) { this->SetConvertCellData(b); }
117 virtual bool GetConvertEdgeData() { return this->GetConvertCellData(); }
118 vtkBooleanMacro(ConvertEdgeData, bool);
119
123 virtual void SetConvertRowData(bool b) { this->SetConvertPointData(b); }
124 virtual bool GetConvertRowData() { return this->GetConvertPointData(); }
125 vtkBooleanMacro(ConvertRowData, bool);
126
131 vtkInformationVector* outputVector) override;
132
133protected:
136
141 vtkInformationVector* outputVector) override;
142
146 void ConvertArrays(vtkFieldData* fieldData);
147
155
162
163 // These keep track of our progress
166
168
169private:
170 vtkStringToNumeric(const vtkStringToNumeric&) = delete;
171 void operator=(const vtkStringToNumeric&) = delete;
172};
173
174VTK_ABI_NAMESPACE_END
175#endif
Superclass for algorithms that produce only data object as output.
represent and manipulate fields of data
a simple class to control print indentation
Definition vtkIndent.h:108
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.
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()
virtual bool GetConvertRowData()
virtual void SetConvertVertexData(bool b)
Whether to detect and convert vertex data arrays.
~vtkStringToNumeric() override
static vtkStringToNumeric * New()
int vtkTypeBool
Definition vtkABI.h:64