예제 #1
0
void QhullHyperplane_test::
t_operator()
{
    RboxPoints rcube("c");
    Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    const QhullHyperplane h= q.firstFacet().hyperplane();
    //operator== and operator!= tested elsewhere
    const coordT *c= h.coordinates();
    for(int k=h.dimension(); k--; ){
        QCOMPARE(c[k], h[k]);
    }
    //h[0]= 10.0; // compiler error, const
    QhullHyperplane h2= q.firstFacet().hyperplane();
    h2[0]= 10.0;  // Overwrites Hyperplane coordinate!
    QCOMPARE(h2[0], 10.0);
}//t_operator
예제 #2
0
void QhullHyperplane_test::
t_construct()
{
    // Qhull.runQhull() constructs QhullFacets as facetT
    QhullHyperplane h;
    QVERIFY(!h.isDefined());
    QCOMPARE(h.dimension(),0);
    QCOMPARE(h.coordinates(),static_cast<double *>(0));
    RboxPoints rcube("c");
    Qhull q(rcube,"Qt QR0");  // triangulation of rotated unit cube
    QhullFacet f= q.firstFacet();
    QhullHyperplane h2(f.hyperplane());
    QVERIFY(h2.isDefined());
    QCOMPARE(h2.dimension(),3);
    // h= h2;  // copy assignment disabled, ambiguous
    QhullHyperplane h3(h2.dimension(), h2.coordinates(), h2.offset());
    QCOMPARE(h2, h3);
    QhullHyperplane h5= h2; // copy constructor
    QVERIFY(h5==h2);
}//t_construct