19 #ifndef vtkObjectManager_h
20 #define vtkObjectManager_h
24 #include "vtkSerializationManagerModule.h"
33 #include "vtkTypeUInt32Array.h"
38 VTK_ABI_NAMESPACE_BEGIN
40 class vtkTypeUInt8Array;
53 virtual bool Initialize();
54 bool InitializeDefaultHandlers();
60 bool InitializeExtensionModuleHandlers(
61 const std::vector<vtkSessionObjectManagerRegistrarFunc>& registrars);
62 bool InitializeExtensionModuleHandlers(
75 bool UnRegisterObject(vtkTypeUInt32 identifier);
85 bool RegisterState(
const nlohmann::json& state);
91 bool UnRegisterState(vtkTypeUInt32 identifier);
122 std::vector<vtkTypeUInt32> GetAllDependencies(vtkTypeUInt32 identifier);
130 std::vector<std::string> GetBlobHashes(
const std::vector<vtkTypeUInt32>& ids);
159 void PruneUnusedBlobs();
164 void UpdateObjectsFromStates();
169 void UpdateStatesFromObjects();
180 void UpdateStatesFromObjects(
const std::vector<vtkTypeUInt32>& identifiers);
186 bool UpdateObjectFromState(
const std::string& state);
187 bool UpdateObjectFromState(
const nlohmann::json& state);
193 void UpdateStateFromObject(vtkTypeUInt32 identifier);
205 nlohmann::json Invoke(
206 vtkTypeUInt32 identifier,
const std::string& methodName,
const nlohmann::json& args);
208 std::size_t GetTotalBlobMemoryUsage();
209 std::size_t GetTotalVTKDataObjectMemoryUsage();
215 void Export(
const std::string& filename,
int indentLevel = -1,
char indentChar =
' ');
234 std::vector<vtkSmartPointer<vtkObjectBase>> ImportFromBytes(
240 void PruneUnusedStates();
245 void PruneUnusedObjects();
247 static vtkTypeUInt32
ROOT() {
return 0; }
286 std::vector<vtkTypeUInt32> ImportFromJSON(
const nlohmann::json& json);
297 static const char* KEPT_ALIVE_KEY() {
return "vtk-object-manager-kept-alive"; }
314 void MarkKeptAlive(
vtkObjectBase*
object, vtkTypeUInt32 identifier);
316 VTK_ABI_NAMESPACE_END
Deserialize VTK objects from JSON.
Deserialize VTK objects from JSON.
abstract base class for most VTK objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static const char * OWNERSHIP_KEY()
vtkNew< vtkDeserializer > Deserializer
This header file provides the C API for working with standalone/remote visualization applications...
Hold a reference to a vtkObjectBase instance.
vtkSmartPointer< vtkMarshalContext > Context
a simple class to control print indentation
vtkNew< vtkSerializer > Serializer
abstract base class for most VTK objects
static vtkTypeUInt32 ROOT()
vtkObjectManager maintains internal instances of vtkSerializer and a vtkDeserializer to serialize and...
Shared context used by vtkSerializer and vtkDeserializer
vtkNew< vtkInvoker > Invoker
int(* vtkSessionObjectManagerRegistrarFunc)(void *ser, void *deser, void *invoker, const char **error)
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Serialize VTK objects to JSON.