Editors
The structure, topology and connectivity of :class:`entities <EntityHandle>` is edited via editors. This includes operations such as changing atom positions, connecting atoms with bonds as well as adding and removing chains, residues and atoms. There are two flavors of editors, one for the internal coordinate system (:class:`ICSEditor`) and one for the external coordinate system (:class:`XCSEditor`).
Edit Modes
Editors support two modes: An unbuffered edit mode and a buffered edit mode. In the unbuffered edit mode, dependent information such as the spatial organizer and the internal coordinate system (in case of the XCSEditor) are updated after every change. In buffered edit mode, the updates are delayed until one of the following happens:
- The last editor goes out of scope.
- :meth:`XCSEditor.UpdateICS` or :meth:`ICSEditor.UpdateXCS` is called explicitly.
The editors follow the RIAA (resource allocation is initialization) principle: Whenever an editor is requested an internal reference counter is incremented. In the destructor, this reference count is decremented. When the count drops to zero, the dependent information is updated.
In Python, one can not rely on the destructors being called. It is advised to always put a call to :meth:`XCSEditor.UpdateICS` or :meth:`ICSEditor.UpdateXCS` when the editing is finished. Alternatively, starting from Python version 2.6, one can use the with statement to make sure the destructor are called and the dependent information is updated.
Basic Editing Operations
The basic functionality of editors is implemented in the EditorBase class.
Note
To use the editing functions available in :class:`EditorBase`, it is recommended to use the external coordinate system :class:`XCSEditor` for performance reasons.
Inherited by :class:`XCSEditor`, :class:`ICSEditor`.
Editor for the External Coordinate System
The XCSEditor defines the interface for manipulating the external coordinate system. The external coordinate system directly operates on atom positions in Euclidian space.
Inherits :class:`EditorBase`
Editor for the Internal Coordinate System
The :class:`ICSEditor` is used to manipulate the internal coordinate system that is defined by bond lengths and angles. You can create an editor with the :class:`~EntityHandle.EditICS` method of the :class:`EntityHandle`.