VTK  9.7.20260827
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
131
132// Fake the superclass for non-Python wrappers.
133// Python can handle the templated superclass; Java and others cannot.
134#if !defined(__VTK_WRAP__) || defined(__VTK_WRAP_PYTHON__) || defined(__VTK_WRAP_HIERARCHY__)
135#define vtkDataArray vtkAOSDataArrayTemplate<vtkIdType>
136#endif
137VTK_ABI_NAMESPACE_BEGIN
138class VTKCOMMONCORE_EXPORT VTK_MARSHALAUTO vtkIdTypeArray : public vtkDataArray
139{
140public:
142#if !defined(__VTK_WRAP__) || defined(__VTK_WRAP_PYTHON__) || defined(__VTK_WRAP_HIERARCHY__)
143#undef vtkDataArray
144#endif
145 using DataTypeTag = std::integral_constant<int, VTK_ID_TYPE>;
148 void PrintSelf(ostream& os, vtkIndent indent) override;
149
150 // This macro expands to the set of method declarations that
151 // make up the interface of vtkAOSDataArrayTemplate, which is ignored
152 // by the wrappers.
153#if (defined(__VTK_WRAP__) || defined(__WRAP_GCCXML__)) && !defined(__VTK_WRAP_PYTHON__)
155#else
156
160 int GetDataType() const override
161 {
162 // This needs to overwritten from superclass because
163 // the templated superclass is not able to differentiate
164 // vtkIdType from a long long or an int since vtkIdType
165 // is simply a typedef. This means that
166 // vtkAOSDataArrayTemplate<vtkIdType> != vtkIdTypeArray.
167 return vtkIdTypeArray::DataTypeTag::value;
168 }
169#endif
170
178
179protected:
181 ~vtkIdTypeArray() override;
182
183private:
184 typedef vtkAOSDataArrayTemplate<vtkIdType> RealSuperclass;
185
186 vtkIdTypeArray(const vtkIdTypeArray&) = delete;
187 void operator=(const vtkIdTypeArray&) = delete;
188};
189
190// Define vtkArrayDownCast implementation:
192
193VTK_ABI_NAMESPACE_END
194#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
#define VTK_MARSHALAUTO