The 2D Graphics framework provides geometry classes and corresponding IMGraphic-derived graphics classes. The classes described here are the basic geometric forms that the 2D Graphics framework knows how to render based on the underlying geometry classes, the "atoms" for building more sophisticated graphics.
The 2D Graphics framework geometry classes fall into the following general categories:
The table summarizes the graphic classes, derived from IMGraphic, and their corresponding geometry classes:
Graphic Class |
Geometry Class |
---|---|
ILine | IGLine2D: A line segment formed by 2 points. |
ICurve | IGCurve2D: A general purpose approximating spline curves used for arc and other quadratic curves. |
IPolyline | IGPolyline2D: A set of connected line segments. |
ILoop | IGLoop2D: A closed curve. |
IEllipse | IGEllipse2D: Circles and ellipses. |
IPolygon | IGPolygon2D: A polygon with an arbitrary number of 2D vertices. |
IArea | IGArea: A set of geometries enclosing areas combined by boolean operations. |
IImage | IGImage: A pixel-based image. |
The 2D graphics classes whose names specify a geometry (ILine, ICurve, IEllipse, and so on) are derived from IMGraphic. As shown in the figure, a 2D graphics class has a geometry class that provides the shape for the graphic.
The IMGraphic-derived graphics classes are wrappers for their referenced geometry classes. The graphics classes have functions that let you manipulate the geometry from within the graphic without accessing the geometry functions directly. The advantage of the wrapper architecture is that the 2D graphics classes bring together the functionality of the geometry classes and the high-level functionality of the IMGraphic class.
All IMGraphic-derived classes use a drawing port (IGrafPort) to render the graphic; they own an attribute bundle (IGrafBundle); and they know the transformation matrix.