numericalSAS.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 
00005 #ifndef BALL_STRUCTURE_NUMERICALSAS_H
00006 #define BALL_STRUCTURE_NUMERICALSAS_H
00007 
00008 #ifndef BALL_COMMON_H
00009 # include <BALL/common.h>
00010 #endif
00011 
00012 #ifndef BALL_DATATYPE_OPTIONS_H
00013 # include <BALL/DATATYPE/options.h>
00014 #endif
00015 
00016 #ifndef BALL_MATHS_SURFACE_H
00017 # include <BALL/MATHS/surface.h>
00018 #endif
00019 
00020 #ifndef BALL_MATHS_VECTOR3_H
00021 # include <BALL/MATHS/vector3.h>
00022 #endif
00023 
00024 namespace BALL 
00025 {
00026   class Atom;
00027   class AtomContainer;
00028   template <typename Key, typename T>
00029   class HashMap;
00030   class TriangulatedSphere;
00031 
00044   class BALL_EXPORT NumericalSAS
00045   {
00046     public:
00050 
00053       struct BALL_EXPORT Option
00054       {
00058         static const String COMPUTE_AREA;
00059 
00063         static const String COMPUTE_VOLUME;
00064 
00072         static const String COMPUTE_SURFACE;
00073 
00082         static const String COMPUTE_SURFACE_PER_ATOM;
00083 
00091         static const String COMPUTE_SURFACE_MAP;
00092 
00098         static const String NUMBER_OF_POINTS;
00099 
00102         static const String PROBE_RADIUS;
00103       };
00104 
00107       struct BALL_EXPORT Default
00108       {
00112         static const bool COMPUTE_AREA;
00113 
00117         static const bool COMPUTE_VOLUME;
00118 
00122         static const bool COMPUTE_SURFACE;
00123 
00128         static const bool COMPUTE_SURFACE_PER_ATOM;
00129 
00133         static const bool COMPUTE_SURFACE_MAP;
00134 
00140         static const Size NUMBER_OF_POINTS;
00141 
00145         static const float PROBE_RADIUS;
00146       };
00148 
00149 
00152 
00153       BALL_CREATE(NumericalSAS)
00154 
00155       
00157       NumericalSAS();
00158 
00161       NumericalSAS(const Options& options);
00162 
00165       ~NumericalSAS();
00167       
00170 
00171       void operator() (const AtomContainer& fragment);
00172 
00179       float getTotalArea() {return total_area_;}
00180 
00187       HashMap<const Atom*, float>& getAtomAreas() {return atom_areas_;}
00188 
00195       const HashMap<const Atom*, float>& getAtomAreas() const {return atom_areas_;}
00196 
00203       float getTotalVolume() {return total_volume_;}
00204 
00211       HashMap<const Atom*, float>& getAtomVolumes() {return atom_volumes_;}
00212 
00219       const HashMap<const Atom*, float>& getAtomVolumes() const {return atom_volumes_;}
00220 
00227       Surface& getSurface() {return surface_;}
00228 
00235       const Surface& getSurface() const {return surface_;}
00236 
00243       HashMap<const Atom*, Surface>& getSurfacePerAtom() {return atom_surfaces_;}
00244 
00251       const HashMap<const Atom*, Surface>& getSurfacePerAtom() const {return atom_surfaces_;}
00252 
00259       std::vector< std::pair<Vector3, Surface> >& getSurfaceMap() {return atom_surface_map_;}
00260 
00267       const std::vector< std::pair<Vector3, Surface> >& getSurfaceMap() const {return atom_surface_map_;}
00268       
00270 
00273       Options options;
00274 
00275     protected:
00277       void setDefaultOptions_();
00278 
00282       Size computeSphereTesselation_(TriangulatedSphere& result, int num_points);
00283 
00285       AtomContainer const* fragment_;
00286 
00288       HashMap<Atom const*, float> atom_areas_;
00289 
00291       float total_area_;
00292 
00294       HashMap<Atom const*, float> atom_volumes_;
00295 
00297       float total_volume_;
00298 
00300       Surface surface_;
00301 
00303       HashMap<Atom const*, Surface> atom_surfaces_;
00304 
00306       std::vector< std::pair<Vector3, Surface> > atom_surface_map_;
00307   };
00308 
00319   BALL_EXPORT BALL_DEPRECATED 
00320   float calculateSASArea(const AtomContainer& fragment, float probe_radius = 1.5,
00321                          Size number_of_dots = 400); 
00322 
00333   BALL_EXPORT BALL_DEPRECATED
00334   float calculateSASVolume(const AtomContainer& fragment, float probe_radius = 1.5,
00335                            Size number_of_dots = 400); 
00336 
00348   BALL_EXPORT BALL_DEPRECATED
00349   float calculateSASAtomAreas(const AtomContainer& fragment, HashMap<const Atom*,float>& atom_areas,
00350                               float probe_radius = 1.5, Size number_of_dots = 400);
00351   
00370   BALL_EXPORT BALL_DEPRECATED
00371   float calculateSASPoints(const AtomContainer& fragment, Surface& surface_points,
00372                            float probe_radius = 1.5,  Size number_of_dots = 400);
00373 
00385   BALL_EXPORT BALL_DEPRECATED
00386   float calculateSASAtomPoints(const AtomContainer& fragment, 
00387                                std::vector< std::pair<Vector3, Surface> >& atom_surfaces,
00388                                float probe_radius = 1.5,  Size number_of_dots = 400);
00390 } // namespace BALL
00391 
00392 #endif // BALL_STRUCTURE_NUMERICALSAS_H