FeatherRecordHandler Class Reference

Handles the reading of all feather records in the v2 file format. More...

#include <fthrattr.h>

Inheritance diagram for FeatherRecordHandler:

CamelotRecordHandler CXaraFileRecordHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 FeatherRecordHandler ()
 ~FeatherRecordHandler ()
virtual UINT32GetTagList ()
virtual BOOL HandleRecord (CXaraFileRecord *pCXaraFileRecord)

Private Member Functions

 CC_DECLARE_DYNAMIC (FeatherRecordHandler)
BOOL HandleFeatherRecord (CXaraFileRecord *pCXaraFileRecord)

Detailed Description

Handles the reading of all feather records in the v2 file format.

Author:
Mark_Howitt (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/5/96
See also:
-

Definition at line 408 of file fthrattr.h.


Constructor & Destructor Documentation

FeatherRecordHandler::FeatherRecordHandler  )  [inline]
 

Definition at line 414 of file fthrattr.h.

00414 : CamelotRecordHandler() {}

FeatherRecordHandler::~FeatherRecordHandler  )  [inline]
 

Definition at line 415 of file fthrattr.h.

00415 {}


Member Function Documentation

FeatherRecordHandler::CC_DECLARE_DYNAMIC FeatherRecordHandler   )  [private]
 

UINT32 * FeatherRecordHandler::GetTagList  )  [virtual]
 

Implements CXaraFileRecordHandler.

Definition at line 2251 of file fthrattr.cpp.

02252 {
02253     static UINT32 TagList[] = {TAG_FEATHER,CXFRH_TAG_LIST_END};
02254     return (UINT32*)&TagList;
02255 }

BOOL FeatherRecordHandler::HandleFeatherRecord CXaraFileRecord pCXaraFileRecord  )  [private]
 

Definition at line 2277 of file fthrattr.cpp.

02278 {
02279     BOOL ok = TRUE;
02280 
02281     MILLIPOINT FeatherSz;
02282     double Bias = 0, Gain = 0;
02283     double* ptrBias = &Bias, *ptrGain = &Gain;
02284 
02285     // Read in the feather data
02286     if (ok) ok = pCXaraFileRecord->ReadINT32(&FeatherSz);
02287     if (ok) ok = pCXaraFileRecord->ReadDOUBLEnoError (ptrBias);
02288     if (ok) ok = pCXaraFileRecord->ReadDOUBLEnoError (ptrGain);
02289 
02290     CProfileBiasGain Profile;
02291 
02292     if ((ptrBias != NULL) && (ptrGain != NULL))
02293     {
02294         Profile.SetBias((AFp) Bias);
02295         Profile.SetGain((AFp) Gain);
02296     }
02297 
02298     if (ok)
02299     {
02300         AttrFeather* pAttr = new AttrFeather;
02301         if (pAttr != NULL)
02302         {
02303             // Get a ptr to the attr value object
02304             FeatherAttrValue* pValue = (FeatherAttrValue*)&pAttr->Value;
02305 
02306             if (pValue != NULL)
02307             {
02308                 // Set the feather size
02309                 pValue->SetFeatherSize(FeatherSz);
02310 
02311                 // Set the profile
02312                 pValue->SetFeatherProfile(Profile);
02313                 
02314                 if (ok) ok = InsertNode(pAttr);
02315 
02316                 // Set the m_Node pointer (TODO remove)
02317                 if (ok && pBaseCamelotFilter->GetInsertMode()==INSERTMODE_ATTACHTOTREE)
02318                     pValue->SetLinkedNode((NodeRenderableBounded*)pAttr->FindParent());
02319             }
02320             else
02321                 ok = FALSE;
02322         }
02323         else
02324             ok = FALSE;
02325     }
02326 
02327     return ok;
02328 }

BOOL FeatherRecordHandler::HandleRecord CXaraFileRecord pCXaraFileRecord  )  [virtual]
 

Implements CXaraFileRecordHandler.

Definition at line 2257 of file fthrattr.cpp.

02258 {
02259     ERROR2IF(pCXaraFileRecord == NULL,FALSE,"pCXaraFileRecord is NULL");
02260     BOOL ok = TRUE;
02261 
02262     switch (pCXaraFileRecord->GetTag())
02263     {
02264         case TAG_FEATHER:
02265             ok = HandleFeatherRecord(pCXaraFileRecord);
02266             break;
02267 
02268         default:
02269             ok = FALSE;
02270             ERROR3_PF(("Incorrect tag supplied to HandleRecord. Tag = (%d)\n",pCXaraFileRecord->GetTag()));
02271             break;
02272     }
02273 
02274     return ok;
02275 }


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