#include <moldenv.h>
Inheritance diagram for MouldEnvelope2x2:
Public Member Functions | |
MouldEnvelope2x2 () | |
Envelope mould constructor. | |
~MouldEnvelope2x2 () | |
Envelope2x2 mould destructor. | |
virtual BOOL | Initialise () |
Initialise a mould envelope to contain the correct geometry. | |
virtual BOOL | Validate (Path *const pPath, UINT32 &errorID) |
This function checks whether the path given is suitabile for use as an envelope manifold. Valid paths at present are any set of 5 path elements starting with a moveto followed by line or bezier elements. | |
virtual BOOL | Define (Path *const pPath, DocRect *const pRect) |
This function sets the low level envelope state ready for calls to various envelope path generation functions. It serves simply as a way of informing the low level enveloper of the shape of the current envelope. | |
virtual BOOL | MakeValidFrom (Path **Out, Path *In, INT32 *CornersHint=0) |
creates a valid moulding path from an non-invalid path. | |
virtual MouldSpace | Describe () |
virtual void | Transform (Path *const pPath, DocRect *const pRect, TransformBase &Trans) |
Make sure the envelope mould data is transformed correctly. Note, all we need do here is redefine the low level envelope by calling Define() again with the current NodePath shape. We are ofcourse assuming that the child node path has already been transformed and so is correct. This is the case for NodeMould.Transform() which calls this function. It ensures all children are transformed first before it calls us passing in the transformed path itself. | |
virtual ChangeCode | RecordContext (UndoableOperation *) |
Record our context on the undo. In this overridden function we simply create an action to perform the undo/redo of our envelope shape. | |
virtual UINT32 | GetByteSize () const |
virtual MouldGeometry * | MakeCopy () |
Make a copy of this mould envelope object and return it. | |
Static Public Member Functions | |
static BOOL | WillBeValid (POINT *P) |
Check whether the point array suited for use as a manifold. | |
Protected Member Functions | |
BOOL | CopyContents (MouldEnvelope2x2 *pGeom) |
Make a copy of this mouldenvelope class private data. | |
Private Member Functions | |
CC_DECLARE_DYNAMIC (MouldEnvelope2x2) | |
Private Attributes | |
const INT32 | EnvNumCoords |
Definition at line 229 of file moldenv.h.
|
Envelope mould constructor.
Definition at line 1495 of file moldenv.cpp. 01495 : EnvNumCoords(ENV_NUMCOORDS2X2) 01496 { 01497 }
|
|
Envelope2x2 mould destructor.
Definition at line 1510 of file moldenv.cpp.
|
|
|
|
Make a copy of this mouldenvelope class private data.
Definition at line 1758 of file moldenv.cpp. 01759 { 01760 ERROR3IF(pCopyEnvelope==NULL, "MouldEnvelope::CopyContents() passed a null pointer"); 01761 // ask the base class to copy its bits first 01762 if (!MouldGeometry::CopyContents(pCopyEnvelope)) 01763 return FALSE; 01764 01765 // now lets copy data about ourselves 01766 POINT* TempArray = new POINT[EnvNumCoords]; 01767 if (TempArray==NULL) 01768 return FALSE; 01769 01770 RECT TempRect = pEnvelope->GetSourceBBox(); 01771 DocRect Rect = ConvRectToDocRect(TempRect); 01772 pEnvelope->CopyShape(TempArray); 01773 01774 // define this shape with the details 01775 BOOL ok = (pCopyEnvelope->BuildShape(TempArray, &Rect)); 01776 01777 delete [] TempArray; 01778 return ok; 01779 }
|
|
This function sets the low level envelope state ready for calls to various envelope path generation functions. It serves simply as a way of informing the low level enveloper of the shape of the current envelope.
Reimplemented from MouldGeometry. Definition at line 1643 of file moldenv.cpp. 01644 { 01645 ERROR2IF(pPath==NULL,FALSE,"MouldEnvelope2x2::Define() called with NULL path"); 01646 return MouldEnvelopeBase::Define(pPath,pOrigBBox,EnvNumCoords); 01647 }
|
|
Reimplemented from MouldGeometry. Definition at line 242 of file moldenv.h. 00242 {return MOULDSPACE_ENVELOPE2X2;}
|
|
Reimplemented from MouldGeometry. Definition at line 246 of file moldenv.h. 00246 { return sizeof(MouldEnvelope2x2); };
|
|
Initialise a mould envelope to contain the correct geometry.
Definition at line 1526 of file moldenv.cpp. 01527 { 01528 ERROR3IF(MouldEnvelopeBase::pEnvelope!=NULL, "MouldEnvelope2x2::Initialise() - pEnvelope not NULL!"); 01529 GEnvelope2x2* pGEnvelope = new GEnvelope2x2; 01530 if (pGEnvelope==NULL) 01531 return FALSE; 01532 MouldEnvelopeBase::pEnvelope = pGEnvelope; 01533 return TRUE; 01534 }
|
|
Make a copy of this mould envelope object and return it.
Reimplemented from MouldGeometry. Definition at line 1721 of file moldenv.cpp. 01722 { 01723 // create a new Geometry 01724 MouldEnvelope2x2* pGeometry = new MouldEnvelope2x2; 01725 if (pGeometry == NULL) 01726 return NULL; 01727 01728 if (!pGeometry->Initialise()) 01729 { 01730 delete pGeometry; 01731 return NULL; 01732 } 01733 01734 if (!CopyContents(pGeometry)) 01735 { 01736 delete pGeometry; 01737 return NULL; 01738 } 01739 01740 return ((MouldGeometry*)pGeometry); 01741 }
|
|
creates a valid moulding path from an non-invalid path.
Reimplemented from MouldGeometry. Definition at line 1620 of file moldenv.cpp. 01621 { 01622 return FALSE; 01623 }
|
|
Record our context on the undo. In this overridden function we simply create an action to perform the undo/redo of our envelope shape.
Reimplemented from MouldGeometry. Definition at line 1689 of file moldenv.cpp. 01690 { 01691 if (pOp!=NULL) 01692 { 01693 RecordEnvelopeAction* EnvAction; 01694 ActionCode Act; 01695 01696 // call the actions static init function to get the action going. 01697 Act = RecordEnvelopeAction::Init(pOp, pOp->GetUndoActionList(), this, (Action**)(&EnvAction)); 01698 01699 if (Act == AC_FAIL) 01700 return CC_FAIL; 01701 if (Act == AC_NORECORD) 01702 return CC_NORECORD; 01703 } 01704 return CC_OK; 01705 }
|
|
Make sure the envelope mould data is transformed correctly. Note, all we need do here is redefine the low level envelope by calling Define() again with the current NodePath shape. We are ofcourse assuming that the child node path has already been transformed and so is correct. This is the case for NodeMould.Transform() which calls this function. It ensures all children are transformed first before it calls us passing in the transformed path itself.
Reimplemented from MouldGeometry. Definition at line 1667 of file moldenv.cpp. 01668 { 01669 ERROR3IF(pPath==NULL,"MouldEnvelope2x2::Transform() passed a NULL path shape"); 01670 Define(pPath,pRect); 01671 }
|
|
This function checks whether the path given is suitabile for use as an envelope manifold. Valid paths at present are any set of 5 path elements starting with a moveto followed by line or bezier elements.
Reimplemented from MouldGeometry. Definition at line 1553 of file moldenv.cpp. 01554 { 01555 // check for a reasonable number of coordinates 01556 INT32 numc=pPath->GetNumCoords(); 01557 if ((numc<5) || numc>(EnvNumCoords+1)) 01558 { 01559 errorID = _R(IDE_ENV_NUMCOORDERR); 01560 return FALSE; 01561 } 01562 01563 if (!ValidMouldingPath(numc, 8, pPath, errorID)) 01564 return FALSE; 01565 01566 // Make sure there's no folds either 01567 POINT* p = (POINT*)pPath->GetCoordArray(); 01568 if (!WillBeValid(p)) 01569 { 01570 errorID = _R(IDE_ENV_NOWIDTHHEIGHT); 01571 return FALSE; 01572 } 01573 01574 // Ok, now if necessary do a pseudo conversion 01575 if (numc<(EnvNumCoords+1)) 01576 { 01577 if (!ConvertShape(EnvNumCoords,NULL,pPath,numc)) 01578 { 01579 errorID = _R(IDE_ENV_NUMCOORDERR); 01580 return FALSE; 01581 } 01582 } 01583 01584 // All is well 01585 return TRUE; 01586 }
|
|
Check whether the point array suited for use as a manifold. static BOOL MouldEnvelope2x2::WillBeValid(POINT* P)
Definition at line 1602 of file moldenv.cpp. 01603 { 01604 return MouldEnvelopeBase::WillBeValid(ENV_NUMCOORDS2X2, P); 01605 }
|
|
|