$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r70604 - trunk/libs/geometry/doc/src/docutils/tools/implementation_status
From: bruno.lalande_at_[hidden]
Date: 2011-03-26 19:39:00
Author: bruno.lalande
Date: 2011-03-26 19:38:59 EDT (Sat, 26 Mar 2011)
New Revision: 70604
URL: http://svn.boost.org/trac/boost/changeset/70604
Log:
Discard all-KO rows and columns, if any.
Text files modified: 
   trunk/libs/geometry/doc/src/docutils/tools/implementation_status/implementation_status.cpp |   100 ++++++++++++++++++++++++--------------- 
   1 files changed, 62 insertions(+), 38 deletions(-)
Modified: trunk/libs/geometry/doc/src/docutils/tools/implementation_status/implementation_status.cpp
==============================================================================
--- trunk/libs/geometry/doc/src/docutils/tools/implementation_status/implementation_status.cpp	(original)
+++ trunk/libs/geometry/doc/src/docutils/tools/implementation_status/implementation_status.cpp	2011-03-26 19:38:59 EDT (Sat, 26 Mar 2011)
@@ -9,7 +9,6 @@
 #include <fstream>
 #include <sstream>
 #include <string>
-
 #include <vector>
 
 #include <stdlib.h>
@@ -113,9 +112,9 @@
 
 
 
-void report_library(std::ostream& report, int type, algorithm const& algo, 
-    bool clockwise, bool open, int dimensions, std::string const& cs,
-    int type2 = -1, int type3 = -1)
+int report_library(int type, algorithm const& algo, bool clockwise,
+                   bool open, int dimensions, std::string const& cs,
+                   int type2 = -1)
 {
     std::string lit;
     {
@@ -189,37 +188,37 @@
             ;
     }
 
-    if (system("bjam -a tmp > tmp/t.out"))
-    {
-        report << " [$img/nyi.png] ";
-        std::cout << " ERROR" << std::endl;
-    }
-    else
+    int failed = system("bjam -a tmp > tmp/t.out");
+    if (failed)
     {
-        report << " [$img/ok.png ] ";
-        std::cout << std::endl;
+        std::cout << " ERROR";
     }
+
+    std::cout << std::endl;
+
+    return !failed;
 }
 
-void report(std::ostream& out, int type, algorithm const& algo, 
-    bool clockwise, bool open, int dimensions, std::string const& cs)
+
+std::vector<int> report(int type, algorithm const& algo, bool clockwise,
+                        bool open, int dimensions, std::string const& cs)
 {
+    std::vector<int> result;
+
     switch(algo.arity)
     {
         case 1 :
-            out << "[";
-            report_library(out, type, algo, clockwise, open, dimensions, cs);
-            out << "]";
+            result.push_back(report_library(type, algo, clockwise, open, dimensions, cs));
             break;
         case 2 :
-            for (int type2 = point; type2 < geometry_count; type2++)
+            for (int type2 = point; type2 < geometry_count; ++type2)
             {
-                out << "[";
-                report_library(out, type, algo, clockwise, open, dimensions, cs, type2);
-                out << "]";
+                result.push_back(report_library(type, algo, clockwise, open, dimensions, cs, type2));
             }
             break;
     }
+
+    return result;
 }
 
 
@@ -266,45 +265,70 @@
 
         std::ofstream out(name.str().c_str());
         out << "[heading Supported geometries]" << std::endl;
-        //for (cs_type::const_iterator cit = css.begin(); cit != css.end(); ++cit)
 
         cs_type::const_iterator cit = css.begin();
 
         {
-            int closed = 1;
-            int order = 1;
+            // Construct the table
+
+            std::vector<std::vector<int> > table;
+
+            for (int type = point; type < geometry_count; type++)
+            {
+                table.push_back(report(type, *it, true, true, 2, cit->name));
+            }
+
+
+            // Detect red rows/columns
 
-            out << "[table" << std::endl;
+            std::vector<int> lines_status(table.size(), false);
+            std::vector<int> columns_status(table[0].size(), false);
+
+            for (unsigned int i = 0; i != table.size(); ++i)
+            {
+                for (unsigned int j = 0; j != table[i].size(); ++j)
+                {
+                    lines_status[i] |= table[i][j];
+                    columns_status[j] |= table[i][j];
+                }
+            }
+
+
+            // Display the table
+
+            out << "[table" << std::endl << "[";
 
-            // Table header
-            out << "[";
             if (it->arity > 1)
             {
                 out << "[ ]";
                 for (int type = point; type < geometry_count; type++)
                 {
-                    out << "[" << geometry_string(type) << "]";
+                    if (!columns_status[type]) continue;
+                    out << "[[" << geometry_string(type) << "]]";
                 }
             }
             else
             {
                 out << "[Geometry][Status]";
             }
+
             out << "]" << std::endl;
 
-            // Table body
-            for (int type = point; type < geometry_count; type++)
+            for (unsigned int i = 0; i != table.size(); ++i)
             {
-                out << "[";
-                out << "[" << geometry_string(type) << "]";
-                report(out, type, *it, order == 1, closed == 1, 2, cit->name);
-                out << "]" << std::endl; 
+                if (!lines_status[i]) continue;
+                out << "[[" << geometry_string(i) << "]]";
+                for (unsigned int j = 0; j != table[i].size(); ++j)
+                {
+                    if (!columns_status[j]) continue;
+                    out << "[[$img/" << (table[i][j] ? "ok" : "nyi") << ".png]]";
+                }
+                out << std::endl;
             }
-            // End table
-            out << "]" << std::endl;  
-           
+
+            out << "]" << std::endl;
         }
-   }
+    }
 
     return 0;
 }