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
15#ifndef vtkDataObjectTypes_h
16#define vtkDataObjectTypes_h
17
18#include "vtkCommonDataModelModule.h" // For export macro
19#include "vtkObject.h"
20
21VTK_ABI_NAMESPACE_BEGIN
22class vtkDataObject;
23
24class VTKCOMMONDATAMODEL_EXPORT vtkDataObjectTypes : public vtkObject
25{
26public:
28
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
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
68protected:
69 vtkDataObjectTypes() = default;
70 ~vtkDataObjectTypes() override = default;
71
75 static int Validate();
76
77private:
79 void operator=(const vtkDataObjectTypes&) = delete;
80};
81
82VTK_ABI_NAMESPACE_END
83#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:29
abstract base class for most VTK objects
Definition vtkObject.h:49
#define VTK_NEWINSTANCE