summaryrefslogtreecommitdiff
path: root/src/CGAL_Nef_polyhedron_DxfData.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/CGAL_Nef_polyhedron_DxfData.cc')
-rw-r--r--src/CGAL_Nef_polyhedron_DxfData.cc40
1 files changed, 18 insertions, 22 deletions
diff --git a/src/CGAL_Nef_polyhedron_DxfData.cc b/src/CGAL_Nef_polyhedron_DxfData.cc
index 411a340..922a7ec 100644
--- a/src/CGAL_Nef_polyhedron_DxfData.cc
+++ b/src/CGAL_Nef_polyhedron_DxfData.cc
@@ -28,6 +28,7 @@
#include "grid.h"
#include "CGAL_Nef_polyhedron.h"
#include "cgal.h"
+#include "cgalutils.h"
#ifdef ENABLE_CGAL
@@ -77,29 +78,24 @@ DxfData *CGAL_Nef_polyhedron::convertToDxfData() const
return dxfdata;
}
-// dump the 2 dimensional nef_poly.
-std::string CGAL_Nef_polyhedron::dump_p2() const
+std::string CGAL_Nef_polyhedron::dump() const
{
- std::stringstream out;
- CGAL_Nef_polyhedron2::Explorer explorer = this->p2->explorer();
- CGAL_Nef_polyhedron2::Explorer::Vertex_const_iterator i;
- out << "CGAL_Nef_polyhedron::p2 Vertices";
- for (i = explorer.vertices_begin(); i != explorer.vertices_end(); ++i) {
- if ( explorer.is_standard( i ) ) {
- CGAL_Nef_polyhedron2::Explorer::Point point = explorer.point( i );
- out << "\n Point x y: "
- << CGAL::to_double(point.x()) << " "
- << CGAL::to_double(point.y());
- } else {
- CGAL_Nef_polyhedron2::Explorer::Ray ray = explorer.ray( i );
- CGAL_Nef_polyhedron2::Explorer::Point point = ray.point( 0 );
- out << "\n Ray x y dx dy: "
- << CGAL::to_double(point.x()) << " " << CGAL::to_double(point.y()) << " "
- << CGAL::to_double(ray.direction().dx()) << " " << CGAL::to_double(ray.direction().dy());
- }
- }
- out << "\nCGAL_Nef_polyhedron::p2 Vertices end";
- return out.str();
+ if (this->dim==2)
+ return dump_cgal_nef_polyhedron2( *this->p2 );
+ else if (this->dim==3)
+ return dump_cgal_nef_polyhedron3( *this->p3 );
+ else
+ return std::string("Nef Polyhedron with dimension != 2 or 3");
+}
+
+std::string CGAL_Nef_polyhedron::dump_svg() const
+{
+ if (this->dim==2)
+ return dump_cgal_nef_polyhedron2_svg( *this->p2 );
+ else if (this->dim==3)
+ return dump_cgal_nef_polyhedron3_svg( *this->p3 );
+ else
+ return std::string("<svg><!--Nef Polyhedron with dimension != 2 or 3--></svg>");
}
#endif // ENABLE_CGAL
contact: Jan Huwald // Impressum