refactor: replace raw object pointers with SmartPointer in ObjectsContext and update dependent codebases
This commit is contained in:
@@ -425,6 +425,7 @@ void ReferencePropertyWidget::refreshCombo() {
|
|||||||
Object* currentRef = m_RefProp->GetReferencedObject();
|
Object* currentRef = m_RefProp->GetReferencedObject();
|
||||||
|
|
||||||
if (m_Context) {
|
if (m_Context) {
|
||||||
|
const auto& objects = m_Context->GetObjects();
|
||||||
for (const auto& obj : objects) {
|
for (const auto& obj : objects) {
|
||||||
if (m_RefProp->IsCompatible(obj.get())) {
|
if (m_RefProp->IsCompatible(obj.get())) {
|
||||||
QString label = QString::fromStdString(obj->GetInstanceName());
|
QString label = QString::fromStdString(obj->GetInstanceName());
|
||||||
|
|||||||
@@ -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.
|
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.
|
For this reason the access to a object context for a Object via Get/Set is done using the SmartPointer instances.
|
||||||
|
|
||||||
|
|
||||||
## Geant Physical Volumes
|
## 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).
|
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).
|
||||||
|
|||||||
Reference in New Issue
Block a user