VTK  9.3.0
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 
18 VTK_ABI_NAMESPACE_BEGIN
19 class VTKWEBCORE_EXPORT vtkObjectIdMap : public vtkObject
20 {
21 public:
22  static vtkObjectIdMap* New();
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 
55  bool FreeObject(vtkObject* obj);
56 
62  bool FreeObjectById(vtkTypeUInt32 id);
63 
64 protected:
66  ~vtkObjectIdMap() override;
67 
68 private:
69  vtkObjectIdMap(const vtkObjectIdMap&) = delete;
70  void operator=(const vtkObjectIdMap&) = delete;
71 
72  struct vtkInternals;
73  vtkInternals* Internals;
74 };
75 
76 VTK_ABI_NAMESPACE_END
77 #endif
a simple class to control print indentation
Definition: vtkIndent.h:29
class used to assign Id to any VTK object and be able to retrieve it base on its id.
vtkTypeUInt32 SetActiveObject(const char *objectType, vtkObject *obj)
Assign an active key (string) to an existing object.
vtkObject * GetActiveObject(const char *objectType)
Retrieve a previously stored object based on a name.
vtkObject * GetVTKObject(vtkTypeUInt32 globalId)
Retrieve a vtkObject based on its global id.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkObjectIdMap * New()
~vtkObjectIdMap() override
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.
abstract base class for most VTK objects
Definition: vtkObject.h:52