Web Analytics Made Easy - Statcounter
Skip to content

Class SBGRenderStructuralModel#

ClassList > SBGRenderStructuralModel

The class SBGRenderStructuralModel is used to render the structural model node.

  • #include <SBGRenderStructuralModel.hpp>

Inherits the following classes: SBGRenderNode

Inherited by the following classes: SBGRenderFragment

Public Types inherited from SBGRenderNode#

See SBGRenderNode

Type Name
enum Type
Available render node types.

Public Functions#

Type Name
SBGRenderStructuralModel (SBStructuralModel * model)
Builds a renderer for the structural model model .
void collectAmbientOcclusion (const SBPosition3 & boxOrigin, const SBPosition3 & boxSize, unsigned int nCellsX, unsigned int nCellsY, unsigned int nCellsZ, float * ambientOcclusionData)
Collects the ambient occlusion.
void connectToStructuralModel ()
Connect the render model to the structural model.
void disconnectFromStructuralModel ()
Disconnect the render model from the structural model.
virtual void display (SBNode::RenderingPass renderingPass) override
Display the node.
void expandBounds (SBIAPosition3 & bounds) const
Expands the bounds to make sure the structural model fits inside them.
virtual void forEachNodeDepthFirst (void(*)(SBGRenderNode *node) action) override
Performs the action on this render structural model.
virtual void forEachNodeDepthFirst (SBCClass * object, void(SBCClass::*)(SBGRenderNode *node) action) override
Performs the object 'saction on this render structural model.
const float * getAtomColorData () const
Return the atom color data.
const unsigned int * getAtomFlagData () const
Return the atom flag data.
const unsigned int * getAtomNodeIndexData () const
Return the atom node index data.
const SBPointerIndexer< SBNode > * getAtomPointerIndexer () const
Return the index of currently displayed atoms.
const float * getAtomPositionData () const
Return the atom position data.
float getAtomRadius () const
Returns the constant atom radius for rendering.
float getAtomSizeProportionalToVdWRadius () const
Returns the atom size proportional to atom van der Waals radius.
const float * getBondAtomColorData () const
Return the bond atom color data.
const unsigned int * getBondAtomIndexData () const
Return the bond atom index data.
const SBPointerIndexer< SBNode > * getBondAtomPointerIndexer () const
Return the index of atoms in currently displayed bonds.
const float * getBondAtomPositionData () const
Return the bond atom position data.
const float * getBondDisplacementData () const
Return the bond displacement data.
const unsigned int * getBondFlagData () const
Return the bond flag data.
bool getBondMultipleDisplay () const
Returns bond multiple display flag.
const unsigned int * getBondNodeIndexData () const
Return the bond node index data.
const float * getBondOrderData () const
Return the bond order data.
const SBPointerIndexer< SBNode > * getBondPointerIndexer () const
Return the index of currently displayed bonds.
float getBondRadius () const
Returns the bond radius for rendering.
bool getConstantAtomRadiusFlag () const
Returns true if all atoms should be displayed with the same radius,false if atoms should be displayed with radii proportional to their van der Waals radii.
const unsigned int * getHydrogenBondAtomIndexData () const
Return the H-bond atom index data.
const SBPointerIndexer< SBNode > * getHydrogenBondAtomPointerIndexer () const
Return the index of atoms in currently displayed H-bonds.
const float * getHydrogenBondAtomPositionData () const
Return the H-bond atom position data.
const float * getHydrogenBondColorData () const
Return the H-bond atom color data.
const unsigned int * getHydrogenBondFlagData () const
Return the H-bond flag data.
const unsigned int * getHydrogenBondNodeIndexData () const
Return the H-bond node index data.
const float * getHydrogenBondOrderData () const
Return the H-bond order data.
const SBPointerIndexer< SBNode > * getHydrogenBondPointerIndexer () const
Return the index of currently displayed H-bonds.
virtual void getNodes (std::vector< SBGRenderNode * > & selection) override
Populates selection with this node.
virtual void getNodes (std::vector< SBGRenderNode * > & selection, SBGRenderNode::Type type) override
Populates selection with this node if it has the render node typetype __
virtual void getNodes (std::vector< SBGRenderNode * > & selection, bool(*)(SBGRenderNode *) selectionRule) override
Populates selection with this node based on theselectionRule __
virtual void getNodes (std::vector< SBGRenderNode * > & selection, bool(*)(SBGRenderNode *) visitRule, bool(*)(SBGRenderNode *) selectionRule) override
Populates selection with this node based on thevisitRule andselectionRule __
virtual Type getType () override const
Returns SBGRenderNode::Type::StructuralModel .
void onBaseEvent (SBBaseEvent * event)
Handle structural model events.
void onStructuralEvent (SBStructuralEvent * event)
Handle structural events from structural models (moves, etc.)
virtual void print (unsigned int offset=0) override const
Print debug information.
void setAtomRadius (float atomRadius)
Sets the constant atom radius for rendering.
void setAtomSizeProportionalToVdWRadius (float ratio)
Sets the atom size proportional to atom van der Waals radius.
void setBondMultipleDisplay (bool multipleDisplay)
Sets bond multiple display flag.
void setBondRadius (float bondRadius)
Sets the bond radius for rendering.
void setConstantAtomRadiusFlag (bool flag)
Set true if atoms should be displayed with the same radius,false if atoms should be displayed with radii proportional to their van der Waals radii.
void setupFlagData (SBNode * root)
Update the flags in the tree starting at root.
virtual ~SBGRenderStructuralModel ()
Destructor.

Public Functions inherited from SBGRenderNode#

See SBGRenderNode

Type Name
virtual void display (SBNode::RenderingPass renderingPass) = 0
Display the node.
virtual void forEachNodeDepthFirst (void(*)(SBGRenderNode *node) action)
Performs the action on this render node.
virtual void forEachNodeDepthFirst (SBCClass * object, void(SBCClass::*)(SBGRenderNode *node) action)
Performs the object 'saction on this render node.
virtual void getNodes (std::vector< SBGRenderNode * > & selection)
Populates selection with this node.
virtual void getNodes (std::vector< SBGRenderNode * > & selection, SBGRenderNode::Type type)
Populates selection with this node if it has the render node typetype __
virtual void getNodes (std::vector< SBGRenderNode * > & selection, bool(*)(SBGRenderNode *) selectionRule)
Populates selection with this node based on theselectionRule __
virtual void getNodes (std::vector< SBGRenderNode * > & selection, bool(*)(SBGRenderNode *) visitRule, bool(*)(SBGRenderNode *) selectionRule)
Populates selection with this node based on thevisitRule andselectionRule __
virtual SBGRenderNode * getParent () const
Return parent of the render node.
virtual Type getType () const
Return type of the render node.
virtual void print (unsigned int offset=0) const
Print debug information.
virtual void requestViewportUpdate ()
Request a viewport update.

Public Functions inherited from SBCReferenceTarget#

See SBCReferenceTarget

Type Name
SBCReferenceTarget ()
Builds the reference target.
unsigned int getMemoryFootprint () const
Returns the memory footprint.
void printReferencesToOwners () const
Prints the references to the owners of this reference target.
virtual ~SBCReferenceTarget ()
Destructor.

Public Static Functions#

Type Name
bool selectAll (SBNode * node)
Returns true __
bool selectHighlightedNodes (SBNode * node)
Returns true if thenode is highlighted.
bool selectNodesByType (SBNode * node)
Returns whether the node has the specified node typetype __
bool selectSelectedNodes (SBNode * node)
Returns true if thenode is selected.
bool selectVisibleNodes (SBNode * node)
Returns true if thenode is visible.

Public Static Functions inherited from SBGRenderNode#

See SBGRenderNode

Type Name
void forEachNodeInSelection (std::vector< SBGRenderNode * > & selection, void(*)(SBGRenderNode *node) action)
Performs the action on each render node inselection __
void forEachNodeInSelection (std::vector< SBGRenderNode * > & selection, SBCClass * object, void(SBCClass::*)(SBGRenderNode *node) action)
Performs the object 'saction on each render node in `selection.
std::string getTypeString (Type type)
Return string representation of the type of the render node.

Protected Attributes#

Type Name
SBGRenderStructuralModelData * dataPointer
A pointer to the private data.

Protected Attributes inherited from SBCReferenceTarget#

See SBCReferenceTarget

Type Name
SBCReferenceTargetData * dataPointer
A pointer to the private data.

Protected Functions#

Type Name
void addStructuralNodes ()
Add structural nodes to internal data structures.
void addStructuralNodes (SBNode * root)
Add structural nodes to internal data structures.
void copyAtomData (unsigned int & sourceIndex, unsigned int & destinationIndex)
Copies atom data from a source index to a destination index.
void copyBondAtomData (unsigned int & sourceIndex, unsigned int & destinationIndex)
Copies bond atom data (positions, normal update flag, and colors) from a source index to a destination index.
void copyBondData (unsigned int & sourceIndex, unsigned int & destinationIndex)
Copies bond data (atom indices, order, flags, node index, and displacement) from a source index to a destination index.
void copyHydrogenBondAtomData (unsigned int sourceIndex, unsigned int destinationIndex)
Copies hydrogen bond atom position data from a source index to a destination index.
void copyHydrogenBondData (unsigned int sourceIndex, unsigned int destinationIndex)
Copies hydrogen bond data from a source index to a destination index.
void moveAtom (SBAtom * atom)
Updates rendering data for an atom after it has moved.
void removeStructuralNodes ()
Remove structural nodes from internal data structures.
void removeStructuralNodes (SBNode * root)
Remove structural nodes from internal data structures.
void setupAtomData (SBAtom * atom, unsigned int & index)
Initializes rendering data for an atom.
void setupBondAtomData (SBAtom * atom, unsigned int & index)
Initializes rendering data for a bond atom.
void setupBondData (SBBond * bond, unsigned int & index)
Initializes bond data for the specified bond.
void setupBondDisplacementData (SBBond * bond, unsigned int & index)
Stores the displacement vector for a bond if its order exceeds the threshold.
void setupHydrogenBondAtomData (SBAtom * atom, unsigned int index)
Stores the position of a hydrogen bond atom.
void setupHydrogenBondColorData (SBHydrogenBond * hydrogenBond, unsigned int index)
Stores the RGBA color for a hydrogen bond.
void setupHydrogenBondData (SBHydrogenBond * hydrogenBond, unsigned int index)
Initializes hydrogen bond data, including atom indices and node index.
void setupHydrogenBondOrderData (SBHydrogenBond * hydrogenBond, unsigned int index)
Stores the order value for a hydrogen bond.
void setupMaterials (SBNode * root)
Sets up rendering materials for all visible nodes under the given root.
void updateAtomRadiusData ()
Updates the radius information for all atoms in the model.
void updateAtomRadiusData (SBAtom * atom)
Updates the radius information for a specific atom.
void updateHydrogenBondOrderData ()
Updates the order data for all hydrogen bonds.
void updateHydrogenBonds ()
Updates hydrogen bond data and ensures hydrogen bond groups are refreshed if needed.
void updateStructuralNodes ()
Display attributes.

Protected Functions inherited from SBGRenderNode#

See SBGRenderNode

Type Name
SBGRenderNode ()
Build a base object.
virtual ~SBGRenderNode ()
Destructor.

Protected Functions inherited from SBCReferenceTarget#

See SBCReferenceTarget

Type Name
SBCReferenceTarget (SBCReferenceTargetData * dataPointer)
Protected constructor.
void removeAllReferenceOwners ()
Stops all the reference owners from referencing this reference target.

Public Functions Documentation#

function SBGRenderStructuralModel#

Builds a renderer for the structural model model .

SBGRenderStructuralModel::SBGRenderStructuralModel (
    SBStructuralModel * model
) 

Constructs a renderer for the given structural model.

Initializes internal data structures and connects the renderer to the provided structural model.

Parameters:

  • model Pointer to the structural model to be rendered.

function collectAmbientOcclusion#

Collects the ambient occlusion.

void SBGRenderStructuralModel::collectAmbientOcclusion (
    const SBPosition3 & boxOrigin,
    const SBPosition3 & boxSize,
    unsigned int nCellsX,
    unsigned int nCellsY,
    unsigned int nCellsZ,
    float * ambientOcclusionData
) 

Collects ambient occlusion data for the structural model.

Computes occlusion contributions from atoms within the specified bounding box and grid resolution.

Parameters:

  • boxOrigin The origin of the bounding box.
  • boxSize The size of the bounding box.
  • nCellsX Number of cells along the X axis.
  • nCellsY Number of cells along the Y axis.
  • nCellsZ Number of cells along the Z axis.
  • ambientOcclusionData Array that receives the computed occlusion values.

function connectToStructuralModel#

Connect the render model to the structural model.

void SBGRenderStructuralModel::connectToStructuralModel () 

Connects the render model to its associated structural model.

Registers callbacks to receive structural model events.


function disconnectFromStructuralModel#

Disconnect the render model from the structural model.

void SBGRenderStructuralModel::disconnectFromStructuralModel () 

Disconnects the render model from its associated structural model.

Unregisters callbacks and clears the render node reference.


function display#

Display the node.

virtual void SBGRenderStructuralModel::display (
    SBNode::RenderingPass renderingPass
) override

Renders the structural model according to the specified rendering pass.

This method updates structural node data and then dispatches the appropriate rendering calls for atoms, bonds, and hydrogen bonds based on the current rendering pass and model visibility settings. It also forwards the rendering call to the underlying structural model.

Parameters:

  • renderingPass The rendering pass indicating which geometry to render.

Implements SBGRenderNode::display


function expandBounds#

Expands the bounds to make sure the structural model fits inside them.

void SBGRenderStructuralModel::expandBounds (
    SBIAPosition3 & bounds
) const

Expands the bounds to ensure the structural model fits within them.

Parameters:

  • bounds The bounds to be expanded.

function forEachNodeDepthFirst [1/2]#

Performs the action on this render structural model.

virtual void SBGRenderStructuralModel::forEachNodeDepthFirst (
    void(*)( SBGRenderNode *node) action
) override

Executes the given action on this render node as part of a depth-first traversal.

Parameters:

  • action Function pointer to be invoked with this node.

Implements SBGRenderNode::forEachNodeDepthFirst


function forEachNodeDepthFirst [2/2]#

Performs the object 'saction on this render structural model.

virtual void SBGRenderStructuralModel::forEachNodeDepthFirst (
    SBCClass * object,
    void(SBCClass::*)( SBGRenderNode *node) action
) override

Calls the specified member function on the provided object for this render node as part of a depth-first traversal.

Parameters:

  • object The object whose member function will be called.
  • action Pointer to the member function to invoke.

Implements SBGRenderNode::forEachNodeDepthFirst


function getAtomColorData#

Return the atom color data.

const float * SBGRenderStructuralModel::getAtomColorData () const

Provides access to the atom color data array.

Returns:

Pointer to the array of atom color data.


function getAtomFlagData#

Return the atom flag data.

const unsigned int * SBGRenderStructuralModel::getAtomFlagData () const

Provides access to the atom flag data array.

Returns:

Pointer to the array of atom flag data.


function getAtomNodeIndexData#

Return the atom node index data.

const unsigned int * SBGRenderStructuralModel::getAtomNodeIndexData () const

Provides access to the atom node index data array.

Returns:

Pointer to the array of atom node index data.


function getAtomPointerIndexer#

Return the index of currently displayed atoms.

const SBPointerIndexer< SBNode > * SBGRenderStructuralModel::getAtomPointerIndexer () const

Retrieves the indexer for atoms currently displayed.

Returns:

Pointer to the atom pointer indexer.


function getAtomPositionData#

Return the atom position data.

const float * SBGRenderStructuralModel::getAtomPositionData () const

Provides access to the atom position data array.

Returns:

Pointer to the array of atom position data.


function getAtomRadius#

Returns the constant atom radius for rendering.

float SBGRenderStructuralModel::getAtomRadius () const

Returns the radius used for rendering atoms.

This getter provides the current constant atom radius that is applied when rendering atoms.

Returns:

The atom radius value.


function getAtomSizeProportionalToVdWRadius#

Returns the atom size proportional to atom van der Waals radius.

float SBGRenderStructuralModel::getAtomSizeProportionalToVdWRadius () const

Returns the ratio used to scale atom size relative to van der Waals radius.

This getter provides the factor by which atom radii are multiplied when proportional scaling is applied.

Returns:

The atom size proportionality ratio.


function getBondAtomColorData#

Return the bond atom color data.

const float * SBGRenderStructuralModel::getBondAtomColorData () const

Provides access to the bond atom color data array.

Returns:

Pointer to the array of bond atom color data.


function getBondAtomIndexData#

Return the bond atom index data.

const unsigned int * SBGRenderStructuralModel::getBondAtomIndexData () const

Provides access to the bond atom index data array.

Returns:

Pointer to the array of bond atom index data.


function getBondAtomPointerIndexer#

Return the index of atoms in currently displayed bonds.

const SBPointerIndexer< SBNode > * SBGRenderStructuralModel::getBondAtomPointerIndexer () const

Retrieves the indexer for atoms in bonds currently displayed.

Returns:

Pointer to the bond atom pointer indexer.


function getBondAtomPositionData#

Return the bond atom position data.

const float * SBGRenderStructuralModel::getBondAtomPositionData () const

Provides access to the bond atom position data array.

Returns:

Pointer to the array of bond atom position data.


function getBondDisplacementData#

Return the bond displacement data.

const float * SBGRenderStructuralModel::getBondDisplacementData () const

Provides access to the bond displacement data array.

Returns:

Pointer to the array of bond displacement data.


function getBondFlagData#

Return the bond flag data.

const unsigned int * SBGRenderStructuralModel::getBondFlagData () const

Provides access to the bond flag data array.

Returns:

Pointer to the array of bond flag data.


function getBondMultipleDisplay#

Returns bond multiple display flag.

bool SBGRenderStructuralModel::getBondMultipleDisplay () const

Returns whether multiple bond display is enabled.

This getter indicates if bonds are rendered with multiple display mode.

Returns:

true if multiple bond display is enabled; otherwise false.


function getBondNodeIndexData#

Return the bond node index data.

const unsigned int * SBGRenderStructuralModel::getBondNodeIndexData () const

Provides access to the bond node index data array.

Returns:

Pointer to the array of bond node index data.


function getBondOrderData#

Return the bond order data.

const float * SBGRenderStructuralModel::getBondOrderData () const

Provides access to the bond order data array.

Returns:

Pointer to the array of bond order data.


function getBondPointerIndexer#

Return the index of currently displayed bonds.

const SBPointerIndexer< SBNode > * SBGRenderStructuralModel::getBondPointerIndexer () const

Retrieves the indexer for bonds currently displayed.

Returns:

Pointer to the bond pointer indexer.


function getBondRadius#

Returns the bond radius for rendering.

float SBGRenderStructuralModel::getBondRadius () const

Returns the radius used for rendering bonds.

This getter provides the current bond radius applied during bond rendering.

Returns:

The bond radius value.


function getConstantAtomRadiusFlag#

Returns true if all atoms should be displayed with the same radius,false if atoms should be displayed with radii proportional to their van der Waals radii.

bool SBGRenderStructuralModel::getConstantAtomRadiusFlag () const

Returns whether a constant atom radius is used for rendering.

This getter indicates if all atoms are rendered with the same radius (true) or with radii proportional to their van der Waals radii (false).

Returns:

true if a constant atom radius is used; otherwise false.


function getHydrogenBondAtomIndexData#

Return the H-bond atom index data.

const unsigned int * SBGRenderStructuralModel::getHydrogenBondAtomIndexData () const

Provides access to the hydrogen bond atom index data array.

Returns:

Pointer to the array of hydrogen bond atom index data.


function getHydrogenBondAtomPointerIndexer#

Return the index of atoms in currently displayed H-bonds.

const SBPointerIndexer< SBNode > * SBGRenderStructuralModel::getHydrogenBondAtomPointerIndexer () const

Retrieves the indexer for atoms in hydrogen bonds currently displayed.

Returns:

Pointer to the hydrogen bond atom pointer indexer.


function getHydrogenBondAtomPositionData#

Return the H-bond atom position data.

const float * SBGRenderStructuralModel::getHydrogenBondAtomPositionData () const

Provides access to the hydrogen bond atom position data array.

Returns:

Pointer to the array of hydrogen bond atom position data.


function getHydrogenBondColorData#

Return the H-bond atom color data.

const float * SBGRenderStructuralModel::getHydrogenBondColorData () const

Provides access to the hydrogen bond color data array.

Returns:

Pointer to the array of hydrogen bond color data.


function getHydrogenBondFlagData#

Return the H-bond flag data.

const unsigned int * SBGRenderStructuralModel::getHydrogenBondFlagData () const

Provides access to the hydrogen bond flag data array.

Returns:

Pointer to the array of hydrogen bond flag data.


function getHydrogenBondNodeIndexData#

Return the H-bond node index data.

const unsigned int * SBGRenderStructuralModel::getHydrogenBondNodeIndexData () const

Provides access to the hydrogen bond node index data array.

Returns:

Pointer to the array of hydrogen bond node index data.


function getHydrogenBondOrderData#

Return the H-bond order data.

const float * SBGRenderStructuralModel::getHydrogenBondOrderData () const

Provides access to the hydrogen bond order data array.

Returns:

Pointer to the array of hydrogen bond order data.


function getHydrogenBondPointerIndexer#

Return the index of currently displayed H-bonds.

const SBPointerIndexer< SBNode > * SBGRenderStructuralModel::getHydrogenBondPointerIndexer () const

Retrieves the indexer for hydrogen bonds currently displayed.

Returns:

Pointer to the hydrogen bond pointer indexer.


function getNodes [1/4]#

Populates selection with this node.

virtual void SBGRenderStructuralModel::getNodes (
    std::vector< SBGRenderNode * > & selection
) override

Adds this render node to the selection vector.

Parameters:

  • selection Vector that will receive the selected nodes.

Implements SBGRenderNode::getNodes


function getNodes [2/4]#

Populates selection with this node if it has the render node typetype __

virtual void SBGRenderStructuralModel::getNodes (
    std::vector< SBGRenderNode * > & selection,
    SBGRenderNode::Type type
) override

Adds this render node to the selection vector if its type matches the specified type.

Parameters:

  • selection Vector that will receive the selected nodes.
  • type The render node type to match.

Implements SBGRenderNode::getNodes


function getNodes [3/4]#

Populates selection with this node based on theselectionRule __

virtual void SBGRenderStructuralModel::getNodes (
    std::vector< SBGRenderNode * > & selection,
    bool(*)( SBGRenderNode *) selectionRule
) override

Adds this render node to the selection vector if the provided selection rule returns true.

Parameters:

  • selection Vector that will receive the selected nodes.
  • selectionRule Function pointer that determines whether a node should be selected.

Implements SBGRenderNode::getNodes


function getNodes [4/4]#

Populates selection with this node based on thevisitRule andselectionRule __

virtual void SBGRenderStructuralModel::getNodes (
    std::vector< SBGRenderNode * > & selection,
    bool(*)( SBGRenderNode *) visitRule,
    bool(*)( SBGRenderNode *) selectionRule
) override

Visits this node using the provided visit rule and adds it to the selection if the selection rule also returns true.

Parameters:

  • selection Vector that will receive the selected nodes.
  • visitRule Function pointer invoked to visit the node.
  • selectionRule Function pointer that determines whether a node should be selected.

Implements SBGRenderNode::getNodes


function getType#

Returns SBGRenderNode::Type::StructuralModel .

virtual Type SBGRenderStructuralModel::getType () override const

Returns the render node type for this instance.

Returns:

The type identifier indicating a structural model render node.

Implements SBGRenderNode::getType


function onBaseEvent#

Handle structural model events.

void SBGRenderStructuralModel::onBaseEvent (
    SBBaseEvent * event
) 

Handles events emitted by the structural model.

Responds to changes such as selection, highlighting, index updates, node deletion, visibility changes, material updates, and transparency changes.

Parameters:

  • event Pointer to the event object describing the change.

function onStructuralEvent#

Handle structural events from structural models (moves, etc.)

void SBGRenderStructuralModel::onStructuralEvent (
    SBStructuralEvent * event
) 

Handles structural events from the structural model.

This function processes structural events such as additions, removals, or updates of atoms, bonds, residues, and other structural elements, updating the render model accordingly and requesting a viewport update when needed.

Parameters:

  • event Pointer to the structural event being processed.

function print#

Print debug information.

virtual void SBGRenderStructuralModel::print (
    unsigned int offset=0
) override const

Prints debugging information for this render structural model.

Parameters:

  • offset Number of indentation tabs to prepend to each line of output.

Implements SBGRenderNode::print


function setAtomRadius#

Sets the constant atom radius for rendering.

void SBGRenderStructuralModel::setAtomRadius (
    float atomRadius
) 

Sets the radius used for rendering atoms.

This setter updates the constant atom radius for rendering. If the radius changes, the internal atom radius data is refreshed.

Parameters:

  • r The new atom radius value.

function setAtomSizeProportionalToVdWRadius#

Sets the atom size proportional to atom van der Waals radius.

void SBGRenderStructuralModel::setAtomSizeProportionalToVdWRadius (
    float ratio
) 

Sets the ratio used to scale atom size relative to van der Waals radius.

This setter updates the scaling factor applied to atom radii when proportional rendering is active.

Parameters:

  • ratio The new scaling ratio.

function setBondMultipleDisplay#

Sets bond multiple display flag.

void SBGRenderStructuralModel::setBondMultipleDisplay (
    bool multipleDisplay
) 

Sets the multiple bond display flag.

This setter enables or disables the multiple display mode for bonds.

Parameters:

  • d The new state of the multiple bond display flag.

function setBondRadius#

Sets the bond radius for rendering.

void SBGRenderStructuralModel::setBondRadius (
    float bondRadius
) 

Sets the radius used for rendering bonds.

This setter updates the bond radius for rendering.

Parameters:

  • r The new bond radius value.

function setConstantAtomRadiusFlag#

Set true if atoms should be displayed with the same radius,false if atoms should be displayed with radii proportional to their van der Waals radii.

void SBGRenderStructuralModel::setConstantAtomRadiusFlag (
    bool flag
) 

Sets the flag controlling constant atom radius usage.

This setter enables or disables the use of a constant radius for all atoms.

Parameters:

  • flag true to use a constant radius; false to use proportional radii.

function setupFlagData#

Update the flags in the tree starting at root.

void SBGRenderStructuralModel::setupFlagData (
    SBNode * root
) 

Updates flag data for all nodes under the given root.

This function recomputes flag values for atoms, bonds, and hydrogen bonds based on their visibility, selection, highlighting, and frozen status. It propagates changes through the node hierarchy and updates internal flag arrays accordingly.

Parameters:

  • root Pointer to the root node for which flag data should be updated. If nullptr, the function returns immediately.

function ~SBGRenderStructuralModel#

Destructor.

virtual SBGRenderStructuralModel::~SBGRenderStructuralModel () 

Destroys the renderer and releases associated resources.

Disconnects from the structural model and deletes internal data.


Public Static Functions Documentation#

function selectAll#

Returns true __

static bool SBGRenderStructuralModel::selectAll (
    SBNode * node
) 

Determines whether the given node should be selected unconditionally.

Parameters:

  • node The node to test (unused).

Returns:

true for any node.


function selectHighlightedNodes#

Returns true if thenode is highlighted.

static bool SBGRenderStructuralModel::selectHighlightedNodes (
    SBNode * node
) 

Determines whether the given node is highlighted.

Parameters:

  • node The node to test.

Returns:

true if the node is highlighted, false otherwise.


function selectNodesByType#

Returns whether the node has the specified node typetype __

template<SBNode::Type type>
static inline bool SBGRenderStructuralModel::selectNodesByType (
    SBNode * node
) 


function selectSelectedNodes#

Returns true if thenode is selected.

static bool SBGRenderStructuralModel::selectSelectedNodes (
    SBNode * node
) 

Determines whether the given node is selected.

Parameters:

  • node The node to test.

Returns:

true if the node is selected, false otherwise.


function selectVisibleNodes#

Returns true if thenode is visible.

static bool SBGRenderStructuralModel::selectVisibleNodes (
    SBNode * node
) 

Determines whether the given node is visible.

Parameters:

  • node The node to test.

Returns:

true if the node is visible, false otherwise.


Protected Attributes Documentation#

variable dataPointer#

A pointer to the private data.

SBGRenderStructuralModelData* SBGRenderStructuralModel::dataPointer;


Protected Functions Documentation#

function addStructuralNodes [1/2]#

Add structural nodes to internal data structures.

void SBGRenderStructuralModel::addStructuralNodes () 

Adds pending structural nodes to the render model.

This function processes any nodes that have been queued for addition, integrates them into the render model, and clears the pending addition list.


function addStructuralNodes [2/2]#

Add structural nodes to internal data structures.

void SBGRenderStructuralModel::addStructuralNodes (
    SBNode * root
) 

Adds structural nodes to the renderer for the given root node.

Traverses the subtree rooted at root and adds visible atoms, bonds, and hydrogen bonds to the internal rendering data structures.

Parameters:

  • root The root node from which to start adding structural nodes.

function copyAtomData#

Copies atom data from a source index to a destination index.

void SBGRenderStructuralModel::copyAtomData (
    unsigned int & sourceIndex,
    unsigned int & destinationIndex
) 

Parameters:

  • sourceIndex The index of the atom data to copy from.
  • destinationIndex The index of the atom data to copy to.

function copyBondAtomData#

Copies bond atom data (positions, normal update flag, and colors) from a source index to a destination index.

void SBGRenderStructuralModel::copyBondAtomData (
    unsigned int & sourceIndex,
    unsigned int & destinationIndex
) 

Parameters:

  • sourceIndex The index of the bond atom data to copy from.
  • destinationIndex The index of the bond atom data to copy to.

function copyBondData#

Copies bond data (atom indices, order, flags, node index, and displacement) from a source index to a destination index.

void SBGRenderStructuralModel::copyBondData (
    unsigned int & sourceIndex,
    unsigned int & destinationIndex
) 

Parameters:

  • sourceIndex The index of the bond data to copy from.
  • destinationIndex The index of the bond data to copy to.

function copyHydrogenBondAtomData#

Copies hydrogen bond atom position data from a source index to a destination index.

void SBGRenderStructuralModel::copyHydrogenBondAtomData (
    unsigned int sourceIndex,
    unsigned int destinationIndex
) 

This function copies the 3‑dimensional position data of the hydrogen bond atom from the source index to the destination index in the internal data arrays.

Parameters:

  • sourceIndex Index of the source hydrogen bond atom data to copy.
  • destinationIndex Index of the destination where the data will be copied.

function copyHydrogenBondData#

Copies hydrogen bond data from a source index to a destination index.

void SBGRenderStructuralModel::copyHydrogenBondData (
    unsigned int sourceIndex,
    unsigned int destinationIndex
) 

This function copies the atom indices, color, order, flags, and node index information associated with a hydrogen bond from the source to the destination.

Parameters:

  • sourceIndex Index of the source hydrogen bond data to copy.
  • destinationIndex Index of the destination where the data will be copied.

function moveAtom#

Updates rendering data for an atom after it has moved.

void SBGRenderStructuralModel::moveAtom (
    SBAtom * atom
) 

This function updates the atom's position in the atom and bond atom arrays, marks the corresponding bond atom normal for update, updates neighboring bond atom normals and bond displacements, and updates hydrogen bond atom positions if applicable.

Parameters:

  • atom The atom that has moved.

function removeStructuralNodes [1/2]#

Remove structural nodes from internal data structures.

void SBGRenderStructuralModel::removeStructuralNodes () 

Removes structural nodes that were scheduled for removal.

This function processes the list of nodes marked for removal, removes them from the internal render data structures, and clears the removal list.


function removeStructuralNodes [2/2]#

Remove structural nodes from internal data structures.

void SBGRenderStructuralModel::removeStructuralNodes (
    SBNode * root
) 

Removes structural nodes starting from a specified root node.

This function removes atoms, bonds, and hydrogen bonds associated with the given root node from the render model's internal data structures.

Parameters:

  • root The root node from which removal of structural nodes begins.

function setupAtomData#

Initializes rendering data for an atom.

void SBGRenderStructuralModel::setupAtomData (
    SBAtom * atom,
    unsigned int & index
) 

This function fills the atom position, radius, color, and node index arrays at the specified index. The radius may be constant or scaled based on the atom's van der Waals radius, and the color is obtained from the atom's material color scheme if available, otherwise from its default color.

Parameters:

  • atom The atom for which to set up data.
  • atomPointerIndex Reference to the index in the rendering arrays where the data will be stored.

function setupBondAtomData#

Initializes rendering data for a bond atom.

void SBGRenderStructuralModel::setupBondAtomData (
    SBAtom * atom,
    unsigned int & index
) 

This function stores the position and color of the atom in the bond atom arrays at the given index and marks the normal data for update.

Parameters:

  • atom The atom that is part of a bond.
  • atomPointerIndex Reference to the index in the bond atom arrays where the data will be stored.

function setupBondData#

Initializes bond data for the specified bond.

void SBGRenderStructuralModel::setupBondData (
    SBBond * bond,
    unsigned int & index
) 

Parameters:

  • bond The bond to set up.
  • bondPointerIndex The index of the bond within the internal bond data arrays.

function setupBondDisplacementData#

Stores the displacement vector for a bond if its order exceeds the threshold.

void SBGRenderStructuralModel::setupBondDisplacementData (
    SBBond * bond,
    unsigned int & index
) 

Parameters:

  • bond The bond whose displacement is stored.
  • bondPointerIndex The index of the bond within the displacement data array.

function setupHydrogenBondAtomData#

Stores the position of a hydrogen bond atom.

void SBGRenderStructuralModel::setupHydrogenBondAtomData (
    SBAtom * atom,
    unsigned int index
) 

Parameters:

  • atom The atom whose position is stored.
  • atomPointerIndex The index of the atom within the hydrogen bond atom position array.

function setupHydrogenBondColorData#

Stores the RGBA color for a hydrogen bond.

void SBGRenderStructuralModel::setupHydrogenBondColorData (
    SBHydrogenBond * hydrogenBond,
    unsigned int index
) 

Parameters:

  • hydrogenBond The hydrogen bond whose color is stored.
  • hydrogenBondPointerIndex The index of the hydrogen bond within the color data array.

function setupHydrogenBondData#

Initializes hydrogen bond data, including atom indices and node index.

void SBGRenderStructuralModel::setupHydrogenBondData (
    SBHydrogenBond * hydrogenBond,
    unsigned int index
) 

Parameters:

  • hydrogenBond The hydrogen bond to set up.
  • hydrogenBondPointerIndex The index of the hydrogen bond within the internal data arrays.

function setupHydrogenBondOrderData#

Stores the order value for a hydrogen bond.

void SBGRenderStructuralModel::setupHydrogenBondOrderData (
    SBHydrogenBond * hydrogenBond,
    unsigned int index
) 

Parameters:

  • hydrogenBond The hydrogen bond whose order is stored.
  • hydrogenBondPointerIndex The index of the hydrogen bond within the order data array.

function setupMaterials#

Sets up rendering materials for all visible nodes under the given root.

void SBGRenderStructuralModel::setupMaterials (
    SBNode * root
) 

This function updates material data for atoms, bonds, and hydrogen bonds. It ensures that visible nodes have their rendering attributes such as colors and other material properties configured correctly based on the current model state.

Parameters:

  • root Pointer to the root node from which material setup begins. If nullptr, the function returns immediately.

function updateAtomRadiusData [1/2]#

Updates the radius information for all atoms in the model.

void SBGRenderStructuralModel::updateAtomRadiusData () 

This function refreshes the stored radius values for every atom based on the current rendering settings.


function updateAtomRadiusData [2/2]#

Updates the radius information for a specific atom.

void SBGRenderStructuralModel::updateAtomRadiusData (
    SBAtom * atom
) 

This function recomputes and stores the radius value for the given atom according to the current rendering configuration.

Parameters:

  • atom Pointer to the atom whose radius data should be updated.

function updateHydrogenBondOrderData#

Updates the order data for all hydrogen bonds.

void SBGRenderStructuralModel::updateHydrogenBondOrderData () 

This function recomputes the order values for each hydrogen bond and updates the internal data arrays.


function updateHydrogenBonds#

Updates hydrogen bond data and ensures hydrogen bond groups are refreshed if needed.

void SBGRenderStructuralModel::updateHydrogenBonds () 

This function processes hydrogen bond groups, triggers updates on groups that require it, and refreshes order data.


function updateStructuralNodes#

Display attributes.

void SBGRenderStructuralModel::updateStructuralNodes () 

Updates the internal representation of structural nodes.

This function refreshes the render model by updating hydrogen bonds, adding new structural nodes, and removing obsolete ones to keep the rendered view synchronized with the underlying structural model.