BevelAttributePathProcessor Class Reference

This is the path processor which is used by the AttrBevelType node to do passbacks etc. More...

#include <ppbevel.h>

Inheritance diagram for BevelAttributePathProcessor:

PathProcessor CCObject SimpleCCObject List of all members.

Public Member Functions

 BevelAttributePathProcessor ()
 Constructor.
 ~BevelAttributePathProcessor ()
 Destructor.
void SetIndent (MILLIPOINT Indent)
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.
PathGetSummedPath ()
PathGetStrokedPath ()

Private Member Functions

 CC_DECLARE_DYNAMIC (BevelAttributePathProcessor)

Private Attributes

Path m_SummedPath
Path m_StrokedPath
MILLIPOINT m_Indent

Detailed Description

This is the path processor which is used by the AttrBevelType node to do passbacks etc.

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

Definition at line 155 of file ppbevel.h.


Constructor & Destructor Documentation

BevelAttributePathProcessor::BevelAttributePathProcessor  ) 
 

Constructor.

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

Definition at line 729 of file ppbevel.cpp.

00730 {
00731     m_SummedPath.Initialise();
00732     m_StrokedPath.Initialise();
00733     m_Indent = 0;
00734 }

BevelAttributePathProcessor::~BevelAttributePathProcessor  ) 
 

Destructor.

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

Definition at line 747 of file ppbevel.cpp.

00748 {
00749 
00750 }


Member Function Documentation

BevelAttributePathProcessor::CC_DECLARE_DYNAMIC BevelAttributePathProcessor   )  [private]
 

Path* BevelAttributePathProcessor::GetStrokedPath  )  [inline]
 

Definition at line 170 of file ppbevel.h.

00170 { return & m_StrokedPath; }

Path* BevelAttributePathProcessor::GetSummedPath  )  [inline]
 

Definition at line 169 of file ppbevel.h.

00169 { return &m_SummedPath; }

void BevelAttributePathProcessor::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 765 of file ppbevel.cpp.

00768 {
00769 //  PORTNOTETRACE("other","BevelAttributePathProcessor::PreOpProcessing - do nothing");
00770 //#ifndef EXCLUDE_FROM_XARALX
00771     // pRender->DrawPath(pPath, this);
00772 
00773     // clip the path to itself
00774     Path BlankPath;
00775     BlankPath.Initialise();
00776 
00777     Path SafePath;
00778     SafePath.Initialise();
00779 
00780     pPath->ClipPathToPath(BlankPath, &SafePath, 6, BevelPathProcessor_Tolerance, 
00781         BevelPathProcessor_Flatness,
00782         BevelPathProcessor_Flatness);
00783 
00784     // now, sum the path
00785     m_SummedPath.MergeTwoPaths(SafePath);
00786 
00787     Path StrokedPath;
00788     StrokedPath.Initialise();
00789 
00790     SafePath.StrokePathToPath(abs(m_Indent)*2,
00791                             LineCapButt,
00792                             RoundJoin,
00793                             NULL,
00794                             &StrokedPath,
00795                             BevelPathProcessor_Flatness,
00796                             FALSE);
00797 
00798     // now, clip this path against the original (i.e. the passed in) path to
00799     // produce the final clipped path
00800     Path ClippedPath;
00801     ClippedPath.Initialise();
00802 
00803     // shrink the clipped path
00804     Path ShrunkPath;
00805     ShrunkPath.Initialise();
00806 
00807     if (m_Indent < 0)
00808     {
00809         pPath->ClipPathToPath(StrokedPath, &ClippedPath, 7 | CLIPPING_SOURCE_WINDING,
00810             BevelPathProcessor_Tolerance, BevelPathProcessor_Flatness,
00811             BevelPathProcessor_Flatness);
00812 
00813         BevelHelpers::ShrinkPath(&ClippedPath, pRender->GetScaledPixelWidth(), pRender->GetScaledPixelWidth(),
00814                             &ShrunkPath, FALSE);
00815 
00816         ClippedPath.CloneFrom(ShrunkPath);
00817 
00818         // merge the original path (reversed) into this path to produce a hole for 
00819         // outer bevels
00820         Path ReversedPath;
00821         ReversedPath.Initialise();
00822         ReversedPath.CloneFrom(SafePath);
00823         ReversedPath.Reverse();
00824         ClippedPath.MergeTwoPaths(ReversedPath);
00825     }
00826     else
00827     {
00828         pPath->ClipPathToPath(StrokedPath, &ClippedPath, 2 | CLIPPING_SOURCE_WINDING,
00829             BevelPathProcessor_Tolerance, BevelPathProcessor_Flatness,
00830             BevelPathProcessor_Flatness);
00831 
00832         BevelHelpers::ShrinkPath(&ClippedPath, pRender->GetScaledPixelWidth(), pRender->GetScaledPixelWidth(),
00833                             &ShrunkPath, FALSE);
00834 
00835         ClippedPath.CloneFrom(ShrunkPath);      
00836     }
00837 
00838     // merge this path with the stroked path member variable - as the attribute needs
00839     // it too
00840     m_StrokedPath.MergeTwoPaths(ClippedPath);
00841 
00842     // render the path with the same parameters
00843     ClippedPath.IsFilled = TRUE;
00844     ClippedPath.IsStroked = FALSE;
00845 
00846     pRender->SaveContext();
00847     pRender->SetLineColour(COLOUR_NONE);
00848 
00849     pRender->DrawPath(&ClippedPath, this, ShapePath);
00850     pRender->RestoreContext();
00851 //#endif
00852 }

void BevelAttributePathProcessor::SetIndent MILLIPOINT  Indent  )  [inline]
 

Definition at line 162 of file ppbevel.h.

00162 { m_Indent = Indent; }


Member Data Documentation

MILLIPOINT BevelAttributePathProcessor::m_Indent [private]
 

Definition at line 174 of file ppbevel.h.

Path BevelAttributePathProcessor::m_StrokedPath [private]
 

Definition at line 173 of file ppbevel.h.

Path BevelAttributePathProcessor::m_SummedPath [private]
 

Definition at line 172 of file ppbevel.h.


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