#include <fillattr.h>
Inheritance diagram for SelectedAttrs:
Public Member Functions | |
SelectedAttrs () | |
~SelectedAttrs () | |
NodeAttribute * | FindFirst (CCRuntimeClass *AttrType=(CCRuntimeClass *) CC_RUNTIME_CLASS(AttrFillGeometry)) |
Scans the selection for attributes. Replaces AttrFillGeometry::FindFirstSelectedAttr without relying on global variables! | |
NodeAttribute * | FindNext (CCRuntimeClass *AttrType=(CCRuntimeClass *) CC_RUNTIME_CLASS(AttrFillGeometry)) |
Scans the selection for fill attributes. | |
Private Attributes | |
Range * | m_pAttrSelectionLevel |
SelRange * | m_pAttrSelection |
Node * | m_pSelNode |
NodeAttribute * | m_pLastSelectedAttr |
Definition at line 520 of file fillattr.h.
|
Definition at line 523 of file fillattr.h. 00524 { 00525 m_pAttrSelectionLevel = NULL; 00526 m_pAttrSelection = NULL; 00527 m_pSelNode = NULL; 00528 m_pLastSelectedAttr = NULL; 00529 }
|
|
Definition at line 531 of file fillattr.h. 00532 { 00533 if (m_pAttrSelectionLevel) 00534 { 00535 delete m_pAttrSelectionLevel; 00536 m_pAttrSelectionLevel = NULL; 00537 } 00538 }
|
|
Scans the selection for attributes. Replaces AttrFillGeometry::FindFirstSelectedAttr without relying on global variables!
Definition at line 1442 of file fillattr.cpp. 01443 { 01444 // Get the current selection 01445 // and initialise all statics to initial conditions 01446 m_pAttrSelection = Camelot.FindSelection(); 01447 m_pLastSelectedAttr = NULL; 01448 m_pSelNode = NULL; 01449 01450 // If previous use of FindFirst/NextSelectedAttr was stopped before FindNext had reached the 01451 // end, AttrSelectionLevel may still be left lying around... 01452 if (m_pAttrSelectionLevel) 01453 { 01454 delete m_pAttrSelectionLevel; 01455 m_pAttrSelectionLevel = NULL; 01456 } 01457 01458 m_pAttrSelectionLevel = EffectsStack::GetNewLevelRange(NULL, FALSE); // Don't escape old controllers, apply attr to base nodes 01459 01460 if (m_pAttrSelectionLevel) 01461 { 01462 // Find the first Object 01463 m_pSelNode = m_pAttrSelectionLevel->FindFirst(); 01464 if (m_pSelNode) 01465 { 01466 // Now find any attributes that are applied to this node. 01467 Node* pAttrNode = m_pSelNode; 01468 if (m_pSelNode->IsAnObject()) 01469 pAttrNode = ((NodeRenderableInk*)m_pSelNode)->GetObjectToApplyTo(AttrType); 01470 ENSURE(pAttrNode->IsAnObject(), "Found unexpected non-ink node in FindFirstSelectedAttr"); 01471 m_pLastSelectedAttr = ((NodeRenderableInk*)pAttrNode)->FindAppliedAttribute(AttrType); 01472 if (m_pLastSelectedAttr) 01473 return (NodeAttribute*)m_pLastSelectedAttr; 01474 } 01475 01476 // If nothing found on first object or level range is empty 01477 // fall into FindNext so that we don't have to 01478 // duplicate its loop and its tidy up features... 01479 return FindNext(AttrType); 01480 } 01481 01482 ENSURE(m_pAttrSelectionLevel==NULL, "Possible Range Leak"); 01483 m_pAttrSelection = NULL; 01484 m_pSelNode = NULL; 01485 m_pLastSelectedAttr = NULL; 01486 return NULL; 01487 }
|
|
Scans the selection for fill attributes.
Definition at line 1502 of file fillattr.cpp. 01503 { 01504 // Better make sure nobodys being Silly 01505 ERROR2IF((m_pAttrSelection==NULL), NULL, "AttrSelection NULL in FindNextSelectedAttr"); 01506 ERROR2IF((m_pAttrSelectionLevel==NULL), NULL, "AttrSelectionLevel NULL in FindNextSelectedAttr"); 01507 01508 // Loop through the selection range until found another match or end of range 01509 while (m_pSelNode) 01510 { 01511 m_pSelNode = m_pAttrSelectionLevel->FindNext(m_pSelNode); 01512 01513 if (m_pSelNode) 01514 { 01515 // Now find any attributes that are applied to this node. 01516 Node* pAttrNode = m_pSelNode; 01517 if (m_pSelNode->IsAnObject()) 01518 pAttrNode = ((NodeRenderableInk*)m_pSelNode)->GetObjectToApplyTo(AttrType); 01519 ENSURE(pAttrNode->IsAnObject(), "Found unexpected non-ink node in FindFirstSelectedAttr"); 01520 m_pLastSelectedAttr = ((NodeRenderableInk*)pAttrNode)->FindAppliedAttribute(AttrType); 01521 if (m_pLastSelectedAttr) 01522 { 01523 return (NodeAttribute*)m_pLastSelectedAttr; 01524 } 01525 } 01526 } 01527 01528 // End of iteration so clear out our statics 01529 if (m_pAttrSelectionLevel) 01530 { 01531 delete m_pAttrSelectionLevel; 01532 m_pAttrSelectionLevel = NULL; 01533 } 01534 m_pAttrSelection = NULL; 01535 m_pSelNode = NULL; 01536 m_pLastSelectedAttr = NULL; 01537 01538 return NULL; 01539 }
|
|
Definition at line 545 of file fillattr.h. |
|
Definition at line 544 of file fillattr.h. |
|
Definition at line 547 of file fillattr.h. |
|
Definition at line 546 of file fillattr.h. |