BevelPathProcessor Class Reference

This is the bevel path processor. It is used to combine all the paths rendered so that the next bevel node can render them. More...

#include <ppbevel.h>

Inheritance diagram for BevelPathProcessor:

PathProcessor CCObject SimpleCCObject List of all members.

Public Member Functions

 BevelPathProcessor (BOOL bShrinkPath)
 ~BevelPathProcessor ()
 Destructor.
virtual void ProcessPath (Path *pPath, RenderRegion *pRender, PathShape ShapePath=PATHSHAPE_PATH)
 Adds the given path to the path in me for a bevel node to use.
BOOL GetPathIsClosed ()

Protected Attributes

BOOL m_bShrinkPath
BOOL m_bIsPathClosed

Private Member Functions

 CC_DECLARE_DYNAMIC (BevelPathProcessor)

Detailed Description

This is the bevel path processor. It is used to combine all the paths rendered so that the next bevel node can render them.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com> Mc
Date:
12/11/98
See also:
RenderRegion::DrawPath; PathProcessor::ProcessPath

Definition at line 120 of file ppbevel.h.


Constructor & Destructor Documentation

BevelPathProcessor::BevelPathProcessor BOOL  bShrinkPath  ) 
 

Definition at line 142 of file ppbevel.cpp.

00143 {
00144     m_bShrinkPath = bShrinkPath;
00145     m_bIsPathClosed = TRUE;
00146 }

BevelPathProcessor::~BevelPathProcessor  ) 
 

Destructor.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com> Mc
Date:
12/11/98
Returns:
Errors: If this object still has a non-NULL Next pointer, it will ERROR3 in an effort to get you to clean up properly before destruction.

Definition at line 162 of file ppbevel.cpp.

00163 {
00164 }


Member Function Documentation

BevelPathProcessor::CC_DECLARE_DYNAMIC BevelPathProcessor   )  [private]
 

BOOL BevelPathProcessor::GetPathIsClosed  )  [inline]
 

Definition at line 133 of file ppbevel.h.

00133 { return m_bIsPathClosed; }

void BevelPathProcessor::ProcessPath Path pPath,
RenderRegion pRender,
PathShape  ShapePath = PATHSHAPE_PATH
[virtual]
 

Adds the given path to the path in me for a bevel node to use.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com> Mc
Date:
12/11/98

Implements PathProcessor.

Definition at line 178 of file ppbevel.cpp.

00181 {
00182     PORTNOTETRACE("other","BevelPathProcessor::PreOpProcessing - do nothing");
00183 #ifndef EXCLUDE_FROM_XARALX
00184     pRender->SaveContext();
00185 
00186     BOOL bPathIsClosed = pPath->IsClosed();
00187 
00188     if (m_bIsPathClosed && !bPathIsClosed)
00189     {
00190         m_bIsPathClosed = FALSE;
00191     }
00192 
00193     Path ShrunkPath;
00194     ShrunkPath.Initialise();
00195 
00196     // get the line width from the render region
00197     StrokeColourAttribute * pStrokeColour = (StrokeColourAttribute *)pRender->GetCurrentAttribute(ATTR_STROKECOLOUR);
00198 
00199     BOOL bShrinkPath = m_bShrinkPath;
00200     
00201     if (pStrokeColour)
00202     {
00203         if (pStrokeColour->GetStartColour())
00204         {
00205             if (!(pStrokeColour->GetStartColour()->IsTransparent()))
00206             {
00207                 bShrinkPath = FALSE;
00208             }
00209         }
00210     }
00211 
00212     if (bShrinkPath && bPathIsClosed)
00213     {
00214         // flatten the path first
00215         ProcessFlatten Flatten(200);
00216 
00217         Path FlatPath;
00218         FlatPath.Initialise();
00219 
00220         ProcessFlags pf(TRUE, FALSE, FALSE);
00221         Flatten.FlattenPath(pf, pPath, &FlatPath);
00222 
00223         // ensure that the path is correct
00224         Path ClippedPath;
00225         ClippedPath.Initialise();
00226 
00227         Path CopyPath;
00228         CopyPath.Initialise();
00229         CopyPath.CloneFrom(FlatPath);
00230 
00231         FlatPath.ClipPathToPath(CopyPath, &ClippedPath, 3, 50, 200, 200);
00232 
00233         BevelHelpers::ShrinkPath(&ClippedPath, pRender->GetScaledPixelWidth(),
00234             pRender->GetScaledPixelWidth(), &ShrunkPath);
00235 
00236         pRender->DrawPath(&ShrunkPath, this, ShapePath);
00237     }
00238     else
00239     {
00240         pRender->DrawPath(pPath, this, ShapePath);
00241     }
00242 
00243     pRender->RestoreContext();
00244 #endif
00245 }


Member Data Documentation

BOOL BevelPathProcessor::m_bIsPathClosed [protected]
 

Definition at line 137 of file ppbevel.h.

BOOL BevelPathProcessor::m_bShrinkPath [protected]
 

Definition at line 136 of file ppbevel.h.


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