本文整理汇总了C++中mitk::pointset::Pointer::ExecuteOperation方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::ExecuteOperation方法的具体用法?C++ Pointer::ExecuteOperation怎么用?C++ Pointer::ExecuteOperation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mitk::pointset::Pointer
的用法示例。
在下文中一共展示了Pointer::ExecuteOperation方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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)));
}
示例2: TestPointOperationOpMove
void TestPointOperationOpMove()
{
//check opMOVE ExecuteOperation
int id=1;
mitk::Point3D point1;
mitk::Point3D tempPoint;
point1.Fill(2);
doOp = new mitk::PointOperation(mitk::OpMOVE, point1, id);
pointSet->ExecuteOperation(doOp);
tempPoint = pointSet->GetPoint(id);
CPPUNIT_ASSERT_EQUAL_MESSAGE("check PointOperation OpMove ",
true, tempPoint == point1);
/*
if (tempPoint != point1)
{
std::cout<<"[FAILED]"<<std::endl;
return EXIT_FAILURE;
}
delete doOp;
std::cout<<"[PASSED]"<<std::endl;
*/
}
示例3: TestOpMovePointUpOnFirstPoint
void TestOpMovePointUpOnFirstPoint()
{
//check OpMOVEPOINTUP on first point ExecuteOperation
mitk::PointSet::PointType p1 = pointSet->GetPoint(1);
mitk::PointSet::PointType p2 = pointSet->GetPoint(2);
doOp = new mitk::PointOperation(mitk::OpMOVEPOINTUP, p1, 1);
pointSet->ExecuteOperation(doOp);
mitk::PointSet::PointType newP1 = pointSet->GetPoint(1);
mitk::PointSet::PointType newP2 = pointSet->GetPoint(2);
CPPUNIT_ASSERT_EQUAL_MESSAGE("check PointOperation OpMOVEPOINTUP for point id 1: ",
true, ((newP1 == p1) && (newP2 == p2)));
/*
if (((newP1 == p1) && (newP2 == p2)) == false)
{
std::cout<<"[FAILED]"<<std::endl;
return EXIT_FAILURE;
}
std::cout<<"[PASSED]"<<std::endl;
*/
}
示例4: TestOpMovePointUp
void TestOpMovePointUp()
{
//check OpMOVEPOINTUP ExecuteOperation
const int id = 4;
mitk::Point3D point = pointSet->GetPoint(id);
mitk::Point3D point4(0.);
doOp = new mitk::PointOperation(mitk::OpMOVEPOINTUP, point4, id);
pointSet->ExecuteOperation(doOp);
mitk::Point3D tempPoint = pointSet->GetPoint(id-1);
CPPUNIT_ASSERT_EQUAL_MESSAGE("check PointOperation OpMOVEPOINTUP ",
true, tempPoint == point);
/*
if (tempPoint != point)
{
std::cout<<"[FAILED]"<<std::endl;
return EXIT_FAILURE;
}
delete doOp;
std::cout<<"[PASSED]"<<std::endl;
*/
}
示例5: TestOpDeselectPoint
void TestOpDeselectPoint()
{
//check OpDESELECTPOINT ExecuteOperation
mitk::Point3D point4(0.);
doOp = new mitk::PointOperation(mitk::OpDESELECTPOINT, point4,4);
pointSet->ExecuteOperation(doOp);
CPPUNIT_ASSERT_EQUAL_MESSAGE("check PointOperation OpDESELECTPOINT ",
false, pointSet->GetSelectInfo(4));
CPPUNIT_ASSERT_EQUAL_MESSAGE("check GetNumeberOfSelected ",
true, pointSet->GetNumberOfSelected() == 0 );
/*
if (pointSet->GetSelectInfo(4))
{
std::cout<<"[FAILED]"<<std::endl;
return EXIT_FAILURE;
}
delete doOp;
std::cout<<"[PASSED]"<<std::endl;
if(pointSet->GetNumberOfSelected() != 0)
{
std::cout<<"[FAILED]"<<std::endl;
return EXIT_FAILURE;
}
std::cout<<"[PASSED]"<<std::endl;
*/
}
示例6: TestPointOperationOpRemove
void TestPointOperationOpRemove()
{
//check OpREMOVE ExecuteOperation
int id=0;
mitk::Point3D point;
mitk::Point3D tempPoint;
point = pointSet->GetPoint(id);
doOp = new mitk::PointOperation(mitk::OpREMOVE, point, id);
pointSet->ExecuteOperation(doOp);
tempPoint = pointSet->GetPoint(id);
CPPUNIT_ASSERT_EQUAL_MESSAGE("check PointOperation OpREMOVE ",
false, pointSet->IndexExists(id) );
/*
if(pointSet->IndexExists(id))
{
std::cout<<"[FAILED]"<<std::endl;
return EXIT_FAILURE;
}
delete doOp;
std::cout<<"[PASSED]"<<std::endl;
*/
}
示例7: TestCreateOperationAndAddPoint
void TestCreateOperationAndAddPoint()
{
int id = 0;
mitk::Point3D point;
point.Fill(1);
doOp = new mitk::PointOperation(mitk::OpINSERT, point, id);
pointSet->ExecuteOperation(doOp);
CPPUNIT_ASSERT_EQUAL_MESSAGE("check if added points exists",
true, pointSet->GetSize()==4 && pointSet->IndexExists(id));
mitk::Point3D tempPoint;
tempPoint.Fill(0);
tempPoint = pointSet->GetPoint(id);
CPPUNIT_ASSERT_EQUAL_MESSAGE("check if added point contains real value",
true, point == tempPoint);
}
示例8: TestPointOperationOpSelectPoint
void TestPointOperationOpSelectPoint()
{
mitk::Point3D point3(0.);
//check OpSELECTPOINT ExecuteOperation
doOp = new mitk::PointOperation(mitk::OpSELECTPOINT, point3,3);
pointSet->ExecuteOperation(doOp);
CPPUNIT_ASSERT_EQUAL_MESSAGE("check PointOperation OpSELECTPOINT ",
true, pointSet->GetSelectInfo(3));
/*
if (!pointSet->GetSelectInfo(4))
{
std::cout<<"[FAILED]"<<std::endl;
return EXIT_FAILURE;
}
delete doOp;
std::cout<<"[PASSED]"<<std::endl;
*/
}
示例9: TestOpMovePointDown
void TestOpMovePointDown()
{
//check OpMOVEPOINTDown ExecuteOperation
const int id = 2;
mitk::Point3D point = pointSet->GetPoint(id);
mitk::Point3D point2(0.);
doOp = new mitk::PointOperation(mitk::OpMOVEPOINTDOWN, point2, id);
pointSet->ExecuteOperation(doOp);
mitk::Point3D tempPoint = pointSet->GetPoint(id+1);
CPPUNIT_ASSERT_EQUAL_MESSAGE("check PointOperation OpMOVEPOINTDOWN ",
true, tempPoint == point);
/*
if (tempPoint != point)
{
std::cout<<"[FAILED]"<<std::endl;
return EXIT_FAILURE;
}
std::cout<<"[PASSED]"<<std::endl;
*/
}