|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgizmoball.shape.UnionShape
public class UnionShape
This object, implementing the Shape interface, represents a shape constructed as a combination of other shapes.
| Constructor Summary | |
|---|---|
UnionShape(java.util.List<Shape> shapes)
Constructs a UnionShape out of a list of shapes, which must all be either Cirle09, Polygon or UnionShape. |
|
UnionShape(Shape s1,
Shape s2)
Constructs a UnionShape out of a pair of shapes, which must be either Circle09, UnionShape or Polygon. |
|
| Method Summary | |
|---|---|
boolean |
containsPoint(Vect pt)
returns true iff shape contains specified point |
java.util.List<Circle> |
getCircles()
returns list of circles constituting UnionShape |
java.util.List<LineSegment> |
getLineSegments()
returns list of LineSegments constituting UnionShape |
java.util.List<Shape> |
getShapes()
|
Vect |
maxXY()
Returns the maximum coordinates of a bounding rectangle of the shape |
Vect |
minXY()
Returns the minimum coordinates for a bounding rectangle of the shape |
UnionShape |
rotate(Angle theta,
Vect centerOfRotation)
returns a new UnionShape rotated by specified angle around center of rotation |
UnionShape |
translate(Vect v)
returns a new UnionShape translated by specified vector. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UnionShape(java.util.List<Shape> shapes)
shapes - list of shapes
public UnionShape(Shape s1,
Shape s2)
s1 - shapes2 - shape| Method Detail |
|---|
public Vect minXY()
minXY in interface Shapepublic Vect maxXY()
maxXY in interface Shapepublic java.util.List<Shape> getShapes()
public boolean containsPoint(Vect pt)
containsPoint in interface Shapepublic java.util.List<Circle> getCircles()
getCircles in interface Shapepublic java.util.List<LineSegment> getLineSegments()
getLineSegments in interface Shape
public UnionShape rotate(Angle theta,
Vect centerOfRotation)
rotate in interface Shapetheta - angle to rotatecenterOfRotation - point to rotate around
public UnionShape translate(Vect v)
translate in interface Shapev - vector to translate shape by
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||