Point>> get=graphAction_step(b,.get(i).size(),.get(i).get(packs.get(i).size()/2),,pt_last,defColour,dx,dy,stack+1,false,tmp_ways);(get !=Null) {> out=new ArrayList (); (int j=0; j trace_tmp=new ArrayList (); _tmp.addAll (trace); _tmp.addAll (get.get (j));. add (trace_tmp);
}. addAll (out);
}
} (end.isEmpty ()) {null;
} end;
} > tmp; (iterations == 1 && previous!=null) {= getNextPoint_vectorAngelCriterion (packs, new Point (pt.x - previous.x, pt.y - previous.y), - 2, pt); (tmp == null) {= new ArrayList ();
}
} else {= packs;
}
(! tmp.isEmpty ()) {(tmp.get (0). size ()> width) {+ +; -;
} else {best=(tmp.get (0). size () - 1) / 2; old_pt=pt;
/ / find the best point-> s=- 3; pVx=pt_last.x - pt.x; pVy=pt_last.y - pt.y; pL=sqrt (pow (pVx, 2) + pow (pVy, 2)); (int j=0; j
((double) pVy / pL) * ((double) cVy / cL); (s_tmp>=s) {= s_tmp;=j;
}
}
/ / <-find the best point
=tmp.get (0). get (best);. add (new Point (old_pt.x + dx, old_pt.y + dy));=old_pt;
}
} else {= null;
}
}
} null;
}
boolean isPtInBImg (BufferedImage bimage, int x, int y) {! (x <0 | | y <0 | | x> (bimage.getWidth () - 1) | | y> (bimage . getHeight () - 1));
}
Point toInitCord (Point in) {
=new Point ((int) (in.x + x_init), (int) (in.y + y_init)); w=(int) image_w; h=(int) image_h;
Dimension dim=this.getSize ();
double z=pow (0.9, zoom); sx=1; sy=1; (w> dim.width | h> dim.height) {= dim.width / (double) w; =dim.height / (double) h;
}
double x_c=(dim.width) / 2; y_c=(dim.height) / 2;
double zx=1 / (z * sx);
double zy=1 / (z * sy);
z_x_ord=(in.x - x_c) * zx + x_c; z_y_ord=- (- (in.y) + y_c) * zy + y_c;
out=new Point ((int) (z_x_ord), (int) (z_y_ord));
(); out;
}
List > getNextPoint_vectorAngelCriterion (List > packs, Point vect, double minScal, Point pt) {(packs == null | | packs.isEmpty ()) {
return null;
} > result=null; > out=new ArrayList ();
if (vect!=null) {
double scalar=- 2; (int i=0; i
pL=sqrt (pow (pVx, 2) + pow (pVy, 2));
/ / find the best point-> (int j=0; j