VTK  9.4.20241221
vtkObjectIdMap.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
12#ifndef vtkObjectIdMap_h
13#define vtkObjectIdMap_h
14
15#include "vtkObject.h"
16#include "vtkWebCoreModule.h" // needed for exports
17
18VTK_ABI_NAMESPACE_BEGIN
19class VTKWEBCORE_EXPORT vtkObjectIdMap : public vtkObject
20{
21public:
23 vtkTypeMacro(vtkObjectIdMap, vtkObject);
24 void PrintSelf(ostream& os, vtkIndent indent) override;
25
30 vtkTypeUInt32 GetGlobalId(vtkObject* obj);
31
35 vtkObject* GetVTKObject(vtkTypeUInt32 globalId);
36
43 vtkTypeUInt32 SetActiveObject(const char* objectType, vtkObject* obj);
44
48 vtkObject* GetActiveObject(const char* objectType);
49
56
62 bool FreeObjectById(vtkTypeUInt32 id);
63
64protected:
66 ~vtkObjectIdMap() override;
67
68private:
69 vtkObjectIdMap(const vtkObjectIdMap&) = delete;
70 void operator=(const vtkObjectIdMap&) = delete;
71
72 struct vtkInternals;
73 vtkInternals* Internals;
74};
75
76VTK_ABI_NAMESPACE_END
77#endif
a simple class to control print indentation
Definition vtkIndent.h:108
class used to assign Id to any VTK object and be able to retrieve it base on its id.
vtkObject * GetVTKObject(vtkTypeUInt32 globalId)
Retrieve a vtkObject based on its global id.
vtkTypeUInt32 SetActiveObject(const char *objectType, vtkObject *obj)
Assign an active key (string) to an existing object.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkObjectIdMap() override
static vtkObjectIdMap * New()
vtkTypeUInt32 GetGlobalId(vtkObject *obj)
Retrieve a unique identifier for the given object or generate a new one if its global id was never re...
bool FreeObjectById(vtkTypeUInt32 id)
Given an id, remove any internal reference count due to internal Id/Object mapping.
bool FreeObject(vtkObject *obj)
Given an object, remove any internal reference count due to internal Id/Object mapping.
vtkObject * GetActiveObject(const char *objectType)
Retrieve a previously stored object based on a name.
abstract base class for most VTK objects
Definition vtkObject.h:162