ContourBecomeA2 Class Reference

ContourBecomeA2 class provides a greener alternative to ContourBecomeA. More...

#include <pbecomea.h>

Inheritance diagram for ContourBecomeA2:

PathBecomeA BecomeA List of all members.

Public Member Functions

 ContourBecomeA2 (UndoableOperation *pUndoOp, MILLIPOINT Width, Path *pResultPath)
 Constructor for a new ContourBecomeA, to do your contouring dirty work :o).
virtual BOOL PassBack (NodeRenderableInk *pNewNode, NodeRenderableInk *pCreatedByNode, CCAttrMap *pAttrMap=NULL)
 PassBack function fer lettin' me do ma contour thang.

Protected Attributes

MILLIPOINT m_Width

Private Member Functions

 CC_DECLARE_MEMDUMP (ContourBecomeA2)

Detailed Description

ContourBecomeA2 class provides a greener alternative to ContourBecomeA.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/11/2000
Parameters:
[INPUTS] 
[OUTPUTS] 
Returns:
Reasons to use us: It deals with all lines correctly, because it doesn't simulate line width by contouring out from lines (like ContourBecomeA), but actually strokes them, and contours outwards from the result.

Reasons not to use us: 1. We don't currently deal with brush strokes correctly. 2. We currently only do rounded contours - no bevelled or mitred contours.

Example usage: Path ContourPath; ContourPath.Initialise(); ContourBecomeA2 baContour(NULL, MillipointWidth, &ContourPath) BOOL Success = pSourceNode->DoBecomeA(&baContour);

( source node not included :o] )

Definition at line 200 of file pbecomea.h.


Constructor & Destructor Documentation

ContourBecomeA2::ContourBecomeA2 UndoableOperation pUndoOp,
MILLIPOINT  Width,
Path pResultPath
 

Constructor for a new ContourBecomeA, to do your contouring dirty work :o).

Definition at line 457 of file pbecomea.cpp.

00460                                     : PathBecomeA(  BECOMEA_PASSBACK,
00461                                                     CC_RUNTIME_CLASS(NodePath),
00462                                                     pUndoOp,
00463                                                     FALSE,
00464                                                     pResultPath,
00465                                                     ADD_OUTLINES )
00466 {
00467     m_Width = Width;
00468     SetDoSilhouette(TRUE);
00469     SetDoShadowSilhouettes(TRUE);
00470 }


Member Function Documentation

ContourBecomeA2::CC_DECLARE_MEMDUMP ContourBecomeA2   )  [private]
 

BOOL ContourBecomeA2::PassBack NodeRenderableInk pNewNode,
NodeRenderableInk pCreatedByNode,
CCAttrMap pAttrMap = NULL
[virtual]
 

PassBack function fer lettin' me do ma contour thang.

Parameters:
pNewNode ptr to the NodePath which you're passing in to me [INPUTS] (don't expect it back). pCreatedByNode ptr to the node which created the NodePath - useful to me if you don't supply an attr-map. pAttrMap ptr to an attr-map for me to get line attributes out of when I stroke the path. Not compulsory
pResultPath will contain the result of doing a contour outwards from the [OUTPUTS] DoBecomeA-ing objects.
Returns:
TRUE if successful, FALSE if not.

Reimplemented from PathBecomeA.

Definition at line 497 of file pbecomea.cpp.

00500 {
00501     Path* pContourPath          = NULL;
00502     Path* pSummedContourPath    = m_pResultPath;
00503 
00504     m_pResultPath = new Path;
00505     BOOL    ok = (m_pResultPath != NULL);
00506     if (ok) ok = m_pResultPath->Initialise();
00507     if (ok)
00508     {
00509         PathBecomeA::PassBack(pNewNode, pCreatedByNode, pAttrMap);
00510         ok = (m_pResultPath->GetNumCoords() != 0);
00511     }
00512     if (ok)
00513     {
00514         pContourPath = new Path;
00515         ok = (pContourPath != NULL);
00516     }
00517     if (ok) ok = pContourPath->Initialise();
00518     if (ok)
00519     {
00520         TRACEUSER( "Karim", _T("Node at 0x%x; ResultPath - %d coords.\n"),
00521                             pCreatedByNode,
00522                             m_pResultPath->GetNumCoords());
00523 
00524         m_pResultPath->InitializeContourValues(2 * m_Width);
00525         m_pResultPath->GetContourForStep(pContourPath);
00526 
00527         delete m_pResultPath;
00528         m_pResultPath = pSummedContourPath;
00529 
00530         if (pContourPath->GetNumCoords() != 0)
00531             pContourPath->ClipPathToPath(*m_pResultPath, m_pResultPath, 7, 20, 75, 75);
00532 
00533         if (!m_pResultPath->IsFilled)
00534             m_pResultPath->IsFilled = TRUE;
00535 
00536         delete pContourPath;
00537     }
00538 
00539     return ok;
00540 }


Member Data Documentation

MILLIPOINT ContourBecomeA2::m_Width [protected]
 

Definition at line 215 of file pbecomea.h.


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