Package com.amalgamasimulation.geometry
Class IntersectionDescriptor
java.lang.Object
com.amalgamasimulation.geometry.IntersectionDescriptor
Class representing all contextual information about one intersection point of
two geometric primitives, each of them can be a
Point, a
Segment, or a Polyline.
This class stores the intersection Point itself, as well as absolute
and relative offsets of this point on both intersection operands.
- Author:
- Andrey Malykhanov
-
Constructor Summary
ConstructorsConstructorDescriptionIntersectionDescriptor(Point intersectionPoint, double firstOperandRelativeOffset, double firstOperandAbsoluteOffset, double secondOperandRelativeOffset, double secondOperandAbsoluteOffset) Creates a new instance of intersection descriptor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanequals(IntersectionDescriptor intersectionDescriptor) Checks whether this intersection descriptor equals specified other intersection descriptor.booleandoubleReturns the absolute offset of the intersection point on the first operand.doubleReturns the relative offset of the intersection point on the first operand.Returns the intersection point.doubleReturns the absolute offset of the intersection point on the second operand.doubleReturns the relative offset of the intersection point on the second operand.inthashCode()Returns the string representing Java code that creates this intersection descriptor in its current state.toString()
-
Constructor Details
-
IntersectionDescriptor
public IntersectionDescriptor(Point intersectionPoint, double firstOperandRelativeOffset, double firstOperandAbsoluteOffset, double secondOperandRelativeOffset, double secondOperandAbsoluteOffset) Creates a new instance of intersection descriptor.- Parameters:
intersectionPoint- point of intersectionfirstOperandRelativeOffset- relative offset of the intersection on the first operandfirstOperandAbsoluteOffset- absolute offset of the intersection on the first operandsecondOperandRelativeOffset- relative offset of the intersection point on the second operandsecondOperandAbsoluteOffset- absolute offset of the intersection point on the second operand
-
-
Method Details
-
getIntersectionPoint
Returns the intersection point.- Returns:
- intersection point
-
getFirstOperandRelativeOffset
public double getFirstOperandRelativeOffset()Returns the relative offset of the intersection point on the first operand.- Returns:
- relative offset of the intersection on the first operand
-
getFirstOperandAbsoluteOffset
public double getFirstOperandAbsoluteOffset()Returns the absolute offset of the intersection point on the first operand.- Returns:
- absolute offset of the intersection on the first operand
-
getSecondOperandRelativeOffset
public double getSecondOperandRelativeOffset()Returns the relative offset of the intersection point on the second operand.- Returns:
- relative offset of the intersection on the second operand
-
getSecondOperandAbsoluteOffset
public double getSecondOperandAbsoluteOffset()Returns the absolute offset of the intersection point on the second operand.- Returns:
- absolute offset of the intersection on the second operand
-
hashCode
public int hashCode() -
equals
-
equals
Checks whether this intersection descriptor equals specified other intersection descriptor.- Parameters:
intersectionDescriptor- specified other intersection descriptor- Returns:
trueif this intersection descriptor equals specified other intersection descriptor,falseotherwise
-
toString
-
toCodeString
Returns the string representing Java code that creates this intersection descriptor in its current state.- Returns:
- Java code required to create this intersection descriptor in its current state
-