28 #ifndef _chemistry_molecule_molshape_h
29 #define _chemistry_molecule_molshape_h
35 #include <util/misc/formio.h>
37 #include <math/isosurf/shape.h>
38 #include <chemistry/molecule/atominfo.h>
39 #include <chemistry/molecule/molecule.h>
63 double radius_scale_factor_;
71 #ifndef COUNT_CONNOLLY
72 # define COUNT_CONNOLLY 1
83 static int n_no_spheres_;
84 static int n_probe_enclosed_by_a_sphere_;
85 static int n_probe_center_not_enclosed_;
86 static int n_surface_of_s0_not_covered_;
87 static int n_plane_totally_covered_;
88 static int n_internal_edge_not_covered_;
89 static int n_totally_covered_;
94 CS2Sphere(
double x,
double y,
double z,
double rad):
95 _v(x,y,z),_radius(rad){}
97 void initialize(
SCVector3& v,
double rad) {
98 _v = v; _radius = rad; }
101 _v = s._v; _radius = s._radius;
return *
this; }
106 {
return sqrt((_v[0]-asphere._v[0])*(_v[0]-asphere._v[0])+
107 (_v[1]-asphere._v[1])*(_v[1]-asphere._v[1])+
108 (_v[2]-asphere._v[2])*(_v[2]-asphere._v[2]));}
112 double common_radius(
CS2Sphere &asphere);
115 const SCVector3& center(
void)
const {
return _v; }
116 double x()
const {
return _v[0]; }
117 double y()
const {
return _v[1]; }
118 double z()
const {
return _v[2]; }
123 double radius(
void)
const {
return _radius;}
125 void recenter(
const SCVector3 &v) { _v -= v; }
129 <<
scprintf(
"Rad=%lf, Center=(%lf,%lf,%lf), From origin=%lf\n",
130 _radius, _v[0], _v[1], _v[2], _v.norm());
138 int n_spheres)
const;
140 static void print_counts(std::ostream& =
ExEnv::out0());
143 #define CONNOLLYSHAPE_N_WITH_NSPHERE_DIM 10
152 double radius_scale_factor_;
156 std::vector<int> ***box_;
163 int get_box(
const SCVector3 &v,
int &x,
int &y,
int &z)
const;
167 static int n_inside_vdw_;
168 static int n_with_nsphere_[CONNOLLYSHAPE_N_WITH_NSPHERE_DIM];
176 double distance_to_surface(
const SCVector3&r,
178 void boundingbox(
double valuemin,
182 static void print_counts(std::ostream& =
ExEnv::out0());