Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
troussil committed Nov 13, 2014
1 parent 6d55eb3 commit c5a3d62
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 24 deletions.
1 change: 0 additions & 1 deletion src/DGtal/base/IteratorFunctions.ih
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ bool DGtal::isNotEmpty( const IC& itb, const IC& ite )
template< typename IC >
bool DGtal::detail::isNotEmpty( const IC& itb, const IC& ite, IteratorType )
{
trace.info() << "IteratorType = " << std::endl;
return (itb != ite);
}

Expand Down
39 changes: 16 additions & 23 deletions tests/geometry/curves/testFP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ bool testFP(string filename)
{

using namespace DGtal;
//using namespace LibBoard;

trace.info() << endl;
trace.info() << "Reading GridCurve from " << filename << endl;
Expand Down Expand Up @@ -102,18 +101,10 @@ bool compare(const Range1& pts, const Range2& groundTruth)
DGtal::GridCurve<> curve;
curve.initFromPointsRange(pts.begin(), pts.end());

std::cout << curve.size() << std::endl;
std::copy(curve.getPointsRange().begin(), curve.getPointsRange().end(), std::ostream_iterator<DGtal::Z2i::Point>(std::cout, " ") );
std::cout << std::endl;

typedef DGtal::GridCurve<>::PointsRange::ConstCirculator ConstCirculator;
typedef DGtal::FP<ConstCirculator, DGtal::Z2i::Integer, 4> FaithfulPolygon;
FaithfulPolygon theFP( curve.getPointsRange().c(), curve.getPointsRange().c() );

std::cout << theFP.polygon().size() << std::endl;
std::copy(theFP.polygon().begin(), theFP.polygon().end(), std::ostream_iterator<DGtal::Z2i::Point>(std::cout, " ") );
std::cout << std::endl;

return ( (theFP.polygon().size() == groundTruth.size()) &&
std::equal(theFP.polygon().begin(), theFP.polygon().end(), groundTruth.begin()) );
}
Expand All @@ -126,6 +117,8 @@ bool stoppingCriterionTest()
int nbok = 0;
int nb = 0;

trace.beginBlock ( "Stopping criterion" );

{ //inflection part, one leaning point
std::vector<Point> pts, pts2;
pts.push_back(Point(0,0));
Expand Down Expand Up @@ -252,6 +245,7 @@ bool stoppingCriterionTest()

trace.info() << nbok << " / " << nb << std::endl;
}
trace.endBlock();

return (nb == nbok);
}
Expand All @@ -261,27 +255,26 @@ bool stoppingCriterionTest()

int main( int argc, char** argv )
{
DGtal::trace.beginBlock ( "Testing class FP" );
DGtal::trace.info() << "Args:";
using namespace DGtal;

trace.beginBlock ( "Testing class FP" );
trace.info() << "Args:";
for ( int i = 0; i < argc; ++i )
DGtal::trace.info() << " " << argv[ i ];
DGtal::trace.info() << std::endl;
trace.info() << " " << argv[ i ];
trace.info() << endl;

std::string sinus2D4 = testPath + "samples/sinus2D4.dat";
std::string square = testPath + "samples/smallSquare.dat";
std::string dss = testPath + "samples/DSS.dat";
string sinus2D4 = testPath + "samples/sinus2D4.dat";
string square = testPath + "samples/smallSquare.dat";
string dss = testPath + "samples/DSS.dat";

bool res =
/*testFP(sinus2D4)
bool res = testFP(sinus2D4)
&& testFP(square)
&& testFP(dss)
//other tests
&&*/
stoppingCriterionTest()
&& stoppingCriterionTest()
;

DGtal::trace.emphase() << ( res ? "Passed." : "Error." ) << std::endl;
DGtal::trace.endBlock();
trace.emphase() << ( res ? "Passed." : "Error." ) << endl;
trace.endBlock();
return res ? 0 : 1;
}
// //
Expand Down

0 comments on commit c5a3d62

Please sign in to comment.