Don't print a line if counters unused; in example/alphashapes converted cout to rInfo
authorDmitriy Morozov <morozov@cs.duke.edu>
Sun, 25 Nov 2007 09:12:36 -0500
changeset 40 122e4a1fa117
parent 39 b85ded6b1530
child 41 388fd8eade12
child 43 0f970f454094
child 60 bb79215d1f93
Don't print a line if counters unused; in example/alphashapes converted cout to rInfo
examples/alphashapes/alpharadius.cpp
examples/alphashapes/alphashapes2d.cpp
examples/alphashapes/alphashapes2d.hpp
examples/alphashapes/alphashapes3d.cpp
examples/alphashapes/alphashapes3d.hpp
include/utilities/counter.hpp
--- a/examples/alphashapes/alpharadius.cpp	Thu Oct 11 11:46:00 2007 -0400
+++ b/examples/alphashapes/alpharadius.cpp	Sun Nov 25 09:12:36 2007 -0500
@@ -50,6 +50,7 @@
 #ifdef LOGGING
 	rlog::RLogInit(argc, argv);
 
+	stdoutLog.subscribeTo( RLOG_CHANNEL("info") );
 	stdoutLog.subscribeTo( RLOG_CHANNEL("error") );
 	stdoutLog.subscribeTo( RLOG_CHANNEL("topology/filtration") );
 	//stdoutLog.subscribeTo( RLOG_CHANNEL("topology/cycle") );
@@ -66,7 +67,7 @@
 		Point p(x,y,z);
 		Dt.insert(p);
 	}
-	std::cout << "Delaunay triangulation computed" << std::endl;
+	rInfo("Delaunay triangulation computed");
  
 	AlphaSimplex3DVector alpha_ordering;
 	fill_alpha_order(Dt, alpha_ordering);
@@ -83,17 +84,17 @@
 			continue;
 		
 		double current_alpha = CGAL::to_double(cur->value());
-		std::cout << "Current alpha: " << current_alpha << std::endl;
+		rInfo("Current alpha: %f", current_alpha);
 		std::sort(radius_ordering.begin(), radius_ordering.end(), ro);
-		std::cout << "Radius ordering size: " << radius_ordering.size() << std::endl;
+		rInfo("Radius ordering size: %i", radius_ordering.size());
 
 		RadiusFiltration rf;
 		for (SimplexVector::const_iterator cur = radius_ordering.begin(); cur != radius_ordering.end(); ++cur)
 			rf.append(*cur);
 		rf.fill_simplex_index_map();
-		std::cout << "Simplex index map filled" << std::endl;
+		rInfo("Simplex index map filled");
 		rf.pair_simplices(rf.begin(), rf.end());
-		std::cout << "Pairing computed" << std::endl;
+		rInfo("Pairing computed");
 	
 		for (RadiusFiltration::const_Index cur = rf.begin(); cur != rf.end(); ++cur)
 		{
@@ -101,7 +102,7 @@
 	
 			RealValue d1 = cur->distance;
 			//if (cur == cur->pair())
-			//	std::cout << "Unpaired " << cur->dimension() << ' ' << CGAL::to_double(d1) << std::endl;
+			//	rInfo("Unpaired %d %f", cur->dimension(), CGAL::to_double(d1));
 			
 			RealValue d2 = cur->pair()->distance;
 			if (d1 == d2)	continue;
--- a/examples/alphashapes/alphashapes2d.cpp	Thu Oct 11 11:46:00 2007 -0400
+++ b/examples/alphashapes/alphashapes2d.cpp	Sun Nov 25 09:12:36 2007 -0500
@@ -14,6 +14,7 @@
 	rlog::RLogInit(argc, argv);
 
 	stdoutLog.subscribeTo( RLOG_CHANNEL("error") );
+	stdoutLog.subscribeTo( RLOG_CHANNEL("info") );
 	//stdoutLog.subscribeTo( RLOG_CHANNEL("topology/filtration") );
 	//stdoutLog.subscribeTo( RLOG_CHANNEL("topology/cycle") );
 #endif
@@ -31,11 +32,11 @@
 		Point p(x,y);
 		Dt.insert(p);
 	}
-	std::cout << "Delaunay triangulation computed" << std::endl;
+	rInfo("Delaunay triangulation computed");
    
 	AlphaSimplex2DVector alpha_ordering;
 	fill_alpha_order(Dt, alpha_ordering);
-	std::cout << "Simplices: " << alpha_ordering.size() << std::endl;
+	rInfo("Simplices: %i", alpha_ordering.size());
 
 	// Create the alpha-shape filtration
 	AlphaFiltration af;
@@ -43,9 +44,9 @@
 											  cur != alpha_ordering.end(); ++cur)
 		af.append(*cur);
 	af.fill_simplex_index_map();
-	std::cout << "Filled simplex-index map" << std::endl;
+	rInfo("Filled simplex-index map");
 	af.pair_simplices(af.begin(), af.end(), false);
-	std::cout << "Simplices paired" << std::endl;
+	rInfo("Simplices paired");
 
 	for (AlphaFiltration::Index i = af.begin(); i != af.end(); ++i)
 		if (i->is_paired())
--- a/examples/alphashapes/alphashapes2d.hpp	Thu Oct 11 11:46:00 2007 -0400
+++ b/examples/alphashapes/alphashapes2d.hpp	Sun Nov 25 09:12:36 2007 -0500
@@ -105,13 +105,13 @@
 	AlphaSimplex2D::SimplexSet simplices;
 	for(Face_iterator cur = Dt.finite_faces_begin(); cur != Dt.finite_faces_end(); ++cur)
 		simplices.insert(AlphaSimplex2D(*cur));
-	std::cout << "Faces inserted" << std::endl;
+	rInfo("Faces inserted");
 	for(Edge_iterator cur = Dt.finite_edges_begin(); cur != Dt.finite_edges_end(); ++cur)
 		simplices.insert(AlphaSimplex2D(*cur, simplices));
-	std::cout << "Edges inserted" << std::endl;
+	rInfo("Edges inserted");
 	for(Vertex_iterator cur = Dt.finite_vertices_begin(); cur != Dt.finite_vertices_end(); ++cur)
 		simplices.insert(AlphaSimplex2D(*cur));
-	std::cout << "Vertices inserted" << std::endl;
+	rInfo("Vertices inserted");
     
 	// Sort simplices by their alpha values
 	alpha_order.resize(simplices.size());
--- a/examples/alphashapes/alphashapes3d.cpp	Thu Oct 11 11:46:00 2007 -0400
+++ b/examples/alphashapes/alphashapes3d.cpp	Sun Nov 25 09:12:36 2007 -0500
@@ -13,6 +13,7 @@
 #ifdef LOGGING
 	rlog::RLogInit(argc, argv);
 
+	stdoutLog.subscribeTo( RLOG_CHANNEL("info") );
 	stdoutLog.subscribeTo( RLOG_CHANNEL("error") );
 	//stdoutLog.subscribeTo( RLOG_CHANNEL("topology/filtration") );
 	//stdoutLog.subscribeTo( RLOG_CHANNEL("topology/cycle") );
@@ -31,20 +32,20 @@
 		Point p(x,y,z);
 		Dt.insert(p);
 	}
-	std::cout << "Delaunay triangulation computed" << std::endl;
+	rInfo("Delaunay triangulation computed");
    
 	AlphaSimplex3DVector alpha_ordering;
 	fill_alpha_order(Dt, alpha_ordering);
-	std::cout << "Simplices: " << alpha_ordering.size() << std::endl;
+	rInfo("Simplices: %d", alpha_ordering.size());
 
 	// Create the alpha-shape filtration
 	AlphaFiltration af;
 	for (AlphaSimplex3DVector::const_iterator cur = alpha_ordering.begin(); cur != alpha_ordering.end(); ++cur)
 		af.append(*cur);
 	af.fill_simplex_index_map();
-	std::cout << "Filled simplex-index map" << std::endl;
+	rInfo("Filled simplex-index map");
 	af.pair_simplices(af.begin(), af.end(), false);
-	std::cout << "Simplices paired" << std::endl;
+	rInfo("Simplices paired");
 
 	for (AlphaFiltration::Index i = af.begin(); i != af.end(); ++i)
 		if (i->is_paired())
--- a/examples/alphashapes/alphashapes3d.hpp	Thu Oct 11 11:46:00 2007 -0400
+++ b/examples/alphashapes/alphashapes3d.hpp	Sun Nov 25 09:12:36 2007 -0500
@@ -163,16 +163,16 @@
 	AlphaSimplex3D::SimplexSet simplices;
 	for(Cell_iterator cur = Dt.finite_cells_begin(); cur != Dt.finite_cells_end(); ++cur)
 		simplices.insert(AlphaSimplex3D(*cur));
-	std::cout << "Cells inserted" << std::endl;
+	rInfo("Cells inserted");
 	for(Facet_iterator cur = Dt.finite_facets_begin(); cur != Dt.finite_facets_end(); ++cur)
 		simplices.insert(AlphaSimplex3D(*cur, simplices));
-	std::cout << "Facets inserted" << std::endl;
+	rInfo("Facets inserted");
 	for(Edge_iterator cur = Dt.finite_edges_begin(); cur != Dt.finite_edges_end(); ++cur)
 		simplices.insert(AlphaSimplex3D(*cur, simplices, Dt.incident_facets(*cur)));
-	std::cout << "Edges inserted" << std::endl;
+	rInfo("Edges inserted");
 	for(Vertex_iterator cur = Dt.finite_vertices_begin(); cur != Dt.finite_vertices_end(); ++cur)
 		simplices.insert(AlphaSimplex3D(*cur));
-	std::cout << "Vertices inserted" << std::endl;
+	rInfo("Vertices inserted");
     
 	// Sort simplices by their alpha values
 	alpha_order.resize(simplices.size());
--- a/include/utilities/counter.hpp	Thu Oct 11 11:46:00 2007 -0400
+++ b/include/utilities/counter.hpp	Sun Nov 25 09:12:36 2007 -0500
@@ -39,7 +39,7 @@
 Counter::
 ~Counter()
 { 
-	if (full_name_ == "")
+	if (full_name_ == "" && (!subcounters_.empty() || count))
 		print(); 
 
 	for (SubCounterMap::iterator cur = subcounters_.begin(); cur != subcounters_.end(); ++cur)