28 #ifndef _chemistry_molecule_molshape_h
29 #define _chemistry_molecule_molshape_h
31 #include <util/misc/formio.h>
33 #include <math/isosurf/shape.h>
34 #include <chemistry/molecule/atominfo.h>
35 #include <chemistry/molecule/molecule.h>
48 double radius_scale_factor = 1.0);
52 double radius_scale_factor = 1.0);
61 double radius_scale_factor_;
69 #ifndef COUNT_CONNOLLY
70 # define COUNT_CONNOLLY 1
81 static int n_no_spheres_;
82 static int n_probe_enclosed_by_a_sphere_;
83 static int n_probe_center_not_enclosed_;
84 static int n_surface_of_s0_not_covered_;
85 static int n_plane_totally_covered_;
86 static int n_internal_edge_not_covered_;
87 static int n_totally_covered_;
92 CS2Sphere(
double x,
double y,
double z,
double rad):
93 _v(x,y,z),_radius(rad){}
95 void initialize(
SCVector3& v,
double rad) {
96 _v = v; _radius = rad; }
99 _v = s._v; _radius = s._radius;
return *
this; }
104 {
return sqrt((_v[0]-asphere._v[0])*(_v[0]-asphere._v[0])+
105 (_v[1]-asphere._v[1])*(_v[1]-asphere._v[1])+
106 (_v[2]-asphere._v[2])*(_v[2]-asphere._v[2]));}
110 double common_radius(
CS2Sphere &asphere);
113 const SCVector3& center(
void)
const {
return _v; }
114 double x()
const {
return _v[0]; }
115 double y()
const {
return _v[1]; }
116 double z()
const {
return _v[2]; }
121 double radius(
void)
const {
return _radius;}
123 void recenter(
const SCVector3 &v) { _v -= v; }
127 <<
scprintf(
"Rad=%lf, Center=(%lf,%lf,%lf), From origin=%lf\n",
128 _radius, _v[0], _v[1], _v[2], _v.norm());
136 int n_spheres)
const;
138 static void print_counts(std::ostream& =
ExEnv::out0());
141 #define CONNOLLYSHAPE_N_WITH_NSPHERE_DIM 10
150 double radius_scale_factor_;
154 std::vector<int> ***box_;
161 int get_box(
const SCVector3 &v,
int &x,
int &y,
int &z)
const;
165 static int n_inside_vdw_;
166 static int n_with_nsphere_[CONNOLLYSHAPE_N_WITH_NSPHERE_DIM];
174 double distance_to_surface(
const SCVector3&r,
176 void boundingbox(
double valuemin,
180 static void print_counts(std::ostream& =
ExEnv::out0());