Geophysical Inversion and Modelling Library v1.5.4
Loading...
Searching...
No Matches
kdtreeWrapper.h
1/******************************************************************************
2 * Copyright (C) 2006-2024 by the GIMLi development team *
3 * Carsten Rücker carsten@resistivity.net *
4 * *
5 * Licensed under the Apache License, Version 2.0 (the "License"); *
6 * you may not use this file except in compliance with the License. *
7 * You may obtain a copy of the License at *
8 * *
9 * http://www.apache.org/licenses/LICENSE-2.0 *
10 * *
11 * Unless required by applicable law or agreed to in writing, software *
12 * distributed under the License is distributed on an "AS IS" BASIS, *
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
14 * See the License for the specific language governing permissions and *
15 * limitations under the License. *
16 * *
17 ******************************************************************************/
18
19#ifndef _GIMLI_KDTREEWRAPPER__H
20#define _GIMLI_KDTREEWRAPPER__H
21
22#include "gimli.h"
23
24#include <iostream>
25
26#ifdef _MSC_VER
27 // warning from kdtree
28 #pragma warning( disable: 4396)
29#endif
30
31//#define KDTREE_DEFINE_OSTREAM_OPERATORS
32#include <kdtree++/kdtree.hpp>
33
35 typedef double result_type;
36 result_type operator()(GIMLI::Node * n, size_t i) const;
37};
38
40
41namespace GIMLI{
42
44
47public:
50
53
55 void insert( Node * node );
56
58 Node * nearest( const RVector3 & pos );
59
61 uint size( ) const;
62
64 NodeKDTree * tree();
65
66protected:
67 NodeKDTree * tree_;
68};
69
70} // namespace GIMLI
71
72#endif // _GIMLI_KDTREEWRAPPER__H
Node * nearest(const RVector3 &pos)
Definition kdtreeWrapper.cpp:46
void insert(Node *node)
Definition kdtreeWrapper.cpp:42
~KDTreeWrapper()
Definition kdtreeWrapper.cpp:38
NodeKDTree * tree()
Definition kdtreeWrapper.cpp:55
uint size() const
Definition kdtreeWrapper.cpp:51
KDTreeWrapper()
Definition kdtreeWrapper.cpp:33
3D Node
Definition node.h:39
GIMLi main namespace for the Geophyiscal Inversion and Modelling Library.
Definition baseentity.h:24
Definition kdtreeWrapper.h:34