OE2DAtomDisplay¶

class OE2DAtomDisplay : public OEAtomDisplayBase


This class stores 2D depiction information of an atom. See Figure: OEDepict TK atom display class hierarchy.

OEDepict TK atom display class hierarchy

The following figure (Figure: Example of the layout of an atom) illustrates how atoms are rendered in the OEDepict TK.

Example of the layout of an atom

The following methods are publicly inherited from OEAtomDisplayBase:

The OE2DAtomDisplay class stores the following properties:

Property Get method Set method Corresponding namespace / class / type
rendered formal charge GetCharge SetCharge integer
position of the atom label GetCoords SetCoords OE2DPoint class
hydrogen count GetHCount SetHCount unsigned int
position of hydrogen label GetHPosition SetHPosition OEHydrogenPos namespace
rendered atom label GetLabel SetLabel string
font of atom label GetLabelFont SetLabelFont OEFont class
rendered isotope number GetMass SetMass integer
rendered string as property GetProperty SetProperty string
font of property string GetPropertyFont SetPropertyFont OEFont class
position of property label GetPropertyOffset SetPropertyOffset OE2DPoint class

Constructors¶

OE2DAtomDisplay(const OEChem::OEAtomBase* atom)


Construct an OE2DAtomDisplay object that contains the style information for atom.

OE2DAtomDisplay(const OE2DAtomDisplay &rhs)


Copy constructor.

operator=¶

OE2DAtomDisplay &operator=(const OE2DAtomDisplay &rhs)


Assignment operator.

CreateCopy¶

OESystem::OEBase *CreateCopy() const


Deep copy constructor that returns a pointer to a copy of the object. The memory returned is dynamically allocated and owned by the caller.

GetCharge¶

int GetCharge() const


Returns the charge rendered next to the atomic label. See example in Figure: Example of charge representation. The number will be rendered in the following ways:

0: nothing is rendered negative sign “-” is rendered positive sign “+” is rendered “-” is rendered “+” is rendered

Example of charge representation

GetCoords¶

const OE2DPoint &GetCoords() const


Returns the coordinates of the atom in the coordinate system that is defined when a OE2DMolDisplay object is constructed with a specific width and height. This is the exact location of the atom when it is rendered into an image.

GetHCount¶

unsigned int GetHCount() const


Returns the hydrogen count to render for this atom. See example in Figure: Example of hydrogen count representation. The number will be rendered in the following ways:

0: no “H” label is rendered “H” is rendered next to the atomic label this number is rendered as a sub-script of the “H” label

Example of hydrogen count representation

GetHPosition¶

unsigned int GetHPosition() const


Returns the position of the hydrogen label relative to the atomic label. The return value is taken from the OEHydrogenPos namespace.

GetLabel¶

const std::string &GetLabel() const


Returns the string that is rendered as the atomic label at the coordinates returned by the OE2DAtomDisplay::GetCoords method. The color of the font is set by the

GetLabelFont¶

const OEFont &GetLabelFont() const


Returns the font that is used when rendering the atomic label string of the OE2DAtomDisplay object.

GetMass¶

unsigned int GetMass() const


Returns the isotope information rendered as a super-script next to the atomic label. If zero, nothing is rendered. See example in Figure: Example of isotope representation.

Example of isotope representation

GetProperty¶

const std::string &GetProperty() const


Returns the string rendered next to the atom. If the string is empty, nothing is rendered.

GetPropertyFont¶

const OEFont &GetPropertyFont() const


Returns the font that is used when rendering the property string of the OE2DAtomDisplay object.

GetPropertyOffset¶

const OE2DPoint &GetPropertyOffset() const


Returns the offset vector relative to the coordinates returned by OE2DAtomDisplay::GetCoords that is used to position the property label of the atom. These vectors are calculated during OE2DMolDisplay construction to minimize potentially clashing with the rest of the depiction. See Figure: The property offset vector is relative to coordinates returned by the GetCoords method.

The property offset vector is relative to coordinates returned by the OE2DAtomDisplay::GetCoords method

This allows for any string representable information to be rendered at a logical location near the atom. See example in Example of indices as an atom property.

Example of indices as an atom property

unsigned int GetRadical() const


Returns the radical display type of the atom. The return value is taken from the OERadicalDisplayType namespace. See example in Example of rendering radicals.

HasLabel¶

bool HasLabel() const


Returns whether or not the atomic label string of the OE2DAtomDisplay object is empty.

HasProperty¶

bool HasProperty() const


Returns whether or not the property string of the OE2DAtomDisplay object is empty.

SetCharge¶

void SetCharge(int charge)


Sets the charge rendered next to the atomic label.

SetCoords¶

void SetCoords(const OE2DPoint &coords)


Sets the exact coordinates of the atom in the rendered image.

SetHCount¶

void SetHCount(unsigned int hcount)


Set the hydrogen count to render for this atom.

SetHPosition¶

void SetHPosition(unsigned int hpos)


Sets the position of hydrogen label relative to the atomic label.

hpos
This value has to be from the OEHydrogenPos namespace.

SetLabel¶

void SetLabel(const std::string &label)


Sets the string that is rendered as the “atomic” label at the position returned by the OE2DAtomDisplay::GetCoords method.

SetLabelFont¶

void SetLabelFont(const OEFont &font)


Sets the font that is used when rendering the atomic label of the OE2DAtomDisplay object.

SetMass¶

void SetMass(unsigned int mass)


Sets the isotope information rendered next to the atomic label.

SetProperty¶

void SetProperty(const std::string &label)


Sets the string rendered next to the atom.

Warning

The preferred way to set the atom property strings is to use the OE2DMolDisplayOptions::SetAtomPropertyFunctor method. See example in the Displaying Atom Properties section.

SetPropertyFont¶

void SetPropertyFont(const OEFont &font)


Sets the font that is used when rendering the property string of the OE2DAtomDisplay object.

Warning

The preferred way to set the font of the atom property strings is to use the OE2DMolDisplayOptions::SetAtomPropLabelFont method.

SetPropertyOffset¶

void SetPropertyOffset(const OE2DPoint &offset)


Sets the offset vector that is used to position the property label of the atom.

void  SetRadical(unsigned int radical)