summaryrefslogtreecommitdiff
path: root/src/polyset.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/polyset.cc
parenta76d5b02bdb8cd7a9d32c2e204c86726d1384c63 (diff)
use shared_ptr in shell visitor. add dump() code. hide debug cout.
Diffstat (limited to 'src/polyset.cc')
-rw-r--r--src/polyset.cc30
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());
contact: Jan Huwald // Impressum