// Test computation on a simple example void updateTest(){ m_thisObject->findData("position")->read("0. 0. 0. 1. 0. 0. 0. 1. 0."); m_thisObject->findData("triangles")->read("0 1 2"); m_thisObject->findData("distance")->read("0."); m_thisObject->init(); m_thisObject->update(); // Check output EXPECT_TRUE(m_thisObject->findData("output_position")->getValueString()=="0 0 0 1 0 0 0 1 0"); // Should stay invariant EXPECT_TRUE(m_thisObject->findData("normal")->getValueString()=="0 0 1 0 0 1 0 0 1"); m_thisObject->findData("distance")->read("0.1"); m_thisObject->update(); EXPECT_TRUE(m_thisObject->findData("output_position")->getValueString()=="0 0 0.1 1 0 0.1 0 1 0.1"); // Should apply distance along normal }
// Test computation on a simple example void updateTest(){ m_mecaobject->findData("position")->read("0. 0. 0. 1. 0. 0. 2. 4. 0. 3. 0. 0."); m_mecaobject->init(); m_thisObject->findData("indices")->read("0 1 2 3"); m_thisObject->init(); m_thisObject->update(); EXPECT_TRUE(m_thisObject->findData("average")->getValueString()=="1.5 1 0"); }
// Test computation on a simple example void updateTest(){ m_thisObject->findData("position")->read("0. 0. 0. 0. 0. 1. 0. 0. 2. 0. 0. 3. 0. 0. 4. 0. 0. 5. 0. 0. 6."); m_thisObject->findData("nbSet")->read("2"); m_thisObject->init(); m_thisObject->findData("setIndices1")->read("0 1"); m_thisObject->findData("setIndices2")->read("5 6"); m_thisObject->update(); EXPECT_TRUE(m_thisObject->findData("indices")->getValueString() == "2 3 4"); EXPECT_TRUE(m_thisObject->findData("pointsInROI")->getValueString() == "0 0 2 0 0 3 0 0 4"); }