#include <noderect.h>
Inheritance diagram for NodeRect:
Public Member Functions | |
NodeRect () | |
This constructor creates a NodeRect linked to no other with all status flags false and an uninitialized bounding rectangle. | |
NodeRect (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE) | |
This constructor initialises the nodes flags and links it to ContextNode in the direction specified by Direction. All neccesary tree links are updated. | |
virtual Node * | SimpleCopy () |
Makes a copy of all the data in the node. | |
virtual String | Describe (BOOL Plural, BOOL Verbose) |
To return a description of the NodeRect object in either the singular or the plural. This method is called by the DescribeRange method. The description will always begin with a lower case letter. | |
void | PreExportRender (RenderRegion *pRegion) |
Output data required to mark this object as a rectangle as opposed to an arbitrary path. | |
virtual void | CreateShape (DocRect NewRect) |
Creates a rectangle using a path. | |
virtual void | UpdateShape () |
Updates rectangle node to fit the current parallelogram. | |
virtual UINT32 | GetNodeSize () const |
For finding the size of the node. | |
virtual BOOL | SnapToCoords (DocCoord *pDocCoord) |
Snaps the point magnetically to the magnetic coords for a rectangle. These are :- The Centre, The Corners, and the midpoints of its edges. | |
virtual void | HandleBlobDrag (DocCoord &, Spread *, INT32) |
When a drag is started on one of the paths blobs this is called. It tries to fire up an operation that will perform a drag of all the selected points, including all the EORing of the relavent parts of the curve. If it fails it will inform the user and not bother. | |
Private Member Functions | |
CC_DECLARE_DYNCREATE (NodeRect) |
Definition at line 122 of file noderect.h.
|
This constructor creates a NodeRect linked to no other with all status flags false and an uninitialized bounding rectangle.
Definition at line 200 of file noderect.cpp. 00200 : NodeSimpleShape() 00201 { 00202 }
|
|
This constructor initialises the nodes flags and links it to ContextNode in the direction specified by Direction. All neccesary tree links are updated.
Specifies the direction in which the node is to be attached to the ContextNode. The values this variable can take are as follows: PREV : Attach node as a previous sibling of the context node NEXT : Attach node as a next sibling of the context node FIRSTCHILD: Attach node as the first child of the context node LASTCHILD : Attach node as a last child of the context node BoundingRect: Bounding rectangle The remaining inputs specify the status of the node: Locked: Is node locked ? Mangled: Is node mangled ? Marked: Is node marked ? Selected: Is node selected ? Note: SetUpPath() must be called before the NodeRect is in a state in which it can be used.
Definition at line 170 of file noderect.cpp. 00176 :NodeSimpleShape(ContextNode, Direction, Locked, Mangled, Marked, Selected ) 00177 { 00178 }
|
|
|
|
Creates a rectangle using a path.
Reimplemented from NodeSimpleShape. Definition at line 293 of file noderect.cpp. 00294 { 00295 // Copy the rectangle into the parallelogram 00296 Parallel[0] = DocCoord(NewRect.lo.x, NewRect.hi.y); 00297 Parallel[1] = DocCoord(NewRect.hi.x, NewRect.hi.y); 00298 Parallel[2] = DocCoord(NewRect.hi.x, NewRect.lo.y); 00299 Parallel[3] = DocCoord(NewRect.lo.x, NewRect.lo.y); 00300 00301 // build a path 00302 InkPath.FindStartOfPath(); 00303 00304 // Start at bottom left corner 00305 InkPath.InsertMoveTo(Parallel[0]); 00306 InkPath.InsertLineTo(Parallel[1]); 00307 InkPath.InsertLineTo(Parallel[2]); 00308 InkPath.InsertLineTo(Parallel[3]); 00309 InkPath.InsertLineTo(Parallel[0]); 00310 00311 // Close the path properly 00312 InkPath.CloseSubPath(); 00313 }
|
|
To return a description of the NodeRect object in either the singular or the plural. This method is called by the DescribeRange method. The description will always begin with a lower case letter.
Reimplemented from Node. Reimplemented in NodeAnimatingBitmap, and NodeBitmap. Definition at line 247 of file noderect.cpp. 00248 { 00249 if (Plural) 00250 return(String(_R(IDS_RECTANGLE_DESCRP))); 00251 else 00252 return(String(_R(IDS_RECTANGLE_DESCRS))); 00253 };
|
|
For finding the size of the node.
Reimplemented from NodeSimpleShape. Reimplemented in NodeAnimatingBitmap, and NodeBitmap. Definition at line 395 of file noderect.cpp. 00396 { 00397 return (sizeof(NodeRect)); 00398 }
|
|
When a drag is started on one of the paths blobs this is called. It tries to fire up an operation that will perform a drag of all the selected points, including all the EORing of the relavent parts of the curve. If it fails it will inform the user and not bother.
Reimplemented from NodeSimpleShape. Definition at line 359 of file noderect.cpp. 00360 { 00361 #if !defined(EXCLUDE_FROM_RALPH) 00362 OpEditRectangle* pOpRect = new OpEditRectangle; 00363 if (pOpRect == NULL) 00364 { 00365 // Failed to get the memory to do the job 00366 TRACEUSER( "Rik", _T("The Node Rect Edit Operation failed to start\n") ); 00367 00368 // Inform the person doing the clicking that life is not looking so good 00369 InformError(); 00370 } 00371 else 00372 { 00373 // Start the drag operation and pass in the Anchor Point to the operation 00374 pOpRect->DoDrag(PointerPos, pSpread, this, FixedCorner); 00375 } 00376 #endif 00377 }
|
|
Output data required to mark this object as a rectangle as opposed to an arbitrary path.
Reimplemented from Node. Reimplemented in NodeBitmap. Definition at line 268 of file noderect.cpp. 00269 { 00270 #ifdef DO_EXPORT 00271 if (pRegion->IsKindOf(CC_RUNTIME_CLASS(ArtWorksEPSRenderRegion))) 00272 { 00273 // Output "ArtWorks rectangle" token 00274 EPSExportDC *pDC = (EPSExportDC *) pRegion->GetRenderDC(); 00275 pDC->OutputToken(_T("ar")); 00276 pDC->OutputNewLine(); 00277 } 00278 #endif 00279 }
|
|
Makes a copy of all the data in the node.
Reimplemented from NodeSimpleShape. Reimplemented in NodeAnimatingBitmap, and NodeBitmap. Definition at line 217 of file noderect.cpp. 00218 { 00219 // Make a new NodeSimpleShape and then copy things into it 00220 NodeRect* NodeCopy = new NodeRect(); 00221 if (NodeCopy) 00222 CopyNodeContents(NodeCopy); 00223 00224 return NodeCopy; 00225 }
|
|
Snaps the point magnetically to the magnetic coords for a rectangle. These are :- The Centre, The Corners, and the midpoints of its edges.
Reimplemented from NodeSimpleShape. Definition at line 419 of file noderect.cpp. 00420 { 00421 #if !defined(EXCLUDE_FROM_RALPH) 00422 // First try and snap to all the places that the base class snaps for us 00423 BOOL IsSnapped = NodeSimpleShape::SnapToCoords(pDocCoord); 00424 00425 // if it did not snap in the base class, try the extra points 00426 if (IsSnapped==FALSE) 00427 { 00428 // Try each of the corner of the rectangle 00429 for (INT32 i=0; i<4; i++) 00430 { 00431 if (IsMagneticallyClose(&Parallel[i], pDocCoord)) 00432 return TRUE; 00433 } 00434 } 00435 00436 // send the result on 00437 return IsSnapped; 00438 #else 00439 return FALSE; 00440 #endif 00441 }
|
|
Updates rectangle node to fit the current parallelogram.
Reimplemented from NodeSimpleShape. Definition at line 325 of file noderect.cpp. 00326 { 00327 // make sure the path seems to have the correct number of coords in it 00328 ENSURE(InkPath.GetNumCoords()==5, "NodeRect::UpdateShape found its path corrupt" ); 00329 00330 // Get the array of coords in the path 00331 DocCoord* Coords = InkPath.GetCoordArray(); 00332 00333 // Update them to what we now have 00334 Coords[0] = Parallel[0]; 00335 Coords[1] = Parallel[1]; 00336 Coords[2] = Parallel[2]; 00337 Coords[3] = Parallel[3]; 00338 Coords[4] = Parallel[0]; 00339 }
|