BWAPI
|
00001 // Copyright (c) 2005-2007 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: $ 00015 // $Id: $ 00016 // 00017 // 00018 // Author(s): Ophir Setter <ophir.setter@post.tau.ac.il> 00019 // 00020 00029 #ifndef CGAL_ENV_TRACE_TRAITS_H 00030 #define CGAL_ENV_TRACE_TRAITS_H 00031 00037 #include <CGAL/basic.h> 00038 #include <CGAL/tags.h> 00039 #include <CGAL/representation_tags.h> 00040 #include <CGAL/functions_on_enums.h> 00041 #include <CGAL/number_utils.h> 00042 #include <CGAL/Envelope_3/Envelope_base.h> 00043 00044 CGAL_BEGIN_NAMESPACE 00045 00049 template <class Traits_> 00050 class Env_tracing_traits_3 : public Traits_ 00051 { 00052 public: 00053 typedef Traits_ Base; 00054 00055 typedef typename Base::Multiplicity Multiplicity; 00056 typedef typename Base::Point_2 Point_2; 00057 typedef typename Base::Curve_2 Curve_2; 00058 typedef typename Base::X_monotone_curve_2 X_monotone_curve_2; 00059 00060 typedef typename Base::Boundary_category Boundary_category; 00061 00062 typedef typename Base::Xy_monotone_surface_3 Xy_monotone_surface_3; 00063 typedef typename Base::Surface_3 Surface_3; 00064 00065 typedef std::pair<X_monotone_curve_2, Multiplicity> Intersection_curve; 00066 00067 class Make_xy_monotone_3 00068 { 00069 public: 00070 00071 template <class OutputIterator> 00072 OutputIterator operator()(const Surface_3& s, 00073 bool is_lower, 00074 OutputIterator o) const 00075 { 00076 Base base; 00077 return base.make_xy_monotone_3_object() (s, is_lower, o); 00078 } 00079 }; 00080 00081 Make_xy_monotone_3 make_xy_monotone_3_object() const 00082 { 00083 return Make_xy_monotone_3(); 00084 } 00085 00086 class Compare_z_at_xy_3 00087 { 00088 public: 00089 00090 Comparison_result operator()(const Point_2& p, 00091 const Xy_monotone_surface_3& h1, 00092 const Xy_monotone_surface_3& h2) const 00093 { 00094 Base base; 00095 std::cerr << "Compare_z_at_xy_3:" << std::endl; 00096 std::cerr << "Point: " << p << std::endl; 00097 std::cerr << "Surface1: " << h1 << std::endl; 00098 std::cerr << "Surface2: " << h2 << std::endl; 00099 Comparison_result res = base.compare_z_at_xy_3_object() (p, h1, h2); 00100 std::cerr << "Result: " << res << std::endl; 00101 return res; 00102 } 00103 00104 Comparison_result operator()(const X_monotone_curve_2& cv, 00105 const Xy_monotone_surface_3& h1, 00106 const Xy_monotone_surface_3& h2) const 00107 { 00108 Base base; 00109 std::cerr << "Compare_z_at_xy_3:" << std::endl; 00110 std::cerr << "Curve: " << cv << std::endl; 00111 std::cerr << "Surface1: " << h1 << std::endl; 00112 std::cerr << "Surface2: " << h2 << std::endl; 00113 Comparison_result res = base.compare_z_at_xy_3_object() (cv, h1, h2); 00114 std::cerr << "Result: " << res << std::endl; 00115 return res; 00116 } 00117 00118 00119 Comparison_result operator()(const Xy_monotone_surface_3& h1, 00120 const Xy_monotone_surface_3& h2) const 00121 00122 { 00123 Base base; 00124 std::cerr << "Compare_z_at_xy_3:" << std::endl; 00125 std::cerr << "Surface1: " << h1 << std::endl; 00126 std::cerr << "Surface2: " << h2 << std::endl; 00127 Comparison_result res = base.compare_z_at_xy_3_object() (h1, h2); 00128 std::cerr << "Result: " << res << std::endl; 00129 return res; 00130 } 00131 00132 }; 00133 00134 Compare_z_at_xy_3 compare_z_at_xy_3_object() const 00135 { 00136 return Compare_z_at_xy_3(); 00137 } 00138 00139 class Compare_z_at_xy_above_3 00140 { 00141 public: 00142 Comparison_result operator()(const X_monotone_curve_2& cv, 00143 const Xy_monotone_surface_3& h1, 00144 const Xy_monotone_surface_3& h2) const 00145 { 00146 Base base; 00147 std::cerr << "Compare_z_at_xy_above_3:" << std::endl; 00148 std::cerr << "Curve: " << cv << std::endl; 00149 std::cerr << "Surface1: " << h1 << std::endl; 00150 std::cerr << "Surface2: " << h2 << std::endl; 00151 Comparison_result res = 00152 base.compare_z_at_xy_above_3_object() (cv, h1, h2); 00153 std::cerr << "Result: " << res << std::endl; 00154 return res; 00155 } 00156 }; 00157 00158 Compare_z_at_xy_above_3 compare_z_at_xy_above_3_object() const 00159 { 00160 return Compare_z_at_xy_above_3(); 00161 } 00162 00163 class Compare_z_at_xy_below_3 00164 { 00165 public: 00166 Comparison_result operator()(const X_monotone_curve_2& cv, 00167 const Xy_monotone_surface_3& h1, 00168 const Xy_monotone_surface_3& h2) const 00169 { 00170 Base base; 00171 std::cerr << "Compare_z_at_xy_below_3:" << std::endl; 00172 std::cerr << "Curve: " << cv << std::endl; 00173 std::cerr << "Surface1: " << h1 << std::endl; 00174 std::cerr << "Surface2: " << h2 << std::endl; 00175 Comparison_result res = 00176 base.compare_z_at_xy_below_3_object() (cv, h1, h2); 00177 std::cerr << "Result: " << res << std::endl; 00178 return res; 00179 } 00180 00181 }; 00182 00183 Compare_z_at_xy_below_3 compare_z_at_xy_below_3_object() const 00184 { 00185 return Compare_z_at_xy_below_3(); 00186 } 00187 00188 00189 class Construct_projected_boundary_2 00190 { 00191 public: 00192 00193 template <class OutputIterator> 00194 OutputIterator operator()(const Xy_monotone_surface_3& s, 00195 OutputIterator o) const 00196 { 00197 Base base; 00198 std::cerr << "Construct_projected_boundary_2: JUST FIRST" << std::endl; 00199 std::cerr << "Surface: " << s << std::endl; 00200 std::list<CGAL::Object> l; 00201 base.construct_projected_boundary_2_object() (s, std::back_inserter(l)); 00202 00203 if (l.size() > 0) 00204 { 00205 std::pair<X_monotone_curve_2, CGAL::Oriented_side> i; 00206 if (CGAL::assign(i, l.front())) 00207 std::cerr << "First: " << i.first << std::endl; 00208 else 00209 std::cerr << "First intersection is a point" << std::endl; 00210 } 00211 00212 std::copy(l.begin(), l.end(), o); 00213 return o; 00214 } 00215 }; 00216 00217 Construct_projected_boundary_2 00218 construct_projected_boundary_2_object() const 00219 { 00220 return Construct_projected_boundary_2(); 00221 } 00222 00223 00224 class Construct_projected_intersections_2 00225 { 00226 public: 00227 00228 template <class OutputIterator> 00229 OutputIterator operator()(const Xy_monotone_surface_3& s1, 00230 const Xy_monotone_surface_3& s2, 00231 OutputIterator o) const 00232 { 00233 Base base; 00234 std::cerr << "Construct_projected_intersections_2: JUST FIRST" 00235 << std::endl; 00236 std::cerr << "Surface1: " << s1 << std::endl; 00237 std::cerr << "Surface2: " << s2 << std::endl; 00238 std::list<CGAL::Object> l; 00239 base.construct_projected_intersections_2_object() (s1, s2, 00240 std::back_inserter(l)); 00241 00242 if (l.size() > 0) 00243 { 00244 Intersection_curve i; 00245 if (CGAL::assign(i, l.front())) 00246 std::cerr << "First: " << i.first << std::endl; 00247 else 00248 std::cerr << "First intersection is not a point" << std::endl; 00249 } 00250 00251 std::copy(l.begin(), l.end(), o); 00252 return o; 00253 } 00254 }; 00255 00256 Construct_projected_intersections_2 00257 construct_projected_intersections_2_object() const 00258 { 00259 return Construct_projected_intersections_2(); 00260 } 00261 00262 }; 00263 00264 CGAL_END_NAMESPACE 00265 00266 #endif