10 #include <Eigen/Dense> 41 vector<double>
GeodesicDistances(Eigen::Vector2d source, vector<Eigen::Vector2d> targets);
55 Eigen::Vector2d v1(p1.x, p1.y);
56 Eigen::Vector2d v2(p2.x, p2.y);
57 return (v1 - v2).norm();
63 Eigen::Vector2d v1(p1.x(), p1.y());
64 Eigen::Vector2d v2(p2.x(), p2.y());
65 return (v1 - v2).norm();
71 Eigen::Vector2d v1(p1.x(), p1.y());
72 Eigen::Vector2d v2(p2.x(), p2.y());
76 return (v1 - v2).norm();
87 int source_index = -1;
96 if (source_index == -1){
97 double min_dis = DBL_MAX;
102 if (crt_dis < min_dis){
107 source_index = min_index;
109 if (source_index == -1){
110 cout <<
"source point: " << source.x() <<
" " << source.y() << endl;
111 cout <<
"error in " << __FUNCTION__ <<
", source index cant find, input to exit" << endl;
112 getchar(); getchar(); getchar();
120 Point_2 target(p1.x(), p1.y());
121 int target_index = -1;
130 if (target_index == -1){
131 double min_dis = DBL_MAX;
136 if (crt_dis < min_dis){
141 target_index = min_index;
143 if (target_index == -1){
144 cout <<
"task point: " << target.x() <<
" " << target.y() << endl;
145 cout <<
"error in " << __FUNCTION__ <<
", task index cant find, input to exit" << endl;
146 getchar(); getchar(); getchar();
154 for (
int i = 0; i < path_result.size(); i++)
155 path.push_back(
Point_2(path_result[i].Get3DPoint(m_model).x, path_result[i].Get3DPoint(m_model).y));
156 if (
ceil(path.front().x()) !=
ceil(p0.x()) ||
ceil(path.front().y()) !=
ceil(p0.y()))
158 if (
ceil(path.back().x()) !=
ceil(p1.x()) ||
ceil(path.back().y()) !=
ceil(p1.y()))
160 return distance_result;
167 vector<Point_2> t(targets.size());
168 for (
int idx = 0; idx < targets.size(); idx++)
169 t[idx] =
Point_2(targets[idx].x(), targets[idx].y());
180 vector<double> stDistances;
181 for (
int tid = 0; tid < targets.size(); tid++)
182 stDistances.push_back(0);
189 int source_index = -1;
198 if (source_index == -1){
199 double min_dis = DBL_MAX;
204 if (crt_dis < min_dis){
209 source_index = min_index;
211 if (source_index == -1)
213 cerr <<
"source point: " << source.x() <<
" " << source.y() << endl;
214 cerr <<
"error in " << __FUNCTION__ <<
", source index cant find, input to exit" << endl;
215 getchar(); getchar(); getchar();
225 for (
int tid = 0; tid < targets.size(); tid++)
228 Point_2 target(targets[tid].x(), targets[tid].y());
229 int target_index = -1;
238 if (target_index == -1){
239 double min_dis = DBL_MAX;
244 if (crt_dis < min_dis){
249 target_index = min_index;
251 if (target_index == -1)
253 cerr <<
"task point: " << target.x() <<
" " << target.y() << endl;
254 cerr <<
"error in " << __FUNCTION__ <<
", target index can't find, input to exit" << endl;
255 getchar(); getchar(); getchar();
283 Point_2 source(p0.x(), p0.y());
284 int source_index = -1;
293 if (source_index == -1){
294 double min_dis = DBL_MAX;
299 if (crt_dis < min_dis){
304 source_index = min_index;
306 if (source_index == -1){
307 cout <<
"source point: " << source.x() <<
" " << source.y() << endl;
308 cout <<
"error in " << __FUNCTION__ <<
", source index cant find, input to exit" << endl;
309 getchar(); getchar(); getchar();
317 Point_2 target(p1.x(), p1.y());
318 int target_index = -1;
327 if (target_index == -1){
328 double min_dis = DBL_MAX;
333 if (crt_dis < min_dis){
338 target_index = min_index;
340 if (target_index == -1){
341 cout <<
"task point: " << target.x() <<
" " << target.y() << endl;
342 cout <<
"error in " << __FUNCTION__ <<
", task index cant find, input to exit" << endl;
343 getchar(); getchar(); getchar();
348 return distance_result;
vector< CPoint3D > m_Verts
void get_geodesic_distance_fast_initialization()
vector< double > GeodesicDistances(Eigen::Vector2d source, vector< Eigen::Vector2d > targets)
const std::string cdt_obj_path
double distanceField[map_rows][map_cols]
double get_euclidean_distance(Point_2 p1, Point_2 p2)
const vector< double > & GetDistanceField() const
CRichModel * m_geodesic_domain
int m_geodesic_domain_version
double get_geodesic_distance(Point_2 p0, Point_2 p1, vector< Point_2 > &path)
virtual vector< EdgePoint > BacktraceShortestPath(int end) const
int GetNumOfVerts() const
double get_geodesic_distance_fast(Point_2 p0, Point_2 p1)
vector< double > getGeodesicDistances(Point_2 source, vector< Point_2 > targets)
EIGEN_DEVICE_FUNC const CeilReturnType ceil() const