#include <mi32/cgm.h>
This is meant to be a base class. There are a number of protected virtual methods for actually "rendering" the CGM object.
This class is NOT for writing CGM files.
Definition at line 201 of file cgm.h.
| enum CGM::ASF |
| enum CGM::CLIPMODE |
| enum CGM::COLORMODE |
| enum CGM::COLORMODEL |
| enum CGM::INTERIORSTYLE |
| enum CGM::LINECAP |
| enum CGM::LINECONT |
| enum CGM::LINEJOIN |
| enum CGM::LINETYPE |
| enum CGM::MARKERTYPE |
| enum CGM::REALMODE |
| enum CGM::SCALEMODE |
| enum CGM::SIZEMODE |
| enum CGM::TEXTALIGNMENT |
| enum CGM::TEXTPATH |
| enum CGM::TEXTPRECISION |
| enum CGM::VDCTYPE |
| CGM::CGM | ( | ) |
Constructor.
The constructor only clears the structure.
| virtual CGM::~CGM | ( | ) | [virtual] |
| void CGM::GetExtents | ( | DRECT2D & | rect | ) | const [inline] |
Return the VDC (Virtual Device Context?) extents.
It should be noted that CGM files set this themselves. It is not computed based on the elements in the file. If the CGM file fails to set it, the default is 0 to 32767 in both directions. It should also be obvious that the extents are only valid after calling ReadFile(). before that time, this function will return the default extents.
| const PRIMITIVECONTEXT& CGM::GetPC | ( | ) | [inline, protected] |
| int CGM::ReadFile | ( | const MIUNICODE * | fname | ) |
Opens a CGM file and reads it into an internal buffer and parses it.
| int CGM::Render | ( | ) |
Render the CGM data.
The actual rendering is done by the protected virutal methods of a derived class.
| virtual int CGM::RenderArc | ( | const DPOINT2D & | center, | |
| double | StartAngle, | |||
| double | EndAngle, | |||
| double | radius, | |||
| int | CloseMethod | |||
| ) | [protected, virtual] |
Draw a circular arc.
If not implemented by the derived class, the default is to convert the arc to a bunch of points and call RenderPolyline() or RenderPolygon (depending on CloseMethod)
| CloseMethod | 0 = none, 1 = pie, 2 = chord |
| virtual int CGM::RenderBezier | ( | int | NumPts, | |
| DPOINT2D * | cpoints, | |||
| bool | bContinuous | |||
| ) | [protected, virtual] |
Render a Bezier curve.
If not overloaded by the derived class, the default method will convert the curve to points can call RenderPolyline()
| virtual int CGM::RenderBSpline | ( | int | order, | |
| int | NumPts, | |||
| const DPOINT2D * | cpoints, | |||
| const double * | knots, | |||
| const double * | weights, | |||
| double | Start, | |||
| double | End | |||
| ) | [protected, virtual] |
Render a B-Spline.
If not overloaded by the derived class, the default method will convert the curve to points can call RenderPolyline()
| cpoints | Control points (NumPts of them) |
| knots | Array of (NumPts + order) knots |
| weights | Array of (NumPts weights) (may be NULL) |
| virtual int CGM::RenderCircle | ( | const DPOINT2D & | center, | |
| double | radius | |||
| ) | [protected, virtual] |
Draw a circle.
If not implemented by the derived class, the default is to convert the circle to a bunch of points and call RenderPolygon()
| virtual int CGM::RenderEArc | ( | const DPOINT2D & | center, | |
| const DPOINT2D & | EndPoint1, | |||
| const DPOINT2D & | EndPoint2, | |||
| double | StartAngle, | |||
| double | EndAngle, | |||
| int | CloseMethod | |||
| ) | [protected, virtual] |
Render an Elliptical Arc (General Case).
This method takes exactly what CGM gives us. Instead of two radii and a rotation angle, they give the endpoints of where the axes intersect the ellipse. Note This gives the possibility of shear angle too. Ick!
Override this method only if you are writing to a format that wants this weird format. The default method will call either the other RenderEArc (for the non-shear case or will convert the arc to a polyline and call RenderPolyline or RenderPolygon (to if closed)
| CloseMethod | 0 = none, 1 = pie, 2 = chord |
| virtual int CGM::RenderEArc | ( | const DPOINT2D & | center, | |
| double | StartAngle, | |||
| double | EndAngle, | |||
| double | xradius, | |||
| double | yradius, | |||
| double | RotAngle, | |||
| int | CloseMethod | |||
| ) | [protected, virtual] |
Render an Elliptical Arc (Simple Case).
If not implemented by the derived class, the default is to convert the arc to a bunch of points and call RenderPolyline() or RenderPolygon (depending on CloseMethod)
| CloseMethod | 0 = none, 1 = pie, 2 = chord |
| virtual int CGM::RenderEllipse | ( | const DPOINT2D & | center, | |
| const DPOINT2D & | EndPoint1, | |||
| const DPOINT2D & | EndPoint2 | |||
| ) | [protected, virtual] |
Render an Elliptical Arc (General Case).
This method takes exactly what CGM gives us. Instead of two radii and a rotation angle, they give the endpoints of where the axes intersect the ellipse. Note This gives the possibility of shear angle too. Ick!
Override this method only if you are writing to a format that wants this weird format. The default method will call either the other RenderEllipse (for the non-shear case or will convert the ellipse to a polygon and call RenderPolygon
| virtual int CGM::RenderEllipse | ( | const DPOINT2D & | center, | |
| double | xradius, | |||
| double | yradius, | |||
| double | RotAngle | |||
| ) | [protected, virtual] |
Render an Ellipse (Simple Case).
If not implemented by the derived class, the default is to convert the ellipse to a bunch of points and call RenderPolygon()
Draw a 2-point line.
If not overloaded by the derived class, the default method just calls RenderPolyline with a 2-point line.
| virtual int CGM::RenderMarker | ( | const DPOINT2D & | point | ) | [protected, virtual] |
Draw a marker (point).
| virtual int CGM::RenderPolygon | ( | const DPOINT2D * | points, | |
| int | NumPoints | |||
| ) | [protected, virtual] |
Draw a closed polygon.
If not overloaded by the derived class, the default method just calls RenderPolygons() with one polygon.
| virtual int CGM::RenderPolygons | ( | const DPOLYGON * | polys, | |
| int | NumPolys | |||
| ) | [protected, virtual] |
Render multiple polygons (with islands).
| virtual int CGM::RenderPolyline | ( | const DPOINT2D * | points, | |
| int | NumPoints | |||
| ) | [protected, virtual] |
Draw a multi-point line.
| virtual int CGM::RenderRectangle | ( | const DRECT2D & | rect | ) | [protected, virtual] |
Draw a rectangle (no rotation).
If the current affine transformation has no rotation, this method will be called to render rectangles, since it can be much faster. If not overloaded, the default method will call the other RenderRectangle() method, so implementing this one is optional.
| virtual int CGM::RenderRectangle | ( | const DPOINT2D * | points | ) | [protected, virtual] |
Draw a rectangle.
Points will be in the order...
0 1
3 2
For convinence, you will actually be passed 5 points, and points[4] == points[0]. If not overloaded by the derived class, the default method will call RenderPolygon.
| virtual int CGM::RenderText | ( | const DPOINT2D & | basept, | |
| const TEXTSTYLE & | style, | |||
| const STYLEEXTRA & | extra, | |||
| const MIUNICODE * | str | |||
| ) | [protected, virtual] |
Render text.
| virtual int CGM::SetLineStyle | ( | const LINESTYLE & | style, | |
| const STYLEEXTRA & | extra | |||
| ) | [inline, protected, virtual] |
| virtual int CGM::SetPointStyle | ( | const POINTSTYLE & | style, | |
| const STYLEEXTRA & | extra | |||
| ) | [inline, protected, virtual] |
| virtual int CGM::SetPolyStyle | ( | const POLYSTYLE & | style, | |
| const STYLEEXTRA & | extra | |||
| ) | [inline, protected, virtual] |
| virtual int CGM::SetTextStyle | ( | const TEXTSTYLE & | style, | |
| const STYLEEXTRA & | extra | |||
| ) | [inline, protected, virtual] |
| void CGM::SetTransAffine | ( | const TRANS2D_AFFINE & | trans | ) |
Set the affine transformation.
Set the affine transformation.
1.5.2