VTK  9.2.6
vtkDataObjectTypes.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDataObjectTypes.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 =========================================================================*/
27 #ifndef vtkDataObjectTypes_h
28 #define vtkDataObjectTypes_h
29 
30 #include "vtkCommonDataModelModule.h" // For export macro
31 #include "vtkObject.h"
32 
33 class vtkDataObject;
34 
35 class VTKCOMMONDATAMODEL_EXPORT vtkDataObjectTypes : public vtkObject
36 {
37 public:
38  static vtkDataObjectTypes* New();
39 
40  vtkTypeMacro(vtkDataObjectTypes, vtkObject);
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
47  static const char* GetClassNameFromTypeId(int typeId);
48 
53  static int GetTypeIdFromClassName(const char* classname);
54 
58  static vtkDataObject* NewDataObject(const char* classname);
59 
63  static vtkDataObject* NewDataObject(int typeId);
64 
65  /*
66  * Returns true if the `typeId` is same or or a subclass of
67  * `targetTypeId`.
68  */
69  static bool TypeIdIsA(int typeId, int targetTypeId);
70 
77  static int GetCommonBaseTypeId(int typeA, int typeB);
78 
79 protected:
80  vtkDataObjectTypes() = default;
81  ~vtkDataObjectTypes() override = default;
82 
86  static int Validate();
87 
88 private:
89  vtkDataObjectTypes(const vtkDataObjectTypes&) = delete;
90  void operator=(const vtkDataObjectTypes&) = delete;
91 };
92 
93 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:62
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:39
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:65