VTK  9.3.0
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
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
36 void PrintSelf(ostream& os, vtkIndent indent) override;
37
38 // This macro expands to the set of method declarations that
39 // make up the interface of vtkAOSDataArrayTemplate, which is ignored
40 // by the wrappers.
41#if defined(__VTK_WRAP__) || defined(__WRAP_GCCXML__)
43#else
44
48 int GetDataType() const override
49 {
50 // This needs to overwritten from superclass because
51 // the templated superclass is not able to differentiate
52 // vtkIdType from a long long or an int since vtkIdType
53 // is simply a typedef. This means that
54 // vtkAOSDataArrayTemplate<vtkIdType> != vtkIdTypeArray.
55 return VTK_ID_TYPE;
56 }
57#endif
58
63 {
64 return static_cast<vtkIdTypeArray*>(Superclass::FastDownCast(source));
65 }
66
71
76
77protected:
79 ~vtkIdTypeArray() override;
80
81private:
83
84 vtkIdTypeArray(const vtkIdTypeArray&) = delete;
85 void operator=(const vtkIdTypeArray&) = delete;
86};
87
88// Define vtkArrayDownCast implementation:
90
91VTK_ABI_NAMESPACE_END
92#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()
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: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 *)
int vtkIdType
Definition vtkType.h:315
#define VTK_ID_MAX
Definition vtkType.h:319
#define VTK_ID_MIN
Definition vtkType.h:318
#define VTK_ID_TYPE
Definition vtkType.h:44