VTK  9.3.1
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
abstract base class for most VTK objects
Definition: vtkObject.h:51
class used to assign Id to any VTK object and be able to retrieve it base on its id.
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:28
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...