#include <paths.h>
Public Member Functions | |
PathExtraInfo () | |
Constructor for PathExtraInfo class. | |
~PathExtraInfo () | |
Destructor for PathExtraInfo class. | |
BOOL | Init (ChannelIndex, INT32) |
Allocates memory in the path for the extra info arrays. | |
BOOL | Add (ChannelIndex, INT32) |
Adds an extra Info Value at the current path position. The value stored will be scaled so that it is between 0 and 65536. | |
void | Sync (INT32) |
Sets the Extra Info Ptr to the current Path Postion. | |
void | Next () |
BOOL | HasWidthInfo () |
To determine if the path has any width information. | |
void | MapWidthInfo (ChannelIndex) |
Alters the mapping of the Width Information to one of the ExtraInfo channels. | |
PathWidth | GetWidthInfo () |
Get the width at the current path position. | |
PathWidth * | GetWidthArray () |
The array holds the width of the path. | |
Private Member Functions | |
BOOL | IncreaseExtraBlocks (INT32) |
Allocates more memory for extra info. | |
BOOL | DecreaseExtraBlocks (INT32) |
De-allocates memory used for extra info. | |
void | ShiftUpExtraInfo (INT32, INT32, INT32) |
Shifts up the ExtraInfo memory to make room for more. | |
void | ShiftDownExtraInfo (INT32, INT32, INT32) |
Shifts down the ExtraInfo memory when it gets shrunk. | |
void | CopyExtraInfo (PathExtraInfo *) |
Copies all the ExtraInfo from another path. | |
Private Attributes | |
MHANDLE | ExtraInfoHandles [NUMEXTRACHANNELS] |
FIXED16 | Scaling [NUMEXTRACHANNELS] |
INT32 | CurrentExtraPos |
ChannelIndex | WidthChannel |
Friends | |
class | Path |
Definition at line 150 of file paths.h.
|
Constructor for PathExtraInfo class.
Definition at line 8350 of file paths.cpp. 08351 { 08352 CurrentExtraPos = 0; 08353 WidthChannel = CI_PRESSURE; // Default mapping of Pressure to Width 08354 08355 INT32 i; 08356 for (i = 0; i < NUMEXTRACHANNELS; ++i) 08357 ExtraInfoHandles[i] = BAD_MHANDLE; // Clear all the handles. 08358 08359 for (i = 0; i < NUMEXTRACHANNELS; ++i) 08360 Scaling[i] = 1; // Clear all the scaling values. 08361 08362 // WEBSTER - markn 25/4/97 08363 // No pen stuff required in Webster 08364 // Taken out by vector stroking code Neville 2/10/97 08365 #ifdef VECTOR_STROKING 08366 // Set the Pressure scaling so that the Maximum pressure is always stored as EXTRAVALUEMAX 08367 //if ((Camelot.GetPressurePen())->IsPressureOn()) 08368 // Scaling[CI_PRESSURE] = fixed16((INT32)EXTRAVALUEMAX/((INT32)(Camelot.GetPressurePen())->GetPressureMax())); 08369 #endif // VECTOR_STROKING 08370 }
|
|
Destructor for PathExtraInfo class.
Definition at line 8385 of file paths.cpp. 08386 { 08387 // Scan thru all the extra channels that we know of, and release and blocks 08388 // that we have claimed. 08389 for (INT32 Index = 0; Index < NUMEXTRACHANNELS; ++Index) 08390 { 08391 // Have we claimed a block for this channel ? 08392 if (ExtraInfoHandles[Index] != BAD_MHANDLE) 08393 { 08394 ReleaseBlock(ExtraInfoHandles[Index]); 08395 TRACEUSER( "Will", _T("Released Block with Index=%d\n"),Index); 08396 } 08397 } 08398 }
|
|
Adds an extra Info Value at the current path position. The value stored will be scaled so that it is between 0 and 65536.
Definition at line 8442 of file paths.cpp. 08443 { 08444 TRACEUSER( "Will", _T("AddExtraInfo, Index=%d, Value=%d\n"),Index, ExtraValue); 08445 ENSURE(Index <= NUMEXTRACHANNELS, "Index out of range in PathExtraInfo::Add()"); 08446 08447 // get pointer to info array 08448 PathExtraElement* Info = (PathExtraElement*) DescribeHandle(ExtraInfoHandles[Index]); 08449 08450 // Wop the info in the array at the postion coresponding to the last point inserted. 08451 Info[CurrentExtraPos] = XLONG(ExtraValue) * Scaling[Index]; 08452 08453 return TRUE; 08454 }
|
|
Copies all the ExtraInfo from another path.
Definition at line 8591 of file paths.cpp.
|
|
De-allocates memory used for extra info.
Definition at line 8511 of file paths.cpp. 08512 { 08513 TRACEUSER( "Will", _T("DecreaseExtraBlocks, Slots=%d\n"),SlotsLost); 08514 08515 // Scan thru all our channels and decrease their size by 'SlotsNeeded'. 08516 for (INT32 Index = 0; Index < NUMEXTRACHANNELS; ++Index) 08517 { 08518 if (ExtraInfoHandles[Index] != BAD_MHANDLE) 08519 if (!DecreaseBlock(ExtraInfoHandles[Index], sizeof(PathExtraElement)*SlotsLost)) 08520 return FALSE; 08521 } 08522 return TRUE; 08523 }
|
|
The array holds the width of the path.
Definition at line 8645 of file paths.cpp. 08646 { 08647 // de-reference an Extra Info array 08648 return (PathWidth*) DescribeHandle(ExtraInfoHandles[WidthChannel]); 08649 }
|
|
Get the width at the current path position.
Definition at line 8626 of file paths.cpp. 08627 { 08628 // de-reference the Extra Info array 08629 PathExtraElement* WidthInfo = (PathExtraElement*) DescribeHandle(ExtraInfoHandles[WidthChannel]); 08630 08631 return (PathWidth)WidthInfo[CurrentExtraPos]; 08632 }
|
|
To determine if the path has any width information.
Definition at line 8662 of file paths.cpp. 08663 { 08664 return (WidthChannel!=-1); 08665 }
|
|
Allocates more memory for extra info.
Definition at line 8486 of file paths.cpp. 08487 { 08488 TRACEUSER( "Will", _T("IncreaseExtraBlocks, Slots=%d\n"),SlotsNeeded); 08489 08490 // Scan thru all our channels and increase their size by 'SlotsNeeded'. 08491 for (INT32 Index = 0; Index < NUMEXTRACHANNELS; ++Index) 08492 { 08493 if (ExtraInfoHandles[Index] != BAD_MHANDLE) 08494 if (!IncreaseBlock(ExtraInfoHandles[Index], sizeof(PathExtraElement)*SlotsNeeded)) 08495 return FALSE; 08496 } 08497 return TRUE; 08498 }
|
|
Allocates memory in the path for the extra info arrays.
Definition at line 8413 of file paths.cpp. 08414 { 08415 TRACEUSER( "Will", _T("InitExtraInfo, Index=%d\n"), Index ); 08416 ENSURE(Index <= NUMEXTRACHANNELS, "Index out of range in InitExtraInfo"); 08417 08418 if (ExtraInfoHandles[Index] != BAD_MHANDLE) 08419 return TRUE; // Already Initialised 08420 08421 // Claim an initial block of memory for this Index. 08422 ExtraInfoHandles[Index] = ClaimBlock(sizeof(PathExtraElement)*SlotInitSize); 08423 08424 // Check that the block claimed ok. 08425 return (ExtraInfoHandles[Index] != BAD_MHANDLE); 08426 }
|
|
Alters the mapping of the Width Information to one of the ExtraInfo channels.
Definition at line 8609 of file paths.cpp. 08610 { 08611 ENSURE(Index <= NUMEXTRACHANNELS, "Index out of range in MapWidthInfo()"); 08612 WidthChannel = Index; 08613 }
|
|
Definition at line 162 of file paths.h. 00162 { CurrentExtraPos++; }
|
|
Shifts down the ExtraInfo memory when it gets shrunk.
Definition at line 8563 of file paths.cpp. 08564 { 08565 TRACEUSER( "Will", _T("ShiftDownExtraInfo, Start=%d, NumSlots=%d, SlotsToMove=%d\n"), 08566 StartSlot, NumSlots, SlotsToMove); 08567 08568 // The channel data has been resized and so we need to shift it around a bit. 08569 for (INT32 Index = 0; Index < NUMEXTRACHANNELS; ++Index) 08570 { 08571 if (ExtraInfoHandles[Index] != BAD_MHANDLE) 08572 { 08573 PathExtraElement* ExtraInfoPtr = (PathExtraElement*) DescribeHandle(ExtraInfoHandles[Index]); 08574 memmove( (void*)&ExtraInfoPtr[StartSlot], (void*)&ExtraInfoPtr[StartSlot+NumSlots], SlotsToMove*sizeof(PathExtraElement) ); 08575 } 08576 } 08577 08578 }
|
|
Shifts up the ExtraInfo memory to make room for more.
Definition at line 8536 of file paths.cpp. 08537 { 08538 TRACEUSER( "Will", _T("ShiftUpExtraInfo, NumSlots=%d, SlotsToMove=%d\n"),NumSlots, SlotsToMove); 08539 08540 // The channel data has been resized and so we need to shift it around a bit. 08541 for (INT32 Index = 0; Index < NUMEXTRACHANNELS; ++Index) 08542 { 08543 if (ExtraInfoHandles[Index] != BAD_MHANDLE) 08544 { 08545 PathExtraElement* ExtraInfoPtr = (PathExtraElement*) DescribeHandle(ExtraInfoHandles[Index]); 08546 memmove( (void*)&ExtraInfoPtr[CurrentPos+NumSlots], (void*)&ExtraInfoPtr[CurrentPos], SlotsToMove*sizeof(PathExtraElement) ); 08547 } 08548 } 08549 08550 }
|
|
Sets the Extra Info Ptr to the current Path Postion.
Definition at line 8469 of file paths.cpp. 08470 { 08471 TRACEUSER( "Will", _T("SyncExtraInfo, Pos=%d\n"),CurrentPos); 08472 CurrentExtraPos = CurrentPos; 08473 }
|
|
|
|
|
|
|
|
|
|
|