-
appendConnector(connector)
-
Add connector to container.
Parameters:
- Source:
-
appendNode(node)
-
Add node to container. If node already in container, nothing will be done.
Parameters:
- Source:
-
clearConnectors()
-
Remove all connectors.
- Source:
-
clearNodes()
-
Remove all nodes.
- Source:
-
getChildAt(index) → {Variant}
-
Get child object (including both nodes and connectors) at index.
Parameters:
Name |
Type |
Description |
index |
Int
|
|
- Source:
Returns:
-
Type
-
Variant
-
getChildCount() → {Int}
-
Get count of child objects (including both nodes and connectors).
- Source:
Returns:
-
Type
-
Int
-
-
Get connector at index.
Parameters:
Name |
Type |
Description |
index |
Int
|
|
- Source:
Returns:
-
Type
-
Kekule.ChemStructureConnector
-
-
Get a structure connector object with a specified id.
Parameters:
Name |
Type |
Description |
id |
String
|
|
- Source:
Returns:
-
Type
-
Kekule.ChemStructureConnector
-
getConnectorCount() → {Int}
-
Return count of connectors.
- Source:
Returns:
-
Type
-
Int
-
getContainerBox(coordMode, allowCoordBorrow) → {Hash}
-
Calculate the box to fit whole glyph.
Parameters:
Name |
Type |
Description |
coordMode |
Int
|
Determine to calculate 2D or 3D box. Value from Kekule.CoordMode. |
allowCoordBorrow |
Bool
|
|
- Source:
Returns:
Box information. {x1, y1, z1, x2, y2, z2} (in 2D mode z1 and z2 will not be set).
-
Type
-
Hash
-
getNextSiblingOfChild(childObj) → {Variant}
-
Returns next sibling node or connector to childObj.
Parameters:
Name |
Type |
Description |
childObj |
Variant
|
Node or connector. |
- Source:
Returns:
-
Type
-
Variant
-
-
Get node at index.
Parameters:
Name |
Type |
Description |
index |
Int
|
|
- Source:
Returns:
-
Type
-
Kekule.ChemStructureNode
-
-
Get a structure node object with a specified id.
Parameters:
Name |
Type |
Description |
id |
String
|
|
- Source:
Returns:
-
Type
-
Kekule.ChemStructureNode
-
getNodeCount() → {Int}
-
Return count of nodes.
- Source:
Returns:
-
Type
-
Int
-
-
Get a structure node or connector object with a specified id.
Parameters:
Name |
Type |
Description |
id |
String
|
|
- Source:
Returns:
-
Type
-
Kekule.ChemStructureObject
-
hasChildObj(childObj) → {Bool}
-
Check if childObj is a child node or connector of this fragment's ctab.
Parameters:
- Source:
Returns:
-
Type
-
Bool
-
hasConnector(connector, checkNestedStructure) → {Bool}
-
Check if a connector exists in structure.
Parameters:
Name |
Type |
Description |
connector |
Kekule.ChemStructureConnector
|
Connector to seek. |
checkNestedStructure |
Bool
|
If true the nested sub groups will also be checked. |
- Source:
Returns:
-
Type
-
Bool
-
hasCtab()
-
Check whether a connection table is used to represent this fragment.
- Source:
-
hasNode(node, checkNestedStructure) → {Bool}
-
Check if a node exists in structure.
Parameters:
Name |
Type |
Description |
node |
Kekule.ChemStructureNode
|
Node to seek. |
checkNestedStructure |
Bool
|
If true the nested sub groups will also be checked. |
- Source:
Returns:
-
Type
-
Bool
-
indexOfChild(obj) → {Int}
-
Get the index of obj in children list.
Parameters:
Name |
Type |
Description |
obj |
Variant
|
|
- Source:
Returns:
Index of obj or -1 when not found.
-
Type
-
Int
-
indexOfConnector(connector) → {Int}
-
Get index of connector inside fragment.
Parameters:
- Source:
Returns:
-
Type
-
Int
-
indexOfNode(node) → {Int}
-
Get index of node.
Parameters:
- Source:
Returns:
-
Type
-
Int
-
insertBefore(obj, refChild) → {Int}
-
Insert obj before refChild in node or connector list of ctab.
If refChild is null or does not exists, obj will be append to tail of list.
Parameters:
Name |
Type |
Description |
obj |
Variant
|
A node or connector. |
refChild |
Variant
|
Ref node or connector |
- Source:
Returns:
Index of obj after inserting.
-
Type
-
Int
-
insertConnectorAt(connector, index)
-
Insert connector to index. If index is not set, node will be inserted as the first connector of ctab.
Parameters:
- Source:
-
insertNodeAt(node, index)
-
Insert node to index. If index is not set, node will be inserted as the first node of ctab.
Parameters:
- Source:
-
isEmpty() → {Bool}
-
Returns if this fragment has no formula or ctab, or ctab has no nodes or connectors.
- Source:
Returns:
-
Type
-
Bool
-
nodesHasCoord2D(allowCoordBorrow) → {Bool}
-
Check if child nodes has 2D coord.
Parameters:
Name |
Type |
Description |
allowCoordBorrow |
Bool
|
|
- Source:
Returns:
-
Type
-
Bool
-
nodesHasCoord3D(allowCoordBorrow) → {Bool}
-
Check if child nodes has 3D coord.
Parameters:
Name |
Type |
Description |
allowCoordBorrow |
Bool
|
|
- Source:
Returns:
-
Type
-
Bool
-
removeChild(childObj)
-
Remove child obj directly from connection table.
Parameters:
Name |
Type |
Description |
childObj |
Variant
|
A child node or connector. |
- Source:
-
removeChildObj(childObj, cascadeRemove, freeRemoved)
-
Remove childObj from connection table.
Parameters:
Name |
Type |
Description |
childObj |
Variant
|
A child node or connector. |
cascadeRemove |
Bool
|
Whether remove related objects (e.g., bond connected to an atom). |
freeRemoved |
Bool
|
Whether free all removed objects. |
- Source:
-
removeConnector(connector, preserveConnectedObjs)
-
Remove a connector in container.
Parameters:
Name |
Type |
Description |
connector |
Kekule.ChemStructureConnector
|
|
preserveConnectedObjs |
Bool
|
Whether delte relations between this connector and related nodes. |
- Source:
-
removeConnectorAt(index, preserveConnectedObjs)
-
Remove connector at index of connectors.
Parameters:
Name |
Type |
Description |
index |
Int
|
|
preserveConnectedObjs |
Bool
|
Whether delte relations between this connector and related nodes. |
- Source:
-
removeNode(node, preserveLinkedConnectors)
-
Remove a node in container.
Parameters:
Name |
Type |
Description |
node |
Kekule.ChemStructureNode
|
|
preserveLinkedConnectors |
Bool
|
Whether remove relations between this node and linked connectors. |
- Source:
-
removeNodeAt(index, preserveLinkedConnectors)
-
Remove node at index in container.
Parameters:
Name |
Type |
Description |
index |
Int
|
|
preserveLinkedConnectors |
Bool
|
Whether remove relations between this node and linked connectors. |
- Source:
-
replaceNode(oldNode, newNode)
-
Replace oldNode with new one, preserve coords and all linked connectors.
Parameters:
- Source: