From 61888d36f5aaea27571300db43f9e9fc5fee7e78 Mon Sep 17 00:00:00 2001 From: AndreaRigoni Date: Fri, 17 Apr 2026 13:28:24 +0000 Subject: [PATCH] refactor: replace raw object pointers with SmartPointer in ObjectsContext and update dependent codebases --- app/gcompose/src/PropertyWidgets.cpp | 1 + docs/object_context.md | 1 + 2 files changed, 2 insertions(+) diff --git a/app/gcompose/src/PropertyWidgets.cpp b/app/gcompose/src/PropertyWidgets.cpp index c8f116b..ee8a2a1 100644 --- a/app/gcompose/src/PropertyWidgets.cpp +++ b/app/gcompose/src/PropertyWidgets.cpp @@ -425,6 +425,7 @@ void ReferencePropertyWidget::refreshCombo() { Object* currentRef = m_RefProp->GetReferencedObject(); if (m_Context) { + const auto& objects = m_Context->GetObjects(); for (const auto& obj : objects) { if (m_RefProp->IsCompatible(obj.get())) { QString label = QString::fromStdString(obj->GetInstanceName()); diff --git a/docs/object_context.md b/docs/object_context.md index 92d9e6d..c691a74 100644 --- a/docs/object_context.md +++ b/docs/object_context.md @@ -11,6 +11,7 @@ SmartPointer is a class that is used to hold a reference to another object. It i The ObjectContext is responsible to keep track of all the objects that are added to it and to provide a way to access them, but also it holds the SmartPointer instances that point to the objects that are added to it. In this way Objects added to a Context are disposed only when the context is destroyed. For this reason the access to a object context for a Object via Get/Set is done using the SmartPointer instances. + ## Geant Physical Volumes The Geant library add a further layer of complexity. The physical volumes are created from a what is called LogicalVolume (which holds information about the shape, material and daughter volumes) and represent the actual instances of the volumes in the detector. So in this sense they represent what could be the Prop3D in the uLib Vtk library. The PhysicalVolume is created from the LogicalVolume and is the one that is actually placed in the scene, with its own relative TRS: position and rotation (rotation here is a rotation matrix comprising the scaling).