Class SBDDataGraphNode#
This class is the base class to describe a node in the data graph. More...
#include <SBDDataGraphNode.hpp>
Inherits the following classes: SBCReferenceTarget
Inherited by the following classes: SBDAsset, SBDController, SBDControllerNode, SBDDataGraphNodeGroup, SBDDocumentAnimation, SBDDocumentCamera, SBDDocumentFile, SBDDocumentFolder, SBDDocumentLabel, SBDDocumentLight, SBDDocumentNote, SBDDocumentPresentation, SBDDocumentRenderPreset, SBMModel, SBMModelNode, SBMStructuralModelConformation, SBMStructuralModelPath, SBSSimulator, SBSStateUpdater
Classes#
| Type | Name |
|---|---|
| class | DescendsFrom This node predicate returns true if the node descends from a given node or node indexer |
| class | IsIn This node predicate returns true if the node descends from a given node or node indexer, or if the node belongs to a group stored in the given node or node indexer |
| class | IsOneOf This node predicate returns true for nodes in a given node indexer |
Public Types#
| Type | Name |
|---|---|
| enum | RenderingPass The rendering pass. |
| enum | Type The type of the data graph node. |
Public Functions#
| Type | Name |
|---|---|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, SBCClassProxy *, GetProxy) |
|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, SBDDataGraphNode *, This) |
|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, SBDDataGraphNode *, GetParent) |
|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, SBDDataGraphNode *, GetThis) |
|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, SBDDataGraphNode *, GetNextNode) |
|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, SBDDataGraphNode *, GetPreviousNode) |
|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, SBDDocument *, GetDocument) |
|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, SBDDataGraphNode *, GetRoot) |
|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, unsigned int, GetNodeIndex) |
|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, SBDDataGraphNode::Type, GetType) |
|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, bool, GetSelectionFlag) |
|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, bool, GetLockedFlag) |
|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, bool, GetVisibilityFlag) |
|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, bool, GetHighlightingFlag) |
|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, unsigned int, GetFlags) |
|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, std::string, GetName) |
|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, std::string, GetClass) |
|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, std::string, GetElement) |
|
| SB_NODE_GETTER_0 (SB_SBDDATAGRAPH_EXPORT, SBCContainerUUID, GetElementUUID) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, All) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, None) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsModel) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsAtom) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsBond) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsStructuralNode) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsStructuralModel) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsVisualModel) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsMesh) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsLight) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsInteractionModel) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsDynamicalModel) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsPropertyModel) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsSimulator) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsBallAndStick) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsLicorice) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsVanDerWaals) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsCartoon) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsRibbon) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsTube) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsGaussianSurface) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsSolventAccessibleSurface) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsSolventExcludedSurface) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, HasMaterial) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, OwnsMaterial) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsLocked) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsSerializable) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsCreated) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsErased) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsSelected) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsVisible) |
|
| SB_NODE_PREDICATE_0 (SB_SBDDATAGRAPH_EXPORT, IsHighlighted) |
|
| SB_NODE_PREDICATE_1 (SB_SBDDATAGRAPH_EXPORT, IsType, SBDDataGraphNode::Type) |
|
| SB_NODE_PREDICATE_1 (SB_SBDDATAGRAPH_EXPORT, HasOneOf, SBNodeIndexer) |
|
| virtual bool | addChild (SBDDataGraphNode * node, SBDDataGraphNode * nextNode=nullptr) Adds a child to the node. |
| bool | addMaterial (SBDDataGraphNodeMaterial * material) Adds a material. |
| bool | baseSignalIsConnectedToSlot (SBCReferenceTarget * referenceTarget, void(SBCReferenceTarget::*)(SBBaseEvent *) functionPointer) const Returns true when the base signal is connected to a slot. |
| virtual bool | canAddChild (const SBDDataGraphNode * node, const SBDDataGraphNode * nextNode=nullptr) const Returns whether this node can add node as a child. |
| virtual bool | canAddChildType (SBDDataGraphNode::Type nodeType) const Returns whether this node can add a node with type nodeType as a child. |
| bool | canAddMaterial () const Returns whether can add a material to the node based on its type. |
| virtual bool | canHaveDescendantType (SBDDataGraphNode::Type nodeType) const Returns whether this node can have a node with type nodeType as a descendant. |
| virtual SBDDataGraphNode * | clone () Returns a copy of the node and its descendants. |
| void | connectBaseSignalToSlot (SBCReferenceTarget * referenceTarget, void(SBCReferenceTarget::*)(SBBaseEvent *) functionPointer, SBCReferenceTarget * nextReferenceTarget=0, void(SBCReferenceTarget::*)(SBBaseEvent *) nextFunctionPointer=0) Connects the base signal to a slot. |
| unsigned int | countNodes (SBDDataGraphNode::Type nodeType, bool selectedNodesOnly=false, const SBNodePredicate & visitPredicate=SBDDataGraphNode::All(), bool includeDependencies=false) const Counts nodes based on a nodeType , a selection status and avisitPredicate , with or without dependencies. |
| unsigned int | countNodes (const SBNodePredicate & selectionPredicate=SBDDataGraphNode::All(), const SBNodePredicate & visitPredicate=SBDDataGraphNode::All(), bool includeDependencies=false) const Counts nodes based on a selectionPredicate and avisitPredicate , with or without dependencies. |
| void | create () Creates the node. |
| bool | descendsFrom (const SBDDataGraphNode * node) const Returns true if and only if this node isnode , or descends from it. |
| bool | descendsFrom (const SBNodeIndexer & nodeIndexer) const Returns true if and only if this node is one of the nodes of thenodeIndexer , or descends from one of them. |
| bool | descendsFrom (SBPointerIndexer< SBDDataGraphNode > * nodePointerIndexer) const Returns true if and only if this node is one of the nodes of thenodePointerIndexer , or descends from one of them. |
| void | disconnectBaseSignalFromSlot (SBCReferenceTarget * referenceTarget, void(SBCReferenceTarget::*)(SBBaseEvent *) functionPointer) Disconnects the base signal from a slot. |
| virtual void | display (RenderingPass renderingPass) Displays the node. |
| virtual void | display () Displays the node (deprecated) |
| virtual void | displayForSelection () Displays the node for selection purposes (deprecated) |
| virtual void | displayForShadow () Displays the node for shadowing purposes (deprecated) |
| void | erase () Erases the node. |
| virtual void | forEachNodeDepthFirst (void(*)(SBDDataGraphNode *node) action) Performs the action on this node. |
| virtual void | forEachNodeDepthFirst (SBCClass * object, void(SBCClass::*)(SBDDataGraphNode *node) action) Performs the objects 'saction on this node. |
| unsigned int | getDefaultOpacity () const Returns the default opacity. |
| unsigned int | getDefaultTransparency () const Returns the default transparency. |
| SBDDocument * | getDocument () const Returns the document the node belongs to. |
| virtual unsigned int | getFlags () const Returns the flags. |
| virtual std::string | getHierarchyString (const std::string & separator=" / ", bool includeNodeType=false) const Returns a string with hierarchical information on the node and its parents names. |
| bool | getHighlightingFlag () const Returns the highlighting flag. |
| virtual unsigned int | getInheritedFlags () const Returns the inherited flags. |
| float | getInheritedOpacity () const Returns the cumulative opacity, when taking into account the ascendants. |
| float | getInheritedTransparency () const Returns the cumulative transparency, when taking into account the ascendants. |
| virtual bool | getLockedFlag () const Returns the locked flag. |
| SBDDataGraphNodeMaterial * | getMaterial () const Returns the material. |
| SBDDataGraphNode * | getMaterialOwner () const Returns the node whose material is inherited. |
| unsigned int | getMaximumOpacity () const Returns the maximum opacity. |
| unsigned int | getMaximumTransparency () const Returns the maximum transparency. |
| unsigned int | getMinimumOpacity () const Returns the minimum opacity. |
| unsigned int | getMinimumTransparency () const Returns the minimum transparency. |
| virtual SBQuantity::mass | getMolecularWeight () Returns the molecular weight. |
| virtual std::string const & | getName () const Returns the name of the node. |
| SBDDataGraphNode * | getNextNode () const Returns the pointer to the next node in the children of the node's parent. |
| SBDDataGraphNode * | getNextNode (SBDDataGraphNode::Type nodeType) const Returns the pointer to the next node with type nodeType in the children of the node's parent. |
| unsigned int | getNodeIndex () const Returns the node index (unique in the whole data graph, but non-persistent) |
| SBUUID | getNodeUUID () const Returns the node UUID. |
| virtual void | getNodes (SBNodeIndexer & nodeIndexer, SBDDataGraphNode::Type nodeType, bool selectedNodesOnly=false, const SBNodePredicate & visitPredicate=SBDDataGraphNode::All(), bool includeDependencies=false) const Collects nodes into nodeIndexer , based on anodeType , a selection status and avisitPredicate , with or without dependencies. |
| virtual void | getNodes (SBNodeIndexer & nodeIndexer, const SBNodePredicate & selectionPredicate=SBDDataGraphNode::All(), const SBNodePredicate & visitPredicate=SBDDataGraphNode::All(), bool includeDependencies=false) const Collects nodes into nodeIndexer , based on aselectionPredicate and avisitPredicate , with or without dependencies. |
| virtual unsigned int | getNumberOfAtoms () Returns the number of atoms. |
| virtual unsigned int | getNumberOfCarbons () Returns the number of carbons. |
| virtual unsigned int | getNumberOfChains () Returns the number of chains. |
| virtual unsigned int | getNumberOfCoarseGrainedAtoms () Returns the number of coarse-grained atoms. |
| virtual unsigned int | getNumberOfHydrogens () Returns the number of hydrogens. |
| virtual unsigned int | getNumberOfMolecules () Returns the number of molecules. |
| virtual unsigned int | getNumberOfNitrogens () Returns the number of nitrogens. |
| virtual unsigned int | getNumberOfOtherAtoms () Returns the number of other atoms. |
| virtual unsigned int | getNumberOfOxygens () Returns the number of oxygens. |
| virtual unsigned int | getNumberOfResidues () Returns the number of residues. |
| virtual unsigned int | getNumberOfSegments () Returns the number of segments. |
| virtual unsigned int | getNumberOfStructuralGroups () Returns the number of structural groups. |
| virtual unsigned int | getNumberOfStructuralModels () Returns the number of structural models. |
| virtual unsigned int | getNumberOfSulfurs () Returns the number of sulfurs. |
| virtual unsigned int | getOpacity () const Returns the opacity. |
| unsigned int | getOpacitySingleStep () const Returns the opacity single step. |
| std::string | getOpacitySuffix () const Returns the opacity suffix. |
| SBDDataGraphNode * | getParent () const Returns the parent of the node. |
| SBDDataGraphNode * | getPreviousNode () const Returns the pointer to the previous node in the children of the node's parent. |
| SBDDataGraphNode * | getPreviousNode (SBDDataGraphNode::Type nodeType) const Returns the pointer to the previous node with type nodeType in the children of the node's parent. |
| SBDDataGraphNode * | getRoot () const Returns the root of the hierarchy the node belongs to. |
| bool | getSelected () const Returns whether the node is selected. |
| bool | getSelectionFlag () const Returns the selection flag. |
| virtual int | getSumOfFormalCharges () Returns the sum of formal charges. |
| virtual float | getSumOfPartialCharges () Returns the sum of partial charges. |
| SBDDataGraphNode * | getThisNode () const Returns the pointer to this node. |
| virtual unsigned int | getTransparency () const Returns the transparency. |
| unsigned int | getTransparencySingleStep () const Returns the transparency single step. |
| std::string | getTransparencySuffix () const Returns the transparency suffix. |
| virtual Type | getType () const Returns the type of the data graph node. |
| std::string | getTypeString (bool humanReadable=false) const Returns a string describing the type of the data graph node. |
| bool | getVisibilityFlag () const Returns the visibility flag. |
| bool | getVisible () const Returns whether the node is visible. |
| bool | hasMaterial () const Returns whether the node has a material (by itself, or inherited) |
| virtual bool | hasNode (SBDDataGraphNode::Type nodeType, bool selectedNodesOnly=false, const SBNodePredicate & visitPredicate=SBDDataGraphNode::All(), bool includeDependencies=false) const Returns whether the node has nodes based on a nodeType , a selection status and avisitPredicate , with or without dependencies. |
| virtual bool | hasNode (const SBNodePredicate & selectionPredicate=SBDDataGraphNode::All(), const SBNodePredicate & visitPredicate=SBDDataGraphNode::All(), bool includeDependencies=false) const Returns whether the node has nodes based on a selectionPredicate and avisitPredicate , with or without dependencies. |
| bool | hasOneOf (const SBNodeIndexer & nodeIndexer) const Returns true if and only if this node is one of the nodes of thenodeIndexer , or is the ancestor of one of them, or is a group that stores one of them. |
| bool | hasOpacityRange () const Returns whether the node has the opacity range. |
| bool | hasTransparencyRange () const Returns whether the node has the transparency range. |
| bool | isAtom () const Returns true when the node is an atom. |
| bool | isBallAndStick () const Returns true when the node is the default ball-and-stick visual model. |
| bool | isBond () const Returns true when the node is a bond. |
| bool | isCartoon () const Returns true when the node is the default cartoon visual model. |
| bool | isCreated () const Returns true if and only if the node is created. |
| bool | isDynamicalModel () const Returns true when the node is a dynamical model. |
| bool | isErased () const Returns true if and only if the node is erased. |
| bool | isGaussianSurface () const Returns true when the node is the default Gaussian surface visual model. |
| bool | isHighlighted () const Returns whether the node is highlighted. |
| bool | isIn (const SBDDataGraphNode * node) const Returns true if and only if this node isnode , or descends from it, or belongs to a group stored innode . |
| bool | isIn (const SBNodeIndexer & nodeIndexer) const Returns true if and only if this node is one of the nodes of thenodeIndexer , or descends from one of them, or belongs to a group stored in one of the nodes of thenodeIndexer . |
| bool | isIn (SBPointerIndexer< SBDDataGraphNode > * nodePointerIndexer) const Returns true if and only if this node is one of the nodes of thenodePointerIndexer , or descends from one of them, or belongs to a group stored in of the nodes of thenodePointerIndexer . |
| bool | isInteractionModel () const Returns true when the node is a interaction model. |
| bool | isLicorice () const Returns true when the node is the default licorice visual model. |
| bool | isLight () const Returns true when the node is a light. |
| virtual bool | isLocked () const Returns whether the node is locked. |
| bool | isMesh () const Returns true when the node is a mesh. |
| bool | isModel () const Returns true when the node is a model. |
| bool | isOneOf (const SBNodeIndexer & nodeIndexer) const Returns true if and only if this node is one of the nodes of thenodeIndexer . |
| bool | isOneOf (SBPointerIndexer< SBDDataGraphNode > * nodePointerIndexer) const Returns true if and only if this node is one of the nodes of thenodePointerIndexer . |
| bool | isPropertyModel () const Returns true when the node is a property model. |
| bool | isRibbon () const Returns true when the node is the default ribbon visual model. |
| bool | isSelected () const Returns whether the node is selected. |
| virtual bool | isSerializable () const Returns true when the class is serializable. |
| bool | isSimulator () const Returns true when the node is a simulator. |
| bool | isSolventAccessibleSurface () const Returns true when the node is the default solvent accessible surface visual model. |
| bool | isSolventExcludedSurface () const Returns true when the node is the default solvent excluded surface visual model. |
| bool | isStructuralModel () const Returns true when the node is a structural model. |
| bool | isStructuralNode () const Returns true when the node is a structural node. |
| bool | isTube () const Returns true when the node is the default tube visual model. |
| bool | isType (Type type) const Returns true when the type of the node corresponds totype . |
| bool | isVanDerWaals () const Returns true when the node is the default van der Waals visual model. |
| bool | isVisible () const Returns whether the node is visible. |
| bool | isVisualModel () const Returns true when the node is a visual model. |
| bool | ownsMaterial () const Returns whether the node owns a material. |
| virtual void | print (unsigned int offset=0) const Prints some debugging information. |
| virtual bool | removeChild (SBDDataGraphNode * node) Removes a child from the node. |
| bool | removeMaterial () Removes the material. |
| void | removeMaterialsFromDescendants () Removes materials from all nodes that descend from this node, but it does not remove the material from the node itself. |
| virtual void | serialize (SBCSerializer * serializer, const SBNodeIndexer & nodeIndexer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0)) const Serializes the node. |
| void | setHighlightingFlag (bool flag) Sets the highlighting flag. |
| virtual void | setLockedFlag (bool flag) Sets the locked flag. |
| virtual void | setName (const std::string & name) Sets the name of the node. |
| virtual void | setOpacity (unsigned int opacity) Sets the opacity. |
| void | setSelectionFlag (bool flag) Sets the selection flag. |
| virtual void | setTransparency (unsigned int transparency) Sets the transparency. |
| void | setVisibilityFlag (bool flag) Sets the visibility flag. |
| virtual void | unserialize (SBCSerializer * serializer, const SBNodeIndexer & nodeIndexer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0)) Unserializes the node. |
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 | canAddMaterial (SBDDataGraphNode::Type nodeType) Returns whether can add a material to a node of type nodeType . |
| void | clone (const SBNodeIndexer & sourceNodeIndexer, SBNodeIndexer & destinationNodeIndexer) Clones the nodes in sourceNodeIndexer (treated as a whole) and places the clones indestinationNodeIndexer . |
| void | forEachNodeInSelection (SBNodeIndexer & nodeIndexer, void(*)(SBDDataGraphNode *node) action) Performs the action for each node innodeIndexer __ |
| void | forEachNodeInSelection (SBNodeIndexer & nodeIndexer, SBCClass * object, void(SBCClass::*)(SBDDataGraphNode *node) action) Performs the objects 'saction for each node innodeIndexer __ |
| SBDDataGraphNode * | getNode (unsigned int nodeIndex) Returns the unique node corresponding to the node index nodeIndex . |
| std::string | getTypeString (Type type, bool humanReadable=false) Returns a string describing the type of the data graph node. |
Protected Attributes inherited from SBCReferenceTarget#
| Type | Name |
|---|---|
| SBCReferenceTargetData * | dataPointer A pointer to the private data. |
Protected Functions#
| Type | Name |
|---|---|
| SBDDataGraphNode () Builds a data graph node. |
|
| SBDDataGraphNode (SBDDataGraphNodeData * dataPointer) Builds a data graph node. |
|
| virtual | ~SBDDataGraphNode () Destroys the node. |
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#
The data graph contains everything directly or indirectly added by the user through SAMSON's user interface, plugins, etc.
A data graph node has basic pre-defined data and functionalities to manage the data (models, apps, etc.).
All nodes in SAMSON's data graph, e.g. atoms (SBAtom), bonds (SBBond), etc., derive from SBDDataGraphNode. The figure below shows the document view, which is a view of SAMSON's data graph structure.
Short name: SBNode

Topology#
SAMSON's data graph is a directed graph, where each node has one and only one parent (with the exception of documents, which have no parent), and possibly some children. The parent of a node can never be directly set, but can be retrieved using the getParent function. Children are managed using the addChild and removeChild functions.
Node lifecycle#
In SAMSON, a data graph node may go through four lifecycle stages:
- C++ object creation (e.g. with a
newoperator) - Node creation (using the create function)
- Node destruction (using the erase function)
- C++ object destruction (usually automatically, or forced with a call to deleteReferenceTarget)
As reference targets, data graph nodes should not be destructed using the delete operator, because objects that are referencing them need to stop doing so before the node is deleted. Thus, when a node needs to be deleted (in the C++ sense), a SAMSON pointer (see References) must be used:
SBPointer<SBAtom> nodePointer = new SBAtom();
// ...
// remove all references to the atom, and delete it
nodePointer.deleteReferenceTarget();
See also: References, MemoryManagement
Node identity#
Each node in the data graph has a type, which may be retrieved using the getType function. For example, the type returned by the SBAtom class, which derives from the SBDDataGraphNode class, is SBNode::Atom, while the type returned by the SBStructuralModel class is SBNode::StructuralModel. The getTypeString function is a convenience function that may be used to obtain a type as a string.
Types may be used, for example, to rapidly search the data graph:
// Find all atoms
SBNodeIndexer nodeIndexer;
SAMSON::getActiveDocument()->getNodes(nodeIndexer, SBNode::Atom);
Each data graph node also has a unique index, that is managed internally by SAMSON. All indices are contiguous unsigned integers between 0 and n-1, where n is the number of data graph nodes. As a result, the node index is not permanent: when node i is deleted (and i is different from n-1), then node n-1 becomes node i. Node indices are used for example when picking objects in a viewport, by writing integers into the framebuffer instead of colors. The unique node index can be retrieved using getNodeIndex.
See also: getType, getTypeString, getNodeIndex
Flags#
Each data graph node has four flags:
- The created flag indicates whether the node is created or not (see Node lifecycle)
- The visibility flag indicates whether the renderer should display the node in the viewport
- The highlighting indicates whether the renderer should highlight the node in the viewport
- The selection flag indicates whether the node is selected or not
These flags are accessed through functions of SBDDataGraphNode and, except for the highlighting flag which has temporary purposes, changing these flags' values is undoable .
The getFlags function returns an unsigned int that combines the highlighting and selection flags.
See also: isCreated, getVisibilityFlag, getHighlightingFlag, getSelectionFlag
Materials and color schemes#
Each data graph node may have a material, which may affect its rendering in the viewport. A material may be applied to a node with the addMaterial function. When a material is added to a node, it affects the node itself and all its descendants (unless they have a material themselves, which then has priority). Precisely, the getMaterial function returns the material directly applied to the node (if the addMaterial function was called), or determines the deepest ancestor that has a material applied (by examining the node's parent, then its parent's parent, etc.). If no material is found, the getMaterial function returns 0.
Each material has a color scheme which may be modified and used to associate a color to a node or a spatial position.
See also: Materials, Color schemes
See also: getMaterial, addMaterial, removeMaterial
Node predicates#
The SBDDataGraphNode class defines a series of node predicates, i.e. functors that may be used to e.g. collect nodes in the data graph. For example, the SBNode::IsType predicate may be used to collect nodes by type:
// Find all atoms
SBNodeIndexer nodeIndexer;
SAMSON::getActiveDocument()->getNodes(nodeIndexer,
SBNode:IsType(SBNode::Atom));
true, or because one of their ancestors is selected):
// Find all selected nodes
SBNodeIndexer nodeIndexer;
SAMSON::getActiveDocument()->getNodes(nodeIndexer,
SBNode:IsSelected());
Predicates may be combined through logical operations. For example, collecting selected atoms may be achieved with:
// Find all selected nodes
SBNodeIndexer nodeIndexer;
SAMSON::getActiveDocument()->getNodes(nodeIndexer,
SBNode::IsAtom() && SBNode:IsSelected());
Please refer to Functors for more information.
See also: getNodes
See also: Functors
Node getters#
The SBDDataGraphNode class also defines a series of node getters, i.e. functors that may be used to collect nodes in the data graph. For example, the SBNode::GetType getter may be used to retrieve the type of a node instead of through the getType function:
// Get the type of a node
SBPointer<SBAtom> nodePointer = new SBAtom();
SBNode::GetType()(nodePointer()); // returns SBNode::Atom
Node getters may be used to construct node predicates through comparison operators, so that collecting all atoms may also be achieved with:
// Find all atoms
SBNodeIndexer nodeIndexer;
SAMSON::getActiveDocument()->getNodes(nodeIndexer,
SBNode::GetType() == SBNode::Atom);
SBNode::GetType() == SBNode::Atom constructs a node predicate that is passed to the getNodes function.
In general, node getters have the same name as the corresponding getter function, but the first letter of their name is capitalized, since they are classes. For example, just like the SBNode::GetType getter corresponds to the SBNode::getType function, the SBAtom::GetTemperatureFactor getter corresponds to the SBAtom::getTemperatureFactor function.
Node predicates and node getters may be used to collect nodes from potentially complex rules:
// Find all selected atoms with a large enough temperature factor
SBNodeIndexer nodeIndexer;
SAMSON::getActiveDocument()->getNodes(nodeIndexer,
SBNode::IsSelected() &&
SBNode::IsAtom() &&
(SBAtom::GetTemperatureFactor() > 2.0));
Node predicates and node getters constitute the foundation of SAMSON's NSL.
See also: getNodes
Serialization#
Data graph nodes support serialization through the serialize and unserialize functions. Serialization is used in SAMSON to e.g. copy, paste, save, load, etc. data graph nodes. Please refer to Serialization for more information.
Public Types Documentation#
enum RenderingPass#
The rendering pass.
enum SBDDataGraphNode::RenderingPass {
Setup = 10,
OpaqueGeometry = 20,
SelectableGeometry = 30,
ShadowingGeometry = 40,
TransparentGeometry = 50,
Interface = 60,
Text = 70
};
enum Type#
The type of the data graph node.
enum SBDDataGraphNode::Type {
Undefined = 0,
StructuralModel = 1,
StructuralModelNode = 2,
StructuralModelConformation = 28,
Conformation = 28,
StructuralModelPath = 29,
Path = 29,
StructuralModelNodeGroup = 200,
StructuralGroup = 200,
StructuralModelNodeRoot = 20000,
Root = 20000,
StructuralModelNodeAtom = 20100,
Atom = 20100,
StructuralModelNodeBond = 202,
Bond = 202,
StructuralModelNodeHydrogenBond = 20202,
HydrogenBond = 20202,
StructuralModelNodeHydrogenBondGroup = 20203,
HydrogenBondGroup = 20203,
StructuralModelNodeResidue = 204,
Residue = 204,
StructuralModelNodeSegment = 205,
Segment = 205,
StructuralModelNodeChain = 207,
Chain = 207,
StructuralModelNodeMolecule = 208,
Molecule = 208,
StructuralModelNodeBackbone = 209,
Backbone = 209,
StructuralModelNodeSideChain = 210,
SideChain = 210,
VisualModel = 3,
VisualModelMesh = 300,
Mesh = 300,
DynamicalModel = 5,
DynamicalModelParticleSystem = 500,
ParticleSystem = 500,
DynamicalModelRigidBodySystem = 501,
RigidBodySystem = 501,
DynamicalModelArticulatedBodySystem = 502,
ArticulatedBodySystem = 502,
DynamicalModelNode = 6,
DynamicalNode = 6,
DynamicalModelNodeGroup = 600,
DynamicalGroup = 600,
DynamicalModelNodeRoot = 60000,
DynamicalRoot = 60000,
DynamicalModelNodeParticle = 601,
Particle = 601,
DynamicalModelNodeRigidBody = 602,
RigidBody = 602,
DynamicalModelNodeArticulatedBody = 603,
ArticulatedBody = 603,
InteractionModel = 7,
InteractionModelParticleSystem = 700,
InteractionModelRigidBodySystem = 701,
InteractionModelArticulatedBodySystem = 702,
PropertyModel = 9,
PropertyModelFunction = 900,
Simulator = 11,
SimulatorParticleSystem = 1100,
SimulatorRigidBodySystem = 1101,
SimulatorArticulatedBodySystem = 1102,
StateUpdater = 15,
StateUpdaterParticleSystem = 1501,
StateUpdaterRigidBodySystem = 1502,
StateUpdaterArticulatedBodySystem = 1503,
Animation = 800,
Camera = 801,
Document = 802,
DocumentManager = 803,
File = 804,
Folder = 805,
Label = 806,
Light = 807,
Note = 808,
Presentation = 809,
RenderPreset = 810,
DataGraphNodeGroup = 30,
NodeGroup = 30,
Controller = 40,
ControllerNode = 41,
Asset = 50
};
Public Functions Documentation#
function SB_NODE_GETTER_0 [1/19]#
function SB_NODE_GETTER_0 [2/19]#
function SB_NODE_GETTER_0 [3/19]#
function SB_NODE_GETTER_0 [4/19]#
function SB_NODE_GETTER_0 [5/19]#
function SB_NODE_GETTER_0 [6/19]#
function SB_NODE_GETTER_0 [7/19]#
function SB_NODE_GETTER_0 [8/19]#
function SB_NODE_GETTER_0 [9/19]#
function SB_NODE_GETTER_0 [10/19]#
function SB_NODE_GETTER_0 [11/19]#
function SB_NODE_GETTER_0 [12/19]#
function SB_NODE_GETTER_0 [13/19]#
function SB_NODE_GETTER_0 [14/19]#
function SB_NODE_GETTER_0 [15/19]#
function SB_NODE_GETTER_0 [16/19]#
function SB_NODE_GETTER_0 [17/19]#
function SB_NODE_GETTER_0 [18/19]#
function SB_NODE_GETTER_0 [19/19]#
function SB_NODE_PREDICATE_0 [1/32]#
function SB_NODE_PREDICATE_0 [2/32]#
function SB_NODE_PREDICATE_0 [3/32]#
function SB_NODE_PREDICATE_0 [4/32]#
function SB_NODE_PREDICATE_0 [5/32]#
function SB_NODE_PREDICATE_0 [6/32]#
function SB_NODE_PREDICATE_0 [7/32]#
function SB_NODE_PREDICATE_0 [8/32]#
function SB_NODE_PREDICATE_0 [9/32]#
function SB_NODE_PREDICATE_0 [10/32]#
function SB_NODE_PREDICATE_0 [11/32]#
function SB_NODE_PREDICATE_0 [12/32]#
function SB_NODE_PREDICATE_0 [13/32]#
function SB_NODE_PREDICATE_0 [14/32]#
function SB_NODE_PREDICATE_0 [15/32]#
function SB_NODE_PREDICATE_0 [16/32]#
function SB_NODE_PREDICATE_0 [17/32]#
function SB_NODE_PREDICATE_0 [18/32]#
function SB_NODE_PREDICATE_0 [19/32]#
function SB_NODE_PREDICATE_0 [20/32]#
function SB_NODE_PREDICATE_0 [21/32]#
function SB_NODE_PREDICATE_0 [22/32]#
function SB_NODE_PREDICATE_0 [23/32]#
function SB_NODE_PREDICATE_0 [24/32]#
function SB_NODE_PREDICATE_0 [25/32]#
function SB_NODE_PREDICATE_0 [26/32]#
function SB_NODE_PREDICATE_0 [27/32]#
function SB_NODE_PREDICATE_0 [28/32]#
function SB_NODE_PREDICATE_0 [29/32]#
function SB_NODE_PREDICATE_0 [30/32]#
function SB_NODE_PREDICATE_0 [31/32]#
function SB_NODE_PREDICATE_0 [32/32]#
function SB_NODE_PREDICATE_1 [1/2]#
function SB_NODE_PREDICATE_1 [2/2]#
function addChild#
Adds a child to the node.
virtual bool SBDDataGraphNode::addChild (
SBDDataGraphNode * node,
SBDDataGraphNode * nextNode=nullptr
)
Adds a child node to this node.
Parameters:
nodeA pointer to the child that should be addednextNodeA pointer to the node before which the child should be added
Returns:
true if the child was added successfully
This function adds node as a child of this node, immediately before node nextNode. By default, nextNode is 0 and the child is added at the end of the list of this node's children. This function is reimplemented in derived classes. When developing new data graph nodes types, with custom children management, this convention should be respected if it makes sense for the custom node, and the reimplemented function should be undoable
.
"This function is <a href=\"../undo-and-redo.md">undoable.
See also: removeChild
function addMaterial#
Adds a material.
Adds a material to this node.
This function adds a material to the node. A node may have at most one material, and a material may be applied to at most one node. The function returns true when the material is successfully added.
Parameters:
materialPointer to the material to add.
Returns:
true if the material was successfully added, false otherwise. Please see Materials for more information
"This function is <a href=\"../undo-and-redo.md">undoable.
See also: Materials
See also: hasMaterial, ownsMaterial, removeMaterial, getMaterial, getMaterialOwner
function baseSignalIsConnectedToSlot#
Returns true when the base signal is connected to a slot.
bool SBDDataGraphNode::baseSignalIsConnectedToSlot (
SBCReferenceTarget * referenceTarget,
void(SBCReferenceTarget::*)( SBBaseEvent *) functionPointer
) const
Checks whether the node's base signal is connected to a specific slot.
Parameters:
referenceTargetPointer to the reference target.functionPointerPointer to the reference target's member function to check.
Returns:
true if the slot is connected, false otherwise.
function canAddChild#
Returns whether this node can add node as a child.
virtual bool SBDDataGraphNode::canAddChild (
const SBDDataGraphNode * node,
const SBDDataGraphNode * nextNode=nullptr
) const
Determines whether a node can be added as a child of this node.
Parameters:
nodeA pointer to a potential childnextNodeA pointer to the node before which the child should be added
Returns:
A boolean that indicates whether node can be added as a child of this node, immediately before node nextNode.
See also: canAddChildType, canHaveDescendantType, addChild
function canAddChildType#
Returns whether this node can add a node with type nodeType as a child.
Determines whether a child of the given type can be added to this node.
Parameters:
nodeTypeA node type
Returns:
A boolean that indicates whether a node with type nodeType can be added as a child of this node.
See also: canAddChild, canHaveDescendantType, addChild
function canAddMaterial [1/2]#
Returns whether can add a material to the node based on its type.
Determines whether this node can have a material.
This function returns whether it is possible to add a material to this node based on its node type. Not all nodes can have materials, i.e. can be colorized, - this is the case for e.g. SBNode::Animation, SBNode::Camera, SBNode::Path, etc.
Returns:
true if a material can be added to this node, false otherwise.
See also: Materials
See also: hasMaterial, ownsMaterial, removeMaterial, getMaterial, getMaterialOwner
function canHaveDescendantType#
Returns whether this node can have a node with type nodeType as a descendant.
Determines whether a node of the given type can be a descendant of this node.
Parameters:
nodeTypeA node type
Returns:
A boolean that indicates whether a node with type nodeType can be added as a descendant of this node.
See also: canAddChild, addChild
function clone [1/2]#
Returns a copy of the node and its descendants.
This function returns a copy of the node and its descendants.
In case the copy cannot be performed (for example if some nodes in the hierarchy have not been exposed through SAMSON's Introspection), the function returns nullptr. Note that the highlighting flag, the selection flag, and the created flag are not cloned. As a result, a clone must be created before insertion in the document:
SBNode* clone = node->clone();
if (clone) {
SAMSON::beginHolding("Add clone");
SAMSON::hold(clone); // hold the clone in memory
clone->create(); // mark the clone as created
node->getParent()->addChild(clone); // add the clone as a sibling
SAMSON::endHolding();
}
Finally, note that cloning assumes that the serialize and unserialize functions have been implemented for each cloned node.
See also: Serialization
function connectBaseSignalToSlot#
Connects the base signal to a slot.
void SBDDataGraphNode::connectBaseSignalToSlot (
SBCReferenceTarget * referenceTarget,
void(SBCReferenceTarget::*)( SBBaseEvent *) functionPointer,
SBCReferenceTarget * nextReferenceTarget=0,
void(SBCReferenceTarget::*)( SBBaseEvent *) nextFunctionPointer=0
)
Connects the node's base signal to a slot.
Parameters:
referenceTargetA pointer to the reference target that will receives the signalfunctionPointerA pointer to the reference target's member function that will be called when the node's base signal is emittednextReferenceTargetA pointer to the next reference target; null by defaultnextFunctionPointerA pointer to the next reference target's member function; null by default
This function connects the node's base signal to a slot.
Please refer to Signals and slots for more information.
"This function is <a href=\"../undo-and-redo.md">undoable.
See also: disconnectBaseSignalFromSlot, baseSignalIsConnectedToSlot
function countNodes [1/2]#
Counts nodes based on a nodeType , a selection status and avisitPredicate , with or without dependencies.
unsigned int SBDDataGraphNode::countNodes (
SBDDataGraphNode::Type nodeType,
bool selectedNodesOnly=false,
const SBNodePredicate & visitPredicate=SBDDataGraphNode::All(),
bool includeDependencies=false
) const
Counts nodes of a given type in the sub‑tree, optionally including dependencies.
This function traverses the sub‑tree for which visitPredicate is true (depth‑first), and counts the nodes for which the selectionPredicate is true. Precisely, if the visitPredicate returns false, a node is not visited, and neither are its descendants. If the visitPredicate returns true, the node is visited, and the visitPredicate will be used to decide whether its children are visited or not.
When includeDependencies is true, the function also counts nodes that are not descendants of this node, but are dependencies nonetheless. For example, in a bond, the two atoms connected by the bond are not children of the bond, but are still dependencies of the bond. Hence, provided they satisfy the nodeType, selectedNodesOnly, and visitPredicate, they are counted if includeDependencies is true.
Among the node types defined in the SAMSON SDK, four have dependencies that are not children:
- Bonds: the left and right atom
- Conformations: the atoms whose positions are stored in the conformation
- Groups: the nodes belonging to the group
- Paths: the atoms whose positions are stored in the path
Some SAMSON Extensions may define nodes that have non‑child dependencies. For example, a visual model that references atoms should reimplement the getNodes function to add these dependencies to the nodeIndexer. See getNodes for more information and examples.
This function is a convenience function that internally calls getNodes.
Parameters:
nodeTypeType of nodes to count.selectedNodesOnlyIftrue, only selected nodes are counted.visitPredicatePredicate that determines which nodes are visited.includeDependenciesIftrue, also counts dependency nodes.
Returns:
Number of nodes counted.
function countNodes [2/2]#
Counts nodes based on a selectionPredicate and avisitPredicate , with or without dependencies.
unsigned int SBDDataGraphNode::countNodes (
const SBNodePredicate & selectionPredicate=SBDDataGraphNode::All(),
const SBNodePredicate & visitPredicate=SBDDataGraphNode::All(),
bool includeDependencies=false
) const
Counts nodes matching a selection predicate in the sub‑tree, optionally including dependencies.
This function traverses the sub‑tree for which visitPredicate is true (depth‑first), and counts the nodes for which the selectionPredicate is true. Precisely, if the visitPredicate returns false, a node is not visited, and neither are its descendants. If the visitPredicate returns true, the node is visited, and the visitPredicate will be used to decide whether its children are visited or not.
When includeDependencies is true, the function also counts nodes that are not descendants of this node, but are dependencies nonetheless. For example, in a bond, the two atoms connected by the bond are not children of the bond, but are still dependencies of the bond. Hence, provided they satisfy the selectionPredicate and visitPredicate, they are counted if includeDependencies is true.
Among the node types defined in the SAMSON SDK, four have dependencies that are not children:
- Bonds: the left and right atom
- Conformations: the atoms whose positions are stored in the conformation
- Groups: the nodes belonging to the group
- Paths: the atoms whose positions are stored in the path
Some SAMSON Extensions may define nodes that have non‑child dependencies. For example, a visual model that references atoms should reimplement the getNodes function to add these dependencies to the nodeIndexer. See getNodes for more information and examples.
This function is a convenience function that internally calls getNodes.
Parameters:
selectionPredicatePredicate that selects nodes to be counted.visitPredicatePredicate that determines which nodes are visited.includeDependenciesIftrue, also counts dependency nodes.
Returns:
Number of nodes counted.
function create#
Creates the node.
Creates the node and all its descendants, marking them as created.
This function creates the node and all its descendants, i.e. sets their created flag to true. Nodes which were not already created send the event SBEvent::NodeCreated. The created flag indicates whether the node is created or not, from SAMSON's point of view (as opposed to C++ object creation and destruction).
For more information, please refer to section Node lifecycle.
See also: isCreated, isErased, create, erase
See also: Node lifecycle
See also: Signals and slots "This function is <a href=\"../undo-and-redo.md">undoable.
function descendsFrom [1/3]#
Returns true if and only if this node isnode , or descends from it.
Checks whether this node is the given node or descends from it.
Parameters:
nodeThe node to test against.
Returns:
true if this node is the given node or a descendant.
See also: data graph
function descendsFrom [2/3]#
Returns true if and only if this node is one of the nodes of thenodeIndexer , or descends from one of them.
Checks whether this node matches any node in the indexer or descends from any.
Parameters:
nodeIndexerThe indexer containing nodes to test against.
Returns:
true if this node matches or descends from any node in the indexer.
See also: data graph
function descendsFrom [3/3]#
Returns true if and only if this node is one of the nodes of thenodePointerIndexer , or descends from one of them.
bool SBDDataGraphNode::descendsFrom (
SBPointerIndexer< SBDDataGraphNode > * nodePointerIndexer
) const
Checks whether this node matches any node in the pointer indexer or descends from any.
Parameters:
nodePointerIndexerThe pointer indexer containing nodes to test against.
Returns:
true if this node matches or descends from any node in the pointer indexer.
See also: data graph
function disconnectBaseSignalFromSlot#
Disconnects the base signal from a slot.
void SBDDataGraphNode::disconnectBaseSignalFromSlot (
SBCReferenceTarget * referenceTarget,
void(SBCReferenceTarget::*)( SBBaseEvent *) functionPointer
)
Disconnects the node's base signal from a slot.
Parameters:
referenceTargetPointer to the reference target to disconnect.functionPointerPointer to the member function to disconnect.
function display [1/2]#
Displays the node.
Displays the node based on the rendering pass.
This function displays the node. It receives from the SAMSON renderer the current renderingPass which indicates what the function should display.
Parameters:
-
renderingPassThe rendering pass indicating which geometry to render. -
Setup:the setup pass where you can perform initialization that may be used in other passes, without rendering anything OpaqueGeometry:the main pass where you should render opaque geometrySelectableGeometry:the pass where you should render selectable geometryShadowingGeometry:the pass where you should render shadowing geometryTransparentGeometry:the pass where you should render transparent geometryInterface:the pass where you should render 2D and 3D interface componentsText:the pass where you should render text
Please refer to tutorials for more information.
Starting with SAMSON 0.9.0, this is the main and only function to display nodes in the viewport. Previous display functions (SBDDataGraphNode::display(), SBDDataGraphNode::displayForSelection() and SBDDataGraphNode::displayForShadow()) are marked as deprecated and will be removed in a future SAMSON version.
To facilitate porting to SAMSON 0.9.0, the default implementation of this function calls the now deprecated functions SBDDataGraphNode::display(), SBDDataGraphNode::displayForSelection() and SBDDataGraphNode::displayForShadow().
function display [2/2]#
Displays the node (deprecated)
Displays the node (deprecated).
This function is deprecated and will be removed in a future version. Implement SBDDataGraphNode::display(RenderingPass renderingPass) instead.
function displayForSelection#
Displays the node for selection purposes (deprecated)
Displays the node for selection (deprecated).
This function is deprecated and will be removed in a future version. Implement SBDDataGraphNode::display(RenderingPass renderingPass) instead.
function displayForShadow#
Displays the node for shadowing purposes (deprecated)
Displays the node for shadow rendering (deprecated).
This function is deprecated and will be removed in a future version. Implement SBDDataGraphNode::display(RenderingPass renderingPass) instead.
function erase#
Erases the node.
Erases the node and all its descendants.
This function erases the node and all its descendants. To perform custom erase operations (for example, a bond being erased will remove itself from its parent and disconnect from the base signal of its left and right atom), derived class may reimplement onErase, which is a private virtual function of SBDDataGraphNode. Because the objects that are connected to this node's base signal might want to perform some tasks before the node is erased, nodes being erased send three events: SBBaseEvent::Type::NodeEraseBegin immediately before erasing begins, SBBaseEvent::Type::NodeEraseEnd after erasing is complete, and finally SBBaseEvent::Type::NodeErased. Precisely, the erase function sends the SBBaseEvent::Type::NodeEraseBegin event, sets the selection flag of the node to false, calls the virtual onErase function, removes the node from its parent, then sends the SBBaseEvent::Type::NodeEraseEnd and the SBBaseEvent::Type::NodeErased events. In the case of a bond, for example, the operations mentioned above are thus performed between the SBBaseEvent::Type::NodeEraseBegin and SBBaseEvent::Type::NodeEraseEnd events.
For more information, please refer to section Node lifecycle.
See also: isCreated, isErased, create, erase, onErase
See also: Node lifecycle
function forEachNodeDepthFirst [1/2]#
Performs the action on this node.
Executes a given action on this node.
Calls the provided function pointer with this node as its argument.
Parameters:
actionFunction pointer that takes a SBDDataGraphNode* and performs an action.
function forEachNodeDepthFirst [2/2]#
Performs the objects 'saction on this node.
virtual void SBDDataGraphNode::forEachNodeDepthFirst (
SBCClass * object,
void(SBCClass::*)( SBDDataGraphNode *node) action
)
Executes a member function on this node using a given object.
Calls the specified member function of the provided object with this node as its argument.
Parameters:
objectPointer to an object whose member function will be called.actionPointer to the member function of SBCClass that takes a SBDDataGraphNode*.
function getDefaultOpacity#
Returns the default opacity.
Returns the default opacity value (0-100).
Returns:
The default opacity.
function getDefaultTransparency#
Returns the default transparency.
Returns the default transparency value (0-100).
Returns:
The default transparency.
function getDocument#
Returns the document the node belongs to.
Returns the document the node belongs to, or nullptr if none.
The function traverses the ancestors of the node to locate a document node.
function getFlags#
Returns the flags.
This function returns an unsigned int that contains the flags of the node:
- the first bit is the selection flag
- the second bit is the highlighting flag
Returns:
the flags
See also: Flags
See also: getSelectionFlag, getHighlightingFlag
function getHierarchyString#
Returns a string with hierarchical information on the node and its parents names.
virtual std::string SBDDataGraphNode::getHierarchyString (
const std::string & separator=" / ",
bool includeNodeType=false
) const
Generates a string describing the node's hierarchy.
This function returns a string with information on the node's hierarchy. This information can be used for logging and debugging.
Parameters:
separatorSeparator string used between hierarchy elements.includeNodeTypeIftrue, includes the node type in the output.
Returns:
Hierarchy string.
function getHighlightingFlag#
Returns the highlighting flag.
This function returns the highlighting flag of the node.
Setting this flag to true instructs the renderer to highlight the node in the viewport.
See also: setHighlightingFlag
function getInheritedFlags#
Returns the inherited flags.
This function returns an unsigned int that contains the inherited flags of the node:
- the first bit is
trueif the node is selected - the second bit is
trueif the node is highlighted
Returns:
the flags
See also: Flags
See also: isSelected, isHighlighted
function getInheritedOpacity#
Returns the cumulative opacity, when taking into account the ascendants.
Returns the cumulative opacity of the node and its ancestors.
This function returns the product of the opacities of all the ascendant nodes.
Returns:
The cumulative opacity as a float.
function getInheritedTransparency#
Returns the cumulative transparency, when taking into account the ascendants.
Returns the cumulative transparency of the node and its ancestors.
Returns:
One minus the cumulative opacity as a float.
function getLockedFlag#
Returns the locked flag.
Returns the locked flag of the node.
Returns:
true if the node is locked; otherwise false.
function getMaterial#
Returns the material.
Retrieves the material associated with this node or an ancestor.
This function returns the material associated to this node, if a material was added to the node itself or to one of its ancestors (in which case it returns the deepest ancestor with a material applied).
Returns:
Pointer to the material, or nullptr if none.
See also: Materials
See also: hasMaterial, ownsMaterial, removeMaterial, addMaterial, getMaterialOwner
function getMaterialOwner#
Returns the node whose material is inherited.
Retrieves the node that owns the material for this node.
This function returns the node which owns the material associated to this node, i.e. the deepest ancestor with a material applied. The function returns 0 if no (direct or inherited) material is applied.
Returns:
Pointer to the node owning the material, or nullptr if none.
See also: Materials
See also: getMaterial, hasMaterial, ownsMaterial, addMaterial, removeMaterial
function getMaximumOpacity#
Returns the maximum opacity.
Returns the maximum opacity value (0-100).
Returns:
The maximum opacity.
function getMaximumTransparency#
Returns the maximum transparency.
Returns the maximum transparency value (0-100).
Returns:
The maximum transparency.
function getMinimumOpacity#
Returns the minimum opacity.
Returns the minimum opacity value (0-100).
Returns:
The minimum opacity.
function getMinimumTransparency#
Returns the minimum transparency.
Returns the minimum transparency value (0-100).
Returns:
The minimum transparency.
function getMolecularWeight#
Returns the molecular weight.
function getName#
Returns the name of the node.
Returns:
The node's name.
function getNextNode [1/2]#
Returns the pointer to the next node in the children of the node's parent.
Returns the next sibling node in the parent's child list, or nullptr if none.
function getNextNode [2/2]#
Returns the pointer to the next node with type nodeType in the children of the node's parent.
Returns the next sibling node with the specified type in the parent's child list, or nullptr if none.
function getNodeIndex#
Returns the node index (unique in the whole data graph, but non-persistent)
Returns the unique index of the data graph node.
At any time, each data graph node has a unique index, that is managed internally by SAMSON. All indices are contiguous unsigned integers between 0 and n-1, where n is the number of data graph nodes. As a result, the node index is not permanent: when node i is deleted (and i is different from n-1), then node n-1 becomes node i. Node indices are used for example when picking objects in a viewport, by writing integers into the framebuffer instead of colors.
Returns:
The unique node index.
function getNodeUUID#
Returns the node UUID.
Returns the unique identifier (UUID) of the node.
This function returns the UUID associated with this data graph node. If the internal data pointer is not set, an empty UUID is returned.
Returns:
The node's UUID, or an empty UUID if unavailable.
function getNodes [1/2]#
Collects nodes into nodeIndexer , based on anodeType , a selection status and avisitPredicate , with or without dependencies.
virtual void SBDDataGraphNode::getNodes (
SBNodeIndexer & nodeIndexer,
SBDDataGraphNode::Type nodeType,
bool selectedNodesOnly=false,
const SBNodePredicate & visitPredicate=SBDDataGraphNode::All(),
bool includeDependencies=false
) const
Collects nodes of a specific type into a node indexer.
Parameters:
nodeIndexerReference to the node indexer where matching nodes will be added.nodeTypeThe type of nodes to collect.selectedNodesOnlyIf true, only selected nodes (or ancestors) are collected.visitPredicatePredicate that determines which nodes and subtrees to visit.includeDependenciesIf true, also includes dependent nodes that are not children.
function getNodes [2/2]#
Collects nodes into nodeIndexer , based on aselectionPredicate and avisitPredicate , with or without dependencies.
virtual void SBDDataGraphNode::getNodes (
SBNodeIndexer & nodeIndexer,
const SBNodePredicate & selectionPredicate=SBDDataGraphNode::All(),
const SBNodePredicate & visitPredicate=SBDDataGraphNode::All(),
bool includeDependencies=false
) const
Collects nodes that satisfy a selection predicate into a node indexer.
Parameters:
nodeIndexerReference to the node indexer where matching nodes will be added.selectionPredicatePredicate that selects nodes to collect.visitPredicatePredicate that determines which nodes and subtrees to visit.includeDependenciesIf true, also includes dependent nodes that are not children.
function getNumberOfAtoms#
Returns the number of atoms.
function getNumberOfCarbons#
Returns the number of carbons.
function getNumberOfChains#
Returns the number of chains.
function getNumberOfCoarseGrainedAtoms#
Returns the number of coarse-grained atoms.
function getNumberOfHydrogens#
Returns the number of hydrogens.
function getNumberOfMolecules#
Returns the number of molecules.
function getNumberOfNitrogens#
Returns the number of nitrogens.
function getNumberOfOtherAtoms#
Returns the number of other atoms.
function getNumberOfOxygens#
Returns the number of oxygens.
function getNumberOfResidues#
Returns the number of residues.
function getNumberOfSegments#
Returns the number of segments.
function getNumberOfStructuralGroups#
Returns the number of structural groups.
function getNumberOfStructuralModels#
Returns the number of structural models.
function getNumberOfSulfurs#
Returns the number of sulfurs.
function getOpacity#
Returns the opacity.
Returns the opacity of the node as a percentage (0-100).
Returns:
The opacity value (0-100).
function getOpacitySingleStep#
Returns the opacity single step.
Returns the single step increment for opacity adjustments.
Returns:
The opacity step size.
function getOpacitySuffix#
Returns the opacity suffix.
Returns the suffix used when displaying opacity values.
Returns:
The opacity suffix string.
function getParent#
Returns the parent of the node.
Returns the parent of the node, or nullptr if there is none.
function getPreviousNode [1/2]#
Returns the pointer to the previous node in the children of the node's parent.
Returns the previous sibling node in the parent's child list, or nullptr if none.
function getPreviousNode [2/2]#
Returns the pointer to the previous node with type nodeType in the children of the node's parent.
Returns the previous sibling node with the specified type in the parent's child list, or nullptr if none.
function getRoot#
Returns the root of the hierarchy the node belongs to.
This function returns the root of the hierarchy the node belongs to.
In general, this returns a pointer to the document that contains the node. However, if the node is not yet inserted in a document, this may return a node with a different type. In case the node has not been added as a child to another node, this function returns a pointer to the node itself.
See also: data graph
function getSelected#
Returns whether the node is selected.
This function returns true if the node is selected, either directly or indirectly through its ancestors.
Returns:
true if the node is selected, false otherwise.
function getSelectionFlag#
Returns the selection flag.
This function returns the selection flag of the data graph node.
The selection flag is true if and only if the node is currently selected. Please refer to SBDDocument for more information about the way selection works in SAMSON.
See also: setSelectionFlag
function getSumOfFormalCharges#
Returns the sum of formal charges.
function getSumOfPartialCharges#
Returns the sum of partial charges.
function getThisNode#
Returns the pointer to this node.
Returns a pointer to this node.
This is useful for inspectors to easily select the inspected node.
function getTransparency#
Returns the transparency.
Returns the transparency of the node as a percentage (0-100).
Returns:
The transparency value (0-100).
function getTransparencySingleStep#
Returns the transparency single step.
Returns the single step increment for transparency adjustments.
Returns:
The transparency step size.
function getTransparencySuffix#
Returns the transparency suffix.
Returns the suffix used when displaying transparency values.
Returns:
The transparency suffix string.
function getType#
Returns the type of the data graph node.
Each node in the data graph has a type, which can be used, for example, to rapidly search the data graph:
// Find all atoms
SBNodeIndexer nodeIndexer;
SAMSON::getActiveDocument()->getNodes(nodeIndexer, SBNode::Atom);
Returns:
The node type.
function getTypeString [1/2]#
Returns a string describing the type of the data graph node.
Returns a string describing the type of this data graph node.
This function is a convenience function used to produce a string corresponding to the node's type.
Parameters:
humanReadableIftrue, returns a human-readable string; otherwise a programmatic string.
Returns:
A string representation of the node type.
function getVisibilityFlag#
Returns the visibility flag.
This function returns the visibility flag of the node.
The visibility flag is true if and only if the node is visible in viewports. In other words, setting this flag to false instructs the renderer to not display the node (in case it has a visual representation).
See also: setVisibilityFlag
function getVisible#
Returns whether the node is visible.
This function returns true if the node is visible, i.e., both the node and all its ancestors have their visibility flag set to true.
Returns:
true if the node is visible, false otherwise.
function hasMaterial#
Returns whether the node has a material (by itself, or inherited)
Checks whether this node has a material directly or via inheritance.
This function returns whether the node has a material by itself, or inherited
Returns:
true if the node has a material, false otherwise.
See also: Materials
See also: ownsMaterial, getMaterial, getMaterialOwner, addMaterial, removeMaterial
function hasNode [1/2]#
Returns whether the node has nodes based on a nodeType , a selection status and avisitPredicate , with or without dependencies.
virtual bool SBDDataGraphNode::hasNode (
SBDDataGraphNode::Type nodeType,
bool selectedNodesOnly=false,
const SBNodePredicate & visitPredicate=SBDDataGraphNode::All(),
bool includeDependencies=false
) const
Checks if there is at least one node of a given type in the sub-tree.
Parameters:
nodeTypeThe type of node to check for.selectedNodesOnlyIf true, only selected nodes are considered.visitPredicatePredicate that determines which nodes and subtrees to visit.includeDependenciesIf true, includes dependent nodes.
Returns:
true if at least one matching node exists, false otherwise.
function hasNode [2/2]#
Returns whether the node has nodes based on a selectionPredicate and avisitPredicate , with or without dependencies.
virtual bool SBDDataGraphNode::hasNode (
const SBNodePredicate & selectionPredicate=SBDDataGraphNode::All(),
const SBNodePredicate & visitPredicate=SBDDataGraphNode::All(),
bool includeDependencies=false
) const
Checks if there is at least one node satisfying a selection predicate in the sub-tree.
Parameters:
selectionPredicatePredicate that selects nodes.visitPredicatePredicate that determines which nodes and subtrees to visit.includeDependenciesIf true, includes dependent nodes.
Returns:
true if at least one matching node exists, false otherwise.
function hasOneOf#
Returns true if and only if this node is one of the nodes of thenodeIndexer , or is the ancestor of one of them, or is a group that stores one of them.
Checks whether this node matches any node in the given indexer, is an ancestor of any, or belongs to a group storing one.
See also: data graph
function hasOpacityRange#
Returns whether the node has the opacity range.
Determines whether the node has an opacity range.
Returns:
true if the node has an opacity range, false otherwise.
function hasTransparencyRange#
Returns whether the node has the transparency range.
Determines whether the node has a transparency range.
Returns:
true if the node has a transparency range, false otherwise.
function isAtom#
Returns true when the node is an atom.
Checks whether the node is an atom.
Returns:
true if the node type is Atom.
function isBallAndStick#
Returns true when the node is the default ball-and-stick visual model.
Checks whether the node is a ball‑and‑stick visual model.
Returns:
true if the node's proxy name matches the ball‑and‑stick model.
function isBond#
Returns true when the node is a bond.
Checks whether the node is a bond.
Returns:
true if the node type is Bond.
function isCartoon#
Returns true when the node is the default cartoon visual model.
Checks whether the node is a cartoon visual model.
Returns:
true if the node's proxy name matches the cartoon model.
function isCreated#
Returns true if and only if the node is created.
Returns true if the node has been created.
For more information, please refer to section Node lifecycle.
See also: isErased, create, erase
See also: Node lifecycle
function isDynamicalModel#
Returns true when the node is a dynamical model.
Checks whether the node is a dynamical model.
Returns:
true if the node type is DynamicalModel or one of its derived types.
function isErased#
Returns true if and only if the node is erased.
Returns true if the node is erased (i.e., not created).
For more information, please refer to section Node lifecycle.
See also: isCreated, create, erase
See also: Node lifecycle
function isGaussianSurface#
Returns true when the node is the default Gaussian surface visual model.
Checks whether the node is a Gaussian surface visual model.
Returns:
true if the node's proxy name matches the Gaussian surface model.
function isHighlighted#
Returns whether the node is highlighted.
This function returns whether the node is highlighted directly (because its highlighting flag is true) or indirectly (because the highlighting flag of one of its ancestors is true).
See also: getHighlightingFlag
function isIn [1/3]#
Returns true if and only if this node isnode , or descends from it, or belongs to a group stored innode .
Checks whether this node is the given node, descends from it, or belongs to a group stored in it.
Parameters:
nodeThe node to test against.
Returns:
true if this node is the given node, descends from it, or belongs to a group stored in it.
See also: data graph
function isIn [2/3]#
Returns true if and only if this node is one of the nodes of thenodeIndexer , or descends from one of them, or belongs to a group stored in one of the nodes of thenodeIndexer .
Checks whether this node matches any node in the given indexer, descends from any, or belongs to a group stored in one of the nodes of the indexer.
See also: data graph
function isIn [3/3]#
Returns true if and only if this node is one of the nodes of thenodePointerIndexer , or descends from one of them, or belongs to a group stored in of the nodes of thenodePointerIndexer .
This function returns true if and only if this node is one of the nodes of the nodePointerIndexer, or descends from one of them.
If a node of the nodePointerIndexer contains groups, then the function returns true if this node belongs to them.
See also: data graph
function isInteractionModel#
Returns true when the node is a interaction model.
Checks whether the node is an interaction model.
Returns:
true if the node type is InteractionModel or one of its derived types.
function isLicorice#
Returns true when the node is the default licorice visual model.
Checks whether the node is a licorice visual model.
Returns:
true if the node's proxy name matches the licorice model.
function isLight#
Returns true when the node is a light.
Checks whether the node is a light.
Returns:
true if the node type is Light.
function isLocked#
Returns whether the node is locked.
Returns:
true if the node is locked; otherwise false.
function isMesh#
Returns true when the node is a mesh.
Checks whether the node is a mesh.
Returns:
true if the node type is Mesh.
function isModel#
Returns true when the node is a model.
Checks whether the node is a model (structural, visual, dynamical, interaction, or property).
Returns:
true if the node is a model.
function isOneOf [1/2]#
Returns true if and only if this node is one of the nodes of thenodeIndexer .
This function returns true if and only if this node is one of the nodes of the nodeIndexer
See also: data graph
function isOneOf [2/2]#
Returns true if and only if this node is one of the nodes of thenodePointerIndexer .
This function returns true if and only if this node is one of the nodes of the nodePointerIndexer
See also: data graph
function isPropertyModel#
Returns true when the node is a property model.
Checks whether the node is a property model.
Returns:
true if the node type is PropertyModel or PropertyModelFunction.
function isRibbon#
Returns true when the node is the default ribbon visual model.
Checks whether the node is a ribbon visual model.
Returns:
true if the node's proxy name matches the ribbon model.
function isSelected#
Returns whether the node is selected.
This function returns whether the node is selected directly (because its selection flag is true) or indirectly (because the selection flag of one of its ancestors is true).
Please refer to SBDDocument for more information about the way selection works in SAMSON.
See also: getSelectionFlag
function isSerializable#
Returns true when the class is serializable.
Returns true when the node is serializable.
By default, custom nodes are not serializable (i.e. the function returns false). If the node should be serializable (for example to make it possible to copy and paste the node, and save and load it), this function should be overloaded to return true.
Returns:
true if the node is serializable; otherwise false.
See also: Serialization
See also: serialize, unserialize
function isSimulator#
Returns true when the node is a simulator.
Checks whether the node is a simulator.
Returns:
true if the node type is Simulator or one of its derived types.
function isSolventAccessibleSurface#
Returns true when the node is the default solvent accessible surface visual model.
Checks whether the node is a solvent‑accessible surface visual model.
Returns:
true if the node's proxy name matches the solvent‑accessible surface model.
function isSolventExcludedSurface#
Returns true when the node is the default solvent excluded surface visual model.
Checks whether the node is a solvent‑excluded surface visual model.
Returns:
true if the node's proxy name matches the solvent‑excluded surface model.
function isStructuralModel#
Returns true when the node is a structural model.
Checks whether the node is a structural model.
Returns:
true if the node type is StructuralModel.
function isStructuralNode#
Returns true when the node is a structural node.
Checks whether the node is a structural node (e.g., atom, bond, residue, etc.).
Returns:
true if the node is a structural node.
function isTube#
Returns true when the node is the default tube visual model.
Checks whether the node is a tube visual model.
Returns:
true if the node's proxy name matches the tube model.
function isType#
Returns true when the type of the node corresponds totype .
Checks whether the node's type matches the given type.
Parameters:
typeThe type to compare against.
Returns:
true if the node's type equals the specified type.
function isVanDerWaals#
Returns true when the node is the default van der Waals visual model.
Checks whether the node is a van‑der‑Waals visual model.
Returns:
true if the node's proxy name matches the van‑der‑Waals model.
function isVisible#
Returns whether the node is visible.
This function returns whether the node is visible, which happens when the node and all its ancestors have their visibility flag set to true.
See also: getVisibilityFlag
function isVisualModel#
Returns true when the node is a visual model.
Checks whether the node is a visual model.
Returns:
true if the node type is VisualModel or Mesh.
function ownsMaterial#
Returns whether the node owns a material.
Checks whether this node directly owns a material.
This function returns whether the node owns a material
Returns:
true if the node owns a material, false otherwise.
See also: Materials
See also: hasMaterial, getMaterial, getMaterialOwner, addMaterial, removeMaterial
function print#
Prints some debugging information.
Prints debugging information for the node.
Prints information with indentation specified by offset.
Parameters:
offsetNumber of tab characters to prepend to each line.
function removeChild#
Removes a child from the node.
Removes a child node from this node.
Parameters:
nodeA pointer to the child that should be removed
Returns:
true if the child was removed successfully
This function removes node from the children of this node. This function is reimplemented in derived classes. When developing new data graph nodes types, with custom children management, the reimplemented function should be undoable
.
"This function is <a href=\"../undo-and-redo.md">undoable.
See also: addChild
function removeMaterial#
Removes the material.
Removes the material from this node.
This function removes a material from the node. Please see Materials for more information
Returns:
true if the material was removed, false otherwise. "This function is <a href=\"../undo-and-redo.md">undoable.
See also: Materials
See also: hasMaterial, ownsMaterial, addMaterial, removeMaterialsFromDescendants, getMaterial, getMaterialOwner
function removeMaterialsFromDescendants#
Removes materials from all nodes that descend from this node, but it does not remove the material from the node itself.
Removes materials from all descendant nodes.
This function removes materials from all nodes that descend from this node, but it does not remove the material from the node itself. Please see Materials for more information
"This function is <a href=\"../undo-and-redo.md">undoable.
See also: Materials
See also: hasMaterial, ownsMaterial, addMaterial, removeMaterial, getMaterial, getMaterialOwner
function serialize#
Serializes the node.
virtual void SBDDataGraphNode::serialize (
SBCSerializer * serializer,
const SBNodeIndexer & nodeIndexer,
const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER,
const SBVersionNumber & classVersionNumber=SBVersionNumber (1, 0, 0)
) const
This function writes the node's data to the provided serializer.
Parameters:
serializerA pointer to a serializer.nodeIndexerA node indexer used to retrieve indices associated to nodes.sdkVersionNumberA version number of the SDK.classVersionNumberA version number of the class.
Please refer to the page about Serialization for more information.
See also: Serialization
See also: isSerializable, unserialize
function setHighlightingFlag#
Sets the highlighting flag.
This function sets the highlighting flag of the node.
Setting this flag to true instructs the renderer to highlight the node in the viewport.
"This function is <a href=\"../undo-and-redo.md">undoable.
See also: getHighlightingFlag
function setLockedFlag#
Sets the locked flag.
Sets the locked flag of the node.
Parameters:
flagThe new locked state.
function setName#
Sets the name of the node.
Example usage:
"This function is <a href=\"../undo-and-redo.md">undoable.
function setOpacity#
Sets the opacity.
Sets the opacity of the node.
Parameters:
opacityThe new opacity value (0-100).
function setSelectionFlag#
Sets the selection flag.
This function sets the selection flag of the data graph node.
The selection flag is true if and only if the node is currently selected. Please refer to SBDDocument for more information about the way selection works in SAMSON.
"This function is <a href=\"../undo-and-redo.md">undoable.
See also: getSelectionFlag
function setTransparency#
Sets the transparency.
Sets the transparency of the node.
Parameters:
transparencyThe new transparency value (0-100).
function setVisibilityFlag#
Sets the visibility flag.
This function sets the visibility flag of the node.
"This function is <a href=\"../undo-and-redo.md">undoable.
See also: getVisibilityFlag
function unserialize#
Unserializes the node.
virtual void SBDDataGraphNode::unserialize (
SBCSerializer * serializer,
const SBNodeIndexer & nodeIndexer,
const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER,
const SBVersionNumber & classVersionNumber=SBVersionNumber (1, 0, 0)
)
This function reads the node's data from the provided serializer.
Parameters:
serializerA pointer to a serializer.nodeIndexerA node indexer used to retrieve indices associated to nodes.sdkVersionNumberA version number of the SDK.classVersionNumberA version number of the class.
Please refer to the page about Serialization for more information.
See also: Serialization
See also: isSerializable, serialize
Public Static Functions Documentation#
function canAddMaterial [2/2]#
Returns whether can add a material to a node of type nodeType .
Determines whether a node of the specified type can have a material.
This function returns whether it is possible to add a material to a node of type nodeType. Not all nodes can have materials, i.e. can be colorized, - this is the case for e.g. SBNode::Animation, SBNode::Camera, SBNode::Path, etc.
Parameters:
nodeTypeType of the node.
Returns:
true if a material can be added to nodes of this type, false otherwise.
See also: Materials
See also: hasMaterial, ownsMaterial, removeMaterial, getMaterial, getMaterialOwner
function clone [2/2]#
Clones the nodes in sourceNodeIndexer (treated as a whole) and places the clones indestinationNodeIndexer .
static void SBDDataGraphNode::clone (
const SBNodeIndexer & sourceNodeIndexer,
SBNodeIndexer & destinationNodeIndexer
)
This function clones the nodes in sourceNodeIndexer and places the roots of the clones in destinationNodeIndexer.
This variant is useful when multiple nodes must be cloned simultaneously. For example, cloning a bond would not clone the two referenced atoms, and the clone would still reference the original atoms. With this variant, placing the bond and the two referenced atoms in sourceNodeIndexer will result in three nodes in destinationNodeIndexer (the cloned bond and the two cloned atoms), and the cloned bond will reference the two bond atoms.
Note that all restrictions applying to clone cloning individual nodes still apply. In particular, if one of the nodes cannot be cloned, the function may return without modifying destinationNodeIndexer.
See also: Serialization
See also: clone()
function forEachNodeInSelection [1/2]#
Performs the action for each node innodeIndexer __
static void SBDDataGraphNode::forEachNodeInSelection (
SBNodeIndexer & nodeIndexer,
void(*)( SBDDataGraphNode *node) action
)
Executes a given action for each node in the provided indexer.
Iterates over all nodes in the SBNodeIndexer and calls the function pointer with each node.
Parameters:
nodeIndexerIndexer containing nodes to process.actionFunction pointer to be called for each node.
function forEachNodeInSelection [2/2]#
Performs the objects 'saction for each node innodeIndexer __
static void SBDDataGraphNode::forEachNodeInSelection (
SBNodeIndexer & nodeIndexer,
SBCClass * object,
void(SBCClass::*)( SBDDataGraphNode *node) action
)
Executes a member function on each node in the provided indexer using a given object.
Iterates over all nodes in the SBNodeIndexer and calls the specified member function of the object with each node.
Parameters:
nodeIndexerIndexer containing nodes to process.objectPointer to an object whose member function will be called.actionPointer to the member function of SBCClass that takes a SBDDataGraphNode*.
function getNode#
Returns the unique node corresponding to the node index nodeIndex .
Returns the unique node of the data graph node corresponding to the given node index.
Parameters:
nodeIndexThe index of the node to retrieve.
Returns:
Pointer to the node with the given index, or nullptr if not found.
See also: getNodeIndex
function getTypeString [2/2]#
Returns a string describing the type of the data graph node.
Returns a string describing the type of a data graph node.
This function is a convenience function used to produce a string corresponding to the given node type type.
Parameters:
typeThe node type to describe.humanReadableIftrue, returns a human‑readable string; otherwise returns the internal identifier (a programmatic string).
Returns:
A string representation of the node type.
Protected Functions Documentation#
function SBDDataGraphNode [1/2]#
Builds a data graph node.
(protected) constructor that is indirectly called when constructing instances of derived classes, assigning a unique index to the new node.
By default, the created flag, the selection flag and the highlighting flag are set to false, whereas the visibility flag is set to true.
See also: Node identity, Flags
function SBDDataGraphNode [2/2]#
Builds a data graph node.
(protected) constructor that builds a data graph node from an existing data pointer.
This constructor is used internally when the data graph node data already exists.
Parameters:
dataPointerPointer to the data graph node data.
See also: SBDDataGraphNode::SBDDataGraphNode()
function ~SBDDataGraphNode#
Destroys the node.
(protected) destructor that releases the node's unique index.
The destructor releases the node's unique index. When this destructor completes, the SBBaseEvent::Type::NodeDeleted event is emitted.
See also: Node identity