Loading isis/src/base/objs/ImagePolygon/ImagePolygon.cpp +14 −4 Original line number Diff line number Diff line Loading @@ -240,7 +240,9 @@ namespace Isis { p_pts = NULL; p_pts = new geos::geom::CoordinateArraySequence(); std::cout << "C 1 -------------" << std::endl; WalkPoly(); std::cout << "C 2 -------------" << std::endl; polygonGenerated = true; } Loading @@ -262,6 +264,7 @@ namespace Isis { } } } std::cout << "C 3 -------------" << std::endl; /*------------------------------------------------------------------------ / If image contains 0/360 boundary, the polygon needs to be split up Loading @@ -273,7 +276,9 @@ namespace Isis { } // Create the polygon, fixing if needed std::cout << "C 4 -------------" << std::endl; Fix360Poly(); std::cout << "C 5 -------------" << std::endl; if (p_brick != 0) delete p_brick; Loading @@ -292,10 +297,9 @@ namespace Isis { std::vector<geos::geom::Geometry *> *polys = new std::vector<geos::geom::Geometry *>; geos::geom::Polygon *poly = globalFactory->createPolygon(globalFactory->createLinearRing(p_pts), nullptr); polys->push_back(poly->clone().release()); // createMultiPolygon takes ownership of polys argument p_polygons = globalFactory->createMultiPolygon(polys); delete polys; Fix360Poly(); } Loading Loading @@ -1203,7 +1207,7 @@ namespace Isis { geos::geom::Polygon *newPoly = globalFactory->createPolygon (globalFactory->createLinearRing(newLonLatPts), NULL); p_polygons = PolygonTools::MakeMultiPolygon(newPoly); delete newLonLatPts; //delete newLonLatPts; return; } Loading Loading @@ -1314,11 +1318,17 @@ namespace Isis { p_polygons = globalFactory->createMultiPolygon(finalpolys); delete finalpolys; std::cout << "F 1==========" << std::endl; //delete finalpolys; std::cout << "F 2==========" << std::endl; delete newGeom; std::cout << "F 3==========" << std::endl; delete newLonLatPts; std::cout << "F 4==========" << std::endl; delete pts; std::cout << "F 5==========" << std::endl; delete pts2; std::cout << "F 6==========" << std::endl; } catch(geos::util::IllegalArgumentException *geosIll) { std::string msg = "Unable to create image footprint (Fix360Poly) due to "; Loading isis/tests/FunctionalTestsCnetextract.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractExclusiveNoFromlist) { cnetextract( *network, options, &appLog ); FAIL() << "Should not have been able to extract a new network with no fromlist set" << std::endl; } catch(IException &e) { EXPECT_THAT(e.what(), HasSubstr("To create a [TOLIST] the [FROMLIST] parameter must be provided.")); EXPECT_THAT(e.what(), HasSubstr("To create a [TOLIST] the [FROMLIST] parameter must be provided")); } } Loading @@ -43,7 +43,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractExclusiveNoOnet) { cnetextract( *network, options, &appLog ); FAIL() << "Should not have been able to extract a new network with no onet set" << std::endl; } catch(IException &e) { EXPECT_THAT(e.what(), HasSubstr("Parameter [ONET] has no value.")); EXPECT_THAT(e.what(), HasSubstr("Parameter [ONET] has no value")); } } Loading isis/tests/FunctionalTestsFindimageoverlaps.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -29,21 +29,28 @@ using namespace Isis; static QString APP_XML = FileName("$ISISROOT/bin/xml/findimageoverlaps.xml").expanded(); TEST_F(ThreeImageNetwork, FunctionalTestFindimageoverlapsNoOverlap) { std::cout << "1 ------------" << std::endl; ImagePolygon fp1; std::cout << "1.1 ------------" << std::endl; fp1.Create(*cube1); std::cout << "1.2 ------------" << std::endl; cube1->write(fp1); std::cout << "2 ------------" << std::endl; Cube newCube2; json newIsd2; std::ifstream i(isdPath2->expanded().toStdString()); i >> newIsd2; std::cout << "3 ------------" << std::endl; newIsd2["instrument_position"]["positions"] = {{1,1,1}, {2,2,2}, {3,3,3}}; newCube2.fromIsd(tempDir.path()+"/new2.cub", *cube2->label(), newIsd2, "rw"); std::cout << "4 ------------" << std::endl; ImagePolygon fp2; fp2.Create(newCube2); newCube2.write(fp2); std::cout << "5 ------------" << std::endl; FileList cubes; cubes.append(cube1->fileName()); Loading @@ -51,12 +58,14 @@ TEST_F(ThreeImageNetwork, FunctionalTestFindimageoverlapsNoOverlap) { cube1->close(); cube2->close(); newCube2.close(); std::cout << "6 ------------" << std::endl; QString cubeListPath = tempDir.path() + "/cubes.lis"; cubes.write(cubeListPath); QVector<QString> args = {"from="+cubeListPath, "overlapList="+tempDir.path()+"/overlaps.txt"}; UserInterface options(APP_XML, args); Pvl appLog; std::cout << "7 ------------" << std::endl; try { findimageoverlaps(options, false, &appLog); Loading @@ -66,6 +75,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestFindimageoverlapsNoOverlap) { EXPECT_TRUE(e.toString().toLatin1().contains("No overlaps were found")) << e.toString().toStdString(); } std::cout << "8 ------------" << std::endl; } Loading isis/tests/Fixtures.cpp +2 −2 File changed.Contains only whitespace changes. Show changes Loading
isis/src/base/objs/ImagePolygon/ImagePolygon.cpp +14 −4 Original line number Diff line number Diff line Loading @@ -240,7 +240,9 @@ namespace Isis { p_pts = NULL; p_pts = new geos::geom::CoordinateArraySequence(); std::cout << "C 1 -------------" << std::endl; WalkPoly(); std::cout << "C 2 -------------" << std::endl; polygonGenerated = true; } Loading @@ -262,6 +264,7 @@ namespace Isis { } } } std::cout << "C 3 -------------" << std::endl; /*------------------------------------------------------------------------ / If image contains 0/360 boundary, the polygon needs to be split up Loading @@ -273,7 +276,9 @@ namespace Isis { } // Create the polygon, fixing if needed std::cout << "C 4 -------------" << std::endl; Fix360Poly(); std::cout << "C 5 -------------" << std::endl; if (p_brick != 0) delete p_brick; Loading @@ -292,10 +297,9 @@ namespace Isis { std::vector<geos::geom::Geometry *> *polys = new std::vector<geos::geom::Geometry *>; geos::geom::Polygon *poly = globalFactory->createPolygon(globalFactory->createLinearRing(p_pts), nullptr); polys->push_back(poly->clone().release()); // createMultiPolygon takes ownership of polys argument p_polygons = globalFactory->createMultiPolygon(polys); delete polys; Fix360Poly(); } Loading Loading @@ -1203,7 +1207,7 @@ namespace Isis { geos::geom::Polygon *newPoly = globalFactory->createPolygon (globalFactory->createLinearRing(newLonLatPts), NULL); p_polygons = PolygonTools::MakeMultiPolygon(newPoly); delete newLonLatPts; //delete newLonLatPts; return; } Loading Loading @@ -1314,11 +1318,17 @@ namespace Isis { p_polygons = globalFactory->createMultiPolygon(finalpolys); delete finalpolys; std::cout << "F 1==========" << std::endl; //delete finalpolys; std::cout << "F 2==========" << std::endl; delete newGeom; std::cout << "F 3==========" << std::endl; delete newLonLatPts; std::cout << "F 4==========" << std::endl; delete pts; std::cout << "F 5==========" << std::endl; delete pts2; std::cout << "F 6==========" << std::endl; } catch(geos::util::IllegalArgumentException *geosIll) { std::string msg = "Unable to create image footprint (Fix360Poly) due to "; Loading
isis/tests/FunctionalTestsCnetextract.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractExclusiveNoFromlist) { cnetextract( *network, options, &appLog ); FAIL() << "Should not have been able to extract a new network with no fromlist set" << std::endl; } catch(IException &e) { EXPECT_THAT(e.what(), HasSubstr("To create a [TOLIST] the [FROMLIST] parameter must be provided.")); EXPECT_THAT(e.what(), HasSubstr("To create a [TOLIST] the [FROMLIST] parameter must be provided")); } } Loading @@ -43,7 +43,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestCnetextractExclusiveNoOnet) { cnetextract( *network, options, &appLog ); FAIL() << "Should not have been able to extract a new network with no onet set" << std::endl; } catch(IException &e) { EXPECT_THAT(e.what(), HasSubstr("Parameter [ONET] has no value.")); EXPECT_THAT(e.what(), HasSubstr("Parameter [ONET] has no value")); } } Loading
isis/tests/FunctionalTestsFindimageoverlaps.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -29,21 +29,28 @@ using namespace Isis; static QString APP_XML = FileName("$ISISROOT/bin/xml/findimageoverlaps.xml").expanded(); TEST_F(ThreeImageNetwork, FunctionalTestFindimageoverlapsNoOverlap) { std::cout << "1 ------------" << std::endl; ImagePolygon fp1; std::cout << "1.1 ------------" << std::endl; fp1.Create(*cube1); std::cout << "1.2 ------------" << std::endl; cube1->write(fp1); std::cout << "2 ------------" << std::endl; Cube newCube2; json newIsd2; std::ifstream i(isdPath2->expanded().toStdString()); i >> newIsd2; std::cout << "3 ------------" << std::endl; newIsd2["instrument_position"]["positions"] = {{1,1,1}, {2,2,2}, {3,3,3}}; newCube2.fromIsd(tempDir.path()+"/new2.cub", *cube2->label(), newIsd2, "rw"); std::cout << "4 ------------" << std::endl; ImagePolygon fp2; fp2.Create(newCube2); newCube2.write(fp2); std::cout << "5 ------------" << std::endl; FileList cubes; cubes.append(cube1->fileName()); Loading @@ -51,12 +58,14 @@ TEST_F(ThreeImageNetwork, FunctionalTestFindimageoverlapsNoOverlap) { cube1->close(); cube2->close(); newCube2.close(); std::cout << "6 ------------" << std::endl; QString cubeListPath = tempDir.path() + "/cubes.lis"; cubes.write(cubeListPath); QVector<QString> args = {"from="+cubeListPath, "overlapList="+tempDir.path()+"/overlaps.txt"}; UserInterface options(APP_XML, args); Pvl appLog; std::cout << "7 ------------" << std::endl; try { findimageoverlaps(options, false, &appLog); Loading @@ -66,6 +75,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestFindimageoverlapsNoOverlap) { EXPECT_TRUE(e.toString().toLatin1().contains("No overlaps were found")) << e.toString().toStdString(); } std::cout << "8 ------------" << std::endl; } Loading