Permalink
Browse files

4 mid points on circle

  • Loading branch information...
VVS1864 committed May 13, 2018
1 parent 2c6dd0f commit 3173a54649cd28abfa33038f8eb06fba6f2a8717
@@ -32,16 +32,17 @@
float yTR, Map<Integer, Shape> theShapes) {
LinkedList<Shape> ReturnableShapes = new LinkedList<Shape>();
System.out.println("simple");
for (Shape shape : theShapes.values()) {
List<SnapCoord> midPoints = shape.getSnapPoints(SnapType.MidPoint);
if (midPoints.size() > 0) {
SnapCoord snap_point = midPoints.get(0);
float x = snap_point.getX();
float y = snap_point.getY();
if ((xBL < x && x < xTR) && (yBL < y && y < yTR)) {
ReturnableShapes.add(shape);
continue;
for (SnapCoord snap_point : midPoints) {//Edited by Vlad, find more then 1 midpoint
//SnapCoord snap_point = midPoints.get(0);
float x = snap_point.getX();
float y = snap_point.getY();
if ((xBL < x && x < xTR) && (yBL < y && y < yTR)) {
ReturnableShapes.add(shape);
continue;
}
}
}
@@ -120,7 +121,6 @@
public static LinkedList<Shape> enclose_clip(float xBL, float yBL,
float xTR, float yTR, Map<Integer, Shape> theShapes) {
LinkedList<Shape> ReturnableShapes = new LinkedList<Shape>();
System.out.println("over");
for (Shape shape : theShapes.values()) {
for (Line snap_line : shape.getSnapLines()) {
Coord c1 = snap_line.getC1();
@@ -41,7 +41,6 @@ public Mouse_select(boolean shift_down) {
r.get_y_max(), core.global.theShapes);
}
make_new_collection(current_Shapes, shift_down);
}
}
@@ -41,9 +41,19 @@ public ShapeCircle(ObjectMode mode, float x2, float y2, float z2, float rx, floa
@Override
public void addLines() {
Coord point1 = new Coord(theCenter.getX(), theCenter.getY()-Radius);
Coord point2 = new Coord(theCenter.getX(), theCenter.getY()+Radius);
Coord point3 = new Coord(theCenter.getX()-Radius, theCenter.getY());
Coord point4 = new Coord(theCenter.getX()+Radius, theCenter.getY());
create_circle();
// Snap center
add_snap_point(new SnapCoord(SnapType.MidPoint, theCenter));
add_snap_point(new SnapCoord(SnapType.MidPoint, point1));
add_snap_point(new SnapCoord(SnapType.MidPoint, point2));
add_snap_point(new SnapCoord(SnapType.MidPoint, point3));
add_snap_point(new SnapCoord(SnapType.MidPoint, point4));
add_snap_circle(new Circle(theCenter, Radius));
}

0 comments on commit 3173a54

Please sign in to comment.