BWAPI
|
00001 // Copyright (c) 2005-2008 Fernando Luis Cacciola Carballal. All rights reserved. 00002 // 00003 // This file is part of CGAL (www.cgal.org); you may redistribute it under 00004 // the terms of the Q Public License version 1.0. 00005 // See the file LICENSE.QPL distributed with CGAL. 00006 // 00007 // Licensees holding a valid commercial license may use this file in 00008 // accordance with the commercial license agreement provided with the software. 00009 // 00010 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00011 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00012 // 00013 // $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.5-branch/Straight_skeleton_2/include/CGAL/Straight_skeleton_halfedge_base_2.h $ 00014 // $Id: Straight_skeleton_halfedge_base_2.h 43050 2008-04-28 17:03:23Z fcacciola $ 00015 // 00016 // Author(s) : Fernando Cacciola <fernando_cacciola@ciudad.com.ar> 00017 // 00018 #ifndef CGAL_STRAIGHT_SKELETON_HALFEDGE_BASE_2_H 00019 #define CGAL_STRAIGHT_SKELETON_HALFEDGE_BASE_2_H 1 00020 00021 00022 CGAL_BEGIN_NAMESPACE 00023 00024 template < class Refs, class S > 00025 class Straight_skeleton_halfedge_base_base_2 00026 { 00027 public: 00028 00029 typedef Refs HalfedgeDS; 00030 typedef Tag_true Supports_halfedge_prev; 00031 typedef Tag_true Supports_halfedge_vertex; 00032 typedef Tag_true Supports_halfedge_face; 00033 00034 typedef typename Refs::Vertex_handle Vertex_handle; 00035 typedef typename Refs::Vertex_const_handle Vertex_const_handle; 00036 typedef typename Refs::Halfedge_handle Halfedge_handle; 00037 typedef typename Refs::Halfedge_const_handle Halfedge_const_handle; 00038 typedef typename Refs::Face_handle Face_handle; 00039 typedef typename Refs::Face_const_handle Face_const_handle; 00040 typedef typename Refs::Vertex Vertex; 00041 typedef typename Refs::Face Face; 00042 00043 typedef Straight_skeleton_halfedge_base_base_2<Refs,S> Base_base ; 00044 00045 typedef S Segment_2; 00046 00047 protected: 00048 00049 Straight_skeleton_halfedge_base_base_2() : mF(Face_handle()), mID(-1), mSlope(ZERO) {} 00050 00051 Straight_skeleton_halfedge_base_base_2( int aID ) : mF(Face_handle()), mID(aID), mSlope(ZERO) {} 00052 00053 Straight_skeleton_halfedge_base_base_2( int aID, Sign aSlope ) : mF(Face_handle()), mID(aID), mSlope(aSlope) {} 00054 00055 public: 00056 00057 int id() const { return mID ; } 00058 00059 bool is_bisector() const 00060 { 00061 return !this->is_border() && !this->opposite()->is_border() ; 00062 } 00063 00064 bool is_inner_bisector() const 00065 { 00066 return !this->vertex()->is_contour() && !this->opposite()->vertex()->is_contour(); 00067 } 00068 00069 bool has_null_segment() const { return this->vertex()->has_null_point() ; } 00070 00071 bool has_infinite_time() const { return this->vertex()->has_infinite_time() ; } 00072 00073 Halfedge_const_handle defining_contour_edge() const { return this->face()->halfedge() ; } 00074 Halfedge_handle defining_contour_edge() { return this->face()->halfedge() ; } 00075 00076 Halfedge_handle opposite() { return mOpp;} 00077 Halfedge_const_handle opposite() const { return mOpp;} 00078 Halfedge_handle next () { return mNxt;} 00079 Halfedge_const_handle next () const { return mNxt;} 00080 Halfedge_handle prev () { return mPrv; } 00081 Halfedge_const_handle prev () const { return mPrv; } 00082 Vertex_handle vertex () { return mV; } 00083 Vertex_const_handle vertex () const { return mV; } 00084 Face_handle face () { return mF; } 00085 Face_const_handle face () const { return mF; } 00086 00087 Sign slope() const { return mSlope ; } 00088 00089 bool is_border() const { return mF == Face_handle();} 00090 00091 void set_opposite( Halfedge_handle h) { mOpp = h; } 00092 void set_next ( Halfedge_handle h) { mNxt = h; } 00093 void set_prev ( Halfedge_handle h) { mPrv = h; } 00094 void set_vertex ( Vertex_handle w) { mV = w; } 00095 void set_face ( Face_handle g) { mF = g; } 00096 00097 void set_slope( Sign aSlope ) { mSlope = aSlope ; } 00098 00099 void reset_id ( int aID ) { mID = aID ; } 00100 00101 private: 00102 00103 Halfedge_handle mOpp; 00104 Halfedge_handle mNxt; 00105 Halfedge_handle mPrv; 00106 Vertex_handle mV; 00107 Face_handle mF; 00108 int mID ; 00109 Sign mSlope ; 00110 }; 00111 00112 template < class Refs, class S > 00113 class Straight_skeleton_halfedge_base_2 : public Straight_skeleton_halfedge_base_base_2<Refs,S> 00114 { 00115 public: 00116 00117 typedef typename Refs::Vertex_handle Vertex_handle; 00118 typedef typename Refs::Halfedge_handle Halfedge_handle; 00119 typedef typename Refs::Face_handle Face_handle; 00120 00121 typedef Straight_skeleton_halfedge_base_base_2<Refs,S> Base_base ; 00122 typedef Straight_skeleton_halfedge_base_2<Refs,S> Base ; 00123 00124 Straight_skeleton_halfedge_base_2() {} 00125 00126 Straight_skeleton_halfedge_base_2( int aID ) : Base_base(aID) {} 00127 00128 Straight_skeleton_halfedge_base_2( int aID, Sign aSlope ) : Base_base(aID,aSlope) {} 00129 00130 private: 00131 00132 void set_opposite( Halfedge_handle h ) { Base_base::opposite(h) ; } 00133 void set_next ( Halfedge_handle h ) { Base_base::set_next(h) ; } 00134 void set_prev ( Halfedge_handle h ) { Base_base::set_prev(h) ; } 00135 void set_vertex ( Vertex_handle w ) { Base_base::set_vertex(w); } 00136 void set_face ( Face_handle g ) { Base_base::set_face(g) ; } 00137 void set_slope ( Sign s ) { Base_base::set_slope(s) ; } 00138 void reset_id ( int i ) { Base_base::reset_id(i) ; } 00139 00140 } ; 00141 00142 CGAL_END_NAMESPACE 00143 00144 #endif // CGAL_STRAIGHT_SKELETON_HALFEDGE_BASE_2_H // 00145 // EOF // 00146