Class SBGRenderFragment#
The class SBGRenderFragment can be used to render fragments, i.e.More...
#include <SBGRenderFragment.hpp>
Inherits the following classes: SBGRenderStructuralModel
Public Types inherited from SBGRenderNode#
See SBGRenderNode
| Type | Name |
|---|---|
| enum | Type Available render node types. |
Public Functions#
| Type | Name |
|---|---|
| SBGRenderFragment (const SBNodeIndexer & nodeIndexer) Builds a render fragment based on the given node indexer nodeIndexer . |
|
| virtual void | display (SBNode::RenderingPass renderingPass, const SBSpatialTransform & transform=SBSpatialTransform::identity, const SBColor & diffuseColor=SBColor::black, float diffuseColorReplacement=0.0f, float opacity=1.0f, unsigned int flagModifier=0, unsigned int nodeIndexModifier=0) Displays the visual model. |
| virtual | ~SBGRenderFragment () Destructor. |
Public Functions inherited from SBGRenderStructuralModel#
| 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 inherited from SBGRenderStructuralModel#
| 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 inherited from SBGRenderStructuralModel#
| 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 (SBNode * root) Add structural nodes to internal data structures. |
| void | onBaseEvent (SBBaseEvent * event) Handles base events. |
Protected Functions inherited from SBGRenderStructuralModel#
| 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. |
Detailed Description#
a collection of nodes. It can be used to display fragments without adding them into the data graph in the dedicated display functions of editors and visual models by calling the fragment's display function.
Public Functions Documentation#
function SBGRenderFragment#
Builds a render fragment based on the given node indexer nodeIndexer .
Constructs a render fragment using the specified node indexer.
The fragment is initialized with the nodes provided by nodeIndexer. The fragment's internal data structures are prepared for rendering.
Parameters:
nodeIndexerThe indexer containing the nodes to be included in the fragment.
function display#
Displays the visual model.
virtual void SBGRenderFragment::display (
SBNode::RenderingPass renderingPass,
const SBSpatialTransform & transform=SBSpatialTransform::identity,
const SBColor & diffuseColor=SBColor::black,
float diffuseColorReplacement=0.0f,
float opacity=1.0f,
unsigned int flagModifier=0,
unsigned int nodeIndexModifier=0
)
Renders the fragment for the specified rendering pass.
This function displays the visual representation of the fragment, applying the provided spatial transform, diffuse color, opacity, and any flag or node index modifications.
Parameters:
renderingPassThe rendering pass for which the fragment should be displayed (e.g., opaque geometry, transparent geometry, etc.).transformThe spatial transform to apply to the fragment's geometry. Defaults to the identity transform.diffuseColorThe base diffuse color to use for rendering the fragment. Defaults to black.diffuseColorReplacementA factor determining how much to replace the diffuse color. Defaults to 0.0f.opacityThe opacity factor for rendering (1.0 for fully opaque). Defaults to 1.0f.flagModifierAdditional flag bits to modify rendering behavior. Defaults to 0.nodeIndexModifierAn offset added to node indices during selection rendering. Defaults to 0.
function ~SBGRenderFragment#
Destructor.
Destroys the render fragment and releases associated resources.
Disconnects event signals from atoms and bonds and cleans up any internal data.
Protected Functions Documentation#
function addStructuralNodes#
Add structural nodes to internal data structures.
Adds structural nodes from the given root node to the fragment.
The function collects atoms and bonds under root, updates the fragment's internal indices, and connects event handling signals.
Parameters:
rootThe root node from which to retrieve structural nodes.
function onBaseEvent#
Handles base events.
Handles base events for the fragment.
This function processes events such as index changes or transparency changes that affect the fragment and triggers appropriate viewport updates.
Parameters:
eventThe base event to handle.