new StructureUtils()
Util methods about chem structure.
Methods
-
(static) calcMostEmptyDirectionAngleOfChemObj(obj, linkedObjs, allowCoordBorrow) → {Float}
-
Get direction angle most empty space to a chem object. This function is in 2D mode.
Parameters:
Name Type Description objKekule.ChemStructureObject linkedObjsArray Objects around obj. allowCoordBorrowBool Returns:
- Type
- Float
-
(static) calcPreferred2DBondGrowingDirection(startingObj, defBondAngle, allowCoordBorrow) → {Float}
-
When adding a new bond to a node, this function will calculate the most suitable angle (related to X axis) of the bond direction.
Parameters:
Name Type Description startingObjObject defBondAngleFloat Default bond angle of this type of bond. allowCoordBorrowBool Returns:
- Type
- Float
-
(static) calcPreferred2DBondGrowingLocation(startingObj, bondLength, defAngle, allowCoordBorrow) → {Hash}
-
When adding a new bond to a node, this function will calculate the most suitable location of the bond direction.
Parameters:
Name Type Description startingObjObject bondLengthFloat defAngleFloat Default bond angle of this type of bond. allowCoordBorrowBool Returns:
Coord of the bond's ending point.- Type
- Hash
-
(static) getAllChemStructureNodesHtmlCode(nodes, labelConfigs) → {String}
-
Returns HTML code represents all the chem nodes situation.
Parameters:
Name Type Description nodesArray labelConfigsObject Returns:
- Type
- String
-
(static) getAllChemStructureNodesLabel(nodes, labelConfigs) → {String}
-
Returns label represents all the chem nodes situation.
Parameters:
Name Type Description nodesArray labelConfigsObject Returns:
- Type
- String
-
(static) getCascadeDeleteObjs(chemStructObj) → {Array}
-
Returns nodes or connectors that should be removed cascadely with chemStructObj.
Parameters:
Name Type Description chemStructObjObject - Deprecated:
- Yes
- Source:
Returns:
- Type
- Array
-
(static) getChemStructureNodeLabel(node, labelConfigs) → {String}
-
Returns label represents the chem node situation.
Parameters:
Name Type Description nodeKekule.ChemStructureNode labelConfigsObject Returns:
- Type
- String
-
(static) getStructureCenterAbsBaseCoord(structureFragment, coordMode, allowCoordBorrow) → {Hash}
-
Returns center abs base coord of a structure.
Parameters:
Name Type Description structureFragmentKekule.StructureFragment coordModeInt allowCoordBorrowBool Returns:
- Type
- Hash
-
(static) getSurroundingObjs()
-
Returns objects directly link arround chemObj. If chemObj is a node, returns node.getLinkedObjs(); if chemObj is connector, returns connector.getLinkedObjs() + connector.getConnectedObjs()
-
(static) isBondPropsMatch(src, target, propNames) → {boolean}
-
Check if two hash object that stores bond properties (type, order, stereo) is same in chemical means.
Parameters:
Name Type Description srcHash targetHash propNamesArray Property names to be compared Returns:
- Type
- boolean