Boost logo

Boost-Commit :

From: huseyinakcan_at_[hidden]
Date: 2007-08-07 20:47:16


Author: huseyinakcan
Date: 2007-08-07 20:47:12 EDT (Tue, 07 Aug 2007)
New Revision: 38502
URL: http://svn.boost.org/trac/boost/changeset/38502

Log:
create lens added.
base functions updated

Text files modified:
   sandbox/SOC/2007/geometry/libs/hdstl/dev/euler/base_functions.hpp | 61 +++++++++------------------------------
   sandbox/SOC/2007/geometry/libs/hdstl/dev/euler/base_functions.t.cpp | 12 +++---
   sandbox/SOC/2007/geometry/libs/hdstl/dev/euler/euler_operators.hpp | 44 +++++++++++++++++++++++++---
   3 files changed, 60 insertions(+), 57 deletions(-)

Modified: sandbox/SOC/2007/geometry/libs/hdstl/dev/euler/base_functions.hpp
==============================================================================
--- sandbox/SOC/2007/geometry/libs/hdstl/dev/euler/base_functions.hpp (original)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/euler/base_functions.hpp 2007-08-07 20:47:12 EDT (Tue, 07 Aug 2007)
@@ -6,7 +6,9 @@
 // The base functions are the building blocks for the Euler operators defined in 'euler_operators.hpp'.
 // The list of these functions are as follows:
 //
-// - stitch_cycle: Sets the next and prev links of the given two halfedges 'h' and 'g' based on the configuration
+// - stitch_next: Sets the next link of the given two halfedges 'h' and 'g' based on the configuration
+// of data structure 'hds'.
+// - stitch_prev: Sets the next link of the given two halfedges 'h' and 'g' based on the configuration
 // of data structure 'hds'.
 // - stitch_vertex: Sets the vertex 'v' as the 'source' or the 'target' vertex of halfedge 'h' and defines a vertex
 // link from the halfedge 'h' to vertex 'v' if the vertex links are defined in 'hds'
@@ -89,58 +91,25 @@
     }
 };
 
-template <typename HalfedgeGen, bool IsForward=true, bool IsBackward=false>
-struct stitch_cycle_dir_helper
- // Helper for forward HDS, uses the nested 'next_tag' to identify the primary accessor and selects
- // the set functions for the appropriate accessor.
-{
- static void
- stitch_cycle_dir(typename HalfedgeGen::halfedge_descriptor h, typename HalfedgeGen::halfedge_descriptor g,
- HalfedgeGen& hds)
- {
- stitch_cycle_helper<HalfedgeGen, typename HalfedgeGen::halfedge_selector::next_tag>::stitch(h,g,hds);
- }
-};
-
-template <typename HalfedgeGen>
-struct stitch_cycle_dir_helper<HalfedgeGen, false, true>
- // Helper for backward HDS, uses the nested 'prev_tag' to identify the primary accessor and selects
- // the set functions for the appropriate accessor.
-{
- static void
- stitch_cycle_dir(typename HalfedgeGen::halfedge_descriptor h, typename HalfedgeGen::halfedge_descriptor g,
- HalfedgeGen& hds)
- {
- stitch_cycle_helper<HalfedgeGen, typename HalfedgeGen::halfedge_selector::prev_tag>::stitch(h,g,hds);
- }
-};
+} // end namespace detail
+// \endcond
 
 template <typename HalfedgeGen>
-struct stitch_cycle_dir_helper<HalfedgeGen, true, true>
- // Helper for bidirectional HDS, uses the nested 'next_tag' and 'prev_tag' to identify the primary accessors
- // and selects the set functions for the appropriate accessors.
+void
+stitch_next(typename HalfedgeGen::halfedge_descriptor h, typename HalfedgeGen::halfedge_descriptor g, HalfedgeGen& hds)
+ // Sets the appropriate forward accessor relations between h and g, based on the configuration of the 'hds'
 {
- static void
- stitch_cycle_dir(typename HalfedgeGen::halfedge_descriptor h, typename HalfedgeGen::halfedge_descriptor g,
- HalfedgeGen& hds)
- {
- stitch_cycle_helper<HalfedgeGen, typename HalfedgeGen::halfedge_selector::next_tag>::stitch(h,g,hds);
- stitch_cycle_helper<HalfedgeGen, typename HalfedgeGen::halfedge_selector::prev_tag>::stitch(h,g,hds);
- }
-};
-
-} // end namespace detail
-// \endcond
+ typedef typename HalfedgeGen::halfedge_selector::next_tag tag;
+ detail::stitch_cycle_helper<HalfedgeGen, tag>::stitch(h,g,hds);
+}
 
 template <typename HalfedgeGen>
 void
-stitch_cycle(typename HalfedgeGen::halfedge_descriptor h, typename HalfedgeGen::halfedge_descriptor g, HalfedgeGen& hds)
- // Sets the appropriate accessor relations between h and g, based on the configuration of the 'hds'
+stitch_prev(typename HalfedgeGen::halfedge_descriptor h, typename HalfedgeGen::halfedge_descriptor g, HalfedgeGen& hds)
+ // Sets the appropriate backward accessor relations between h and g, based on the configuration of the 'hds'
 {
- typedef typename HalfedgeGen::halfedge_selector halfedge_selector;
- detail::stitch_cycle_dir_helper<HalfedgeGen, halfedge_selector::is_forward,
- halfedge_selector::is_backward
- >::stitch_cycle_dir(h,g,hds);
+ typedef typename HalfedgeGen::halfedge_selector::prev_tag tag;
+ detail::stitch_cycle_helper<HalfedgeGen, tag>::stitch(h,g,hds);
 }
 
 // \cond

Modified: sandbox/SOC/2007/geometry/libs/hdstl/dev/euler/base_functions.t.cpp
==============================================================================
--- sandbox/SOC/2007/geometry/libs/hdstl/dev/euler/base_functions.t.cpp (original)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/euler/base_functions.t.cpp 2007-08-07 20:47:12 EDT (Tue, 07 Aug 2007)
@@ -128,7 +128,7 @@
     halfedge_descriptor ha = *begin;
     halfedge_descriptor hb = *(++begin);
 
- stitch_cycle(ha, hb, halfedgeGen);
+ stitch_next(ha, hb, halfedgeGen);
     
     BOOST_CHECK(( next_in_facet(ha, halfedgeGen) == hb ));
     return true;
@@ -148,7 +148,7 @@
     halfedge_descriptor ha = *begin;
     halfedge_descriptor hb = *(++begin);
 
- stitch_cycle(ha, hb, halfedgeGen);
+ stitch_next(ha, hb, halfedgeGen);
     
     BOOST_CHECK(( next_at_source(ha, halfedgeGen) == hb ));
 
@@ -169,7 +169,7 @@
     halfedge_descriptor ha = *begin;
     halfedge_descriptor hb = *(++begin);
 
- stitch_cycle(ha, hb, halfedgeGen);
+ stitch_next(ha, hb, halfedgeGen);
     
     BOOST_CHECK(( next_at_target(ha, halfedgeGen) == hb ));
 
@@ -190,7 +190,7 @@
     halfedge_descriptor ha = *begin;
     halfedge_descriptor hb = *(++begin);
 
- stitch_cycle(ha, hb, halfedgeGen);
+ stitch_prev(ha, hb, halfedgeGen);
     
     BOOST_CHECK(( prev_in_facet(ha, halfedgeGen) == hb ));
 
@@ -211,7 +211,7 @@
     halfedge_descriptor ha = *begin;
     halfedge_descriptor hb = *(++begin);
 
- stitch_cycle(ha, hb, halfedgeGen);
+ stitch_prev(ha, hb, halfedgeGen);
     
     BOOST_CHECK(( prev_at_source(ha, halfedgeGen) == hb ));
 
@@ -232,7 +232,7 @@
     halfedge_descriptor ha = *begin;
     halfedge_descriptor hb = *(++begin);
 
- stitch_cycle(ha, hb, halfedgeGen);
+ stitch_prev(ha, hb, halfedgeGen);
     
     BOOST_CHECK(( prev_at_target(ha, halfedgeGen) == hb ));
 

Modified: sandbox/SOC/2007/geometry/libs/hdstl/dev/euler/euler_operators.hpp
==============================================================================
--- sandbox/SOC/2007/geometry/libs/hdstl/dev/euler/euler_operators.hpp (original)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/euler/euler_operators.hpp 2007-08-07 20:47:12 EDT (Tue, 07 Aug 2007)
@@ -62,11 +62,45 @@
 namespace boost {
 namespace hdstl {
 
-template <typename HDS>
-HDS::halfedge_descriptor
-create_lens(typename HDS::facet_descriptor f1, typename HDS::facet_descriptor f2
- , typename HDS::vertex_descriptor v1, typename HDS::vertex_descriptor v2
- , typename HDS::halfedge_descriptor h, HDS& hds)
+template <typename HalfedgeGen>
+typename HalfedgeGen::halfedge_descriptor
+create_lens(typename HalfedgeGen::facet_descriptor f1, typename HalfedgeGen::facet_descriptor f2
+ , typename HalfedgeGen::vertex_descriptor v1, typename HalfedgeGen::vertex_descriptor v2
+ , typename HalfedgeGen::halfedge_descriptor h, HalfedgeGen& hds)
+{
+ set_next(h, opposite(h, hds), hds);
+ set_next(opposite(h, hds), h, hds);
+ set_vertex(h, v1, hds);
+ set_vertex(opposite(h), v2, hds);
+ set_facet(h, f1, hds);
+ set_facet(opposite(h), v2, hds);
+}
+
+template <typename HalfedgeGen>
+typename HalfedgeGen::halfedge_descriptor
+create_lens(typename HalfedgeGen::vertex_descriptor v1, typename HalfedgeGen::vertex_descriptor v2
+ , typename HalfedgeGen::halfedge_descriptor h, HalfedgeGen& hds)
+{
+ set_next(h, opposite(h, hds), hds);
+ set_next(opposite(h, hds), h, hds);
+ set_vertex(h, v1, hds);
+ set_vertex(opposite(h), v2, hds);
+}
+
+template <typename HalfedgeGen>
+typename HalfedgeGen::halfedge_descriptor
+create_lens(typename HalfedgeGen::facet_descriptor f1, typename HalfedgeGen::facet_descriptor f2
+ , typename HalfedgeGen::halfedge_descriptor h, HalfedgeGen& hds)
+{
+ set_next(h, opposite(h, hds), hds);
+ set_next(opposite(h, hds), h, hds);
+ set_facet(h, f1, hds);
+ set_facet(opposite(h), v2, hds);
+}
+
+template <typename HalfedgeGen>
+typename HalfedgeGen::halfedge_descriptor
+create_lens(HalfedgeGen& hds)
 {
 
 }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk