OpSelectPathPoints Class Reference

This is the operation that marquee selects points in paths. More...

#include <opbezier.h>

Inheritance diagram for OpSelectPathPoints:

UndoableOperation Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 OpSelectPathPoints ()
 Constructor. This simply sets a few of the operation flags.
void DoDrag (DocCoord Anchor, Spread *, BOOL isAdjust, BezierTool *toolptr, ClickModifiers)
 Starts dragging a rectangle, and when the drag finishes, any points inside the rectangle will be selected. If isAdjust, points inside the rectangle will be toggled.
virtual void DragPointerMove (DocCoord PointerPos, ClickModifiers ClickMods, Spread *, BOOL bSolidDrag)
 Handles the event of the mouse moving during a drag.
virtual void DragFinished (DocCoord PointerPos, ClickModifiers ClickMods, Spread *, BOOL Success, BOOL bSolidDrag)
 Handles the drag finishing by rubbing out an EOR on the screen and selecting any points which fall within the rectangle dragged out.
void RenderDragBlobs (DocRect, Spread *, BOOL bSolidDrag)
 EORs the rectangle onto the screen.

Static Public Member Functions

static BOOL Declare ()
 Adds the operation to the list of all known operations.
static OpState GetState (String_256 *Description, OpDescriptor *)
 Find out the state of the operation at the specific time.
static BOOL Init ()
 Adds the operation to the list of all known operations.
static BOOL DragInProgress ()
 To find out if there is a select points operation in progress.

Private Member Functions

 CC_DECLARE_DYNCREATE (OpSelectPathPoints)
void ChangeCursor (Cursor *cursor)
void PushCursor (Cursor *cursor)
void PopCursor ()
void RemoveDragBlobs (BOOL, BOOL)
 Implement a common bit of code shared by two bits at the end of DragFinished. Both want to go through all selected paths although they do different things with them.
void RenderRubberRect (DocRect *Rect)
 EORs the selection rectangle onto the screen. The rectangle is rendered using the coordinates StartPoint to PreviousPoint.
void RenderRubberSelection (RenderRegion *pRegion)
 EORs the blobs on the selected paths onto the screen. This is is needed to solve quite an ugly situation. If the path(s) are scrolled then their blobs will be redrawn as per their document status. We need to go through all the paths rendering their selection status as we want them to be.

Private Attributes

DocCoord StartPoint
SpreadStartSpread
DocCoord PreviousPoint
BOOL AdjustDrag
BezierToolBezToolPtr
ClickModifiers Mods
CursorpcMarqueeCursor

Static Private Attributes

static BOOL DragUnderway = FALSE

Detailed Description

This is the operation that marquee selects points in paths.

Author:
Jim_Lynn (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/6/94

Definition at line 122 of file opbezier.h.


Constructor & Destructor Documentation

OpSelectPathPoints::OpSelectPathPoints  ) 
 

Constructor. This simply sets a few of the operation flags.

Author:
Jim_Lynn (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/6/94

Definition at line 145 of file opbezier.cpp.

00146 {
00147 }


Member Function Documentation

OpSelectPathPoints::CC_DECLARE_DYNCREATE OpSelectPathPoints   )  [private]
 

void OpSelectPathPoints::ChangeCursor Cursor cursor  )  [private]
 

BOOL OpSelectPathPoints::Declare  )  [static]
 

Adds the operation to the list of all known operations.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/7/93
Returns:
TRUE if all went OK, False otherwise

Definition at line 747 of file opbezier.cpp.

00748 {
00749     return (RegisterOpDescriptor(
00750                                 0, 
00751                                 _R(IDS_SELECTPATHPOINTS),
00752                                 CC_RUNTIME_CLASS(OpSelectPathPoints), 
00753                                 OPTOKEN_BEZTOOL,
00754                                 OpSelectPathPoints::GetState,
00755                                 0,  /* help ID */
00756                                 _R(IDBBL_FREEHANDTOOLOP),
00757                                 0   /* bitmap ID */));
00758 }

void OpSelectPathPoints::DoDrag DocCoord  Anchor,
Spread pSpread,
BOOL  isAdjust,
BezierTool tptr,
ClickModifiers  ClickMods
 

Starts dragging a rectangle, and when the drag finishes, any points inside the rectangle will be selected. If isAdjust, points inside the rectangle will be toggled.

Author:
Jim_Lynn (Xara Group Ltd) <camelotdev@xara.com> - Modified by Peter
Date:
29/6/94
Parameters:
Anchor - The position of the mouse at the start of the Drag [INPUTS] pSpread - The spread that the drag started on isAdjust - lets the operation remember if the drag is adjust or not tptr points at the calling tool, so that we can call it back if this drag happened to really insert a floating endpoint ClickMods are the modifiers so that we know if adjust was down
If the drag finishes where it started, we assume that actually the user wanted to insert a floating endpoint at the click position, so we have to call back to the bezier tool to tell it where to put the endpoint.

On the drag start all control point blobs are removed, also if the drag is a select drag (as opposed to an adjust drag) the selected endpoints blobs are replaced with unselected blobs.

Definition at line 221 of file opbezier.cpp.

00226 {
00227     // Make a mental note of the start point
00228     StartPoint      = Anchor;
00229     StartSpread     = pSpread;
00230     PreviousPoint   = Anchor;
00231     AdjustDrag      = isAdjust;
00232     BezToolPtr      = tptr;
00233     Mods            = ClickMods;
00234 
00235     // Go through all the selected NodePaths and remove all the 
00236     // control point blobs
00237     SelRange*   Selection = GetApplication()->FindSelection();
00238     Node*       pNode = Selection->FindFirst();
00239     NodePath*   pSelected = NULL;
00240 
00241     while (pNode != NULL)
00242     {
00243         if (pNode->IsNodePath())
00244             pSelected = (NodePath*)pNode;
00245         else
00246             pSelected = (NodePath*) (pNode->HasEditableChild(CC_RUNTIME_CLASS(NodePath), NULL));
00247 
00248         if (pSelected)
00249         {
00250             Path* ThisPath = &(pSelected->InkPath);
00251             Spread* pSpread = pNode->FindParentSpread();
00252 
00253             // Dereference the pointers
00254             DocCoord* Coords = ThisPath->GetCoordArray();
00255             PathFlags* Flags = ThisPath->GetFlagArray();
00256             PathVerb* Verbs = ThisPath->GetVerbArray();
00257             INT32 UsedSlots = ThisPath->GetNumCoords();
00258 
00259             DocCoord StartCoord = Coords[0];
00260 
00261             // Go into a RenderOnTop loop
00262             RenderRegion* pRender = DocView::RenderOnTop(NULL, pSpread, ClippedEOR);
00263             while (pRender!=NULL)
00264             {
00265                 // loop through the path and count the selected blobs
00266                 INT32 endcount = 0;     // Count the number of selected endpoints
00267                 INT32 EndPtIndex = 0;   // Index of only selected endpoint
00268                 for (INT32 i=0; i<UsedSlots; i++)
00269                 {
00270                     if (Flags[i].IsEndPoint && Flags[i].IsSelected)
00271                     {
00272                         if (!(Verbs[i] & PT_CLOSEFIGURE))
00273                         {
00274                             EndPtIndex = i;
00275                             endcount++;
00276                             if (!AdjustDrag)
00277                             {
00278                                 // If in select mode then remove the selection blob
00279                                 ThisPath->DrawBlob(pRender, Coords[i], TRUE);
00280                                 ThisPath->DrawBlob(pRender, Coords[i], FALSE);
00281                             }
00282                         }
00283                     }
00284                 }
00285                 if (endcount == 1)
00286                 {
00287                     // Remove the control points and lines
00288                     ThisPath->RenderPathControlBlobs(pSpread,EndPtIndex);
00289                 }
00290                 pRender = DocView::GetNextOnTop(NULL);
00291             }   // while the render region
00292         }   // if its a node path
00293         pNode = Selection->FindNext(pNode);
00294     }   // while there are selected nodes
00295     
00296     // And tell the Dragging system that we need drags to happen
00297     StartDrag( DRAGTYPE_AUTOSCROLL );
00298 
00299     DragUnderway = TRUE;
00300 }

void OpSelectPathPoints::DragFinished DocCoord  PointerPos,
ClickModifiers  ClickMods,
Spread pSpread,
BOOL  Success,
BOOL  bSolidDrag
[virtual]
 

Handles the drag finishing by rubbing out an EOR on the screen and selecting any points which fall within the rectangle dragged out.

Author:
Jim_Lynn (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/6/94
Parameters:
PointerPos - The position of the mouse at the end of the drag [INPUTS] ClickMods - the key modifiers being pressed pSpread - The spread that the drag finished on Success - TRUE if the drag was terminated properly, FALSE if it was ended with the escape key being pressed
See also:
ClickModifiers

Reimplemented from Operation.

Definition at line 428 of file opbezier.cpp.

00430 {
00431 
00432     DocRect RubberRect(StartPoint, StartPoint);
00433     RubberRect.IncludePoint(PreviousPoint);
00434     RenderRubberRect(&RubberRect);
00435 
00436     DragUnderway = FALSE;
00437 
00438     BeginSlowJob();
00439     // End the Drag
00440     if ( !EndDrag() )
00441     {
00442         FailAndExecute(); 
00443         End(); 
00444     }
00445 
00446     // select any points within the rectangle if the drag completed properly
00447     // If the rectangle is tiny, we're not selecting points, we're inserting a new
00448     // path at the click position
00449 
00450     if ( Success )
00451     {
00452         DocRect temp;
00453         GetApplication()->GetBlobManager()->GetBlobRect(StartPoint,&temp);
00454         if (!temp.ContainsCoord(PreviousPoint))
00455         {
00456             // Must be selecting points
00457             // Get all selected points, and remove any selected EORing, replacing it with
00458             // normal EORing
00459 
00460             SelRange* Selected = GetApplication()->FindSelection();
00461             Node* pNode = Selected->FindFirst();
00462             NodePath* pSelected = NULL;
00463 
00464             while (pNode)
00465             {
00466                 if (pNode->IsNodePath())
00467                     pSelected = (NodePath*)pNode;
00468                 else
00469                     pSelected = (NodePath*) (pNode->HasEditableChild(CC_RUNTIME_CLASS(NodePath), NULL));
00470 
00471                 if ((pSelected) && (pSelected->FindParentSpread() == StartSpread))
00472                 {
00473                     // Go through the points in this path. 
00474                     // Select any unselected points that fall in the rectangle. 
00475                     // If Adjust, deselected any selected points that fall in the rectangle.
00476                     // If not Adjust, deselect any selected points that fall outside.
00477 
00478                     DocCoord testcoord;
00479                     Path*   ThisPath = &(pSelected->InkPath);
00480                     DocCoord*   Coords = ThisPath->GetCoordArray();
00481                     PathFlags*  Flags = ThisPath->GetFlagArray();
00482                     PathVerb*   Verbs = ThisPath->GetVerbArray();
00483                     INT32   UsedSlots = ThisPath->GetNumCoords();
00484                     INT32   SelectedEndPoints = 0;
00485                     INT32   EndPtIndex = 0;
00486 
00487                     for (INT32 i=0; i<UsedSlots; i++)
00488                     {
00489                         if (Flags[i].IsEndPoint)
00490                         {
00491                             // Selected points change depending on Adjust and whether they are
00492                             // within the rectangle.
00493                             if (Flags[i].IsSelected)
00494                             {
00495                                 if (!AdjustDrag && !RubberRect.ContainsCoord(Coords[i]))
00496                                 {
00497                                     Flags[i].IsSelected = FALSE;
00498                                 }
00499                                 else
00500                                 {
00501                                     if (!(Verbs[i] & PT_CLOSEFIGURE))
00502                                     {
00503                                         SelectedEndPoints++;
00504                                         EndPtIndex = i;
00505                                     }
00506                                 }
00507                             }
00508                             else
00509                             {
00510                                 // unselected points inside rect are selected
00511                                 if (RubberRect.ContainsCoord(Coords[i]))
00512                                 {
00513                                     Flags[i].IsSelected = TRUE;
00514                                     if (!(Verbs[i] & PT_CLOSEFIGURE))
00515                                     {
00516                                         SelectedEndPoints++;
00517                                         EndPtIndex = i;
00518                                     }
00519                                 }
00520                             }
00521                         }
00522                     }
00523                     ThisPath->EnsureSelection(TRUE);
00524                     // Now render on the control points if there was just one selected endpoint
00525                     if (SelectedEndPoints == 1)
00526                     {
00527                         ThisPath->RenderPathControlBlobs(pSpread,EndPtIndex);
00528                     }
00529                 }
00530                 pNode = Selected->FindNext(pNode);
00531             } // while
00532 
00533         }
00534         else
00535         {
00536             // Must have been a single click. If Adjust was down, clear all selected points
00537             // if not, still clear all selected points, but tell the bezier tool that
00538             // the user wants to start a new path at this point
00539             // Get all selected points, and remove any selected EORing, replacing it with
00540             // normal EORing
00541             RemoveDragBlobs(FALSE, TRUE);
00542 
00543             // Now we've cleared the selection, check Adjust. If adjust is not set
00544             // we have to put in a floating endpoint
00545             if (!Mods.Adjust)
00546             {
00547                 DocView::SnapCurrent(pSpread, &StartPoint);
00548                 BezToolPtr->SetMoveTo(StartPoint, pSpread, GetWorkingDoc());
00549 
00550                 if (!RemoveFloaterAction::DoRemove(this, &UndoActions, BezToolPtr))
00551                 {
00552                     FailAndExecute();
00553                     End();
00554                     return;
00555                 }
00556             }
00557         }
00558     }
00559     else
00560     {
00561         // Escape was pressed, we just have to restore the blob state to the previous
00562         RemoveDragBlobs(TRUE, FALSE);
00563     }
00564     GetApplication()->UpdateSelection();
00565     End();
00566 }

BOOL OpSelectPathPoints::DragInProgress  )  [static]
 

To find out if there is a select points operation in progress.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/10/94
Parameters:
- [INPUTS]
Returns:
TRUE if a drag is underway, otherwise FALSE.

Definition at line 186 of file opbezier.cpp.

00187 {
00188     return DragUnderway;
00189 }

void OpSelectPathPoints::DragPointerMove DocCoord  PointerPos,
ClickModifiers  ClickMods,
Spread pSpread,
BOOL  bSolidDrag
[virtual]
 

Handles the event of the mouse moving during a drag.

Author:
Jim_Lynn (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/6/94
Parameters:
PointerPos - The current position of the mouse in Doc Coords [INPUTS] ClickMods - Which key modifiers are being pressed pSpread - The spread that the mouse is moving over
See also:
ClickModifiers

Reimplemented from Operation.

Definition at line 320 of file opbezier.cpp.

00322 {
00323     // If drag has moved onto a different spread, convert the coord to be relative to the
00324     // original spread.
00325     if (pSpread != StartSpread)
00326         PointerPos = MakeRelativeToSpread(StartSpread, pSpread, PointerPos);
00327 
00328     // Remove old rubber rectangle
00329     DocRect OldOutline(StartPoint, StartPoint);
00330     OldOutline.IncludePoint(PreviousPoint);
00331     RenderRubberRect(&OldOutline);
00332 
00333     // Change the variable that remembers the other corner of the rectangle
00334     PreviousPoint = PointerPos;
00335 
00336     // And render the rubber rect in its new position
00337     DocRect NewOutline(StartPoint, StartPoint);
00338     NewOutline.IncludePoint(PreviousPoint);
00339     RenderRubberRect(&NewOutline);
00340 
00341     // Now we need to render selection status of newly entered/exited endpoints
00342     // Go through all the endpoints on selected NodePaths.  
00343     SelRange*   Selection = GetApplication()->FindSelection();
00344     Node*       pNode = Selection->FindFirst();
00345     NodePath*   pSelected = NULL;
00346 
00347     while (pNode != NULL)
00348     {
00349         if (pNode->IsNodePath())
00350             pSelected = (NodePath*)pNode;
00351         else
00352             pSelected = (NodePath*) (pNode->HasEditableChild(CC_RUNTIME_CLASS(NodePath), NULL));
00353 
00354         if (pSelected)
00355         {
00356             Path* ThisPath = &(pSelected->InkPath);
00357             Spread* pSpread = pNode->FindParentSpread();
00358 
00359             // Dereference the pointers
00360             DocCoord*   Coords = ThisPath->GetCoordArray();
00361             PathFlags*  Flags = ThisPath->GetFlagArray();
00362             PathVerb*   Verbs = ThisPath->GetVerbArray();
00363             INT32 UsedSlots = ThisPath->GetNumCoords();
00364 
00365             // Go into a RenderOnTop loop
00366             RenderRegion* pRender = DocView::RenderOnTop(NULL, pSpread, ClippedEOR);
00367             while (pRender!=NULL)
00368             {
00369                 // loop through the path, processing every endpoint
00370                 for (INT32 i=0; i<UsedSlots; i++)
00371                 {
00372                     if (Flags[i].IsEndPoint && !(Verbs[i] & PT_CLOSEFIGURE) )
00373                     {
00374                         BOOL First = TRUE;      // Default selection status/es/i/whatever
00375                         BOOL Second = FALSE;    // This means we can skip doing thigs
00376                         BOOL Render = FALSE;
00377                         if (!(AdjustDrag && Flags[i].IsSelected))
00378                         {
00379                             if (NewOutline.ContainsCoord(Coords[i]) && 
00380                                                         !OldOutline.ContainsCoord(Coords[i]) )
00381                             {
00382                                 // Point has just entered the selection rect
00383                                 First = FALSE;
00384                                 Second = TRUE;
00385                                 Render = TRUE;
00386                             }
00387                             if (!NewOutline.ContainsCoord(Coords[i]) 
00388                                             && OldOutline.ContainsCoord(Coords[i]) )
00389                             {
00390                                 // Point has just left the selection rect
00391                                 Render = TRUE;
00392                             }
00393                         }
00394                         if (Render)
00395                         {
00396                             ThisPath->DrawBlob(pRender, Coords[i], First);
00397                             ThisPath->DrawBlob(pRender, Coords[i], Second);
00398                         }
00399                     }
00400                 }
00401                 pRender = DocView::GetNextOnTop(NULL);
00402             }   // while the render region
00403         }   // if its a node path
00404         pNode = Selection->FindNext(pNode);
00405     }   // while there are selected nodes
00406 }

OpState OpSelectPathPoints::GetState String_256 Description,
OpDescriptor
[static]
 

Find out the state of the operation at the specific time.

Author:
Jim_Lynn (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/6/94
Parameters:
Description - GetState fills this string with an approriate description [OUTPUTS] of the current state of the push tool
Returns:
The state of the operation, so that menu items (ticks and greying can be done properly

Definition at line 865 of file opbezier.cpp.

00866 {
00867     OpState Blobby;
00868     
00869     return Blobby;
00870 }

BOOL OpSelectPathPoints::Init void   )  [static]
 

Adds the operation to the list of all known operations.

Author:
Jim_Lynn (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/7/94
Returns:
TRUE if all went OK, False otherwise

Reimplemented from SimpleCCObject.

Definition at line 160 of file opbezier.cpp.

00161 {
00162     return (RegisterOpDescriptor(   0, 
00163                                     _R(IDS_NODEPATH_EDIT),
00164                                     CC_RUNTIME_CLASS(OpSelectPathPoints), 
00165                                     OPTOKEN_NODEPATH,
00166                                     OpSelectPathPoints::GetState,
00167                                     0,  /* help ID */
00168                                     _R(IDBBL_NODEPATHOP),
00169                                     0   /* bitmap ID */));     
00170 }

void OpSelectPathPoints::PopCursor  )  [private]
 

void OpSelectPathPoints::PushCursor Cursor cursor  )  [private]
 

void OpSelectPathPoints::RemoveDragBlobs BOOL  RenderControlBlobs,
BOOL  Deselect
[private]
 

Implement a common bit of code shared by two bits at the end of DragFinished. Both want to go through all selected paths although they do different things with them.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/10/94
Parameters:
RenderContolBlobs - TRUE if the control blobs should be rendered [INPUTS] Deselect - TRUE if all endpoints should be deslected
Returns:
-
See also:
OpSelectPathPoints::DragFinished()

Definition at line 778 of file opbezier.cpp.

00779 {
00780     DocRect RubberRect(StartPoint, StartPoint);
00781     RubberRect.IncludePoint(PreviousPoint);
00782 
00783     SelRange* Selected = GetApplication()->FindSelection();
00784     Node* pNode = Selected->FindFirst();
00785     NodePath* pSelected = NULL;
00786 
00787     while (pNode)
00788     {
00789         if (pNode->IsNodePath())
00790             pSelected = (NodePath*)pNode;
00791         else
00792             pSelected = (NodePath*) (pNode->HasEditableChild(CC_RUNTIME_CLASS(NodePath), NULL));
00793 
00794         if ((pSelected) && (pSelected->FindParentSpread() == StartSpread))
00795         {
00796             Path*   ThisPath = &(pSelected->InkPath);
00797             INT32   UsedSlots = ThisPath->GetNumCoords();
00798             DocCoord*   Coords = ThisPath->GetCoordArray();
00799             PathFlags*  Flags = ThisPath->GetFlagArray();
00800             PathVerb*   Verbs = ThisPath->GetVerbArray();
00801 
00802             RenderRegion* pRender = DocView::RenderOnTop(NULL, StartSpread, ClippedEOR);
00803             while (pRender!=NULL)
00804             {
00805                 INT32 SelectedEndPoints = 0;
00806                 INT32 EndPtIndex = 0;
00807                 DocCoord EndPtCoord;
00808                 for (INT32 i=0; i<UsedSlots; i++)
00809                 {
00810                     if (Flags[i].IsEndPoint)
00811                     {
00812                         if ( ((AdjustDrag && Flags[i].IsSelected) ||
00813                                 RubberRect.ContainsCoord(Coords[i]))
00814                               && !(Verbs[i] & PT_CLOSEFIGURE) )
00815                         {
00816                             // Remove the selection blobs
00817                             ThisPath->DrawBlob(pRender, Coords[i], TRUE);
00818                             ThisPath->DrawBlob(pRender, Coords[i], FALSE);
00819                         }
00820                         if (Flags[i].IsSelected)
00821                         {
00822                             SelectedEndPoints ++;
00823                             EndPtIndex = i;
00824                             EndPtCoord = Coords[i];
00825                         }
00826                     }
00827                     if (Deselect)
00828                     {
00829                         Flags[i].IsSelected = FALSE;
00830                     }
00831                 }
00832                 if ((SelectedEndPoints == 1) && (RenderControlBlobs))
00833                 {
00834                     ThisPath->RenderPathControlBlobs(StartSpread,EndPtIndex);
00835                     if (!(AdjustDrag && RubberRect.ContainsCoord(EndPtCoord)))
00836                     {
00837                         ThisPath->DrawBlob(pRender, EndPtCoord, FALSE);
00838                         ThisPath->DrawBlob(pRender, EndPtCoord, TRUE);
00839                     }
00840                 }
00841                 pRender = DocView::GetNextOnTop(NULL);
00842             }
00843         }
00844         pNode = Selected->FindNext(pNode);
00845     }
00846 }

void OpSelectPathPoints::RenderDragBlobs DocRect  Rect,
Spread pSpread,
BOOL  bSolidDrag
[virtual]
 

EORs the rectangle onto the screen.

Author:
Jim_Lynn (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/6/94
Parameters:
Rect - The Rectangle that needs to be re-rendered [INPUTS] pSpread - The spread on which the rendering is to take place
See also:
OpBezier::RenderLineSegment()

Reimplemented from Operation.

Definition at line 583 of file opbezier.cpp.

00584 {
00585     // If being called from DocView::RenderView, then the spread could be wrong - so
00586     // convert the rectangle if necessary.
00587     if (pSpread != StartSpread)
00588     {
00589         Rect.lo = MakeRelativeToSpread(StartSpread, pSpread, Rect.lo);
00590         Rect.hi = MakeRelativeToSpread(StartSpread, pSpread, Rect.hi);
00591     }
00592 
00593     RenderRubberRect(&Rect);
00594     RenderRegion* pRegion = DocView::RenderOnTop(&Rect, StartSpread, UnclippedEOR);
00595 
00596     while (pRegion)
00597     {
00598         if (DragUnderway)
00599             RenderRubberSelection(pRegion);
00600 
00601         // Get the Next render region
00602         pRegion = DocView::GetNextOnTop(&Rect);
00603     }
00604 }

void OpSelectPathPoints::RenderRubberRect DocRect Rect  )  [private]
 

EORs the selection rectangle onto the screen. The rectangle is rendered using the coordinates StartPoint to PreviousPoint.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/94
Parameters:
Rect - pointer to the bounding box of the render region. NOT the rubber [INPUTS] rectangle.
Returns:
-
See also:
OpSelectPathPoints::RenderRubberSelection(), OpSelectPathPoints::RenderDragBlobs()

Definition at line 622 of file opbezier.cpp.

00623 {
00624     RenderRegion* pRegion = DocView::RenderOnTop(Rect, StartSpread, UnclippedEOR);
00625     while (pRegion)
00626     {
00627         // Set the line colour 
00628         pRegion -> SetLineColour(COLOUR_XORNEW);
00629         pRegion -> SetFillColour(COLOUR_NONE);
00630 
00631         // And Draw the rect
00632         DocRect RubberBox(StartPoint, StartPoint);
00633         RubberBox.IncludePoint(PreviousPoint);
00634         
00635         // Draw the rectangle
00636         pRegion->DrawDragRect(&RubberBox);
00637 
00638         // Get the Next render region
00639         pRegion = DocView::GetNextOnTop(Rect);
00640     }
00641 }

void OpSelectPathPoints::RenderRubberSelection RenderRegion pRegion  )  [private]
 

EORs the blobs on the selected paths onto the screen. This is is needed to solve quite an ugly situation. If the path(s) are scrolled then their blobs will be redrawn as per their document status. We need to go through all the paths rendering their selection status as we want them to be.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/94
Parameters:
pRegion - pointer to the render region to draw into. [INPUTS]
Returns:
-
See also:
OpSelectPathPoints::RenderRubberRect(), OpSelectPathPoints::RenderDragBlobs()

Definition at line 661 of file opbezier.cpp.

00662 {
00663     ERROR3IF (pRegion == NULL, "Pointer to RenderRegion was NULL");
00664     ERROR3IF (!DragUnderway, "RenderRubberSelection called when no drag was underway");
00665     
00666     SelRange*   Selection = GetApplication()->FindSelection();
00667     Node*       pNode = Selection->FindFirst();
00668 
00669     DocRect RubberBox(StartPoint, StartPoint);
00670     RubberBox.IncludePoint(PreviousPoint);
00671     NodePath* pSelected = NULL;
00672 
00673     while (pNode)
00674     {
00675         if (pNode->IsNodePath())
00676             pSelected = (NodePath*)pNode;
00677         else
00678             pSelected = (NodePath*) (pNode->HasEditableChild(CC_RUNTIME_CLASS(NodePath), NULL));
00679 
00680         if ((pSelected) && (pSelected->FindParentSpread() == StartSpread))
00681         {
00682             Path*   ThisPath = &(pSelected->InkPath);
00683             INT32   UsedSlots = ThisPath->GetNumCoords();
00684             DocCoord*   Coords = ThisPath->GetCoordArray();
00685             PathFlags*  Flags = ThisPath->GetFlagArray();
00686             PathVerb*   Verbs = ThisPath->GetVerbArray();
00687             INT32 EndPtIndex =0;
00688             INT32 endcount = 0;
00689 
00690             for (INT32 i=0; i<UsedSlots; i++)
00691             {
00692                 if (Flags[i].IsEndPoint && !(Verbs[i] & PT_CLOSEFIGURE))
00693                 {
00694                     // Now we need to render on the selection blob status
00695                     BOOL First = TRUE;      // By default deselect a selected blob
00696                     BOOL Second = FALSE;    
00697                     BOOL Render = FALSE;
00698 
00699                     if (Flags[i].IsSelected)
00700                     {
00701                         EndPtIndex = i;
00702                         endcount++;
00703                         Render = TRUE;
00704                     }
00705                     
00706                     if (AdjustDrag)
00707                         Render = FALSE; 
00708 
00709                     if (RubberBox.ContainsCoord(Coords[i]) && !Flags[i].IsSelected)
00710                     {
00711                         // Render an unselected blob as selected
00712                         Render = TRUE;
00713                         First = FALSE;
00714                         Second = TRUE;
00715                     }
00716 
00717                     if (Render)
00718                     {
00719                         ThisPath->DrawBlob(pRegion, Coords[i], First);
00720                         ThisPath->DrawBlob(pRegion, Coords[i], Second);
00721                     }
00722                 }
00723             }
00724             if (endcount == 1)
00725             {
00726                 // Remove the control points and lines
00727                 ThisPath->RenderPathControlBlobs(StartSpread,EndPtIndex);
00728             }
00729         }
00730         pNode = Selection->FindNext(pNode);
00731     }
00732 }


Member Data Documentation

BOOL OpSelectPathPoints::AdjustDrag [private]
 

Definition at line 155 of file opbezier.h.

BezierTool* OpSelectPathPoints::BezToolPtr [private]
 

Definition at line 156 of file opbezier.h.

BOOL OpSelectPathPoints::DragUnderway = FALSE [static, private]
 

Definition at line 158 of file opbezier.h.

ClickModifiers OpSelectPathPoints::Mods [private]
 

Definition at line 157 of file opbezier.h.

Cursor* OpSelectPathPoints::pcMarqueeCursor [private]
 

Definition at line 160 of file opbezier.h.

DocCoord OpSelectPathPoints::PreviousPoint [private]
 

Definition at line 154 of file opbezier.h.

DocCoord OpSelectPathPoints::StartPoint [private]
 

Definition at line 152 of file opbezier.h.

Spread* OpSelectPathPoints::StartSpread [private]
 

Definition at line 153 of file opbezier.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:58:52 2007 for Camelot by  doxygen 1.4.4