VTK  9.6.1
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 the wrappers.
23#ifndef __VTK_WRAP__
24#define vtkDataArray vtkAOSDataArrayTemplate<vtkIdType>
25#endif
26VTK_ABI_NAMESPACE_BEGIN
27class VTKCOMMONCORE_EXPORT vtkIdTypeArray : public vtkDataArray
28{
29public:
31#ifndef __VTK_WRAP__
32#undef vtkDataArray
33#endif
34 using DataTypeTag = std::integral_constant<int, VTK_ID_TYPE>;
37 void PrintSelf(ostream& os, vtkIndent indent) override;
38
39 // This macro expands to the set of method declarations that
40 // make up the interface of vtkAOSDataArrayTemplate, which is ignored
41 // by the wrappers.
42#if defined(__VTK_WRAP__) || defined(__WRAP_GCCXML__)
44#else
45
49 int GetDataType() const override
50 {
51 // This needs to overwritten from superclass because
52 // the templated superclass is not able to differentiate
53 // vtkIdType from a long long or an int since vtkIdType
54 // is simply a typedef. This means that
55 // vtkAOSDataArrayTemplate<vtkIdType> != vtkIdTypeArray.
56 return vtkIdTypeArray::DataTypeTag::value;
57 }
58#endif
59
67
68protected:
70 ~vtkIdTypeArray() override;
71
72private:
73 typedef vtkAOSDataArrayTemplate<vtkIdType> RealSuperclass;
74
75 vtkIdTypeArray(const vtkIdTypeArray&) = delete;
76 void operator=(const vtkIdTypeArray&) = delete;
77};
78
79// Define vtkArrayDownCast implementation:
81
82VTK_ABI_NAMESPACE_END
83#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:368