BWAPI
|
00001 // Copyright (c) 1997-2002 Max-Planck-Institute Saarbruecken (Germany). 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/Nef_S2/include/CGAL/Nef_S2/SM_list.h $ 00015 // $Id: SM_list.h 28567 2006-02-16 14:30:13Z lsaboret $ 00016 // 00017 // 00018 // Author(s) : Peter Hachenberger <hachenberger@mpi-sb.mpg.de> 00019 00020 #ifndef CGAL_SM_LIST_H 00021 #define CGAL_SM_LIST_H 00022 00023 #include <CGAL/In_place_list.h> 00024 #include <CGAL/Nef_S2/SM_items.h> 00025 #include <CGAL/Nef_S2/Sphere_geometry.h> 00026 #include <CGAL/Nef_2/Object_handle.h> 00027 #include <CGAL/Nef_S2/Generic_handle_map.h> 00028 #include <CGAL/Nef_2/iterator_tools.h> 00029 #include <list> 00030 00031 CGAL_BEGIN_NAMESPACE 00032 00033 /* 00034 template <typename HE> 00035 class move_edge_around_svertex { 00036 public: 00037 void forward(HE& e) const { e = (e->sprev()->twin()); } 00038 void backward(HE& e) const { e = (e->twin()->snext()); } 00039 }; 00040 00041 template <typename HE> 00042 struct move_edge_around_sface { 00043 void forward(HE& e) const { e = (e->snext()); } 00044 void backward(HE& e) const { e = (e->sprev()); } 00045 }; 00046 */ 00047 00048 template < class SVertex> 00049 class SNC_in_place_list_svertex 00050 : public SVertex, 00051 public In_place_list_base<SNC_in_place_list_svertex<SVertex> > { 00052 public: 00053 typedef SNC_in_place_list_svertex<SVertex> Self; 00054 // typedef typename SVertex::SVertex_handle SVertex_handle; 00055 // typedef typename SVertex::SVertex_const_handle SVertex_const_handle; 00056 SNC_in_place_list_svertex() {} 00057 SNC_in_place_list_svertex(const SVertex& v) // down cast 00058 : SVertex(v) {} 00059 Self& operator=( const Self& v) { 00060 // This self written assignment avoids that assigning vertices will 00061 // overwrite the list linking of the target vertex. 00062 *((SVertex*)this) = ((const SVertex&)v); 00063 return *this; 00064 } 00065 }; 00066 00067 template < class SHalfedge> 00068 class SNC_in_place_list_shalfedge 00069 : public SHalfedge, 00070 public In_place_list_base<SNC_in_place_list_shalfedge<SHalfedge> > { 00071 public: 00072 typedef SNC_in_place_list_shalfedge<SHalfedge> Self; 00073 // typedef typename SHalfedge::SHalfedge_handle SHalfedge_handle; 00074 // typedef typename SHalfedge::SHalfedge_const_handle SHalfedge_const_handle; 00075 SNC_in_place_list_shalfedge() {} 00076 SNC_in_place_list_shalfedge(const SHalfedge& v) // down cast 00077 : SHalfedge(v) {} 00078 Self& operator=( const Self& v) { 00079 // This self written assignment avoids that assigning vertices will 00080 // overwrite the list linking of the target vertex. 00081 *((SHalfedge*)this) = ((const SHalfedge&)v); 00082 return *this; 00083 } 00084 }; 00085 00086 template < class SFace> 00087 class SNC_in_place_list_sface 00088 : public SFace, 00089 public In_place_list_base<SNC_in_place_list_sface<SFace> > { 00090 public: 00091 typedef SNC_in_place_list_sface<SFace> Self; 00092 // typedef typename SFace::SFace_handle SFace_handle; 00093 // typedef typename SFace::SFace_const_handle SFace_const_handle; 00094 SNC_in_place_list_sface() {} 00095 SNC_in_place_list_sface(const SFace& v) // down cast 00096 : SFace(v) {} 00097 Self& operator=( const Self& v) { 00098 // This self written assignment avoids that assigning vertices will 00099 // overwrite the list linking of the target vertex. 00100 *((SFace*)this) = ((const SFace&)v); 00101 return *this; 00102 } 00103 }; 00104 00105 CGAL_END_NAMESPACE 00106 00107 #endif // CGAL_SM_LIST_H