public class RotateAdjectantShapes
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static Edge |
edgeA |
private static Edge |
edgeB |
private static Vector3D |
intersectionPoint |
private static float |
tolerance |
private static Shape |
virtualShape |
Constructor and Description |
---|
RotateAdjectantShapes() |
Modifier and Type | Method and Description |
---|---|
private static boolean |
compareEdges(Edge edge1,
Edge edge2) |
private static Vector3D |
findIntersectionPoint(Edge edge1,
Edge edge2) |
private static Edge |
getAlreadyConnectedEdge(Edge edge) |
private static Vector3D |
getCommonPoint(Edge edge) |
private static toxi.geom.Line3D |
getIntersectionLine(Edge edge) |
private static Vector3D |
getNormalVector(Edge edge1,
Edge edge2) |
private static Vector3D |
getNotCommonPoint(Edge edge) |
private static Edge |
getOtherEdge(Edge edge) |
private static Vector3D |
getPointOfRotatingEdge(Edge edge) |
private static Edge |
getRotatingEdge(Edge edge) |
private static float |
getRotationFor(Edge edge) |
private static void |
initialiseVirtualShape(Edge masterEdge,
Edge slaveEdge) |
static boolean |
rotateBothShapes(Connection connection,
Edge masterEdge,
Edge slaveEdge)
Rotates two edges with a common point until the other is common,
too
Two edges on different shapes, which have one common point, at
least one of their corresponding shapes can be rotated (only one
connection with another shape) and the rotating axis are also
connected with this common point.
|
private static float |
rotateOnlyOneShape(Edge edgeA,
Edge edgeB) |
private static float |
safeAngleBetween(Vector3D masterEdgeDirection,
Vector3D slaveEdgeDirection) |
private static boolean |
tryToConnectBothEdges(Connection connection,
Edge masterEdge1,
Edge masterEdge2,
float masterAngle,
Edge slaveEdge1,
Edge slaveEdge2,
float slaveAngle) |
private static boolean |
tryToConnectOneEdge(Connection connection,
Edge masterEdge,
Edge slaveEdge,
float angle) |
private static float tolerance
private static Shape virtualShape
private static Edge edgeA
private static Edge edgeB
private static Vector3D intersectionPoint
public static boolean rotateBothShapes(Connection connection, Edge masterEdge, Edge slaveEdge)
connection
- The connection which should be made by rotating the edges. If
both shapes could be aligned, such that these edges are at the
same position, this connection is finally made and storedmasterEdge
- The first edge which should be connected with theslaveEdge
- , the second edgeprivate static float safeAngleBetween(Vector3D masterEdgeDirection, Vector3D slaveEdgeDirection)
private static toxi.geom.Line3D getIntersectionLine(Edge edge)
private static float getRotationFor(Edge edge)
private static boolean tryToConnectOneEdge(Connection connection, Edge masterEdge, Edge slaveEdge, float angle)
private static boolean tryToConnectBothEdges(Connection connection, Edge masterEdge1, Edge masterEdge2, float masterAngle, Edge slaveEdge1, Edge slaveEdge2, float slaveAngle)