XPFCFill Class Reference

This is the class for Fill capabilities. More...

#include <xpfcaps.h>

Inheritance diagram for XPFCFill:

XPFCapability List of all members.

Public Member Functions

 XPFCFill (XPFConvertType ConvertType, XPFProp Shape, XPFProp Repeat, XPFBOOL bMultistage, XPFProp Effect, XPFBOOL bProfile, XPFBOOL bContone)
virtual ~XPFCFill ()

Protected Member Functions

virtual BOOL DoAttributesMatch (RenderRegion *pRegion)

Protected Attributes

XPFProp m_Shape
XPFProp m_Repeat
XPFBOOL m_bMultistage
XPFProp m_Effect
XPFBOOL m_bProfile
XPFBOOL m_bContone

Private Member Functions

 CC_DECLARE_MEMDUMP (XPFCFill)

Detailed Description

This is the class for Fill capabilities.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/01/05

Definition at line 790 of file xpfcaps.h.


Constructor & Destructor Documentation

XPFCFill::XPFCFill XPFConvertType  ConvertType,
XPFProp  Shape,
XPFProp  Repeat,
XPFBOOL  bMultistage,
XPFProp  Effect,
XPFBOOL  bProfile,
XPFBOOL  bContone
[inline]
 

Definition at line 796 of file xpfcaps.h.

00797         : XPFCapability(ConvertType)
00798     {
00799         m_Shape = Shape;
00800         m_Repeat = Repeat;
00801         m_bMultistage = bMultistage;
00802         m_Effect = Effect;
00803         m_bProfile = bProfile;
00804         m_bContone = bContone;
00805     }

virtual XPFCFill::~XPFCFill  )  [inline, virtual]
 

Definition at line 806 of file xpfcaps.h.

00807     {
00808     }


Member Function Documentation

XPFCFill::CC_DECLARE_MEMDUMP XPFCFill   )  [private]
 

BOOL XPFCFill::DoAttributesMatch RenderRegion pRegion  )  [protected, virtual]
 

Reimplemented from XPFCapability.

Definition at line 744 of file xpfcaps.cpp.

00745 {
00746     // If this item specifies the shape property
00747     if (m_Shape != XPFB_UNKNOWN)
00748     {
00749         // Get the fill attribute from the render region
00750         ColourFillAttribute* pFill = (ColourFillAttribute*)(pRegion->GetCurrentAttribute(ATTR_FILLGEOMETRY));
00751         if (m_Shape != pFill->GetGeometryShape())
00752             return(FALSE);
00753     }
00754 
00755     // If this item specifies the repeat property
00756     if (m_Repeat != XPFB_UNKNOWN)
00757     {
00758         // Get the fill repeat attribute from the render region
00759         INT32 Shape = ((ColourFillAttribute*)(pRegion->GetCurrentAttribute(ATTR_FILLGEOMETRY)))->GetGeometryShape();
00760         if (Shape != FILLSHAPE_FLAT)
00761         {
00762             INT32 Repeat = ((FillMappingAttribute*)(pRegion->GetCurrentAttribute(ATTR_FILLMAPPING)))->Repeat;
00763             switch (Repeat)
00764             {
00765                 case XPFP_FILLREPEAT_REPEAT:
00766                     if (Shape >= FILLSHAPE_FLAT && Shape <= FILLSHAPE_DIAMOND)
00767                         Repeat = XPFP_FILLREPEAT_SIMPLE;
00768                     break;
00769 
00770                 case XPFP_FILLREPEAT_REPEATINV:
00771                     if (Shape >= FILLSHAPE_FLAT && Shape <= FILLSHAPE_DIAMOND)
00772                         Repeat = XPFP_FILLREPEAT_SIMPLE;
00773                     break;
00774 
00775                 case XPFP_FILLREPEAT_REPEATEXTRA:
00776                     if (Shape >= FILLSHAPE_BITMAP && Shape <= FILLSHAPE_PLASMA)
00777                         Repeat = XPFP_FILLREPEAT_SIMPLE;
00778                     break;
00779             }
00780             if (m_Repeat != Repeat)
00781                 return(FALSE);
00782         }
00783     }
00784 
00785     // If this item specifies the multistage property
00786     if (m_bMultistage != XPFB_UNKNOWN)
00787     {
00788         // Get the fill attribute from the render region
00789         ColourFillAttribute* pFill = (ColourFillAttribute*)(pRegion->GetCurrentAttribute(ATTR_FILLGEOMETRY));
00790         BOOL bMulti = (pFill->GetColourRamp() != NULL && pFill->GetColourRamp()->GetCount() > 0);
00791         if (m_bMultistage != bMulti)
00792             return(FALSE);
00793     }
00794     
00795     // If this item specifies the effect property
00796     if (m_Effect != XPFB_UNKNOWN)
00797     {
00798         ColourFillAttribute* pFill = ((ColourFillAttribute*)(pRegion->GetCurrentAttribute(ATTR_FILLGEOMETRY)));
00799         INT32 Shape = pFill->GetGeometryShape();
00800         if (Shape != FILLSHAPE_FLAT && Shape != FILLSHAPE_3POINT && Shape != FILLSHAPE_4POINT)
00801         {
00802             BOOL bCheckEffect = TRUE;
00803             // If it is a bitmap or fractal fill and has no colours then ignore the effect
00804             if (Shape == FILLSHAPE_BITMAP || Shape == FILLSHAPE_CLOUDS || Shape == FILLSHAPE_PLASMA)
00805             {
00806                 if (pFill->GetStartColour() == NULL && pFill->GetEndColour() == NULL)
00807                     bCheckEffect = FALSE;
00808             }
00809         
00810             if (bCheckEffect)
00811             {
00812                 // Get the fill effect from the render region
00813                 EFFECTTYPE Effect = pRegion->GetFillEffect();
00814                 if (m_Effect != Effect)
00815                     return(FALSE);
00816             }
00817         }
00818     }
00819     
00820     // If this item specifies the profile property
00821     if (m_bProfile != XPFB_UNKNOWN)
00822     {
00823         // Get the fill attribute from the render region
00824         ColourFillAttribute* pFill = (ColourFillAttribute*)(pRegion->GetCurrentAttribute(ATTR_FILLGEOMETRY));
00825 
00826         CProfileBiasGain DefaultProfile;
00827     
00828         BOOL bProfile = !(*(pFill->GetProfilePtr()) == DefaultProfile);
00829         if (m_bProfile != bProfile)
00830             return(FALSE);
00831     }
00832 
00833     // If this item specifies the contone property
00834     if (m_bContone != XPFB_UNKNOWN)
00835     {
00836         // Get the fill attribute from the render region
00837         ColourFillAttribute* pFill = (ColourFillAttribute*)(pRegion->GetCurrentAttribute(ATTR_FILLGEOMETRY));
00838         if (pFill->GetGeometryShape() == FILLSHAPE_BITMAP)
00839         {
00840             BOOL bContone = (pFill->GetStartColour() != NULL) || (pFill->GetEndColour() != NULL);
00841             if (m_bContone != bContone)
00842                 return(FALSE);
00843         }
00844     }
00845 
00846     return(TRUE);
00847 }


Member Data Documentation

XPFBOOL XPFCFill::m_bContone [protected]
 

Definition at line 820 of file xpfcaps.h.

XPFBOOL XPFCFill::m_bMultistage [protected]
 

Definition at line 817 of file xpfcaps.h.

XPFBOOL XPFCFill::m_bProfile [protected]
 

Definition at line 819 of file xpfcaps.h.

XPFProp XPFCFill::m_Effect [protected]
 

Definition at line 818 of file xpfcaps.h.

XPFProp XPFCFill::m_Repeat [protected]
 

Definition at line 816 of file xpfcaps.h.

XPFProp XPFCFill::m_Shape [protected]
 

Definition at line 815 of file xpfcaps.h.


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