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 "vtkDataObjectAlgorithm.h"
38 
40 {
41 public:
42  static vtkStringToNumeric* New();
44  void PrintSelf(ostream& os, vtkIndent indent);
45 
47 
49  vtkSetMacro(ForceDouble, bool);
50  vtkGetMacro(ForceDouble, bool);
51  vtkBooleanMacro(ForceDouble, bool);
53 
55 
56  vtkSetMacro(DefaultIntegerValue, int);
57  vtkGetMacro(DefaultIntegerValue, int);
59 
61 
62  vtkSetMacro(DefaultDoubleValue, double);
63  vtkGetMacro(DefaultDoubleValue, double);
65 
67 
76  vtkSetMacro(TrimWhitespacePriorToNumericConversion, bool);
77  vtkGetMacro(TrimWhitespacePriorToNumericConversion, bool);
78  vtkBooleanMacro(TrimWhitespacePriorToNumericConversion, bool);
80 
82 
83  vtkSetMacro(ConvertFieldData, bool);
84  vtkGetMacro(ConvertFieldData, bool);
85  vtkBooleanMacro(ConvertFieldData, bool);
87 
89 
90  vtkSetMacro(ConvertPointData, bool);
91  vtkGetMacro(ConvertPointData, bool);
92  vtkBooleanMacro(ConvertPointData, bool);
94 
96 
97  vtkSetMacro(ConvertCellData, bool);
98  vtkGetMacro(ConvertCellData, bool);
99  vtkBooleanMacro(ConvertCellData, bool);
101 
103 
104  virtual void SetConvertVertexData(bool b)
105  { this->SetConvertPointData(b); }
106  virtual bool GetConvertVertexData()
107  { return this->GetConvertPointData(); }
108  vtkBooleanMacro(ConvertVertexData, bool);
110 
112 
113  virtual void SetConvertEdgeData(bool b)
114  { this->SetConvertCellData(b); }
115  virtual bool GetConvertEdgeData()
116  { return this->GetConvertCellData(); }
117  vtkBooleanMacro(ConvertEdgeData, bool);
119 
121 
122  virtual void SetConvertRowData(bool b)
123  { this->SetConvertPointData(b); }
124  virtual bool GetConvertRowData()
125  { return this->GetConvertPointData(); }
126  vtkBooleanMacro(ConvertRowData, bool);
128 
130 
131  virtual int ProcessRequest(vtkInformation* request,
132  vtkInformationVector** inputVector,
133  vtkInformationVector* outputVector);
135 
136 protected:
139 
141 
142  virtual int RequestDataObject(vtkInformation* request,
143  vtkInformationVector** inputVector,
144  vtkInformationVector* outputVector);
146 
148  void ConvertArrays(vtkFieldData* fieldData);
149 
157 
161  int CountItemsToConvert(vtkFieldData *fieldData);
162 
163  // These keep track of our progress
166 
167  int RequestData(
168  vtkInformation*,
171 
172 private:
173  vtkStringToNumeric(const vtkStringToNumeric&); // Not implemented
174  void operator=(const vtkStringToNumeric&); // Not implemented
175 };
176 
177 #endif
178