Ejemplo n.º 1
0
bool PymolWriter::handle_polygon(PolygonGeometry *g, Color color,
                                 std::string name) {
  setup(name, TRIANGLES);
  if (!open_type_) {
    get_stream() << "BEGIN, TRIANGLES, ";
    open_type_ = TRIANGLES;
  }
  Ints tris = internal::get_triangles(g);
  algebra::Vector3Ds normals = internal::get_normals(tris, g->get_geometry());
  for (unsigned int i = 0; i < tris.size() / 3; ++i) {
    write_triangle(tris.begin() + 3 * i, tris.begin() + 3 * i + 3,
                   g->get_geometry(), normals, color, get_stream());
  }
  return true;
}
Ejemplo n.º 2
0
bool PymolWriter::handle_surface(SurfaceMeshGeometry *g, Color color,
                                 std::string name) {
  setup(name, TRIANGLES);
  if (!open_type_) {
    get_stream() << "BEGIN, TRIANGLES, ";
    open_type_ = TRIANGLES;
  }
  Ints triangles = internal::get_triangles(g);
  algebra::Vector3Ds normals =
      internal::get_normals(triangles, g->get_vertexes());
  IMP_INTERNAL_CHECK(triangles.size() % 3 == 0,
                     "The returned triangles aren't triangles");
  for (unsigned int i = 0; i < triangles.size() / 3; ++i) {
    write_triangle(triangles.begin() + 3 * i, triangles.begin() + 3 * i + 3,
                   g->get_vertexes(), normals, color, get_stream());
  }
  return true;
}
Ejemplo n.º 3
0
bool PymolWriter::handle_triangle(TriangleGeometry *g, Color color,
                                  std::string name) {
  setup(name, TRIANGLES);
  if (!open_type_) {
    get_stream() << "BEGIN, TRIANGLES, ";
    open_type_ = TRIANGLES;
  }
  Ints tri(3);
  tri[0] = 0;
  tri[1] = 1;
  tri[2] = 2;
  algebra::Vector3Ds verts(3);
  verts[0] = g->get_geometry().get_point(0);
  verts[1] = g->get_geometry().get_point(1);
  verts[2] = g->get_geometry().get_point(2);
  algebra::Vector3Ds normals = internal::get_normals(tri, verts);
  write_triangle(tri.begin(), tri.end(), verts, normals, color, get_stream());
  return true;
}
Ejemplo n.º 4
0
void SaveModel(FILE *fp, double StoneDiff, BitBoard b_board, BitBoard w_board, int color)
{

	fprintf(fp, "%lf\n", StoneDiff);

	write_h_ver1(fp);
	write_h_ver2(fp);
	write_h_ver3(fp);
	write_dia_ver1(fp);
	write_dia_ver2(fp);
	write_dia_ver3(fp);
	write_dia_ver4(fp);
	write_edge(fp);
	write_corner3_3(fp);
	write_corner5_2(fp);
	write_triangle(fp);
	//write_mobility(fp, b_board, w_board);
	write_pality(fp, ~(b_board | w_board), color);
	//write_potmob(fp, b_board, w_board);
}
Ejemplo n.º 5
0
void SaveModel_zyouseki()
{
	FILE *fp;
	if(fopen_s(&fp, "eval_zyouseki.dat", "a") != 0)
	{
		return;
	}
	fprintf(fp, "%d\n", 0);

	write_h_ver1(fp);
	write_h_ver2(fp);
	write_h_ver3(fp);
	write_dia_ver1(fp);
	write_dia_ver2(fp);
	write_dia_ver3(fp);
	write_dia_ver4(fp);
	write_edge(fp);
	write_corner5_2(fp);
	write_triangle(fp);

	fclose(fp);
}