VTK  9.3.20240329
vtkIdTypeArray.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
124 #ifndef vtkIdTypeArray_h
125 #define vtkIdTypeArray_h
126 
127 #include "vtkAOSDataArrayTemplate.h" // Real Superclass
128 #include "vtkCommonCoreModule.h" // For export macro
129 #include "vtkDataArray.h"
130 
131 // Fake the superclass for the wrappers.
132 #ifndef __VTK_WRAP__
133 #define vtkDataArray vtkAOSDataArrayTemplate<vtkIdType>
134 #endif
135 VTK_ABI_NAMESPACE_BEGIN
136 class VTKCOMMONCORE_EXPORT vtkIdTypeArray : public vtkDataArray
137 {
138 public:
139  vtkTypeMacro(vtkIdTypeArray, vtkDataArray);
140 #ifndef __VTK_WRAP__
141 #undef vtkDataArray
142 #endif
143  static vtkIdTypeArray* New();
145  void PrintSelf(ostream& os, vtkIndent indent) override;
146 
147  // This macro expands to the set of method declarations that
148  // make up the interface of vtkAOSDataArrayTemplate, which is ignored
149  // by the wrappers.
150 #if defined(__VTK_WRAP__) || defined(__WRAP_GCCXML__)
152 #else
153 
157  int GetDataType() const override
158  {
159  // This needs to overwritten from superclass because
160  // the templated superclass is not able to differentiate
161  // vtkIdType from a long long or an int since vtkIdType
162  // is simply a typedef. This means that
163  // vtkAOSDataArrayTemplate<vtkIdType> != vtkIdTypeArray.
164  return VTK_ID_TYPE;
165  }
166 #endif
167 
172  {
173  return static_cast<vtkIdTypeArray*>(Superclass::FastDownCast(source));
174  }
175 
180 
185 
186 protected:
188  ~vtkIdTypeArray() override;
189 
190 private:
192 
193  vtkIdTypeArray(const vtkIdTypeArray&) = delete;
194  void operator=(const vtkIdTypeArray&) = delete;
195 };
196 
197 // Define vtkArrayDownCast implementation:
199 
200 VTK_ABI_NAMESPACE_END
201 #endif
Abstract superclass for all arrays.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:155
dynamic, self-adjusting array of vtkIdType
static vtkIdTypeArray * FastDownCast(vtkAbstractArray *source)
A faster alternative to SafeDownCast for downcasting vtkAbstractArrays.
static vtkIdType GetDataTypeValueMax()
Get the maximum data value in its native type.
int GetDataType() const override
Get the data type.
~vtkIdTypeArray() override
static vtkIdTypeArray * ExtendedNew()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkIdType GetDataTypeValueMin()
Get the minimum data value in its native type.
static vtkIdTypeArray * New()
a simple class to control print indentation
Definition: vtkIndent.h:108
#define vtkCreateWrappedArrayInterface(T)
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkArrayDownCast_FastCastMacro(vtkIdTypeArray)
int vtkIdType
Definition: vtkType.h:315
#define VTK_ID_MAX
Definition: vtkType.h:319
#define VTK_ID_MIN
Definition: vtkType.h:318
#define VTK_ID_TYPE
Definition: vtkType.h:44