PathFlagsRecordHandler Class Reference

Handles the reading of the path flag record in the v2 file format. More...

#include <rechpath.h>

Inheritance diagram for PathFlagsRecordHandler:

CamelotRecordHandler CXaraFileRecordHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 PathFlagsRecordHandler ()
 ~PathFlagsRecordHandler ()
virtual UINT32GetTagList ()
 This is the base class record description generator. It doesn't do anything yet. Provides the record handler system with a list of records handled by this handler.
virtual BOOL HandleRecord (CXaraFileRecord *pCXaraFileRecord)
 Handles the given record. The record has to be a path flags record.

Private Member Functions

 CC_DECLARE_DYNAMIC (PathFlagsRecordHandler)

Detailed Description

Handles the reading of the path flag record in the v2 file format.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/99
See also:
-

Definition at line 160 of file rechpath.h.


Constructor & Destructor Documentation

PathFlagsRecordHandler::PathFlagsRecordHandler  )  [inline]
 

Definition at line 166 of file rechpath.h.

00166 {}

PathFlagsRecordHandler::~PathFlagsRecordHandler  )  [inline]
 

Definition at line 167 of file rechpath.h.

00167 {}


Member Function Documentation

PathFlagsRecordHandler::CC_DECLARE_DYNAMIC PathFlagsRecordHandler   )  [private]
 

UINT32 * PathFlagsRecordHandler::GetTagList  )  [virtual]
 

This is the base class record description generator. It doesn't do anything yet. Provides the record handler system with a list of records handled by this handler.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/99
Parameters:
- [INPUTS]
Returns:
Ptr to a list of tag values, terminated by CXFRH_TAG_LIST_END
See also:
-

Implements CXaraFileRecordHandler.

Definition at line 3475 of file nodepath.cpp.

03476 {
03477     static UINT32 TagList[] = { TAG_PATH_FLAGS,
03478                                 CXFRH_TAG_LIST_END};
03479 
03480     return (UINT32*)&TagList;
03481 }

BOOL PathFlagsRecordHandler::HandleRecord CXaraFileRecord pCXaraFileRecord  )  [virtual]
 

Handles the given record. The record has to be a path flags record.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/99
Parameters:
pCXaraFileRecord = ptr to record to handle [INPUTS]
Returns:
TRUE if handled successfuly FALSE otherwise
NOTE: moved from PathRecordHandler class by Markn 12/5/99
See also:
-

Implements CXaraFileRecordHandler.

Definition at line 3500 of file nodepath.cpp.

03501 {
03502     ERROR2IF(pCXaraFileRecord == NULL,FALSE,"pCXaraFileRecord is NULL");
03503     ERROR3IF(pCXaraFileRecord->GetTag() != TAG_PATH_FLAGS,"I don't handle this tag type");
03504 
03505     BOOL ok = TRUE;
03506 
03507     NodePath* pNodePath = GetLastNodePathInserted();
03508 
03509     if (pNodePath != NULL)
03510     {
03511         UINT32 NumFlags  = pCXaraFileRecord->GetSize()*sizeof(BYTE);
03512         UINT32 NumCoords = pNodePath->InkPath.GetNumCoords();
03513 
03514         if (NumCoords == NumFlags)
03515         {
03516             PathFlags* pFlags = pNodePath->InkPath.GetFlagArray();
03517 
03518             BYTE Flags;
03519             for (UINT32 i=0; ok && i < NumFlags;i++)
03520             {
03521                 ok = pCXaraFileRecord->ReadBYTE(&Flags);
03522 
03523                 if (ok)
03524                 {
03525                     pFlags[i].IsSmooth  = (Flags & TAG_PATH_FLAGS_SMOOTH)   != 0;
03526                     pFlags[i].IsRotate  = (Flags & TAG_PATH_FLAGS_ROTATE)   != 0;
03527                     pFlags[i].IsEndPoint= (Flags & TAG_PATH_FLAGS_ENDPOINT) != 0;
03528                 }
03529             }
03530         }
03531     }
03532     else
03533     {
03534         ERROR3("NULL node path ptr");   // Only complain a little in debug builds
03535     }
03536 
03537     return ok;
03538 }


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