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
24 #ifndef vtkIdTypeArray_h
25 #define vtkIdTypeArray_h
26 
27 #include "vtkAOSDataArrayTemplate.h" // Real Superclass
28 #include "vtkCommonCoreModule.h" // For export macro
29 #include "vtkDataArray.h"
30 
31 // Fake the superclass for the wrappers.
32 #ifndef __VTK_WRAP__
33 #define vtkDataArray vtkAOSDataArrayTemplate<vtkIdType>
34 #endif
35 VTK_ABI_NAMESPACE_BEGIN
36 class VTKCOMMONCORE_EXPORT vtkIdTypeArray : public vtkDataArray
37 {
38 public:
39  vtkTypeMacro(vtkIdTypeArray, vtkDataArray);
40 #ifndef __VTK_WRAP__
41 #undef vtkDataArray
42 #endif
43  static vtkIdTypeArray* New();
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
47  // This macro expands to the set of method declarations that
48  // make up the interface of vtkAOSDataArrayTemplate, which is ignored
49  // by the wrappers.
50 #if defined(__VTK_WRAP__) || defined(__WRAP_GCCXML__)
52 #else
53 
57  int GetDataType() const override
58  {
59  // This needs to overwritten from superclass because
60  // the templated superclass is not able to differentiate
61  // vtkIdType from a long long or an int since vtkIdType
62  // is simply a typedef. This means that
63  // vtkAOSDataArrayTemplate<vtkIdType> != vtkIdTypeArray.
64  return VTK_ID_TYPE;
65  }
66 #endif
67 
72  {
73  return static_cast<vtkIdTypeArray*>(Superclass::FastDownCast(source));
74  }
75 
80 
85 
86 protected:
88  ~vtkIdTypeArray() override;
89 
90 private:
92 
93  vtkIdTypeArray(const vtkIdTypeArray&) = delete;
94  void operator=(const vtkIdTypeArray&) = delete;
95 };
96 
97 // Define vtkArrayDownCast implementation:
99 
100 VTK_ABI_NAMESPACE_END
101 #endif
Abstract superclass for all arrays.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
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 * 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.
static vtkIdTypeArray * New()
a simple class to control print indentation
Definition: vtkIndent.h:38
#define vtkCreateWrappedArrayInterface(T)
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkArrayDownCast_FastCastMacro(vtkIdTypeArray)
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