![]() |
LArSoft
v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
|
Representation of a node and its ancestry. More...
#include "GeoNodePath.h"
Public Types | |
using | Entry = GeoNodePathEntry |
using | Depth_t = std::size_t |
Type used to represent the depth of the path. More... | |
Public Member Functions | |
GeoNodePath (TGeoNode const *topNode) | |
Sets all the the specified nodes into the current path. More... | |
bool | empty () const |
Returns whether there is a current node. More... | |
Depth_t | depth () const |
Returns the depth of the path (elements including up to the current). More... | |
TGeoNode const * | current () const |
Returns the current node. Undefined if the path is empty. More... | |
Entry | current_entry () const |
Returns the current node. Undefined if the path is empty. More... | |
Entry | parent_entry () const |
Returns the parent entry of the current entry, or null if there is no parent. More... | |
void | append (TGeoNode const *node) |
Adds a node to the current path. More... | |
void | pop () |
Removes the current node from the path, moving the current one up. More... | |
template<typename Matrix = TGeoHMatrix> | |
Matrix | currentTransformation () const |
Returns the total transformation to the current node, as a Matrix . More... | |
operator std::string () const | |
Prints the full path (as node names) into a string. More... | |
Private Attributes | |
std::vector< Entry > | fNodes |
Local path of pointers to ROOT geometry nodes. More... | |
Representation of a node and its ancestry.
A GeoNodePath
contains a sequence of nodes, from the root()
node down to a current()
one.
It behaves like a stack
in that it inserts and removes elements at the "top", which is also what defines the current node.
Definition at line 34 of file GeoNodePath.h.
using geo::GeoNodePath::Depth_t = std::size_t |
Type used to represent the depth of the path.
Definition at line 41 of file GeoNodePath.h.
Definition at line 37 of file GeoNodePath.h.
|
explicit |
Sets all the the specified nodes into the current path.
Definition at line 39 of file GeoNodePath.cxx.
void geo::GeoNodePath::append | ( | TGeoNode const * | node | ) |
Adds a node to the current path.
Definition at line 67 of file GeoNodePath.cxx.
References current_entry(), empty(), and fNodes.
Referenced by geo::ROOTGeometryNavigator::apply(), and geo::GeometryExtractor::operator()().
TGeoNode const * geo::GeoNodePath::current | ( | ) | const |
Returns the current node. Undefined if the path is empty.
Definition at line 51 of file GeoNodePath.cxx.
References current_entry(), and geo::GeoNodePathEntry::node.
Referenced by geo::ROOTGeometryNavigator::apply(), geo::GeometryBuilderStandard::makeAuxDet(), geo::GeometryBuilderStandard::makeCryostat(), geo::WireReadoutGeomBuilderStandard::makePlane(), geo::WireReadoutGeomBuilderStandard::makeWire(), and geo::GeometryExtractor::operator()().
auto geo::GeoNodePath::current_entry | ( | ) | const |
Returns the current node. Undefined if the path is empty.
Definition at line 56 of file GeoNodePath.cxx.
References fNodes.
Referenced by append(), current(), and geo::GeometryBuilderStandard::makeTPC().
Matrix geo::GeoNodePath::currentTransformation | ( | ) | const |
Returns the total transformation to the current node, as a Matrix
.
Definition at line 94 of file GeoNodePath.h.
References fNodes.
Referenced by geo::GeometryBuilderStandard::makeAuxDet(), geo::GeometryBuilderStandard::makeCryostat(), geo::WireReadoutGeomBuilderStandard::makePlane(), geo::GeometryBuilderStandard::makeTPC(), and geo::WireReadoutGeomBuilderStandard::makeWire().
GeoNodePath::Depth_t geo::GeoNodePath::depth | ( | ) | const |
Returns the depth of the path (elements including up to the current).
Definition at line 46 of file GeoNodePath.cxx.
References fNodes.
Referenced by geo::GeometryExtractor::operator()(), and parent_entry().
bool geo::GeoNodePath::empty | ( | ) | const |
Returns whether there is a current node.
Definition at line 41 of file GeoNodePath.cxx.
References fNodes.
Referenced by append().
geo::GeoNodePath::operator std::string | ( | ) | const |
Prints the full path (as node names) into a string.
Definition at line 78 of file GeoNodePath.cxx.
References util::end(), and fNodes.
auto geo::GeoNodePath::parent_entry | ( | ) | const |
Returns the parent entry of the current entry, or null if there is no parent.
Definition at line 61 of file GeoNodePath.cxx.
References depth(), fNodes, and util::size().
Referenced by geo::WireReadoutGeomBuilderStandard::doExtractPlanes().
void geo::GeoNodePath::pop | ( | ) |
Removes the current node from the path, moving the current one up.
Definition at line 73 of file GeoNodePath.cxx.
References fNodes.
Referenced by geo::ROOTGeometryNavigator::apply(), and geo::GeometryExtractor::operator()().
|
private |
Local path of pointers to ROOT geometry nodes.
Definition at line 84 of file GeoNodePath.h.
Referenced by append(), current_entry(), currentTransformation(), depth(), empty(), operator std::string(), parent_entry(), and pop().