SBMStructuralModel Class Reference

This class describes a structural model.

Public Member Functions

 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)
 
 SB_DECLARE_DATA (SBMStructuralModel)
 
- Public Member Functions inherited from SBMModel
 SB_NODE_GETTER_0 (, SBDDataGraphNode::Type, GetModelType)
 
 SB_NODE_PREDICATE_1 (, IsModelType, SBDDataGraphNode::Type)
 
 SB_DECLARE_DATA (SBMModel)
 
virtual ~SBMModel ()
 Delete the model.
 
SBMModelgetNextModel () const
 Returns the next model in the parent.
 
SBMModelgetPreviousModel () const
 Returns the previous model in the parent.
 
virtual unsigned int getOpacity () const
 Returns the opacity.
 
virtual void setOpacity (unsigned int opacity)
 Sets the opacity.
 
virtual unsigned int getMinimumOpacity () const
 Returns the minimum opacity.
 
virtual unsigned int getTransparency () const
 Returns the transparency.
 
virtual void setTransparency (unsigned int transparency)
 Sets the transparency.
 
virtual unsigned int getMaximumTransparency () const
 Returns the maximum transparency.
 
- Public Member Functions inherited from SBDDataGraphNode
 SB_DECLARE_DATA (SBDDataGraphNode)
 
SBDDataGraphNodegetParent () const
 Returns the parent of the node. More...
 
SBDDataGraphNodegetThisNode () const
 Returns the pointer to this node. More...
 
SBDDataGraphNodegetNextNode () const
 Returns the pointer to the next node in the children of the node's parent. More...
 
SBDDataGraphNodegetPreviousNode () const
 Returns the pointer to the previous node in the children of the node's parent. More...
 
SBDDataGraphNodegetNextNode (SBDDataGraphNode::Type nodeType) const
 Returns the pointer to the next node with type nodeType in the children of the node's parent. More...
 
SBDDataGraphNodegetPreviousNode (SBDDataGraphNode::Type nodeType) const
 Returns the pointer to the previous node with type nodeType in the children of the node's parent. More...
 
SBDDocumentgetDocument () const
 Returns the document the node belongs to. More...
 
virtual bool canAddChild (SBDDataGraphNode *node, SBDDataGraphNode *nextNode=0) const
 Returns whether this node can add node as a child. More...
 
virtual bool addChild (SBDDataGraphNode *node, SBDDataGraphNode *nextNode=0)
 Adds a child to the node. More...
 
virtual bool removeChild (SBDDataGraphNode *node)
 Removes a child from the node. More...
 
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. More...
 
bool descendsFrom (SBDDataGraphNode *node) const
 Returns true if and only if this node is node, or descends from it. More...
 
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. More...
 
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. More...
 
bool isIn (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. More...
 
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. More...
 
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. More...
 
bool isOneOf (const SBNodeIndexer &nodeIndexer) const
 Returns true if and only if this node is one of the nodes of the nodeIndexer. More...
 
bool isOneOf (SBPointerIndexer< SBDDataGraphNode > *nodePointerIndexer) const
 Returns true if and only if this node is one of the nodes of the nodePointerIndexer. More...
 
SBDDataGraphNodegetRoot () const
 Returns the root of the hierarchy the node belongs to. More...
 
unsigned int getNodeIndex () const
 Returns the node index (unique in the whole data graph, but non-persistent) More...
 
std::string getTypeString (bool humanReadable=false) const
 Returns a string describing the type of the data graph node. More...
 
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. More...
 
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 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 isSimulator () const
 Returns true when the node is a simulator.
 
bool isStructuralParticle () const
 Returns true when the node is a structural particle (an atom or a pseudo-atom)
 
bool isCreated () const
 Returns true if and only if the node is created. More...
 
void create ()
 Creates the node. More...
 
bool isErased () const
 Returns true if and only if the node is erased. More...
 
void erase ()
 Erases the node. More...
 
unsigned int getFlags () const
 Returns the flags. More...
 
unsigned int getInheritedFlags () const
 Returns the inherited flags. More...
 
bool isSelected () const
 Returns whether the node is selected. More...
 
bool getSelected () const
 Returns whether the node is selected.
 
bool getSelectionFlag () const
 Returns the selection flag. More...
 
void setSelectionFlag (bool flag)
 Sets the selection flag. More...
 
bool isVisible () const
 Returns whether the node is visible. More...
 
bool getVisible () const
 Returns whether the node is visible.
 
bool getVisibilityFlag () const
 Returns the visibility flag. More...
 
void setVisibilityFlag (bool flag)
 Sets the visibility flag. More...
 
bool isHighlighted () const
 Returns whether the node is highlighted. More...
 
bool getHighlightingFlag () const
 Returns the highlighting flag. More...
 
void setHighlightingFlag (bool flag)
 Sets the highlighting flag. More...
 
virtual void display (RenderingPass renderingPass)
 Displays the node. More...
 
virtual void display ()
 Displays the node (deprecated) More...
 
virtual void displayForShadow ()
 Displays the node for shadowing purposes (deprecated) More...
 
virtual void displayForSelection ()
 Displays the node for selection purposes (deprecated) More...
 
virtual bool hasOpacityRange () const
 Returns whether the node has the opacity range.
 
virtual unsigned int getDefaultOpacity () const
 Returns the default 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 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 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 addMaterial (SBDDataGraphNodeMaterial *material)
 Adds a material. More...
 
bool removeMaterial ()
 Removes the material. More...
 
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. More...
 
SBDDataGraphNodegetMaterialOwner () const
 Returns the node whose material is inherited. More...
 
void connectBaseSignalToSlot (SBCReferenceTarget *referenceTarget, void(SBCReferenceTarget::*functionPointer)(SBBaseEvent *), SBCReferenceTarget *nextReferenceTarget=0, void(SBCReferenceTarget::*nextFunctionPointer)(SBBaseEvent *)=0)
 Connects the base signal to a slot. More...
 
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.
 
unsigned int countNodes (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 our without dependencies. More...
 
unsigned int countNodes (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 our without dependencies. More...
 
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. More...
 
- Public Member Functions inherited from SBCReferenceTarget
 SBCReferenceTarget ()
 
virtual ~SBCReferenceTarget ()
 
unsigned int getMemoryFootprint () const
 
void printReferencesToOwners () const
 

Constructors and destructors

 SBMStructuralModel ()
 Builds a base model.
 
virtual ~SBMStructuralModel ()
 Deletes the model.
 

Serialization

bool isSerializable () const
 Returns true.
 
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.
 

Rendering

virtual void expandBounds (SBIAPosition3 &bounds) const
 Expands the bounds to make sure the visual model fits inside them.
 
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.
 

Geometry

void centerTransform ()
 Centers the pivot of the transform on the center of mass of the particles contained in the structural model. More...
 
SBSpatialTransform const & getTransform () const
 Returns the spatial transform of the structural model.
 
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 the oldTransform of the structural model.
 
SBMatrix33 const & getOrientation () const
 Returns the orientation of the structural model.
 
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 the oldOrientation of the structural model.
 
SBPosition3 const & getPosition () const
 Returns the position 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 the oldPosition of the structural model.
 
void transform (const SBSpatialTransform &transform)
 Applies a spatial transform to the structural model.
 
void rotate (const SBVector3 &axis, const SBQuantity::dimensionless &angle)
 Rotates the structural model.
 
void translate (const SBLength3 &translation)
 Translates the structural model.
 

Topology

virtual bool canAddChild (SBNode *node, SBNode *nextNode=0) const
 Returns whether this node can add node as a child. More...
 
virtual bool canAddChildType (SBNode::Type nodeType) const
 Returns whether this node can add a node with type nodeType as a child. More...
 
virtual bool canHaveDescendantType (SBNode::Type nodeType) const
 Returns whether this node can have a node with type nodeType as a descendant. More...
 
virtual bool addChild (SBNode *node, SBNode *nextNode=0)
 Adds a child to the node. More...
 
virtual bool removeChild (SBNode *node)
 Removes a child from the node. More...
 
virtual SBPointerList< SBMStructuralModelNode > const * getChildren () const
 This function is a convenience function equivalent to getStructuralRoot()->getChildren
 
SBMStructuralModelNodeRootgetStructuralRoot () const
 
virtual SBMStructuralModelclone ()
 Returns a copy of the node and its descendants.
 
static bool extractStructuralNodes (SBNodeIndexer &structuralModelIndexer, const SBNodeIndexer &structuralNodeIndexer)
 Adds in structuralModelIndexer the structural models resulting from extracting the structural nodes in structuralNodeIndexer.
 
static bool cloneStructuralNodes (SBNodeIndexer &structuralModelIndexer, const SBNodeIndexer &structuralNodeIndexer)
 Adds in structuralModelIndexer the structural models resulting from cloning the structural nodes in structuralNodeIndexer.
 
static SBSpatialDomain computeDomain (const SBNodeIndexer &nodeIndexer)
 Computes the domain containing the atoms and bond atoms in the node indexer.
 

Locking

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

Identity

virtual SBDDataGraphNode::Type getType () const
 Returns the type of the data graph node.
 
virtual SBDDataGraphNode::Type getModelType () const
 Returns the model type.
 

Atoms

static void replaceAtom (SBMStructuralModelNodeAtom *oldAtom, SBMStructuralModelNodeAtom *newAtom, bool preserveOldAtomPosition=false)
 Replaces atom oldAtom with atom newAtom. All bonds from the old atom are transferred to the new atom.
 
static std::set< char > getAltLocations (const SBNodeIndexer &nodeIndexer)
 Returns a set of all alternate locations for atoms that belong to nodes present in nodeIndexer.
 
static std::set< char > getAltLocations (const SBIndexer< SBMStructuralModelNodeAtom *> &atomIndexer)
 Returns a set of all alternate locations of atoms present in the atomIndexer.
 
static SBMStructuralModelNodeAtomfindAtom (const SBNodeIndexer &nodeIndexer, SBElement::Type type, const std::string &name)
 Returns, if found, an atom from a node indexer nodeIndexer with the type type and name name; else returns 0.
 
static SBMStructuralModelNodeAtomfindAtom (const SBIndexer< SBMStructuralModelNodeAtom *> &atomIndexer, SBElement::Type type, const std::string &name)
 Returns, if found, an atom from an atom node indexer atomIndexer with the type type and name name; else returns 0.
 
static SBMStructuralModelNodeAtomfindAtom (const SBNodeIndexer &nodeIndexer, SBElement::Type type, const std::string &name, char altLoc)
 Returns, if found, an atom from a node indexer nodeIndexer with the type type, name name, and an alternate location altLoc (if the atom has an alternate location); else returns 0.
 
static SBMStructuralModelNodeAtomfindAtom (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 type type, name name, and an alternate location altLoc (if the atom has an alternate location); else returns 0.
 

Bonds

void createCovalentBonds ()
 Builds covalent bonds for the atoms belonging to the structural model according to the inter-atomic distances.
 
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.
 
static void replaceBond (SBMStructuralModelNodeBond *oldBond, SBMStructuralModelNodeBond *newBond, bool flipBond=false, bool preserveOldBondPosition=false)
 Replaces bond oldBond with bond newBond. All neighboring bonds from the old bond are transferred to the new bond.
 
static bool createBond (SBMStructuralModelNodeAtom *atom1, SBMStructuralModelNodeAtom *atom2, double bondOrder=1.0, SBBond::BondType bondType=SBBond::BondType::Undefined)
 Creates a bond between atom1 and atom2 if there is none; sets the bond order to bondOrder and the bond type to bondType.
 
static bool bondExists (SBMStructuralModelNodeAtom *atom1, SBMStructuralModelNodeAtom *atom2)
 Checks whether the bond between atoms atom1 and atom2 exists. More...
 
static 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.
 

Chains

bool populateChainIDs (bool forceRenumbering=false)
 Populates the chain IDs for all chains in the structural model. More...
 

Secondary structure

bool computeSecondaryStructure (bool &updated, bool forceUpdate=false)
 Computes the secondary structure for all residues in the structural model. More...
 

Messaging

void connectStructuralSignalToSlot (SBCReferenceTarget *referenceTarget, void(SBCReferenceTarget::*functionPointer)(SBStructuralEvent *), SBCReferenceTarget *nextReferenceTarget=0, void(SBCReferenceTarget::*nextFunctionPointer)(SBStructuralEvent *)=0)
 
bool structuralSignalIsConnectedToSlot (SBCReferenceTarget *referenceTarget, void(SBCReferenceTarget::*functionPointer)(SBStructuralEvent *)) const
 
void disconnectStructuralSignalFromSlot (SBCReferenceTarget *referenceTarget, void(SBCReferenceTarget::*functionPointer)(SBStructuralEvent *))
 

Selection functions

virtual void getNodes (SBNodeIndexer &nodeIndexer, SBNode::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 our without dependencies.
 
virtual void getNodes (SBNodeIndexer &nodeIndexer, const SBNodePredicate &selectionPredicate=SBDDataGraphNode::All(), const SBNodePredicate &visitPredicate=SBDDataGraphNode::All(), bool includeDependencies=false) const
 Returns some nodes.
 

Utility functions

void getWater (SBNodeIndexer &resultNodeIndexer) const
 Finds water nodes in the structural model. More...
 
static void getWater (SBNodeIndexer &resultNodeIndexer, const SBNodeIndexer &nodeIndexer)
 Finds water nodes in the nodeIndexer. More...
 
static SBQuantity::mass getMolecularWeight (const SBNodeIndexer &nodeIndexer)
 Returns the cumulative molecular weight of atoms in nodeIndexer. More...
 
static SBPosition3 getCentroid (const SBNodeIndexer &nodeIndexer)
 Returns the centroid (the geometric center) of atoms in nodeIndexer. More...
 
static SBPosition3 getCenterOfMass (const SBNodeIndexer &nodeIndexer)
 Returns the center of mass of atoms in nodeIndexer. More...
 
static 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. More...
 
static 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, possitive values correspond to prolate ellipsoid. More...
 
static SBQuantity::length getRadiusOfGyration (const SBNodeIndexer &nodeIndexer)
 Returns the radius of gyration of the system of atoms (based on their positions and masses) in nodeIndexer. More...
 
static SBInertiaTensor33 getInertiaTensor (const SBNodeIndexer &nodeIndexer)
 Returns the inertia tensor of the system of atoms (based on their positions and masses) in nodeIndexer. More...
 
static 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. More...
 
static 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. More...
 
static 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 radius probeRadius, and the number of points on a sphere numberOfPointsOnSphere. More...
 
static bool isPlanar (const SBNodeIndexer &nodeIndexer)
 Returns true if all atoms in nodeIndexer are in the same plane. More...
 

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.
 

Properties

bool hasTitleInformation () const
 Returns true when the model's title information is set.
 
std::string const & getTitleInformation () const
 Returns the model's title information.
 
void setTitleInformation (const std::string &info)
 Sets the model's title information.
 
void clearTitleInformation ()
 Clears the model's title information.
 
bool hasPrimaryStructureInformation () const
 Returns true when the model's primary structure information is set.
 
std::string const & getPrimaryStructureInformation () const
 Returns the model's primary structure information.
 
void setPrimaryStructureInformation (const std::string &info)
 Sets the model's primary structure information.
 
void clearPrimaryStructureInformation ()
 Clears the model's primary structure information.
 
bool hasHeterogenInformation () const
 Returns true when the model's heterogen information is set.
 
std::string const & getHeterogenInformation () const
 Returns the model's heterogen information.
 
void setHeterogenInformation (const std::string &info)
 Sets the model's heterogen information.
 
void clearHeterogenInformation ()
 Clears the model's heterogen information.
 
bool hasSecondaryStructureInformation () const
 Returns true when the model's secondary structure information is set.
 
std::string const & getSecondaryStructureInformation () const
 Returns the model's secondary structure information.
 
void setSecondaryStructureInformation (const std::string &info)
 Sets the model's secondary structure information.
 
void clearSecondaryStructureInformation ()
 Clears the model's secondary structure information.
 
bool hasConnectivityAnnotationInformation () const
 Returns true when the model's connectivity annotation information is set.
 
std::string const & getConnectivityAnnotationInformation () const
 Returns the model's connectivity annotation information.
 
void setConnectivityAnnotationInformation (const std::string &info)
 Sets the model's connectivity annotation information.
 
void clearConnectivityAnnotationInformation ()
 Clears the model's connectivity annotation information.
 
bool hasMiscellaneousInformation () const
 Returns true when the model's miscellaneous information is set.
 
std::string const & getMiscellaneousInformation () const
 Returns the model's miscellaneous information.
 
void setMiscellaneousInformation (const std::string &info)
 Sets the model's miscellaneous information.
 
void clearMiscellaneousInformation ()
 Clears the model's miscellaneous information.
 
bool hasCrystallographicAndTransformationInformation () const
 Returns true when the model's crystallographic and transformation information is set.
 
std::string const & getCrystallographicAndTransformationInformation () const
 Returns the model's crystallographic and transformation information.
 
void setCrystallographicAndTransformationInformation (const std::string &info)
 Sets the model's crystallographic and transformation information.
 
void clearCrystallographicAndTransformationInformation ()
 Clears the model's crystallographic and transformation information.
 

Statistics

unsigned int getNumberOfChains ()
 Returns the number of chains.
 
unsigned int getNumberOfMolecules ()
 Returns the number of molecules.
 
unsigned int getNumberOfResidues ()
 Returns the number of residues.
 
unsigned int getNumberOfSegments ()
 Returns the number of segments.
 
unsigned int getNumberOfStructuralGroups ()
 Returns the number of structural groups.
 
unsigned int getNumberOfStructuralModels ()
 Returns the number of structural models.
 
unsigned int getNumberOfAtoms ()
 Returns the number of atoms.
 
unsigned int getNumberOfCarbons ()
 Returns the number of carbons.
 
unsigned int getNumberOfHydrogens ()
 Returns the number of hydrogens.
 
unsigned int getNumberOfNitrogens ()
 Returns the number of nitrogens.
 
unsigned int getNumberOfOxygens ()
 Returns the number of oxygens.
 
unsigned int getNumberOfSulfurs ()
 Returns the number of sulfurs.
 
unsigned int getNumberOfOtherAtoms ()
 Returns the number of other atoms.
 
int getSumOfFormalCharges ()
 Returns the sum of formal charges.
 
float getSumOfPartialCharges ()
 Returns the sum of partial charges.
 
SBQuantity::mass getMolecularWeight ()
 Returns the molecular weight. More...
 

Debugging

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

Additional Inherited Members

- Public Types inherited from SBDDataGraphNode
enum  RenderingPass {
  RenderingPass::Setup,
  RenderingPass::OpaqueGeometry,
  RenderingPass::SelectableGeometry,
  RenderingPass::ShadowingGeometry,
  RenderingPass::TransparentGeometry,
  RenderingPass::Interface,
  RenderingPass::Text
}
 The rendering pass. More...
 
enum  Type {
  Undefined,
  StructuralModel,
  StructuralModelNode,
  StructuralModelConformation,
  Conformation,
  StructuralModelPath,
  Path,
  StructuralModelNodeGroup,
  StructuralGroup,
  StructuralModelNodeRoot,
  Root,
  StructuralModelNodeParticle,
  StructuralParticle,
  StructuralModelNodeAtom,
  Atom,
  StructuralModelNodePseudoAtom,
  PseudoAtom,
  StructuralModelNodeBond,
  Bond,
  StructuralModelNodePseudoBond,
  PseudoBond,
  StructuralModelNodeHydrogenBond,
  HydrogenBond,
  StructuralModelNodeHydrogenBondGroup,
  HydrogenBondGroup,
  StructuralModelNodeResidue,
  Residue,
  StructuralModelNodeSegment,
  Segment,
  StructuralModelNodeProtein,
  Protein,
  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,
  DynamicalParticle,
  DynamicalModelNodeRigidBody,
  RigidBody,
  DynamicalModelNodeArticulatedBody,
  ArticulatedBody,
  InteractionModel,
  InteractionModelParticleSystem,
  InteractionModelRigidBodySystem,
  InteractionModelArticulatedBodySystem,
  PropertyModel,
  PropertyModelFunction,
  Simulator,
  SimulatorParticleSystem,
  SimulatorRigidBodySystem,
  SimulatorArticulatedBodySystem,
  StateUpdater,
  StateUpdaterParticleSystem,
  StateUpdaterRigidBodySystem,
  StateUpdaterArticulatedBodySystem,
  DocumentManager,
  Document,
  Folder,
  Camera,
  Label,
  Note,
  Animation,
  Presentation,
  DataGraphNodeGroup,
  NodeGroup,
  Controller,
  ControllerNode,
  Asset
}
 The type of the data graph node. More...
 
- Static Public Member Functions inherited from SBDDataGraphNode
static void clone (const SBNodeIndexer &sourceNodeIndexer, SBNodeIndexer &destinationNodeIndexer)
 Clones the nodes in sourceNodeIndexer (treated as a whole) and places the clones in destinationNodeIndexer. More...
 
static SBDDataGraphNodegetNode (unsigned int nodeIndex)
 Returns the unique node corresponding to the node index nodeIndex. More...
 
static std::string getTypeString (Type type, bool humanReadable=false)
 Returns a string describing the type of the data graph node. More...
 
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.
 
- Protected Member Functions inherited from SBMModel
 SBMModel ()
 Builds a model.
 
 SBMModel (SBMModelData *dataPointer)
 Builds a model.
 
- Protected Member Functions inherited from SBDDataGraphNode
 SBDDataGraphNode ()
 Builds a data graph node. More...
 
 SBDDataGraphNode (SBDDataGraphNodeData *dataPointer)
 Builds a data graph node.
 
virtual ~SBDDataGraphNode ()
 Destroys the node. More...
 
- Protected Member Functions inherited from SBCReferenceTarget
void removeAllReferenceOwners ()
 
 SBCReferenceTarget (SBCReferenceTargetData *dataPointer)
 
- Protected Attributes inherited from SBCReferenceTarget
SBCReferenceTargetData * dataPointer
 

Member Function Documentation

◆ addChild()

bool SBMStructuralModel::addChild ( SBNode node,
SBNode nextNode = 0 
)
virtual

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

◆ bondExists()

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

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

◆ canAddChild()

bool SBMStructuralModel::canAddChild ( SBNode node,
SBNode nextNode = 0 
) const
virtual

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

◆ canAddChildType()

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

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

Reimplemented from SBDDataGraphNode.

◆ canHaveDescendantType()

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

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

Reimplemented from SBDDataGraphNode.

◆ centerTransform()

void SBMStructuralModel::centerTransform ( )

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

◆ computeSecondaryStructure()

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

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

◆ getAsphericity()

double SBMStructuralModel::getAsphericity ( const SBNodeIndexer nodeIndexer)
static

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.

◆ getCenterOfMass()

SBPosition3 SBMStructuralModel::getCenterOfMass ( const SBNodeIndexer nodeIndexer)
static

This function returns the center of mass of atoms from nodeIndexer The center of mass is computed as follows: R = sqrt(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).

◆ getCentroid()

SBPosition3 SBMStructuralModel::getCentroid ( const SBNodeIndexer nodeIndexer)
static

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

◆ getInertiaTensor()

SBInertiaTensor33 SBMStructuralModel::getInertiaTensor ( const SBNodeIndexer nodeIndexer)
static

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.

◆ getLockedFlag()

bool SBMStructuralModel::getLockedFlag ( ) const
virtual

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

Reimplemented from SBDDataGraphNode.

◆ getMolecularWeight() [1/2]

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

This function returns the cumulative molecular weight of atoms in nodeIndexer

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

◆ getMolecularWeight() [2/2]

SBQuantity::mass SBMStructuralModel::getMolecularWeight ( )
virtual

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.

Reimplemented from SBDDataGraphNode.

◆ getPrincipalAxes()

SBMatrix33 SBMStructuralModel::getPrincipalAxes ( const SBNodeIndexer nodeIndexer)
static

Returns the principal axes of the inertia tensor of the system of atoms (based on their positions and masses) in 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.

◆ getRadiusOfGyration()

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

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.

◆ getShapeParameter()

double SBMStructuralModel::getShapeParameter ( const SBNodeIndexer nodeIndexer)
static

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, possitive 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.

◆ getSolventAccessibleSurfaceArea()

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

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.

◆ getSpatialTransform()

SBDTypeSpatialTransform SBMStructuralModel::getSpatialTransform ( const SBNodeIndexer nodeIndexer)
static

Returns the spatial transform based on the inertia tensor of the system of atoms (based on their positions and masses) in 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.

◆ getStructuralRoot()

SBMStructuralModelNodeRoot * SBMStructuralModel::getStructuralRoot ( ) const

This function returns a pointer to the structural root of the structural model. 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).

◆ getWater() [1/2]

void SBMStructuralModel::getWater ( SBNodeIndexer resultNodeIndexer) const

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

◆ getWater() [2/2]

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

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.

◆ isLocked()

bool SBMStructuralModel::isLocked ( ) const
virtual

This function is equivalent to getLockedFlag

See also
getLockedFlag
setLockedFlag

Reimplemented from SBDDataGraphNode.

◆ isPlanar()

bool SBMStructuralModel::isPlanar ( const SBNodeIndexer nodeIndexer)
static

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

◆ populateChainIDs()

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.

◆ removeChild()

bool SBMStructuralModel::removeChild ( SBNode node)
virtual

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

◆ setLockedFlag()

void SBMStructuralModel::setLockedFlag ( bool  flag)
virtual

This function sets the locked flag of the structural model.

This function is undoable

See also
isLocked
getLockedFlag

Reimplemented from SBDDataGraphNode.