当前位置: 首页>>代码示例>>C++>>正文


C++ Triangulation::AddTriangle方法代码示例

本文整理汇总了C++中Triangulation::AddTriangle方法的典型用法代码示例。如果您正苦于以下问题:C++ Triangulation::AddTriangle方法的具体用法?C++ Triangulation::AddTriangle怎么用?C++ Triangulation::AddTriangle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Triangulation的用法示例。


在下文中一共展示了Triangulation::AddTriangle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TestFlipMinimize

//-------------------------------------------------------------------------
void TriangulationTest::TestFlipMinimize()
//-------------------------------------------------------------------------
{
	Triangulation<double> triangulation;

	std::vector<Point3D<double> >		points;

	double pos[3] = {0,0,1};

	Point3D<double> p0;
	Point3D<double> p1;
	Point3D<double> p2;

	int pointId0 = 0;
	int pointId1 = 1;
	int pointId2 = 2;

	triangulation.points.push_back(p0);
	triangulation.points.push_back(p1);
	triangulation.points.push_back(p2);

    triangulation.AddTriangle(0,1,2);

    int result = triangulation.FlipMinimize(0);

	CPPUNIT_ASSERT(result == 0);	
}
开发者ID:besoft,项目名称:MAF2Medical,代码行数:28,代码来源:TriangulationTest.cpp

示例2: TestArea

//-------------------------------------------------------------------------
void TriangulationTest::TestArea()
//-------------------------------------------------------------------------
{
	Triangulation<double> triangulation;

	Point3D<double> p0;
	Point3D<double> p1;
	Point3D<double> p2;

	int pointId0 = 0;
	int pointId1 = 1;
	int pointId2 = 2;

	triangulation.points.push_back(p0);
	triangulation.points.push_back(p1);
	triangulation.points.push_back(p2);

	triangulation.AddTriangle(0,1,2);

	double area = triangulation.Area();

	CPPUNIT_ASSERT(area == 0);

	area = triangulation.Area(0);

	CPPUNIT_ASSERT(area == 0);

	area = triangulation.Area(0,1,2);

	CPPUNIT_ASSERT(area == 0);
}
开发者ID:besoft,项目名称:MAF2Medical,代码行数:32,代码来源:TriangulationTest.cpp

示例3: TestAddTriangle

//-------------------------------------------------------------------------
void TriangulationTest::TestAddTriangle()
//-------------------------------------------------------------------------
{
	Triangulation<double> triangulation;

	Point3D<double> p0;
	Point3D<double> p1;
	Point3D<double> p2;

	const int pointId0 = 0;
	const int pointId1 = 1;
	const int pointId2 = 2;

	triangulation.points.push_back(p0);
	triangulation.points.push_back(p1);
	triangulation.points.push_back(p2);

	triangulation.AddTriangle(0,1,2);

	int result = triangulation.AddTriangle(pointId0, pointId1, pointId2);

	assert(result == 0);
}
开发者ID:besoft,项目名称:MAF2Medical,代码行数:24,代码来源:TriangulationTest.cpp

示例4: TestFactor

//-------------------------------------------------------------------------
void TriangulationTest::TestFactor()
//-------------------------------------------------------------------------
{
	Triangulation<double> triangulation;

	Point3D<double> p0;
	Point3D<double> p1;
	Point3D<double> p2;

	int pointId0 = 0;
    int pointId1 = 1;
    int pointId2 = 2;

	triangulation.points.push_back(p0);
	triangulation.points.push_back(p1);
	triangulation.points.push_back(p2);

	triangulation.AddTriangle(0,1,2);

	int returnValue = triangulation.Factor(0,pointId0,pointId1,pointId2);

	CPPUNIT_ASSERT(returnValue == 1);
}
开发者ID:besoft,项目名称:MAF2Medical,代码行数:24,代码来源:TriangulationTest.cpp


注:本文中的Triangulation::AddTriangle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。