VTK  9.7.20260805
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
14
15#ifndef vtkIdTypeArray_h
16#define vtkIdTypeArray_h
17
18#include "vtkAOSDataArrayTemplate.h" // Real Superclass
19#include "vtkCommonCoreModule.h" // For export macro
20#include "vtkDataArray.h"
21
22// Fake the superclass for non-Python wrappers.
23// Python can handle the templated superclass; Java and others cannot.
24#if !defined(__VTK_WRAP__) || defined(__VTK_WRAP_PYTHON__) || defined(__VTK_WRAP_HIERARCHY__)
25#define vtkDataArray vtkAOSDataArrayTemplate<vtkIdType>
26#endif
27VTK_ABI_NAMESPACE_BEGIN
28class VTKCOMMONCORE_EXPORT vtkIdTypeArray : public vtkDataArray
29{
30public:
32#if !defined(__VTK_WRAP__) || defined(__VTK_WRAP_PYTHON__) || defined(__VTK_WRAP_HIERARCHY__)
33#undef vtkDataArray
34#endif
35 using DataTypeTag = std::integral_constant<int, VTK_ID_TYPE>;
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
40 // This macro expands to the set of method declarations that
41 // make up the interface of vtkAOSDataArrayTemplate, which is ignored
42 // by the wrappers.
43#if (defined(__VTK_WRAP__) || defined(__WRAP_GCCXML__)) && !defined(__VTK_WRAP_PYTHON__)
45#else
46
50 int GetDataType() const override
51 {
52 // This needs to overwritten from superclass because
53 // the templated superclass is not able to differentiate
54 // vtkIdType from a long long or an int since vtkIdType
55 // is simply a typedef. This means that
56 // vtkAOSDataArrayTemplate<vtkIdType> != vtkIdTypeArray.
57 return vtkIdTypeArray::DataTypeTag::value;
58 }
59#endif
60
68
69protected:
71 ~vtkIdTypeArray() override;
72
73private:
74 typedef vtkAOSDataArrayTemplate<vtkIdType> RealSuperclass;
75
76 vtkIdTypeArray(const vtkIdTypeArray&) = delete;
77 void operator=(const vtkIdTypeArray&) = delete;
78};
79
80// Define vtkArrayDownCast implementation:
82
83VTK_ABI_NAMESPACE_END
84#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:29
#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