AttrThreeColFill Class Reference

ThreeCol Graduated Fill Attribute class. More...

#include <fillattr2.h>

Inheritance diagram for AttrThreeColFill:

AttrFillGeometry NodeAttribute NodeRenderable Node CCObject SimpleCCObject AttrThreeColColourFill AttrThreeColTranspFill List of all members.

Public Member Functions

 AttrThreeColFill ()
 AttrThreeColFill (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
virtual void Transform (TransformBase &)
 Transform a grad fill attribute by moving the start and end points.
virtual BOOL CanTransform ()
 Indicate that this attribute can be transformed.
virtual void RenderFillBlobs (RenderRegion *pRender)
virtual void RenderFillMesh (RenderRegion *, DocCoord *, BOOL *, INT32 NumControlPoints=0)
virtual void OnControlDrag (DocCoord, FillControl &, ClickModifiers)
virtual void RenderControl (FillControl Control, BOOL RenderOn)
 Renders a specified control.
virtual void CycleSelection (BOOL Reverse)
 Cycles the selection state of the controls.
virtual FillControl CheckForControlHit (DocCoord &ClickPos)
 Check to see if a click was on a Fill Control Point.
virtual AttributeValueGetAttributeValue ()=0
virtual FillControl TestColourDrop (AttrColourDrop *ColDrop)
 Check to see which colour will be changed if dropped at this point.
virtual void TransformSelectedControlPoints (TransformBase &, BOOL *isARampBlob=NULL)
 Transform a grad fill attribute by moving the selected control points.
virtual BOOL IsAGradFill () const
 Virtual function for determining if the node is an attribute.
virtual DocRect GetBlobBoundingRect ()
 Calculates the bounding rectangle of the attrs blobs.This should always be calculated on the fly as the view scale can change without the attr knowing, giving an incorrect result.
virtual BOOL NeedsForceToSimpleMapping ()
virtual INT32 GetNumberOfControlPoints ()

Protected Member Functions

virtual void ValidateAttributeValue ()
 Makes sure the Coords of the Fill are sensible.

Detailed Description

ThreeCol Graduated Fill Attribute class.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/07/94
See also:
ThreeColFillAttribute

Definition at line 1437 of file fillattr2.h.


Constructor & Destructor Documentation

AttrThreeColFill::AttrThreeColFill  )  [inline]
 

Definition at line 1442 of file fillattr2.h.

01442 : AttrFillGeometry() {}

AttrThreeColFill::AttrThreeColFill Node ContextNode,
AttachNodeDirection  Direction,
BOOL  Locked = FALSE,
BOOL  Mangled = FALSE,
BOOL  Marked = FALSE,
BOOL  Selected = FALSE
[inline]
 

Definition at line 1443 of file fillattr2.h.

01448                                      : 
01449         AttrFillGeometry(ContextNode, Direction, Locked, Mangled, Marked, Selected) {}


Member Function Documentation

BOOL AttrThreeColFill::CanTransform  )  [virtual]
 

Indicate that this attribute can be transformed.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
Returns:
TRUE => transform this attribute.
See also:
Copied from AttrLinearFill

Reimplemented from NodeRenderable.

Definition at line 11205 of file fillattr.cpp.

11206 {
11207     return TRUE;
11208 }

FillControl AttrThreeColFill::CheckForControlHit DocCoord ClickPos  )  [virtual]
 

Check to see if a click was on a Fill Control Point.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/08/96
Parameters:
ClickPos,The DocCoord position to check. [INPUTS]
Returns:
A FillControl, indicating the Fill Control Point Hit, or FILLCONTROL_NULL, if no points hit.
See also:
FillControl

Reimplemented from AttrFillGeometry.

Definition at line 11631 of file fillattr.cpp.

11632 {
11633     // Set up a default, that indicates not control points hit
11634     FillControl HitControl = FILLCONTROL_NULL;
11635 #if !defined(EXCLUDE_FROM_RALPH)
11636     DocRect BlobRect;
11637 
11638     if (!GetApplication()->GetBlobManager()->GetCurrentInterest().Fill || !IsVisible())
11639         return FILLCONTROL_NULL;
11640 
11641 
11642     // Get the rectangle around the Start Control Point
11643     (Camelot.GetBlobManager())->GetBlobRect(*GetStartPoint(), &BlobRect);
11644     // See if the Click Position is within the rectangle
11645     if ( BlobRect.ContainsCoord(ClickPos) )
11646         HitControl = FILLCONTROL_STARTPOINT;
11647 
11648     // Get the rectangle around the End Control Point
11649     (Camelot.GetBlobManager())->GetBlobRect(*GetEndPoint(), &BlobRect);
11650     // See if the Click Position is within the rectangle
11651     if ( BlobRect.ContainsCoord(ClickPos) )
11652         HitControl = FILLCONTROL_ENDPOINT;
11653 
11654     // Get the rectangle around the Secondary Control Point
11655     (Camelot.GetBlobManager())->GetBlobRect(*GetEndPoint2(), &BlobRect);
11656     // See if the Click Position is within the rectangle
11657     if ( BlobRect.ContainsCoord(ClickPos) )
11658         HitControl = FILLCONTROL_ENDPOINT2;
11659 #endif
11660     return HitControl;
11661 }

void AttrThreeColFill::CycleSelection BOOL  Reverse  )  [virtual]
 

Cycles the selection state of the controls.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/08/96

Reimplemented from AttrFillGeometry.

Definition at line 11585 of file fillattr.cpp.

11586 {
11587     if (GetSelectionCount() == 1)
11588     {
11589         if (SelectionState[FILLCONTROL_STARTPOINT])
11590         {
11591             DeselectAll();
11592             if (Reverse)
11593                 SelectBlob(FILLCONTROL_ENDPOINT2);
11594             else
11595                 SelectBlob(FILLCONTROL_ENDPOINT);
11596         }
11597         else if (SelectionState[FILLCONTROL_ENDPOINT])
11598         {
11599             DeselectAll();
11600             if (Reverse)
11601                 SelectBlob(FILLCONTROL_STARTPOINT);
11602             else
11603                 SelectBlob(FILLCONTROL_ENDPOINT2);
11604         }
11605         else if (SelectionState[FILLCONTROL_ENDPOINT2])
11606         {
11607             DeselectAll();
11608             if (Reverse)
11609                 SelectBlob(FILLCONTROL_ENDPOINT);
11610             else
11611                 SelectBlob(FILLCONTROL_STARTPOINT);
11612         }
11613     }
11614 }

virtual AttributeValue* AttrThreeColFill::GetAttributeValue  )  [pure virtual]
 

Implements AttrFillGeometry.

Implemented in AttrThreeColColourFill, and AttrThreeColTranspFill.

DocRect AttrThreeColFill::GetBlobBoundingRect  )  [virtual]
 

Calculates the bounding rectangle of the attrs blobs.This should always be calculated on the fly as the view scale can change without the attr knowing, giving an incorrect result.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
Returns:
DocRect - The rectangle that contains all the nodes selection blobs.

Reimplemented from AttrFillGeometry.

Definition at line 11466 of file fillattr.cpp.

11467 {
11468 #if !defined(EXCLUDE_FROM_RALPH)
11469     // Optimisation.  If there is currently no interest in Fill Blobs
11470     // and this fill is not being Dragged (Fill blobs are turned off during
11471     // a fill drag), then we needn't bother doing anything. 
11472     if ( (!GetApplication()->GetBlobManager()->GetCurrentInterest(TRUE).Fill || !IsVisible()) && DraggedFill != this )
11473         return DocRect(0,0, 0,0);
11474 
11475     // Get the Start and End Points
11476     DocCoord StartPoint = *GetStartPoint();
11477     DocCoord EndPoint = *GetEndPoint();
11478     DocCoord EndPoint2 = *GetEndPoint2();
11479 
11480     // Make a dummy bounds from just the Start Point
11481     DocRect BoundingRect(StartPoint, StartPoint);
11482 
11483     // We're not being dragged, so just calc the bounds of the Start and End Blobs
11484     DocRect BlobRect;
11485 
11486     // Get the Bounding rect of the Blob and include the Bottom Left and
11487     // Top Right of each blob in the Bounds.
11488     // We have to do it like this to make sure that the DocRect's coords
11489     // are valid.  ie. The Hi's are Higher than the Lo's.
11490     (Camelot.GetBlobManager())->GetBlobRect(StartPoint, &BlobRect);
11491     BoundingRect.IncludePoint(BlobRect.lo);
11492     BoundingRect.IncludePoint(BlobRect.hi);
11493 
11494     (Camelot.GetBlobManager())->GetBlobRect(EndPoint, &BlobRect);
11495     BoundingRect.IncludePoint(BlobRect.lo);
11496     BoundingRect.IncludePoint(BlobRect.hi);
11497 
11498     (Camelot.GetBlobManager())->GetBlobRect(EndPoint2, &BlobRect);
11499     BoundingRect.IncludePoint(BlobRect.lo);
11500     BoundingRect.IncludePoint(BlobRect.hi);
11501 
11502     IncludeArrowHead(&BoundingRect, StartPoint, EndPoint);
11503     IncludeArrowHead(&BoundingRect, StartPoint, EndPoint2);
11504 
11505     // and return it
11506     return BoundingRect;
11507 #else
11508     return DocRect(0,0,0,0);
11509 #endif
11510 }

virtual INT32 AttrThreeColFill::GetNumberOfControlPoints  )  [inline, virtual]
 

Reimplemented from AttrFillGeometry.

Definition at line 1479 of file fillattr2.h.

01479 { return 3; }

virtual BOOL AttrThreeColFill::IsAGradFill  )  const [inline, virtual]
 

Virtual function for determining if the node is an attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/2/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the node is a NodeAttribute, will return TRUE

Errors:

Reimplemented from NodeAttribute.

Definition at line 1471 of file fillattr2.h.

01471 { return TRUE; } 

virtual BOOL AttrThreeColFill::NeedsForceToSimpleMapping  )  [inline, virtual]
 

Reimplemented from AttrFillGeometry.

Definition at line 1475 of file fillattr2.h.

01475 { return (FALSE); }

void AttrThreeColFill::OnControlDrag DocCoord  ,
FillControl ,
ClickModifiers 
[virtual]
 

Reimplemented from AttrFillGeometry.

Definition at line 11365 of file fillattr.cpp.

11366 {
11367 #if !defined(EXCLUDE_FROM_RALPH)
11368     // Get the current Control Positions
11369     DocCoord StartPoint = *GetStartPoint();
11370     DocCoord EndPoint = *GetEndPoint();
11371     DocCoord EndPoint2 = *GetEndPoint2();
11372 
11373     INT32 dx, dy;
11374 
11375     // Which control point is being dragged ?
11376     switch (DragControl)
11377     {
11378         case FILLCONTROL_STARTPOINT:
11379         
11380             // Someone is dragging the Centre of the Fill
11381             dx = StartPoint.x - Pos.x;
11382             dy = StartPoint.y - Pos.y;
11383             // Move the other points relative
11384             EndPoint.translate(-dx, -dy);
11385             EndPoint2.translate(-dx, -dy);
11386 
11387             SetEndPoint(&EndPoint);
11388             SetEndPoint2(&EndPoint2);
11389             SetStartPoint(&Pos);
11390             break;
11391 
11392         case FILLCONTROL_ENDPOINT:
11393             
11394             // Someone is dragging the first End Point
11395             
11396             // Constrain the angle if necessary
11397             if (ClickMods.Constrain)
11398                 DocView::ConstrainToAngle(StartPoint, &Pos);
11399 
11400             // The mesh can be locked as an equilateral triangle by the Shift key
11401             if (ClickMods.Adjust)
11402             {
11403                 double OldLen = StartPoint.Distance(EndPoint);
11404                 double NewLen = StartPoint.Distance(Pos);
11405                 double Ratio = 1.0;
11406 
11407                 if (OldLen == 0)
11408                     Ratio = 0;
11409                 else
11410                     Ratio = NewLen/OldLen;
11411 
11412                 // Calculate the new end point
11413                 DocCoord temp = MakeLineAtAngle(StartPoint, Pos, 60, INT32(StartPoint.Distance(EndPoint2) * Ratio));
11414                 SetEndPoint2(&temp);
11415             }
11416 
11417             SetEndPoint(&Pos);
11418             break;
11419 
11420         case FILLCONTROL_ENDPOINT2:
11421 
11422             // Someone is dragging the second End Point
11423             
11424             // Constrain the angle if necessary
11425             if (ClickMods.Constrain)
11426                 DocView::ConstrainToAngle(StartPoint, &Pos);
11427 
11428             // The mesh can be locked as an equilateral triangle by the Shift key
11429             if (ClickMods.Adjust)
11430             {
11431                 double OldLen = StartPoint.Distance(EndPoint2);
11432                 double NewLen = StartPoint.Distance(Pos);
11433                 double Ratio = 1.0;
11434 
11435                 if (OldLen == 0)
11436                     Ratio = 0;
11437                 else
11438                     Ratio = NewLen/OldLen;
11439 
11440                 // Calculate the new end point
11441                 DocCoord temp = MakeLineAtAngle(StartPoint, Pos, -60, INT32(StartPoint.Distance(EndPoint) * Ratio));
11442                 SetEndPoint(&temp);
11443             }
11444 
11445             SetEndPoint2(&Pos);
11446             break;
11447     }
11448 #endif
11449 }

void AttrThreeColFill::RenderControl FillControl  Control,
BOOL  RenderOn
[virtual]
 

Renders a specified control.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/08/96
Parameters:
Control,the control to render [INPUTS] RenderOn, TRUE if rendering blob on FALSE if off
See also:
FillControl

Reimplemented from AttrFillGeometry.

Definition at line 11526 of file fillattr.cpp.

11527 {
11528 #if !defined(EXCLUDE_FROM_RALPH)
11529     DocRect ControlRect;
11530 
11531     // Ignore if we're not in the tree yet
11532     // We may be a tempory clone, or something
11533     NodeRenderable* pParent = (NodeRenderable*)FindParent();
11534 
11535     if (pParent == NULL)
11536         return;
11537 
11538     if (IsBlobSame(Control))
11539         return;         // Ignore if same as the last blob rendered
11540 
11541     Spread* pSpread = this->FindParentSpread();
11542 
11543     switch (Control)
11544     {
11545         case FILLCONTROL_STARTPOINT:
11546             if (GetStartPoint() != NULL)
11547             {
11548                 // Redraw the Start Point Blob
11549                 (Camelot.GetBlobManager())->GetBlobRect(*GetStartPoint(), &ControlRect);
11550                 RenderFillControl(RenderOn, &ControlRect, pSpread, pParent);
11551             }
11552             break;
11553 
11554         case FILLCONTROL_ENDPOINT:
11555             if (GetEndPoint() != NULL)
11556             {
11557                 // Redraw BOTH End Point Blobs
11558                 (Camelot.GetBlobManager())->GetBlobRect(*GetEndPoint(), &ControlRect);
11559                 RenderFillControl(RenderOn, &ControlRect, pSpread, pParent);
11560             }
11561             break;
11562 
11563         case FILLCONTROL_ENDPOINT2:
11564             if (GetEndPoint2() != NULL)
11565             {
11566                 (Camelot.GetBlobManager())->GetBlobRect(*GetEndPoint2(), &ControlRect);
11567                 RenderFillControl(RenderOn, &ControlRect, pSpread, pParent);
11568             }
11569             break;
11570     }
11571 #endif
11572 }

virtual void AttrThreeColFill::RenderFillBlobs RenderRegion pRender  )  [inline, virtual]
 

Reimplemented from AttrFillGeometry.

Reimplemented in AttrThreeColColourFill, and AttrThreeColTranspFill.

Definition at line 1455 of file fillattr2.h.

01455 {};

void AttrThreeColFill::RenderFillMesh RenderRegion ,
DocCoord ,
BOOL *  ,
INT32  NumControlPoints = 0
[virtual]
 

Reimplemented from AttrFillGeometry.

Definition at line 11229 of file fillattr.cpp.

11232 {
11233 #if !defined(EXCLUDE_FROM_RALPH)
11234     DocCoord StartPoint = ControlPoints[FILLCONTROL_STARTPOINT];
11235     DocCoord EndPoint   = ControlPoints[FILLCONTROL_ENDPOINT];
11236     DocCoord EndPoint2  = ControlPoints[FILLCONTROL_ENDPOINT2];
11237 
11238     if (StartPoint == EndPoint)
11239         return;
11240 
11241     if (SelState == NULL)
11242     {
11243         // If no selection state passed in, then assume
11244         // all the points are deselected
11245         BOOL Selected[NUMCONTROLPOINTS];
11246         for (INT32 i=0; i< NumControlPoints; i++)
11247         {
11248             Selected[i] = FALSE;
11249         }
11250         SelState = Selected;
11251     }
11252 
11253     // Remember what attributes were here before
11254     pRender->SaveContext();
11255 
11256     // Get the current blob size in Doc Units
11257     INT32 BlobSize = (Camelot.GetBlobManager())->GetBlobSize();
11258 
11259     // Calculate the Arrow on the End of the Line
11260     Path ArrowPath;
11261     ArrowPath.Initialise();
11262     DocCoord LineEnd;
11263     MakeMeshArrow(&ArrowPath, StartPoint, EndPoint, &LineEnd);
11264 
11265     // Calculate the Arrow on the End of the Line2
11266     Path ArrowPath2;
11267     ArrowPath2.Initialise();
11268     DocCoord LineEnd2;
11269     MakeMeshArrow(&ArrowPath2, StartPoint, EndPoint2, &LineEnd2);
11270 
11271     // Set the line colours etc as we need them
11272     pRender->SetLineWidth(0);
11273     pRender->SetLineColour(COLOUR_UNSELECTEDBLOB);
11274     pRender->SetFillColour(COLOUR_UNSELECTEDBLOB);
11275 
11276     // First Draw the Line
11277     pRender->SetLineWidth(BlobSize/4);
11278     pRender->DrawLine(StartPoint, LineEnd);
11279 
11280     // Draw the secondary line
11281     pRender->DrawLine(StartPoint, LineEnd2);
11282 
11283     // Render an Arrow at the end of the line
11284     pRender->SetLineWidth(0);
11285     pRender->SetLineColour(COLOUR_NONE);
11286     pRender->DrawPath(&ArrowPath);
11287 
11288     // and on the end of the secondary line
11289     pRender->DrawPath(&ArrowPath2);
11290 
11291     if (DraggedFill == this)
11292     {
11293         // If we are being dragged then draw a line accros the end of the triangle
11294         pRender->SetLineColour(COLOUR_SELECTEDBLOB);
11295         pRender->SetFillColour(COLOUR_NONE);
11296         pRender->DrawLine(EndPoint, EndPoint2);
11297     }
11298 
11299     // Now Render the blobs on the path
11300     // Set the line colour to none
11301     pRender->SetLineColour(COLOUR_NONE);
11302 
11303     // Draw a blob at the start point
11304     if (SelState[FILLCONTROL_STARTPOINT])
11305     {
11306         // Draw Selected Blob
11307         pRender->SetFillColour(COLOUR_SELECTEDBLOB);
11308         pRender->DrawBlob(StartPoint, BT_SELECTED);
11309     }
11310     else
11311     {
11312         // Draw Unselected Blob
11313         pRender->SetFillColour(COLOUR_UNSELECTEDBLOB);
11314         pRender->DrawBlob(StartPoint, BT_UNSELECTED);
11315     }
11316 
11317     // Draw the blobs at the end points
11318     if (SelState[FILLCONTROL_ENDPOINT])
11319     {
11320         // Draw Selected Blobs
11321         pRender->SetFillColour(COLOUR_SELECTEDBLOB);
11322         pRender->DrawBlob(EndPoint, BT_SELECTED);
11323     }
11324     else
11325     {
11326         // Draw Unselected Blobs
11327         pRender->SetFillColour(COLOUR_UNSELECTEDBLOB);
11328         pRender->DrawBlob(EndPoint, BT_UNSELECTED);
11329     }
11330 
11331     // Draw the blobs at the second end point
11332     if (SelState[FILLCONTROL_ENDPOINT2])
11333     {
11334         // Draw Selected Blobs
11335         pRender->SetFillColour(COLOUR_SELECTEDBLOB);
11336         pRender->DrawBlob(EndPoint2,BT_SELECTED);
11337     }
11338     else
11339     {
11340         // Draw Unselected Blobs
11341         pRender->SetFillColour(COLOUR_UNSELECTEDBLOB);
11342         pRender->DrawBlob(EndPoint2,BT_UNSELECTED);
11343     }
11344 
11345     // Put all the old attributes back
11346     pRender->RestoreContext();
11347 #endif
11348 }

FillControl AttrThreeColFill::TestColourDrop AttrColourDrop ColDrop  )  [virtual]
 

Check to see which colour will be changed if dropped at this point.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
Parameters:
ColDrop - pointer to the [INPUTS]

Reimplemented from AttrFillGeometry.

Definition at line 11106 of file fillattr.cpp.

11107 { 
11108 #if !defined(EXCLUDE_FROM_RALPH)
11109     // So, where was it dropped (or where will it be dropped)
11110     DocCoord DropPoint = ColDrop->GetDropPoint();
11111 
11112     // Look to see if the DropPoint is over any of the Fill Control Points
11113     FillControl ControlHit = CheckForControlHit(DropPoint);
11114     
11115     // If it hit one of our control points, then use that
11116     if (ControlHit != FILLCONTROL_NULL)
11117         return ControlHit;
11118 
11119     // It didn't hit any of our control points, so if the drop is over
11120     // the object then we'll make a guess as to which control point
11121     // the user would like to change, depending on which area of the
11122     // object the pointer is over.
11123 
11124     // First make sure we're actually over an object
11125     NodeRenderableInk* pParentObject = ColDrop->GetObjectDroppedOn();
11126     if (pParentObject == NULL)
11127         return FILLCONTROL_NULL;    // We're not over any object 
11128 
11129     // Make sure this fill type has some Control Points
11130     if (GetStartPoint() == NULL || GetEndPoint() == NULL || GetEndPoint2() == NULL)
11131         return FILLCONTROL_NULL;
11132 
11133     DocCoord StartPoint = *GetStartPoint();
11134     DocCoord EndPoint   = *GetEndPoint();
11135     DocCoord EndPoint2  = *GetEndPoint2();
11136 
11137     double StartDist = DropPoint.Distance(StartPoint);
11138     double EndDist = DropPoint.Distance(EndPoint);
11139     double End2Dist = DropPoint.Distance(EndPoint2);
11140     
11141     // FInd which point is closest
11142     
11143     if (StartDist < End2Dist)
11144     {
11145         if (StartDist < EndDist)
11146             ControlHit = FILLCONTROL_STARTPOINT;
11147         else
11148             ControlHit = FILLCONTROL_ENDPOINT;
11149     }
11150     else
11151     {
11152         if (EndDist < End2Dist)
11153             ControlHit = FILLCONTROL_ENDPOINT;
11154         else
11155             ControlHit = FILLCONTROL_ENDPOINT2;
11156     }
11157 
11158     return ControlHit;
11159 #else
11160     return FILLCONTROL_NULL;
11161 #endif
11162 }

void AttrThreeColFill::Transform TransformBase Trans  )  [virtual]
 

Transform a grad fill attribute by moving the start and end points.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96
Parameters:
Trans - the transform object to apply to this attribute. [INPUTS]
See also:
Copied from AttrLinearFill

Reimplemented from NodeRenderable.

Definition at line 11178 of file fillattr.cpp.

11179 {
11180     if ( Trans.TransFills )
11181     {
11182         Trans.Transform( GetStartPoint(), 1);
11183         Trans.Transform( GetEndPoint(), 1);
11184         Trans.Transform( GetEndPoint2(), 1);
11185 
11186         if (IsPerspective())
11187             Trans.Transform( GetEndPoint3(), 1);
11188     }
11189 }

void AttrThreeColFill::TransformSelectedControlPoints TransformBase Trans,
BOOL *  isARampBlob = NULL
[virtual]
 

Transform a grad fill attribute by moving the selected control points.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/8/96
Parameters:
Trans - the transform object to apply to this attribute. [INPUTS]
See also:
NodeRenderable::Transform

Reimplemented from AttrFillGeometry.

Definition at line 11049 of file fillattr.cpp.

11050 {
11051 #if !defined(EXCLUDE_FROM_RALPH)
11052     if ( Trans.TransFills )
11053     {
11054         ClickModifiers ClickMods;
11055         ClickMods.Adjust = FALSE;       // Force adjust off
11056 
11057         // If the start point is selected then move the whole mesh
11058         if (IsSelected(FILLCONTROL_STARTPOINT))
11059         {
11060             DocCoord Pos = *GetStartPoint();
11061             Trans.Transform( &Pos, 1);
11062 
11063             FillControl Start = FILLCONTROL_STARTPOINT;
11064 
11065             OnControlDrag(Pos, Start, ClickMods);
11066         }
11067         else
11068         {
11069             // Otherwise move the fill points
11070             if (IsSelected(FILLCONTROL_ENDPOINT))
11071             {
11072                 DocCoord Pos = *GetEndPoint();
11073                 Trans.Transform( &Pos, 1);
11074 
11075                 FillControl End = FILLCONTROL_ENDPOINT;
11076 
11077                 OnControlDrag(Pos, End, ClickMods);
11078             }
11079 
11080             if (IsSelected(FILLCONTROL_ENDPOINT2))
11081             {
11082                 DocCoord Pos = *GetEndPoint2();
11083                 Trans.Transform( &Pos, 1);
11084 
11085                 FillControl End2 = FILLCONTROL_ENDPOINT2;
11086 
11087                 OnControlDrag(Pos, End2, ClickMods);
11088             }
11089         }
11090     }
11091 #endif
11092 }

void AttrThreeColFill::ValidateAttributeValue  )  [protected, virtual]
 

Makes sure the Coords of the Fill are sensible.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/8/96

Reimplemented from AttrFillGeometry.

Definition at line 11676 of file fillattr.cpp.

11677 {
11678 #if !defined(EXCLUDE_FROM_RALPH)
11679     if ((*GetStartPoint()) != DocCoord(0,0) && (*GetEndPoint()) != DocCoord(0,0))
11680     {
11681         // If the EndPoint2 is 'NULL' then make it sensible
11682         if (*GetEndPoint2() == DocCoord(0,0))
11683         {
11684             DocCoord temp = MakeLineAtAngle((*GetStartPoint()), (*GetEndPoint()), 90);
11685             SetEndPoint2(&temp);
11686         }
11687         
11688         return;
11689     }
11690 
11691     // Make up some sensible defaults
11692     DocRect AttrBounds = DocRect(0,0,0,0);
11693 
11694     INT32 Width  = DEFAULT_FILLWIDTH;
11695     INT32 Height = DEFAULT_FILLHEIGHT;
11696 
11697     // Are we an Orphan ?
11698     if (FindParent() != NULL)
11699     {
11700         // Nope, so we can use Daddies Bounding Box
11701         SelRange* Selected = GetApplication()->FindSelection();
11702                  
11703         if (Selected == NULL || Selected->Count() <= 1)
11704             AttrBounds = ((NodeRenderableBounded*)FindParent())->GetBoundingRect(TRUE);
11705         else
11706             AttrBounds = Selected->GetBoundingRect();
11707 
11708         Width  = AttrBounds.Width();
11709         Height = AttrBounds.Height();
11710     }
11711 
11712     // If the StartPoint is 'NULL' then make all points sensible
11713     if ((*GetStartPoint()) == DocCoord(0,0))
11714     {
11715         // Start in the centre of the bounds
11716         SetStartPoint(&AttrBounds.lo);
11717 
11718         // and set End Points to Middle Right, and Middle Top
11719         DocCoord temp = DocCoord(AttrBounds.hi.x, AttrBounds.lo.y);
11720         SetEndPoint(&temp);
11721         temp = DocCoord(AttrBounds.lo.x, AttrBounds.hi.y);
11722         SetEndPoint2(&temp);
11723     }
11724 
11725     // If the EndPoint is 'NULL' then make it sensible
11726     if ((*GetEndPoint()) == DocCoord(0,0))
11727     {
11728         DocCoord temp = DocCoord(AttrBounds.hi.x, AttrBounds.lo.y);
11729         SetEndPoint(&temp);
11730     }
11731 
11732     if ((*GetEndPoint2()) == DocCoord(0,0))
11733     {
11734         DocCoord temp = DocCoord(AttrBounds.lo.x, AttrBounds.hi.y);
11735         SetEndPoint2(&temp);
11736     }
11737 #endif
11738 }


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