VTK  9.5.20251008
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
143 using DataTypeTag = std::integral_constant<int, VTK_ID_TYPE>;
146 void PrintSelf(ostream& os, vtkIndent indent) override;
147
148 // This macro expands to the set of method declarations that
149 // make up the interface of vtkAOSDataArrayTemplate, which is ignored
150 // by the wrappers.
151#if defined(__VTK_WRAP__) || defined(__WRAP_GCCXML__)
153#else
154
158 int GetDataType() const override
159 {
160 // This needs to overwritten from superclass because
161 // the templated superclass is not able to differentiate
162 // vtkIdType from a long long or an int since vtkIdType
163 // is simply a typedef. This means that
164 // vtkAOSDataArrayTemplate<vtkIdType> != vtkIdTypeArray.
165 return vtkIdTypeArray::DataTypeTag::value;
166 }
167#endif
168
173 {
174 return static_cast<vtkIdTypeArray*>(Superclass::FastDownCast(source));
175 }
176
181
186
187protected:
189 ~vtkIdTypeArray() override;
190
191private:
193
194 vtkIdTypeArray(const vtkIdTypeArray&) = delete;
195 void operator=(const vtkIdTypeArray&) = delete;
196};
197
198// Define vtkArrayDownCast implementation:
200
201VTK_ABI_NAMESPACE_END
202#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()
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.
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:367
#define VTK_ID_MAX
Definition vtkType.h:371
#define VTK_ID_MIN
Definition vtkType.h:370