RDCode: GridUtils.h Source File

- Main Page
- Namespaces
- Classes
- Files
- Directories

# GridUtils.h

Go to the documentation of this file.

    00001 //
    00002 //   Copyright (C) 2003-2007 Rational Discovery LLC
    00003 //
    00004 //   @@ All Rights Reserved  @@
    00005 //
    00006 #ifndef _GRIDUTILS_H_20050126
    00007 #define _GRIDUTILS_H_20050126
    00008
    00009 #include <vector>
    00010
    00011 namespace RDGeom {
    00012   class UniformGrid3D;
    00013   class Point3D;
    00014
    00015   //! calculate the tanimoto distance between the shapes encoded on two grids
    00016   /*!
    00017
    00018      tanimoto(S1,S2) =  1 - ( | S1&S2 | / | S1|S2 | )
    00019
    00020   */
    00021   template<class GRIDTYPE> double tanimotoDistance(const GRIDTYPE &grid1,
    00022                                                    const GRIDTYPE &grid2);
    00023   //! calculate the protrude distance between the shapes encoded on two grids
    00024   /*!
    00025
    00026      protrude(S1,S2) = ( | S1|S2 | - | S1&S2 | ) / | S1 |
    00027
    00028   */
    00029   template<class GRIDTYPE> double protrudeDistance(const GRIDTYPE &grid1,
    00030                                                    const GRIDTYPE &grid2);
    00031
    00032
    00033   //! calculate the grid centroid within a window of a point
    00034   Point3D computeGridCentroid(const UniformGrid3D &grid,
    00035                               const Point3D &pt,
    00036                               double windowRadius,
    00037                               double &weightSum);
    00038
    00039   //! find terminal points of a shape encoded on a grid
    00040   //!  this is part of the subshape implementation
    00041   std::vector<Point3D> findGridTerminalPoints(const UniformGrid3D &grid,
    00042                                           double windowRadius,
    00043                                           double inclusionFraction);
    00044
    00045
    00046 }
    00047
    00048 #endif
    00049