diff --git a/Cubical_gaussian_map_3/include/CGAL/Cubical_gaussian_map_3.h b/Cubical_gaussian_map_3/include/CGAL/Cubical_gaussian_map_3.h index 28a58340156..1b6d9bb0dc3 100644 --- a/Cubical_gaussian_map_3/include/CGAL/Cubical_gaussian_map_3.h +++ b/Cubical_gaussian_map_3/include/CGAL/Cubical_gaussian_map_3.h @@ -449,7 +449,7 @@ protected: } } else if (proj_normal1.num_faces() == 3) { unsigned index = Cgm::get_corner_index(faces_mask1, id); - CGAL_assertion(index < NUM_CORNERS); + CGAL_assertion(index < Cgm::NUM_CORNERS); Arr_vertex_handle v = m_cgm.m_corner_vertices[id][index]; /*! \todo Set the entire cyclic chain of 3 vertices, and not just the @@ -492,7 +492,7 @@ protected: } } else if (proj_normal2.num_faces() == 3) { unsigned index = Cgm::get_corner_index(faces_mask2, id); - CGAL_assertion(index < NUM_CORNERS); + CGAL_assertion(index < Cgm::NUM_CORNERS); Arr_vertex_handle v = m_cgm.m_corner_vertices[id][index]; /*! \todo Set the entire cyclic chain of 3 vertices, and not just the diff --git a/Cubical_gaussian_map_3/include/CGAL/IO/Cgm_iostream.h b/Cubical_gaussian_map_3/include/CGAL/IO/Cgm_iostream.h index b4cb9dbe8e5..ce7b7874988 100644 --- a/Cubical_gaussian_map_3/include/CGAL/IO/Cgm_iostream.h +++ b/Cubical_gaussian_map_3/include/CGAL/IO/Cgm_iostream.h @@ -25,6 +25,10 @@ */ #include +#include +#include + +#include CGAL_BEGIN_NAMESPACE @@ -51,18 +55,18 @@ operator<<(std::ostream & os, * \param os the output stream * \param cgm the Cubical_gaussian_map_3 object */ -template #endif class T_Dcel> inline std::ostream & operator<<(std::ostream & os, - const Cubical_gaussian_map_3 & cgm) + const Cubical_gaussian_map_3 & cgm) { - typedef Cubical_gaussian_map_3 Cgm; - for (unsigned int i = 0; i < Cubical_gaussian_map_3::NUM_FACES; ++i) { - const typename Cgm::Arrangement & arr = cgm.get_arrangement(i); + typedef Cubical_gaussian_map_3 Cgm; + for (unsigned int i = 0; i < Cgm::NUM_FACES; ++i) { + const typename Cgm::Arrangement & arr = cgm.arrangement(i); os << arr; } return os; @@ -72,15 +76,15 @@ std::ostream & operator<<(std::ostream & os, * \param is the input stream * \param cgm the Cubical_gaussian_map_3 object */ -template #endif class T_Dcel> inline std::istream & operator>>(std::istream & is, - Cubical_gaussian_map_3 & cgm) + Cubical_gaussian_map_3 & cgm) { - typedef Cubical_gaussian_map_3 Cgm; + typedef Cubical_gaussian_map_3 Cgm; for (unsigned int i = 0; i < Cubical_gaussian_map_3::NUM_FACES; ++i) { const typename Cgm::Arrangement & arr = cgm.get_arrangement(i); arr >> is; diff --git a/Cubical_gaussian_map_3/include/CGAL/IO/Polyhedral_cgm_iostream.h b/Cubical_gaussian_map_3/include/CGAL/IO/Polyhedral_cgm_iostream.h index 2652591d784..b8515decc2a 100644 --- a/Cubical_gaussian_map_3/include/CGAL/IO/Polyhedral_cgm_iostream.h +++ b/Cubical_gaussian_map_3/include/CGAL/IO/Polyhedral_cgm_iostream.h @@ -17,14 +17,18 @@ // // Author(s) : Efi Fogel -#ifndef CGAL_CGM_IOSTREAM_H -#define CGAL_CGM_IOSTREAM_H +#ifndef CGAL_POLYHEDRAL_CGM_IOSTREAM_H +#define CGAL_POLYHEDRAL_CGM_IOSTREAM_H /*! \file Implmentation of importer and exporter IO operations of a * Polyhedral_cgm object */ #include +#include +#include + +#include CGAL_BEGIN_NAMESPACE @@ -37,11 +41,11 @@ template #endif class T_Dcel> -inline -std::ostream & operator<<(std::ostream & os, - const Polyhedral_cgm & cgm) +inline std::ostream & operator<<(std::ostream & os, + const Polyhedral_cgm & cgm) { - os << static_cast(cgm); + const Cubical_gaussian_map_3 * tmp = &cgm; + os << *tmp; return os; } diff --git a/Cubical_gaussian_map_3/include/CGAL/Polyhedral_cgm.h b/Cubical_gaussian_map_3/include/CGAL/Polyhedral_cgm.h index d622869037e..f6aa63374ea 100644 --- a/Cubical_gaussian_map_3/include/CGAL/Polyhedral_cgm.h +++ b/Cubical_gaussian_map_3/include/CGAL/Polyhedral_cgm.h @@ -64,8 +64,7 @@ CGAL_BEGIN_NAMESPACE /*! */ template , + class Polyhedron = Polyhedral_cgm_polyhedron_3, class Visitor = Polyhedral_cgm_initializer_visitor > class Polyhedral_cgm_initializer : public Cgm_initializer @@ -712,13 +711,26 @@ public: } while(hec != hec_begin); } - /*! Compute the minkowski sum + /*! Compute the minkowski sum of a range of objects of type Polyhedral_cgm */ template - void minkowsi_sum(CgmIterator begin, CgmIterator end) + void minkowski_sum(CgmIterator begin, CgmIterator end) + { + Polyhedral_cgm * cgm1 = *begin++; + Polyhedral_cgm * cgm2 = *begin; + minkowski_sum(cgm1, cgm2); + } + + /*! Compute the minkowski sum of 2 objects of type Polyhedral_cgm + * \param cgm1 the first Polyhedral_cgm object + * \param cgm2 the second Polyhedral_cgm object + */ + template <> + void minkowski_sum(Polyhedral_cgm * cgm1, + Polyhedral_cgm * cgm2) { // Compute the overlays: - overlay(begin, end); + overlay(cgm1, cgm2); // Initialize the corners: init_corners(); @@ -748,18 +760,17 @@ public: // print_stat(); } - /*! Compute the overlay + /*! Compute the overlay of the respective 6 face pairs of 2 Polyhedral_cgm + * objects. + * \param cgm1 the first Polyhedral_cgm object + * \param cgm2 the second Polyhedral_cgm object */ - template - void overlay(CgmIterator & begin, CgmIterator & end) + void overlay(Polyhedral_cgm * cgm1, Polyhedral_cgm * cgm2) { - Polyhedral_cgm * gm1 = *begin++; - Polyhedral_cgm * gm2 = *begin; - for (unsigned int i = 0; i < NUM_FACES; ++i) { Arr & arr = m_arrangements[i]; - Arr & arr1 = gm1->m_arrangements[i]; - Arr & arr2 = gm2->m_arrangements[i]; + Arr & arr1 = cgm1->m_arrangements[i]; + Arr & arr2 = cgm2->m_arrangements[i]; #if 0 Arr_halfedge_const_iterator hi; diff --git a/Cubical_gaussian_map_3/include/CGAL/Polyhedral_cgm_initializer_visitor.h b/Cubical_gaussian_map_3/include/CGAL/Polyhedral_cgm_initializer_visitor.h index 88a5133d293..f72bc62f951 100644 --- a/Cubical_gaussian_map_3/include/CGAL/Polyhedral_cgm_initializer_visitor.h +++ b/Cubical_gaussian_map_3/include/CGAL/Polyhedral_cgm_initializer_visitor.h @@ -24,8 +24,8 @@ CGAL_BEGIN_NAMESPACE -template > +template > class Polyhedral_cgm_initializer_visitor { public: typedef typename Polyhedron::Vertex_const_handle @@ -35,10 +35,10 @@ public: typedef typename Polyhedron::Facet_const_handle Polyhedron_facet_const_handle; - typedef typename Cgm::Arr_vertex_handle Arr_vertex_handle; - typedef typename Cgm::Arr_halfedge_handle Arr_halfedge_handle; - typedef typename Cgm::Arr_face_handle Arr_face_handle; - typedef typename Cgm::Arr_face_const_handle Arr_face_const_handle; + typedef typename PolyhedralCgm::Arr_vertex_handle Arr_vertex_handle; + typedef typename PolyhedralCgm::Arr_halfedge_handle Arr_halfedge_handle; + typedef typename PolyhedralCgm::Arr_face_handle Arr_face_handle; + typedef typename PolyhedralCgm::Arr_face_const_handle Arr_face_const_handle; /*! Pass information from a polyhedron vertex to its dual - a cgm-face */ virtual void update_dual_vertex(Polyhedron_vertex_const_handle src, diff --git a/Cubical_gaussian_map_3/include/CGAL/Polyhedral_cgm_polyhedron_3.h b/Cubical_gaussian_map_3/include/CGAL/Polyhedral_cgm_polyhedron_3.h index 698ada55c34..4b07f16d88b 100644 --- a/Cubical_gaussian_map_3/include/CGAL/Polyhedral_cgm_polyhedron_3.h +++ b/Cubical_gaussian_map_3/include/CGAL/Polyhedral_cgm_polyhedron_3.h @@ -199,12 +199,12 @@ struct Polyhedral_cgm_polyhedron_items : public CGAL::Polyhedron_items_3 { * based on the new items type. */ template -struct Polyhedral_cgm_default_polyhedron_3 : +struct Polyhedral_cgm_polyhedron_3 : public CGAL::Polyhedron_3, Polyhedral_cgm_polyhedron_items > { /*! Constructor */ - Polyhedral_cgm_default_polyhedron_3() {} + Polyhedral_cgm_polyhedron_3() {} }; CGAL_END_NAMESPACE