Skip to content

Class rayx::BeamlineNode

ClassList > rayx > BeamlineNode

Base class for all nodes in the beamline hierarchy (scene/model graph). More...

  • #include <Node.h>

Inherited by the following classes: rayx::DesignElement, rayx::DesignSource, rayx::Group

Public Functions

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

Detailed Description

This abstract class defines the common interface for any node in a beamline. Nodes can be groups, elements, or sources, each providing their own logic for position/orientation and potential child relationships.

Public Functions Documentation

function asElement [1/2]

const DesignElement * rayx::BeamlineNode::asElement () const

function asElement [2/2]

DesignElement * rayx::BeamlineNode::asElement () 

function asGroup [1/2]

const Group * rayx::BeamlineNode::asGroup () const

function asGroup [2/2]

Group * rayx::BeamlineNode::asGroup () 

function asSource [1/2]

const DesignSource * rayx::BeamlineNode::asSource () const

function asSource [2/2]

DesignSource * rayx::BeamlineNode::asSource () 

function clone

Creates a deep copy (clone) of this BeamlineNode .

virtual std::unique_ptr< BeamlineNode > rayx::BeamlineNode::clone () const = 0

Derived classes must implement this to allow duplication of their internal state.

Returns:

A unique_ptr to the newly cloned BeamlineNode.


function getName

virtual std::string rayx::BeamlineNode::getName () const = 0

function getObjectId

int rayx::BeamlineNode::getObjectId () const

function getOrientation

Gets the local orientation (rotation/transform) of this node.

virtual glm::dmat4 rayx::BeamlineNode::getOrientation () const = 0

Each node may have its own transform relative to its parent.

Returns:

A 4x4 matrix (dmat4) representing the local orientation.


function getParent [1/2]

inline const BeamlineNode * rayx::BeamlineNode::getParent () const

function getParent [2/2]

inline BeamlineNode * rayx::BeamlineNode::getParent () 

function getPosition

Gets the local position of this node.

virtual glm::dvec4 rayx::BeamlineNode::getPosition () const = 0

Each node may have its own transform relative to its parent.

Returns:

A 4D vector (dvec4) representing the local position.


function getRoot [1/2]

const BeamlineNode * rayx::BeamlineNode::getRoot () const

function getRoot [2/2]

BeamlineNode * rayx::BeamlineNode::getRoot () 

function getWorldOrientation

Computes the absolute/world orientation of this node.

glm::dmat4 rayx::BeamlineNode::getWorldOrientation () const

Recursively multiplies the parent's world orientation by the node's local orientation. If there is no parent, the local orientation is already in world space.

Returns:

A 4x4 matrix (dmat4) representing the orientation in world coordinates.


function getWorldPosition

Computes the absolute/world position of this node.

glm::dvec4 rayx::BeamlineNode::getWorldPosition () const

Recursively applies parent transformations until the root of the hierarchy is reached. If there is no parent, the local position is already in world space.

Returns:

A 4D vector (dvec4) representing the position in world coordinates.


function hasParent

inline bool rayx::BeamlineNode::hasParent () const

function isElement

inline virtual bool rayx::BeamlineNode::isElement () const

function isGroup

inline virtual bool rayx::BeamlineNode::isGroup () const

function isSource

inline virtual bool rayx::BeamlineNode::isSource () const

function operator[]

virtual const BeamlineNode * rayx::BeamlineNode::operator[] (
    size_t index
) const

function operator[]

virtual BeamlineNode * rayx::BeamlineNode::operator[] (
    size_t index
) 

function operator[]

virtual const BeamlineNode * rayx::BeamlineNode::operator[] (
    const std::string & name
) const

function operator[]

virtual BeamlineNode * rayx::BeamlineNode::operator[] (
    const std::string & name
) 

function setName

virtual void rayx::BeamlineNode::setName (
    std::string name
) = 0

function ~BeamlineNode

virtual rayx::BeamlineNode::~BeamlineNode () = default

Ensures proper cleanup of derived classes when deleting through a pointer to BeamlineNode.



The documentation for this class was generated from the following file Intern/rayx-core/src/Beamline/Node.h