ContourRecordHandler Class Reference

Handles the reading of all contour records. More...

#include <ncntrcnt.h>

Inheritance diagram for ContourRecordHandler:

CamelotRecordHandler CXaraFileRecordHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ContourRecordHandler ()
 Destructor.
 ~ContourRecordHandler ()
 Destructor.
virtual UINT32GetTagList ()
 Gets the tag list for this handler to handle.
virtual BOOL HandleRecord (CXaraFileRecord *pCXaraFileRecord)
 Handles the bevel record - basically creates a BevelController node & creates all the attributes.

Detailed Description

Handles the reading of all contour records.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/10/98
See also:
-

Definition at line 386 of file ncntrcnt.h.


Constructor & Destructor Documentation

ContourRecordHandler::ContourRecordHandler  ) 
 

Destructor.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/10/98
Parameters:
- [INPUTS]
Returns:

Definition at line 3179 of file ncntrcnt.cpp.

03180 {
03181 
03182 }

ContourRecordHandler::~ContourRecordHandler  ) 
 

Destructor.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/10/98
Parameters:
- [INPUTS]
Returns:

Definition at line 3194 of file ncntrcnt.cpp.

03195 {
03196 }


Member Function Documentation

UINT32 * ContourRecordHandler::GetTagList  )  [virtual]
 

Gets the tag list for this handler to handle.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/10/98
Parameters:
- [INPUTS]
Returns:

Implements CXaraFileRecordHandler.

Definition at line 3207 of file ncntrcnt.cpp.

03208 {
03209     static UINT32 TagList[] = { TAG_CONTOURCONTROLLER,
03210                                 TAG_CONTOUR,
03211                                 CXFRH_TAG_LIST_END};
03212 
03213     return (UINT32*)&TagList;
03214 }

BOOL ContourRecordHandler::HandleRecord CXaraFileRecord pCXaraFileRecord  )  [virtual]
 

Handles the bevel record - basically creates a BevelController node & creates all the attributes.

Author:
David_McClarnon (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/10/98
Parameters:
- [INPUTS]
Returns:

Implements CXaraFileRecordHandler.

Definition at line 3226 of file ncntrcnt.cpp.

03227 {
03228     INT32 Steps = 0;
03229     INT32 Width = 0;
03230     BYTE Type = 0;
03231 
03232     BOOL ok = TRUE;
03233 
03234     double ObjBias = 0;
03235     double ObjGain = 0;
03236     double AttrBias = 0;
03237     double AttrGain = 0;
03238     
03239     if (pCXaraFileRecord->GetTag() == TAG_CONTOURCONTROLLER)
03240     {
03241         ok = pCXaraFileRecord->ReadINT32(&Steps);
03242 
03243         if (ok) ok = pCXaraFileRecord->ReadINT32(&Width);
03244         if (ok) ok = pCXaraFileRecord->ReadBYTE(&Type);
03245         if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&ObjBias);
03246         if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&ObjGain);
03247         if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&AttrBias);
03248         if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&AttrGain);
03249 
03250         NodeContourController * pNode = new NodeContourController;
03251 
03252         if (!pNode)
03253         {
03254             ERROR3("Can't create contour controller");
03255             return FALSE;
03256         }
03257 
03258         pNode->SetWidth(Width);
03259         pNode->SetNumberOfSteps(Steps);
03260 
03261         if ((Type & 128) != 0)
03262         {
03263             Type = Type - 128;
03264             pNode->SetInsetPathFlag(TRUE);
03265         }
03266 
03267         pNode->SetColourBlendType((ColourBlendType)Type);
03268 
03269         pNode->SetObjectProfile( CProfileBiasGain( (AFp)ObjBias, (AFp)ObjGain ) );
03270         pNode->SetAttrProfile( CProfileBiasGain( (AFp)AttrBias, (AFp)AttrGain ) );
03271 
03272         if (ok)
03273         {
03274             InsertNode(pNode);
03275         }
03276     }
03277     else if (pCXaraFileRecord->GetTag() == TAG_CONTOUR)
03278     {
03279         NodeContour * pNode = new NodeContour;
03280 
03281         if (!pNode)
03282         {
03283             ERROR3("Can't create NodeContour");
03284             return FALSE;
03285         }
03286 
03287         InsertNode(pNode);
03288     }
03289     else
03290     {
03291         ERROR3("Contour file record handler - unrecognised tag");
03292         ok = FALSE;
03293     }
03294 
03295     return ok;
03296 }


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