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 -------------------------------------------------------------------------*/
34 #ifndef vtkStringToNumeric_h
35 #define vtkStringToNumeric_h
36 
37 #include "vtkInfovisCoreModule.h" // For export macro
38 #include "vtkDataObjectAlgorithm.h"
39 
41 {
42 public:
43  static vtkStringToNumeric* New();
45  void PrintSelf(ostream& os, vtkIndent indent);
46 
48 
50  vtkSetMacro(ForceDouble, bool);
51  vtkGetMacro(ForceDouble, bool);
52  vtkBooleanMacro(ForceDouble, bool);
54 
56 
57  vtkSetMacro(DefaultIntegerValue, int);
58  vtkGetMacro(DefaultIntegerValue, int);
60 
62 
63  vtkSetMacro(DefaultDoubleValue, double);
64  vtkGetMacro(DefaultDoubleValue, double);
66 
68 
77  vtkSetMacro(TrimWhitespacePriorToNumericConversion, bool);
78  vtkGetMacro(TrimWhitespacePriorToNumericConversion, bool);
79  vtkBooleanMacro(TrimWhitespacePriorToNumericConversion, bool);
81 
83 
84  vtkSetMacro(ConvertFieldData, bool);
85  vtkGetMacro(ConvertFieldData, bool);
86  vtkBooleanMacro(ConvertFieldData, bool);
88 
90 
91  vtkSetMacro(ConvertPointData, bool);
92  vtkGetMacro(ConvertPointData, bool);
93  vtkBooleanMacro(ConvertPointData, bool);
95 
97 
98  vtkSetMacro(ConvertCellData, bool);
99  vtkGetMacro(ConvertCellData, bool);
100  vtkBooleanMacro(ConvertCellData, bool);
102 
104 
105  virtual void SetConvertVertexData(bool b)
106  { this->SetConvertPointData(b); }
107  virtual bool GetConvertVertexData()
108  { return this->GetConvertPointData(); }
109  vtkBooleanMacro(ConvertVertexData, bool);
111 
113 
114  virtual void SetConvertEdgeData(bool b)
115  { this->SetConvertCellData(b); }
116  virtual bool GetConvertEdgeData()
117  { return this->GetConvertCellData(); }
118  vtkBooleanMacro(ConvertEdgeData, bool);
120 
122 
123  virtual void SetConvertRowData(bool b)
124  { this->SetConvertPointData(b); }
125  virtual bool GetConvertRowData()
126  { return this->GetConvertPointData(); }
127  vtkBooleanMacro(ConvertRowData, bool);
129 
131 
132  virtual int ProcessRequest(vtkInformation* request,
133  vtkInformationVector** inputVector,
134  vtkInformationVector* outputVector);
136 
137 protected:
140 
142 
143  virtual int RequestDataObject(vtkInformation* request,
144  vtkInformationVector** inputVector,
145  vtkInformationVector* outputVector);
147 
149  void ConvertArrays(vtkFieldData* fieldData);
150 
158 
162  int CountItemsToConvert(vtkFieldData *fieldData);
163 
164  // These keep track of our progress
167 
168  int RequestData(
172 
173 private:
174  vtkStringToNumeric(const vtkStringToNumeric&); // Not implemented
175  void operator=(const vtkStringToNumeric&); // Not implemented
176 };
177 
178 #endif
179 
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual bool GetConvertRowData()
Store vtkAlgorithm input/output information.
static vtkDataObjectAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
virtual void SetConvertRowData(bool b)
a simple class to control print indentation
Definition: vtkIndent.h:38
Converts string arrays to numeric arrays.
#define VTKINFOVISCORE_EXPORT
bool TrimWhitespacePriorToNumericConversion
Superclass for algorithms that produce only data object as output.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual int ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual bool GetConvertVertexData()
Store zero or more vtkInformation instances.
virtual void SetConvertVertexData(bool b)
virtual bool GetConvertEdgeData()
virtual void SetConvertEdgeData(bool b)
represent and manipulate fields of data
Definition: vtkFieldData.h:55