Class: AbstractRepositoryItem

Kekule.Editor. AbstractRepositoryItem

new AbstractRepositoryItem()

Base repository item class.
Properties:
Name Type Description
name String The unique name of this repository item.
Source:

Extends

  • ObjectEx

Methods

createObjects(targetObj, options) → {Hash}

Returns chem objects which can stored in this repository. All objects will be be inserted into chem editor when execute this repository item.
Parameters:
Name Type Description
targetObj Kekule.ChemObject Existing object in editor that the repository objects based on. Set it to null to indicate that the repository object should be created in blank space.
options Hash Options to create new objects. Different repository item may has different options.
Source:
Returns:
A hash object that should containing the following fields: { objects: Array, identical. Objects created. mergeObj: Kekule.ChemObject, optional. If created objects can merge with targetObj, this field decide the merge part. mergeDest: Kekule.ChemObject, optional. Which object should this repository item merge to. If not set, means merge to targetObj. baseObjCoord: The base object system coord to rotate objects added to editor after inserting immediately. //centerCoord: Center coord of repository object. }
Type
Hash

getAvailableCoordModes() → {Array}

Returns this repository item can be used in 2D/3D or both editor.
Source:
Returns:
Type
Array

getRefLength() → {Float}

Returns ref length to adjust repository object coord and size in editor.
Source:
Returns:
Type
Float

getScale() → {Float}

Returns default scale level of this repository object when adding to editor.
Source:
Returns:
Type
Float

initialize()

Source:

isOneStructureFragmentObj() → {Bool}

Returns if repository object created is one molecule (structure fragment).
Source:
Returns:
Type
Bool