コード例 #1
0
ファイル: AverageCoord_test.cpp プロジェクト: fredroy/sofa
    // 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");
    }
コード例 #2
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");
    }
コード例 #3
0
ファイル: DilateEngine_test.cpp プロジェクト: fredroy/sofa
    // 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
    }
コード例 #4
0
    // Basic tests (data and init).
    void normalTests(){

        m_thisObject->setName("myname") ;
        EXPECT_TRUE(m_thisObject->getName() == "myname") ;

        EXPECT_TRUE( m_thisObject->findData("position") != NULL ) ;
        EXPECT_TRUE( m_thisObject->findData("nbSet") != NULL ) ;
        EXPECT_TRUE( m_thisObject->findData("indices") != NULL ) ;
        EXPECT_TRUE( m_thisObject->findData("pointsInROI") != NULL ) ;

        EXPECT_NO_THROW( m_thisObject->init() ) ;
        EXPECT_NO_THROW( m_thisObject->bwdInit() ) ;
        EXPECT_NO_THROW( m_thisObject->reinit() ) ;
        EXPECT_NO_THROW( m_thisObject->reset() ) ;

        m_thisObject->findData("nbSet")->read("3");
        m_thisObject->init();

        EXPECT_TRUE( m_thisObject->findData("setIndices1") != NULL ) ;
        EXPECT_TRUE( m_thisObject->findData("setIndices2") != NULL ) ;
        EXPECT_TRUE( m_thisObject->findData("setIndices3") != NULL ) ;

        return ;
    }
コード例 #5
0
ファイル: AverageCoord_test.cpp プロジェクト: fredroy/sofa
    // Basic tests (data and init).
    void normalTests(){

        m_thisObject->setName("myname") ;
        EXPECT_TRUE(m_thisObject->getName() == "myname") ;

        EXPECT_TRUE( m_thisObject->findData("indices") != NULL ) ;
        EXPECT_TRUE( m_thisObject->findData("vecId") != NULL ) ;
        EXPECT_TRUE( m_thisObject->findData("average") != NULL ) ;

        EXPECT_NO_THROW( m_thisObject->init() ) ;
        EXPECT_NO_THROW( m_thisObject->bwdInit() ) ;
        EXPECT_NO_THROW( m_thisObject->reinit() ) ;
        EXPECT_NO_THROW( m_thisObject->reset() ) ;

        this->mstate = NULL;
        EXPECT_NO_THROW(this->update()) ;

        return ;
    }
コード例 #6
0
ファイル: DilateEngine_test.cpp プロジェクト: fredroy/sofa
    // Basic tests (data and init).
    void normalTests(){
        m_thisObject->setName("myname") ;
        EXPECT_TRUE(m_thisObject->getName() == "myname") ;

        EXPECT_TRUE( m_thisObject->findData("input_position") != NULL ) ;
        EXPECT_TRUE( m_thisObject->findData("output_position") != NULL ) ;
        EXPECT_TRUE( m_thisObject->findData("triangles") != NULL ) ;
        EXPECT_TRUE( m_thisObject->findData("quads") != NULL ) ;
        EXPECT_TRUE( m_thisObject->findData("normal") != NULL ) ;
        EXPECT_TRUE( m_thisObject->findData("thickness") != NULL ) ;
        EXPECT_TRUE( m_thisObject->findData("distance") != NULL ) ;
        EXPECT_TRUE( m_thisObject->findData("minThickness") != NULL ) ;

        EXPECT_NO_THROW( m_thisObject->init() ) ;
        EXPECT_NO_THROW( m_thisObject->bwdInit() ) ;
        EXPECT_NO_THROW( m_thisObject->reinit() ) ;
        EXPECT_NO_THROW( m_thisObject->reset() ) ;
        EXPECT_NO_THROW(this->update()) ;

        return ;
    }
コード例 #7
0
ファイル: PlaneROI_test.cpp プロジェクト: FabienPean/sofa
 /// Shouldn't crash without input data
 void initTest()
 {
     EXPECT_NO_THROW(m_thisObject->init()) << "The component should succeed in being initialized.";
 }