本文整理汇总了C++中mitk::pointset::Pointer::InsertPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::InsertPoint方法的具体用法?C++ Pointer::InsertPoint怎么用?C++ Pointer::InsertPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mitk::pointset::Pointer
的用法示例。
在下文中一共展示了Pointer::InsertPoint方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setUp
void setUp() override
{
//Create PointSet
pointSet = mitk::PointSet::New();
// add some points
mitk::Point3D point2, point3, point4;
point2.Fill(3);
point3.Fill(4);
point4.Fill(5);
pointSet->InsertPoint(2,point2);
pointSet->InsertPoint(3,point3);
pointSet->InsertPoint(4,point4);
mitk::Point3D point1;
mitk::FillVector3D(point1, 1.0, 2.0, 3.0);
pointSet->InsertPoint(1, point1);
mitk::Point3D point0;
point0.Fill(1);
pointSet->InsertPoint(0, point0);
// select point with id 2
pointSet->SetSelectInfo(2, true);
}
示例2: TestCreateHoleInThePointIDs
void TestCreateHoleInThePointIDs()
{
// create a hole in the point IDs
mitk::Point3D point(0.);
mitk::PointSet::PointType p10, p11, p12;
p10.Fill(10.0);
p11.Fill(11.0);
p12.Fill(12.0);
pointSet->InsertPoint(10, p10);
pointSet->InsertPoint(11, p11);
pointSet->InsertPoint(12, p12);
CPPUNIT_ASSERT_EQUAL_MESSAGE("add points with id 10, 11, 12: ",
true, (pointSet->IndexExists(10) == true) || (pointSet->IndexExists(11) == true) || (pointSet->IndexExists(12) == true));
//check OpREMOVE ExecuteOperation
int id = 11;
auto doOp = new mitk::PointOperation(mitk::OpREMOVE, point, id);
pointSet->ExecuteOperation(doOp);
CPPUNIT_ASSERT_EQUAL_MESSAGE( "remove point id 11: ",
false, pointSet->IndexExists(id));
/*
if(pointSet->IndexExists(id))
{
std::cout<<"[FAILED]"<<std::endl;
return EXIT_FAILURE;
}
delete doOp;
std::cout<<"[PASSED]"<<std::endl;
*/
//mitk::PointOperation* doOp = new mitk::PointOperation(mitk::OpMOVEPOINTUP, p12, 12);
//pointSet->ExecuteOperation(doOp);
delete doOp;
//check OpMOVEPOINTUP ExecuteOperation
doOp = new mitk::PointOperation(mitk::OpMOVEPOINTUP, p12, 12);
pointSet->ExecuteOperation(doOp);
delete doOp;
mitk::PointSet::PointType newP10 = pointSet->GetPoint(10);
mitk::PointSet::PointType newP12 = pointSet->GetPoint(12);
CPPUNIT_ASSERT_EQUAL_MESSAGE("check PointOperation OpMOVEPOINTUP for point id 12:",
true, ((newP10 == p12) && (newP12 == p10)));
//check OpMOVEPOINTDOWN ExecuteOperation
doOp = new mitk::PointOperation(mitk::OpMOVEPOINTDOWN, p10, 10);
pointSet->ExecuteOperation(doOp);
delete doOp;
newP10 = pointSet->GetPoint(10);
newP12 = pointSet->GetPoint(12);
CPPUNIT_ASSERT_EQUAL_MESSAGE("check PointOperation OpMOVEPOINTDOWN for point id 10: ",
true, ((newP10 == p10) && (newP12 == p12)));
}
示例3: Equal_DifferentNumberOfPoints_ReturnsFalse
void Equal_DifferentNumberOfPoints_ReturnsFalse()
{
mitk::Point3D tmpPoint;
tmpPoint[0] = 1.0;
tmpPoint[1] = 1.0;
tmpPoint[2] = 1.0;
m_PointSet->InsertPoint( 1, tmpPoint );
m_PointSet->InsertPoint( 2, tmpPoint );
m_AnotherPointSet->InsertPoint( 1, tmpPoint );
MITK_ASSERT_NOT_EQUAL( m_PointSet, m_AnotherPointSet, "One pointset has two points the other has one. Result should be false.");
}
示例4: Equal_DifferentPoints_ReturnsFalse
void Equal_DifferentPoints_ReturnsFalse()
{
mitk::Point3D tmpPoint;
tmpPoint[0] = 1.0;
tmpPoint[1] = 1.0;
tmpPoint[2] = 1.0;
m_PointSet->InsertPoint( 1, tmpPoint );
tmpPoint[0] = 1.0 + 2*mitk::eps;
m_AnotherPointSet->InsertPoint( 1, tmpPoint );
MITK_ASSERT_NOT_EQUAL( m_PointSet, m_AnotherPointSet, "Two pointsets with different points. Result should be false.");
}
示例5: setUp
void setUp() override
{
//Create PointSet
pointSet = mitk::PointSet::New();
// add some points
mitk::Point3D point2, point3, point4;
point2.Fill(3);
point3.Fill(4);
point4.Fill(5);
pointSet->InsertPoint(2,point2);
pointSet->InsertPoint(3,point3);
pointSet->InsertPoint(4,point4);
}