|
Boost-Commit : |
From: huseyinakcan_at_[hidden]
Date: 2007-07-15 20:48:51
Author: huseyinakcan
Date: 2007-07-15 20:48:50 EDT (Sun, 15 Jul 2007)
New Revision: 7442
URL: http://svn.boost.org/trac/boost/changeset/7442
Log:
halfedge_selector class (has halfedgeS, halfedge_gen and stored_halfedge).
Later all the selector classes can be split to three parts, .._selector.hpp,
..._gen.hpp and stored_...hpp classes.
Added:
sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/halfedge_selectors.cpp
sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/halfedge_selectors.hpp
sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/meta_functions.hpp
Removed:
sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/halfedge_gen.hpp
sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/hds_selectors.hpp
Text files modified:
sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/Makefile | 10 ++
sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/halfedge_ds.hpp | 147 +++++++++++++++++----------------------
2 files changed, 72 insertions(+), 85 deletions(-)
Modified: sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/Makefile
==============================================================================
--- sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/Makefile (original)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/Makefile 2007-07-15 20:48:50 EDT (Sun, 15 Jul 2007)
@@ -6,11 +6,12 @@
TARGET=dbg_exc_mt
-PACKAGE_OBJECTS=container_selectors.o facet_selectors.o
+PACKAGE_OBJECTS=container_selectors.o facet_selectors.o \
+ vertex_selectors.o halfedge_selectors.o
PACKAGE_LIBRARY=libhalfedge_ds.a
-TEST_DRIVERS=container_selectors.t facet_selectors.t
+TEST_DRIVERS=container_selectors.t facet_selectors.t
.SUFFIXES:
.SUFFIXES: ${TARGET}.o .o .cpp .hpp
@@ -30,6 +31,9 @@
facet_selectors.o:
+vertex_selectors.o:
+
+halfedge_selectors.o:
### BUILDING TEST DRIVERS AND DEPENDENCIES OF TEST DRIVER
@@ -43,6 +47,7 @@
facet_selectors.t.o:
+
%.t.o: %.t.cpp %.hpp
${CXX} ${CXXFLAGS} ${CXXINCLUDES} -c -o $*.t.o $<
@@ -51,6 +56,7 @@
facet_selectors.t:
+
## UTILITIES
clean: testclean
Modified: sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/halfedge_ds.hpp
==============================================================================
--- sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/halfedge_ds.hpp (original)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/halfedge_ds.hpp 2007-07-15 20:48:50 EDT (Sun, 15 Jul 2007)
@@ -25,107 +25,88 @@
// on the storage type. Do not use and opposite method and manually calculates
// the opposite if the storage is 'stl::vector' type, otherwise uses the
// defined 'opposite' member.
-// - 'halfedge_ds' concerete implementation of the 'HDS'.
+// - 'halfedge_ds' concrete implementation of the 'HDS'.
#ifndef BOOST_HDSTL_HALFEDGE_DS_HPP
#define BOOST_HDSTL_HALFEDGE_DS_HPP 1
-#include <boost/pending/ct_if.hpp>
+#include <boost/hdstl/halfedge_ds/meta_functions.hpp>
+#include <boost/hdstl/halfedge_ds/halfedge_selectors.hpp>
+#include <boost/hdstl/halfedge_ds/vertex_selectors.hpp>
+#include <boost/hdstl/halfedge_ds/facet_selectors.hpp>
namespace boost {
namespace hdstl {
+
+
template <typename HalfedgeS, typename VertexS, typename FacetS>
struct halfedge_ds_gen {
struct config {
- typedef boost::ct_if_t<mpl::equal<HalfedgeS::container_type, vecS>,
- false_type, true_type> halfedge_has_opposite_member;
- typedef HalfedgeS::is_forward is_forward;
- typedef HalfedgeS::is_backward is_backward;
- typedef HalfedgeS::is_bidir is_bidir;
- typedef HalfedgeS::tag traversal_tag;
+
+ enum { halfedge_has_opposite_member = !meta_is_same<
+ typename HalfedgeS::container_selector, vecS>::value };
+ enum { is_forward = HalfedgeS::is_forward };
+ enum { is_backward = HalfedgeS::is_backward };
+ enum { is_bidir = HalfedgeS::is_bidir };
+ typedef typename HalfedgeS::tag traversal_tag;
// halfedge config
- typedef boost::ct_if_t<mpl::equal<VertexS,noVertexS>,
- false_type, true_type> halfedge_supports_vertices;
- typedef VertexS::is_source is_source;
- typedef VertexS::is_target is_target;
- typedef VertexS::has_vertex_links has_vertex_links;
+ enum { halfedge_supports_vertices = !meta_is_same<
+ VertexS,noVertexS>::value };
+ enum { is_source = VertexS::is_source };
+ enum { is_target = VertexS::is_target };
+ enum { has_vertex_link = VertexS::has_vertex_link };
// vertex config
- typedef boost::ct_if_t<mpl::equal<FacetS,noFacetS>,
- false_type, true_type> halfedge_supports_facets;
+ enum { halfedge_supports_facets= !meta_is_same<FacetS,noFacetS>::value};
// facet config
-
-
};
};
-
-template <typename Selector, typename ValueType>
-struct container_gen { };
-
-template <typename ValueType>
-struct container_gen<listS, ValueType> {
- typedef std::list<ValueType> type;
- typedef false_type is_rand_access;
-};
-
-template <typename ValueType>
-struct container_gen<vecS, ValueType> {
- typedef std::vector<ValueType> type;
- typedef true_type is_rand_access;
-};
-
-} // namespace detail
-
-
-template<typename Selector, typename HalfedgeDescriptor>
-struct opposite_helper {
- inline static
- HalfedgeDescriptor&
- opposite(HalfedgeDescriptor& h)
- {
- // halfedges come in pairs, point to each other as
- // opposite. If halfedges stored in a list, use the
- // opposite pointer.
- return h->opposite_;
- }
-};
-
-template<typename HalfedgeDescriptor>
-struct opposite_helper<vecS, HalfedgeDescriptor> {
- inline static
- HalfedgeSescriptor&
- opposite(HalfedgeDescriptor& h)
- {
- // halfedges come in pairs, point to each other as
- // opposite. If halfedges stored in a vector:
- if (h%2==0)
- return h+1;
- else
- return h-1;
- }
-
-
-template <typename HalfedgeS = halfedgeS<vecS, forwardS<next_in_facet_tag> >,
- typename VertexS = vertexS<vecS, vertexLinkS, sourceS>,
- typename FacetS = facetS<vecS> >
-class halfedge_ds
-{
- typedef void* halfedge_ptr;
-
- typedef typename container_gen<HalfedgeS, halfedge_ptr
- >::is_random is_rand_access;
-
- typedef typename boost::ct_if_t<is_rand_access,
- std::size_t, halfedge_ptr>::type halfedge_descriptor;
-
- typedef typename container_gen<HalfedgeS, halfedge_ptr>::type
- HalfedgeList;
-
- typedef typename HalfedgeList::iterator halfedge_iterator;
-
-};
+//template<typename Selector, typename HalfedgeDescriptor>
+//struct opposite_helper {
+// inline static
+// HalfedgeDescriptor&
+// opposite(HalfedgeDescriptor& h)
+// {
+// // halfedges come in pairs, point to each other as
+// // opposite. If halfedges stored in a list, use the
+// // opposite pointer.
+// return h->opposite_;
+// }
+//};
+//
+//template<typename HalfedgeDescriptor>
+//struct opposite_helper<vecS, HalfedgeDescriptor> {
+// inline static
+// HalfedgeDescriptor&
+// opposite(HalfedgeDescriptor& h)
+// {
+// // halfedges come in pairs, point to each other as
+// // opposite. If halfedges stored in a vector:
+// return h^1;
+// }
+//};
+
+//template <typename HalfedgeS = halfedgeS<vecS, forwardS<next_in_facet_tag> >,
+// typename VertexS = vertexS<vecS, vertexLinkS, sourceS>,
+// typename FacetS = facetS<vecS> >
+//class halfedge_ds
+//{
+// typedef void* halfedge_ptr;
+//
+// typedef typename container_gen<HalfedgeS, halfedge_ptr
+// >::is_random is_rand_access;
+//
+// typedef typename boost::ct_if_t<is_rand_access,
+// std::size_t, halfedge_ptr>::type halfedge_descriptor;
+//
+// typedef typename container_gen<HalfedgeS, halfedge_ptr>::type
+// HalfedgeList;
+//
+// typedef typename HalfedgeList::iterator halfedge_iterator;
+//
+//};
} // namespace hdstl
} // namespace boost
Deleted: sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/halfedge_gen.hpp
==============================================================================
--- sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/halfedge_gen.hpp 2007-07-15 20:48:50 EDT (Sun, 15 Jul 2007)
+++ (empty file)
@@ -1,139 +0,0 @@
-//halfedge_gen.hpp -*- C++ -*-
-//
-//@PURPOSE: Provide a concrete implementation of 'stored_halfedge' based on various configurations of 'halfedge_ds'.
-//
-//@CLASSES:
-// 'stored_halfedge': implementation of halfedge
-// 'opposite_helper': class for configuring opposite access methods
-// 'vertex_helper': class for configuring vertex access methods
-// 'facet_helper': class for configuring facet access methods
-// 'traversal_helper': class for configuring traversal methods
-//
-//@SEE_ALSO: {hds_concepts.hpp, halfedge_ds.hpp}
-//
-//@DESCRIPTION: This file provide a single class template, 'stored_halfedge',
-//and the helper classes, which accepts many template parameters that can be
-//used to govern its implementation. These parameters can be chosen using the
-//'Config' class members (see 'halfedge_ds' component).
-//
-///Definition
-///----------
-// - 'stored_halfedge' This class inherits from four helper classes,
-// 'opposite_helper', 'vertex_helper', 'facet_helper', 'traversal_helper'.
-// Based on the configurations of these classes, members are added or omited
-// from 'stored_halfedge' for optimization purposes.
-// - 'vertex_helper' If vertices are supported in the 'halfedge_ds', this class
-// defines 'source' or 'target' members, based on the configuration
-// options. If vertices are not supported, this class does not define a
-// vertex access member.
-// - 'facet_helper' If facets are supported in the 'halfedge_ds', this class
-// defines facet members, based on the configuration
-// options. If facets are not supported, this class does not define a
-// facet access member.
-// - 'traversal_helper' Based on the traversal configuration, this class
-// defines 'm_next', 'm_prev' or both traversal access members.
-
-
-#ifndef BOOST_HDSTL_HALFEDGE_GEN_HPP
-#define BOOST_HDSTL_HALFEDGE_GEN_HPP 1
-
-#include <boost/hdstl/halfedge_ds/halfedge_ds.hpp>
-
-namespace boost {
-namespace hdstl {
-
-template<typename has_opposite_member, typename HalfedgeDescriptor>
-struct opposite_helper
-{
-};
-
-template<typename HalfedgeDescriptor>
-struct opposite_helper<true_type, HalfedgeDescriptor>
-{
- HalfedgeDescriptor m_opposite;
-};
-
-template<typename is_source, typename VertexDescriptor>
-struct source_helper
-{
-};
-
-struct source_helper<true_type, VertexDescriptor>
-{
- VertexDescriptor m_source;
-};
-
-template<typename is_target, typename VertexDescriptor>
-struct target_helper
-{
-};
-
-struct target_helper<true_type, VertexDescriptor>
-{
- VertexDescriptor m_target;
-};
-
-template<typename supports_vertices, typename is_source, typename is_target,
- typename VertexDescriptor>
-struct vertex_helper
-{
-};
-
-template<typename is_source, typename is_target, typename VertexDescriptor>
-struct vertex_helper<true_type, is_source, is_target, VertexDescriptor>
-: public source_helper<is_source>,
-: public target_helper<is_target> {
-};
-
-template<typename supports_facets, typename FacetDescriptor>
-struct facet_helper
-{
-};
-
-template<typename FacetDescriptor>
-struct facet_helper<true_type, FacetDescriptor>
-{
- FacetDescriptor m_facet;
-};
-
-template<typename is_forward, typename is_backward, typename isbidir,
- typename HalfedgeDescriptor>
-struct traversal_helper
-{
-};
-
-template<typename is_backward, typename isbidir, typename HalfedgeDescriptor>
-struct traversal_helper<true_type, false_type, false_type, HalfedgeDescriptor>
-{
- HalfedgeDescriptor m_next;
-};
-
-template<typename is_forward, typename isbidir, typename HalfedgeDescriptor>
-struct traversal_helper<false_type, true_type, false_type, HalfedgeDescriptor>
-{
- HalfedgeDescriptor m_prev;
-};
-
-template<typename is_forward, typename is_backward, typename HalfedgeDescriptor>
-struct traversal_helper<false_type, false_type, true_type, HalfedgeDescriptor>
-: traversal_helper<true_type,false_type,false_type,HalfedgeDescriptor>,
-: traversal_helper<false_type,true_type,false_type,HalfedgeDescriptor>
-{
-};
-
-template<typename HalfedgeDescriptor, typename VertexDescriptor,
- typename FacetDescriptor, typename Config>
-struct stored_halfedge
-: public opposite_helper<Config::halfedge_has_opposite_member,
- HalfedgeDescriptor>,
-: public vertex_helper<Config::is_source, Config::is_target, VertexDescriptor>,
-: public facet_helper<Config::halfedge_supports_facets, FacetDescriptor>,
-: public traversal_helper<Config::is_forward, Config::is_backward,
- Config::is_bidir, HalfedgeDescriptor>
-{
-};
-
-} // namespace hdstl
-} // namespace boost
-
-#endif
Added: sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/halfedge_selectors.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/halfedge_selectors.cpp 2007-07-15 20:48:50 EDT (Sun, 15 Jul 2007)
@@ -0,0 +1,3 @@
+//halfedge_selectors.cpp -*- C++ -*-
+
+#include <boost/hdstl/halfedge_ds/halfedge_selectors.hpp>
Added: sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/halfedge_selectors.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/halfedge_selectors.hpp 2007-07-15 20:48:50 EDT (Sun, 15 Jul 2007)
@@ -0,0 +1,265 @@
+//halfedge_selectors.hpp -*- C++ -*-
+//
+//@PURPOSE: Provide a concrete implementation of 'stored_halfedge' based on various configurations of 'halfedge_ds'.
+//
+//@CLASSES:
+// 'stored_halfedge': defines the storage for a given halfedge configuration
+// 'halfedge_gen': defines the stored type and accesors for a halfedge
+// configuration
+// 'halfedgeS': inherits the options from one of 'forwardS', 'backwardS'
+// , or 'bidirS', and defined the container type.
+//
+//@SEE_ALSO: {hds_concepts.hpp, halfedge_ds.hpp}
+//
+//@DESCRIPTION: This file provides the 'stored_halfedge',
+//and the helper classes, which accepts many template parameters that can be
+//used to govern its implementation. These parameters can be chosen using the
+//'Config' class members (see 'halfedge_ds' component). Currently the
+// helper classes are as follows:
+//
+// - 'opposite_helper': class for configuring opposite access methods
+// - 'vertex_helper': class for configuring vertex access methods
+// - 'facet_helper': class for configuring facet access methods
+// - 'traversal_helper': class for configuring traversal methods
+//
+// and the selectors are as follows:
+//
+// - 'forwardS': defines configuration options for forward access
+// - 'backwardS': defines configuration options for backward access
+// - 'bidirS': defines configuration options for bidirectional access
+//
+///Definition
+///----------
+// - 'stored_halfedge' This class inherits from four helper classes,
+// 'opposite_helper', 'vertex_helper', 'facet_helper', 'traversal_helper'.
+// Based on the configurations of these classes, members are added or omited
+// from 'stored_halfedge' for optimization purposes.
+// - 'vertex_helper' If vertices are supported in the 'halfedge_ds', this class
+// defines 'source' or 'target' members, based on the configuration
+// options. If vertices are not supported, this class does not define a
+// vertex access member.
+// - 'facet_helper' If facets are supported in the 'halfedge_ds', this class
+// defines facet members, based on the configuration
+// options. If facets are not supported, this class does not define a
+// facet access member.
+// - 'traversal_helper' Based on the traversal configuration, this class
+// defines 'm_next', 'm_prev' or both traversal access members.
+
+
+#ifndef BOOST_HDSTL_HALFEDGE_SELECTORS_HPP
+#define BOOST_HDSTL_HALFEDGE_SELECTORS_HPP 1
+
+#include <boost/hdstl/hds_traits.hpp>
+#include <boost/hdstl/halfedge_ds/halfedge_ds.hpp>
+
+namespace boost {
+namespace hdstl {
+
+template <typename ForwardCategory>
+struct forwardS {
+ typedef forward_traversal_tag tag;
+ typedef ForwardCategory next_tag;
+ enum { is_forward = true };
+ enum { is_backward = false };
+ enum { is_bidir = false };
+};
+
+template <typename BackwardCategory>
+struct backwardS {
+ typedef backward_traversal_tag tag;
+ typedef BackwardCategory prev_tag;
+ enum { is_forward = false };
+ enum { is_backward = true };
+ enum { is_bidir = false };
+};
+
+template <typename ForwardCategory, typename BackwardCategory>
+struct bidirS {
+ typedef bidirectional_traversal_tag tag;
+ typedef ForwardCategory next_tag;
+ typedef BackwardCategory prev_tag;
+ enum { is_forward = false };
+ enum { is_backward = false };
+ enum { is_bidir = true };
+};
+
+template <typename ContainerS,
+ typename TraversalS = forwardS<next_in_facet_tag> >
+struct halfedgeS
+: public TraversalS {
+ typedef ContainerS container_selector;
+};
+template<bool has_opposite_member = false, typename HalfedgeDescriptor=int>
+struct opposite_helper
+{
+};
+
+template<typename HalfedgeDescriptor>
+struct opposite_helper<true, HalfedgeDescriptor>
+{
+ HalfedgeDescriptor m_opposite;
+};
+
+template<bool is_source=false, typename VertexDescriptor=int>
+struct source_helper
+{
+};
+
+template<typename VertexDescriptor>
+struct source_helper<true, VertexDescriptor>
+{
+ VertexDescriptor m_source;
+};
+
+template<bool is_target=false, typename VertexDescriptor=int>
+struct target_helper
+{
+};
+
+template<typename VertexDescriptor>
+struct target_helper<true, VertexDescriptor>
+{
+ VertexDescriptor m_target;
+};
+
+template<bool supports_vertices, bool is_source, bool is_target,
+ typename VertexDescriptor=int>
+struct vertex_helper
+{
+};
+
+template<bool is_source, bool is_target, typename VertexDescriptor>
+struct vertex_helper<true, is_source, is_target, VertexDescriptor>
+: public source_helper<is_source>,
+ public target_helper<is_target> {
+};
+
+template<bool supports_facets =false, typename FacetDescriptor=int>
+struct facet_helper
+{
+};
+
+template<typename FacetDescriptor>
+struct facet_helper<true, FacetDescriptor>
+{
+ FacetDescriptor m_facet;
+};
+
+template<bool is_forward, bool is_backward, bool isbidir,
+ typename HalfedgeDescriptor>
+struct traversal_helper
+{
+};
+
+template<typename HalfedgeDescriptor>
+struct traversal_helper<true, false, false, HalfedgeDescriptor>
+{
+ HalfedgeDescriptor m_next;
+};
+
+template<typename HalfedgeDescriptor>
+struct traversal_helper<false, true, false, HalfedgeDescriptor>
+{
+ HalfedgeDescriptor m_prev;
+};
+
+template<typename HalfedgeDescriptor>
+struct traversal_helper<false, false, true, HalfedgeDescriptor>
+: public traversal_helper<true,false,false,HalfedgeDescriptor>,
+ public traversal_helper<false,true,false,HalfedgeDescriptor>
+{
+};
+
+template<typename HalfedgeDescriptor, typename VertexDescriptor,
+ typename FacetDescriptor, typename Config>
+struct stored_halfedge
+: public opposite_helper<Config::halfedge_has_opposite_member,
+ HalfedgeDescriptor>,
+ public vertex_helper<Config::halfedge_supports_vertices,
+ Config::is_source, Config::is_target, VertexDescriptor>,
+ public facet_helper<Config::halfedge_supports_facets, FacetDescriptor>,
+ public traversal_helper<Config::is_forward, Config::is_backward,
+ Config::is_bidir, HalfedgeDescriptor>
+{
+ // This struct implements a stored_halfedge which can be configured based
+ // on the 'halfedge_ds::config' selections. Based on the configuration
+ // options, this stored_halfedge has the following options as members:
+ // - having an opposite member or not
+ // - having a next/prev pointer or not, or having both
+ // - having a vertex descriptor
+ // - having a facet descriptor
+ // All the selections are done in the ..._helper<> functions and these
+ // functions form a base for the stored_halfedge.
+
+ // CREATORS
+ stored_halfedge() {}
+
+};
+
+template <typename HalfedgeS, typename HalfedgeDescriptor,
+ typename VertexDescriptor, typename FacetDescriptor, typename Config>
+struct halfedge_gen {
+};
+
+template <typename ContainerS, typename TraversalS,typename HalfedgeDescriptor,
+ typename VertexDescriptor, typename FacetDescriptor, typename Config>
+struct halfedge_gen<halfedgeS<ContainerS,TraversalS>, HalfedgeDescriptor,
+ VertexDescriptor, FacetDescriptor, Config> {
+ // TYPES
+ typedef stored_halfedge<HalfedgeDescriptor, VertexDescriptor,
+ FacetDescriptor, Config> halfedge_type;
+ // The stored halfedge type for this halfedge generator.
+
+ typedef container_gen<ContainerS, halfedge_type> ContainerGen;
+ // The container generator for this halfdedge generator.
+
+ typedef typename ContainerGen::type container_type;
+ // The halfedge container type for this halfedge generator.
+
+ typedef typename ContainerGen::descriptor halfedge_descriptor;
+ // The halfedge descriptor type for this halfedge generator.
+
+ typedef typename ContainerGen::iterator halfedge_iterator;
+ // The halfedge iterator type for this halfedge generator.
+
+ // DATA
+ container_type m_container;
+ // The actual container for the halfedges, from which halfedges can be
+ // obtained.
+};
+
+// FREE FUNCTIONS
+template <typename HalfedgeS, typename HalfedgeDescriptor,
+ typename VertexDescriptor, typename FacetDescriptor, typename Config>
+typename halfedge_gen<HalfedgeS, HalfedgeDescriptor, VertexDescriptor,
+ FacetDescriptor, Config>::iterator
+halfedges_begin(halfedge_gen<HalfedgeS, HalfedgeDescriptor, VertexDescriptor,
+ FacetDescriptor, Config> const& hds) {
+ typedef typename halfedge_gen<HalfedgeS, HalfedgeDescriptor,
+ VertexDescriptor,FacetDescriptor, Config>::ContainerGen ContainerGen;
+ return ContainerGen::container_begin(hds.m_container);
+}
+
+template <typename HalfedgeS, typename HalfedgeDescriptor,
+ typename VertexDescriptor, typename FacetDescriptor, typename Config>
+typename halfedge_gen<HalfedgeS, HalfedgeDescriptor, VertexDescriptor,
+ FacetDescriptor, Config>::iterator
+halfedges_end(halfedge_gen<HalfedgeS, HalfedgeDescriptor, VertexDescriptor,
+ FacetDescriptor, Config> const& hds) {
+ typedef typename halfedge_gen<HalfedgeS, HalfedgeDescriptor,
+ VertexDescriptor,FacetDescriptor, Config>::ContainerGen ContainerGen;
+ return ContainerGen::container_end(hds.m_container);
+}
+
+template <typename HalfedgeS, typename HalfedgeDescriptor,
+ typename VertexDescriptor, typename FacetDescriptor, typename Config>
+typename halfedge_gen<HalfedgeS, HalfedgeDescriptor, VertexDescriptor,
+ FacetDescriptor, Config>::iterator
+num_halfedges(halfedge_gen<HalfedgeS, HalfedgeDescriptor, VertexDescriptor,
+ FacetDescriptor, Config> const& hds) {
+ return hds.m_container.size();
+}
+} // namespace hdstl
+} // namespace boost
+
+#endif
Deleted: sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/hds_selectors.hpp
==============================================================================
--- sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/hds_selectors.hpp 2007-07-15 20:48:50 EDT (Sun, 15 Jul 2007)
+++ (empty file)
@@ -1,63 +0,0 @@
-//hds_selectors.hpp -*- C++ -*-
-//
-//@PURPOSE: Provide selector classes for 'HalfedgeS'.
-//
-//@CLASSES:
-// 'forwardS': defines configuration options for forward access
-// 'backwardS': defines configuration options for backward access
-// 'bidirS': defines configuration options for bidirectional access
-// 'halfedgeS': inherits the options from one of 'forwardS', 'backwardS', or
-// 'bidirS', and defined the container type.
-//
-//@SEE_ALSO: {hds_concepts.hpp, halfedge_ds.hpp}
-//
-//@DESCRIPTION: This file provides the halfedgeS selector class for
-//configurations related to halfedge properties. Uses the 'forwardS',
-//'backwardS' and 'bidirS' selector classes to inherit the configuration
-//options based on the traversal type.
-
-#ifndef BOOST_HDSTL_HDS_SELECTORS_HPP
-#define BOOST_HDSTL_HDS_SELECTORS_HPP 1
-
-namespace boost;
-namespace hdstl;
-
-template <typename ForwardCategory>
-struct forwardS {
- typedef forward_traversal_tag tag;
- typedef ForwardCategory next_tag;
- typedef true_type is_forward;
- typedef false_type is_backward;
- typedef false_type is_bidir;
-};
-
-template <typename BackwardCategory>
-struct backwardS {
- typedef backward_traversal_tag tag;
- typedef BackwardCategory prev_tag;
- typedef false_type is_forward;
- typedef true_type is_backward;
- typedef false_type is_bidir;
-};
-
-template <typename ForwardCategory, typename BackwardCategory>
-struct bidirS {
- typedef bidirectional_traversal_tag tag;
- typedef ForwardCategory next_tag;
- typedef BackwardCategory prev_tag;
- typedef false_type is_forward;
- typedef false_type is_backward;
- typedef true_type is_bidir;
-};
-
-template <typename Selector,
- typename TraversalS = forwardS<next_in_facet_tag> >
-struct halfedgeS
-: public TraversalS {
- typedef Selector container_type;
-};
-
-} // namespace hdstl
-} // namespace boost
-
-#endif
Added: sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/meta_functions.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/geometry/libs/hdstl/dev/halfedge_ds/meta_functions.hpp 2007-07-15 20:48:50 EDT (Sun, 15 Jul 2007)
@@ -0,0 +1,15 @@
+struct true_type {};
+struct false_type{};
+
+template <typename T1, typename T2>
+struct meta_is_same {
+ enum {value = false};
+ typedef false_type type;
+};
+
+template<typename T>
+struct meta_is_same<T,T> {
+ enum {value = true};
+ typedef true_type type;
+};
+
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