VectorFileRenderRegion Class Reference

Encapsulates the functions shared by the CMX, EPS, and Flash render regions. This class is never itself instantiated. More...

#include <vectrndr.h>

Inheritance diagram for VectorFileRenderRegion:

RenderRegion ListItem CCObject SimpleCCObject AIEPSGradientScanRenderRegion CMXRenderRegion EPSRenderRegion FlashRenderRegion AIEPSRenderRegion ArtWorksEPSRenderRegion CamelotEPSRenderRegion NativeRenderRegion PrintPSRenderRegion List of all members.

Public Member Functions

 VectorFileRenderRegion (void)
 Default constructor for the VectorFileRenderRegion class.
 VectorFileRenderRegion (DocRect ClipRect, Matrix ConvertMatrix, FIXED16 ViewScale)
 Constructor for the VectorFileRenderRegion class.
virtual ~VectorFileRenderRegion (void)
 Destructor for the VectorFileRenderRegion class.
BOOL Init (void)
 Constructor for the VectorFileRenderRegion class.
virtual BOOL StartRender (void)
 Prepare the render region for rendering (exporting).
virtual BOOL StopRender (void)
 Deinitialise the render region after rendering (exporting).
void DrawRect (DocRect *RectToRender)
 None at present - this function should not be called during ink rendering.
void DrawDragRect (DocRect *RectToRender)
 Should not be called for this kind of render region.
void DrawLine (const DocCoord &StartPoint, const DocCoord &EndPoint)
 None at present - this function should not be called during ink rendering.
void DrawPixel (const DocCoord &Point)
 Should not be called for this kind of render region.
void DrawBlob (DocCoord p, BlobType type)
 Should not be called for this kind of render region.
void DrawCross (const DocCoord &Point, const UINT32 Size)
 Should not be called for this kind of render region.
void DrawBitmap (const DocCoord &Point, KernelBitmap *pBitmap)
 Should not be called for this kind of render region.
void DrawBitmap (const DocCoord &Point, UINT32 BitmapID, UINT32 ToolID=NULL)
 Should not be called for this kind of render region.
void DrawBitmapBlob (const DocCoord &Point, KernelBitmap *BlobShape)
 Should not be called for this kind of render region.
void DrawBitmapBlob (const DocCoord &Point, ResourceID resID)

Protected Member Functions

MILLIPOINT CalcPixelWidth ()
 None for vector file render regions - just returns 1.
MILLIPOINT CalcScaledPixelWidth ()
 None for vector file render regions - just returns 1.
virtual void InitClipping ()
 Stub function.
virtual void InitAttributes ()
 Set up the default attributes for the render region. (Actually just marks the path attributes as invalid, so that we output some attribute commands before the first path we export).
virtual void DeInitAttributes ()
 Cleans up the default attributes for the render region.
virtual void SetOSDrawingMode ()
 Ensures that the drawing mode is set to DM_COPYPEN - any other drawing mode doesn't make sense when exporting EPS.
virtual void SetQualityLevel ()
 Sets the quality level for the drawing. Unused.
DocColour AlphaBlend (DocColour &Foreground, DocColour &Background, UINT32 Transp)
 Blends the two colours (pForeground and pBackground) together using a simple alpha blending algorithm.

Protected Attributes

AttributeEntryLastOutputAttrs

Detailed Description

Encapsulates the functions shared by the CMX, EPS, and Flash render regions. This class is never itself instantiated.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/00

Definition at line 112 of file vectrndr.h.


Constructor & Destructor Documentation

VectorFileRenderRegion::VectorFileRenderRegion void   ) 
 

Default constructor for the VectorFileRenderRegion class.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/10/00
See also:
EPSOutputFilter::Init

Definition at line 116 of file vectrndr.cpp.

00117     : RenderRegion()
00118 {
00119     // Null this pointer to prevent access violations.
00120     LastOutputAttrs = NULL;
00121 }

VectorFileRenderRegion::VectorFileRenderRegion DocRect  ClipRect,
Matrix  ConvertMatrix,
FIXED16  ViewScale
 

Constructor for the VectorFileRenderRegion class.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/10/00
See also:
EPSOutputFilter::Init

Definition at line 136 of file vectrndr.cpp.

00139     : RenderRegion( ClipRect, ConvertMatrix, ViewScale )
00140 {
00141     // Null this pointer to prevent access violations.
00142     LastOutputAttrs = NULL;
00143 }

VectorFileRenderRegion::~VectorFileRenderRegion void   )  [virtual]
 

Destructor for the VectorFileRenderRegion class.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/10/00

Definition at line 155 of file vectrndr.cpp.

00156 {
00157     // Clear up any attributes that survived the rendering process.
00158     DeInitAttributes();
00159 }


Member Function Documentation

DocColour VectorFileRenderRegion::AlphaBlend DocColour Foreground,
DocColour Background,
UINT32  Transp
[protected]
 

Blends the two colours (pForeground and pBackground) together using a simple alpha blending algorithm.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/1/00
Returns:
A DocColour containing the blend of the two input colours.
Moved into the VectorFileRenderRegion on 20/12/00
See also:
-

Definition at line 574 of file vectrndr.cpp.

00577 {
00578     // Step 1:  Declare local variables.
00579     DocColour   Result;
00580     INT32       FGColour [3];
00581     INT32       BGColour [3];
00582     INT32       ResultColour [3];
00583 
00584     // Step 2:  Extract the colours from the DocColour class.
00585     Foreground.GetRGBValue( &( FGColour [0] ), &( FGColour [1] ), &( FGColour [2] ) );
00586     Background.GetRGBValue( &( BGColour [0] ), &( BGColour [1] ), &( BGColour [2] ) );
00587 
00588     // Step 3:  Cycle through the list of colours, perform the alpha blend, and pass the
00589     //          result out.
00590     for ( INT32 i = 0; i < 3; i++ )
00591     {
00592         // Perform the alpha blend.
00593         ResultColour [i] = ( ( ( 255 - Transp ) * FGColour [i] ) +
00594                              ( Transp * BGColour [i] ) ) / 255;
00595     }
00596 
00597     // Step 4:  Set the colour value.
00598     Result.SetRGBValue( ResultColour [0], ResultColour [1], ResultColour [2] );
00599 
00600     // Step 5:  And return it.
00601     return Result;
00602 }

MILLIPOINT VectorFileRenderRegion::CalcPixelWidth void   )  [protected, virtual]
 

None for vector file render regions - just returns 1.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com> ( Modified by Graeme )
Date:
30/03/94 ( Moved here on 26/10/00 )
Returns:
Width of pixels on millipoints.
See also:
VectorFileRenderRegion::CalcScaledPixelWidth

Implements RenderRegion.

Reimplemented in AIEPSGradientScanRenderRegion.

Definition at line 418 of file vectrndr.cpp.

00419 {
00420     return 1;
00421 }

MILLIPOINT VectorFileRenderRegion::CalcScaledPixelWidth void   )  [protected, virtual]
 

None for vector file render regions - just returns 1.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com> ( Modified by Graeme )
Date:
30/03/94 ( Moved here on 26/10/00 )
Returns:
Scaled width of pixels on millipoints.
See also:
VectorFileRenderRegion::CalcPixelWidth

Implements RenderRegion.

Reimplemented in AIEPSGradientScanRenderRegion.

Definition at line 435 of file vectrndr.cpp.

00436 {
00437     return 1;
00438 }

void VectorFileRenderRegion::DeInitAttributes  )  [protected, virtual]
 

Cleans up the default attributes for the render region.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com> ( Modified by Graeme )
Date:
30/03/94 ( Moved here on 26/10/00 )

Definition at line 505 of file vectrndr.cpp.

00506 {
00507     // Release the 'Last Ouput' array
00508     if ( LastOutputAttrs != NULL )
00509     {
00510         for ( INT32 i = 0; i < NumCurrentAttrs; i++ )
00511         {
00512             if ( LastOutputAttrs[i].Temp )
00513             {
00514                 delete LastOutputAttrs[i].pAttr;
00515             }
00516         }
00517 
00518         // We've finished with this array of attributes now
00519         CCFree( LastOutputAttrs );
00520         LastOutputAttrs = NULL;
00521     }
00522 }

void VectorFileRenderRegion::DrawBitmap const DocCoord Point,
UINT32  BitmapID,
UINT32  ToolID = NULL
[virtual]
 

Should not be called for this kind of render region.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/00
Returns:
Errors: ENSURE failure if called.
See also:
RenderRegion::DrawBitmap

Implements RenderRegion.

Reimplemented in AIEPSGradientScanRenderRegion.

Definition at line 359 of file vectrndr.cpp.

00362 {
00363     ENSURE( FALSE, "DrawBitmap called while exporting!" );
00364 }

void VectorFileRenderRegion::DrawBitmap const DocCoord Point,
KernelBitmap pBitmap
[virtual]
 

Should not be called for this kind of render region.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/00
Returns:
Errors: ENSURE failure if called.
See also:
RenderRegion::DrawBitmap

Implements RenderRegion.

Reimplemented in AIEPSGradientScanRenderRegion.

Definition at line 339 of file vectrndr.cpp.

00341 {
00342     ENSURE( FALSE, "DrawBitmap called while exporting!" );
00343 }

void VectorFileRenderRegion::DrawBitmapBlob const DocCoord Point,
ResourceID  resID
[virtual]
 

Implements RenderRegion.

Reimplemented in AIEPSGradientScanRenderRegion.

void VectorFileRenderRegion::DrawBitmapBlob const DocCoord Point,
KernelBitmap BlobShape
[virtual]
 

Should not be called for this kind of render region.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/00
Returns:
Errors: ENSURE failure if called.
See also:
RenderRegion::DrawBitmap

Implements RenderRegion.

Reimplemented in AIEPSGradientScanRenderRegion.

Definition at line 379 of file vectrndr.cpp.

00381 {
00382     ENSURE( FALSE, "DrawBitmapBlob called while exporting!" );
00383 }

void VectorFileRenderRegion::DrawBlob DocCoord  p,
BlobType  type
[virtual]
 

Should not be called for this kind of render region.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com> ( Modified by Graeme )
Date:
30/03/94 ( Moved here on 26/10/00 )
Returns:
Errors: ENSURE failure if called.
See also:
RenderRegion::DrawBlob

Implements RenderRegion.

Reimplemented in AIEPSGradientScanRenderRegion.

Definition at line 301 of file vectrndr.cpp.

00303 {
00304     ENSURE( FALSE, "DrawBlob called while exporting!" );
00305 }

void VectorFileRenderRegion::DrawCross const DocCoord Point,
const UINT32  Size
[virtual]
 

Should not be called for this kind of render region.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com> ( Modified by Graeme )
Date:
30/03/94 ( Moved here on 26/10/00 )
Returns:
Errors: ENSURE failure if called.
See also:
RenderRegion::DrawCross

Implements RenderRegion.

Reimplemented in AIEPSGradientScanRenderRegion.

Definition at line 320 of file vectrndr.cpp.

00322 {
00323     ENSURE( FALSE, "DrawCross called while exporting!" );
00324 }

void VectorFileRenderRegion::DrawDragRect DocRect RectToRender  )  [virtual]
 

Should not be called for this kind of render region.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com> ( Modified by Graeme )
Date:
30/03/94 ( Moved here on 26/10/00 )
Returns:
Errors: ENSURE failure if called.
See also:
RenderRegion::DrawDragRect

Implements RenderRegion.

Reimplemented in AIEPSGradientScanRenderRegion.

Definition at line 248 of file vectrndr.cpp.

00249 {
00250     ENSURE(FALSE, "DrawDragRect called while exporting!");
00251 }

void VectorFileRenderRegion::DrawLine const DocCoord StartPoint,
const DocCoord EndPoint
[virtual]
 

None at present - this function should not be called during ink rendering.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com> ( Modified by Graeme )
Date:
30/03/94 ( Moved here on 26/10/00 )
Returns:
Errors: ENSURE failure if called.

Implements RenderRegion.

Reimplemented in AIEPSGradientScanRenderRegion.

Definition at line 265 of file vectrndr.cpp.

00267 {
00268     ENSURE( FALSE, "EPSRenderRegion::DrawLine called - this should not happen!" );
00269 }

void VectorFileRenderRegion::DrawPixel const DocCoord Point  )  [virtual]
 

Should not be called for this kind of render region.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com> ( Modified by Graeme )
Date:
30/03/94 ( Moved here on 26/10/00 )
Returns:
Errors: ENSURE failure if called.
See also:
RenderRegion::DrawPixel

Implements RenderRegion.

Reimplemented in AIEPSGradientScanRenderRegion.

Definition at line 283 of file vectrndr.cpp.

00284 {
00285     ENSURE( FALSE, "DrawPixel called while exporting!" );
00286 }

void VectorFileRenderRegion::DrawRect DocRect RectToRender  )  [virtual]
 

None at present - this function should not be called during ink rendering.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com> ( Modified by Graeme )
Date:
30/03/94 ( Moved here on 26/10/00 )
Returns:
Errors: ENSURE failure if called.

Implements RenderRegion.

Reimplemented in AIEPSGradientScanRenderRegion.

Definition at line 231 of file vectrndr.cpp.

00232 {
00233     ENSURE( FALSE, "VectorFileRenderRegion::DrawRect called - this should not happen!" );
00234 }

BOOL VectorFileRenderRegion::Init void   ) 
 

Constructor for the VectorFileRenderRegion class.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/10/00
Returns:
TRUE - Successful. FALSE - An error occured.

Reimplemented from RenderRegion.

Reimplemented in EPSRenderRegion.

Definition at line 173 of file vectrndr.cpp.

00174 {
00175     // Clear up any previous attributes.
00176     DeInitAttributes();
00177 
00178     return TRUE;
00179 }

void VectorFileRenderRegion::InitAttributes void   )  [protected, virtual]
 

Set up the default attributes for the render region. (Actually just marks the path attributes as invalid, so that we output some attribute commands before the first path we export).

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com> ( Modified by Graeme )
Date:
30/03/94 ( Moved here on 26/10/00 )
See also:
VectorFileRenderRegion::InitClipping

Implements RenderRegion.

Reimplemented in AIEPSGradientScanRenderRegion.

Definition at line 469 of file vectrndr.cpp.

00470 {
00471     // We don't use pens and brushes.
00472     SetOSDrawingMode();
00473     SetLineAttributes();
00474     SetFillAttributes();
00475 
00476     // Set up the Last Output attributes for this device, first making sure that
00477     // any we might have lying around already are cleaned up.
00478     DeInitAttributes();
00479     LastOutputAttrs = AttributeManager::GetDefaultAttributes();
00480 
00481     if ( LastOutputAttrs != NULL )
00482     {
00483         for ( INT32 i = 0; i < NumCurrentAttrs; i++ )
00484         {
00485             // NULL all the pointers to begin with,
00486             // so that all default attribute are output
00487             // with the first object
00488             LastOutputAttrs[i].pAttr    = NULL;
00489             LastOutputAttrs[i].Temp     = FALSE;
00490             LastOutputAttrs[i].Ignore   = FALSE;
00491         }
00492     }
00493 }

void VectorFileRenderRegion::InitClipping void   )  [protected, virtual]
 

Stub function.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/00
See also:
VectorFileRenderRegion::InitAttributes

Implements RenderRegion.

Reimplemented in AIEPSGradientScanRenderRegion.

Definition at line 451 of file vectrndr.cpp.

00452 {
00453     // Do nothing.
00454 }

void VectorFileRenderRegion::SetOSDrawingMode void   )  [protected, virtual]
 

Ensures that the drawing mode is set to DM_COPYPEN - any other drawing mode doesn't make sense when exporting EPS.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com> ( Modified by Graeme )
Date:
30/03/94 ( Moved here on 26/10/00 )
Returns:
Errors: If drawing mode is not DM_COPYPEN, ENSURE failure.

Implements RenderRegion.

Reimplemented in AIEPSGradientScanRenderRegion.

Definition at line 536 of file vectrndr.cpp.

00537 {
00538     // EPS doesn't care about drawing modes...or at least, we should never set
00539     // anything other than COPYPEN - EOR is right out!
00540     ENSURE( DrawingMode == DM_COPYPEN, "Non-standard drawing mode in EPS output!" );
00541 }

void VectorFileRenderRegion::SetQualityLevel void   )  [protected, virtual]
 

Sets the quality level for the drawing. Unused.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com> ( Modified by Graeme )
Date:
30/03/94 ( Moved here on 26/10/00 )

Reimplemented from RenderRegion.

Definition at line 553 of file vectrndr.cpp.

00554 {
00555 }

BOOL VectorFileRenderRegion::StartRender void   )  [virtual]
 

Prepare the render region for rendering (exporting).

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com> ( Modified by Graeme )
Date:
30/03/94 ( Moved here on 26/10/00 )
Returns:
TRUE if worked, FALSE if failed.
See also:
EPSRenderRegion::Initialise; EPSRenderRegion::StopRender

Reimplemented from RenderRegion.

Reimplemented in ArtWorksEPSRenderRegion, CamelotEPSRenderRegion, and PrintPSRenderRegion.

Definition at line 193 of file vectrndr.cpp.

00194 {
00195     // Call base class first.
00196     if (!RenderRegion::StartRender())
00197         return FALSE;
00198 
00199     InitAttributes();
00200 
00201     return TRUE;
00202 }

BOOL VectorFileRenderRegion::StopRender void   )  [virtual]
 

Deinitialise the render region after rendering (exporting).

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com> ( Modified by Graeme )
Date:
30/03/94 ( Moved here on 26/10/00 )

Implements RenderRegion.

Reimplemented in AIEPSGradientScanRenderRegion, CamelotEPSRenderRegion, and PrintPSRenderRegion.

Definition at line 214 of file vectrndr.cpp.

00215 {
00216     DeInitAttributes();
00217     return TRUE;
00218 }


Member Data Documentation

AttributeEntry* VectorFileRenderRegion::LastOutputAttrs [protected]
 

Reimplemented in CMXRenderRegion.

Definition at line 173 of file vectrndr.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:02:55 2007 for Camelot by  doxygen 1.4.4