return processPick(picker, apath);
} else if (pickType == 5) {
vtkActor2DCollection coll = ren.GetActors2D();
- coll.InitTraversal();
- vtkActor2D a;
-
- List<vtkActor2D> picked = new ArrayList<vtkActor2D>();
- while ((a = coll.GetNextItem()) != null) {
- double pos[] = a.GetPosition();
- // TODO : width and height do not seem to affect the perceived size of Actor2D.
- // actual size should be fetched from mapper.
- double w = a.GetWidth();
- double h = a.GetHeight();
- int minx = (int)(pos[0]-w*0.5);
- int miny = (int)(pos[1]-h*0.5);
- int maxx = (int)(pos[0]+w*0.5);
- int maxy = (int)(pos[1]+h*0.5);
- if (minx <= ax && maxx >= ax &&
- miny <= ay && maxy >= ay) {
- picked.add(a);
- }
- }
- return picked.toArray(new vtkProp[picked.size()]);
+ coll.InitTraversal();
+ vtkActor2D a;
+
+ List<vtkActor2D> picked = new ArrayList<vtkActor2D>();
+ while ((a = coll.GetNextItem()) != null) {
+ double pos[] = a.GetPosition();
+ // TODO : width and height do not seem to affect the perceived size of Actor2D.
+ // actual size should be fetched from mapper.
+ double w = a.GetWidth();
+ double h = a.GetHeight();
+ int minx = (int)(pos[0]-w*0.5);
+ int miny = (int)(pos[1]-h*0.5);
+ int maxx = (int)(pos[0]+w*0.5);
+ int maxy = (int)(pos[1]+h*0.5);
+ if (minx <= ax && maxx >= ax &&
+ miny <= ay && maxy >= ay) {
+ picked.add(a);
+ }
+ }
+ return picked.toArray(new vtkProp[picked.size()]);
}
return null;