VTK
vtkIdTypeArray.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkIdTypeArray.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
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 class VTKCOMMONCORE_EXPORT vtkIdTypeArray : public vtkDataArray
36 {
37 public:
38  vtkTypeMacro(vtkIdTypeArray, vtkDataArray);
39 #ifndef __VTK_WRAP__
40 #undef vtkDataArray
41 #endif
42  static vtkIdTypeArray* New();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
45  // This macro expands to the set of method declarations that
46  // make up the interface of vtkAOSDataArrayTemplate, which is ignored
47  // by the wrappers.
48 #if defined(__VTK_WRAP__) || defined(__WRAP_GCCXML__)
50 #else
51 
55  int GetDataType() const override
56  {
57  // This needs to overwritten from superclass because
58  // the templated superclass is not able to differentiate
59  // vtkIdType from a long long or an int since vtkIdType
60  // is simply a typedef. This means that
61  // vtkAOSDataArrayTemplate<vtkIdType> != vtkIdTypeArray.
62  return VTK_ID_TYPE;
63  }
64 #endif
65 
70  {
71  return static_cast<vtkIdTypeArray*>(Superclass::FastDownCast(source));
72  }
73 
78 
83 
84 protected:
86  ~vtkIdTypeArray() override;
87 
88 private:
89  typedef vtkAOSDataArrayTemplate<vtkIdType> RealSuperclass;
90 
91  vtkIdTypeArray(const vtkIdTypeArray&) = delete;
92  void operator=(const vtkIdTypeArray&) = delete;
93 };
94 
95 // Define vtkArrayDownCast implementation:
97 
98 #endif
vtkIdType
int vtkIdType
Definition: vtkType.h:343
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkAOSDataArrayTemplate.h
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
vtkIdTypeArray::GetDataTypeValueMin
static vtkIdType GetDataTypeValueMin()
Get the minimum data value in its native type.
Definition: vtkIdTypeArray.h:77
vtkDataArray::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkArrayDownCast_FastCastMacro
vtkArrayDownCast_FastCastMacro(vtkIdTypeArray)
vtkIdTypeArray::GetDataType
int GetDataType() const override
Get the data type.
Definition: vtkIdTypeArray.h:55
vtkAbstractArray
Abstract superclass for all arrays.
Definition: vtkAbstractArray.h:75
vtkDataArray.h
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:35
VTK_ID_MAX
#define VTK_ID_MAX
Definition: vtkType.h:347
VTK_ID_TYPE
#define VTK_ID_TYPE
Definition: vtkType.h:54
vtkCreateWrappedArrayInterface
#define vtkCreateWrappedArrayInterface(T)
Definition: vtkAOSDataArrayTemplate.h:312
vtkAOSDataArrayTemplate< vtkIdType >
source
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:959
vtkIdTypeArray::GetDataTypeValueMax
static vtkIdType GetDataTypeValueMax()
Get the maximum data value in its native type.
Definition: vtkIdTypeArray.h:82
VTK_ID_MIN
#define VTK_ID_MIN
Definition: vtkType.h:346
vtkIdTypeArray::FastDownCast
static vtkIdTypeArray * FastDownCast(vtkAbstractArray *source)
A faster alternative to SafeDownCast for downcasting vtkAbstractArrays.
Definition: vtkIdTypeArray.h:69