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; */ }
void EvaluateState(std::string &refPsFile, mitk::PointSet::Pointer ps, int selected) { mitk::PointSet::Pointer refPs = dynamic_cast<mitk::PointSet*>(mitk::IOUtil::Load(refPsFile)[0].GetPointer()); refPs->UpdateOutputInformation(); ps->UpdateOutputInformation(); MITK_ASSERT_EQUAL(ps, refPs, ""); MITK_TEST_CONDITION_REQUIRED(true, "Test against reference point set."); MITK_TEST_CONDITION_REQUIRED(ps->GetNumberOfSelected() == 1, "One selected point."); MITK_TEST_CONDITION_REQUIRED(ps->GetSelectInfo(selected), "Testing if proper point is selected."); }
void TestSetSelectInfo() { //check SetSelectInfo pointSet->SetSelectInfo(4, true); CPPUNIT_ASSERT_EQUAL_MESSAGE("check SetSelectInfo", true, pointSet->GetSelectInfo(4)); /* if (!pointSet->GetSelectInfo(2)) { std::cout<<"[FAILED]"<<std::endl; return EXIT_FAILURE; } delete doOp; std::cout<<"[PASSED]"<<std::endl; */ }
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; */ }