本文整理汇总了C++中Body::bounding_box方法的典型用法代码示例。如果您正苦于以下问题:C++ Body::bounding_box方法的具体用法?C++ Body::bounding_box怎么用?C++ Body::bounding_box使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Body
的用法示例。
在下文中一共展示了Body::bounding_box方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_oriented_brick
static int test_oriented_brick()
{
CubitVector center(1, 2, 4);
CubitVector axes[3] = {
CubitVector(0.707, 0.707, 0),
CubitVector(-0.707, 0.707, 0),
CubitVector(0, 0, 1)
};
CubitVector extension(3, 5, 7);
Body* brick = GeometryModifyTool::instance()->brick(center, axes, extension);
if(!brick)
{
printf("failed to make brick\n");
return 1;
}
CubitBox comp_box(CubitVector(-4.656854, -3.656854, -3.),
CubitVector(6.656854, 7.656854, 11.));
CubitBox bnd_box = brick->bounding_box();
bool identical = cubit_box_identical(bnd_box, comp_box, GEOMETRY_RESABS*2.0, true);
if (identical)
return 0;
if( bnd_box < comp_box || bnd_box > comp_box*1.09)
{
printf("boxes not identical\n");
return 1;
}
return 0;
}
示例2: test_planar_sheet
static int test_planar_sheet()
{
CubitVector axes[2] = {
CubitVector(1,0,0),
CubitVector(.1,.9,0)
};
Body* body = GeometryModifyTool::instance()->planar_sheet(CubitVector(1,1,1),
axes, 2, 3);
if(!body)
{
printf("failed to make planar sheet\n");
return 1;
}
CubitBox comp_box(CubitVector(-0.165647,-0.490826,1.0),
CubitVector(2.165647,2.490826,1.0));
CubitBox bnd_box = body->bounding_box();
bool identical = cubit_box_identical(bnd_box, comp_box, GEOMETRY_RESABS*2.0, true);
if (identical)
return 0;
if( bnd_box < comp_box || bnd_box > comp_box*1.09)
{
printf("boxes not identical\n");
return 1;
}
body = GeometryModifyTool::instance()->planar_sheet(
CubitVector(0,0,0),
CubitVector(1,0,0),
CubitVector(1,1,0),
CubitVector(0,1,.2)
);
if(body)
{
printf("should have failed to make planar sheet out of non-planar points\n");
return 1;
}
body = GeometryModifyTool::instance()->planar_sheet(
CubitVector(0,0,0),
CubitVector(0,0,0),
CubitVector(1,1,0),
CubitVector(0,1,0)
);
if(body)
{
printf("should have failed to make planar sheet with coincident input points\n");
return 1;
}
return 0;
}
示例3: test_brick
static int test_brick()
{
Body* brick = GeometryModifyTool::instance()->brick(1,2,4);
if(!brick)
{
printf("failed to make brick\n");
return 1;
}
if(!cubit_box_identical(brick->bounding_box(),
CubitBox(CubitVector(-0.5,-1,-2), CubitVector(0.5,1,2)),
GEOMETRY_RESABS*2.0, true))
{
printf("boxes not identical\n");
return 1;
}
return 0;
}
示例4: test_sphere
static int test_sphere()
{
Body* sphere = GeometryModifyTool::instance()->sphere(1);
if(!sphere)
{
printf("failed to make sphere\n");
return 1;
}
CubitBox comp_box( CubitVector(-1,-1,-1), CubitVector(1,1,1));
CubitBox bnd_box = sphere->bounding_box();
bool identical = cubit_box_identical(bnd_box, comp_box, GEOMETRY_RESABS*2.0, true);
if (identical)
return 0;
if( bnd_box < comp_box || bnd_box > comp_box*1.09)
{
printf("boxes not identical\n");
return 1;
}
return 0;
}
示例5: test_torus
static int test_torus()
{
printf("making torus\n");
Body* torus = GeometryModifyTool::instance()->torus(1, .2);
if(!torus)
{
printf("failed to make torus\n");
return 1;
}
CubitBox comp_box(CubitVector(-1.2,-1.2,-0.2), CubitVector(1.2,1.2,0.2));
CubitBox bnd_box = torus->bounding_box();
bool identical = cubit_box_identical(bnd_box, comp_box, GEOMETRY_RESABS*2.0, true);
if (identical)
return 0;
if( bnd_box < comp_box || bnd_box > comp_box*1.09)
{
printf("boxes not identical\n");
return 1;
}
return 0;
}