MGD::CONTEXT_PDF2 Class Reference

#include <mi32/mg2pdf.h>

Inheritance diagram for MGD::CONTEXT_PDF2:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CONTEXT_PDF2 (DEVICE_PDF2 *dev)
 ~CONTEXT_PDF2 ()
virtual ERRVALUE v_DrawArc (double xcenter, double ycenter, double xradius, double yradius, double startangle, double sweepangle, double rotangle, MGD::SHAPECLOSE closemode)
virtual ERRVALUE v_DrawCircle (double xcenter, double ycenter, double radius)
virtual ERRVALUE v_DrawGlyph (MGD::FONT *font, double x, double y, double baseangle, const MGD::STRINGDATA &gidstr, int num)
virtual ERRVALUE v_DrawLine (double x1, double y1, double x2, double y2)
virtual ERRVALUE v_DrawLine (INT32 x1, INT32 y1, INT32 x2, INT32 y2)
virtual ERRVALUE v_DrawLinesDashed (const LPOINT2D *points, INT32 numpoints, const double *DashArray, INT32 DashCount, double DashOffset, bool close)
virtual ERRVALUE v_DrawLinesLow (const POLYLINE &line)
virtual ERRVALUE v_DrawLinesLow (const LPOINT2D *lpoint, INT32 NumPoints)
virtual ERRVALUE v_DrawPoint (const DPOINT2D &pt)
virtual ERRVALUE v_DrawPoint (INT32 x, INT32 y)
virtual ERRVALUE v_DrawRectangle (INT32 x1, INT32 y1, INT32 x2, INT32 y2)
virtual ERRVALUE v_DrawStringStraight (const DPOINT2D &pt, double baseangle, const MGD::STRINGDATA &gidstr, int sindex, int eindex, double SpaceExtra, double GlyphExtra)
virtual ERRVALUE v_FillArc (double xcenter, double ycenter, double xradius, double yradius, double startangle, double sweepangle, double rotangle, MGD::SHAPECLOSE closemode)
virtual ERRVALUE v_FillCircle (INT32 xcenter, INT32 ycenter, INT32 radius)
virtual ERRVALUE v_FillCircle (double xcenter, double ycenter, double radius)
virtual ERRVALUE v_FillPolygon (const LPOINT2D *lpoint, INT32 NumPoints, MGD::POLYSHAPE shape=MGD::POLYSHAPE_Complex, bool bDrawBorder=false)
virtual ERRVALUE v_FillPolygons (const LPOLYGON *lpolygons, INT32 NumPolys, bool bDrawBorder)
virtual ERRVALUE v_FillRectangle (INT32 x1, INT32 y1, INT32 x2, INT32 y2)
virtual ERRVALUE v_FillRectangle (const DRECT2D &rect)
virtual ERRVALUE v_FillRegion (const REGION2D &region, bool DrawOutline)
virtual ERRVALUE v_FillSubRegion (const SUBREGION2D &polygons, bool DrawOutline)
virtual ERRVALUE v_ImageBegin (INT32 x, INT32 y, INT32 cols, INT32 lins, COLORSPACE ColorSpace, const COLOR_ARRAY *colmap, UINT32 flags)
virtual ERRVALUE v_ImageEnd (UINT32 flags)
virtual ERRVALUE v_PutImageSpanDirect (INT32 x, INT32 y, INT32 len, const void *data, const UINT8 *mask)
virtual ERRVALUE v_PutPixel (INT32 x, INT32 y, MGD::PIXEL pixel)
virtual void v_TextBlockBegin (const MGD::TEXTBLOCK &block)
virtual void v_TextBlockEnd (const MGD::TEXTBLOCK &block)
virtual void v_TextSpanBegin ()
virtual void v_TextSpanEnd ()
virtual void v_UpdateClipNone ()
virtual void v_UpdateClipRect ()
virtual void v_UpdateClipRegion ()
virtual void v_UpdateColor ()
virtual void v_UpdateColor2 (const COLOR &color)

Constructor & Destructor Documentation

MGD::CONTEXT_PDF2::CONTEXT_PDF2 ( DEVICE_PDF2 dev  )  [inline]
MGD::CONTEXT_PDF2::~CONTEXT_PDF2 (  )  [inline]

Member Function Documentation

virtual ERRVALUE MGD::CONTEXT_PDF2::v_DrawArc ( double  xcenter,
double  ycenter,
double  xradius,
double  yradius,
double  startangle,
double  sweepangle,
double  rotangle,
MGD::SHAPECLOSE  closemode 
) [virtual]

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_DrawCircle ( double  xcenter,
double  ycenter,
double  radius 
) [virtual]

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_DrawGlyph ( MGD::FONT font,
double  x,
double  y,
double  baseangle,
const MGD::STRINGDATA gidstr,
int  num 
) [virtual]

Draw the nth glyph in gidstr at the given location.

The default implementation just calls the font->DrawGlyph() method. Special devices could elect to output the glyph itself. The gidstr.m_str is the string being drawn (in Unicode)

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_DrawLine ( double  x1,
double  y1,
double  x2,
double  y2 
) [virtual]
virtual ERRVALUE MGD::CONTEXT_PDF2::v_DrawLine ( INT32  x1,
INT32  y1,
INT32  x2,
INT32  y2 
) [virtual]

Draw a 2 point line.

Default implemementation just calls DrawLines() with a 2 point line

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_DrawLinesDashed ( const LPOINT2D points,
INT32  numpoints,
const double *  DashArray,
INT32  DashCount,
double  DashOffset,
bool  close 
) [virtual]

Draw dashed polyline.

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_DrawLinesLow ( const POLYLINE line  )  [virtual]

Derived classes can override this instead of v_DrawLines.

The default DrawLines implementation will call this method after having closed the polygon (if requested) and possibly clipping the lines (if necessary)

This method is also guarenteed to never get passes a line with less than 2 points or have to deal with line patterns. The line patterns are decomposed into simple lines which are drawn via this function

Note: The default version of this method converts the POLYLINE into an array of LPOINT2Ds and calls the other version of this virtual method. If you override this method, you must also override the other method because either could be called.

The only reason to override this method is if your device would benifit from getting passed floating-point coordinates or could skip a step by doing its own rounding (X has to convert points to 16-bit integers, so it overrides this to skip converting them to LPOINT2Ds first)

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_DrawLinesLow ( const LPOINT2D points,
INT32  numpts 
) [virtual]

Derived classes can override this instead of v_DrawLines.

The default DrawLines implementation will call this method after having closed the polygon (if requested) and possibly clipping the lines (if necessary)

This method is also guarenteed to never get passed a line with less than 2 points or have to deal with line patterns. The line patterns are decomposed into simple lines which are drawn via this function

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_DrawPoint ( const DPOINT2D pt  )  [virtual]

Draw a point, using current point style.

Override if you can make use of floating point coordinates. Otherwise let the default implementation call the other

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_DrawPoint ( INT32  x,
INT32  y 
) [virtual]

Draw a point, using current point style.

Default implementation calls either DrawPointPattern() or DrawPixel(), depending on current context settings.

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_DrawRectangle ( INT32  x1,
INT32  y1,
INT32  x2,
INT32  y2 
) [virtual]

Draw rectangle outline.

Default implementation calls DrawLines()

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_DrawStringStraight ( const DPOINT2D pt,
double  baseangle,
const MGD::STRINGDATA gidstr,
int  sindex,
int  eindex,
double  SpaceExtra,
double  GlyphExtra 
) [virtual]

SpaceExtra and GlyphExtra are added between each space and each glyph (including spaces) to acheive "full" justification.

If overwritten by a derived class, the new method is responsible for drawing the underline, enhanced mode, and shadow.

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_FillArc ( double  xcenter,
double  ycenter,
double  xradius,
double  yradius,
double  startangle,
double  sweepangle,
double  rotangle,
MGD::SHAPECLOSE  closemode 
) [virtual]

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_FillCircle ( INT32  xcenter,
INT32  ycenter,
INT32  radius 
) [virtual]

Fill a circle.

Default implementation uses FillSpans()

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_FillCircle ( double  xcenter,
double  ycenter,
double  radius 
) [virtual]

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_FillPolygon ( const LPOINT2D points,
INT32  NumPoints,
MGD::POLYSHAPE  shape = MGD::POLYSHAPE_Complex,
bool  DrawOutline = false 
) [virtual]

Fill a polygon.

Default implementation calls FillPolygons with a single polygon

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_FillPolygons ( const LPOLYGON polygons,
INT32  NumPolys,
bool  DrawOutline 
) [virtual]

Fill polygons.

The first polygon is the polygon to fill, additional polygons are treated as islands (with possible islands inside the islands, etc)

Default implementation calls HatchPolygons() if the current context wants them, otherwise it fills using FillSpan()

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_FillRectangle ( INT32  x1,
INT32  y1,
INT32  x2,
INT32  y2 
) [virtual]

Fill a rectangle.

Default implementation converts the rectangle to a polygon and calls fill Polygon if the context is set to use a hatch pattern or if the device's AvoidFillSpans() returns true. Otherwise it fills using FillSpan()

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_FillRectangle ( const DRECT2D rect  )  [virtual]

Fill a rectangle.

Default implementation calls the other version of FillRectangle()

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_FillRegion ( const REGION2D polygons,
bool  DrawOutline 
) [virtual]

Fill a region.

Converts the region into LPOLYGONs and calls FillPolygons.

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_FillSubRegion ( const SUBREGION2D polygons,
bool  DrawOutline 
) [virtual]

Fill a region.

Converts the region into LPOLYGONs and calls FillPolygons.

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_ImageBegin ( INT32  x,
INT32  y,
INT32  width,
INT32  height,
COLORSPACE  colorspace,
const COLOR_ARRAY colormap,
UINT32  flags 
) [virtual]

Tell the display what kind of data we'll provide to PutImageSpan().

If it matches the colorspace of the display, PutImageSpan() will call ImagePutSpanDirect(). If not, the image will be translated to what the display wants first.

If overloaded, derived class should call base class first. Doing so will setup the protected m_ColorComp member and PutImageSpanDirect() can assume the image data sent to it is in the colorspace returned by GetColorSpace()

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_ImageEnd ( UINT32  flags  )  [virtual]

Notify device that image is complete.

Needed for some displays to flush output or terminate image operations Derived method should call base method after doing its own work.

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_PutImageSpanDirect ( INT32  x,
INT32  y,
INT32  len,
const void *  data,
const UINT8 mask 
) [virtual]

Put a span of image data.

Note: Before putting an image, you MUST call ImageBegin and call ImageEnd afterwards. These are stub functions that do nothing in most implementations, but required by others

This function should assume the data passed to it is exactly what it wants. The caller will actually call PutImageSpan(), and ImageBegin() will cause PutImageSpan to either call this directly or first translate the data from one display type to what we really want.

Reimplemented from MGD::CONTEXT.

virtual ERRVALUE MGD::CONTEXT_PDF2::v_PutPixel ( INT32  x,
INT32  y,
MGD::PIXEL  pixel 
) [virtual]

Put single pixel on generic display.

Default implementation calls SetColor() and DrawPixel() and the default DrawPixel() just calls FillSpan with a one-pixel span If there is any 3D depth testing active, PutPixel() calculates z and calls PutPixel3D()

Reimplemented from MGD::CONTEXT.

virtual void MGD::CONTEXT_PDF2::v_TextBlockBegin ( const MGD::TEXTBLOCK block  )  [virtual]

Called at the beginning of a TextBlockDraw().

This allows the derived class to just keep track of the glyphs and dump them all out in some format at the end of the string. Default implementation does nothing

Reimplemented from MGD::CONTEXT.

virtual void MGD::CONTEXT_PDF2::v_TextBlockEnd ( const MGD::TEXTBLOCK block  )  [virtual]

Called at the end of a TextBlockDraw().

This allows the derived class to just keep track of the glyphs and dump them all out in some format at the end of the string. Default implementation does nothing

Reimplemented from MGD::CONTEXT.

virtual void MGD::CONTEXT_PDF2::v_TextSpanBegin (  )  [virtual]

Called just before starting a run of _DrawGlyph calls.

This allows the derived class to just keep track of the glyphs and dump them all out in some format at the end of the string. Default implementation does nothing

Reimplemented from MGD::CONTEXT.

virtual void MGD::CONTEXT_PDF2::v_TextSpanEnd (  )  [virtual]

Called just after ending a run of _DrawGlyph calls.

This allows the derived class to just keep track of the glyphs and dump them all out in some format at the end of the string. Default implementation does nothing

Reimplemented from MGD::CONTEXT.

virtual void MGD::CONTEXT_PDF2::v_UpdateClipNone (  )  [inline, virtual]

Called when clipping is set to None.

This method can be overridden by a derived class if it needs to notify the underlying device about a change to the context. The default implementation does nothing.

Reimplemented from MGD::CONTEXT.

virtual void MGD::CONTEXT_PDF2::v_UpdateClipRect (  )  [inline, virtual]

Called when the ClipRect is changed.

This method can be overridden by a derived class if it needs to notify the underlying device about a change to the context. The default implementation does nothing.

Reimplemented from MGD::CONTEXT.

virtual void MGD::CONTEXT_PDF2::v_UpdateClipRegion (  )  [inline, virtual]

Called when the ClipRegion or ClipRect is changed.

This method can be overridden by a derived class if it needs to notify the underlying device about a change to the context. The default implementation does nothing.

Reimplemented from MGD::CONTEXT.

virtual void MGD::CONTEXT_PDF2::v_UpdateColor (  )  [inline, virtual]

Called when the current drawing color changes (via a PIXEL).

This method can be overridden by a derived class if it needs to notify the underlying device about a change to the context. The default implementation does nothing. Note that this method is always called when the color is changed, where as the COLOR version is only called if the COLOR version of SetColor() is called.

Reimplemented from MGD::CONTEXT.

virtual void MGD::CONTEXT_PDF2::v_UpdateColor2 ( const COLOR  )  [inline, virtual]

Called when the current drawing color changes (via a COLOR).

This method can be overridden by a derived class if it needs to notify the underlying device about a change to the context. The default implementation does nothing. Note that when this method is called, the PIXEL version will also get called, but the reverse is not always true. This version of the method is only called when the COLOR version of SetColor is called.

Reimplemented from MGD::CONTEXT.


The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:35:07 2012 for TNTsdk 2012 by  doxygen 1.6.1