docs: refactor and promote object context documentation to dedicated guide

This commit is contained in:
AndreaRigoni
2026-04-17 12:33:37 +00:00
parent 16ae404d66
commit d771269efa
2 changed files with 1 additions and 3 deletions

View File

@@ -27,4 +27,3 @@ In the Geant4/HEP domain, visibility and placement follow a strict two-tier hier
## 4. Best Practices & Checks ## 4. Best Practices & Checks
- **TRS Logic**: Always apply transformations to the `PhysicalVolume`. Changes to a `LogicalVolume` will affect all its instances but will not move them. - **TRS Logic**: Always apply transformations to the `PhysicalVolume`. Changes to a `LogicalVolume` will affect all its instances but will not move them.
- **Dependency Tracking**: Use the tree structure to identify shared references. Changing a property on a shared object affects all parent nodes that reference it. - **Dependency Tracking**: Use the tree structure to identify shared references. Changing a property on a shared object affects all parent nodes that reference it.

View File

@@ -2,7 +2,7 @@
In uLib the context is meant to hold a set of objects and their hierarchy. In addition ObjectFactory is used to create objects from a predefined registry. In uLib the context is meant to hold a set of objects and their hierarchy. In addition ObjectFactory is used to create objects from a predefined registry.
Object context can be thouught as a collection of uLib::Object instances. And there exists nested collection of objects if a context is added to another context. A nested context is a Group of elements that appears like a single object in the parent context and a hierarchy of objects inside the tree structure. Object context can be thought as a collection of uLib::Object instances. And there exists nested collection of objects if a context is added to another context. A nested context is a Group of elements that appears like a single object in the parent context and a hierarchy of objects inside the tree structure.
## SmartPointer access ## SmartPointer access
@@ -11,7 +11,6 @@ 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).