Go to the documentation of this file.00001
00059
00060
00061
00062
00063
00064
00065
00066 #ifndef NODE_H_
00067 #define NODE_H_
00068
00069
00070 #include "way.h"
00071 #include "../curved_polygons/bb.h"
00072
00073 namespace Slam
00074 {
00075
00082
00083 template<typename OBJECT_CONTEXT>
00084 class Node
00085 {
00086 public:
00087 typedef typename OBJECT_CONTEXT::DOF6 DOF6;
00088 typedef OBJECT_CONTEXT OBJCTXT;
00089 typedef typename OBJCTXT::OBJECT OBJECT;
00090
00091 typedef boost::shared_ptr<Node> Ptr;
00092
00093 private:
00094
00095 std::vector<SWAY<Node> > connections_;
00096 OBJCTXT ctxt_;
00097
00098 bool _register(const OBJCTXT &ctxt, DOF6 &link, std::map<typename OBJECT::Ptr,bool> &used, std::map<const Node*,bool> &_visited_list_, const bool only_merge=false, const int depth=0);
00099 void _merge(const OBJCTXT &ctxt, const DOF6 &link, std::map<typename OBJECT::Ptr,bool> &used, std::map<const Node*,bool> &_visited_list_, const bool only_merge=false, const int depth=0);
00100
00101 public:
00102
00103 void addLink(const SWAY<Node> &con) {
00104 connections_.push_back(con);
00105 }
00106
00107 bool registration(const OBJCTXT &ctxt, DOF6 &tf, typename DOF6::TYPE &probability_success_rate, typename DOF6::TYPE &probability_error_rate);
00108 bool merge(const OBJCTXT &ctxt, const DOF6 &tf, std::map<typename OBJECT::Ptr,bool> &used, const BoundingBox::TransformedFoVBB &fov, const bool only_merge);
00109
00110 bool addCtxt(const OBJCTXT &ctxt, const DOF6 &tf);
00111
00112 size_t getNumObjs() const {return ctxt_.getNumObjs();}
00113
00114 const std::vector<SWAY<Node> > &getConnections() const {return connections_;}
00115
00116 const OBJECT_CONTEXT &getContext() const {return ctxt_;}
00117
00118 bool compute(const OBJCTXT &ctxt, DOF6 &link, std::map<typename OBJECT::Ptr,bool> &used, std::map<const Node*,bool> &_visited_list_, const bool only_merge=false, const int depth=0);
00119 };
00120
00121 #include "impl/node.hpp"
00122
00123 }
00124
00125
00126 #endif