27 #include "../Rocmap/include/kdtree_d.h"
37 using Point_3::operator[];
46 typedef CGAL::Kdtree_d<KD_interface>
KD_tree;
47 typedef KD_tree::Box
box;
53 const Real w2e_ratio = 1;
54 const Real d2e_ratio_sq = 1;
56 std::list<Feature_0> &bf0 =
B->
flist_0();
57 std::list<Feature_0> &gf0 =
G->
flist_0();
59 std::vector< Point_3_ref> gf0_1;
60 gf0_1.reserve( gf0.size());
61 for ( std::list<Feature_0>::iterator it=gf0.begin(); it!=gf0.end(); ++it)
62 gf0_1.push_back(
Point_3_ref( it->point(), it->vertex()));
65 KD_tree kdtree(3); kdtree.build( gf0_1);
70 for ( std::list<Feature_0>::iterator
71 it=bf0.begin(),
iend=bf0.end(); it !=
iend; ++it) {
85 const Vector_3 vtol(tol*w2e_ratio, tol*w2e_ratio, tol*w2e_ratio);
86 KD_tree::Box
box( p-vtol, p+vtol, 3);
88 std::vector< Point_3_ref> outList; outList.reserve(2);
89 kdtree.search( std::back_inserter( outList), box);
92 Real dist_min = HUGE_VAL;
95 for (
int i=0,
n = outList.size();
i<
n; ++
i) {
96 Real d=(p-
reinterpret_cast<const Point_3&
>(outList[
i])).squared_norm();
102 if ( dist_min<HUGE_VAL) {
114 if ( dist_min < s*d2e_ratio_sq) {
116 std::cout <<
"Matched\t blue vertex "
119 <<
"\n with\t green vertex "
146 std::cout <<
"\nRocface Warning: Dropping blue corner vertex "
149 <<
" at " << p << std::endl;
158 std::cout <<
"Dropped " << dropped <<
" corners in \"" <<
B->
name()
159 <<
"\" after feature matching" << std::endl;
164 for ( std::list<Feature_0>::iterator
165 it=gf0.begin(),
iend=gf0.end(); it !=
iend; ++it) {
170 std::cout <<
"\nRocface Warning: Dropping green corner vertex "
173 <<
" at " << v->
point() << std::endl;
183 std::cout <<
"Dropped " << dropped <<
" corners in \"" <<
G->
name()
184 <<
"\" after feature matching" << std::endl;
std::string name() const
The name of the window.
Vertex * get_origin(Halfedge *h) const
Halfedge * get_next(Halfedge *h) const
Point_3_ref(const Point_3 &r, Overlay::Vertex *v=NULL)
Feature_list_0::iterator remove_feature_0(Feature_list_0::iterator i)
Remove the given 0-feature from the list.
Halfedge * get_opposite(Halfedge *h) const
RFC_Pane_overlay * get_pane(Vertex *v) const
Overlay::Vertex * vertex() const
INode * get_inode(Vertex *v) const
Halfedge * get_halfedge(Vertex *v) const
Vertex_overlay * origin()
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Point object that represents a single point.
bool snap_on_features() const
#define RFC_END_NAME_SPACE
CGAL::Kdtree_interface< Point_3_ref > KD_interface
const Point & point() const
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode iend
Feature_list_0 & flist_0()
#define RFC_BEGIN_NAME_SPACE
CGAL::Kdtree_d< KD_interface > KD_tree
Real sq_length(const Halfedge &h) const
HDS_accessor< Tag_true > acc
int get_index(const Vertex *v) const
Halfedge * get_next_around_origin(Halfedge *h) const
void insert_node_in_blue_edge(INode &x, Halfedge *b)
Halfedge * get_next_around_destination(Halfedge *h) const
Some basic geometric data types.
bool is_border(const Halfedge *h) const
void set_parent(Halfedge *h, const Point_2 &p, int color)
SURF::Vector_2< Real > Point_2