Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
GEF/GEF4/Geometry
Contents
Description
This is the documentation of the GEF4 Geometry API. You can find a small tutorial for the API here.
Geometric primitives
Point
Dimension
Angle
Geometrc figures
This diagram depicts the interface hierarchy which underlies the individual geometry classes. In turn, the inheritance hierarchy classifies the figures by their construction type, so that many operations are generalized in a few abstract classes. Additionally, the different geometric figures provide extra functionality, for example, computing the area of a Polygon, or unifying two Rectangles.
IGeometry
The IGeometry interface defines the functionality that every geometric figure implements.
-
IGeometry.contains(Point) : boolean
The contains(Point) method tests if the given Point lies on/in the particular IGeometry.
-
IGeometry.getBounds() : Rectangle
The getBounds() method computes a bounding box for the particular IGeometry. The bounding box is the smallest Rectangle that contains this IGeometry.
-
IGeometry.touches(IGeometry) : boolean
The touches(IGeometry) method tests the given other IGeometry for at least one Point in common with this IGeometry. touches(IGeometry) works differently for ICurves and IShapes. For the latter ones, only the particular IShape's outline is regarded.
-
IGeometry.getTransformed(AffineTransform) : IGeometry
The getTransformed(AffineTransform) method applies an AffineTransform to this IGeometry and returns a new IGeometry that reflects the particular transformation. The resulting IGeometry is not necessarily of the same type as the original IGeometry, because some transformations - for example the rotation of an Ellipse - yield geometric figures that are not representable by the original IGeometry.
-
IGeometry.toPath() : Path
The toPath() method creates a Path representing this IGeometry. A Path implements Therefore, the Path is the general IGeometry that is used when you have to burst the boundaries of the other classes.
-
IGeometry.getCopy() : IGeometry
The getCopy() method returns a newly constructed IGeometry of same type that is equal to the original IGeometry.
ICurve
Line
QuadraticCurve
CubicCurve
BezierCurve
IPolyCurve
Polyline
PolyBezier
IShape
Rectangle
RoundedRectangle
Polygon
Ellipse
Path
Conversions (From/To AWT/SWT/Geometry)
From SWT to Geometry
Important. Very easy via the toSWT...() methods.
From AWT to Geometry
From Geometry to AWT
From AWT to SWT
From SWT to AWT
Affine transformations
Via projective geometry. All matrices can be combined before applying them to the particular shape.