Class SelectionQuery
java.lang.Object
java.awt.geom.RectangularShape
java.awt.geom.Rectangle2D
java.awt.Rectangle
com.j3d.engine.interact.selection.SelectionQuery
- All Implemented Interfaces:
Shape,Serializable,Cloneable
A SelectionQuery represents a selection made by the user.
It is represented as a rectangle defined by two ScreenPoints (the corners).
It can be used to check whether certain GObjects are within the selection.
- Author:
- Lehlogonolo Poole
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D
Rectangle2D.Double, Rectangle2D.Float -
Field Summary
FieldsFields inherited from class java.awt.geom.Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP -
Constructor Summary
ConstructorsConstructorDescriptionSelectionQuery(ScreenPoint i, ScreenPoint ii, SelectionType t) Constructs a SelectionQuery object with the given screen points and selection type. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanWhether the Selection has the triangle.booleanbooleanbooleanWhether the Selection has the given GObject.booleanintersectsWith(Segment line) private booleanonSegment(ScreenPoint a, ScreenPoint b, ScreenPoint c) private intorientation(ScreenPoint a, ScreenPoint b, ScreenPoint c) private booleansegmentsIntersect(ScreenPoint p1, ScreenPoint p2, ScreenPoint q1, ScreenPoint q2) Methods inherited from class java.awt.Rectangle
add, add, add, contains, contains, contains, contains, createIntersection, createUnion, equals, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setBounds, setBounds, setLocation, setLocation, setRect, setSize, setSize, toString, translate, unionMethods inherited from class java.awt.geom.Rectangle2D
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, unionMethods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonalMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.Shape
contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects
-
Field Details
-
type
-
points
-
-
Constructor Details
-
SelectionQuery
Constructs a SelectionQuery object with the given screen points and selection type.- Parameters:
i- The first screen point.ii- The second screen point.t- The type of selection.
-
-
Method Details
-
has
Whether the Selection has the given GObject.- Parameters:
obj- The GObject to check.soft- If false, we strictly check whether the GObject is fully contained within the selection. Otherwise, we check whether the selection does so much as intersect with the GObject.
-
has
-
has
Whether the Selection has the triangle.- Parameters:
triangle- The triangle to check.soft- If false, we strictly check whether the triangle is fully contained within the selection. Otherwise, we check whether the selection does so much as intersect with ay of the lines of the triangle.- Returns:
- true if all the points are within the triangle
-
has
-
has
-
intersectsWith
-
segmentsIntersect
-
orientation
-
onSegment
-