VTK  9.3.20240527
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
135VTK_ABI_NAMESPACE_BEGIN
136class VTKCOMMONCORE_EXPORT vtkIdTypeArray : public vtkDataArray
137{
138public:
140#ifndef __VTK_WRAP__
141#undef vtkDataArray
142#endif
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
186protected:
188 ~vtkIdTypeArray() override;
189
190private:
192
193 vtkIdTypeArray(const vtkIdTypeArray&) = delete;
194 void operator=(const vtkIdTypeArray&) = delete;
195};
196
197// Define vtkArrayDownCast implementation:
199
200VTK_ABI_NAMESPACE_END
201#endif
Array-Of-Structs implementation of vtkGenericDataArray.
Abstract superclass for all arrays.
abstract superclass for arrays of numeric data
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 * New()
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.
a simple class to control print indentation
Definition vtkIndent.h:108
#define vtkCreateWrappedArrayInterface(T)
#define vtkArrayDownCast_FastCastMacro(ArrayT)
This macro is used to tell vtkArrayDownCast to use FastDownCast instead of SafeDownCast.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
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