# OEInteractionHint¶

class OEInteractionHint : public OESystem::OEBase


The OEInteractionHint class is a container that stores a typed interaction between two fragments (OEInteractionHintFragment) of an OEInteractionHintContainer object.

Schematic representation of interaction hint container

The following built-in interaction hint types are available:

Code Examples

## Constructors¶

OEInteractionHint(const OEInteractionHintContainerImpl *container,
const OEInteractionHintFragment *fragBgn,
const OEInteractionHintFragment *fragEnd,
const OEInteractionHintTypeBase &itype)


Constructs an OEInteractionHint object with the given parameters.

container
The OEInteractionHintContainer object the two fragments belong to.
fragBgn, fragEnd
The two fragments of the interaction. The first fragment is going to be considered as the ‘begin’ fragment, while the second one will be the considered as the ‘end’ fragment.
type
The type of the interaction that is derived from the OEInteractionHintTypeBase abstract base class.

OEInteractionHint(const OEInteractionHint &rhs)


Copy constructor.

## operator=¶

OEInteractionHint &operator=(const OEInteractionHint &rhs)


Assignment operator.

## CreateCopy¶

OESystem::OEBase *CreateCopy() const


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

## HasCalculatedGeometry¶

bool HasCalculatedGeometry(const std::string& name) const


Returns true if the interaction hint has the geometry calculated with the given name.

name
The name of the calculated geometry. All interaction hint geometry names start with the bio:interaction: prefix. The OEInteractionHint.HasCalculatedGeometry method can be invoked with or without the bio:interaction: prefix in the given name.

## GetBgnFragment¶

const OEInteractionHintFragment *GetBgnFragment() const


Returns the ‘begin’ fragment of the interaction. The ‘begin’ fragment is defined when the interaction is constructed.

## GetCalculatedGeometry¶

double GetCalculatedGeometry(const std::string& name) const


Returns the calculated geometry of the interaction (such as distance or angle). The “distance” values are given in Angstroms, and all “angle” values are given in radians.

name
The name of the calculated geometry. All interaction hint geometry names start with the bio:interaction: prefix. The OEInteractionHint.GetCalculatedGeometry method can be invoked with or without the bio:interaction: prefix in the given name.

Hint

It is a good practice to call OEInteractionHint.HasCalculatedGeometry beforehand to check whether the interaction hint has a geometry with a given name.

Example:

if (inter.HasCalculatedGeometry("distance")) {
double distance = inter.GetCalculatedGeometry("distance");
System.out.println("distance: " +
String.format("%.3f", distance) + " Angstrom(s)");
}
if (inter.HasCalculatedGeometry("acceptor-angle")) {
double angle = Math.toDegrees(inter.GetCalculatedGeometry("acceptor-angle"));
System.out.println("acceptor angle: " +
String.format("%.3f", angle) + " degree(s)");
}


## GetCalculatedGeometries¶

OESystem::OEIterBase<const std::string>* GetCalculatedGeometries() const


Returns an iterator over the geometry names of the interaction hint.

## GetDataType¶

const void *GetDataType() const


This function is used to perform run-time type identification.

## GetDetails¶

std::string GetDetails() const


Returns the string data associated with the OEInteractionHint object.

## GetEndFragment¶

const OEInteractionHintFragment *GetEndFragment() const


Returns the ‘end’ fragment of the interaction. The ‘end’ fragment is defined when the interaction is constructed.

## GetFragment¶

const OEInteractionHintFragment *
GetFragment(const OEInteractionHintComponentTypeBase &) const


Returns the pointer to one fragment with the given component type. If neither the ‘begin’ nor the ‘end’ fragment has the given type, a NULL pointer will be returned.

Warning

In case of an intramolecular interaction, the OEInteractionHint.GetFragment can return a NULL pointer, so the return value should always be checked.

The following built-in component types are available:

## GetInteractionType¶

const OEInteractionHintTypeBase &GetInteractionType() const


Returns the interaction type of the OEInteractionHint object.

The following built-in fragment connection types are available:

## GetWeight¶

double GetWeight() const


Returns the ‘weight’ (or score) associated with the OEInteractionHint object.

## IsDataType¶

bool IsDataType(const void *) const


Returns whether type is the same as the instance this method is called on.

## IsInter¶

bool IsInter() const


Returns whether the two fragments of the OEInteractionHint object belongs to the different molecules.

## IsIntra¶

bool IsIntra() const


Returns whether the two fragments of the OEInteractionHint object belongs to the same molecule.

## IsValid¶

bool IsValid() const


Returns whether the OEInteractionHint object represents a valid interaction defined by the type associated with it.

## SetDetails¶

void SetDetails(const std::string& details)


Sets string data associated with the OEInteractionHint object.

## SetWeight¶

void SetWeight(double)


Sets the ‘weight’ associated with the OEInteractionHint object.

weight
This number has to be in the range of [0.0, 1.0].