|
@@ -96,7 +96,7 @@ struct vertex_list
|
|
|
|
|
|
void log()
|
|
|
{
|
|
|
- printf("%s",to_string().c_str());
|
|
|
+ log_info("%s",to_string().c_str());
|
|
|
}
|
|
|
|
|
|
|
|
@@ -192,11 +192,11 @@ point base_path::cross(const vertex_list&v, const base_path&o)const
|
|
|
#ifdef __DEBUG__
|
|
|
void log_path(const std::vector<base_path>&path,const vertex_list&v_list)
|
|
|
{
|
|
|
- printf("%s\n","----------------------------------------------------------------");
|
|
|
+ log_info("%s\n","----------------------------------------------------------------");
|
|
|
for(int i=0,len=path.size();i<len;i++)
|
|
|
{
|
|
|
double c=path[i].arg(v_list)/PI*180;
|
|
|
- printf("base_path %.6lf, %03d,(%d,%s),(%d,%s)\n",c,i,path[i][0],v_list[path[i][0]].to_string().c_str(),path[i][1],v_list[path[i][1]].to_string().c_str());
|
|
|
+ log_info("base_path %.6lf, %03d,(%d,%s),(%d,%s)\n",c,i,path[i][0],v_list[path[i][0]].to_string().c_str(),path[i][1],v_list[path[i][1]].to_string().c_str());
|
|
|
}
|
|
|
}
|
|
|
#endif
|
|
@@ -648,7 +648,7 @@ struct graph
|
|
|
|
|
|
line_v lv(v[from],v[to]);
|
|
|
|
|
|
- printf("line:%s\n",lv.to_string().c_str());
|
|
|
+ log_info("line:%s\n",lv.to_string().c_str());
|
|
|
|
|
|
double cos=lv.cos_k();
|
|
|
double sin=lv.sin_k();
|
|
@@ -873,9 +873,9 @@ std::vector<line_v> card_path::find_possible_path(const point&from,double dist)
|
|
|
void test_at_path(card_path&cp,const point&pt)
|
|
|
{
|
|
|
if(cp.is_at_path(pt))
|
|
|
- printf("test (%.3lf,%.3lf) is-at-path:true\n",pt.x,pt.y);
|
|
|
+ log_info("test (%.3lf,%.3lf) is-at-path:true\n",pt.x,pt.y);
|
|
|
else
|
|
|
- printf("test (%.3lf,%.3lf) is-at-path:false\n",pt.x,pt.y);
|
|
|
+ log_info("test (%.3lf,%.3lf) is-at-path:false\n",pt.x,pt.y);
|
|
|
}
|
|
|
|
|
|
void test_find_path(card_path&cp,const point&p1,const point&p2)
|
|
@@ -883,16 +883,16 @@ void test_find_path(card_path&cp,const point&p1,const point&p2)
|
|
|
printf("\nfind-path: from=(%.3lf,%.3lf),to=(%.3lf,%.3lf)\n",p1.x,p1.y,p2.x,p2.y);
|
|
|
std::vector<point> rc=cp.find_path(p1,p2);
|
|
|
for(uint32_t i=0;i<rc.size();i++)
|
|
|
- printf("x=%.3lf,y=%.3lf\n",rc[i].x,rc[i].y);
|
|
|
+ log_info("x=%.3lf,y=%.3lf\n",rc[i].x,rc[i].y);
|
|
|
}
|
|
|
|
|
|
void test_find_poss_path(const card_path&cp ,const point&from)
|
|
|
{
|
|
|
- printf("\nfind-poss_path: from=(%.3lf,%.3lf)\n",from.x,from.y);
|
|
|
+ log_info("\nfind-poss_path: from=(%.3lf,%.3lf)\n",from.x,from.y);
|
|
|
std::vector<line_v> rc=cp.find_possible_path(from,3);
|
|
|
for(uint32_t i=0;i<rc.size();i++)
|
|
|
{
|
|
|
- printf("poss path from=(%.3lf,%.3lf) to=(%.3lf,%.3lf)\n", rc[i][0].x,rc[i][0].y, rc[i][1].x,rc[i][1].y);
|
|
|
+ log_info("poss path from=(%.3lf,%.3lf) to=(%.3lf,%.3lf)\n", rc[i][0].x,rc[i][0].y, rc[i][1].x,rc[i][1].y);
|
|
|
}
|
|
|
}
|
|
|
|