diff options
author | Don Bright <hugh.m.bright@gmail.com> | 2012-02-14 00:43:38 (GMT) |
---|---|---|
committer | Don Bright <hugh.m.bright@gmail.com> | 2012-02-14 00:43:38 (GMT) |
commit | 319364b59790140b607a0f2af6d6b7e1ab068f51 (patch) | |
tree | fe2ea7cf8d150a27894b80ce18fbdaf35e3f27e6 /src/polyset.cc | |
parent | a76d5b02bdb8cd7a9d32c2e204c86726d1384c63 (diff) |
use shared_ptr in shell visitor. add dump() code. hide debug cout.
Diffstat (limited to 'src/polyset.cc')
-rw-r--r-- | src/polyset.cc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/polyset.cc b/src/polyset.cc index e5553aa..b6df0c2 100644 --- a/src/polyset.cc +++ b/src/polyset.cc @@ -48,6 +48,36 @@ PolySet::~PolySet() { } +std::string PolySet::dump() const +{ + std::stringstream out; + out << "PolySet:" + << "\n dimensions:" << std::string( this->is2d ? "2" : "3" ) + << "\n convexity:" << this->convexity + << "\n num polygons: " << polygons.size() + << "\n num borders: " << borders.size() + << "\n polygons data:"; + for (size_t i = 0; i < polygons.size(); i++) { + out << "\n polygon begin:"; + const Polygon *poly = &polygons[i]; + for (size_t j = 0; j < poly->size(); j++) { + Vector3d v = poly->at(j); + out << "\n vertex:" << v.transpose(); + } + } + out << "\n borders data:"; + for (size_t i = 0; i < borders.size(); i++) { + out << "\n border polygon begin:"; + const Polygon *poly = &borders[i]; + for (size_t j = 0; j < poly->size(); j++) { + Vector3d v = poly->at(j); + out << "\n vertex:" << v.transpose(); + } + } + out << "\nPolySet end"; + return out.str(); +} + void PolySet::append_poly() { polygons.push_back(Polygon()); |