VTK  9.3.0
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
24#ifndef vtkDataObjectTypes_h
25#define vtkDataObjectTypes_h
26
27#include "vtkCommonDataModelModule.h" // For export macro
28#include "vtkObject.h"
29
30VTK_ABI_NAMESPACE_BEGIN
31class vtkDataObject;
32
33class VTKCOMMONDATAMODEL_EXPORT vtkDataObjectTypes : public vtkObject
34{
35public:
37
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
45 static const char* GetClassNameFromTypeId(int typeId);
46
51 static int GetTypeIdFromClassName(const char* classname);
52
56 static VTK_NEWINSTANCE vtkDataObject* NewDataObject(const char* classname);
57
62
63 /*
64 * Returns true if the `typeId` is same or a subclass of
65 * `targetTypeId`.
66 */
67 static bool TypeIdIsA(int typeId, int targetTypeId);
68
75 static int GetCommonBaseTypeId(int typeA, int typeB);
76
77protected:
78 vtkDataObjectTypes() = default;
79 ~vtkDataObjectTypes() override = default;
80
84 static int Validate();
85
86private:
88 void operator=(const vtkDataObjectTypes&) = delete;
89};
90
91VTK_ABI_NAMESPACE_END
92#endif
static int Validate()
Method used to validate data object types, for testing purposes.
vtkDataObjectTypes()=default
static vtkDataObject * NewDataObject(const char *classname)
Create (New) and return a data object of the given classname.
static bool TypeIdIsA(int typeId, int targetTypeId)
static int GetTypeIdFromClassName(const char *classname)
Given a data object classname, return it's int identified (as defined in vtkType.h)
static const char * GetClassNameFromTypeId(int typeId)
Given an int (as defined in vtkType.h) identifier for a class return it's classname.
~vtkDataObjectTypes() override=default
static int GetCommonBaseTypeId(int typeA, int typeB)
Given two data types, returns the closest common data type.
static vtkDataObject * NewDataObject(int typeId)
Create (New) and return a data object of the given type id.
static vtkDataObjectTypes * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
general representation of visualization data
a simple class to control print indentation
Definition vtkIndent.h:38
abstract base class for most VTK objects
Definition vtkObject.h:58
#define VTK_NEWINSTANCE