VTK  9.1.0
vtkObjectIdMap.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkObjectIdMap.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
21 #ifndef vtkObjectIdMap_h
22 #define vtkObjectIdMap_h
23 
24 #include "vtkObject.h"
25 #include "vtkWebCoreModule.h" // needed for exports
26 
27 class VTKWEBCORE_EXPORT vtkObjectIdMap : public vtkObject
28 {
29 public:
30  static vtkObjectIdMap* New();
31  vtkTypeMacro(vtkObjectIdMap, vtkObject);
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
38  vtkTypeUInt32 GetGlobalId(vtkObject* obj);
39 
43  vtkObject* GetVTKObject(vtkTypeUInt32 globalId);
44 
51  vtkTypeUInt32 SetActiveObject(const char* objectType, vtkObject* obj);
52 
56  vtkObject* GetActiveObject(const char* objectType);
57 
63  bool FreeObject(vtkObject* obj);
64 
70  bool FreeObjectById(vtkTypeUInt32 id);
71 
72 protected:
74  ~vtkObjectIdMap() override;
75 
76 private:
77  vtkObjectIdMap(const vtkObjectIdMap&) = delete;
78  void operator=(const vtkObjectIdMap&) = delete;
79 
80  struct vtkInternals;
81  vtkInternals* Internals;
82 };
83 
84 #endif
a simple class to control print indentation
Definition: vtkIndent.h:34
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:63