#include <ppbevel.h>
Inheritance diagram for BevelPathProcessor:
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) |
Definition at line 120 of file ppbevel.h.
|
Definition at line 142 of file ppbevel.cpp. 00143 { 00144 m_bShrinkPath = bShrinkPath; 00145 m_bIsPathClosed = TRUE; 00146 }
|
|
Destructor.
Definition at line 162 of file ppbevel.cpp.
|
|
|
|
Definition at line 133 of file ppbevel.h. 00133 { return m_bIsPathClosed; }
|
|
Adds the given path to the path in me for a bevel node to use.
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 }
|
|
|
|
|