OBGrid Class Reference

A base grid class. More...

#include <openbabel/grid.h>

Inheritance diagram for OBGrid:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 OBGrid ()
virtual void Init (OBMol &box)
double GetXmin () const
double GetYmin () const
double GetZmin () const
double GetXmax () const
double GetYmax () const
double GetZmax () const
bool PointIsInBox (double x, double y, double z)
bool PointIsInBox (double *c)
virtual bool Clear ()
virtual OBBaseDoTransformations (const std::map< std::string, std::string > *)
template<class T>
T * CastAndClear (bool clear=true)
Generic data handling methods (via OBGenericData)
bool HasData (const std::string &)
bool HasData (const char *)
bool HasData (const unsigned int type)
void DeleteData (unsigned int type)
void DeleteData (OBGenericData *)
void DeleteData (std::vector< OBGenericData * > &)
void SetData (OBGenericData *d)
unsigned int DataSize () const
OBGenericDataGetData (const unsigned int type)
OBGenericDataGetData (const std::string &)
OBGenericDataGetData (const char *)
std::vector< OBGenericData * > & GetData ()
std::vector< OBGenericData * > GetData (DataOrigin source)
OBDataIterator BeginData ()
OBDataIterator EndData ()

Static Public Member Functions

static const char * ClassDescription ()

Protected Attributes

double _xmin
double _xmax
double _ymin
double _ymax
double _zmin
double _zmax
std::vector< OBGenericData * > _vdata

Detailed Description

A base grid class.


Constructor & Destructor Documentation

OBGrid (  )  [inline]


Member Function Documentation

void Init ( OBMol box  )  [virtual]

Initialize the grid based on a box around the molecule box Subclasses should overload this method -- this only tracks the dimension of the box itself.

double GetXmin (  )  const [inline]

Returns:
the minimum x value of the grid

double GetYmin (  )  const [inline]

Returns:
the minimum y value of the grid

double GetZmin (  )  const [inline]

Returns:
the minimum z value of the grid

double GetXmax (  )  const [inline]

Returns:
the maximum x value of the grid

double GetYmax (  )  const [inline]

Returns:
the maximum y value of the grid

double GetZmax (  )  const [inline]

Returns:
the maximum z value of the grid

bool PointIsInBox ( double  x,
double  y,
double  z 
) [inline]

Returns:
whether the supplied XYZ coordinates fall within the box

bool PointIsInBox ( double *  c  )  [inline]

Returns:
true if the point falls within the box

bool Clear ( void   )  [virtual, inherited]

Clear any and all data associated with this object.

This method can be called by OBConversion::Read() before reading data. Derived classes should be sure to call OBBase::Clear() to remove inherited generic data.

Returns:
Whether the call was successful.
Since:
version 2.1.

Reimplemented in OBAtom, OBMol, and OBResidue.

virtual OBBase* DoTransformations ( const std::map< std::string, std::string > *   )  [inline, virtual, inherited]

Perform a set of transformations specified by the user

Typically these are program options to filter or modify an object For example, see OBMol::DoTransformations() and OBMol::ClassDescription()

Reimplemented in OBMol.

static const char* ClassDescription (  )  [inline, static, inherited]

Returns:
A list of descriptions of command-line options for DoTransformations()

Reimplemented in OBMol.

T* CastAndClear ( bool  clear = true  )  [inline, inherited]

By default clears the object. Called from ReadMolecule of most format classes.

bool HasData ( const std::string &   )  [inherited]

Returns:
whether the generic attribute/value pair exists

bool HasData ( const char *   )  [inherited]

Returns:
whether the generic attribute/value pair exists

bool HasData ( const unsigned int  type  )  [inherited]

Returns:
whether the generic attribute/value pair exists, for a given OBGenericDataType

void DeleteData ( unsigned int  type  )  [inherited]

Delete any data matching the given OBGenericDataType.

void DeleteData ( OBGenericData  )  [inherited]

Delete the given generic data from this object.

void DeleteData ( std::vector< OBGenericData * > &   )  [inherited]

Delete all of the given generic data from this object.

void SetData ( OBGenericData d  )  [inline, inherited]

Adds a data object; does nothing if d==NULL.

unsigned int DataSize (  )  const [inline, inherited]

Returns:
the number of OBGenericData items attached to this molecule.

OBGenericData * GetData ( const unsigned int  type  )  [inherited]

Returns:
the first matching data for a given type from OBGenericDataType or NULL if nothing matches

OBGenericData * GetData ( const std::string &   )  [inherited]

Returns:
the value given an attribute name

OBGenericData * GetData ( const char *   )  [inherited]

Returns:
the value given an attribute name

std::vector<OBGenericData*>& GetData (  )  [inline, inherited]

Returns:
all data, suitable for iterating

std::vector< OBGenericData * > GetData ( DataOrigin  source  )  [inherited]

Returns:
all data with a specific origin, suitable for iterating

OBDataIterator BeginData (  )  [inline, inherited]

Returns:
An iterator pointing to the beginning of the data

OBDataIterator EndData (  )  [inline, inherited]

Returns:
An iterator pointing to the end of the data


Member Data Documentation

double _xmin [protected]

double _xmax [protected]

double _ymin [protected]

double _ymax [protected]

double _zmin [protected]

double _zmax [protected]

the min/max values in XYZ axes (i.e., the box)

std::vector<OBGenericData*> _vdata [protected, inherited]

Custom data.


The documentation for this class was generated from the following files: