XPFCMould Class Reference

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

#include <xpfcaps.h>

Inheritance diagram for XPFCMould:

XPFCComplexClass XPFCapability List of all members.

Public Member Functions

 XPFCMould (XPFConvertType ConvertType, XPFProp Type, XPFBOOL bGradFill)
virtual ~XPFCMould ()

Protected Member Functions

virtual BOOL DoesNodeMatch (Node *pNode)
BOOL HasGraduatedFill (Node *pNode)
 This determines if a mould uses any attributes that will not render correctly if converted to simple shapes.

Protected Attributes

XPFProp m_Type
XPFBOOL m_bGradFill

Private Member Functions

 CC_DECLARE_MEMDUMP (XPFCMould)

Detailed Description

This is the class for Mould capabilities.

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

Definition at line 504 of file xpfcaps.h.


Constructor & Destructor Documentation

XPFCMould::XPFCMould XPFConvertType  ConvertType,
XPFProp  Type,
XPFBOOL  bGradFill
[inline]
 

Definition at line 510 of file xpfcaps.h.

00511         : XPFCComplexClass(CC_RUNTIME_CLASS(NodeMould), ConvertType)
00512     {
00513         m_Type = Type;
00514         m_bGradFill = bGradFill;
00515     }

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

Definition at line 516 of file xpfcaps.h.

00517     {
00518     }


Member Function Documentation

XPFCMould::CC_DECLARE_MEMDUMP XPFCMould   )  [private]
 

BOOL XPFCMould::DoesNodeMatch Node pNode  )  [protected, virtual]
 

Reimplemented from XPFCComplexClass.

Definition at line 464 of file xpfcaps.cpp.

00465 {
00466     // If we aren't the correct type of node then return
00467     if (!XPFCComplexClass::DoesNodeMatch(pNode))
00468         return(FALSE);
00469 
00470     NodeMould* pMould = (NodeMould*)pNode;
00471 
00472     // Now test the property attributes
00473     if (m_Type != XPFP_UNKNOWN && pMould->DescribeGeometry() != m_Type)
00474         return(FALSE);
00475 
00476     if (m_bGradFill != XPFB_UNKNOWN)
00477     {
00478         // Scan story for non-plain attributes
00479         BOOL bGradFill = HasGraduatedFill(pNode);
00480         TRACEUSER( "Gerry", _T("HasGraduatedFill returned %s\n"), bGradFill ? _T("true") : _T("false"));
00481         if (bGradFill != m_bGradFill)
00482             return(FALSE);
00483     }
00484 
00485     return(TRUE);
00486 }

BOOL XPFCMould::HasGraduatedFill Node pNode  )  [protected]
 

This determines if a mould uses any attributes that will not render correctly if converted to simple shapes.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/08/2005
Returns:
TRUE if the node contains any fills or transparencies that require perspectivised rendering.

Definition at line 502 of file xpfcaps.cpp.

00503 {
00504 //  TRACEUSER( "Gerry", _T("HasGraduatedFill(%s)\n"), pNode->GetRuntimeClass()->m_lpszClassName);
00505 
00506     // If the node has children then we must loop through them testing each
00507     Node* pChild = pNode->FindFirstChild();
00508     while (pChild)
00509     {
00510         if (HasGraduatedFill(pChild))
00511             return(TRUE);
00512 
00513         pChild = pChild->FindNext();
00514     }
00515 
00516     if (pNode->IsAnAttribute())
00517     {
00518         NodeAttribute* pAttr = (NodeAttribute*)pNode;
00519 
00520         // These don't return a sensible value from GetAttributeIndex so 
00521         // we have to check the runtime class
00522         if (pAttr->GetAttributeType() == CC_RUNTIME_CLASS(AttrFillGeometry) ||
00523             pAttr->GetAttributeType() == CC_RUNTIME_CLASS(AttrTranspFillGeometry))
00524         {
00525             if (!pAttr->IsAFlatFill())
00526                 return(TRUE);
00527         }
00528     }
00529 
00530     // We've got this far so there are no perspectivisable fills and we can return FALSE
00531     return(FALSE);
00532 }


Member Data Documentation

XPFBOOL XPFCMould::m_bGradFill [protected]
 

Definition at line 526 of file xpfcaps.h.

XPFProp XPFCMould::m_Type [protected]
 

Definition at line 525 of file xpfcaps.h.


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