示例#1
0
IMPMULTIFIT_BEGIN_NAMESPACE

void write_connolly_surface(atom::Atoms atoms, base::TextOutput fn,
                            float density, float probe_radius) {

  algebra::Sphere3Ds spheres;
  for (unsigned int i = 0; i < atoms.size(); ++i) {
    spheres.push_back(core::XYZR(atoms[i]).get_sphere());
  }

  algebra::ConnollySurfacePoints sps =
      algebra::get_connolly_surface(spheres, density, probe_radius);

  for (unsigned int i = 0; i < sps.size(); ++i) {
    fn.get_stream() << std::setw(5) << sps[i].get_atom(0) + 1 << std::setw(5)
                    << sps[i].get_atom(1) + 1 << std::setw(5)
                    << sps[i].get_atom(2) + 1 << std::fixed << std::setw(8)
                    << std::setprecision(3) << sps[i].get_surface_point()[0]
                    << std::setw(8) << std::setprecision(3)
                    << sps[i].get_surface_point()[1] << std::setw(8)
                    << std::setprecision(3) << sps[i].get_surface_point()[2]
                    << std::setw(8) << std::setprecision(3) << sps[i].get_area()
                    << std::setw(7) << std::setprecision(3)
                    << sps[i].get_normal()[0] << std::setw(7)
                    << std::setprecision(3) << sps[i].get_normal()[1]
                    << std::setw(7) << std::setprecision(3)
                    << sps[i].get_normal()[2] << "  0.500" << std::endl;
  }
}
示例#2
0
文件: io.cpp 项目: drussel/imp
IMPALGEBRA_BEGIN_NAMESPACE

void write_pts(const Vector3Ds &vs, base::TextOutput out) {
  for (unsigned int i=0; i< vs.size(); ++i) {
    out.get_stream() << spaces_io(vs[i]) << "\n";
  }
}
示例#3
0
TextWriter::TextWriter(base::TextOutput fn): Writer(fn.get_name()), out_(fn) {
  set_was_used(true);
}
示例#4
0
文件: io.cpp 项目: drussel/imp
void write_spheres(const Sphere3Ds &vs,
                   base::TextOutput out) {
  for (unsigned int i=0; i< vs.size(); ++i) {
    out.get_stream() << spaces_io(vs[i]) << "\n";
  }
}