#include <xpfcaps.h>
Inheritance diagram for XPFCLine:
Public Member Functions | |
XPFCLine (XPFConvertType ConvertType, XPFBOOL bDash, XPFBOOL bArrowhead, XPFProp Cap, XPFProp Join, XPFBOOL bStroke, XPFBOOL bBrush) | |
virtual | ~XPFCLine () |
Protected Member Functions | |
virtual BOOL | DoAttributesMatch (RenderRegion *pRegion) |
Protected Attributes | |
XPFBOOL | m_bDash |
XPFBOOL | m_bArrowhead |
XPFProp | m_Cap |
XPFProp | m_Join |
XPFBOOL | m_bStroke |
XPFBOOL | m_bBrush |
Private Member Functions | |
CC_DECLARE_MEMDUMP (XPFCLine) |
Definition at line 874 of file xpfcaps.h.
|
Definition at line 880 of file xpfcaps.h. 00881 : XPFCapability(ConvertType) 00882 { 00883 m_bDash = bDash; 00884 m_bArrowhead = bArrowhead; 00885 m_Cap = Cap; 00886 m_Join = Join; 00887 m_bStroke = bStroke; 00888 m_bBrush = bBrush; 00889 }
|
|
Definition at line 890 of file xpfcaps.h.
|
|
|
|
Reimplemented from XPFCapability. Definition at line 922 of file xpfcaps.cpp. 00923 { 00924 StrokeColourAttribute* pStrokeCol = (StrokeColourAttribute*)(pRegion->GetCurrentAttribute(ATTR_STROKECOLOUR)); 00925 BOOL bNoStroke = pStrokeCol->Colour.IsTransparent(); 00926 00927 // If this item specifies the dash property 00928 if (m_bDash != XPFB_UNKNOWN) 00929 { 00930 DashPatternAttribute NoDash; 00931 // Get the dash pattern attribute from the render region 00932 DashPatternAttribute* pDash = (DashPatternAttribute*)(pRegion->GetCurrentAttribute(ATTR_DASHPATTERN)); 00933 if (bNoStroke) 00934 pDash = &NoDash; 00935 // If the attribute is the "no dash" and m_bDash is TRUE or 00936 // the attribute is not "no dash" and m_bDash is FALSE 00937 // then we do not match 00938 if (m_bDash != NoDash.IsDifferent(pDash)) 00939 return(FALSE); 00940 } 00941 00942 // If this item specifies the arrowhead property 00943 if (m_bArrowhead != XPFB_UNKNOWN) 00944 { 00945 StartArrowAttribute DefStart; 00946 EndArrowAttribute DefEnd; 00947 00948 // Get the arrow attributes from the render region 00949 StartArrowAttribute* pStart = (StartArrowAttribute*)(pRegion->GetCurrentAttribute(ATTR_STARTARROW)); 00950 if (bNoStroke) 00951 pStart = &DefStart; 00952 EndArrowAttribute* pEnd = (EndArrowAttribute*)(pRegion->GetCurrentAttribute(ATTR_ENDARROW)); 00953 if (bNoStroke) 00954 pEnd = &DefEnd; 00955 00956 BOOL bHasStart = DefStart.IsDifferent(pStart); 00957 BOOL bHasEnd = DefEnd.IsDifferent(pEnd); 00958 00959 if (m_bArrowhead != (bHasStart | bHasEnd)) 00960 return(FALSE); 00961 } 00962 00963 // If this item specifies the cap property 00964 if (m_Cap != XPFB_UNKNOWN) 00965 { 00966 // Get the dash pattern attribute from the render region 00967 StartCapAttribute* pCap = (StartCapAttribute*)(pRegion->GetCurrentAttribute(ATTR_STARTCAP)); 00968 if (m_Cap != pCap->StartCap) 00969 return(FALSE); 00970 } 00971 00972 // If this item specifies the join property 00973 if (m_Join != XPFB_UNKNOWN) 00974 { 00975 // Get the dash pattern attribute from the render region 00976 JoinTypeAttribute* pJoin = (JoinTypeAttribute*)(pRegion->GetCurrentAttribute(ATTR_JOINTYPE)); 00977 if (m_Join != pJoin->JoinType) 00978 return(FALSE); 00979 } 00980 00981 // If this item specifies the stroke property 00982 if (m_bStroke != XPFB_UNKNOWN) 00983 { 00984 StrokeTypeAttrValue DefStroke; 00985 VariableWidthAttrValue DefVarWidth; 00986 00987 // Get the attributes from the render region 00988 StrokeTypeAttrValue* pStroke = (StrokeTypeAttrValue*)(pRegion->GetCurrentAttribute(ATTR_STROKETYPE)); 00989 VariableWidthAttrValue* pVarWidth = (VariableWidthAttrValue*)(pRegion->GetCurrentAttribute(ATTR_VARWIDTH)); 00990 if (bNoStroke) 00991 { 00992 pStroke = &DefStroke; 00993 pVarWidth = &DefVarWidth; 00994 } 00995 00996 BOOL bStroke = !(((*pStroke) == DefStroke) && ((*pVarWidth) == DefVarWidth)); 00997 if (m_bStroke != bStroke) 00998 return(FALSE); 00999 } 01000 01001 // If this item specifies the brush property 01002 if (m_bBrush != XPFB_UNKNOWN) 01003 { 01004 BrushAttrValue DefBrush; 01005 01006 // Get the dash pattern attribute from the render region 01007 BrushAttrValue* pBrush = (BrushAttrValue*)(pRegion->GetCurrentAttribute(ATTR_BRUSHTYPE)); 01008 if (bNoStroke) 01009 pBrush = &DefBrush; 01010 01011 if (m_bBrush != DefBrush.IsDifferent(pBrush)) 01012 return(FALSE); 01013 } 01014 01015 return(TRUE); 01016 }
|
|
|
|
|
|
|
|
|
|
|
|
|