Web Analytics Made Easy - Statcounter
Skip to content

Class SBMStructuralModel#

ClassList > SBMStructuralModel

This class describes a structural model. More...

  • #include "SBMStructuralModel.hpp"

Inherits the following classes: SBMModel

Public Types inherited from SBDDataGraphNode#

See SBDDataGraphNode

Type Name
enum RenderingPass
The rendering pass.
enum Type
The type of the data graph node.

Public Functions#

Type Name
SBMStructuralModel ()
Builds a structural model.
SB_DECLARE_DATA (SBMStructuralModel)
SB_NODE_GETTER_0 (std::string, GetTitleInformation)
SB_NODE_GETTER_0 (std::string, GetPrimaryStructureInformation)
SB_NODE_GETTER_0 (std::string, GetHeterogenInformation)
SB_NODE_GETTER_0 (std::string, GetSecondaryStructureInformation)
SB_NODE_GETTER_0 (std::string, GetConnectivityAnnotationInformation)
SB_NODE_GETTER_0 (std::string, GetMiscellaneousInformation)
SB_NODE_GETTER_0 (std::string, GetCrystallographicAndTransformationInformation)
SB_NODE_PREDICATE_0 (HasTitleInformation)
SB_NODE_PREDICATE_0 (HasPrimaryStructureInformation)
SB_NODE_PREDICATE_0 (HasHeterogenInformation)
SB_NODE_PREDICATE_0 (HasSecondaryStructureInformation)
SB_NODE_PREDICATE_0 (HasConnectivityAnnotationInformation)
SB_NODE_PREDICATE_0 (HasMiscellaneousInformation)
SB_NODE_PREDICATE_0 (HasCrystallographicAndTransformationInformation)
virtual bool addChild (SBNode * node, SBNode * nextNode=nullptr) override
Adds a child to the node.
virtual bool canAddChild (const SBNode * node, const SBNode * nextNode=nullptr) override const
Returns whether this node can add node as a child.
virtual bool canAddChildType (SBNode::Type nodeType) override const
Returns whether this node can add a node with type nodeType as a child.
virtual bool canHaveDescendantType (SBNode::Type nodeType) override const
Returns whether this node can have a node with type nodeType as a descendant.
void centerTransform ()
Centers the pivot of the transform on the center of mass of the atoms contained in the structural model.
void clearConnectivityAnnotationInformation ()
Clears the model's connectivity annotation information.
void clearCrystallographicAndTransformationInformation ()
Clears the model's crystallographic and transformation information.
void clearHeterogenInformation ()
Clears the model's heterogen information.
void clearMiscellaneousInformation ()
Clears the model's miscellaneous information.
void clearPrimaryStructureInformation ()
Clears the model's primary structure information.
void clearSecondaryStructureInformation ()
Clears the model's secondary structure information.
void clearTitleInformation ()
Clears the model's title information.
virtual SBMStructuralModel * clone () override
Returns a copy of the node and its descendants.
virtual void collectAmbientOcclusion (const SBPosition3 & boxOrigin, const SBPosition3 & boxSize, unsigned int nCellsX, unsigned int nCellsY, unsigned int nCellsZ, float * ambientOcclusionData)
To collect ambient occlusion data.
bool computeSecondaryStructure (bool & updated, bool forceUpdate=false)
Computes the secondary structure for all residues in the structural model.
void connectStructuralSignalToSlot (SBCReferenceTarget * referenceTarget, void(SBCReferenceTarget::*)(SBStructuralEvent *) functionPointer, SBStructuralEvent::Type eventType=SBStructuralEvent::Type::Any, SBCReferenceTarget * nextReferenceTarget=nullptr, void(SBCReferenceTarget::*)(SBStructuralEvent *) nextFunctionPointer=nullptr)
Connects the structural signal to a slot.
void createCovalentBonds ()
Builds covalent bonds for the atoms belonging to the structural model according to the inter-atomic distances.
void createCovalentBonds (SBQuantity::length additionalMargin)
Builds covalent bonds for the atoms belonging to the structural model according to the inter-atomic distances with the additional margin additionalMargin .
int createCovalentBondsByResidueType ()
Builds covalent bonds for the atoms belonging to the structural model according to the residue types, regardless of inter-atomic distances. If the bonds are already present, it sets the order of covalent bonds for the atoms belonging to the structural model according to the residue types.
void disconnectStructuralSignalFromSlot (SBCReferenceTarget * referenceTarget, void(SBCReferenceTarget::*)(SBStructuralEvent *) functionPointer, SBStructuralEvent::Type eventType=SBStructuralEvent::Type::Any)
Disconnects the structural signal from a slot.
virtual void expandBounds (SBIAPosition3 & bounds) const
Expands the bounds to make sure the visual model fits inside them.
virtual void forEachNodeDepthFirst (void(*)(SBDDataGraphNode *node) action) override
Performs the action on each node (this structural model and all its children), depth-first.
virtual void forEachNodeDepthFirst (SBCClass * object, void(SBCClass::*)(SBDDataGraphNode *node) action) override
Performs the object 'saction on each node (this structural model and all its children), depth-first.
virtual SBPointerList< SBMStructuralModelNode > const * getChildren () const
This function is a convenience function equivalent to getStructuralRoot() ->getChildren __
std::string const & getConnectivityAnnotationInformation () const
Returns the model's connectivity annotation information.
std::string const & getCrystallographicAndTransformationInformation () const
Returns the model's crystallographic and transformation information.
std::string const & getHeterogenInformation () const
Returns the model's heterogen information.
virtual bool getLockedFlag () override const
Returns the locked flag.
std::string const & getMiscellaneousInformation () const
Returns the model's miscellaneous information.
virtual SBDDataGraphNode::Type getModelType () override const
Returns the model type.
virtual SBQuantity::mass getMolecularWeight () override
Returns the molecular weight.
virtual void getNodes (SBNodeIndexer & nodeIndexer, SBNode::Type nodeType, bool selectedNodesOnly=false, const SBNodePredicate & visitPredicate=SBDDataGraphNode::All(), bool includeDependencies=false) override 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) override const
Collects nodes into nodeIndexer , based on aselectionPredicate and avisitPredicate , with or without dependencies.
virtual unsigned int getNumberOfAtoms () override
Returns the number of atoms.
virtual unsigned int getNumberOfCarbons () override
Returns the number of carbons.
virtual unsigned int getNumberOfChains () override
Returns the number of chains.
virtual unsigned int getNumberOfCoarseGrainedAtoms () override
Returns the number of coarse-grained atoms.
virtual unsigned int getNumberOfHydrogens () override
Returns the number of hydrogens.
virtual unsigned int getNumberOfMolecules () override
Returns the number of molecules.
virtual unsigned int getNumberOfNitrogens () override
Returns the number of nitrogens.
virtual unsigned int getNumberOfOtherAtoms () override
Returns the number of other atoms.
virtual unsigned int getNumberOfOxygens () override
Returns the number of oxygens.
virtual unsigned int getNumberOfResidues () override
Returns the number of residues.
virtual unsigned int getNumberOfSegments () override
Returns the number of segments.
virtual unsigned int getNumberOfStructuralGroups () override
Returns the number of structural groups.
virtual unsigned int getNumberOfStructuralModels () override
Returns the number of structural models.
virtual unsigned int getNumberOfSulfurs () override
Returns the number of sulfurs.
SBMatrix33 const & getOrientation () const
Returns the orientation of the structural model.
SBPosition3 const & getPosition () const
Returns the position of the structural model.
std::string const & getPrimaryStructureInformation () const
Returns the model's primary structure information.
std::string const & getSecondaryStructureInformation () const
Returns the model's secondary structure information.
SBMStructuralModelNodeRoot * getStructuralRoot () const
This function returns a pointer to the structural root of the structural model.
bool getStructuralSignalFlag () const
Returns true when the model can send structural signals.
virtual int getSumOfFormalCharges () override
Returns the sum of formal charges.
virtual float getSumOfPartialCharges () override
Returns the sum of partial charges.
std::string const & getTitleInformation () const
Returns the model's title information.
SBSpatialTransform const & getTransform () const
Returns the spatial transform of the structural model.
virtual SBDDataGraphNode::Type getType () override const
Returns the type of the data graph node.
void getWater (SBNodeIndexer & resultNodeIndexer) const
Finds water nodes in the structural model.
bool hasConnectivityAnnotationInformation () const
Returns true when the model's connectivity annotation information is set.
bool hasCrystallographicAndTransformationInformation () const
Returns true when the model's crystallographic and transformation information is set.
bool hasHeterogenInformation () const
Returns true when the model's heterogen information is set.
bool hasMiscellaneousInformation () const
Returns true when the model's miscellaneous information is set.
virtual bool hasNode (SBNode::Type nodeType, bool selectedNodesOnly=false, const SBNodePredicate & visitPredicate=SBDDataGraphNode::All(), bool includeDependencies=false) override const
Checks for 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) override const
Checks for nodes based on a selectionPredicate and avisitPredicate , with or without dependencies.
bool hasPrimaryStructureInformation () const
Returns true when the model's primary structure information is set.
bool hasSecondaryStructureInformation () const
Returns true when the model's secondary structure information is set.
bool hasTitleInformation () const
Returns true when the model's title information is set.
virtual bool isLocked () override const
Returns whether the model is locked.
virtual bool isSerializable () override const
Returns true __
bool populateChainIDs (bool forceRenumbering=false)
Populates the chain IDs for all chains in the structural model.
virtual void print (unsigned int offset=0) override const
Prints debugging information.
virtual bool removeChild (SBNode * node) override
Removes a child from the node.
void rotate (const SBVector3 & axis, const SBQuantity::dimensionless & angle)
Rotates the structural model.
virtual void serialize (SBCSerializer * serializer, const SBNodeIndexer & nodeIndexer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0)) override const
Serializes the node.
void setConnectivityAnnotationInformation (const std::string & info)
Sets the model's connectivity annotation information.
void setCrystallographicAndTransformationInformation (const std::string & info)
Sets the model's crystallographic and transformation information.
void setHeterogenInformation (const std::string & info)
Sets the model's heterogen information.
virtual void setLockedFlag (bool flag) override
Sets the locked flag.
void setMiscellaneousInformation (const std::string & info)
Sets the model's miscellaneous information.
void setOrientation (const SBMatrix33 & orientation)
Sets the orientation of the structural model.
void setOrientation (const SBMatrix33 & orientation, bool transformParticles)
Sets the orientation of the structural model.
void setOrientation (SBMatrix33 const & newOrientation, SBMatrix33 const & oldOrientation, bool transformParticles=true)
Sets the newOrientation and theoldOrientation of the structural model.
void setPosition (const SBPosition3 & position)
Sets the position of the structural model.
void setPosition (const SBPosition3 & position, bool transformParticles)
Sets the position of the structural model.
void setPosition (SBPosition3 const & newPosition, SBPosition3 const & oldPosition, bool transformParticles=true)
Sets the newPosition and theoldPosition of the structural model.
void setPrimaryStructureInformation (const std::string & info)
Sets the model's primary structure information.
void setSecondaryStructureInformation (const std::string & info)
Sets the model's secondary structure information.
void setStructuralSignalFlag (bool structuralSignalFlag)
Sets whether the model can send structural signals.
void setTitleInformation (const std::string & info)
Sets the model's title information.
void setTransform (const SBSpatialTransform & transform)
Sets the spatial transform of the structural model.
void setTransform (const SBSpatialTransform & transform, bool transformParticles)
Sets the spatial transform of the structural model.
void setTransform (SBSpatialTransform const & newTransform, SBSpatialTransform const & oldTransform, bool transformParticles=true)
Sets the newTransform and theoldTransform of the structural model.
bool structuralSignalIsConnectedToSlot (SBCReferenceTarget * referenceTarget, void(SBCReferenceTarget::*)(SBStructuralEvent *) functionPointer, SBStructuralEvent::Type eventType=SBStructuralEvent::Type::Any) const
Returns true if and only if the structural signal is connected to a given slot.
std::optional< std::string > toSMILES () const
Converts the structural model into a SMILES string.
std::optional< std::string > toSVG () const
Converts the structural model into a 2D SVG representation.
void transform (const SBSpatialTransform & transform)
Applies a spatial transform to the structural model.
void translate (const SBLength3 & translation)
Translates the structural model.
virtual void unserialize (SBCSerializer * serializer, const SBNodeIndexer & nodeIndexer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0)) override
Unserializes the node.
virtual ~SBMStructuralModel ()
Destructor.

Public Functions inherited from SBMModel#

See SBMModel

Type Name
SB_DECLARE_DATA (SBMModel)
SB_NODE_GETTER_0 (SBDDataGraphNode::Type, GetModelType)
SB_NODE_PREDICATE_1 (IsModelType, SBDDataGraphNode::Type)
void clearSourceFileName ()
Clears the name of the file associated to the model.
virtual SBMModel * clone () override
Returns a copy of the node and its descendants.
virtual SBDDataGraphNode::Type getModelType () const
Returns the model type.
SBMModel * getNextModel () const
Returns the next model in the parent.
virtual unsigned int getOpacity () override const
Returns the opacity.
SBMModel * getPreviousModel () const
Returns the previous model in the parent.
bool getShadowingFlag () const
Returns whether the model casts shadows.
const std::string & getSourceFileName () const
Returns the name of the file associated to the model.
virtual unsigned int getTransparency () override const
Returns the transparency.
virtual SBDDataGraphNode::Type getType () override const
Returns the type of the data graph node.
bool hasSourceFileName () const
Returns true when the model has the source file name set.
virtual bool isSerializable () override const
Returns true __
virtual void print (unsigned int offset=0) override const
Prints debugging information.
virtual void serialize (SBCSerializer * serializer, const SBNodeIndexer & nodeIndexer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0)) override const
Serializes the node.
virtual void setOpacity (unsigned int opacity) override
Sets the opacity.
void setShadowingFlag (bool shadowingFlag)
Sets whether the model casts shadows.
void setSourceFileName (const std::string & fileName)
Sets the name of the file associated to the model.
virtual void setTransparency (unsigned int transparency) override
Sets the transparency.
virtual void unserialize (SBCSerializer * serializer, const SBNodeIndexer & nodeIndexer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0)) override
Unserializes the node.
virtual ~SBMModel ()
Delete the model.

Public Functions inherited from SBDDataGraphNode#

See SBDDataGraphNode

Type Name
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.
SBDDataGraphNodeData * getDataPointer ()
const SBDDataGraphNodeData * getDataPointer () const
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#

See SBCReferenceTarget

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

Public Static Functions#

Type Name
bool bondExists (SBMStructuralModelNodeAtom * atom1, SBMStructuralModelNodeAtom * atom2)
Checks whether the bond between atoms atom1 andatom2 exists.
bool cloneStructuralNodes (SBNodeIndexer & structuralModelIndexer, const SBNodeIndexer & structuralNodeIndexer)
Adds in structuralModelIndexer the structural models resulting from cloning the structural nodes instructuralNodeIndexer .
SBSpatialDomain computeDomain (const SBNodeIndexer & nodeIndexer)
Computes the domain containing the atoms and bond atoms in the node indexer.
bool createBond (SBMStructuralModelNodeAtom * atom1, SBMStructuralModelNodeAtom * atom2, double bondOrder=1.0, SBBond::BondType bondType=SBBond::BondType::Undefined)
Creates a bond between atom1 andatom2 if there is none; sets the bond order tobondOrder and the bond type tobondType .
int createCovalentBondsByResidueType (const SBNodeIndexer & nodeIndexer)
Builds covalent bonds for the atoms belonging to the given residues of the structural model according to the residue types, regardless of inter-atomic distances. If the bonds are already present, it sets the order of covalent bonds for the atoms belonging to the structural model according to the residue types.
SBMStructuralModel * createModel (const std::string & smiles, const std::string & name, bool addHydrogens=true, bool addExplicitHydrogenOnly=false, bool kekulize=true, bool runUFF=true, int uffMaxIters=500, double uffVdwThreshold=10.0, int uffConfId=0)
Creates a structural model from a SMILES string.
bool exportImage (const std::string & smiles, const std::string & outputFile, int widthPx=600, int marginPx=10, double lineWidth=3.0, const std::string & fontFamily="Sans Serif Collection")
Exports a molecular structure (SMILES) as an image file (png, jpg, svg).
bool extractStructuralNodes (SBNodeIndexer & structuralModelIndexer, const SBNodeIndexer & structuralNodeIndexer)
Adds in structuralModelIndexer the structural models resulting from extracting the structural nodes instructuralNodeIndexer .
SBMStructuralModelNodeAtom * findAtom (const SBNodeIndexer & nodeIndexer, SBElement::Type type, const std::string & name)
Returns, if found, an atom from a node indexer nodeIndexer with the typetype and namename ; else returns 0.
SBMStructuralModelNodeAtom * findAtom (const SBIndexer< SBMStructuralModelNodeAtom * > & atomIndexer, SBElement::Type type, const std::string & name)
Returns, if found, an atom from an atom node indexer atomIndexer with the typetype and namename ; else returns 0.
SBMStructuralModelNodeAtom * findAtom (const SBNodeIndexer & nodeIndexer, SBElement::Type type, const std::string & name, char altLoc)
Returns, if found, an atom from a node indexer nodeIndexer with the typetype , namename , and an alternate locationaltLoc (if the atom has an alternate location); else returns 0.
SBMStructuralModelNodeAtom * findAtom (const SBIndexer< SBMStructuralModelNodeAtom * > & atomIndexer, SBElement::Type type, const std::string & name, char altLoc)
Returns, if found, an atom from an atom node indexer atomIndexer with the typetype , namename , and an alternate locationaltLoc (if the atom has an alternate location); else returns 0.
std::set< char > getAltLocations (const SBNodeIndexer & nodeIndexer)
Returns a set of all alternate locations for atoms that belong to nodes present in nodeIndexer .
std::set< char > getAltLocations (const SBIndexer< SBMStructuralModelNodeAtom * > & atomIndexer)
Returns a set of all alternate locations of atoms present in the atomIndexer .
double getAsphericity (const SBNodeIndexer & nodeIndexer)
Returns the asphericity parameter of the system of atoms (based on their positions and masses) in nodeIndexer . The asphericity parameter changes in the [0, 1] interval: 0 - a sphere, 1 - a rod.
SBPosition3 getCenterOfFormalCharge (const SBNodeIndexer & nodeIndexer)
Returns the center of formal charge of atoms in nodeIndexer .
SBPosition3 getCenterOfMass (const SBNodeIndexer & nodeIndexer)
Returns the center of mass of atoms in nodeIndexer .
SBPosition3 getCenterOfPartialCharge (const SBNodeIndexer & nodeIndexer)
Returns the center of partial charge of atoms in nodeIndexer .
SBPosition3 getCentroid (const SBNodeIndexer & nodeIndexer)
Returns the centroid (the geometric center) of atoms in nodeIndexer .
SBQuantity::length getDipoleMomentAtCenterOfCharge (const SBNodeIndexer & nodeIndexer)
Returns the dipole moment of atoms in nodeIndexer at their center of charge (based on partial charge)
SBQuantity::length getDipoleMomentAtCenterOfMass (const SBNodeIndexer & nodeIndexer)
Returns the dipole moment of atoms in nodeIndexer at their center of mass.
SBPosition3 getDipoleVectorAtCenterOfCharge (const SBNodeIndexer & nodeIndexer)
Returns the dipole vector of atoms in nodeIndexer at their center of charge (based on partial charge)
SBPosition3 getDipoleVectorAtCenterOfMass (const SBNodeIndexer & nodeIndexer)
Returns the dipole vector of atoms in nodeIndexer at their center of mass.
SBInertiaTensor33 getInertiaTensor (const SBNodeIndexer & nodeIndexer)
Returns the inertia tensor of the system of atoms (based on their positions and masses) in nodeIndexer .
SBQuantity::mass getMolecularWeight (const SBNodeIndexer & nodeIndexer)
Returns the cumulative molecular weight of nodes in nodeIndexer .
SBMatrix33 getPrincipalAxes (const SBNodeIndexer & nodeIndexer)
Returns the principal axes of the inertia tensor of the system of atoms (based on their positions and masses) in nodeIndexer .
SBQuantity::length getRadiusOfGyration (const SBNodeIndexer & nodeIndexer)
Returns the radius of gyration of the system of atoms (based on their positions and masses) in nodeIndexer .
double getShapeParameter (const SBNodeIndexer & nodeIndexer)
Returns the shape parameter of the system of atoms (based on their positions and masses) in nodeIndexer . The shape parameter, S, changes in the [-0.25, 2] interval, where 0 corresponds to a sphere, negative values correspond to oblate ellipsoid, positive values correspond to prolate ellipsoid.
SBQuantity::squareLength getSolventAccessibleSurfaceArea (const SBNodeIndexer & nodeIndexer, const SBQuantity::length & probeRadius, const unsigned int numberOfPointsOnSphere)
Returns the solvent-accessible surface area (SASA) of the system of atoms in nodeIndexer with the probe radiusprobeRadius , and the number of points on a spherenumberOfPointsOnSphere .
SBDTypeSpatialTransform getSpatialTransform (const SBNodeIndexer & nodeIndexer)
Returns the spatial transform based on the inertia tensor of the system of atoms (based on their positions and masses) in nodeIndexer .
int getSumOfFormalCharges (const SBNodeIndexer & nodeIndexer)
Returns the sum of formal charges of nodes in nodeIndexer .
float getSumOfPartialCharges (const SBNodeIndexer & nodeIndexer)
Returns the sum of partial charges of nodes in nodeIndexer .
void getWater (SBNodeIndexer & resultNodeIndexer, const SBNodeIndexer & nodeIndexer)
Finds water nodes in the nodeIndexer .
bool isPlanar (const SBNodeIndexer & nodeIndexer)
Returns true if all atoms innodeIndexer are in the same plane.
bool isValidSMILES (const std::string & smiles)
Checks if a given SMILES string represents a valid molecular structure.
void replaceAtom (SBMStructuralModelNodeAtom * oldAtom, SBMStructuralModelNodeAtom * newAtom, bool preserveOldAtomPosition=false)
Replaces atom oldAtom with atomnewAtom . All bonds from the old atom are transferred to the new atom.
void replaceBond (SBMStructuralModelNodeBond * oldBond, SBMStructuralModelNodeBond * newBond, bool flipBond=false, bool preserveOldBondPosition=false)
Replaces bond oldBond with bondnewBond . All neighboring bonds from the old bond are transferred to the new bond.
std::optional< std::string > smilesToSVG (const std::string & smiles, int widthPx=600)
Converts a SMILES string into an SVG representation.

Public Static Functions inherited from SBDDataGraphNode#

See SBDDataGraphNode

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#

See SBCReferenceTarget

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

Protected Functions inherited from SBMModel#

See SBMModel

Type Name
SBMModel ()
Builds a model.
SBMModel (SBMModelData * dataPointer)
Builds a model.

Protected Functions inherited from SBDDataGraphNode#

See SBDDataGraphNode

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#

See SBCReferenceTarget

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

Detailed Description#

Short name: SBStructuralModel

Public Functions Documentation#

function SBMStructuralModel#

Builds a structural model.

SBMStructuralModel::SBMStructuralModel () 

Builds a base model.


function SB_DECLARE_DATA#

SBMStructuralModel::SB_DECLARE_DATA (
    SBMStructuralModel
) 

function SB_NODE_GETTER_0 [1/7]#

SBMStructuralModel::SB_NODE_GETTER_0 (
    std::string,
    GetTitleInformation
) 

function SB_NODE_GETTER_0 [2/7]#

SBMStructuralModel::SB_NODE_GETTER_0 (
    std::string,
    GetPrimaryStructureInformation
) 

function SB_NODE_GETTER_0 [3/7]#

SBMStructuralModel::SB_NODE_GETTER_0 (
    std::string,
    GetHeterogenInformation
) 

function SB_NODE_GETTER_0 [4/7]#

SBMStructuralModel::SB_NODE_GETTER_0 (
    std::string,
    GetSecondaryStructureInformation
) 

function SB_NODE_GETTER_0 [5/7]#

SBMStructuralModel::SB_NODE_GETTER_0 (
    std::string,
    GetConnectivityAnnotationInformation
) 

function SB_NODE_GETTER_0 [6/7]#

SBMStructuralModel::SB_NODE_GETTER_0 (
    std::string,
    GetMiscellaneousInformation
) 

function SB_NODE_GETTER_0 [7/7]#

SBMStructuralModel::SB_NODE_GETTER_0 (
    std::string,
    GetCrystallographicAndTransformationInformation
) 

function SB_NODE_PREDICATE_0 [1/7]#

SBMStructuralModel::SB_NODE_PREDICATE_0 (
    HasTitleInformation
) 

function SB_NODE_PREDICATE_0 [2/7]#

SBMStructuralModel::SB_NODE_PREDICATE_0 (
    HasPrimaryStructureInformation
) 

function SB_NODE_PREDICATE_0 [3/7]#

SBMStructuralModel::SB_NODE_PREDICATE_0 (
    HasHeterogenInformation
) 

function SB_NODE_PREDICATE_0 [4/7]#

SBMStructuralModel::SB_NODE_PREDICATE_0 (
    HasSecondaryStructureInformation
) 

function SB_NODE_PREDICATE_0 [5/7]#

SBMStructuralModel::SB_NODE_PREDICATE_0 (
    HasConnectivityAnnotationInformation
) 

function SB_NODE_PREDICATE_0 [6/7]#

SBMStructuralModel::SB_NODE_PREDICATE_0 (
    HasMiscellaneousInformation
) 

function SB_NODE_PREDICATE_0 [7/7]#

SBMStructuralModel::SB_NODE_PREDICATE_0 (
    HasCrystallographicAndTransformationInformation
) 

function addChild#

Adds a child to the node.

virtual bool SBMStructuralModel::addChild (
    SBNode * node,
    SBNode * nextNode=nullptr
) override

This function is a convenience function equivalent to getStructuralRoot() ->addChild(node, nextNode)


function canAddChild#

Returns whether this node can add node as a child.

virtual bool SBMStructuralModel::canAddChild (
    const SBNode * node,
    const SBNode * nextNode=nullptr
) override const

This function is a convenience function equivalent to getStructuralRoot() ->canAddChild(node, nextNode)


function canAddChildType#

Returns whether this node can add a node with type nodeType as a child.

virtual bool SBMStructuralModel::canAddChildType (
    SBNode::Type nodeType
) override const

This function is a convenience function equivalent to getStructuralRoot() ->canAddChildType(nodeType)

Implements SBDDataGraphNode::canAddChildType


function canHaveDescendantType#

Returns whether this node can have a node with type nodeType as a descendant.

virtual bool SBMStructuralModel::canHaveDescendantType (
    SBNode::Type nodeType
) override const

This function is a convenience function equivalent to getStructuralRoot() ->canHaveDescendantType(nodeType)

Implements SBDDataGraphNode::canHaveDescendantType


function centerTransform#

Centers the pivot of the transform on the center of mass of the atoms contained in the structural model.

void SBMStructuralModel::centerTransform () 

Centers the pivot of the transform on the center of mass of the atoms contained in the structural model. This changes the transform only, and does not move atoms belonging to the structural model.


function clearConnectivityAnnotationInformation#

Clears the model's connectivity annotation information.

void SBMStructuralModel::clearConnectivityAnnotationInformation () 


function clearCrystallographicAndTransformationInformation#

Clears the model's crystallographic and transformation information.

void SBMStructuralModel::clearCrystallographicAndTransformationInformation () 


function clearHeterogenInformation#

Clears the model's heterogen information.

void SBMStructuralModel::clearHeterogenInformation () 


function clearMiscellaneousInformation#

Clears the model's miscellaneous information.

void SBMStructuralModel::clearMiscellaneousInformation () 


function clearPrimaryStructureInformation#

Clears the model's primary structure information.

void SBMStructuralModel::clearPrimaryStructureInformation () 


function clearSecondaryStructureInformation#

Clears the model's secondary structure information.

void SBMStructuralModel::clearSecondaryStructureInformation () 


function clearTitleInformation#

Clears the model's title information.

void SBMStructuralModel::clearTitleInformation () 


function clone#

Returns a copy of the node and its descendants.

virtual SBMStructuralModel * SBMStructuralModel::clone () override

Implements SBMModel::clone


function collectAmbientOcclusion#

To collect ambient occlusion data.

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


function computeSecondaryStructure#

Computes the secondary structure for all residues in the structural model.

bool SBMStructuralModel::computeSecondaryStructure (
    bool & updated,
    bool forceUpdate=false
) 

This function incrementally computes the secondary structure of the structural model, i.e.

both the secondary structure types of residues and geometric descriptors. The function returns true if and only if everything went well. The boolean secondaryStructureChanged is modified by the function and is true if and only if the secondary structure was changed compared to the previous call. Since several objects may call this function, a SecondaryStructureChanged event is also sent when this is the case, so that all objects may be warned.


function connectStructuralSignalToSlot#

Connects the structural signal to a slot.

void SBMStructuralModel::connectStructuralSignalToSlot (
    SBCReferenceTarget * referenceTarget,
    void(SBCReferenceTarget::*)( SBStructuralEvent *) functionPointer,
    SBStructuralEvent::Type eventType=SBStructuralEvent::Type::Any,
    SBCReferenceTarget * nextReferenceTarget=nullptr,
    void(SBCReferenceTarget::*)( SBStructuralEvent *) nextFunctionPointer=nullptr
) 


function createCovalentBonds [1/2]#

Builds covalent bonds for the atoms belonging to the structural model according to the inter-atomic distances.

void SBMStructuralModel::createCovalentBonds () 


function createCovalentBonds [2/2]#

Builds covalent bonds for the atoms belonging to the structural model according to the inter-atomic distances with the additional margin additionalMargin .

void SBMStructuralModel::createCovalentBonds (
    SBQuantity::length additionalMargin
) 


function createCovalentBondsByResidueType [1/2]#

Builds covalent bonds for the atoms belonging to the structural model according to the residue types, regardless of inter-atomic distances. If the bonds are already present, it sets the order of covalent bonds for the atoms belonging to the structural model according to the residue types.

int SBMStructuralModel::createCovalentBondsByResidueType () 


function disconnectStructuralSignalFromSlot#

Disconnects the structural signal from a slot.

void SBMStructuralModel::disconnectStructuralSignalFromSlot (
    SBCReferenceTarget * referenceTarget,
    void(SBCReferenceTarget::*)( SBStructuralEvent *) functionPointer,
    SBStructuralEvent::Type eventType=SBStructuralEvent::Type::Any
) 


function expandBounds#

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

virtual void SBMStructuralModel::expandBounds (
    SBIAPosition3 & bounds
) const


function forEachNodeDepthFirst [1/2]#

Performs the action on each node (this structural model and all its children), depth-first.

virtual void SBMStructuralModel::forEachNodeDepthFirst (
    void(*)( SBDDataGraphNode *node) action
) override

Implements SBDDataGraphNode::forEachNodeDepthFirst


function forEachNodeDepthFirst [2/2]#

Performs the object 'saction on each node (this structural model and all its children), depth-first.

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

Implements SBDDataGraphNode::forEachNodeDepthFirst


function getChildren#

This function is a convenience function equivalent to getStructuralRoot() ->getChildren __

virtual SBPointerList< SBMStructuralModelNode > const * SBMStructuralModel::getChildren () const


function getConnectivityAnnotationInformation#

Returns the model's connectivity annotation information.

std::string const & SBMStructuralModel::getConnectivityAnnotationInformation () const


function getCrystallographicAndTransformationInformation#

Returns the model's crystallographic and transformation information.

std::string const & SBMStructuralModel::getCrystallographicAndTransformationInformation () const


function getHeterogenInformation#

Returns the model's heterogen information.

std::string const & SBMStructuralModel::getHeterogenInformation () const


function getLockedFlag#

Returns the locked flag.

virtual bool SBMStructuralModel::getLockedFlag () override const

This function returns the locked flag of the structural model.

When the structural model is locked, its geometry (the atoms positions), topology (the bonds) and identities (node names and indices) cannot be edited by the user. However, other properties can still be edited. For example, secondary structure information can still be computed, and materials and color schemes can still be applied.

Note that some properties that cannot be edited by users can still be edited by developers.

See also: isLocked, setLockedFlag

Implements SBDDataGraphNode::getLockedFlag


function getMiscellaneousInformation#

Returns the model's miscellaneous information.

std::string const & SBMStructuralModel::getMiscellaneousInformation () const


function getModelType#

Returns the model type.

virtual SBDDataGraphNode::Type SBMStructuralModel::getModelType () override const

Implements SBMModel::getModelType


function getMolecularWeight [2/2]#

Returns the molecular weight.

virtual SBQuantity::mass SBMStructuralModel::getMolecularWeight () override

This function returns the cumulative molecular weight of atoms in the structural model.

If the structural model doesn't contain any atoms then the function returns zero.

Implements SBDDataGraphNode::getMolecularWeight


function getNodes [1/2]#

Collects nodes into nodeIndexer , based on anodeType , a selection status and avisitPredicate , with or without dependencies.

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

Implements SBDDataGraphNode::getNodes


function getNodes [2/2]#

Collects nodes into nodeIndexer , based on aselectionPredicate and avisitPredicate , with or without dependencies.

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

Implements SBDDataGraphNode::getNodes


function getNumberOfAtoms#

Returns the number of atoms.

virtual unsigned int SBMStructuralModel::getNumberOfAtoms () override

Implements SBDDataGraphNode::getNumberOfAtoms


function getNumberOfCarbons#

Returns the number of carbons.

virtual unsigned int SBMStructuralModel::getNumberOfCarbons () override

Implements SBDDataGraphNode::getNumberOfCarbons


function getNumberOfChains#

Returns the number of chains.

virtual unsigned int SBMStructuralModel::getNumberOfChains () override

Implements SBDDataGraphNode::getNumberOfChains


function getNumberOfCoarseGrainedAtoms#

Returns the number of coarse-grained atoms.

virtual unsigned int SBMStructuralModel::getNumberOfCoarseGrainedAtoms () override

Implements SBDDataGraphNode::getNumberOfCoarseGrainedAtoms


function getNumberOfHydrogens#

Returns the number of hydrogens.

virtual unsigned int SBMStructuralModel::getNumberOfHydrogens () override

Implements SBDDataGraphNode::getNumberOfHydrogens


function getNumberOfMolecules#

Returns the number of molecules.

virtual unsigned int SBMStructuralModel::getNumberOfMolecules () override

Implements SBDDataGraphNode::getNumberOfMolecules


function getNumberOfNitrogens#

Returns the number of nitrogens.

virtual unsigned int SBMStructuralModel::getNumberOfNitrogens () override

Implements SBDDataGraphNode::getNumberOfNitrogens


function getNumberOfOtherAtoms#

Returns the number of other atoms.

virtual unsigned int SBMStructuralModel::getNumberOfOtherAtoms () override

Implements SBDDataGraphNode::getNumberOfOtherAtoms


function getNumberOfOxygens#

Returns the number of oxygens.

virtual unsigned int SBMStructuralModel::getNumberOfOxygens () override

Implements SBDDataGraphNode::getNumberOfOxygens


function getNumberOfResidues#

Returns the number of residues.

virtual unsigned int SBMStructuralModel::getNumberOfResidues () override

Implements SBDDataGraphNode::getNumberOfResidues


function getNumberOfSegments#

Returns the number of segments.

virtual unsigned int SBMStructuralModel::getNumberOfSegments () override

Implements SBDDataGraphNode::getNumberOfSegments


function getNumberOfStructuralGroups#

Returns the number of structural groups.

virtual unsigned int SBMStructuralModel::getNumberOfStructuralGroups () override

Implements SBDDataGraphNode::getNumberOfStructuralGroups


function getNumberOfStructuralModels#

Returns the number of structural models.

virtual unsigned int SBMStructuralModel::getNumberOfStructuralModels () override

Implements SBDDataGraphNode::getNumberOfStructuralModels


function getNumberOfSulfurs#

Returns the number of sulfurs.

virtual unsigned int SBMStructuralModel::getNumberOfSulfurs () override

Implements SBDDataGraphNode::getNumberOfSulfurs


function getOrientation#

Returns the orientation of the structural model.

SBMatrix33 const & SBMStructuralModel::getOrientation () const


function getPosition#

Returns the position of the structural model.

SBPosition3 const & SBMStructuralModel::getPosition () const


function getPrimaryStructureInformation#

Returns the model's primary structure information.

std::string const & SBMStructuralModel::getPrimaryStructureInformation () const


function getSecondaryStructureInformation#

Returns the model's secondary structure information.

std::string const & SBMStructuralModel::getSecondaryStructureInformation () const


function getStructuralRoot#

This function returns a pointer to the structural root of the structural model.

SBMStructuralModelNodeRoot * SBMStructuralModel::getStructuralRoot () const

This root is a structural node, and can be used as a convenience root for e.g. recursive algorithms that operate on structural nodes (such algorithms could not work on the structural model itself, since the SBMStructuralModel class does not derive from SBMStructuralModelNode).


function getStructuralSignalFlag#

Returns true when the model can send structural signals.

bool SBMStructuralModel::getStructuralSignalFlag () const


function getSumOfFormalCharges [2/2]#

Returns the sum of formal charges.

virtual int SBMStructuralModel::getSumOfFormalCharges () override

Implements SBDDataGraphNode::getSumOfFormalCharges


function getSumOfPartialCharges [2/2]#

Returns the sum of partial charges.

virtual float SBMStructuralModel::getSumOfPartialCharges () override

Implements SBDDataGraphNode::getSumOfPartialCharges


function getTitleInformation#

Returns the model's title information.

std::string const & SBMStructuralModel::getTitleInformation () const


function getTransform#

Returns the spatial transform of the structural model.

SBSpatialTransform const & SBMStructuralModel::getTransform () const


function getType#

Returns the type of the data graph node.

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

Implements SBMModel::getType


function getWater [1/2]#

Finds water nodes in the structural model.

void SBMStructuralModel::getWater (
    SBNodeIndexer & resultNodeIndexer
) const

This function finds water nodes in the structural model and adds them to resultNodeIndexer.


function hasConnectivityAnnotationInformation#

Returns true when the model's connectivity annotation information is set.

bool SBMStructuralModel::hasConnectivityAnnotationInformation () const


function hasCrystallographicAndTransformationInformation#

Returns true when the model's crystallographic and transformation information is set.

bool SBMStructuralModel::hasCrystallographicAndTransformationInformation () const


function hasHeterogenInformation#

Returns true when the model's heterogen information is set.

bool SBMStructuralModel::hasHeterogenInformation () const


function hasMiscellaneousInformation#

Returns true when the model's miscellaneous information is set.

bool SBMStructuralModel::hasMiscellaneousInformation () const


function hasNode [1/2]#

Checks for nodes based on a nodeType , a selection status and avisitPredicate , with or without dependencies.

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

Implements SBDDataGraphNode::hasNode


function hasNode [2/2]#

Checks for nodes based on a selectionPredicate and avisitPredicate , with or without dependencies.

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

Implements SBDDataGraphNode::hasNode


function hasPrimaryStructureInformation#

Returns true when the model's primary structure information is set.

bool SBMStructuralModel::hasPrimaryStructureInformation () const


function hasSecondaryStructureInformation#

Returns true when the model's secondary structure information is set.

bool SBMStructuralModel::hasSecondaryStructureInformation () const


function hasTitleInformation#

Returns true when the model's title information is set.

bool SBMStructuralModel::hasTitleInformation () const


function isLocked#

Returns whether the model is locked.

virtual bool SBMStructuralModel::isLocked () override const

This function is equivalent to getLockedFlag.

See also: getLockedFlag, setLockedFlag

Implements SBDDataGraphNode::isLocked


function isSerializable#

Returns true __

virtual bool SBMStructuralModel::isSerializable () override const

Implements SBMModel::isSerializable


function populateChainIDs#

Populates the chain IDs for all chains in the structural model.

bool SBMStructuralModel::populateChainIDs (
    bool forceRenumbering=false
) 

This function populates the chain IDs for all chains in the structural model.

The numbering of chain IDs for the chains with missing IDs will start from the maximum chain ID present in the structural model, for example, if there are chains with IDs 0, 1, 4 then the numbering of other chains with missing IDs will commence from 5.

If some chains have the same IDs then the repetitions will be renumbered, for example, chain IDs 0, 2, 2 will become 0, 2, 3.

If forceRenumbering is set to true then it renumbers chains IDs starting from 0 iff at least on of the chains has a missing ID or has the same ID as another chain in the structural model.


function print#

Prints debugging information.

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

Implements SBMModel::print


function removeChild#

Removes a child from the node.

virtual bool SBMStructuralModel::removeChild (
    SBNode * node
) override

This function is a convenience function equivalent to getStructuralRoot() ->removeChild(node)


function rotate#

Rotates the structural model.

void SBMStructuralModel::rotate (
    const SBVector3 & axis,
    const SBQuantity::dimensionless & angle
) 


function serialize#

Serializes the node.

virtual void SBMStructuralModel::serialize (
    SBCSerializer * serializer,
    const SBNodeIndexer & nodeIndexer,
    const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER,
    const SBVersionNumber & classVersionNumber=SBVersionNumber (1, 0, 0)
) override const

Implements SBMModel::serialize


function setConnectivityAnnotationInformation#

Sets the model's connectivity annotation information.

void SBMStructuralModel::setConnectivityAnnotationInformation (
    const std::string & info
) 


function setCrystallographicAndTransformationInformation#

Sets the model's crystallographic and transformation information.

void SBMStructuralModel::setCrystallographicAndTransformationInformation (
    const std::string & info
) 


function setHeterogenInformation#

Sets the model's heterogen information.

void SBMStructuralModel::setHeterogenInformation (
    const std::string & info
) 


function setLockedFlag#

Sets the locked flag.

virtual void SBMStructuralModel::setLockedFlag (
    bool flag
) override

This function sets the locked flag of the structural model.

This function is undoable.

See also: isLocked, getLockedFlag

Implements SBDDataGraphNode::setLockedFlag


function setMiscellaneousInformation#

Sets the model's miscellaneous information.

void SBMStructuralModel::setMiscellaneousInformation (
    const std::string & info
) 


function setOrientation [1/3]#

Sets the orientation of the structural model.

void SBMStructuralModel::setOrientation (
    const SBMatrix33 & orientation
) 


function setOrientation [2/3]#

Sets the orientation of the structural model.

void SBMStructuralModel::setOrientation (
    const SBMatrix33 & orientation,
    bool transformParticles
) 


function setOrientation [3/3]#

Sets the newOrientation and theoldOrientation of the structural model.

void SBMStructuralModel::setOrientation (
    SBMatrix33 const & newOrientation,
    SBMatrix33 const & oldOrientation,
    bool transformParticles=true
) 


function setPosition [1/3]#

Sets the position of the structural model.

void SBMStructuralModel::setPosition (
    const SBPosition3 & position
) 


function setPosition [2/3]#

Sets the position of the structural model.

void SBMStructuralModel::setPosition (
    const SBPosition3 & position,
    bool transformParticles
) 


function setPosition [3/3]#

Sets the newPosition and theoldPosition of the structural model.

void SBMStructuralModel::setPosition (
    SBPosition3 const & newPosition,
    SBPosition3 const & oldPosition,
    bool transformParticles=true
) 


function setPrimaryStructureInformation#

Sets the model's primary structure information.

void SBMStructuralModel::setPrimaryStructureInformation (
    const std::string & info
) 


function setSecondaryStructureInformation#

Sets the model's secondary structure information.

void SBMStructuralModel::setSecondaryStructureInformation (
    const std::string & info
) 


function setStructuralSignalFlag#

Sets whether the model can send structural signals.

void SBMStructuralModel::setStructuralSignalFlag (
    bool structuralSignalFlag
) 


function setTitleInformation#

Sets the model's title information.

void SBMStructuralModel::setTitleInformation (
    const std::string & info
) 


function setTransform [1/3]#

Sets the spatial transform of the structural model.

void SBMStructuralModel::setTransform (
    const SBSpatialTransform & transform
) 


function setTransform [2/3]#

Sets the spatial transform of the structural model.

void SBMStructuralModel::setTransform (
    const SBSpatialTransform & transform,
    bool transformParticles
) 


function setTransform [3/3]#

Sets the newTransform and theoldTransform of the structural model.

void SBMStructuralModel::setTransform (
    SBSpatialTransform const & newTransform,
    SBSpatialTransform const & oldTransform,
    bool transformParticles=true
) 


function structuralSignalIsConnectedToSlot#

Returns true if and only if the structural signal is connected to a given slot.

bool SBMStructuralModel::structuralSignalIsConnectedToSlot (
    SBCReferenceTarget * referenceTarget,
    void(SBCReferenceTarget::*)( SBStructuralEvent *) functionPointer,
    SBStructuralEvent::Type eventType=SBStructuralEvent::Type::Any
) const


function toSMILES#

Converts the structural model into a SMILES string.

std::optional< std::string > SBMStructuralModel::toSMILES () const

Returns:

An std::optional<std::string> containing the SMILES string, or std::nullopt if conversion failed.


function toSVG#

Converts the structural model into a 2D SVG representation.

std::optional< std::string > SBMStructuralModel::toSVG () const

Converts the structural model into an SVG representation.

Returns:

An std::optional<std::string> containing the SVG content, or std::nullopt if conversion failed.


function transform#

Applies a spatial transform to the structural model.

void SBMStructuralModel::transform (
    const SBSpatialTransform & transform
) 


function translate#

Translates the structural model.

void SBMStructuralModel::translate (
    const SBLength3 & translation
) 


function unserialize#

Unserializes the node.

virtual void SBMStructuralModel::unserialize (
    SBCSerializer * serializer,
    const SBNodeIndexer & nodeIndexer,
    const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER,
    const SBVersionNumber & classVersionNumber=SBVersionNumber (1, 0, 0)
) override

Implements SBMModel::unserialize


function ~SBMStructuralModel#

Destructor.

virtual SBMStructuralModel::~SBMStructuralModel () 

Deletes the model.


Public Static Functions Documentation#

function bondExists#

Checks whether the bond between atoms atom1 andatom2 exists.

static bool SBMStructuralModel::bondExists (
    SBMStructuralModelNodeAtom * atom1,
    SBMStructuralModelNodeAtom * atom2
) 

This function checks whether the bond between atoms atom1 and atom2 exists: it returns true if the bond exists and false otherwise.


function cloneStructuralNodes#

Adds in structuralModelIndexer the structural models resulting from cloning the structural nodes instructuralNodeIndexer .

static bool SBMStructuralModel::cloneStructuralNodes (
    SBNodeIndexer & structuralModelIndexer,
    const SBNodeIndexer & structuralNodeIndexer
) 


function computeDomain#

Computes the domain containing the atoms and bond atoms in the node indexer.

static SBSpatialDomain SBMStructuralModel::computeDomain (
    const SBNodeIndexer & nodeIndexer
) 


function createBond#

Creates a bond between atom1 andatom2 if there is none; sets the bond order tobondOrder and the bond type tobondType .

static bool SBMStructuralModel::createBond (
    SBMStructuralModelNodeAtom * atom1,
    SBMStructuralModelNodeAtom * atom2,
    double bondOrder=1.0,
    SBBond::BondType bondType=SBBond::BondType::Undefined
) 


function createCovalentBondsByResidueType [2/2]#

Builds covalent bonds for the atoms belonging to the given residues of the structural model according to the residue types, regardless of inter-atomic distances. If the bonds are already present, it sets the order of covalent bonds for the atoms belonging to the structural model according to the residue types.

static int SBMStructuralModel::createCovalentBondsByResidueType (
    const SBNodeIndexer & nodeIndexer
) 


function createModel#

Creates a structural model from a SMILES string.

static SBMStructuralModel * SBMStructuralModel::createModel (
    const std::string & smiles,
    const std::string & name,
    bool addHydrogens=true,
    bool addExplicitHydrogenOnly=false,
    bool kekulize=true,
    bool runUFF=true,
    int uffMaxIters=500,
    double uffVdwThreshold=10.0,
    int uffConfId=0
) 

This function creates an SBMStructuralModel instance based on the provided SMILES string. It allows optional steps such as hydrogen addition, kekulization, and energy minimization using UFF.

Parameters:

  • smiles The SMILES string representing the molecular structure.
  • name The name to assign to the created model.
  • addHydrogens Whether to add implicit hydrogen atoms (default: true).
  • addExplicitHydrogenOnly Whether to add only explicit hydrogens (default: false).
  • kekulize Whether to perform kekulization (default: true).
  • runUFF Whether to run the Universal Force Field (UFF) minimization (default: true).
  • uffMaxIters Maximum number of iterations for UFF minimization (default: 500).
  • uffVdwThreshold Van der Waals threshold for UFF minimization (default: 10.0).
  • uffConfId UFF conformation ID (default: 0).

Returns:

A pointer to the created SBMStructuralModel, or nullptr if creation failed.


function exportImage#

Exports a molecular structure (SMILES) as an image file (png, jpg, svg).

static bool SBMStructuralModel::exportImage (
    const std::string & smiles,
    const std::string & outputFile,
    int widthPx=600,
    int marginPx=10,
    double lineWidth=3.0,
    const std::string & fontFamily="Sans Serif Collection"
) 

Exports a molecular structure as an image file.

This function generates an image of the molecular structure from a given SMILES string and saves it in the specified file format (.png, .jpg, .jpeg, or .svg).

Parameters:

  • smiles The SMILES string representing the molecule.
  • outputFile The file path where the image should be saved.
  • widthPx Image width in pixels (default: 600).
  • marginPx Margin size in pixels around the structure (default: 10).
  • lineWidth Thickness of the molecular bonds (default: 3.0).
  • fontFamily Font family to use for text labels (default: "Sans Serif Collection").

Returns:

true if the export was successful, false otherwise.


function extractStructuralNodes#

Adds in structuralModelIndexer the structural models resulting from extracting the structural nodes instructuralNodeIndexer .

static bool SBMStructuralModel::extractStructuralNodes (
    SBNodeIndexer & structuralModelIndexer,
    const SBNodeIndexer & structuralNodeIndexer
) 


function findAtom [1/4]#

Returns, if found, an atom from a node indexer nodeIndexer with the typetype and namename ; else returns 0.

static SBMStructuralModelNodeAtom * SBMStructuralModel::findAtom (
    const SBNodeIndexer & nodeIndexer,
    SBElement::Type type,
    const std::string & name
) 


function findAtom [2/4]#

Returns, if found, an atom from an atom node indexer atomIndexer with the typetype and namename ; else returns 0.

static SBMStructuralModelNodeAtom * SBMStructuralModel::findAtom (
    const SBIndexer< SBMStructuralModelNodeAtom * > & atomIndexer,
    SBElement::Type type,
    const std::string & name
) 


function findAtom [3/4]#

Returns, if found, an atom from a node indexer nodeIndexer with the typetype , namename , and an alternate locationaltLoc (if the atom has an alternate location); else returns 0.

static SBMStructuralModelNodeAtom * SBMStructuralModel::findAtom (
    const SBNodeIndexer & nodeIndexer,
    SBElement::Type type,
    const std::string & name,
    char altLoc
) 


function findAtom [4/4]#

Returns, if found, an atom from an atom node indexer atomIndexer with the typetype , namename , and an alternate locationaltLoc (if the atom has an alternate location); else returns 0.

static SBMStructuralModelNodeAtom * SBMStructuralModel::findAtom (
    const SBIndexer< SBMStructuralModelNodeAtom * > & atomIndexer,
    SBElement::Type type,
    const std::string & name,
    char altLoc
) 


function getAltLocations [1/2]#

Returns a set of all alternate locations for atoms that belong to nodes present in nodeIndexer .

static std::set< char > SBMStructuralModel::getAltLocations (
    const SBNodeIndexer & nodeIndexer
) 


function getAltLocations [2/2]#

Returns a set of all alternate locations of atoms present in the atomIndexer .

static std::set< char > SBMStructuralModel::getAltLocations (
    const SBIndexer< SBMStructuralModelNodeAtom * > & atomIndexer
) 


function getAsphericity#

Returns the asphericity parameter of the system of atoms (based on their positions and masses) in nodeIndexer . The asphericity parameter changes in the [0, 1] interval: 0 - a sphere, 1 - a rod.

static double SBMStructuralModel::getAsphericity (
    const SBNodeIndexer & nodeIndexer
) 

This function returns the asphericity parameter of the system of atoms (based on their positions and masses) in nodeIndexer.

The asphericity parameter changes in the [0, 1] range, where 0 corresponds to a sphere and 1 corresponds to a rod.

If the nodeIndexer doesn't contain any atoms or their parents then the function returns zero.


function getCenterOfFormalCharge#

Returns the center of formal charge of atoms in nodeIndexer .

static SBPosition3 SBMStructuralModel::getCenterOfFormalCharge (
    const SBNodeIndexer & nodeIndexer
) 

This function returns the center of formal charge of atoms from nodeIndexer.

The center of formal charge is computed as follows:

R = sum(q_i * r_i, i=1..N) / Q

where N is the number of atoms, q_i is the i-th atom's formal charge, r_i is the i-th atom's position, and Q is the total formal charge of all of the N atoms.

If the nodeIndexer doesn't contain any atoms or their parents then the function returns the center of coordinates (SBPosition3::zero).


function getCenterOfMass#

Returns the center of mass of atoms in nodeIndexer .

static SBPosition3 SBMStructuralModel::getCenterOfMass (
    const SBNodeIndexer & nodeIndexer
) 

This function returns the center of mass of atoms from nodeIndexer.

The center of mass is computed as follows:

R = sum(m_i * r_i, i=1..N) / M

where N is the number of atoms, m_i is the i-th atom's mass, r_i is the i-th atom's position, and M is the total mass of all of the N atoms.

If the nodeIndexer doesn't contain any atoms or their parents then the function returns the center of coordinates (SBPosition3::zero).


function getCenterOfPartialCharge#

Returns the center of partial charge of atoms in nodeIndexer .

static SBPosition3 SBMStructuralModel::getCenterOfPartialCharge (
    const SBNodeIndexer & nodeIndexer
) 


function getCentroid#

Returns the centroid (the geometric center) of atoms in nodeIndexer .

static SBPosition3 SBMStructuralModel::getCentroid (
    const SBNodeIndexer & nodeIndexer
) 

This function returns the centroid (the geometric center) of atoms from nodeIndexer.

If the nodeIndexer doesn't contain any atoms or their parents then the function returns the center of coordinates (SBPosition3::zero).


function getDipoleMomentAtCenterOfCharge#

Returns the dipole moment of atoms in nodeIndexer at their center of charge (based on partial charge)

static SBQuantity::length SBMStructuralModel::getDipoleMomentAtCenterOfCharge (
    const SBNodeIndexer & nodeIndexer
) 

This function returns the dipole moment of atoms from nodeIndexer at their center of charge.

The dipole moment at center of charge is computed as follows:

m = norm(mu)

where mu is the dipole vector of atoms from nodeIndexer at their center of partial charge.

If the nodeIndexer doesn't contain any atoms or their parents then the function returns the center of coordinates (SBPosition3::zero).


function getDipoleMomentAtCenterOfMass#

Returns the dipole moment of atoms in nodeIndexer at their center of mass.

static SBQuantity::length SBMStructuralModel::getDipoleMomentAtCenterOfMass (
    const SBNodeIndexer & nodeIndexer
) 

This function returns the dipole moment of atoms from nodeIndexer at their center of mass.

The dipole moment at center of mass is computed as follows:

m = norm(mu)

where mu is the dipole vector of atoms from nodeIndexer at their center of mass.

If the nodeIndexer doesn't contain any atoms or their parents then the function returns the center of coordinates (SBPosition3::zero).


function getDipoleVectorAtCenterOfCharge#

Returns the dipole vector of atoms in nodeIndexer at their center of charge (based on partial charge)

static SBPosition3 SBMStructuralModel::getDipoleVectorAtCenterOfCharge (
    const SBNodeIndexer & nodeIndexer
) 

This function returns the dipole vector of atoms from nodeIndexer at their center of partial charge.

The dipole vector at center of charge is computed as follows:

mu = sum(q_i * (r_i - r_coc), i=1..N)

where N is the number of atoms, q_i is the i-th atom's partial charge, r_i is the i-th atom's position, and r_coc is the center of partial charge of these atoms.

If the nodeIndexer doesn't contain any atoms or their parents then the function returns the center of coordinates (SBPosition3::zero).


function getDipoleVectorAtCenterOfMass#

Returns the dipole vector of atoms in nodeIndexer at their center of mass.

static SBPosition3 SBMStructuralModel::getDipoleVectorAtCenterOfMass (
    const SBNodeIndexer & nodeIndexer
) 

This function returns the center of partial charge of atoms from nodeIndexer.

The center of partial charge is computed as follows:

R = sum(q_i * r_i, i=1..N) / Q

where N is the number of atoms, q_iis thei-th atom's partial charge,r_iis thei-th atom's position, andQis the total partial charge of all of theNatoms. / / If thenodeIndexer` doesn't contain any atoms or their parents then the function returns the center of coordinates (SBPosition3::zero).

SBPosition3 SBMStructuralModel::getCenterOfPartialCharge(const SBNodeIndexer& nodeIndexer) {

compute the center of charge

}

/ This function returns the dipole vector of atoms from nodeIndexer at their center of mass. / / The dipole vector at center of mass is computed as follows: / / mu = sum(q_i * (r_i - r_com), i=1..N) / / where N is the number of atoms, q_i is the i-th atom's partial charge, r_i is the i-th atom's position, and `r_com is the center of mass of these atoms.


function getInertiaTensor#

Returns the inertia tensor of the system of atoms (based on their positions and masses) in nodeIndexer .

static SBInertiaTensor33 SBMStructuralModel::getInertiaTensor (
    const SBNodeIndexer & nodeIndexer
) 

This function returns the moment of inertia tensor of the system of atoms (based on their positions and masses) in nodeIndexer relative to their center of mass.

If the nodeIndexer doesn't contain any atoms or their parents then the function returns a zero tensor.


function getMolecularWeight [1/2]#

Returns the cumulative molecular weight of nodes in nodeIndexer .

static SBQuantity::mass SBMStructuralModel::getMolecularWeight (
    const SBNodeIndexer & nodeIndexer
) 

This function returns the cumulative molecular weight of nodes in nodeIndexer.


function getPrincipalAxes#

Returns the principal axes of the inertia tensor of the system of atoms (based on their positions and masses) in nodeIndexer .

static SBMatrix33 SBMStructuralModel::getPrincipalAxes (
    const SBNodeIndexer & nodeIndexer
) 

The eigen vectors are sorted by their eigen value in the descending order, i.e. the first one corresponds to the first principal axes. In other words: the first axis corresponds to the longest domain dimension, while the third axis corresponds to the smallest domain dimension.

If the nodeIndexer doesn't contain any atoms or their parents then the function returns a zero matrix.


function getRadiusOfGyration#

Returns the radius of gyration of the system of atoms (based on their positions and masses) in nodeIndexer .

static SBQuantity::length SBMStructuralModel::getRadiusOfGyration (
    const SBNodeIndexer & nodeIndexer
) 

This function returns the radius of gyration of the system of atoms (based on their positions and masses) from nodeIndexer.

The radius of gyration is computed as follows:

Rg = sqrt(sum(m_i * (r_i - r_c)^2, i=1..N) / M)

where N is the number of atoms, m_i is the mass of i-th atom, r_i is the i-th atom's position, r_c is the center of mass of all N atoms, M is the total mass of all of the N atoms.

If the nodeIndexer doesn't contain any atoms or their parents then the function returns zero.


function getShapeParameter#

Returns the shape parameter of the system of atoms (based on their positions and masses) in nodeIndexer . The shape parameter, S, changes in the [-0.25, 2] interval, where 0 corresponds to a sphere, negative values correspond to oblate ellipsoid, positive values correspond to prolate ellipsoid.

static double SBMStructuralModel::getShapeParameter (
    const SBNodeIndexer & nodeIndexer
) 

This function returns the shape parameter of the system of atoms (based on their positions and masses) in nodeIndexer.

The shape parameter, S, changes in the [-0.25, 2] range, where 0 corresponds to a sphere, negative values correspond to oblate ellipsoid, positive values correspond to prolate ellipsoid.

It is computed as follows:

S = prod((lambda_i - lambda_mean), i=1..3) / (lambda_mean^3)

where lambda_i is the i-th eigen value of the inertia tensor, lambda_mean is the mean of eigen values and is equal to sum(lambda_i, i=1..3).

If the nodeIndexer doesn't contain any atoms or their parents then the function returns zero.


function getSolventAccessibleSurfaceArea#

Returns the solvent-accessible surface area (SASA) of the system of atoms in nodeIndexer with the probe radiusprobeRadius , and the number of points on a spherenumberOfPointsOnSphere .

static SBQuantity::squareLength SBMStructuralModel::getSolventAccessibleSurfaceArea (
    const SBNodeIndexer & nodeIndexer,
    const SBQuantity::length & probeRadius,
    const unsigned int numberOfPointsOnSphere
) 

This function returns the solvent-accessible surface area (SASA) of the system of atoms in nodeIndexer with the probe radius probeRadius, and the number of points on a sphere numberOfPointsOnSphere.

If the nodeIndexer doesn't contain any atoms or their parents then the function returns zero.


function getSpatialTransform#

Returns the spatial transform based on the inertia tensor of the system of atoms (based on their positions and masses) in nodeIndexer .

static SBDTypeSpatialTransform SBMStructuralModel::getSpatialTransform (
    const SBNodeIndexer & nodeIndexer
) 

The eigen vectors are sorted by their eigen value in the descending order, i.e. the first one corresponds to the first principal axes. In other words: the first axis corresponds to the longest domain dimension, while the third axis corresponds to the smallest domain dimension.

If the nodeIndexer doesn't contain any atoms or their parents then the function returns a zero transform.


function getSumOfFormalCharges [1/2]#

Returns the sum of formal charges of nodes in nodeIndexer .

static int SBMStructuralModel::getSumOfFormalCharges (
    const SBNodeIndexer & nodeIndexer
) 

This function returns the sum of formal charges of nodes in nodeIndexer.


function getSumOfPartialCharges [1/2]#

Returns the sum of partial charges of nodes in nodeIndexer .

static float SBMStructuralModel::getSumOfPartialCharges (
    const SBNodeIndexer & nodeIndexer
) 

This function returns the sum of partial charges of nodes in nodeIndexer.


function getWater [2/2]#

Finds water nodes in the nodeIndexer .

static void SBMStructuralModel::getWater (
    SBNodeIndexer & resultNodeIndexer,
    const SBNodeIndexer & nodeIndexer
) 

This function finds water nodes in the nodeIndexer and adds them to resultNodeIndexer.

The resulting water nodes might include water structural groups and water atoms.


function isPlanar#

Returns true if all atoms innodeIndexer are in the same plane.

static bool SBMStructuralModel::isPlanar (
    const SBNodeIndexer & nodeIndexer
) 

This function returns true if all atoms in nodeIndexer are in the same plane Note that for 3 atoms and less it will always return true.


function isValidSMILES#

Checks if a given SMILES string represents a valid molecular structure.

static bool SBMStructuralModel::isValidSMILES (
    const std::string & smiles
) 

Parameters:

  • smiles The SMILES string to validate.

Returns:

true if the SMILES string is valid, false otherwise.


function replaceAtom#

Replaces atom oldAtom with atomnewAtom . All bonds from the old atom are transferred to the new atom.

static void SBMStructuralModel::replaceAtom (
    SBMStructuralModelNodeAtom * oldAtom,
    SBMStructuralModelNodeAtom * newAtom,
    bool preserveOldAtomPosition=false
) 


function replaceBond#

Replaces bond oldBond with bondnewBond . All neighboring bonds from the old bond are transferred to the new bond.

static void SBMStructuralModel::replaceBond (
    SBMStructuralModelNodeBond * oldBond,
    SBMStructuralModelNodeBond * newBond,
    bool flipBond=false,
    bool preserveOldBondPosition=false
) 


function smilesToSVG#

Converts a SMILES string into an SVG representation.

static std::optional< std::string > SBMStructuralModel::smilesToSVG (
    const std::string & smiles,
    int widthPx=600
) 

This function takes a molecular structure in SMILES format and returns its SVG representation.

Parameters:

  • smiles The SMILES string to convert.
  • widthPx The width of the generated SVG image in pixels.

Returns:

An std::optional<std::string> containing the SVG content, or std::nullopt if conversion failed.