VTK  9.3.1
vtkDataObjectTypes.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 vtkDataObjectTypes_h
16 #define vtkDataObjectTypes_h
17 
18 #include "vtkCommonDataModelModule.h" // For export macro
19 #include "vtkObject.h"
20 
21 VTK_ABI_NAMESPACE_BEGIN
22 class vtkDataObject;
23 
24 class VTKCOMMONDATAMODEL_EXPORT vtkDataObjectTypes : public vtkObject
25 {
26 public:
27  static vtkDataObjectTypes* New();
28 
29  vtkTypeMacro(vtkDataObjectTypes, vtkObject);
30  void PrintSelf(ostream& os, vtkIndent indent) override;
31 
36  static const char* GetClassNameFromTypeId(int typeId);
37 
42  static int GetTypeIdFromClassName(const char* classname);
43 
47  static VTK_NEWINSTANCE vtkDataObject* NewDataObject(const char* classname);
48 
52  static VTK_NEWINSTANCE vtkDataObject* NewDataObject(int typeId);
53 
54  /*
55  * Returns true if the `typeId` is same or a subclass of
56  * `targetTypeId`.
57  */
58  static bool TypeIdIsA(int typeId, int targetTypeId);
59 
66  static int GetCommonBaseTypeId(int typeA, int typeB);
67 
68 protected:
69  vtkDataObjectTypes() = default;
70  ~vtkDataObjectTypes() override = default;
71 
75  static int Validate();
76 
77 private:
78  vtkDataObjectTypes(const vtkDataObjectTypes&) = delete;
79  void operator=(const vtkDataObjectTypes&) = delete;
80 };
81 
82 VTK_ABI_NAMESPACE_END
83 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:51
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:28
#define VTK_NEWINSTANCE
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
general representation of visualization data
Definition: vtkDataObject.h:54