Loading...
Searching...
No Matches
SBDDataGraphNode Class Reference

This class is the base class to describe a node in the data graph. More...

Classes

class  All
 This node predicate returns true for all nodes. More...
 
class  DescendsFrom
 This node predicate returns true if the node descends from a given node or node indexer. More...
 
class  GetClass
 This node getter returns the class name of the node. More...
 
class  GetDocument
 This node getter returns the document the node belongs to. More...
 
class  GetElement
 This node getter returns the SAMSON Extension defining the node. More...
 
class  GetElementUUID
 This node getter returns the UUID of the SAMSON Extension defining the node. More...
 
class  GetFlags
 This node getter returns the flags of the node. More...
 
class  GetHighlightingFlag
 This node getter returns the highlighting flag of the node. More...
 
class  GetLockedFlag
 This node getter returns the locked flag of the node. More...
 
class  GetNextNode
 This node getter returns the next node in the parent's children. More...
 
class  GetNodeIndex
 This node getter returns the index of the node. More...
 
class  GetParent
 This node getter returns the parent of the node. More...
 
class  GetPreviousNode
 This node getter returns the previous node in the parent's children. More...
 
class  GetProxy
 This node getter returns the pointer to the class proxy of the node. More...
 
class  GetRoot
 This node getter returns the root of the node. More...
 
class  GetSelectionFlag
 This node getter returns the selection flag of the node. More...
 
class  GetThis
 This node getter returns the pointer to the node. More...
 
class  GetType
 This node getter returns the type of the node. More...
 
class  GetVisibilityFlag
 This node getter returns the visibility flag of the node. More...
 
class  HasMaterial
 This node predicate is true when the node has a material. More...
 
class  HasOneOf
 This node predicate returns true if the node is an ancestor of a node in a given node indexer. More...
 
class  IsAtom
 This node predicate is true when the node is an atom. More...
 
class  IsBallAndStick
 This node predicate is true when the node is a ball-and-stick visual model. More...
 
class  IsBond
 This node predicate is true when the node is a bond. More...
 
class  IsCartoon
 This node predicate is true when the node is a cartoon visual model. More...
 
class  IsCreated
 This node predicate returns true for created nodes. More...
 
class  IsDynamicalModel
 This node predicate is true when the node is a dynamical model. More...
 
class  IsErased
 This node predicate returns true for erased nodes. More...
 
class  IsGaussianSurface
 This node predicate is true when the node is a gaussian surface visual model. More...
 
class  IsHighlighted
 This node predicate returns true for highlighted nodes. More...
 
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. More...
 
class  IsInteractionModel
 This node predicate is true when the node is an interaction model. More...
 
class  IsLicorice
 This node predicate is true when the node is a licorice visual model. More...
 
class  IsLight
 This node predicate is true when the node is a light. More...
 
class  IsLocked
 This node predicate is true when the node is locked. More...
 
class  IsMesh
 This node predicate is true when the node is a mesh. More...
 
class  IsModel
 This node predicate is true when the node is a model, i.e. is a structural, visual, dynamical, interaction or property model. More...
 
class  IsOneOf
 This node predicate returns true for nodes in a given node indexer. More...
 
class  IsPropertyModel
 This node predicate is true when the node is a property model. More...
 
class  IsRibbon
 This node predicate is true when the node is a ribbon visual model. More...
 
class  IsSelected
 This node predicate returns true for selected nodes. More...
 
class  IsSerializable
 This node predicate returns true for serializable nodes. More...
 
class  IsSimulator
 This node predicate is true when the node is a simulator. More...
 
class  IsSolventAccessibleSurface
 This node predicate is true when the node is a solvent accessible surface visual model. More...
 
class  IsSolventExcludedSurface
 This node predicate is true when the node is a solvent excluded surface visual model. More...
 
class  IsStructuralModel
 This node predicate is true when the node is a structural model. More...
 
class  IsStructuralNode
 This node predicate is true when the node is a structural node. More...
 
class  IsTube
 This node predicate is true when the node is a tube visual model. More...
 
class  IsType
 This node predicate compares the node type with a given type. More...
 
class  IsVanDerWaals
 This node predicate is true when the node is a van der Waals visual model. More...
 
class  IsVisible
 This node predicate returns true for visible nodes. More...
 
class  IsVisualModel
 This node predicate is true when the node is a visual model. More...
 
class  None
 This node predicate returns false for all nodes. More...
 
class  OwnsMaterial
 This node predicate is true when the node owns a material. More...
 

Data graph node types

enum  Type {
  Undefined ,
  StructuralModel ,
  StructuralModelNode ,
  StructuralModelConformation ,
  Conformation ,
  StructuralModelPath ,
  Path ,
  StructuralModelNodeGroup ,
  StructuralGroup ,
  StructuralModelNodeRoot ,
  Root ,
  StructuralModelNodeAtom ,
  Atom ,
  StructuralModelNodeBond ,
  Bond ,
  StructuralModelNodeHydrogenBond ,
  HydrogenBond ,
  StructuralModelNodeHydrogenBondGroup ,
  HydrogenBondGroup ,
  StructuralModelNodeResidue ,
  Residue ,
  StructuralModelNodeSegment ,
  Segment ,
  StructuralModelNodeChain ,
  Chain ,
  StructuralModelNodeMolecule ,
  Molecule ,
  StructuralModelNodeBackbone ,
  Backbone ,
  StructuralModelNodeSideChain ,
  SideChain ,
  VisualModel ,
  VisualModelMesh ,
  Mesh ,
  DynamicalModel ,
  DynamicalModelParticleSystem ,
  ParticleSystem ,
  DynamicalModelRigidBodySystem ,
  RigidBodySystem ,
  DynamicalModelArticulatedBodySystem ,
  ArticulatedBodySystem ,
  DynamicalModelNode ,
  DynamicalNode ,
  DynamicalModelNodeGroup ,
  DynamicalGroup ,
  DynamicalModelNodeRoot ,
  DynamicalRoot ,
  DynamicalModelNodeParticle ,
  Particle ,
  DynamicalModelNodeRigidBody ,
  RigidBody ,
  DynamicalModelNodeArticulatedBody ,
  ArticulatedBody ,
  InteractionModel ,
  InteractionModelParticleSystem ,
  InteractionModelRigidBodySystem ,
  InteractionModelArticulatedBodySystem ,
  PropertyModel ,
  PropertyModelFunction ,
  Simulator ,
  SimulatorParticleSystem ,
  SimulatorRigidBodySystem ,
  SimulatorArticulatedBodySystem ,
  StateUpdater ,
  StateUpdaterParticleSystem ,
  StateUpdaterRigidBodySystem ,
  StateUpdaterArticulatedBodySystem ,
  Animation ,
  Camera ,
  Document ,
  DocumentManager ,
  File ,
  Folder ,
  Label ,
  Light ,
  Note ,
  Presentation ,
  RenderPreset ,
  DataGraphNodeGroup ,
  NodeGroup ,
  Controller ,
  ControllerNode ,
  Asset
}
 The type of the data graph node. More...
 
enum class  RenderingPass {
  Setup ,
  OpaqueGeometry ,
  SelectableGeometry ,
  ShadowingGeometry ,
  TransparentGeometry ,
  Interface ,
  Text
}
 The rendering pass. More...
 

Serialization

virtual bool isSerializable () const
 Returns true when the class is serializable.
 
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.
 
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.
 

Topology

SBDDataGraphNodegetParent () const
 Returns the parent of the node.
 
SBDDataGraphNodegetThisNode () const
 Returns the pointer to this node.
 
SBDDataGraphNodegetNextNode () const
 Returns the pointer to the next node in the children of the node's parent.
 
SBDDataGraphNodegetPreviousNode () const
 Returns the pointer to the previous node in the children of the node's parent.
 
SBDDataGraphNodegetNextNode (SBDDataGraphNode::Type nodeType) const
 Returns the pointer to the next node with type nodeType in the children of the node's parent.
 
SBDDataGraphNodegetPreviousNode (SBDDataGraphNode::Type nodeType) const
 Returns the pointer to the previous node with type nodeType in the children of the node's parent.
 
SBDDocumentgetDocument () const
 Returns the document the node belongs to.
 
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.
 
virtual bool canHaveDescendantType (SBDDataGraphNode::Type nodeType) const
 Returns whether this node can have a node with type nodeType as a descendant.
 
virtual bool addChild (SBDDataGraphNode *node, SBDDataGraphNode *nextNode=nullptr)
 Adds a child to the node.
 
virtual bool removeChild (SBDDataGraphNode *node)
 Removes a child from the node.
 
bool hasOneOf (const SBNodeIndexer &nodeIndexer) const
 Returns true if and only if this node is one of the nodes of the nodeIndexer, or is the ancestor of one of them, or is a group that stores one of them.
 
bool descendsFrom (const SBDDataGraphNode *node) const
 Returns true if and only if this node is node, or descends from it.
 
bool descendsFrom (const SBNodeIndexer &nodeIndexer) const
 Returns true if and only if this node is one of the nodes of the nodeIndexer, 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 the nodePointerIndexer, or descends from one of them.
 
bool isIn (const SBDDataGraphNode *node) const
 Returns true if and only if this node is node, or descends from it, or belongs to a group stored in node.
 
bool isIn (const SBNodeIndexer &nodeIndexer) const
 Returns true if and only if this node is one of the nodes of the nodeIndexer, or descends from one of them, or belongs to a group stored in one of the nodes of the nodeIndexer.
 
bool isIn (SBPointerIndexer< SBDDataGraphNode > *nodePointerIndexer) const
 Returns true if and only if this node is one of the nodes of the nodePointerIndexer, or descends from one of them, or belongs to a group stored in of the nodes of the nodePointerIndexer.
 
bool isOneOf (const SBNodeIndexer &nodeIndexer) const
 Returns true if and only if this node is one of the nodes of the nodeIndexer.
 
bool isOneOf (SBPointerIndexer< SBDDataGraphNode > *nodePointerIndexer) const
 Returns true if and only if this node is one of the nodes of the nodePointerIndexer.
 
SBDDataGraphNodegetRoot () const
 Returns the root of the hierarchy the node belongs to.
 
virtual SBDDataGraphNodeclone ()
 Returns a copy of the node and its descendants.
 
static void clone (const SBNodeIndexer &sourceNodeIndexer, SBNodeIndexer &destinationNodeIndexer)
 Clones the nodes in sourceNodeIndexer (treated as a whole) and places the clones in destinationNodeIndexer.
 

Identity

unsigned int getNodeIndex () const
 Returns the node index (unique in the whole data graph, but non-persistent)
 
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.
 
virtual std::string const & getName () const
 Returns the name of the node.
 
virtual void setName (const std::string &name)
 Sets the name of the node.
 
bool isType (Type type) const
 Returns true when the type of the node corresponds to type.
 
bool isModel () const
 Returns true when the node is a model.
 
bool isAtom () const
 Returns true when the node is an atom.
 
bool isBond () const
 Returns true when the node is a bond.
 
bool isStructuralNode () const
 Returns true when the node is a structural node.
 
bool isStructuralModel () const
 Returns true when the node is a structural model.
 
bool isVisualModel () const
 Returns true when the node is a visual model.
 
bool isDynamicalModel () const
 Returns true when the node is a dynamical model.
 
bool isInteractionModel () const
 Returns true when the node is a interaction model.
 
bool isPropertyModel () const
 Returns true when the node is a property model.
 
bool isMesh () const
 Returns true when the node is a mesh.
 
bool isLight () const
 Returns true when the node is a light.
 
bool isSimulator () const
 Returns true when the node is a simulator.
 
bool isBallAndStick () const
 Returns true when the node is the default ball-and-stick visual model.
 
bool isLicorice () const
 Returns true when the node is the default licorice visual model.
 
bool isVanDerWaals () const
 Returns true when the node is the default van der Waals visual model.
 
bool isCartoon () const
 Returns true when the node is the default cartoon visual model.
 
bool isRibbon () const
 Returns true when the node is the default ribbon visual model.
 
bool isTube () const
 Returns true when the node is the default tube visual model.
 
bool isGaussianSurface () const
 Returns true when the node is the default Gaussian surface visual model.
 
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.
 
static SBDDataGraphNodegetNode (unsigned int nodeIndex)
 Returns the unique node corresponding to the node index nodeIndex.
 
static std::string getTypeString (Type type, bool humanReadable=false)
 Returns a string describing the type of the data graph node.
 

Locking

virtual bool isLocked () const
 Returns whether the node is locked.
 
virtual bool getLockedFlag () const
 Returns the locked flag.
 
virtual void setLockedFlag (bool flag)
 Sets the locked flag.
 

Lifecycle

bool isCreated () const
 Returns true if and only if the node is created.
 
void create ()
 Creates the node.
 
bool isErased () const
 Returns true if and only if the node is erased.
 
void erase ()
 Erases the node.
 

Flags

virtual unsigned int getFlags () const
 Returns the flags.
 
virtual unsigned int getInheritedFlags () const
 Returns the inherited flags.
 

Selection

bool isSelected () const
 Returns whether the node is selected.
 
bool getSelected () const
 Returns whether the node is selected.
 
bool getSelectionFlag () const
 Returns the selection flag.
 
void setSelectionFlag (bool flag)
 Sets the selection flag.
 

Visibility

bool isVisible () const
 Returns whether the node is visible.
 
bool getVisible () const
 Returns whether the node is visible.
 
bool getVisibilityFlag () const
 Returns the visibility flag.
 
void setVisibilityFlag (bool flag)
 Sets the visibility flag.
 

Highlighting

bool isHighlighted () const
 Returns whether the node is highlighted.
 
bool getHighlightingFlag () const
 Returns the highlighting flag.
 
void setHighlightingFlag (bool flag)
 Sets the highlighting flag.
 

Rendering

virtual void display (RenderingPass renderingPass)
 Displays the node.
 
virtual void display ()
 Displays the node (deprecated)
 
virtual void displayForShadow ()
 Displays the node for shadowing purposes (deprecated)
 
virtual void displayForSelection ()
 Displays the node for selection purposes (deprecated)
 
virtual unsigned int getOpacity () const
 Returns the opacity.
 
virtual void setOpacity (unsigned int opacity)
 Sets the opacity.
 
virtual bool hasOpacityRange () const
 Returns whether the node has the opacity range.
 
virtual unsigned int getDefaultOpacity () const
 Returns the default opacity.
 
virtual unsigned int getMinimumOpacity () const
 Returns the minimum opacity.
 
virtual unsigned int getMaximumOpacity () const
 Returns the maximum opacity.
 
virtual unsigned int getOpacitySingleStep () const
 Returns the opacity single step.
 
virtual std::string getOpacitySuffix () const
 Returns the opacity suffix.
 
virtual unsigned int getTransparency () const
 Returns the transparency.
 
virtual void setTransparency (unsigned int transparency)
 Sets the transparency.
 
virtual bool hasTransparencyRange () const
 Returns whether the node has the transparency range.
 
virtual unsigned int getDefaultTransparency () const
 Returns the default transparency.
 
virtual unsigned int getMinimumTransparency () const
 Returns the minimum transparency.
 
virtual unsigned int getMaximumTransparency () const
 Returns the maximum transparency.
 
virtual unsigned int getTransparencySingleStep () const
 Returns the transparency single step.
 
virtual std::string getTransparencySuffix () const
 Returns the transparency suffix.
 
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.
 
bool canAddMaterial () const
 Returns whether can add a material to the node based on its type.
 
bool addMaterial (SBDDataGraphNodeMaterial *material)
 Adds a material.
 
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.
 
bool hasMaterial () const
 Returns whether the node has a material (by itself, or inherited)
 
bool ownsMaterial () const
 Returns whether the node owns a material.
 
SBDDataGraphNodeMaterialgetMaterial () const
 Returns the material.
 
SBDDataGraphNodegetMaterialOwner () const
 Returns the node whose material is inherited.
 
static bool canAddMaterial (SBDDataGraphNode::Type nodeType)
 Returns whether can add a material to a node of type nodeType.
 

Messaging

void connectBaseSignalToSlot (SBCReferenceTarget *referenceTarget, void(SBCReferenceTarget::*functionPointer)(SBBaseEvent *), SBCReferenceTarget *nextReferenceTarget=0, void(SBCReferenceTarget::*nextFunctionPointer)(SBBaseEvent *)=0)
 Connects the base signal to a slot.
 
bool baseSignalIsConnectedToSlot (SBCReferenceTarget *referenceTarget, void(SBCReferenceTarget::*functionPointer)(SBBaseEvent *)) const
 Returns true when the base signal is connected to a slot.
 
void disconnectBaseSignalFromSlot (SBCReferenceTarget *referenceTarget, void(SBCReferenceTarget::*functionPointer)(SBBaseEvent *))
 Disconnects the base signal from a slot.
 

Selection functions

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 a nodeType, a selection status and a visitPredicate, 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 a selectionPredicate and a visitPredicate, with or without dependencies.
 
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 a visitPredicate, 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 a visitPredicate, with or without dependencies.
 
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 a visitPredicate, 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 a visitPredicate, with or without dependencies.
 

Visitor functions

virtual void forEachNodeDepthFirst (void(*action)(SBDDataGraphNode *node))
 Performs an action on each node.
 
virtual void forEachNodeDepthFirst (SBCClass *object, void(SBCClass::*action)(SBDDataGraphNode *node))
 Performs an action on each node.
 
static void forEachNodeInSelection (SBNodeIndexer &nodeIndexer, void(*action)(SBDDataGraphNode *node))
 Performs an action for each node in a selection.
 
static void forEachNodeInSelection (SBNodeIndexer &nodeIndexer, SBCClass *object, void(SBCClass::*action)(SBDDataGraphNode *node))
 Performs an action for each node in a selection.
 

Information

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.
 

Statistics

virtual unsigned int getNumberOfChains ()
 Returns the number of chains.
 
virtual unsigned int getNumberOfMolecules ()
 Returns the number of molecules.
 
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 getNumberOfAtoms ()
 Returns the number of atoms.
 
virtual unsigned int getNumberOfCarbons ()
 Returns the number of carbons.
 
virtual unsigned int getNumberOfHydrogens ()
 Returns the number of hydrogens.
 
virtual unsigned int getNumberOfNitrogens ()
 Returns the number of nitrogens.
 
virtual unsigned int getNumberOfOxygens ()
 Returns the number of oxygens.
 
virtual unsigned int getNumberOfSulfurs ()
 Returns the number of sulfurs.
 
virtual unsigned int getNumberOfCoarseGrainedAtoms ()
 Returns the number of coarse-grained atoms.
 
virtual unsigned int getNumberOfOtherAtoms ()
 Returns the number of other atoms.
 
virtual int getSumOfFormalCharges ()
 Returns the sum of formal charges.
 
virtual float getSumOfPartialCharges ()
 Returns the sum of partial charges.
 
virtual SBQuantity::mass getMolecularWeight ()
 Returns the molecular weight.
 

Debugging

virtual void print (unsigned int offset=0) const
 Prints some debugging information.
 
 SB_DECLARE_DATA (SBDDataGraphNode)
 

Constructors and destructors

 SBDDataGraphNode ()
 Builds a data graph node.
 
 SBDDataGraphNode (SBDDataGraphNodeData *dataPointer)
 Builds a data graph node.
 
virtual ~SBDDataGraphNode ()
 Destroys the node.
 

Topology implementation

virtual void onErase ()
 Implementation of the erase function for this node.
 

Additional Inherited Members

- Public Member Functions inherited from SBCReferenceTarget
unsigned int getMemoryFootprint () const
 
void printReferencesToOwners () const
 
 SBCReferenceTarget ()
 
virtual ~SBCReferenceTarget ()
 
- Protected Member Functions inherited from SBCReferenceTarget
void removeAllReferenceOwners ()
 
 SBCReferenceTarget (SBCReferenceTargetData *dataPointer)
 
- Protected Attributes inherited from SBCReferenceTarget
SBCReferenceTargetData * dataPointer
 

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

The document view shows SAMSON's data graph structure

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 new operator)
  • 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 must be used:

SBPointer<SBAtom> nodePointer = new SBAtom();
// ...
// remove all references to the atom, and delete it
nodePointer.deleteReferenceTarget();
SBMStructuralModelNodeAtom SBAtom
The short name of SBMStructuralModelNodeAtom.
Definition: SBMStructuralModelNodeAtom.hpp:666
See also
Referencing
Memory management

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;
static SBDDocument * getActiveDocument()
Returns a pointer to SAMSON's active document.
Definition: SAMSON.cpp:738
@ Atom
Atom.
Definition: SBDDataGraphNode.hpp:67
This class describes a node indexer.
Definition: SBDDataGraphNodeIndexer.hpp:21
virtual void getNodes(SBNodeIndexer &nodeIndexer, SBNode::Type nodeType, bool selectedNodesOnly=false, const SBNodePredicate &visitPredicate=SBDDataGraphNode::All(), bool includeDependencies=false) const override
Collects nodes into nodeIndexer, based on a nodeType, a selection status and a visitPredicate,...
Definition: SBDDocumentFolder.cpp:804

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
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;
This node predicate compares the node type with a given type.
Definition: SBDDataGraphNode.hpp:512
This class is the base class to describe a node in the data graph.
Definition: SBDDataGraphNode.hpp:33

and the SBNode::IsSelected predicate may be used to collect all nodes that are selected (directly, because their selection flag is true, or because one of their ancestors is selected):

// Find all selected nodes
SBNodeIndexer nodeIndexer;
This node predicate returns true for selected nodes.
Definition: SBDDataGraphNode.hpp:548

Predicates may be combined through logical operations. For example, collecting selected atoms may be achieved with:

// Find all selected nodes
SBNodeIndexer nodeIndexer;
This node predicate is true when the node is an atom.
Definition: SBDDataGraphNode.hpp:514

Please refer to Functors for more information.

See also
getNodes
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
This node getter returns the type of the node.
Definition: SBDDataGraphNode.hpp:495

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;

since the statement 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;
(SBAtom::GetTemperatureFactor() > 2.0));

Node predicates and node getters constitute the foundation of SAMSON's Node Specification Language.

See also
getNodes
Functors
Node Specification Language

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 in SAMSON for more information.

Member Enumeration Documentation

◆ RenderingPass

Enumerator
Setup 

The pass where setup is performed (no rendering occurs)

OpaqueGeometry 

The pass where opaque geometry is rendered.

SelectableGeometry 

The pass where selectable geometry is rendered.

ShadowingGeometry 

The pass where shadowing geometry is rendered.

TransparentGeometry 

The pass where transparent geometry is rendered.

Interface 

The pass where 2D and 3D interface components are rendered.

Text 

The pass where text is rendered.

◆ Type

Enumerator
Undefined 

The undefined type.

StructuralModel 

Structural model.

StructuralModelNode 

Structural node.

StructuralModelConformation 

Structural conformation.

Conformation 

Structural conformation.

StructuralModelPath 

Structural path.

Path 

Structural path.

StructuralModelNodeGroup 

Structural group.

StructuralGroup 

Structural group.

StructuralModelNodeRoot 

Structural root.

Root 

Structural root.

StructuralModelNodeAtom 

Atom.

Atom 

Atom.

StructuralModelNodeBond 

Bond.

Bond 

Bond.

StructuralModelNodeHydrogenBond 

Hydrogen bond.

HydrogenBond 

Hydrogen bond.

StructuralModelNodeHydrogenBondGroup 

Hydrogen bond group.

HydrogenBondGroup 

Hydrogen bond group.

StructuralModelNodeResidue 

Residue.

Residue 

Residue.

StructuralModelNodeSegment 

Segment.

Segment 

Segment.

StructuralModelNodeChain 

Chain.

Chain 

Chain.

StructuralModelNodeMolecule 

Molecule.

Molecule 

Molecule.

StructuralModelNodeBackbone 

Residue backbone.

Backbone 

Residue backbone.

StructuralModelNodeSideChain 

Residue sideChain.

SideChain 

Residue sideChain.

VisualModel 

Visual model.

VisualModelMesh 

Mesh.

Mesh 

Mesh.

DynamicalModel 

Dynamical model.

DynamicalModelParticleSystem 

Particle dynamical model.

ParticleSystem 

Particle dynamical model.

DynamicalModelRigidBodySystem 

Rigid-body dynamical model.

RigidBodySystem 

Rigid-body dynamical model.

DynamicalModelArticulatedBodySystem 

Articulated-body dynamical model.

ArticulatedBodySystem 

Articulated-body dynamical model.

DynamicalModelNode 

Dynamical node.

DynamicalNode 

Dynamical node.

DynamicalModelNodeGroup 

Dynamical group.

DynamicalGroup 

Dynamical group.

DynamicalModelNodeRoot 

Dynamical root.

DynamicalRoot 

Dynamical root.

DynamicalModelNodeParticle 

Particle.

Particle 

Particle.

DynamicalModelNodeRigidBody 

Rigid body.

RigidBody 

Rigid body.

DynamicalModelNodeArticulatedBody 

Articulated body.

ArticulatedBody 

Articulated body.

InteractionModel 

Interaction model.

InteractionModelParticleSystem 

Particle interaction model.

InteractionModelRigidBodySystem 

Rigid-body interaction model.

InteractionModelArticulatedBodySystem 

Articulated-body interaction model.

PropertyModel 

Property model.

PropertyModelFunction 

Scalar field.

Simulator 

Simulator.

SimulatorParticleSystem 

Particle simulator.

SimulatorRigidBodySystem 

Rigid-body simulator.

SimulatorArticulatedBodySystem 

Articulated-body simulator.

StateUpdater 

State updater.

StateUpdaterParticleSystem 

Particle state updater.

StateUpdaterRigidBodySystem 

Rigid-body state updater.

StateUpdaterArticulatedBodySystem 

Articulated-body state updater.

Animation 

Animation.

Camera 

Camera.

Document 

Document.

DocumentManager 

Document manager.

File 

File.

Folder 

Folder.

Label 

Label.

Light 

Light.

Note 

Note.

Presentation 

Presentation.

RenderPreset 

Render preset.

DataGraphNodeGroup 

Group.

NodeGroup 

Group.

Controller 

Controller.

ControllerNode 

Controller node.

Asset 

Asset.

Constructor & Destructor Documentation

◆ SBDDataGraphNode()

SBDDataGraphNode::SBDDataGraphNode ( )
protected

This (protected) constructor is indirectly called when constructing instances of derived classes, and assigns 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

◆ ~SBDDataGraphNode()

SBDDataGraphNode::~SBDDataGraphNode ( )
protectedvirtual

This (protected) destructor is indirectly called when deleting instances of derived classes. The destructor releases the node's unique index. When this destructor completes, the SBBaseEvent::NodeDeleted event is emitted.

See also
Node identity

Member Function Documentation

◆ addChild()

bool SBDDataGraphNode::addChild ( SBDDataGraphNode node,
SBDDataGraphNode nextNode = nullptr 
)
virtual
Parameters
nodeA pointer to the child that should be added
nextNodeA pointer to the node before which the child should be added

This functions 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. The function returns true if the child was added successfully.

This function is undoable

See also
removeChild

Reimplemented in SBMDynamicalModelNodeGroup.

◆ addMaterial()

bool SBDDataGraphNode::addMaterial ( SBDDataGraphNodeMaterial material)

This functions 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.

Please see Materials for more information

This function is undoable

See also
Materials
hasMaterial, ownsMaterial, removeMaterial, getMaterial, getMaterialOwner

◆ canAddChild()

bool SBDDataGraphNode::canAddChild ( const SBDDataGraphNode node,
const SBDDataGraphNode nextNode = nullptr 
) const
virtual
Parameters
nodeA pointer to a potential child
nextNodeA pointer to the node before which the child should be added

This functions 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

◆ canAddChildType()

◆ canAddMaterial() [1/2]

bool SBDDataGraphNode::canAddMaterial ( ) const

This functions 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.

See also
Materials
hasMaterial, ownsMaterial, removeMaterial, getMaterial, getMaterialOwner

◆ canAddMaterial() [2/2]

bool SBDDataGraphNode::canAddMaterial ( SBDDataGraphNode::Type  nodeType)
static

This functions 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.

See also
Materials
hasMaterial, ownsMaterial, removeMaterial, getMaterial, getMaterialOwner

◆ canHaveDescendantType()

bool SBDDataGraphNode::canHaveDescendantType ( SBDDataGraphNode::Type  nodeType) const
virtual

◆ clone() [1/2]

SBDDataGraphNode * SBDDataGraphNode::clone ( )
virtual

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 mechanism), 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
}
static void endHolding()
Ends holding.
Definition: SAMSON.cpp:2141
static void beginHolding(const std::string &name)
Begins holding.
Definition: SAMSON.cpp:2138
static void hold(void *object)
Holds an object.
Definition: SAMSON.cpp:2143
void create()
Creates the node.
Definition: SBDDataGraphNode.cpp:2312
virtual SBDDataGraphNode * clone()
Returns a copy of the node and its descendants.
Definition: SBDDataGraphNode.cpp:1074

Finally, note that cloning assumes that the serialize and unserialize functions have been implemented for each cloned node.

See also
Serialization

Reimplemented in SBDAsset, SBDController, SBDControllerNode, SBDDataGraphNodeGroup, SBDDocument, SBDDocumentAnimation, SBDDocumentCamera, SBDDocumentFile, SBDDocumentFolder, SBDDocumentLabel, SBDDocumentLight, SBDDocumentNote, SBDDocumentPresentation, SBDDocumentRenderPreset, SBMDynamicalModel, SBMDynamicalModelNode, SBMDynamicalModelNodeGroup, SBMDynamicalModelNodeRoot, SBMModel, SBMModelNode, SBMStructuralModel, SBMStructuralModelConformation, SBMStructuralModelNode, SBMStructuralModelNodeAtom, SBMStructuralModelNodeBackbone, SBMStructuralModelNodeBond, SBMStructuralModelNodeChain, SBMStructuralModelNodeGroup, SBMStructuralModelNodeHydrogenBond, SBMStructuralModelNodeHydrogenBondGroup, SBMStructuralModelNodeMolecule, SBMStructuralModelNodeResidue, SBMStructuralModelNodeRoot, SBMStructuralModelNodeSegment, SBMStructuralModelNodeSideChain, SBMStructuralModelPath, SBMVisualModelMesh, SBSSimulator, SBSSimulatorParticleSystem, SBSStateUpdater, and SBSStateUpdaterParticleSystem.

◆ clone() [2/2]

void SBDDataGraphNode::clone ( const SBNodeIndexer sourceNodeIndexer,
SBNodeIndexer destinationNodeIndexer 
)
static

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
clone()

◆ connectBaseSignalToSlot()

void SBDDataGraphNode::connectBaseSignalToSlot ( SBCReferenceTarget referenceTarget,
void(SBCReferenceTarget::*)(SBBaseEvent *)  functionPointer,
SBCReferenceTarget nextReferenceTarget = 0,
void(SBCReferenceTarget::*)(SBBaseEvent *)  nextFunctionPointer = 0 
)
Parameters
referenceTargetA pointer to the reference target that will receives the signal
functionPointerA pointer to the reference target's member function that will be called when the node's base signal is emitted
nextReferenceTargetA pointer to the next reference target; null by default
nextFunctionPointerA 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 undoable

See also
disconnectBaseSignalFromSlot
baseSignalIsConnectedToSlot

◆ countNodes() [1/2]

unsigned int SBDDataGraphNode::countNodes ( const SBNodePredicate selectionPredicate = SBDDataGraphNode::All(),
const SBNodePredicate visitPredicate = SBDDataGraphNode::All(),
bool  includeDependencies = false 
) const

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.

See also
getNodes, hasNode

◆ countNodes() [2/2]

unsigned int SBDDataGraphNode::countNodes ( SBDDataGraphNode::Type  nodeType,
bool  selectedNodesOnly = false,
const SBNodePredicate visitPredicate = SBDDataGraphNode::All(),
bool  includeDependencies = false 
) const

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.

See also
getNodes, hasNode

◆ create()

void SBDDataGraphNode::create ( )

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
Node lifecycle
Signals and slots

This function is undoable

◆ descendsFrom() [1/3]

bool SBDDataGraphNode::descendsFrom ( const SBDDataGraphNode node) const
See also
Data Graph

◆ descendsFrom() [2/3]

bool SBDDataGraphNode::descendsFrom ( const SBNodeIndexer nodeIndexer) const

This function returns true if and only if this node is one of the nodes of the nodeIndexer, or descends from one of them.

See also
Data Graph

◆ descendsFrom() [3/3]

bool SBDDataGraphNode::descendsFrom ( SBPointerIndexer< SBDDataGraphNode > *  nodePointerIndexer) const

This function returns true if and only if this node is one of the nodes of the nodePointerIndexer, or descends from one of them.

See also
Data Graph

◆ display() [1/2]

void SBDDataGraphNode::display ( )
virtual

This function is deprecated and will be removed in a future version. Implement SBDDataGraphNode::display(RenderingPass renderingPass) instead.

◆ display() [2/2]

void SBDDataGraphNode::display ( RenderingPass  renderingPass)
virtual

This function displays the node. It receives from the SAMSON renderer the current renderingPass which indicates what the function should display.

  • 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 geometry
  • SelectableGeometry: the pass where you should render selectable geometry
  • ShadowingGeometry: the pass where you should render shadowing geometry
  • TransparentGeometry: the pass where you should render transparent geometry
  • Interface: the pass where you should render 2D and 3D interface components
  • Text: 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().

Reimplemented in SBDController, and SBDDocumentAnimation.

◆ displayForSelection()

void SBDDataGraphNode::displayForSelection ( )
virtual

This function is deprecated and will be removed in a future version. Implement SBDDataGraphNode::display(RenderingPass renderingPass) instead.

◆ displayForShadow()

void SBDDataGraphNode::displayForShadow ( )
virtual

This function is deprecated and will be removed in a future version. Implement SBDDataGraphNode::display(RenderingPass renderingPass) instead.

◆ erase()

void SBDDataGraphNode::erase ( )

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::NodeEraseBegin immediately before erasing begins, SBBaseEvent::NodeEraseEnd after erasing is complete, and finally SBBaseEvent::NodeErased. Precisely, the erase function sends the SBBaseEvent::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::NodeEraseEnd and the SBBaseEvent::NodeErased events. In the case of a bond, for example, the operations mentioned above are thus performed between the SBBaseEvent::NodeEraseBegin and SBBaseEvent::NodeEraseEnd events.

For more information, please refer to section Node lifecycle.

See also
isCreated
isErased
create
erase
onErase
Node lifecycle

◆ forEachNodeDepthFirst() [1/2]

void SBDDataGraphNode::forEachNodeDepthFirst ( SBCClass object,
void(SBCClass::*)(SBDDataGraphNode *node)  action 
)
virtual

◆ forEachNodeDepthFirst() [2/2]

◆ getDocument()

SBDDocument * SBDDataGraphNode::getDocument ( ) const

This function returns a pointer to the document the node belongs to. It goes up the ascendants of the node, and attempts to find a document node. If it doesn't find one, it returns 0.

◆ getFlags()

unsigned int SBDDataGraphNode::getFlags ( ) const
virtual

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
getSelectionFlag
getHighlightingFlag

Reimplemented in SBMStructuralModelNodeAtom.

◆ getHierarchyString()

std::string SBDDataGraphNode::getHierarchyString ( const std::string &  separator = " / ",
bool  includeNodeType = false 
) const
virtual

This functions returns a string with information on the node's hierarchy. This information can be used for logging and debugging.

Reimplemented in SBMStructuralModelNodeAtom.

◆ getHighlightingFlag()

bool SBDDataGraphNode::getHighlightingFlag ( ) const

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

◆ getInheritedFlags()

unsigned int SBDDataGraphNode::getInheritedFlags ( ) const
virtual

This function returns an unsigned int that contains the inherited flags of the node:

  • the first bit is true if the node is selected
  • the second bit is true if the node is highlighted
Returns
the flags
See also
isSelected
isHighlighted

Reimplemented in SBMStructuralModelNodeAtom.

◆ getLockedFlag()

bool SBDDataGraphNode::getLockedFlag ( ) const
virtual

◆ getMaterial()

SBDDataGraphNodeMaterial * SBDDataGraphNode::getMaterial ( ) const

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).

See also
Materials
hasMaterial, ownsMaterial, removeMaterial, addMaterial, getMaterialOwner

◆ getMaterialOwner()

SBDDataGraphNode * SBDDataGraphNode::getMaterialOwner ( ) const

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.

See also
Materials
getMaterial, hasMaterial, ownsMaterial, addMaterial, removeMaterial

◆ getMaximumTransparency()

unsigned int SBDDataGraphNode::getMaximumTransparency ( ) const
virtual

◆ getMinimumOpacity()

unsigned int SBDDataGraphNode::getMinimumOpacity ( ) const
virtual

◆ getMolecularWeight()

SBQuantity::mass SBDDataGraphNode::getMolecularWeight ( )
virtual

◆ getName()

std::string const & SBDDataGraphNode::getName ( ) const
virtual

Reimplemented in SBDAsset, and SBMStructuralModelNodeAtom.

◆ getNextNode() [1/2]

SBDDataGraphNode * SBDDataGraphNode::getNextNode ( ) const

This function returns a pointer to the next node in the children of the node's parent.

◆ getNextNode() [2/2]

SBDDataGraphNode * SBDDataGraphNode::getNextNode ( SBDDataGraphNode::Type  nodeType) const

This function returns a pointer to the next node with type nodeType in the children of the node's parent.

◆ getNode()

SBDDataGraphNode * SBDDataGraphNode::getNode ( unsigned int  nodeIndex)
static

This function returns the unique node of the data graph node corresponding to the nodeIndex.

See also
getNodeIndex

◆ getNodeIndex()

unsigned int SBDDataGraphNode::getNodeIndex ( ) const

This function 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.

◆ getNodes() [1/2]

void SBDDataGraphNode::getNodes ( SBNodeIndexer nodeIndexer,
const SBNodePredicate selectionPredicate = SBDDataGraphNode::All(),
const SBNodePredicate visitPredicate = SBDDataGraphNode::All(),
bool  includeDependencies = false 
) const
virtual

This function traverses the node's sub-tree for which visitPredicate is true (depth-first), and stores in nodeIndexer the nodes for which the selectionPredicate is true. Precisely, if the visitPredicate returns false, the 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. Note that the node itself must satisfy the visitPredicate else nothing is visited.

When includeDependencies is true, the function also adds to nodeIndexer 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 added to the nodeIndexer 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:

void SEMyVisualModel::getNodes(SBNodeIndexer& nodeIndexer,
const SBNodePredicate& selectionPredicate,
const SBNodePredicate& visitPredicate,
bool includeDependencies) {
if (!visitPredicate(this)) return;
if (selectionPredicate(this)) nodeIndexer.push_back(this);
if (includeDependencies) {
SB_FOR(SBNode* node, atomIndexer) {
node->getNodes(nodeIndexer,
selectionPredicate,
visitPredicate,
includeDependencies);
}
}
}
#define SB_FOR(VARIABLE, CONTAINER)
A macro to easily write for loops involving containers.
Definition: SBCContainerFor.hpp:83
SBDDataGraphNodePredicate SBNodePredicate
The short name of SBDDataGraphNodePredicate.
Definition: SBDDataGraphNodePredicate.hpp:27
unsigned int push_back(const ObjectType &object)
Adds an object in the indexer if possible, and returns the index of the object.
Definition: SBCContainerIndexer.hpp:388
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 a nodeType, a selection status and a visitPredicate,...
Definition: SBDDataGraphNode.cpp:1797

Note that the nodeIndexer is not cleared when entering this function.

See also
SBNodeIndexer
SBNodePredicate
hasNode, countNodes

Reimplemented in SBDController, SBDControllerNode, SBDDataGraphNodeGroup, SBDDocumentFolder, SBDDocumentPresentation, SBMDynamicalModel, SBMDynamicalModelNode, SBMStructuralModel, SBMStructuralModelConformation, SBMStructuralModelNode, SBMStructuralModelNodeBond, SBMStructuralModelNodeGroup, SBMStructuralModelNodeHydrogenBond, SBMStructuralModelPath, and SBSSimulatorParticleSystem.

◆ getNodes() [2/2]

void SBDDataGraphNode::getNodes ( SBNodeIndexer nodeIndexer,
SBDDataGraphNode::Type  nodeType,
bool  selectedNodesOnly = false,
const SBNodePredicate visitPredicate = SBDDataGraphNode::All(),
bool  includeDependencies = false 
) const
virtual

This function traverses the node's sub-tree for which visitPredicate is true (depth-first), and stores in nodeIndexer the nodes whose type is nodeType. Precisely, if the visitPredicate returns false, the 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. Note that the node itself must satisfy the visitPredicate else nothing is visited.

If selectedNodesOnly is set to true, then only nodes that are selected, directly or via their parents, will be traversed.

When includeDependencies is true, the function also adds to nodeIndexer 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 the node type is nodeType and they satisfy they satisfy visitPredicate, they are added to the nodeIndexer 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:

void SEMyVisualModel::getNodes(SBNodeIndexer& nodeIndexer,
SBNode::Type nodeType,
bool selectedNodesOnly,
const SBNodePredicate& visitPredicate,
bool includeDependencies) {
if (!visitPredicate(this)) return;
if ((getType() == nodeType) && (!selectedNodesOnly || isSelected())) nodeIndexer.push_back(this);
if (includeDependencies) {
SB_FOR(SBNode* node, atomIndexer) {
node->getNodes(nodeIndexer,
nodeType,
selectedNodesOnly,
visitPredicate,
includeDependencies);
}
}
}
Type
The type of the data graph node.
Definition: SBDDataGraphNode.hpp:44
virtual Type getType() const
Returns the type of the data graph node.
Definition: SBDDataGraphNode.cpp:364
bool isSelected() const
Returns whether the node is selected.
Definition: SBDDataGraphNode.cpp:1289

Note that the nodeIndexer is not cleared when entering this function.

See also
SBNodeIndexer
SBNodePredicate
hasNode, countNodes

Reimplemented in SBDController, SBDControllerNode, SBDDataGraphNodeGroup, SBDDocumentFolder, SBDDocumentPresentation, SBMDynamicalModel, SBMDynamicalModelNode, SBMStructuralModel, SBMStructuralModelConformation, SBMStructuralModelNode, SBMStructuralModelNodeBond, SBMStructuralModelNodeGroup, SBMStructuralModelNodeHydrogenBond, SBMStructuralModelPath, and SBSSimulatorParticleSystem.

◆ getNumberOfAtoms()

unsigned int SBDDataGraphNode::getNumberOfAtoms ( )
virtual

◆ getNumberOfCarbons()

unsigned int SBDDataGraphNode::getNumberOfCarbons ( )
virtual

◆ getNumberOfChains()

unsigned int SBDDataGraphNode::getNumberOfChains ( )
virtual

◆ getNumberOfCoarseGrainedAtoms()

unsigned int SBDDataGraphNode::getNumberOfCoarseGrainedAtoms ( )
virtual

◆ getNumberOfHydrogens()

unsigned int SBDDataGraphNode::getNumberOfHydrogens ( )
virtual

◆ getNumberOfMolecules()

unsigned int SBDDataGraphNode::getNumberOfMolecules ( )
virtual

◆ getNumberOfNitrogens()

unsigned int SBDDataGraphNode::getNumberOfNitrogens ( )
virtual

◆ getNumberOfOtherAtoms()

unsigned int SBDDataGraphNode::getNumberOfOtherAtoms ( )
virtual

◆ getNumberOfOxygens()

unsigned int SBDDataGraphNode::getNumberOfOxygens ( )
virtual

◆ getNumberOfResidues()

unsigned int SBDDataGraphNode::getNumberOfResidues ( )
virtual

◆ getNumberOfSegments()

unsigned int SBDDataGraphNode::getNumberOfSegments ( )
virtual

◆ getNumberOfStructuralGroups()

unsigned int SBDDataGraphNode::getNumberOfStructuralGroups ( )
virtual

◆ getNumberOfStructuralModels()

unsigned int SBDDataGraphNode::getNumberOfStructuralModels ( )
virtual

Reimplemented in SBDDocumentFolder, and SBMStructuralModel.

◆ getNumberOfSulfurs()

unsigned int SBDDataGraphNode::getNumberOfSulfurs ( )
virtual

◆ getOpacity()

unsigned int SBDDataGraphNode::getOpacity ( ) const
virtual

◆ getParent()

SBDDataGraphNode * SBDDataGraphNode::getParent ( ) const

The data graph node has a hierarchical structure, in which each node has zero or one parent.

◆ getPreviousNode() [1/2]

SBDDataGraphNode * SBDDataGraphNode::getPreviousNode ( ) const

This function returns a pointer to the previous node in the children of the node's parent.

◆ getPreviousNode() [2/2]

SBDDataGraphNode * SBDDataGraphNode::getPreviousNode ( SBDDataGraphNode::Type  nodeType) const

This function returns a pointer to the previous node with type nodeType in the children of the node's parent.

◆ getRoot()

SBDDataGraphNode * SBDDataGraphNode::getRoot ( ) const

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

◆ getSelectionFlag()

bool SBDDataGraphNode::getSelectionFlag ( ) const

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

◆ getSumOfFormalCharges()

int SBDDataGraphNode::getSumOfFormalCharges ( )
virtual

◆ getSumOfPartialCharges()

float SBDDataGraphNode::getSumOfPartialCharges ( )
virtual

◆ getThisNode()

SBDDataGraphNode * SBDDataGraphNode::getThisNode ( ) const

This function returns a pointer to this node. This is mostly useful for inspectors, in order to make it easy for users to select the inspected node.

◆ getTransparency()

unsigned int SBDDataGraphNode::getTransparency ( ) const
virtual

◆ getType()

SBDDataGraphNode::Type SBDDataGraphNode::getType ( ) const
virtual

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;

Reimplemented in SBDAsset, SBDController, SBDControllerNode, SBDDataGraphNodeGroup, SBDDocument, SBDDocumentAnimation, SBDDocumentCamera, SBDDocumentFile, SBDDocumentFolder, SBDDocumentLabel, SBDDocumentLight, SBDDocumentNote, SBDDocumentPresentation, SBDDocumentRenderPreset, SBMDynamicalModel, SBMDynamicalModelArticulatedBodySystem, SBMDynamicalModelNode, SBMDynamicalModelNodeArticulatedBody, SBMDynamicalModelNodeGroup, SBMDynamicalModelNodeParticle, SBMDynamicalModelNodeRigidBody, SBMDynamicalModelNodeRoot, SBMDynamicalModelParticleSystem, SBMDynamicalModelRigidBodySystem, SBMInteractionModel, SBMInteractionModelParticleSystem, SBMModel, SBMModelNode, SBMPropertyModel, SBMPropertyModelBaseFunction, SBMStructuralModel, SBMStructuralModelConformation, SBMStructuralModelNode, SBMStructuralModelNodeAtom, SBMStructuralModelNodeBackbone, SBMStructuralModelNodeBond, SBMStructuralModelNodeChain, SBMStructuralModelNodeGroup, SBMStructuralModelNodeHydrogenBond, SBMStructuralModelNodeHydrogenBondGroup, SBMStructuralModelNodeMolecule, SBMStructuralModelNodeResidue, SBMStructuralModelNodeRoot, SBMStructuralModelNodeSegment, SBMStructuralModelNodeSideChain, SBMStructuralModelPath, SBMVisualModel, SBMVisualModelMesh, SBSSimulatorParticleSystem, SBSStateUpdater, SBSStateUpdaterParticleSystem, and SBSSimulator.

◆ getTypeString() [1/2]

std::string SBDDataGraphNode::getTypeString ( bool  humanReadable = false) const

This function is a convenience function used to produce a string corresponding to the node's type.

◆ getTypeString() [2/2]

std::string SBDDataGraphNode::getTypeString ( SBDDataGraphNode::Type  type,
bool  humanReadable = false 
)
static

This function is a convenience function used to produce a string corresponding to a given type.

◆ getVisibilityFlag()

bool SBDDataGraphNode::getVisibilityFlag ( ) const

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

◆ hasMaterial()

bool SBDDataGraphNode::hasMaterial ( ) const

This functions returns whether the node has a material by itself, or inherited

See also
Materials
ownsMaterial, getMaterial, getMaterialOwner, addMaterial, removeMaterial

◆ hasNode() [1/2]

bool SBDDataGraphNode::hasNode ( const SBNodePredicate selectionPredicate = SBDDataGraphNode::All(),
const SBNodePredicate visitPredicate = SBDDataGraphNode::All(),
bool  includeDependencies = false 
) const
virtual

This function traverses the sub-tree for which visitPredicate is true (depth-first), and checks for 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 checks for 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 checked for 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.

See also
getNodes, countNodes

Reimplemented in SBDController, SBDControllerNode, SBDDataGraphNodeGroup, SBDDocumentFolder, SBDDocumentPresentation, SBMDynamicalModel, SBMDynamicalModelNode, SBMStructuralModel, SBMStructuralModelConformation, SBMStructuralModelNode, SBMStructuralModelNodeBond, SBMStructuralModelNodeGroup, SBMStructuralModelNodeHydrogenBond, SBMStructuralModelPath, and SBSSimulatorParticleSystem.

◆ hasNode() [2/2]

bool SBDDataGraphNode::hasNode ( SBDDataGraphNode::Type  nodeType,
bool  selectedNodesOnly = false,
const SBNodePredicate visitPredicate = SBDDataGraphNode::All(),
bool  includeDependencies = false 
) const
virtual

This function traverses the sub-tree for which visitPredicate is true (depth-first), and checks for 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 checks for 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 checked for 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.

See also
getNodes, countNodes

Reimplemented in SBDController, SBDControllerNode, SBDDataGraphNodeGroup, SBDDocumentFolder, SBDDocumentPresentation, SBMDynamicalModel, SBMDynamicalModelNode, SBMStructuralModel, SBMStructuralModelConformation, SBMStructuralModelNode, SBMStructuralModelNodeBond, SBMStructuralModelNodeGroup, SBMStructuralModelNodeHydrogenBond, SBMStructuralModelPath, and SBSSimulatorParticleSystem.

◆ hasOneOf()

bool SBDDataGraphNode::hasOneOf ( const SBNodeIndexer nodeIndexer) const

This function returns true if and only if this node is one of the nodes of the nodeIndexer, or is the ancestor of one of them, or is a group that stores one of them

See also
Data Graph

◆ isCreated()

bool SBDDataGraphNode::isCreated ( ) const

For more information, please refer to section Node lifecycle.

See also
isErased
create
erase
Node lifecycle

◆ isErased()

bool SBDDataGraphNode::isErased ( ) const

This function returns true when the node is erased (i.e. when the node is not created). For more information, please refer to section Node lifecycle.

See also
isCreated
create
erase
Node lifecycle

◆ isHighlighted()

bool SBDDataGraphNode::isHighlighted ( ) const

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

◆ isIn() [1/3]

bool SBDDataGraphNode::isIn ( const SBDDataGraphNode node) const

This function returns true if and only if this node is node, or descends from it. If node contains groups, then the function returns true if this node belongs to them.

See also
Data Graph

◆ isIn() [2/3]

bool SBDDataGraphNode::isIn ( const SBNodeIndexer nodeIndexer) const

This function returns true if and only if this node is one of the nodes of the nodeIndexer, or descends from one of them. If a node of the nodeIndexer contains groups, then the function returns true if this node belongs to them.

See also
Data Graph

◆ isIn() [3/3]

bool SBDDataGraphNode::isIn ( SBPointerIndexer< SBDDataGraphNode > *  nodePointerIndexer) const

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

◆ isLocked()

bool SBDDataGraphNode::isLocked ( ) const
virtual

◆ isOneOf() [1/2]

bool SBDDataGraphNode::isOneOf ( const SBNodeIndexer nodeIndexer) const

This function returns true if and only if this node is one of the nodes of the nodeIndexer

See also
Data Graph

◆ isOneOf() [2/2]

bool SBDDataGraphNode::isOneOf ( SBPointerIndexer< SBDDataGraphNode > *  nodePointerIndexer) const

This function returns true if and only if this node is one of the nodes of the nodePointerIndexer

See also
Data Graph

◆ isSelected()

bool SBDDataGraphNode::isSelected ( ) const

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

◆ isSerializable()

◆ isVisible()

bool SBDDataGraphNode::isVisible ( ) const

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

◆ onErase()

void SBDDataGraphNode::onErase ( )
privatevirtual

This virtual function is called by the erase function to perform specific tasks when the node must be erased (e.g. to erase descendants as well). 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 classes 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::NodeEraseBegin immediately before erasing begins, SBBaseEvent::NodeEraseEnd after erasing is complete, and finally SBBaseEvent::NodeErased. Precisely, the erase function sends the SBBaseEvent::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::NodeEraseEnd and the SBBaseEvent::NodeErased events. In the case of a bond, for example, the operations mentioned above are thus performed between the SBBaseEvent::NodeEraseBegin and SBBaseEvent::NodeEraseEnd events. Note that all reimplementations must be undoable.

For more information, please refer to section Node lifecycle.

See also
isCreated
isErased
create
erase
emitBaseSignal
Node lifecycle
Signals and slots

Reimplemented in SBSSimulatorParticleSystem.

◆ ownsMaterial()

bool SBDDataGraphNode::ownsMaterial ( ) const

This functions returns whether the node owns a material

See also
Materials
hasMaterial, getMaterial, getMaterialOwner, addMaterial, removeMaterial

◆ print()

◆ removeChild()

bool SBDDataGraphNode::removeChild ( SBDDataGraphNode node)
virtual
Parameters
nodeA pointer to the child that should be removed

This functions 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. The function returns true if the child was removed successfully.

This function is undoable

See also
addChild

Reimplemented in SBMDynamicalModelNodeGroup.

◆ removeMaterial()

bool SBDDataGraphNode::removeMaterial ( )

This functions removes a material from the node. Please see Materials for more information

This function is undoable

See also
Materials
hasMaterial, ownsMaterial, addMaterial, removeMaterialsFromDescendants, getMaterial, getMaterialOwner

◆ removeMaterialsFromDescendants()

void SBDDataGraphNode::removeMaterialsFromDescendants ( )

This functions 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 undoable

See also
Materials
hasMaterial, ownsMaterial, addMaterial, removeMaterial, getMaterial, getMaterialOwner

◆ serialize()

void SBDDataGraphNode::serialize ( SBCSerializer serializer,
const SBNodeIndexer nodeIndexer,
const SBVersionNumber sdkVersionNumber = SB_SDK_VERSION_NUMBER,
const SBVersionNumber classVersionNumber = SBVersionNumber(1, 0, 0) 
) const
virtual

◆ setHighlightingFlag()

void SBDDataGraphNode::setHighlightingFlag ( bool  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 undoable

See also
getHighlightingFlag

◆ setLockedFlag()

void SBDDataGraphNode::setLockedFlag ( bool  flag)
virtual

Reimplemented in SBMStructuralModel.

◆ setName()

void SBDDataGraphNode::setName ( const std::string &  n)
virtual

Set the name of the node:

activeCamera->setName("Overview camera");
static SBDDocumentCamera * getActiveCamera()
Returns a pointer to the active camera.
Definition: SAMSON.cpp:741
virtual void setName(const std::string &name)
Sets the name of the node.
Definition: SBDDataGraphNode.cpp:480
This class describes a camera.
Definition: SBDDocumentCamera.hpp:17

This function is undoable

Reimplemented in SBDAsset, SBMStructuralModelNodeAtom, SBMStructuralModelNodeGroup, and SBMStructuralModelNodeResidue.

◆ setOpacity()

void SBDDataGraphNode::setOpacity ( unsigned int  opacity)
virtual

Reimplemented in SBDDocumentFolder, SBDDocumentLabel, and SBMModel.

◆ setSelectionFlag()

void SBDDataGraphNode::setSelectionFlag ( bool  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 undoable

See also
getSelectionFlag

◆ setTransparency()

void SBDDataGraphNode::setTransparency ( unsigned int  transparency)
virtual

Reimplemented in SBDDocumentFolder, SBDDocumentLabel, and SBMModel.

◆ setVisibilityFlag()

void SBDDataGraphNode::setVisibilityFlag ( bool  flag)

This function sets the visibility flag of the node.

This function is undoable

See also
getVisibilityFlag

◆ unserialize()

void SBDDataGraphNode::unserialize ( SBCSerializer serializer,
const SBNodeIndexer nodeIndexer,
const SBVersionNumber sdkVersionNumber = SB_SDK_VERSION_NUMBER,
const SBVersionNumber classVersionNumber = SBVersionNumber(1, 0, 0) 
)
virtual