summaryrefslogtreecommitdiff
path: root/src/dxfdata.cc
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2012-02-14 00:43:38 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2012-02-14 00:43:38 (GMT)
commit319364b59790140b607a0f2af6d6b7e1ab068f51 (patch)
treefe2ea7cf8d150a27894b80ce18fbdaf35e3f27e6 /src/dxfdata.cc
parenta76d5b02bdb8cd7a9d32c2e204c86726d1384c63 (diff)
use shared_ptr in shell visitor. add dump() code. hide debug cout.
Diffstat (limited to 'src/dxfdata.cc')
-rw-r--r--src/dxfdata.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/dxfdata.cc b/src/dxfdata.cc
index 52493ac..20fcc71 100644
--- a/src/dxfdata.cc
+++ b/src/dxfdata.cc
@@ -38,6 +38,7 @@
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <algorithm>
+#include <sstream>
#include <QDir>
#include "value.h"
@@ -555,3 +556,27 @@ int DxfData::addPoint(double x, double y)
return this->points.size()-1;
}
+std::string DxfData::dump() const
+{
+ std::stringstream out;
+ out << "DxfData"
+ << "\n num points: " << points.size()
+ << "\n num paths: " << paths.size()
+ << "\n num dims: " << dims.size()
+ << "\n points: ";
+ for ( size_t k = 0 ; k < points.size() ; k++ ) {
+ out << "\n x y: " << points[k].transpose();
+ }
+ out << "\n paths: ";
+ for ( size_t i = 0; i < paths.size(); i++ ) {
+ out << "\n path:" << i
+ << "\n is_closed: " << paths[i].is_closed
+ << "\n is_inner: " << paths[i].is_inner ;
+ DxfData::Path path = paths[i];
+ for ( size_t j = 0; j < path.indices.size(); j++ ) {
+ out << "\n index[" << j << "]==" << path.indices[j];
+ }
+ }
+ out << "\nDxfData end";
+ return out.str();
+}
contact: Jan Huwald // Impressum