VTK  9.2.5
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=========================================================================*/
24#ifndef vtkObjectIdMap_h
25#define vtkObjectIdMap_h
26
27#include "vtkObject.h"
28#include "vtkWebCoreModule.h" // needed for exports
29
30class VTKWEBCORE_EXPORT vtkObjectIdMap : public vtkObject
31{
32public:
34 vtkTypeMacro(vtkObjectIdMap, vtkObject);
35 void PrintSelf(ostream& os, vtkIndent indent) override;
36
41 vtkTypeUInt32 GetGlobalId(vtkObject* obj);
42
46 vtkObject* GetVTKObject(vtkTypeUInt32 globalId);
47
54 vtkTypeUInt32 SetActiveObject(const char* objectType, vtkObject* obj);
55
59 vtkObject* GetActiveObject(const char* objectType);
60
67
73 bool FreeObjectById(vtkTypeUInt32 id);
74
75protected:
77 ~vtkObjectIdMap() override;
78
79private:
80 vtkObjectIdMap(const vtkObjectIdMap&) = delete;
81 void operator=(const vtkObjectIdMap&) = delete;
82
83 struct vtkInternals;
84 vtkInternals* Internals;
85};
86
87#endif
a simple class to control print indentation
Definition: vtkIndent.h:40
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:63