#include <rechpath.h>
Inheritance diagram for PathFlagsRecordHandler:
Public Member Functions | |
PathFlagsRecordHandler () | |
~PathFlagsRecordHandler () | |
virtual UINT32 * | GetTagList () |
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) |
Definition at line 160 of file rechpath.h.
|
Definition at line 166 of file rechpath.h.
|
|
Definition at line 167 of file rechpath.h.
|
|
|
|
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.
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 }
|
|
Handles the given record. The record has to be a path flags record.
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 }
|