VTK  9.3.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
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
26 VTK_ABI_NAMESPACE_BEGIN
27 class VTKCOMMONCORE_EXPORT vtkIdTypeArray : public vtkDataArray
28 {
29 public:
30  vtkTypeMacro(vtkIdTypeArray, vtkDataArray);
31 #ifndef __VTK_WRAP__
32 #undef vtkDataArray
33 #endif
34  static vtkIdTypeArray* New();
35  static vtkIdTypeArray* ExtendedNew();
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 
77 protected:
79  ~vtkIdTypeArray() override;
80 
81 private:
82  typedef vtkAOSDataArrayTemplate<vtkIdType> RealSuperclass;
83 
84  vtkIdTypeArray(const vtkIdTypeArray&) = delete;
85  void operator=(const vtkIdTypeArray&) = delete;
86 };
87 
88 // Define vtkArrayDownCast implementation:
90 
91 VTK_ABI_NAMESPACE_END
92 #endif
static vtkIdType GetDataTypeValueMax()
Get the maximum data value in its native type.
Abstract superclass for all arrays.
#define vtkCreateWrappedArrayInterface(T)
static vtkIdTypeArray * FastDownCast(vtkAbstractArray *source)
A faster alternative to SafeDownCast for downcasting vtkAbstractArrays.
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:315
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.
int GetDataType() const override
Get the data type.
a simple class to control print indentation
Definition: vtkIndent.h:28
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
vtkArrayDownCast_FastCastMacro(vtkIdTypeArray)
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define VTK_ID_MIN
Definition: vtkType.h:318
#define VTK_ID_MAX
Definition: vtkType.h:319
#define VTK_ID_TYPE
Definition: vtkType.h:44
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...