OEBondSVGMarkupBase¶
class OEBondSVGMarkupBase
OEBondSVGMarkupBase is an abstract base class.
Concrete classes derived from the base class define the markup of
the bonds in .svg
images that are generated
when calling the OERenderMolecule function.
Drawing elements representing bonds in the .svg
images are grouped together
in the following format in which the <group id>
and <class name>
strings can be defined in the derived concrete classes.
<g id='<group id>' class='<class name>'>
..
list of drawing elements
..
</g>
The following classes derive from this class:
See also
Note
User defined SVG atom marking can be implemented by deriving from this class and implementing all the methods listed below.
Example of using user defined SVG atom markings
class UserDataSVGBondIdxMarkup(oedepict.OEBondSVGMarkupBase):
def GetClassName(self, bond):
return "user-def-bond-class"
def GetGroupId(self, bond):
return "user-def-bond-{}".format(bond.GetIdx())
def CreateCopy(self):
return UserDataSVGBondIdxMarkup().__disown__()
opts = oedepict.OE2DMolDisplayOptions(width, height, oedepict.OEScale_AutoScale)
opts.SetBondSVGMarkupFunctor(UserDataSVGBondIdxMarkup())
disp = oedepict.OE2DMolDisplay(mol, opts)
CreateCopy¶
OEBondSVGMarkupBase *CreateCopy() const =0
Virtual const constructor which allows copying of concrete derived objects using a reference to this base class.
GetClassName¶
std::string GetClassName(const OEChem::OEBondBase &) const =0
Returns the <class name>
associated with a specific bond group
in the .svg
image.
This is a virtual method that has to be implemented in the concrete
derived classes.
The return string will be verified by the
OEIsValidSVGClassName
function.
Invalid SVG class names will be ignored.
See also
OEIsValidSVGClassName
function
GetGroupId¶
std::string GetGroupId(const OEChem::OEBondBase &) const =0
Returns the <group id>
associated with a specific bond group
in the .svg
image.
This is a virtual method that has to be implemented in the concrete
derived classes.
The return string will be verified by the
OEIsValidSVGGroupId
function.
Invalid SVG group ids will be ignored.
See also
OEIsValidSVGGroupId
function