testStelSphereGeometry.cpp   testStelSphereGeometry.cpp 
skipping to change at line 368 skipping to change at line 368
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
QString msg("Exception while loading: "); QString msg("Exception while loading: ");
msg+=e.what(); msg+=e.what();
QFAIL(qPrintable(msg)); QFAIL(qPrintable(msg));
} }
QVERIFY(reg->getType()==SphericalRegion::Polygon); QVERIFY(reg->getType()==SphericalRegion::Polygon);
qDebug() << reg->getArea()*180./M_PI*180/M_PI; qDebug() << reg->getArea()*180./M_PI*180/M_PI;
StelVertexArray vertexAr = reg->getOutlineVertexArray(); QVERIFY(reg->getOutlinePrimitiveType()==PrimitiveType_Lines &&
QVERIFY(vertexAr.primitiveType==StelVertexArray::Lines && vertexAr.v reg->getOutlineVertexPositions().size()%2==0);
ertex.size()%2==0);
} }
void TestStelSphericalGeometry::benchmarkContains() void TestStelSphericalGeometry::benchmarkContains()
{ {
Vec3d v0, v1; Vec3d v0, v1;
StelUtils::spheToRect(0., 0., v0); StelUtils::spheToRect(0., 0., v0);
StelUtils::spheToRect(0.3, 0.3, v1); StelUtils::spheToRect(0.3, 0.3, v1);
QBENCHMARK { QBENCHMARK {
holySquare.contains(v1); holySquare.contains(v1);
skipping to change at line 417 skipping to change at line 417
QVERIFY(OctahedronPolygon::triangleContains2D(Vec3d(0,0,0), Vec3d(1, 0,0), Vec3d(1,1,0), Vec3d(0,0,0))); QVERIFY(OctahedronPolygon::triangleContains2D(Vec3d(0,0,0), Vec3d(1, 0,0), Vec3d(1,1,0), Vec3d(0,0,0)));
QVERIFY(OctahedronPolygon::triangleContains2D(Vec3d(0,0,0), Vec3d(1, 0,0), Vec3d(1,1,0), Vec3d(1,0,0))); QVERIFY(OctahedronPolygon::triangleContains2D(Vec3d(0,0,0), Vec3d(1, 0,0), Vec3d(1,1,0), Vec3d(1,0,0)));
QVERIFY(OctahedronPolygon::triangleContains2D(Vec3d(0,0,0), Vec3d(1, 0,0), Vec3d(1,1,0), Vec3d(1,1,0))); QVERIFY(OctahedronPolygon::triangleContains2D(Vec3d(0,0,0), Vec3d(1, 0,0), Vec3d(1,1,0), Vec3d(1,1,0)));
QVERIFY(OctahedronPolygon::isTriangleConvexPositive2D(Vec3d(0,0,0), Vec3d(1,0,0), Vec3d(1,1,0))); QVERIFY(OctahedronPolygon::isTriangleConvexPositive2D(Vec3d(0,0,0), Vec3d(1,0,0), Vec3d(1,1,0)));
SubContour contour(smallSquareConvex.getConvexContour()); SubContour contour(smallSquareConvex.getConvexContour());
OctahedronPolygon splittedSub(contour); OctahedronPolygon splittedSub(contour);
QCOMPARE(splittedSub.getArea(), smallSquareConvex.getArea()); QCOMPARE(splittedSub.getArea(), smallSquareConvex.getArea());
QVector<Vec3d> va = northPoleSquare.getOutlineVertexArray().vertex; QVector<Vec3d> va = northPoleSquare.getOutlineVertexPositions();
QCOMPARE(va.size(),16); QCOMPARE(va.size(),16);
va = southPoleSquare.getOutlineVertexArray().vertex; va = southPoleSquare.getOutlineVertexPositions();
QCOMPARE(va.size(),16); QCOMPARE(va.size(),16);
// Copy // Copy
OctahedronPolygon splittedSubCopy; OctahedronPolygon splittedSubCopy;
splittedSubCopy = splittedSub; splittedSubCopy = splittedSub;
QCOMPARE(splittedSub.getArea(), splittedSubCopy.getArea()); QCOMPARE(splittedSub.getArea(), splittedSubCopy.getArea());
double oldArea = splittedSubCopy.getArea(); double oldArea = splittedSubCopy.getArea();
splittedSub = OctahedronPolygon(); splittedSub = OctahedronPolygon();
QCOMPARE(splittedSub.getArea(), 0.); QCOMPARE(splittedSub.getArea(), 0.);
 End of changes. 3 change blocks. 
5 lines changed or deleted 4 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/