Class rayx::Group¶
#include <Beamline.h>
Inherits the following classes: rayx::BeamlineNode
Public Functions¶
| Type | Name |
|---|---|
| Group () |
|
| Group (std::string name) |
|
| Group (const Group &) = delete |
|
| Group (Group && other) noexcept |
|
| void | addChild (std::unique_ptr< BeamlineNode > child) Adds a child to this Group . |
| auto | begin () |
| auto | begin () const |
| MaterialTables | calcMinimalMaterialTables () const Calculates the minimal set of material tables required by elements in this Group . |
| auto | cbegin () const |
| auto | cend () const |
| virtual std::unique_ptr< BeamlineNode > | clone () override const Creates a deep copy of this group and its children. |
| std::vector< OpticalElementAndTransform > | compileElements () const Recursively converts all DesignElement nodes into OpticalElements with full transforms. |
| void | ctraverse (const std::function< bool(const BeamlineNode &)> & callback) const Recursively traverse the model/scene graph down from this node. |
| auto | end () |
| auto | end () const |
| const DesignElement * | findElement (const std::function< bool(const DesignElement &)> & pred) const |
| DesignElement * | findElement (const std::function< bool(const DesignElement &)> & pred) |
| const DesignElement * | findElementByName (const std::string & name) const |
| DesignElement * | findElementByName (const std::string & name) |
| const Group * | findGroup (const std::function< bool(const Group &)> & pred) const |
| Group * | findGroup (const std::function< bool(const Group &)> & pred) |
| const Group * | findGroupByName (const std::string & name) const |
| Group * | findGroupByName (const std::string & name) |
| const BeamlineNode * | findNode (const std::function< bool(const BeamlineNode &)> & pred) const |
| BeamlineNode * | findNode (const std::function< bool(const BeamlineNode &)> & pred) |
| const BeamlineNode * | findNodeByName (const std::string & name) const |
| BeamlineNode * | findNodeByName (const std::string & name) |
| const BeamlineNode * | findNodeByObjectId (const size_t objectId) const |
| BeamlineNode * | findNodeByObjectId (const size_t objectId) |
| size_t | findObjectIdByNode (const BeamlineNode * node) const |
| const DesignSource * | findSource (const std::function< bool(const DesignSource &)> & pred) const |
| DesignSource * | findSource (const std::function< bool(const DesignSource &)> & pred) |
| const DesignSource * | findSourceByName (const std::string & name) const |
| DesignSource * | findSourceByName (const std::string & name) |
| const std::vector< std::unique_ptr< BeamlineNode > > & | getChildren () const |
| std::vector< std::string > | getElementNames () const |
| std::vector< const DesignElement * > | getElements () const |
| virtual std::string | getName () override const |
| std::vector< std::string > | getObjectNames () const |
| virtual glm::dmat4 | getOrientation () override const Gets the local orientation (rotation/transform) of this node. |
| virtual glm::dvec4 | getPosition () override const Gets the local position of this node. |
| std::vector< std::string > | getSourceNames () const |
| std::vector< const DesignSource * > | getSources () const |
| virtual bool | isGroup () override const |
| size_t | numElements () const |
| size_t | numObjects () const |
| size_t | numRayPaths () const |
| size_t | numSources () const |
| Group & | operator= (const Group &) = delete |
| Group & | operator= (Group && other) noexcept |
| virtual const BeamlineNode * | operator[] (size_t index) override const |
| virtual BeamlineNode * | operator[] (size_t index) override |
| virtual const BeamlineNode * | operator[] (const std::string & name) override const |
| virtual BeamlineNode * | operator[] (const std::string & name) override |
| std::unique_ptr< BeamlineNode > | releaseNodeFromChildren (const BeamlineNode * node) |
| std::unique_ptr< BeamlineNode > | releaseNodeFromTree (const BeamlineNode * node) |
| virtual void | setName (std::string name) override |
| void | setOrientation (const glm::dmat4 & orientation) |
| void | setPosition (const glm::dvec4 & pos) |
| void | traverse (const std::function< bool(BeamlineNode &)> & callback) Recursively traverses this Group and its children (non-const). |
| ~Group () = default |
Public Functions inherited from rayx::BeamlineNode¶
| Type | Name |
|---|---|
| const DesignElement * | asElement () const |
| DesignElement * | asElement () |
| const Group * | asGroup () const |
| Group * | asGroup () |
| const DesignSource * | asSource () const |
| DesignSource * | asSource () |
| virtual std::unique_ptr< BeamlineNode > | clone () const = 0 Creates a deep copy (clone) of this BeamlineNode . |
| virtual std::string | getName () const = 0 |
| int | getObjectId () const |
| virtual glm::dmat4 | getOrientation () const = 0 Gets the local orientation (rotation/transform) of this node. |
| const BeamlineNode * | getParent () const |
| BeamlineNode * | getParent () |
| virtual glm::dvec4 | getPosition () const = 0 Gets the local position of this node. |
| const BeamlineNode * | getRoot () const |
| BeamlineNode * | getRoot () |
| glm::dmat4 | getWorldOrientation () const Computes the absolute/world orientation of this node. |
| glm::dvec4 | getWorldPosition () const Computes the absolute/world position of this node. |
| bool | hasParent () const |
| virtual bool | isElement () const |
| virtual bool | isGroup () const |
| virtual bool | isSource () const |
| virtual const BeamlineNode * | operator[] (size_t index) const |
| virtual BeamlineNode * | operator[] (size_t index) |
| virtual const BeamlineNode * | operator[] (const std::string & name) const |
| virtual BeamlineNode * | operator[] (const std::string & name) |
| virtual void | setName (std::string name) = 0 |
| virtual | ~BeamlineNode () = default |
Public Static Functions¶
| Type | Name |
|---|---|
| void | accumulateLightSourcesWorldPositions (const Group & group, const glm::dvec4 & parentPos, const glm::dmat4 & parentOri, std::vector< glm::dvec4 > & positions) Gathers the world positions of all light sources within a Group hierarchy. |
Detailed Description¶
A beamline group that can contain child nodes (elements, sources, or other groups). A Group is a building block for the model/scene graph.
Public Functions Documentation¶
function Group [1/4]¶
function Group [2/4]¶
function Group [3/4]¶
function Group [4/4]¶
function addChild¶
Adds a child to this Group .
Parameters:
childA unique_ptr to a BeamlineNode to be moved into this Group.
function begin [1/2]¶
function begin [2/2]¶
function calcMinimalMaterialTables¶
Calculates the minimal set of material tables required by elements in this Group .
Gathers the material IDs used by all child DesignElements and merges them into a single MaterialTables object.
Returns:
A MaterialTables object with data for all relevant materials.
function cbegin¶
function cend¶
function clone¶
Creates a deep copy of this group and its children.
Returns:
unique_ptr to the base class (can be statically casted)
Implements rayx::BeamlineNode::clone
function compileElements¶
Recursively converts all DesignElement nodes into OpticalElements with full transforms.
Returns:
A vector of OpticalElementAndTransform objects compiled from the Group hierarchy.
function ctraverse¶
Recursively traverse the model/scene graph down from this node.
Calls the callback function on each node.
Parameters:
callbackCallback function which takes a BeamlineNode reference and returns a bool. Returning true stops the traversal and returning false continues it.
function end [1/2]¶
function end [2/2]¶
function findElement [1/2]¶
const DesignElement * rayx::Group::findElement (
const std::function< bool(const DesignElement &)> & pred
) const
function findElement [2/2]¶
DesignElement * rayx::Group::findElement (
const std::function< bool(const DesignElement &)> & pred
)
function findElementByName [1/2]¶
function findElementByName [2/2]¶
function findGroup [1/2]¶
function findGroup [2/2]¶
function findGroupByName [1/2]¶
function findGroupByName [2/2]¶
function findNode [1/2]¶
const BeamlineNode * rayx::Group::findNode (
const std::function< bool(const BeamlineNode &)> & pred
) const
function findNode [2/2]¶
function findNodeByName [1/2]¶
function findNodeByName [2/2]¶
function findNodeByObjectId [1/2]¶
function findNodeByObjectId [2/2]¶
function findObjectIdByNode¶
function findSource [1/2]¶
const DesignSource * rayx::Group::findSource (
const std::function< bool(const DesignSource &)> & pred
) const
function findSource [2/2]¶
function findSourceByName [1/2]¶
function findSourceByName [2/2]¶
function getChildren¶
function getElementNames¶
function getElements¶
function getName¶
Implements rayx::BeamlineNode::getName
function getObjectNames¶
function getOrientation¶
Gets the local orientation (rotation/transform) of this node.
Each node may have its own transform relative to its parent.
Returns:
A 4x4 matrix (dmat4) representing the local orientation.
Implements rayx::BeamlineNode::getOrientation
function getPosition¶
Gets the local position of this node.
Each node may have its own transform relative to its parent.
Returns:
A 4D vector (dvec4) representing the local position.
Implements rayx::BeamlineNode::getPosition
function getSourceNames¶
function getSources¶
function isGroup¶
Implements rayx::BeamlineNode::isGroup
function numElements¶
function numObjects¶
function numRayPaths¶
function numSources¶
function operator=¶
function operator=¶
function operator[]¶
Implements rayx::BeamlineNode::operator[]
function operator[]¶
Implements rayx::BeamlineNode::operator[]
function operator[]¶
Implements rayx::BeamlineNode::operator[]
function operator[]¶
Implements rayx::BeamlineNode::operator[]
function releaseNodeFromChildren¶
function releaseNodeFromTree¶
function setName¶
Implements rayx::BeamlineNode::setName
function setOrientation¶
function setPosition¶
function traverse¶
Recursively traverses this Group and its children (non-const).
Calls callback on each node (including nested Groups). If the callback returns true at any point, the traversal stops early.
Parameters:
callbackA function that takes a BeamlineNode& and returns a bool (true = stop traversal, false = continue).
function ~Group¶
Public Static Functions Documentation¶
function accumulateLightSourcesWorldPositions¶
Gathers the world positions of all light sources within a Group hierarchy.
static void rayx::Group::accumulateLightSourcesWorldPositions (
const Group & group,
const glm::dvec4 & parentPos,
const glm::dmat4 & parentOri,
std::vector< glm::dvec4 > & positions
)
Parameters:
groupA reference to the current Group to process.parentPosThe position of the parent Group (in world coords).parentOriThe orientation of the parent Group (in world coords).positionsA reference to a vector of world positions. New positions are appended.
The documentation for this class was generated from the following file Intern/rayx-core/src/Beamline/Beamline.h