testStelSphereGeometry.cpp   testStelSphereGeometry.cpp 
skipping to change at line 462 skipping to change at line 462
// Re-read it // Re-read it
OctahedronPolygon northPoleSquareRead; OctahedronPolygon northPoleSquareRead;
buf.open(QIODevice::ReadOnly); buf.open(QIODevice::ReadOnly);
QDataStream in(&buf); QDataStream in(&buf);
in >> northPoleSquareRead; in >> northPoleSquareRead;
buf.close(); buf.close();
QVERIFY(!northPoleSquareRead.isEmpty()); QVERIFY(!northPoleSquareRead.isEmpty());
QCOMPARE(northPoleSquareRead.getArea(), northPoleSquare.getArea()); QCOMPARE(northPoleSquareRead.getArea(), northPoleSquare.getArea());
QVERIFY(northPoleSquareRead.intersects(northPoleSquare.getOctahedron Polygon())); QVERIFY(northPoleSquareRead.intersects(northPoleSquare.getOctahedron Polygon()));
// Test buggy cases // Spherical cap with aperture > 90 deg
// OctahedronPolygon buggy1; SphericalCap cap1(Vec3d(0,0,1), std::cos(95.*M_PI/180.));
// OctahedronPolygon buggy2; qDebug() << "---------------------";
// QFile f("src/tests/buggyOctahedronPolygon-intersect1.dat"); OctahedronPolygon northCapPoly = cap1.getOctahedronPolygon();
// if (!f.open(QIODevice::ReadOnly)) qDebug() << "---------------------";
// Q_ASSERT(0); qDebug() << northCapPoly.getArea() << OctahedronPolygon::getAllSkyOc
// QDataStream in1(&f); tahedronPolygon().getArea()/2;
// in1 >> buggy1; QVERIFY(northCapPoly.getArea()>OctahedronPolygon::getAllSkyOctahedro
// f.close(); nPolygon().getArea()/2);
// QVERIFY(!buggy1.isEmpty());
//
// QFile f2("src/tests/buggyOctahedronPolygon-intersect2.dat");
// if (!f2.open(QIODevice::ReadOnly))
// Q_ASSERT(0);
// QDataStream in2(&f2);
// in2 >> buggy2;
// f2.close();
// QVERIFY(!buggy2.isEmpty());
//
// qDebug() << buggy1.toJson();
// qDebug() << buggy2.toJson();
//
// buggy2.inPlaceIntersection(buggy1);
// QVERIFY(buggy2.checkAllTrianglesPositive());
} }
void TestStelSphericalGeometry::testSerialize() void TestStelSphericalGeometry::testSerialize()
{ {
// Store a SphericalPolygon as QVariant // Store a SphericalPolygon as QVariant
SphericalRegionP holyReg(new SphericalPolygon(holySquare)); SphericalRegionP holyReg(new SphericalPolygon(holySquare));
QVariant vHolyReg = QVariant::fromValue(holyReg); QVariant vHolyReg = QVariant::fromValue(holyReg);
QVERIFY(QString(vHolyReg.typeName())=="SphericalRegionP"); QVERIFY(QString(vHolyReg.typeName())=="SphericalRegionP");
QVERIFY(vHolyReg.canConvert<SphericalRegionP>()); QVERIFY(vHolyReg.canConvert<SphericalRegionP>());
// and reconvert it // and reconvert it
 End of changes. 1 change blocks. 
24 lines changed or deleted 9 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/