Subsections

   
7.4 OEColorForceField

class OEColorForceField

The OEColorForceField class contains atom types and interactions used by both OEColorOverlap and OEBestOverlay to calculate color interactions.

7.4.1 Constructors

 
OEColorForceField()
OEColorForceField(const OEColorForceField &rhs)
OEColorForceField(const OEColorForceFieldImpl *impl)

Default and copy constructors.

7.4.2 operator=

 
OEColorForceField &operator=(const OEColorForceField &rhs)

Assignment operator. The contents of the passed OEColorForceField reference are copied into an OEColorForceField instance.

7.4.3 AddColorer

 
bool AddColorer(unsigned int type, const std::string &smarts)
bool AddColorer(unsigned int type, const char *smarts)

Add a SMARTS pattern that maps an atom or set of atoms to a pre-defined atom type, created with AddType.

Note that you can use something like:

7.4.4 AddInteraction

 
bool AddInteraction(unsigned int type1, unsigned int type2,
                    const std::string &interaction_type, float weight,
                    float range)

Add an interaction between 2 pre-defined atom types (using AddType). The interaction type can be either ``gaussian'' or ``discrete''. Weight and radius are the 2 gaussian parameters. Weight corresponds to the height of the gaussian and radius is the distance where the gaussian drops to (1/e). Note that since in most cases the color force field is used to match like with like, we need an attractive force, which means we use a negative weight. In the built-in color force fields, the weights default to -1.0 and the radius default is 1.0.

7.4.5 AddType

 
unsigned int AddType(const char *name)
unsigned int AddType(const std::string &name)

Add a new atom type to the list of named types. Examples might be ``donor'', ``acceptor'', etc.

7.4.6 Clear

 
void Clear()

Clear all atom types and interactions.

7.4.7 ClearInteractions

 
void ClearInteractions()

Clear on the interactions while leaving the atom types in place. Useful for setting up a force field with one of the built-in types, but then adding a different set of interactions.

7.4.8 GetTitle

 
const char *GetTitle() const

Return the title from this force field.

7.4.9 GetType

 
unsigned int GetType(std::string k) const

Return the unsigned int corresponding to a given type.

7.4.10 GetTypeName

 
std::string GetTypeName(unsigned int type) const

Get the name back, given the unsigned int atom type.

7.4.11 Init

 

Set up the atom types and interactions.

bool Init(unsigned int cffType);

This sets up one of the built-color force field defintions as described above and outlined in the OEColorFFType namespace (section 9.3).

bool Init(OEPlatform::oeistream &is, bool verbose=false);
bool Init(const std::string &filename, bool verbose=false);

Set up the internal definitions by reading a color force field file from an input stream or directly from a file. Setting verbose to true prints information to stderr as the file is parsed. This can be useful when writing a new color force field file from scratch.

7.4.12 Ready

 
bool Ready() const

Returns true when the object is set up with atom types and interactions.

7.4.13 SetTitle

 
bool SetTitle(const char *title)

Set the force field title.

7.4.14 Write

 
bool Write(OEPlatform::oeostream &os)

Write the current color force field out to a stream. If this is placed into a file, the subsequent file can be used with Init as well as with ROCS.