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#
| 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#
| 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#
| 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 .
Constructs a renderer for the given structural model.
Initializes internal data structures and connects the renderer to the provided structural model.
Parameters:
modelPointer 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:
boxOriginThe origin of the bounding box.boxSizeThe size of the bounding box.nCellsXNumber of cells along the X axis.nCellsYNumber of cells along the Y axis.nCellsZNumber of cells along the Z axis.ambientOcclusionDataArray that receives the computed occlusion values.
function connectToStructuralModel#
Connect the render model to the structural model.
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.
Disconnects the render model from its associated structural model.
Unregisters callbacks and clears the render node reference.
function display#
Display the node.
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:
renderingPassThe rendering pass indicating which geometry to render.
Implements SBGRenderNode::display
function expandBounds#
Expands the bounds to make sure the structural model fits inside them.
Expands the bounds to ensure the structural model fits within them.
Parameters:
boundsThe 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:
actionFunction 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:
objectThe object whose member function will be called.actionPointer to the member function to invoke.
Implements SBGRenderNode::forEachNodeDepthFirst
function getAtomColorData#
Return the atom color data.
Provides access to the atom color data array.
Returns:
Pointer to the array of atom color data.
function getAtomFlagData#
Return the atom flag data.
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.
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.
Retrieves the indexer for atoms currently displayed.
Returns:
Pointer to the atom pointer indexer.
function getAtomPositionData#
Return the atom position data.
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.
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.
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.
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.
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.
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.
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.
Provides access to the bond displacement data array.
Returns:
Pointer to the array of bond displacement data.
function getBondFlagData#
Return the bond flag data.
Provides access to the bond flag data array.
Returns:
Pointer to the array of bond flag data.
function getBondMultipleDisplay#
Returns bond multiple display flag.
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.
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.
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.
Retrieves the indexer for bonds currently displayed.
Returns:
Pointer to the bond pointer indexer.
function getBondRadius#
Returns the bond radius for rendering.
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.
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.
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.
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.
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.
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.
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.
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.
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:
selectionVector 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:
selectionVector that will receive the selected nodes.typeThe 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:
selectionVector that will receive the selected nodes.selectionRuleFunction 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:
selectionVector that will receive the selected nodes.visitRuleFunction pointer invoked to visit the node.selectionRuleFunction pointer that determines whether a node should be selected.
Implements SBGRenderNode::getNodes
function getType#
Returns SBGRenderNode::Type::StructuralModel .
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.
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:
eventPointer to the event object describing the change.
function onStructuralEvent#
Handle structural events from structural models (moves, etc.)
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:
eventPointer to the structural event being processed.
function print#
Print debug information.
Prints debugging information for this render structural model.
Parameters:
offsetNumber of indentation tabs to prepend to each line of output.
Implements SBGRenderNode::print
function setAtomRadius#
Sets the constant atom radius for rendering.
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:
rThe new atom radius value.
function setAtomSizeProportionalToVdWRadius#
Sets the atom size proportional to atom van der Waals radius.
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:
ratioThe new scaling ratio.
function setBondMultipleDisplay#
Sets bond multiple display flag.
Sets the multiple bond display flag.
This setter enables or disables the multiple display mode for bonds.
Parameters:
dThe new state of the multiple bond display flag.
function setBondRadius#
Sets the bond radius for rendering.
Sets the radius used for rendering bonds.
This setter updates the bond radius for rendering.
Parameters:
rThe 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.
Sets the flag controlling constant atom radius usage.
This setter enables or disables the use of a constant radius for all atoms.
Parameters:
flagtrueto use a constant radius;falseto use proportional radii.
function setupFlagData#
Update the flags in the tree starting at 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:
rootPointer to the root node for which flag data should be updated. If nullptr, the function returns immediately.
function ~SBGRenderStructuralModel#
Destructor.
Destroys the renderer and releases associated resources.
Disconnects from the structural model and deletes internal data.
Public Static Functions Documentation#
function selectAll#
Returns true __
Determines whether the given node should be selected unconditionally.
Parameters:
nodeThe node to test (unused).
Returns:
true for any node.
function selectHighlightedNodes#
Returns true if thenode is highlighted.
Determines whether the given node is highlighted.
Parameters:
nodeThe 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.
Determines whether the given node is selected.
Parameters:
nodeThe node to test.
Returns:
true if the node is selected, false otherwise.
function selectVisibleNodes#
Returns true if thenode is visible.
Determines whether the given node is visible.
Parameters:
nodeThe node to test.
Returns:
true if the node is visible, false otherwise.
Protected Attributes Documentation#
variable dataPointer#
A pointer to the private data.
Protected Functions Documentation#
function addStructuralNodes [1/2]#
Add structural nodes to internal data structures.
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.
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:
rootThe 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:
sourceIndexThe index of the atom data to copy from.destinationIndexThe 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:
sourceIndexThe index of the bond atom data to copy from.destinationIndexThe 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:
sourceIndexThe index of the bond data to copy from.destinationIndexThe 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:
sourceIndexIndex of the source hydrogen bond atom data to copy.destinationIndexIndex 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:
sourceIndexIndex of the source hydrogen bond data to copy.destinationIndexIndex of the destination where the data will be copied.
function moveAtom#
Updates rendering data for an atom after it has moved.
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:
atomThe atom that has moved.
function removeStructuralNodes [1/2]#
Remove structural nodes from internal data structures.
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.
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:
rootThe root node from which removal of structural nodes begins.
function setupAtomData#
Initializes rendering data for an atom.
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:
atomThe atom for which to set up data.atomPointerIndexReference to the index in the rendering arrays where the data will be stored.
function setupBondAtomData#
Initializes rendering data for a bond atom.
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:
atomThe atom that is part of a bond.atomPointerIndexReference to the index in the bond atom arrays where the data will be stored.
function setupBondData#
Initializes bond data for the specified bond.
Parameters:
bondThe bond to set up.bondPointerIndexThe 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.
Parameters:
bondThe bond whose displacement is stored.bondPointerIndexThe index of the bond within the displacement data array.
function setupHydrogenBondAtomData#
Stores the position of a hydrogen bond atom.
Parameters:
atomThe atom whose position is stored.atomPointerIndexThe 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:
hydrogenBondThe hydrogen bond whose color is stored.hydrogenBondPointerIndexThe 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:
hydrogenBondThe hydrogen bond to set up.hydrogenBondPointerIndexThe 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:
hydrogenBondThe hydrogen bond whose order is stored.hydrogenBondPointerIndexThe index of the hydrogen bond within the order data array.
function setupMaterials#
Sets up rendering materials for all visible nodes under the given 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:
rootPointer 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.
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.
This function recomputes and stores the radius value for the given atom according to the current rendering configuration.
Parameters:
atomPointer to the atom whose radius data should be updated.
function updateHydrogenBondOrderData#
Updates the order data for all hydrogen bonds.
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.
This function processes hydrogen bond groups, triggers updates on groups that require it, and refreshes order data.
function updateStructuralNodes#
Display attributes.
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.