BWAPI
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_overlay.h
Go to the documentation of this file.
00001 // Copyright(c) 2006  Tel-Aviv University(Israel).
00002 // All rights reserved.
00003 //
00004 // This file is part of CGAL(www.cgal.org); you may redistribute it under
00005 // the terms of the Q Public License version 1.0.
00006 // See the file LICENSE.QPL distributed with CGAL.
00007 //
00008 // Licensees holding a valid commercial license may use this file in
00009 // accordance with the commercial license agreement provided with the software.
00010 //
00011 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 //
00014 // $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.5-branch/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_overlay.h $
00015 // $Id: Arr_polyhedral_sgm_overlay.h 40357 2007-09-17 14:40:53Z efif $
00016 // 
00017 // Author(s)     : Efi Fogel          <efif@post.tau.ac.il>
00018 
00019 #ifndef CGAL_ARR_POLYHEDRAL_SGM_OVERLAY_H
00020 #define CGAL_ARR_POLYHEDRAL_SGM_OVERLAY_H
00021 
00022 // #define CGAL_ARR_POLYHEDRAL_SGM_OVERLAY_DEBUG 1
00023 
00024 #include <iostream>
00025 
00026 CGAL_BEGIN_NAMESPACE
00027 
00028 template <class Sgm>
00029 class Arr_polyhedral_sgm_overlay {
00030 private:
00031   typedef typename Sgm::Point_3                         Point_3;
00032   typedef typename Sgm::Vector_3                        Vector_3;
00033   
00034 public:
00035   typedef typename Sgm::Face_handle                     Face_handle;
00036   typedef typename Sgm::Vertex_handle                   Vertex_handle;
00037   typedef typename Sgm::Halfedge_handle                 Halfedge_handle;
00038 
00039   typedef typename Sgm::Face_const_handle               Face_const_handle;
00040   typedef typename Sgm::Vertex_const_handle             Vertex_const_handle;
00041   typedef typename Sgm::Halfedge_const_handle           Halfedge_const_handle;
00042 
00043   typedef typename Sgm::Ccb_halfedge_const_circulator 
00044     Ccb_halfedge_const_circulator;
00045 
00046   typedef typename Sgm::Halfedge_around_vertex_const_circulator
00047     Arr_halfedge_around_vertex_const_circulator;
00048   
00050   void create_face(Face_const_handle f1, Face_const_handle f2, Face_handle f)
00051   {
00052     const Point_3 & p1 = f1->point();
00053     const Point_3 & p2 = f2->point();
00054     Vector_3 v1(ORIGIN, p1);
00055     Point_3 p = p2 + v1;
00056     f->set_point(p);
00057 #ifdef CGAL_ARR_POLYHEDRAL_SGM_OVERLAY_DEBUG
00058     std::cout << "create_face(f1, f2) "
00059               << p
00060               << std::endl;
00061     std::cout << "  Outer CCB:" << std::endl;
00062     typename Sgm::Outer_ccb_iterator oit;
00063     for (oit = f->outer_ccbs_begin(); oit != f->outer_ccbs_end(); ++oit) {
00064       typename Sgm::Halfedge_iterator first = *oit;
00065       typename Sgm::Halfedge_iterator curr = first;
00066       do {
00067         std::cout << "  " << curr->curve() << std::endl;
00068         curr = curr->next();
00069       } while (curr != first);
00070     }
00071 
00072     std::cout << "  Inner CCB:" << std::endl;
00073     typename Sgm::Inner_ccb_iterator iit;
00074     for (iit = f->inner_ccbs_begin(); iit != f->inner_ccbs_end(); ++iit) {
00075       typename Sgm::Halfedge_iterator first = *iit;
00076       typename Sgm::Halfedge_iterator curr = first;
00077       do {
00078         std::cout << "  " << curr->curve() << std::endl;
00079         curr = curr->next();
00080       } while (curr != first);
00081     }
00082 #endif
00083   }
00084 
00086   void create_vertex(Halfedge_const_handle h1, Halfedge_const_handle h2,
00087                      Vertex_handle v)
00088   {
00089 #ifdef CGAL_ARR_POLYHEDRAL_SGM_OVERLAY_DEBUG
00090     std::cout << "create_vertex(h1, h2)"
00091               << " " << v->point()
00092               << std::endl;
00093 #endif
00094   }
00095 
00097   void create_vertex(Vertex_const_handle v1, Vertex_const_handle v2,
00098                      Vertex_handle v)
00099   {
00100 #ifdef CGAL_ARR_POLYHEDRAL_SGM_OVERLAY_DEBUG
00101     std::cout << "create_vertex(v1, v2)"
00102               << " " << v->point()
00103               << std::endl;
00104 #endif
00105   }
00106 
00108   void create_vertex(Vertex_const_handle v1, Halfedge_const_handle h2,
00109                      Vertex_handle v)
00110   {
00111 #ifdef CGAL_ARR_POLYHEDRAL_SGM_OVERLAY_DEBUG
00112     std::cout << "create_vertex(v1, h2)"
00113               << " " << v->point()
00114               << std::endl;
00115 #endif
00116   }
00117 
00119   void create_vertex(Halfedge_const_handle h1, Vertex_const_handle v2,
00120                      Vertex_handle v)
00121   {
00122 #ifdef CGAL_ARR_POLYHEDRAL_SGM_OVERLAY_DEBUG
00123     std::cout << "create_vertex(h1, v2)"
00124               << " " << v->point()
00125               << std::endl;
00126 #endif
00127   }
00128 
00130   void create_vertex(Face_const_handle f1, Vertex_const_handle v2,
00131                      Vertex_handle v)
00132   {
00133 #ifdef CGAL_ARR_POLYHEDRAL_SGM_OVERLAY_DEBUG
00134     std::cout << "create_vertex(f1, v2)"
00135               << " " << v->point()
00136               << std::endl;
00137 #endif
00138   }
00139 
00141   void create_vertex(Vertex_const_handle v1, Face_const_handle f2,
00142                      Vertex_handle v)
00143   {
00144 #ifdef CGAL_ARR_POLYHEDRAL_SGM_OVERLAY_DEBUG
00145     std::cout << "create_vertex(v1, f2)"
00146               << " " << v->point()
00147               << std::endl;
00148 #endif
00149   }
00150 
00152   void create_edge(Halfedge_const_handle h1, Halfedge_const_handle h2,
00153                    Halfedge_handle h)
00154   {
00155     h->add_arr(0);
00156     h->add_arr(1);
00157     h->twin()->add_arr(0);
00158     h->twin()->add_arr(1);
00159 #ifdef CGAL_ARR_POLYHEDRAL_SGM_OVERLAY_DEBUG
00160     std::cout << "create_edge(h1, h2)"
00161               << " " << h->curve()
00162               << std::endl;
00163 #endif
00164   }
00165 
00167   void create_edge(Halfedge_const_handle h1, Face_const_handle f2,
00168                    Halfedge_handle h)
00169   {
00170     h->add_arr(0);
00171     h->twin()->add_arr(0);
00172 #ifdef CGAL_ARR_POLYHEDRAL_SGM_OVERLAY_DEBUG
00173     std::cout << "create_edge(h1, f2)"
00174               << " " << h->curve()
00175               << std::endl;
00176 #endif
00177   }
00178 
00180   void create_edge(Face_const_handle f1, Halfedge_const_handle h2,
00181                    Halfedge_handle h)
00182   {
00183     h->add_arr(1);
00184     h->twin()->add_arr(1);
00185 #ifdef CGAL_ARR_POLYHEDRAL_SGM_OVERLAY_DEBUG
00186     std::cout << "create_edge(f1, h2)"
00187               << " " << h->curve()
00188               << std::endl;
00189 #endif
00190   }
00191 };
00192 
00193 CGAL_END_NAMESPACE
00194 
00195 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines