1 #ifndef PMPL_KDTREE_NF_H_
2 #define PMPL_KDTREE_NF_H_
6 #include <CGAL/Cartesian_d.h>
7 #include <CGAL/Search_traits.h>
8 #include <CGAL/Orthogonal_k_neighbor_search.h>
66 typedef CGAL::Cartesian_d<double> Kernel;
70 struct PointD :
public Kernel::Point_d {
72 PointD() : Kernel::Point_d() {}
77 PointD(
const VID _vid,
const Cfg& _cfg) :
78 Kernel::Point_d(_cfg.
DOF(), _cfg.
GetData().begin(),
79 _cfg.
GetData().end()), vid(_vid)
87 typedef CGAL::Search_traits<Kernel::FT,
89 Kernel::Cartesian_const_iterator_d,
90 Kernel::Construct_cartesian_const_iterator_d
94 typedef CGAL::Orthogonal_k_neighbor_search<TreeTraits> NeighborSearch;
97 typedef typename NeighborSearch::Tree KdTree;
101 typedef std::pair<RoadmapType*, const VertexSet*> ModelKey;
122 virtual void Print(std::ostream& _os)
const override;
156 double m_epsilon{0.};
158 std::map<ModelKey, KdTree> m_trees;
160 std::unique_ptr<KdTree> m_tmpTree;
#define INVALID_VID
Definition: GenericStateGraph.h:23
Definition: CCTracker.h:36
const std::vector< double > & GetData() const noexcept
Definition: Cfg.cpp:489
size_t DOF() const noexcept
Definition: Cfg.cpp:438
Definition: GenericStateGraph.h:67
STAPLGraph::vertex_descriptor VID
Definition: GenericStateGraph.h:83
STAPLGraph::vertex_iterator VI
Definition: GenericStateGraph.h:89
std::unordered_set< VID > VertexSet
Definition: GenericStateGraph.h:86
Definition: GroupCfg.h:39
Definition: GroupRoadmap.h:25
Definition: KdTreeNF.h:37
RoadmapType::VertexSet VertexSet
Definition: KdTreeNF.h:46
MPBaseObject::GroupCfgType GroupCfgType
Definition: KdTreeNF.h:49
RoadmapType::VI VI
Definition: KdTreeNF.h:44
RoadmapType::CCTrackerType CCTrackerType
Definition: KdTreeNF.h:47
virtual void FindNeighbors(RoadmapType *const _r, const Cfg &_cfg, const VertexSet &_candidates, OutputIterator _out) override
Definition: KdTreeNF.cpp:50
virtual void Initialize() override
Definition: KdTreeNF.cpp:25
RoadmapType::VID VID
Definition: KdTreeNF.h:45
virtual ~KdTreeNF()=default
virtual void Print(std::ostream &_os) const override
Definition: KdTreeNF.cpp:40
MPBaseObject::RoadmapType RoadmapType
Definition: KdTreeNF.h:43
MPBaseObject::GroupRoadmapType GroupRoadmapType
Definition: KdTreeNF.h:48
KdTreeNF()
Definition: KdTreeNF.cpp:8
Definition: NeighborhoodFinderMethod.h:32
Type
The type of neighbors found.
Definition: NeighborhoodFinderMethod.h:50
std::back_insert_iterator< std::vector< Neighbor > > OutputIterator
Output iterator for writing discovered neighbors to a container.
Definition: NeighborhoodFinderMethod.h:59