VTK  9.6.20260312
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
123
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 non-Python wrappers.
132// Python can handle the templated superclass; Java and others cannot.
133#if !defined(__VTK_WRAP__) || defined(__VTK_WRAP_PYTHON__)
134#define vtkDataArray vtkAOSDataArrayTemplate<vtkIdType>
135#endif
136VTK_ABI_NAMESPACE_BEGIN
137class VTKCOMMONCORE_EXPORT vtkIdTypeArray : public vtkDataArray
138{
139public:
141#if !defined(__VTK_WRAP__) || defined(__VTK_WRAP_PYTHON__)
142#undef vtkDataArray
143#endif
144 using DataTypeTag = std::integral_constant<int, VTK_ID_TYPE>;
147 void PrintSelf(ostream& os, vtkIndent indent) override;
148
149 // This macro expands to the set of method declarations that
150 // make up the interface of vtkAOSDataArrayTemplate, which is ignored
151 // by the wrappers.
152#if (defined(__VTK_WRAP__) || defined(__WRAP_GCCXML__)) && !defined(__VTK_WRAP_PYTHON__)
154#else
155
159 int GetDataType() const override
160 {
161 // This needs to overwritten from superclass because
162 // the templated superclass is not able to differentiate
163 // vtkIdType from a long long or an int since vtkIdType
164 // is simply a typedef. This means that
165 // vtkAOSDataArrayTemplate<vtkIdType> != vtkIdTypeArray.
166 return vtkIdTypeArray::DataTypeTag::value;
167 }
168#endif
169
177
178protected:
180 ~vtkIdTypeArray() override;
181
182private:
183 typedef vtkAOSDataArrayTemplate<vtkIdType> RealSuperclass;
184
185 vtkIdTypeArray(const vtkIdTypeArray&) = delete;
186 void operator=(const vtkIdTypeArray&) = delete;
187};
188
189// Define vtkArrayDownCast implementation:
191
192VTK_ABI_NAMESPACE_END
193#endif
Abstract superclass for all arrays.
static vtkDataArray * FastDownCast(vtkAbstractArray *source)
Perform a fast, safe cast from a vtkAbstractArray to a vtkDataArray.
dynamic, self-adjusting array of vtkIdType
static vtkIdTypeArray * FastDownCast(vtkAbstractArray *source)
A faster alternative to SafeDownCast for downcasting vtkAbstractArrays.
int GetDataType() const override
Get the data type.
~vtkIdTypeArray() override
static vtkIdTypeArray * New()
static vtkIdTypeArray * ExtendedNew()
std::integral_constant< int, VTK_ID_TYPE > DataTypeTag
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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 *)
#define vtkDataArray
int vtkIdType
Definition vtkType.h:363