Open Babel  3.0
Public Member Functions | List of all members
OBSquarePlanarStereo::Config Struct Reference

#include <openbabel/stereo/squareplanar.h>

Public Member Functions

 Config ()
 
 Config (unsigned long _center, const OBStereo::Refs &_refs, OBStereo::Shape _shape=OBStereo::ShapeU)
 
bool operator== (const Config &other) const
 
bool operator!= (const Config &other) const
 

Public Attributes

Data members defining stereochemistry.
unsigned long center
 
OBStereo::Refs refs
 
OBStereo::Shape shape
 
bool specified
 

Detailed Description

Stereochemical configuration for square planar stereocenters.

The config struct represents the stereochemistry in a well defined way. For squareplanar stereocenters, the following data members define the spacial arrengement of the atoms.

squareplanar.png
SPshapes.png

Only center are specific for OBSquarePlanarStereo::Config. The other data members occur in all OBTetraPlanarStereo derived classes.

Constructor & Destructor Documentation

◆ Config() [1/2]

Config ( )
inline

Default constructor. Initializes center to OBStereo::NoRef and shape to OBStereo::ShapeU.

◆ Config() [2/2]

Config ( unsigned long  _center,
const OBStereo::Refs _refs,
OBStereo::Shape  _shape = OBStereo::ShapeU 
)
inline

Constructor with all parameters.

Parameters
_centerThe atom id for the central atom.
_refsThe 4 reference ids.
_shapeThe shape for the 4 reference ids.

Member Function Documentation

◆ operator==()

bool operator== ( const Config other) const

Equal to operator. Comparing OBSquarePlanarStereo::Config structs is done using the information stored in the struct's data members (i.e. center, refs and shape).

There are a number of cases resuling in false being returned:

  • center atom ids don't match
  • One of the Refs lists does not contain 4 elements.
  • 2 or more OBStereo::ImplicitRef values in a single Config struct
  • (The two refs don't share a single common element)

In the simplest case where both refs contain exactly the same elements (OBStereo::ContainsSameRefs()), coould include OBStereo::ImplicitRef), both Config struct are normalized to OBStereo::ShapeU starting with the same element. After this normalization, there are two possible orientations to overlay the shape on the double bond. From the illustration below, it can be seen only refs[2] has to be checked in order to conclude both Config structs have the same stereochemistry.

 1   4    1      4    1------4
  \ /     |      |           |
   C      |      |           |
  / \     |      |           |
 2   3    2------3    2------3

          1 2 3 4     1 2 3 4
          |   |       |   |      <- in any case, refs[0] & refs[2] remain unchanged
          1 2 3 4     1 4 3 2

When comparing a Config struct with explicit hydrogen(s) to one with implicit hydrogen(s), both refs are also normalized to OBStereo::ShapeU starting with the same common element. This shared element cannot be OBStereo::ImplicitRef. Depending on the position of the OBStereo::ImplicitRef element(s) in the refs, 3 cases are possible:

 refs[2] != OBStereo::ImplicitId:

   (analog to the case above where they contained the same elements )

   1 2 3 4
   |   |      <- refs[0] & refs[2] remain unchanged
   1 H 3 H

 else:

   1 2 3 4
   |     |    <- refs[0] & refs[3] remain unchanged
   1 H H 4

   1 2 3 4
   | |        <- refs[0] & refs[1] remain unchanged
   1 2 H H

In each case, the orientation of the U shape is also defined since there can be only one OBStereo::ImplicitRef for each side of the double bond.

Returns
True if both Config structs represent the stereochemistry.

◆ operator!=()

bool operator!= ( const Config other) const
inline

Not equal to operator. This is the inverse of the Equal to operator==.

Returns
True if the two Config structs represent a different stereochemistry.

Member Data Documentation

◆ center

unsigned long center

◆ refs

The 4 reference ids.

Referenced by OBSquarePlanarConfig::Convert(), and OBSquarePlanarConfig::operator==().

◆ shape

The shape of the 4 reference ids.

Referenced by OBSquarePlanarConfig::Convert().

◆ specified

bool specified

True if the stereochemistry is specified. When false, the described special orientation is only accidental (i.e. unspecified).

Referenced by OBSquarePlanarConfig::Convert().


The documentation for this struct was generated from the following file: