This commit is contained in:
Efi Fogel 2006-06-03 22:35:00 +00:00
parent 674df59875
commit 9efb9d1b98
6 changed files with 56 additions and 37 deletions

View File

@ -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

View File

@ -25,6 +25,10 @@
*/
#include <CGAL/basic.h>
#include <CGAL/Cubical_gaussian_map_3.h>
#include <CGAL/IO/Arr_iostream.h>
#include <iostream>
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 <class T_Traits,
template <class Kernel,
#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM
template <class T>
#endif
class T_Dcel>
inline
std::ostream & operator<<(std::ostream & os,
const Cubical_gaussian_map_3<T_Traits,T_Dcel> & cgm)
const Cubical_gaussian_map_3<Kernel,T_Dcel> & cgm)
{
typedef Cubical_gaussian_map_3<T_Traits,T_Dcel> 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<Kernel,T_Dcel> 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 <class T_Traits,
template <class Kernel,
#ifndef CGAL_CFG_NO_TMPL_IN_TMPL_PARAM
template <class T>
#endif
class T_Dcel>
inline std::istream & operator>>(std::istream & is,
Cubical_gaussian_map_3<T_Traits,T_Dcel> & cgm)
Cubical_gaussian_map_3<Kernel,T_Dcel> & cgm)
{
typedef Cubical_gaussian_map_3<T_Traits,T_Dcel> Cgm;
typedef Cubical_gaussian_map_3<Kernel,T_Dcel> 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;

View File

@ -17,14 +17,18 @@
//
// Author(s) : Efi Fogel <efif@post.tau.ac.il>
#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 <CGAL/basic.h>
#include <CGAL/Polyhedral_cgm.h>
#include <CGAL/IO/Cgm_iostream.h>
#include <iostream>
CGAL_BEGIN_NAMESPACE
@ -37,11 +41,11 @@ template <class Kernel,
template <class T>
#endif
class T_Dcel>
inline
std::ostream & operator<<(std::ostream & os,
const Polyhedral_cgm<Kernel,T_Dcel> & cgm)
inline std::ostream & operator<<(std::ostream & os,
const Polyhedral_cgm<Kernel,T_Dcel> & cgm)
{
os << static_cast<Cubical_gaussian_map_3<Kernel,T_Dcel>(cgm);
const Cubical_gaussian_map_3<Kernel,T_Dcel> * tmp = &cgm;
os << *tmp;
return os;
}

View File

@ -64,8 +64,7 @@ CGAL_BEGIN_NAMESPACE
/*!
*/
template <class PolyhedralCgm,
class Polyhedron =
Polyhedral_cgm_default_polyhedron_3<PolyhedralCgm>,
class Polyhedron = Polyhedral_cgm_polyhedron_3<PolyhedralCgm>,
class Visitor = Polyhedral_cgm_initializer_visitor<PolyhedralCgm> >
class Polyhedral_cgm_initializer :
public Cgm_initializer<typename PolyhedralCgm::Base>
@ -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 <class CgmIterator>
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 *>(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 <class CgmIterator>
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;

View File

@ -24,8 +24,8 @@
CGAL_BEGIN_NAMESPACE
template<class Cgm,
class Polyhedron = Polyhedral_cgm_default_polyhedron_3<Cgm> >
template<class PolyhedralCgm,
class Polyhedron = Polyhedral_cgm_polyhedron_3<PolyhedralCgm> >
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,

View File

@ -199,12 +199,12 @@ struct Polyhedral_cgm_polyhedron_items : public CGAL::Polyhedron_items_3 {
* based on the new items type.
*/
template <class Cgm>
struct Polyhedral_cgm_default_polyhedron_3 :
struct Polyhedral_cgm_polyhedron_3 :
public CGAL::Polyhedron_3<CGAL::Polyhedron_traits_with_normals_3<typename Cgm::Kernel>,
Polyhedral_cgm_polyhedron_items<Cgm> >
{
/*! Constructor */
Polyhedral_cgm_default_polyhedron_3() {}
Polyhedral_cgm_polyhedron_3() {}
};
CGAL_END_NAMESPACE