class OEColorForceField
The OEColorForceField class contains atom types and interactions used by both OEColorOverlap and OEBestOverlay to calculate color interactions.
OEColorForceField() OEColorForceField(const OEColorForceField &rhs) OEColorForceField(const OEColorForceFieldImpl *impl)
Default and copy constructors.
OEColorForceField &operator=(const OEColorForceField &rhs)
Assignment operator. The contents of the passed OEColorForceField reference are copied into an OEColorForceField instance.
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:
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.
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.
void Clear()
Clear all atom types and interactions.
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.
const char *GetTitle() const
Return the title from this force field.
unsigned int GetType(std::string k) const
Return the unsigned int corresponding to a given type.
std::string GetTypeName(unsigned int type) const
Get the name back, given the unsigned int atom type.
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.
bool Ready() const
Returns true when the object is set up with atom types and interactions.
bool SetTitle(const char *title)
Set the force field title.
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.