CapabilityTree Class Reference

This is the class representing the wntire capability tree. More...

#include <xpfcaps.h>

List of all members.

Public Member Functions

 CapabilityTree ()
virtual ~CapabilityTree ()
XPFConvertType GetConvertTypePass1 (Node *pNode, XPFRenderRegion *pRegion)
XPFConvertType GetConvertTypePass2 (Node *pNode, XPFRenderRegion *pRegion)
void GetConvertTypePass3 (Node *pNode, XPFRenderRegion *pRegion, BOOL *pbFill, BOOL *pbTrans, BOOL *pbFillTrans)
XPFConvertType GetConvertTypePass4 (Node *pNode, XPFRenderRegion *pRegion)
XPFConvertType GetConvertTypePass5 (Node *pNode, XPFRenderRegion *pRegion)
void SetSelection (BOOL bSelection)
void SetBoundsLevel (BoundsWriteLevel Level)
void SetPreviewBitmap (BOOL bPreviewBitmap)
void SetSpreadType (XPFConvertType Type)
void SetRasterise (double DPI, BOOL bAlpha, INT32 Compression, const String_256 &CommonTrans, BOOL bResample)
void SetObjectsTree (XPFCapability *pObjects, XPFConvertType ObjectsType)
void SetAttributesTree (XPFCapability *pAttributes, XPFConvertType AttributesType)
void SetColoursTree (XPFCapability *pColours, XPFConvertType ColoursType)
BOOL GetSelection ()
BoundsWriteLevel GetBoundsLevel ()
BOOL GetPreviewBitmap ()
double GetRasteriseDPI ()
BOOL GetRasteriseAlpha ()
BOOL GetBitmapCompression ()
BOOL HasRasteriseCommonTrans ()
BOOL IsRasteriseCommonTrans (UINT32 Type)
BOOL GetBitmapResample ()
XPFCapabilityGetObjects (void) const
XPFCapabilityGetAttributes (void) const
XPFCapabilityGetColours (void) const
XPFConvertType GetObjectsType (void) const
XPFConvertType GetAttributesType (void) const
XPFConvertType GetColoursType (void) const

Protected Attributes

BoundsWriteLevel m_BoundsLevel
BOOL m_bSelection
BOOL m_bPreviewBitmap
double m_RasteriseDPI
BOOL m_bRasteriseAlpha
INT32 m_BitmapCompression
String_256 m_CommonTrans
BOOL m_bResample
XPFConvertType m_SpreadType
XPFCapabilitym_pObjects
XPFConvertType m_ObjectsType
XPFCapabilitym_pAttributes
XPFConvertType m_AttributesType
XPFCapabilitym_pColours
XPFConvertType m_ColoursType

Private Member Functions

 CC_DECLARE_MEMDUMP (CapabilityTree)


Detailed Description

This is the class representing the wntire capability tree.

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

Definition at line 1021 of file xpfcaps.h.


Constructor & Destructor Documentation

CapabilityTree::CapabilityTree  )  [inline]
 

Definition at line 1027 of file xpfcaps.h.

01028     {
01029         // Set some sensible defaults (these will result in no conversions at all)
01030         m_BoundsLevel = BWL_NONE;
01031         m_bSelection = FALSE;
01032         m_bPreviewBitmap = FALSE;
01033         m_RasteriseDPI = 96.0;
01034         m_bRasteriseAlpha = TRUE;
01035         m_BitmapCompression = 200;
01036         m_bResample = FALSE;
01037         m_SpreadType = XPFCONVTYPE_NATIVE;
01038         m_pObjects = NULL;
01039         m_ObjectsType = XPFCONVTYPE_NATIVE;
01040         m_pAttributes = NULL;
01041         m_AttributesType = XPFCONVTYPE_NATIVE;
01042         m_pColours = NULL;
01043         m_ColoursType = XPFCONVTYPE_NATIVE;
01044     }

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

Definition at line 1045 of file xpfcaps.h.

01046     {
01047         // Clean up the capability trees
01048         XPFCapability* pNext = NULL;
01049         XPFCapability* pCap = m_pObjects;
01050         while (pCap)
01051         {
01052             pNext = pCap->GetNext();
01053             delete pCap;
01054             pCap = pNext;
01055         }
01056 
01057         pCap = m_pAttributes;
01058         while (pCap)
01059         {
01060             pNext = pCap->GetNext();
01061             delete pCap;
01062             pCap = pNext;
01063         }
01064 
01065         pCap = m_pColours;
01066         while (pCap)
01067         {
01068             pNext = pCap->GetNext();
01069             delete pCap;
01070             pCap = pNext;
01071         }
01072     }


Member Function Documentation

CapabilityTree::CC_DECLARE_MEMDUMP CapabilityTree   )  [private]
 

XPFCapability* CapabilityTree::GetAttributes void   )  const [inline]
 

Definition at line 1129 of file xpfcaps.h.

01129 { return(m_pAttributes); }

XPFConvertType CapabilityTree::GetAttributesType void   )  const [inline]
 

Definition at line 1133 of file xpfcaps.h.

01133 { return(m_AttributesType); }

BOOL CapabilityTree::GetBitmapCompression  )  [inline]
 

Definition at line 1122 of file xpfcaps.h.

01122 { return(m_BitmapCompression); }

BOOL CapabilityTree::GetBitmapResample  )  [inline]
 

Definition at line 1126 of file xpfcaps.h.

01126 { return(m_bResample); }

BoundsWriteLevel CapabilityTree::GetBoundsLevel  )  [inline]
 

Definition at line 1117 of file xpfcaps.h.

01117 { return(m_BoundsLevel); }

XPFCapability* CapabilityTree::GetColours void   )  const [inline]
 

Definition at line 1130 of file xpfcaps.h.

01130 { return(m_pColours); }

XPFConvertType CapabilityTree::GetColoursType void   )  const [inline]
 

Definition at line 1134 of file xpfcaps.h.

01134 { return(m_ColoursType); }

XPFConvertType CapabilityTree::GetConvertTypePass1 Node pNode,
XPFRenderRegion pRegion
 

Definition at line 1103 of file xpfcaps.cpp.

01104 {
01105     if (pNode->IsAnAttribute())
01106     {
01107         return(XPFCONVTYPE_NATIVE);
01108     }
01109 
01110     // First we need to check for spreads and layers, returning the appropriate type
01111     if (pNode->IsSpread())
01112         return(m_SpreadType);
01113 
01114     XPFCapability* pItem = GetObjects();
01115     XPFConvertType Type = GetObjectsType();
01116         
01117     while (pItem)
01118     {
01119         XPFConvertType ItemType = pItem->GetConvertTypeForNode(pNode);
01120         if (ItemType != XPFCONVTYPE_UNKNOWN)
01121             Type = ItemType;
01122 
01123         pItem = pItem->GetNext();
01124     }
01125 
01126     if (Type != XPFCONVTYPE_NATIVE && 
01127         Type != XPFCONVTYPE_REMOVE && 
01128         Type != XPFCONVTYPE_SIMPLE && 
01129         Type != XPFCONVTYPE_BITMAP &&
01130         Type != XPFCONVTYPE_REFORMAT)
01131         Type = XPFCONVTYPE_NATIVE;
01132 
01133     return(Type);
01134 }

XPFConvertType CapabilityTree::GetConvertTypePass2 Node pNode,
XPFRenderRegion pRegion
 

Definition at line 1142 of file xpfcaps.cpp.

01143 {
01144     XPFConvertType Type = GetAttributesType();
01145     XPFCapability* pItem = GetAttributes();
01146     while (pItem)
01147     {
01148         XPFConvertType ItemType = pItem->GetConvertTypeForAttrs(pRegion);
01149         if (ItemType == XPFCONVTYPE_STROKED)
01150             Type = ItemType;
01151 
01152         pItem = pItem->GetNext();
01153     }
01154 
01155     if (Type != XPFCONVTYPE_NATIVE && Type != XPFCONVTYPE_STROKED)
01156         Type = XPFCONVTYPE_NATIVE;
01157 
01158     return(Type);
01159 }

void CapabilityTree::GetConvertTypePass3 Node pNode,
XPFRenderRegion pRegion,
BOOL *  pbFill,
BOOL *  pbTrans,
BOOL *  pbFillTrans
 

Definition at line 1166 of file xpfcaps.cpp.

01167 {
01168     XPFConvertType FillType = GetAttributesType();
01169     XPFConvertType TransType = FillType;
01170     XPFConvertType BothType = FillType;
01171     XPFCapability* pItem = GetAttributes();
01172     while (pItem)
01173     {
01174         XPFConvertType ItemType = pItem->GetConvertTypeForAttrs(pRegion);
01175         if (ItemType == XPFCONVTYPE_BITMAPFILL)
01176             FillType = ItemType;
01177         if (ItemType == XPFCONVTYPE_BITMAPTRANS)
01178             TransType = ItemType;
01179         if (ItemType == XPFCONVTYPE_BITMAPFILLTRANS)
01180             BothType = ItemType;
01181 
01182         pItem = pItem->GetNext();
01183     }
01184 
01185     *pbFill = (FillType == XPFCONVTYPE_BITMAPFILL);
01186     *pbTrans = (TransType == XPFCONVTYPE_BITMAPTRANS);
01187     *pbFillTrans = (BothType == XPFCONVTYPE_BITMAPFILLTRANS);
01188 }

XPFConvertType CapabilityTree::GetConvertTypePass4 Node pNode,
XPFRenderRegion pRegion
 

Definition at line 1194 of file xpfcaps.cpp.

01195 {
01196     // This pass must NOT convert any spreads or layers to bitmap as that will 
01197     // have been done during the first pass but the spread/layer node will still 
01198     // be present in the tree
01199     if (pNode->IsSpread() || pNode->IsLayer())
01200         return(XPFCONVTYPE_NATIVE);
01201 
01202     XPFConvertType Type = GetObjectsType();
01203     XPFCapability* pItem = GetObjects();
01204     while (pItem)
01205     {
01206         XPFConvertType ItemType = pItem->GetConvertTypeForNode(pNode);
01207         if (ItemType == XPFCONVTYPE_BITMAP)
01208             Type = ItemType;
01209 
01210         pItem = pItem->GetNext();
01211     }
01212 
01213     if (Type != XPFCONVTYPE_NATIVE && Type != XPFCONVTYPE_BITMAP)
01214         Type = XPFCONVTYPE_NATIVE;
01215 
01216     return(Type);
01217 }

XPFConvertType CapabilityTree::GetConvertTypePass5 Node pNode,
XPFRenderRegion pRegion
 

Definition at line 1225 of file xpfcaps.cpp.

01226 {
01227     XPFConvertType Type = GetAttributesType();
01228     XPFCapability* pItem = GetAttributes();
01229     while (pItem)
01230     {
01231         XPFConvertType ItemType = pItem->GetConvertTypeForAttrs(pRegion);
01232         if (ItemType == XPFCONVTYPE_BITMAPSPAN)
01233             Type = ItemType;
01234 
01235         pItem = pItem->GetNext();
01236     }
01237 
01238     if (Type != XPFCONVTYPE_NATIVE && Type != XPFCONVTYPE_BITMAPSPAN)
01239         Type = XPFCONVTYPE_NATIVE;
01240 
01241     return(Type);
01242 }

XPFCapability* CapabilityTree::GetObjects void   )  const [inline]
 

Definition at line 1128 of file xpfcaps.h.

01128 { return(m_pObjects); }

XPFConvertType CapabilityTree::GetObjectsType void   )  const [inline]
 

Definition at line 1132 of file xpfcaps.h.

01132 { return(m_ObjectsType); }

BOOL CapabilityTree::GetPreviewBitmap  )  [inline]
 

Definition at line 1118 of file xpfcaps.h.

01118 { return(m_bPreviewBitmap); }

BOOL CapabilityTree::GetRasteriseAlpha  )  [inline]
 

Definition at line 1121 of file xpfcaps.h.

01121 { return(m_bRasteriseAlpha); }

double CapabilityTree::GetRasteriseDPI  )  [inline]
 

Definition at line 1120 of file xpfcaps.h.

01120 { return(m_RasteriseDPI); }

BOOL CapabilityTree::GetSelection  )  [inline]
 

Definition at line 1116 of file xpfcaps.h.

01116 { return(m_bSelection); }

BOOL CapabilityTree::HasRasteriseCommonTrans  )  [inline]
 

Definition at line 1123 of file xpfcaps.h.

01123 { return(!m_CommonTrans.IsEmpty()); }

BOOL CapabilityTree::IsRasteriseCommonTrans UINT32  Type  ) 
 

Definition at line 1070 of file xpfcaps.cpp.

01071 {
01072     String_16 TransStr;
01073 
01074     if (Type == TT_StainGlass)
01075         TransStr = _T("stained");
01076     else if (Type == TT_Bleach)
01077         TransStr = _T("bleach");
01078     else if (Type == TT_CONTRAST)
01079         TransStr = _T("contrast");
01080     else if (Type == TT_SATURATION)
01081         TransStr = _T("saturation");
01082     else if (Type == TT_LUMINOSITY)
01083         TransStr = _T("luminosity");
01084     else if (Type == TT_HUE)
01085         TransStr = _T("hue");
01086     else
01087         return(FALSE);
01088 
01089     if (camStrstr(m_CommonTrans, TransStr) != NULL)
01090         return(TRUE);
01091 
01092     return(FALSE);
01093 }

void CapabilityTree::SetAttributesTree XPFCapability pAttributes,
XPFConvertType  AttributesType
[inline]
 

Definition at line 1102 of file xpfcaps.h.

01103     {
01104         ERROR3IF(m_pAttributes, "Already have an Attributes tree");
01105         m_pAttributes = pAttributes;
01106         m_AttributesType = AttributesType;
01107     }

void CapabilityTree::SetBoundsLevel BoundsWriteLevel  Level  )  [inline]
 

Definition at line 1081 of file xpfcaps.h.

01081 { m_BoundsLevel = Level; }

void CapabilityTree::SetColoursTree XPFCapability pColours,
XPFConvertType  ColoursType
[inline]
 

Definition at line 1109 of file xpfcaps.h.

01110     {
01111         ERROR3IF(m_pColours, "Already have a Colours tree");
01112         m_pColours = pColours;
01113         m_ColoursType = ColoursType;
01114     }

void CapabilityTree::SetObjectsTree XPFCapability pObjects,
XPFConvertType  ObjectsType
[inline]
 

Definition at line 1095 of file xpfcaps.h.

01096     {
01097         ERROR3IF(m_pObjects, "Already have an Objects tree");
01098         m_pObjects = pObjects;
01099         m_ObjectsType = ObjectsType;
01100     }

void CapabilityTree::SetPreviewBitmap BOOL  bPreviewBitmap  )  [inline]
 

Definition at line 1082 of file xpfcaps.h.

01082 { m_bPreviewBitmap = bPreviewBitmap; }

void CapabilityTree::SetRasterise double  DPI,
BOOL  bAlpha,
INT32  Compression,
const String_256 CommonTrans,
BOOL  bResample
[inline]
 

Definition at line 1086 of file xpfcaps.h.

01087     {
01088         m_RasteriseDPI = DPI;
01089         m_bRasteriseAlpha = bAlpha;
01090         m_BitmapCompression = Compression;
01091         m_CommonTrans = CommonTrans;
01092         m_bResample = bResample;
01093     }

void CapabilityTree::SetSelection BOOL  bSelection  )  [inline]
 

Definition at line 1080 of file xpfcaps.h.

01080 { m_bSelection = bSelection; }

void CapabilityTree::SetSpreadType XPFConvertType  Type  )  [inline]
 

Definition at line 1084 of file xpfcaps.h.

01084 { m_SpreadType = Type; }


Member Data Documentation

XPFConvertType CapabilityTree::m_AttributesType [protected]
 

Definition at line 1153 of file xpfcaps.h.

INT32 CapabilityTree::m_BitmapCompression [protected]
 

Definition at line 1144 of file xpfcaps.h.

BoundsWriteLevel CapabilityTree::m_BoundsLevel [protected]
 

Definition at line 1138 of file xpfcaps.h.

BOOL CapabilityTree::m_bPreviewBitmap [protected]
 

Definition at line 1140 of file xpfcaps.h.

BOOL CapabilityTree::m_bRasteriseAlpha [protected]
 

Definition at line 1143 of file xpfcaps.h.

BOOL CapabilityTree::m_bResample [protected]
 

Definition at line 1146 of file xpfcaps.h.

BOOL CapabilityTree::m_bSelection [protected]
 

Definition at line 1139 of file xpfcaps.h.

XPFConvertType CapabilityTree::m_ColoursType [protected]
 

Definition at line 1155 of file xpfcaps.h.

String_256 CapabilityTree::m_CommonTrans [protected]
 

Definition at line 1145 of file xpfcaps.h.

XPFConvertType CapabilityTree::m_ObjectsType [protected]
 

Definition at line 1151 of file xpfcaps.h.

XPFCapability* CapabilityTree::m_pAttributes [protected]
 

Definition at line 1152 of file xpfcaps.h.

XPFCapability* CapabilityTree::m_pColours [protected]
 

Definition at line 1154 of file xpfcaps.h.

XPFCapability* CapabilityTree::m_pObjects [protected]
 

Definition at line 1150 of file xpfcaps.h.

double CapabilityTree::m_RasteriseDPI [protected]
 

Definition at line 1142 of file xpfcaps.h.

XPFConvertType CapabilityTree::m_SpreadType [protected]
 

Definition at line 1148 of file xpfcaps.h.


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