Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52058 - in sandbox-branches/andreo/guigl/libs/guigl: build/vc8ide example example/autogeo
From: andreytorba_at_[hidden]
Date: 2009-03-30 12:23:10


Author: andreo
Date: 2009-03-30 12:23:09 EDT (Mon, 30 Mar 2009)
New Revision: 52058
URL: http://svn.boost.org/trac/boost/changeset/52058

Log:
autogeo
Added:
   sandbox-branches/andreo/guigl/libs/guigl/build/vc8ide/autogeo.vcproj (contents, props changed)
   sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/functor.hpp (contents, props changed)
Removed:
   sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/node_types.hpp
Text files modified:
   sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/acceptor.hpp | 8
   sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/geometry.cpp | 110 ++++++++++++-----------
   sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/graph.hpp | 184 +++++++++++++++++----------------------
   sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/visitors.hpp | 14 +-
   sandbox-branches/andreo/guigl/libs/guigl/example/pch.hpp | 1
   5 files changed, 149 insertions(+), 168 deletions(-)

Added: sandbox-branches/andreo/guigl/libs/guigl/build/vc8ide/autogeo.vcproj
==============================================================================
--- (empty file)
+++ sandbox-branches/andreo/guigl/libs/guigl/build/vc8ide/autogeo.vcproj 2009-03-30 12:23:09 EDT (Mon, 30 Mar 2009)
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="autogeo"
+ ProjectGUID="{AC3E72D9-A1F8-4D85-B040-6C021CE9CAB7}"
+ RootNamespace="example"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="debug|Win32"
+ OutputDirectory="..\..\..\..\bin\stage\window_example"
+ IntermediateDirectory="$(OutDir)"
+ ConfigurationType="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="bjam --v2 ../../example/$(ProjectName) $(ConfigurationName)"
+ ReBuildCommandLine="bjam --v2 -a ../../example/$(ProjectName) $(ConfigurationName)"
+ CleanCommandLine="bjam --v2 --clean ../../example/$(ProjectName) $(ConfigurationName)"
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath="D:\Libraries\ggl\boost\ggl;D:\Libraries\ggl"
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="release|Win32"
+ OutputDirectory="..\..\..\..\bin\stage\window_example"
+ IntermediateDirectory="$(OutDir)"
+ ConfigurationType="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="bjam --v2 ../../$(ProjectName) $(ConfigurationName)"
+ ReBuildCommandLine="bjam --v2 -a ../../$(ProjectName) $(ConfigurationName)"
+ CleanCommandLine="bjam --v2 --clean ../../$(ProjectName) $(ConfigurationName)"
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath="D:\Libraries\ggl\boost\ggl;D:\Libraries\ggl"
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\example\autogeo\acceptor.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\example\autogeo\functor.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\example\autogeo\geometry.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\example\autogeo\geometry.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\example\autogeo\graph.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\example\autogeo\Jamfile"
+ >
+ </File>
+ <File
+ RelativePath="..\..\example\autogeo\visitors.hpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Modified: sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/acceptor.hpp
==============================================================================
--- sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/acceptor.hpp (original)
+++ sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/acceptor.hpp 2009-03-30 12:23:09 EDT (Mon, 30 Mar 2009)
@@ -10,7 +10,7 @@
   {
   public:
     virtual ~IAcceptor() {}
- virtual void accept(int key, IVisitor const& v) = 0;
+ virtual void accept(IVisitor const& v) = 0;
   };
 
 template<class T>
@@ -20,9 +20,9 @@
   {
   public:
     explicit Acceptor(T const& obj) : T(obj) {}
- void accept(int key, IVisitor const& v){
+ void accept(IVisitor const& v){
       T& obj = *this;
- v.visit(key, obj);
+ v.visit(obj);
       }
 
     typedef typename T::result_type result_type;
@@ -41,7 +41,7 @@
   accept_each(IVisitor const& v):visitor(v){}
 
   template<class T>
- void operator()(T& obj) const {obj.second->accept(obj.first, visitor);}
+ void operator()(T& obj) const {obj.second->accept(visitor);}
   };
 
 #endif

Added: sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/functor.hpp
==============================================================================
--- (empty file)
+++ sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/functor.hpp 2009-03-30 12:23:09 EDT (Mon, 30 Mar 2009)
@@ -0,0 +1,94 @@
+#ifndef BOOST_GUIGL_EXAMPLE_FUNCTORS_HPP
+#define BOOST_GUIGL_EXAMPLE_FUNCTORS_HPP
+
+#include <boost/guigl/types.hpp>
+#include <boost/array.hpp>
+#include <boost/ref.hpp>
+#include <boost/tuple/tuple.hpp>
+
+#include <geometry/geometries/polygon.hpp>
+#include <boost/guigl/ggl.hpp>
+
+template<class T>
+struct SmartResult
+ {
+ typedef T result_type;
+
+ int id;
+ result_type result;
+
+ explicit SmartResult(int id_):id(id_), result(){}
+ explicit SmartResult(int id_, T const& r):id(id_), result(r){}
+ };
+
+struct EmptyData {};
+
+template<class Result, class Args, class Data = EmptyData>
+struct Functor : public SmartResult<Result>
+ {
+ typedef Data data_type;
+ typedef Args args_type;
+
+ Args args;
+ Data data;
+
+ Functor(int id, Args const& args_, Data const& data_)
+ : SmartResult<Result>(id), args(args_), data(data_) {}
+ };
+
+template<std::size_t N, class HT, class TT>
+inline typename boost::tuples::access_traits<typename boost::tuples::element<N, boost::tuples::cons<HT, TT> >::type>::const_type&
+arg(boost::tuples::cons<HT, TT> const& t)
+ {
+ return boost::get<i>(t.args);
+ }
+
+template<std::size_t N, class HT, class TT>
+inline typename boost::tuples::access_traits<typename boost::tuples::element<N, boost::tuples::cons<HT, TT> >::type>::non_const_type&
+arg(boost::tuples::cons<HT, TT>& t)
+ {
+ return boost::get<i>(t.args);
+ }
+
+//template<std::size_t N, class HT, class TT>
+//inline typename boost::tuples::access_traits<typename boost::tuples::element<N, boost::tuples::cons<HT, TT> >::type>::const_type::result_type&
+//result(boost::tuples::cons<HT, TT> const& t)
+// {
+// return arg<N>(t).result;
+// }
+//
+//template<std::size_t N, class HT, class TT>
+//inline typename boost::tuples::access_traits<typename boost::tuples::element<N, boost::tuples::cons<HT, TT> >::type>::non_const_type::result_type&
+//result(boost::tuples::cons<HT, TT>& t)
+// {
+// return arg<N>(t).result;
+// }
+
+
+typedef double distance_type;
+typedef boost::guigl::position_type point_type;
+typedef boost::guigl::position_type vector_type;
+typedef boost::guigl::segment_type line_type;
+typedef geometry::polygon<point_type> plane_type;
+
+typedef SmartResult<point_type> const& SmartPoint;
+typedef SmartResult<line_type> const& SmartLine;
+typedef SmartResult<plane_type> const& SmartPlane;
+
+typedef
+Functor<point_type, boost::tuple<>, point_type>
+source_point;
+
+typedef
+Functor<line_type, boost::tuple<SmartPoint, SmartPoint> >
+line_from_two_points;
+
+//typedef
+//Functor<line_type, boost::tuple<SmartPoint, SmartVector, SmartDistance> >
+//line_from_point_vector_distance;
+
+typedef
+Functor<plane_type, boost::tuple<SmartPoint, SmartPoint, SmartPoint> >
+plane_from_three_points;
+
+#endif // BOOST_GUIGL_EXAMPLE_FUNCTORS_HPP

Modified: sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/geometry.cpp
==============================================================================
--- sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/geometry.cpp (original)
+++ sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/geometry.cpp 2009-03-30 12:23:09 EDT (Mon, 30 Mar 2009)
@@ -34,23 +34,23 @@
 
 using namespace boost::guigl;
 
-class RenderVisitor : public IVisitor
+class Renderer : public IVisitor
   {
   public:
- void visit(int key, source_point& g) const
+ void operator()(SmartResult<point_type>& g) const
       {
       gl::color(blue(0.7f));
       ggl::draw(g.result);
       }
 
- void visit(int key, line_from_two_points& g) const
+ void operator()(SmartResult<line_type>& g) const
       {
       gl::line_width(4);
       gl::color(red(0.8f));
       ggl::draw(g.result);
       }
 
- void visit(int key, plane_from_three_points& g) const
+ void operator()(SmartResult<plane_type>& g) const
       {
       gl::color(green(0.5f));
       glBegin(GL_POLYGON);
@@ -66,30 +66,41 @@
 class RecomputeVisitor : public IVisitor
   {
   public:
- void visit(int key, line_from_two_points& g) const
+ void visit(source_point& o) const
       {
- g.result = line_type(g.pt1, g.pt2);
+ o.result = o.data;
+
+ point_type const* p = &o.result;
+ };
+
+ void visit(line_from_two_points& o) const
+ {
+ o.result.first = arg<0>(o).result;
+ o.result.second = arg<1>(o).result;
       };
 
- void visit(int key, plane_from_three_points& g) const
+ void visit(plane_from_three_points& o) const
       {
       using namespace boost::assign;
- g.result.outer().clear();
- g.result.outer() += g.pt1, g.pt2, g.pt3;
- geometry::correct(g.result);
+ o.result.outer().clear();
+ o.result.outer() +=
+ arg<1>(o).result,
+ arg<2>(o).result,
+ arg<3>(o).result;
+ geometry::correct(o.result);
       };
   };
 
 struct StreamWriter
   {
   template<class T>
- void operator()(int key, T& g) const
+ void operator()(T& g) const
     {
     std::cout << g.result << std::endl;
     }
 
   template<>
- void operator()<line_from_two_points>(int key, line_from_two_points& g) const
+ void operator()<line_from_two_points>(line_from_two_points& g) const
     {
     geometry::linestring<point_type> s;
     geometry::append(s, g.result.first);
@@ -103,13 +114,13 @@
 struct StreamByTag
   {
   template<class T>
- void operator()(int key, T& g) const
+ void operator()(T& g) const
     {
     return ;
     }
 
   template<>
- void operator()<Tag>(int key, Tag& g) const
+ void operator()<Tag>(Tag& g) const
     {
     std::cout << g.result << std::endl;
     }
@@ -137,11 +148,11 @@
 struct PrintDescription
   {
   std::map<int, std::string> const& descriptions;
- dependency_graph const& g;
+ DependencyGraph const& g;
 
   PrintDescription(
     std::map<int, std::string> const& descriptions_,
- dependency_graph const& g_)
+ DependencyGraph const& g_)
     :descriptions(descriptions_), g(g_) {}
 
   template<class T>
@@ -179,13 +190,13 @@
   // }
 
   template<class T>
- void operator()(int key, T const& obj) const
+ void operator()(T const& obj) const
     {
- boost::optional<int> i = g.get_key(key);
- if(!i) return ;
+ //boost::optional<int> i = g.get_key(key);
+ //if(!i) return ;
 
- point_type center = get_center(obj.result);
- drawString(descriptions.find(*i)->second.c_str(), center.x + 10, center.y, grey(0.1f), GLUT_BITMAP_8_BY_13);
+ //point_type center = get_center(obj.result);
+ //drawString(descriptions.find(*i)->second.c_str(), center.x + 10, center.y, grey(0.1f), GLUT_BITMAP_8_BY_13);
     }
   };
 
@@ -193,7 +204,7 @@
 
 struct drawer {
   typedef boost::shared_ptr<IAcceptor> IAcceptorPtr;
- dependency_graph g;
+ DependencyGraph g;
   std::map<int, std::string> names;
 
   void init_geometry_graph();
@@ -216,11 +227,6 @@
     {
     using namespace boost::assign;
 
- typedef GraphVertex<int, point_type> Point;
- typedef GraphVertex<int, line_type> Line;
- typedef GraphVertex<int, plane_type> Plane;
-
-
     insert(names)
       (middle_notch_point, "middle notch point")
       (femoral_head_point, "femoral head point")
@@ -239,10 +245,10 @@
       g.objects.end(),
       accept_each(RecomputeVisitor()));
 
- std::for_each(
- g.objects.begin(),
- g.objects.end(),
- accept_each(Visitor<StreamWriter>()));
+ //std::for_each(
+ // g.objects.begin(),
+ // g.objects.end(),
+ // accept_each(Visitor<StreamWriter>()));
     }
 
   void operator()() const
@@ -271,7 +277,7 @@
     std::for_each(
       g.objects.begin(),
       g.objects.end(),
- accept_each(RenderVisitor()));
+ accept_each(Visitor<Renderer>()));
 
     std::for_each(
       g.objects.begin(),
@@ -307,30 +313,26 @@
   {
   using namespace boost::assign;
 
- typedef GraphVertex<int, point_type> Point;
- typedef GraphVertex<int, line_type> Line;
- typedef GraphVertex<int, plane_type> Plane;
-
- Point
- pt_mnp = g.make_source_point(middle_notch_point, point_type(90, 90)),
- pt_fh = g.make_source_point(femoral_head_point, point_type(-90, -90)),
- pt_laepi = g.make_source_point(lateral_epi_point, point_type(90, -90)),
- pt_meepi = g.make_source_point(medial_epi_point, point_type(0, -180));
-
- ////Point
- //// pt_mnp = g.make_indicatable_point(middle_notch_point);
-
- Line
- ax_mech = g.make_line(mechanical_axis, pt_mnp, pt_fh),
- ax_epi = g.make_line(epi_axis, pt_meepi, pt_laepi);
+ boost::make_tuple(1).get<0>();
+
+ SmartPoint
+ pt_mnp = make_source_point(g, point_type(90, 90)),
+ pt_fh = make_source_point(g, point_type(-90, -90)),
+ pt_laepi = make_source_point(g, point_type(90, -90)),
+ pt_meepi = make_source_point(g, point_type(0, -180));
 
- Plane
- pl_axial = g.make_plane(axial_plane, pt_mnp, pt_fh, pt_laepi);
+ SmartLine
+ ax_mech = make_line(g, pt_mnp, pt_fh),
+ ax_epi = make_line(g, pt_meepi, pt_laepi);
 
- Point pt1 = g.make_source_point(point1, point_type(120, 30));
+ SmartPlane
+ pl_axial = make_plane(g, pt_mnp, pt_fh, pt_laepi);
 
- g.make_plane(
- g.make_source_point(point_type(-90, 90)),
+ SmartPoint pt1 = make_source_point(g, point_type(120, 30));
+
+ make_plane(g,
+ make_source_point(g, point_type(-90, 90)),
     pt1,
     pt_mnp);
- }
\ No newline at end of file
+
+ }

Modified: sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/graph.hpp
==============================================================================
--- sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/graph.hpp (original)
+++ sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/graph.hpp 2009-03-30 12:23:09 EDT (Mon, 30 Mar 2009)
@@ -1,130 +1,108 @@
 #ifndef BOOST_GUIGL_EXAMPLE_GRAPH_HPP
 #define BOOST_GUIGL_EXAMPLE_GRAPH_HPP
 
-#include "node_types.hpp"
+#include "functor.hpp"
 
 #include <boost/graph/graph_traits.hpp>
 #include <boost/graph/adjacency_list.hpp>
-//#include <boost/graph/dijkstra_shortest_paths.hpp>
+#include <boost/tuple/tuple.hpp>
+#include <boost/ref.hpp>
 
-template<class Key, class T>
-class GraphVertex
+template<class T1, class T2, class F>
+inline void for_each(boost::tuples::cons<T1, T2>& t, F const& f)
   {
- public:
- Key key;
- boost::shared_ptr<base_result<T> > obj;
+ f(t.head);
+ for_each(t.tail, f);
+ }
+
+template<class T1, class F>
+inline void for_each(boost::tuples::cons<T1, boost::tuples::null_type>& t, F const& f) {
+ f(t.head);
+ }
 
- GraphVertex(
- Key key_,
- boost::shared_ptr<base_result<T> > const& obj_)
- :key(key_), obj(obj_) {}
- };
+template<class F>
+inline void for_each(boost::tuple<>& t, F const& f) {}
 
+template<class T1, class T2, class F>
+inline void for_each(boost::tuples::cons<T1, T2> const& t, F const& f)
+ {
+ f(t.head);
+ for_each(t.tail, f);
+ }
+
+template<class T1, class F>
+inline void for_each(boost::tuples::cons<T1, boost::tuples::null_type> const& t, F const& f) {
+ f(t.head);
+ }
 
-class dependency_graph
+template<class F>
+inline void for_each(boost::tuple<> const& t, F const& f) {}
+
+class DependencyGraph
   {
   public:
     std::map<int, boost::shared_ptr<IAcceptor> > objects;
- std::map<int, int> key_map;
 
   public:
     typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS> Graph;
-
     Graph g;
 
- boost::shared_ptr<IAcceptor> get(int key)
- {
- return objects[key_map[key]];
+ struct edge_creator {
+ int v;
+ Graph& g;
+ edge_creator(int v_, Graph& g_):v(v_), g(g_){}
+ template<class T>
+ void operator()(SmartResult<T> const& r) const { boost::add_edge(r.id, v, g);}
+ };
+
+ template<class F>
+ SmartResult<typename F::result_type> const& add_functor(
+ typename F::args_type const& args,
+ typename F::data_type const& data = F::data_type())
+ {
+ boost::shared_ptr<Acceptor<F> >
+ obj(new Acceptor<F>(F(boost::add_vertex(g), args, data)));
+ for_each(args, edge_creator(obj->id, g));
+ objects[obj->id] = obj;
+ SmartResult<typename F::result_type> const& r = *obj;
+ return r;
       }
 
- int add_vertex(boost::shared_ptr<IAcceptor> const& ptr)
- {
- int v = boost::add_vertex(g);
- objects[v] = ptr;
- return v;
- }
-
- void add_key(int key, int v)
- {
- if(key_map.end() != key_map.find(key))
- throw std::runtime_error("vertex already exists");
- key_map[key] = v;
- }
-
- boost::optional<int> get_key(int v) const
- {
- typedef std::pair<int, int> pair_type;
- BOOST_FOREACH(pair_type const& p, key_map)
- if(p.second == v)
- return p.first;
- return boost::optional<int>();
- }
-
- GraphVertex<int, point_type> make_source_point(point_type const& pt)
- {
- boost::shared_ptr<Acceptor<source_point> >
- obj(new Acceptor<source_point>(source_point(pt)) );
- int v = add_vertex(obj);
- return GraphVertex<int, point_type>(v, obj);
- }
-
- GraphVertex<int, point_type> make_source_point(int key, point_type const& pt)
- {
- GraphVertex<int, point_type> result = make_source_point(pt);
- add_key(key, result.key);
- return result;
- }
-
- GraphVertex<int, line_type> make_line(
- GraphVertex<int, point_type> const& pt1,
- GraphVertex<int, point_type> const& pt2)
- {
- boost::shared_ptr<Acceptor<line_from_two_points> >
- obj(new Acceptor<line_from_two_points>(line_from_two_points(pt1.obj->result, pt2.obj->result)) );
-
- int v = add_vertex(obj);
-
- boost::add_edge(pt1.key, v, g);
- boost::add_edge(pt2.key, v, g);
-
- return GraphVertex<int, line_type>(v, obj);
- }
-
- GraphVertex<int, line_type> make_line(int key,
- GraphVertex<int, point_type> const& pt1,
- GraphVertex<int, point_type> const& pt2)
- {
- GraphVertex<int, line_type> result = make_line(pt1, pt2);
- add_key(key, result.key);
- return result;
- }
+ };
 
- GraphVertex<int, plane_type> make_plane(
- GraphVertex<int, point_type> const& pt1,
- GraphVertex<int, point_type> const& pt2,
- GraphVertex<int, point_type> const& pt3)
- {
- boost::shared_ptr<Acceptor<plane_from_three_points> >
- obj(new Acceptor<plane_from_three_points>(plane_from_three_points(pt1.obj->result, pt2.obj->result, pt3.obj->result)) );
+ SmartPoint make_source_point(DependencyGraph& g, point_type const& pt)
+ {
+ return g.add_functor<source_point>(boost::make_tuple(), pt);
+ }
 
- int v = add_vertex(obj);
+#define FUNCTOR_IMPL_1(FunctionName, F, T1)\
+ SmartResult<typename F::result_type> const& FunctionName(DependencyGraph& g,\
+ SmartResult<T1> const& arg1)\
+ {\
+ return g.add_functor<F>(boost::make_tuple(boost::cref(arg1)));\
+ }
+
+#define FUNCTOR_IMPL_2(FunctionName, F, T1, T2)\
+ SmartResult<typename F::result_type> const& FunctionName(DependencyGraph& g,\
+ SmartResult<T1> const& arg1,\
+ SmartResult<T2> const& arg2)\
+ {\
+ return g.add_functor<F>(boost::make_tuple(boost::cref(arg1), boost::cref(arg2)));\
+ }
+
+#define FUNCTOR_IMPL_3(FunctionName, F, T1, T2, T3)\
+ SmartResult<typename F::result_type> const& FunctionName(DependencyGraph& g,\
+ SmartResult<T1> const& arg1,\
+ SmartResult<T2> const& arg2,\
+ SmartResult<T3> const& arg3)\
+ {\
+ return g.add_functor<F>(\
+ boost::make_tuple(boost::cref(arg1), boost::cref(arg2), boost::cref(arg3)));\
+ }
 
- boost::add_edge(pt1.key, v, g);
- boost::add_edge(pt2.key, v, g);
- boost::add_edge(pt3.key, v, g);
+FUNCTOR_IMPL_2(make_line, line_from_two_points, point_type, point_type);
+//FUNCTOR_IMPL_3(make_line, line_from_point_vector_distance, point_type, vector_type, distance_type);
 
- return GraphVertex<int, plane_type>(v, obj);
- }
-
- GraphVertex<int, plane_type> make_plane(int key,
- GraphVertex<int, point_type> const& pt1,
- GraphVertex<int, point_type> const& pt2,
- GraphVertex<int, point_type> const& pt3)
- {
- GraphVertex<int, plane_type> result = make_plane(pt1, pt2, pt3);
- add_key(key, result.key);
- return result;
- }
- };
+FUNCTOR_IMPL_3(make_plane, plane_from_three_points, point_type, point_type, point_type);
 
 #endif

Deleted: sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/node_types.hpp
==============================================================================
--- sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/node_types.hpp 2009-03-30 12:23:09 EDT (Mon, 30 Mar 2009)
+++ (empty file)
@@ -1,48 +0,0 @@
-#ifndef BOOST_GUIGL_EXAMPLE_NODE_TYPES_HPP
-#define BOOST_GUIGL_EXAMPLE_NODE_TYPES_HPP
-
-#include <boost/guigl/types.hpp>
-#include <boost/array.hpp>
-#include <geometry/geometries/polygon.hpp>
-#include <boost/guigl/ggl.hpp>
-
-typedef boost::guigl::position_type point_type;
-typedef boost::guigl::segment_type line_type;
-typedef geometry::polygon<point_type> plane_type;
-
-template<class T>
-struct base_result
- {
- typedef T result_type;
- result_type result;
-
- base_result():result(){}
- explicit base_result(T const& r):result(r){}
- };
-
-struct source_point : public base_result<point_type>
- {
- source_point(point_type const& pt):base_result<point_type>(pt){}
- };
-
-struct line_from_two_points : public base_result<line_type>
- {
- point_type const& pt1, pt2;
-
- line_from_two_points(
- point_type const& pt1_, point_type const& pt2_)
- : pt1(pt1_), pt2(pt2_)
- {}
- };
-
-struct plane_from_three_points : public base_result<plane_type>
- {
- point_type const& pt1, pt2, pt3;
-
- plane_from_three_points(
- point_type const& pt1_, point_type const& pt2_, point_type const& pt3_)
- : pt1(pt1_), pt2(pt2_), pt3(pt3_)
- {}
- };
-
-#endif // BOOST_GUIGL_EXAMPLE_NODE_TYPES_HPP

Modified: sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/visitors.hpp
==============================================================================
--- sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/visitors.hpp (original)
+++ sandbox-branches/andreo/guigl/libs/guigl/example/autogeo/visitors.hpp 2009-03-30 12:23:09 EDT (Mon, 30 Mar 2009)
@@ -1,16 +1,16 @@
 #ifndef BOOST_GUIGL_EXAMPLE_VISITOR_HPP
 #define BOOST_GUIGL_EXAMPLE_VISITOR_HPP
 
-#include "node_types.hpp"
+#include "functor.hpp"
 
 class IVisitor
   {
   public:
     virtual ~IVisitor(){}
 
- virtual void visit(int key, source_point& g) const {}
- virtual void visit(int key, line_from_two_points& g) const {};
- virtual void visit(int key, plane_from_three_points& g) const {};
+ virtual void visit(source_point& g) const {}
+ virtual void visit(line_from_two_points& g) const {};
+ virtual void visit(plane_from_three_points& g) const {};
   };
 
 template<class StaticVisitor>
@@ -22,9 +22,9 @@
   public:
     Visitor(StaticVisitor const& static_visitor = StaticVisitor())
       : m_static_visitor(static_visitor) {}
- void visit(int key, source_point& g) const {m_static_visitor(key, g);}
- void visit(int key, line_from_two_points& g) const {m_static_visitor(key, g);};
- void visit(int key, plane_from_three_points& g) const {m_static_visitor(key, g);};
+ void visit(source_point& g) const {m_static_visitor(g);}
+ void visit(line_from_two_points& g) const {m_static_visitor(g);};
+ void visit(plane_from_three_points& g) const {m_static_visitor(g);};
   };
 
 #endif

Modified: sandbox-branches/andreo/guigl/libs/guigl/example/pch.hpp
==============================================================================
--- sandbox-branches/andreo/guigl/libs/guigl/example/pch.hpp (original)
+++ sandbox-branches/andreo/guigl/libs/guigl/example/pch.hpp 2009-03-30 12:23:09 EDT (Mon, 30 Mar 2009)
@@ -3,3 +3,4 @@
 #include <boost/foreach.hpp>
 #include <boost/bind.hpp>
 #include <boost/bind/placeholders.hpp>
+#include <boost/signal.hpp>
\ No newline at end of file


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