BWAPI
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/Arr_topology_traits/Arr_bounded_planar_topology_traits_2_impl.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_topology_traits/Arr_bounded_planar_topology_traits_2_impl.h $
00015 // $Id: Arr_bounded_planar_topology_traits_2_impl.h 40195 2007-09-05 09:51:34Z ophirset $
00016 // 
00017 //
00018 // Author(s)     : Ron Wein <wein@post.tau.ac.il>
00019 
00020 #ifndef CGAL_ARR_BOUNDED_PLANAR_TOPOLOGY_TRAITS_2_IMPL_H
00021 #define CGAL_ARR_BOUNDED_PLANAR_TOPOLOGY_TRAITS_2_IMPL_H
00022 
00028 CGAL_BEGIN_NAMESPACE
00029 
00030 //-----------------------------------------------------------------------------
00031 // Assign the contents of another topology-traits class.
00032 //
00033 template <class GeomTraits, class Dcel_>
00034 void Arr_bounded_planar_topology_traits_2<GeomTraits, Dcel_>::assign
00035     (const Self& other)
00036 {
00037   // Assign the base class.
00038   Base::assign (other);
00039 
00040   // Update the topology-traits properties after the DCEL have been updated.
00041   dcel_updated();
00042 
00043   return;
00044 }
00045 
00046 //-----------------------------------------------------------------------------
00047 // Initialize an empty DCEL structure.
00048 //
00049 template <class GeomTraits, class Dcel_>
00050 void Arr_bounded_planar_topology_traits_2<GeomTraits, Dcel_>::init_dcel ()
00051 {
00052   // Clear the current DCEL.
00053   this->m_dcel.delete_all();
00054 
00055   // Create the unbounded face.
00056   unb_face = this->m_dcel.new_face();
00057 
00058   unb_face->set_unbounded (true);
00059   unb_face->set_fictitious (false);
00060 
00061   return;
00062 }
00063 
00064 //-----------------------------------------------------------------------------
00065 // Make the necessary updates after the DCEL structure have been updated.
00066 //
00067 template <class GeomTraits, class Dcel_>
00068 void Arr_bounded_planar_topology_traits_2<GeomTraits, Dcel_>::dcel_updated ()
00069 {
00070   // Go over the DCEL faces and locate the unbounded face.
00071   typename Dcel::Face_iterator         fit;
00072   
00073   unb_face = NULL;
00074   for (fit = this->m_dcel.faces_begin();
00075        fit != this->m_dcel.faces_end(); ++fit)
00076   {
00077     if (fit->is_unbounded())
00078     {
00079       unb_face = &(*fit);
00080       break;
00081     }
00082   }
00083   CGAL_assertion (unb_face != NULL);
00084 
00085   return;
00086 }
00087 
00088 CGAL_END_NAMESPACE
00089 
00090 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines