本文整理汇总了C++中Polyhedron::fscan_default_1方法的典型用法代码示例。如果您正苦于以下问题:C++ Polyhedron::fscan_default_1方法的具体用法?C++ Polyhedron::fscan_default_1怎么用?C++ Polyhedron::fscan_default_1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Polyhedron
的用法示例。
在下文中一共展示了Polyhedron::fscan_default_1方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_deform
void test_deform(const char* name, int type, int id, Vector3d delta)
{
DEBUG_START;
double xmin, xmax, ymin, ymax, zmin, zmax;
Polyhedron poly;
char *file_name_in, *file_name_out0, *file_name_out;
fprintf(stdout, "******************************************************\n");
fprintf(stdout, "******************** Deformation ****************\n");
fprintf(stdout, "******************** [%d] *****************\n",
id);
fprintf(stdout, "*********** (%lf, %lf, %lf) *****************\n", delta.x,
delta.y, delta.z);
fprintf(stdout, "******************************************************\n");
file_name_in = new char[255];
file_name_out0 = new char[255];
file_name_out = new char[255];
sprintf(file_name_in, "../poly-data-in/%s.dat", name);
sprintf(file_name_out0, "../poly-data-out/%s.ply", name);
switch (type)
{
case 0:
poly.fscan_default_0(file_name_in);
break;
case 1:
poly.fscan_default_1(file_name_in);
break;
case 2:
poly.fscan_default_1_1(file_name_in);
break;
default:
if (file_name_in != NULL)
delete[] file_name_in;
if (file_name_out != NULL)
delete[] file_name_out;
DEBUG_END;
return;
}
poly.fprint_ply_scale(1000., file_name_out0,
"made-by-Polyhedron_join_facets_2");
poly.get_boundary(xmin, xmax, ymin, ymax, zmin, zmax);
fprintf(stdout, "boundary : \n");
fprintf(stdout, "x [%lf, %lf]\n", xmin, xmax);
fprintf(stdout, "y [%lf, %lf]\n", ymin, ymax);
fprintf(stdout, "z [%lf, %lf]\n", zmin, zmax);
poly.preprocessAdjacency();
poly.shiftPointWeighted(id, delta);
time_t seconds = time(NULL);
tm* timeinfo = localtime(&seconds);
sprintf(file_name_out, "../poly-data-out/%s - %d-%d-%d %d:%d:%d - %d.ply",
name, timeinfo->tm_year + 1900, timeinfo->tm_mon + 1,
timeinfo->tm_mday, timeinfo->tm_hour, timeinfo->tm_min,
timeinfo->tm_sec, id);
poly.fprint_ply_scale(1000., file_name_out,
"made-by-Polyhedron_join_facets_2");
if (file_name_in != NULL)
delete[] file_name_in;
if (file_name_out0 != NULL)
delete[] file_name_out0;
if (file_name_out != NULL)
delete[] file_name_out;
DEBUG_END;
}
示例2: test_join_facets
void test_join_facets(const char* name, int type, int fid0, int fid1)
{
DEBUG_START;
double xmin, xmax, ymin, ymax, zmin, zmax;
Plane iplane;
Polyhedron poly;
char *file_name_in, *file_name_out0, *file_name_out;
fprintf(stdout, "******************************************************\n");
fprintf(stdout, "******************** %d %d ****************\n",
fid0, fid1);
fprintf(stdout, "******************************************************\n");
file_name_in = new char[255];
file_name_out0 = new char[255];
file_name_out = new char[255];
sprintf(file_name_in, "../poly-data-in/%s.dat", name);
sprintf(file_name_out0, "../poly-data-out/%s.ply", name);
switch (type)
{
case 0:
poly.fscan_default_0(file_name_in);
break;
case 1:
poly.fscan_default_1(file_name_in);
break;
case 2:
poly.fscan_default_1_1(file_name_in);
break;
default:
if (file_name_in != NULL)
delete[] file_name_in;
if (file_name_out != NULL)
delete[] file_name_out;
DEBUG_END;
return;
break;
}
poly.fprint_ply_scale(1000., file_name_out0,
"made-by-Polyhedron_join_facets_2");
poly.get_boundary(xmin, xmax, ymin, ymax, zmin, zmax);
fprintf(stdout, "boundary : \n");
fprintf(stdout, "x [%lf, %lf]\n", xmin, xmax);
fprintf(stdout, "y [%lf, %lf]\n", ymin, ymax);
fprintf(stdout, "z [%lf, %lf]\n", zmin, zmax);
poly.preprocessAdjacency();
poly.coalesceFacets(fid0, fid1);
// poly.join_create_first_facet(fid0, fid1);
time_t seconds = time(NULL);
tm* timeinfo = localtime(&seconds);
sprintf(file_name_out,
"../poly-data-out/%s - %d-%d-%d %d:%d:%d - %d - %d.ply", name,
timeinfo->tm_year + 1900, timeinfo->tm_mon + 1, timeinfo->tm_mday,
timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec, fid0, fid1);
poly.fprint_ply_scale(1000., file_name_out,
"made-by-Polyhedron_join_facets_2");
if (file_name_in != NULL)
delete[] file_name_in;
if (file_name_out0 != NULL)
delete[] file_name_out0;
if (file_name_out != NULL)
delete[] file_name_out;
DEBUG_END;
}