AttrFillGeometry Class Reference

Fill Geometry Attribute class. More...

#include <fillattr.h>

Inheritance diagram for AttrFillGeometry:

NodeAttribute NodeRenderable Node CCObject SimpleCCObject AttrBitmapFill AttrConicalFill AttrFlatFill AttrFourColFill AttrLinearFill AttrRadialFill AttrSquareFill AttrStrokeColour AttrStrokeTransp AttrThreeColFill AttrTranspFillGeometry AttrValueChange List of all members.

Public Member Functions

 AttrFillGeometry ()
 Default constructor for a Fill Attribute. Sets default Selection State and Attribute Bounds.
 ~AttrFillGeometry ()
 Destroys a Fill. Currently this function does nothing.
 AttrFillGeometry (Node *ContextNode, AttachNodeDirection Direction, BOOL Locked=FALSE, BOOL Mangled=FALSE, BOOL Marked=FALSE, BOOL Selected=FALSE)
virtual INT32 operator== (const NodeAttribute &NodeAttrib)
 A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
virtual INT32 operator= (AttrFillGeometry &FillAttrib)
 A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
virtual void RenderFillBlobs (RenderRegion *pRender)
virtual void RenderFillMesh (RenderRegion *, DocCoord *, BOOL *, INT32 NumControlPoints=0)
virtual void RenderFillBlobs ()
 Force Renders the fill mesh off the screen.
void DisableRampRedraw ()
void EnableRampRedraw ()
void DisableBoundsRedraw ()
void EnableBoundsRedraw ()
virtual void DrawEndBlobs ()
 Draws the blobs on the ends of the fill arrows.
virtual DocColourGetStartColour ()
virtual DocColourGetEndColour ()
virtual DocColourGetEndColour2 ()
virtual DocColourGetEndColour3 ()
virtual UINT32GetStartTransp ()
virtual UINT32GetEndTransp ()
virtual UINT32GetEndTransp2 ()
virtual UINT32GetEndTransp3 ()
virtual DocCoordGetStartPoint ()
virtual DocCoordGetEndPoint ()
virtual DocCoordGetEndPoint2 ()
virtual DocCoordGetEndPoint3 ()
virtual CProfileBiasGainGetProfile ()
virtual void SetStartColour (DocColour *NewCol)
virtual void SetEndColour (DocColour *NewCol)
virtual void SetEndColour2 (DocColour *NewCol)
virtual void SetEndColour3 (DocColour *NewCol)
virtual void SetStartTransp (UINT32 *NewTransp)
virtual void SetEndTransp (UINT32 *NewTransp)
virtual void SetEndTransp2 (UINT32 *NewTransp)
virtual void SetEndTransp3 (UINT32 *NewTransp)
virtual void SetStartPoint (DocCoord *Pos)
virtual void SetEndPoint (DocCoord *Pos)
virtual void SetEndPoint2 (DocCoord *Pos)
virtual void SetEndPoint3 (DocCoord *Pos)
virtual void SetProfile (CProfileBiasGain &SetWith)
virtual UINT32 GetTranspType ()
virtual UINT32 GetDPI ()
virtual UINT32 GetFractalDPI ()
virtual UINT32 GetFractalDim ()
virtual INT32 GetSeed ()
virtual FIXED16 GetGraininess ()
virtual FIXED16 GetGravity ()
virtual FIXED16 GetSquash ()
virtual BOOL GetTileable ()
virtual double GetNoiseScale ()
virtual void SetTranspType (UINT32 NewType)
virtual BOOL SetDPI (UINT32 NewDpi)
virtual BOOL SetFractalDPI (UINT32 NewDpi)
virtual void SetFractalDim (UINT32 NewDim)
virtual BOOL SetSeed (INT32 NewSeed)
virtual BOOL SetGraininess (FIXED16 NewGrain)
virtual BOOL SetGravity (FIXED16 NewGrav)
virtual BOOL SetSquash (FIXED16 NewSquash)
virtual BOOL SetTileable (BOOL NewTile)
virtual BOOL SetNoiseScale (double ns)
virtual BOOL RecalcFractal ()
virtual BOOL Randomise ()
virtual BOOL AttachBitmap (KernelBitmap *NewBitmap)
virtual BOOL DetachBitmap ()
virtual KernelBitmapGetBitmap ()
virtual BOOL CopyBitmap (KernelBitmap *CopyBitmap)
virtual KernelBitmapRefGetBitmapRef ()
virtual INT32 GetTesselation ()
virtual void SetTesselation (INT32 NewTess)
virtual BOOL IsPerspective ()
virtual ColourRampGetColourRamp ()
virtual TransparencyRampGetTranspRamp ()
virtual void SetColourRamp (ColourRamp *New)
virtual void SetTranspRamp (TransparencyRamp *New)
virtual void MakePerspective (UndoableOperation *pUndoOp=NULL)
virtual void RemovePerspective (UndoableOperation *pUndoOp=NULL)
virtual DocColourEnumerateColourFields (UINT32 Context)
 See base class.
virtual AttributeValueGetAttributeValue ()=0
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 ANGLE GetSecondaryAngle ()
FillRampGetFillRamp ()
 Return the fill ramp associated with this fill geometry. Currently this ramp can be either a colour ramp or a transparency ramp. Other ramps might well be added at a later time.
DocColourGetFirstSelectedColour ()
 Get the colour associated with the first selected endpoint. This function tends to be used with GetSelectionCount once you've worked out there's only one end point selected. At least I use it mostly that way.
UINT32GetFirstSelectedTransp ()
 Get the transparency associated with the first selected endpoint. This function tends to be used with GetSelectionCount once you've worked out there's only one end point selected. At least I use it mostly that way.
INT32 GetFirstSelectedIndex ()
 Find the index of the first selected endpoint. If nothing is selected -1 will be returned otherwise a number 0..n-1.
DocRect GetBoundingRect ()
void SetBoundingRect (DocRect &NewBounds)
 Set the Attributes bounding rectangle, which is used for current attributes and scaling when applying to new ink nodes. This rect is only used for 'Current' Attributes which don't have any parent bounds. It allows us to scale current attributes when they are applied.
BOOL WriteBoundingRect (BaseCamelotFilter *pFilter)
 Write the Attributes bounding rectangle.
virtual BOOL OnClick (DocCoord, ClickType, ClickModifiers, Spread *)
 Allows the fill to respond to clicks by selecting its blobs or starting drags etc.
virtual void GetControlPoints (DocCoord *, INT32)
 Get the positions of fill control points.
virtual void OnControlDrag (DocCoord, FillControl &, ClickModifiers)
virtual void SetAspectRatio (double Ratio)
UINT32 GetSelectionState (BOOL **)
 Get the current Selection state of the Fill Control Points.
BOOL IsSelected (UINT32 Control)
 Set the Selection state of the Fill Control Points. Determines if a Fill Control Point is selected or not.
UINT32 GetSelectionCount ()
 Get the number of Selected Fill Control Points.
UINT32 GetBlobCount (BOOL IncludeRamps=TRUE)
 Return the number of editable points in this fill geometry.
virtual void SetBlobState (FillControl, BOOL)
 Sets the selection state of a particular Control Point.
virtual void ToggleSelection (FillControl)
 Toggle the selection of a Fill Control Point.
virtual void SelectBlob (FillControl)
 Selects a Fill Control Point.
virtual void DeselectBlob (FillControl)
 Deselects a particular Fill Control Point.
virtual void DeselectAll ()
 Deselects all of the Fill Control Points for this fill.
virtual void DeselectAllBut (FillControl)
 Deselects all but one of the Fill Control Points.
virtual void DeselectAllNoRedraw ()
 Deselects all of the Fill Control Points for this fill, without redawing anything.
virtual void CycleSelection (BOOL Reverse)
 Cycles the selection state of the controls.
virtual BOOL IsVisible ()
virtual BOOL NeedsTransparency () const
 Called.
virtual FillControl CheckForControlHit (DocCoord &)
 Check to see if a click was on a Fill Control Point.
virtual AttrFillGeometryMutate (AttrFillGeometry *, BOOL bOptimise=TRUE)
 Changes a fill in some way.
virtual AttrFillGeometryChangeAttrValue (AttrValueChange *)
virtual void AttributeChanged ()
 Called by someone who has changed something about us that it thinks we should know about. It used by the Attribute manager to make a current attribute validate itself after it has been added to a new object. This functions just calls 'ValidateAttributeValue'.
virtual BOOL Blend (BlendAttrParam *pBlendParam)
virtual AttrFillGeometryDoColourDrop (AttrColourDrop *)
 Changes the colour of a fill.
virtual FillControl TestColourDrop (AttrColourDrop *)
 Check to see which colour will be changed if dropped at this point.
virtual BOOL ChangeControlColour (AttrColourChange *)
 Applies a colour to selected Fill Control Points.
virtual BOOL ChangeControlTransp (AttrTranspChange *)
 Applies a colour to selected Fill Control Points.
virtual BOOL ChangeControlColour (DocColour &, FillControl, AttrColourDrop *pColDrop=NULL)
 Applies a colour to a specific Fill Control Point.
virtual BOOL EditColourFillRamp (AttrColFillRampChange *)
 Applies a ramp change to this fill. See the class AttrColFillRampChange for all the documentation on this.
virtual BOOL EditTranspFillRamp (AttrTranspFillRampChange *)
 Applies a ramp change to this fill. See the class AttrTranspFillRampChange for all the documentation on this.
virtual BOOL IsAFillAttr () const
virtual void TransformSelectedControlPoints (TransformBase &, BOOL *isARampBlob=NULL)
 Transform a grad fill attribute by moving the selected control points.
virtual void TransformSelectedFillRampControlPoints (TransformBase &, ClickModifiers ClickMods, BOOL *isARampBlob)
 Transform a grad fill attributes fill ramp by moving the selected control points.
virtual void TransformToNewBounds (DocRect &NewBounds)
 Moves and scales the attribute's bounds to fit NewBounds. This function is used when applying an attribute which has been stored (eg. as a Current attribute) to a new object.
virtual BOOL NeedsForceToSimpleMapping ()
virtual BOOL IsARadialColourFill () const
virtual BOOL CopyComponentData (BaseDocument *SrcDoc, BaseDocument *NodesDoc)
 If the attribute contains any DocColours which are indexed then a copy of the indexed colour is made and added to the NodesDoc ColourListComponent.
virtual BOOL WriteColourDefinitions (BaseCamelotFilter *pFilter)
virtual void PolyCopyNodeContents (NodeRenderable *pNodeCopy)
 Polymorphically copies the contents of this node to another.
virtual BOOL IsTypeExtendible () const
virtual DocRect ValidateExtend (const ExtendParams &ExtParams)
 Determine whether applying an extend to this Node is a reversible process.
virtual void Extend (const ExtendParams &ExtParams)
 Perform an extend operation on this fill node.
virtual DocCoord FindExtendCentre ()
virtual void TransformTranslateObject (const ExtendParams &ExtParams)
 Do an extend (as opposed to stretch) operation on this fill, using ExtParams as the source of the extend data, together with the extend-centre of this path, defined in NodeRenderable::FindExtendCentre() and overridden here also.
virtual INT32 GetNumberOfControlPoints ()

Static Public Member Functions

static BOOL Init ()
 Intialise the fill geometry editing operations.
static AttrFillGeometryFindFirstSelectedAttr (CCRuntimeClass *AttrType=(CCRuntimeClass *) CC_RUNTIME_CLASS(AttrFillGeometry))
 Scans the selection for fill attributes.
static AttrFillGeometryFindNextSelectedAttr (CCRuntimeClass *AttrType=(CCRuntimeClass *) CC_RUNTIME_CLASS(AttrFillGeometry))
 Scans the selection for fill attributes.
static UINT32 CountSelectionControlPoints ()
 Get the number of Selected Fill Control Points within the selected objects.
static BOOL CheckAttrClick (DocCoord PointerPos, ClickType Click, ClickModifiers ClickMods, Spread *pSpread)
 Check to see if an Attribute wants to do something with a click.
static BOOL CheckForFillControlHit (DocCoord Pos, UINT32 *Status)
 Check to see if the mouse moves over a fill control point.
static FillControl DoColourDropTest (AttrColourDrop *, NodeRenderableInk **, AttrFillGeometry **FillAttr=NULL)
static BOOL IsTranspMeshVisible ()
static BOOL IsColourMeshVisible ()
static UINT32 FillSelectionCount ()
static void SetSelectionCount (UINT32)
static void SetTranspMeshesVisible (BOOL)

Public Attributes

BOOL AllowRampRedraw
BOOL AllowBoundsRedraw

Static Public Attributes

static AttrFillGeometryEditedFill = NULL
static AttrFillGeometryDraggedFill = NULL
static List HitList
static BOOL DoFillMeshCheck = TRUE
static FillGeometryAttributeLastRenderedMesh = NULL
static DocCoord LastRenderedStartBlob = DocCoord(0,0)
static DocCoord LastRenderedEndBlob = DocCoord(0,0)
static DocCoord LastRenderedEnd2Blob = DocCoord(0,0)
static DocCoord LastRenderedEnd3Blob = DocCoord(0,0)
static UINT32 SelectionCount = 0
static INT32 FractalSeed = 63933
static double FractalGraininess = 5
static double FractalGravity = 0
static INT32 FractalDPI = 96
static INT32 MaxFractalSize = 256
static BOOL TranspMeshesVisible = FALSE
static BOOL DoCheckOnFillRampMesh = TRUE
static BOOL s_bGroupTransparency = TRUE

Protected Member Functions

virtual void ValidateAttributeValue ()
virtual BOOL CopyNodeContents (AttrFillGeometry *NodeCopy)
 This method copies the node's contents to the node pointed to by NodeCopy.
virtual void RenderControl (FillControl, BOOL)
 Redraws the Fill Control blobs when the selection changes.
void RenderFillControl (BOOL RenderOn, DocRect *ControlRect, Spread *pSpread, NodeRenderable *pParent)
void RenderControlIntoPendingRegions (DocRect *ControlRect, Spread *pSpread, NodeRenderable *pParent)
AttrFillGeometryChangeColour (AttrValueChange *)
 Changes a fill in some way.
AttrFillGeometryChangeTransp (AttrValueChange *)
 Changes a fill in some way.
BOOL CheckPreviousFillMesh ()
 BODGE to stop fill meshes eoring each other out. This can be disabled by setting 'DoFillMeshCheck' to '0' in the 'ini' file.
BOOL IsFillBeingEdited ()
 Check to see if a fill is being edited, so we can decide whether to render the fill mesh or not.
void SetLastRenderedBlob (FillControl)
BOOL IsBlobSame (FillControl)
void ChangeBlobState (FillControl, INT32)
 Sets the state of a fill blob.
virtual double FindRampPoint (DocCoord &dc, DocCoord &StartPoint, DocCoord &EndPoint)
 Called.

Static Protected Member Functions

static BOOL IsMeshSame (FillGeometryAttribute *, FillGeometryAttribute *)

Protected Attributes

BOOL SelectionState [5]
DocRect AttrBounds

Static Protected Attributes

static FillControl ControlHit
static AttrFillGeometryFillHit
static SelectedAttrs s_SelAttrs
static CCAttrMap AttribMap

Detailed Description

Fill Geometry Attribute class.

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

Definition at line 206 of file fillattr.h.


Constructor & Destructor Documentation

AttrFillGeometry::AttrFillGeometry  ) 
 

Default constructor for a Fill Attribute. Sets default Selection State and Attribute Bounds.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/07/94

Definition at line 1216 of file fillattr.cpp.

01217 {
01218     // Make all the control points deselected
01219     SelectionState[FILLCONTROL_STARTPOINT] = FALSE;
01220     SelectionState[FILLCONTROL_ENDPOINT] = FALSE;
01221     SelectionState[FILLCONTROL_ENDPOINT2] = FALSE;
01222     SelectionState[FILLCONTROL_ENDPOINT3] = FALSE;
01223     SelectionState[FILLCONTROL_SECONDARYPOINT] = FALSE;
01224 
01225     // Make the attribute bounds empty.
01226     // Attribute bounds are only used for 'Current Attributes' that do not have
01227     // a parent, so they can be scaled when applied to a new object.
01228     AttrBounds = DocRect(0,0,0,0);
01229 
01230     AllowRampRedraw = TRUE;
01231     AllowBoundsRedraw = TRUE;
01232 }

AttrFillGeometry::~AttrFillGeometry  ) 
 

Destroys a Fill. Currently this function does nothing.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/07/94

Definition at line 1245 of file fillattr.cpp.

01246 {
01247     LastRenderedMesh = NULL;        // this ptr may be pointing to us!
01248 }

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

Definition at line 213 of file fillattr.h.

00218                                      : 
00219         NodeAttribute(ContextNode, Direction, Locked, Mangled, Marked, Selected) {}


Member Function Documentation

BOOL AttrFillGeometry::AttachBitmap KernelBitmap NewBitmap  )  [virtual]
 

Definition at line 22803 of file fillattr.cpp.

22803 { return ATTRVALUE()->AttachBitmap(NewBitmap); }

void AttrFillGeometry::AttributeChanged  )  [virtual]
 

Called by someone who has changed something about us that it thinks we should know about. It used by the Attribute manager to make a current attribute validate itself after it has been added to a new object. This functions just calls 'ValidateAttributeValue'.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/07/94
See also:
AttrFillGeometry::ValidateAttributeValue

Definition at line 3129 of file fillattr.cpp.

03130 {
03131     ValidateAttributeValue();
03132 }

BOOL AttrFillGeometry::Blend BlendAttrParam pBlendParam  )  [virtual]
 

Blending Bits

Reimplemented from NodeAttribute.

Definition at line 19810 of file fillattr.cpp.

19811 {
19812     // Check entry param isn't NULL
19813     ERROR3IF(pBlendParam == NULL,"NULL entry param");
19814     if (pBlendParam == NULL) return FALSE;
19815 
19816     // Get the Value member to blend to the Value member of the other NodeAttribute.
19817     // If it succeeds, ask the blended Value to make a NodeAttribute out of itself.
19818 
19819     if (GetAttributeValue()->Blend(pBlendParam))
19820     {
19821         // Get the blended attr val. After this call, the ptr is our reponsibility
19822         // so we have to delete it if it's no longer needed
19823         AttributeValue* pBlendedAttrVal = pBlendParam->GetBlendedAttrVal();
19824 
19825         if (pBlendedAttrVal != NULL)
19826         {
19827             // We have a blended attr val, so ask it to make a NodeAttribute out of itself
19828             // and set the pBlendParam's blended NodeAttribute ptr to it
19829             NodeAttribute* pBlendedAttr = pBlendedAttrVal->MakeNode();
19830             pBlendParam->SetBlendedAttr(pBlendedAttr);
19831 
19832             if (pBlendedAttr != NULL)
19833             {
19834                 // We were able to make a blended NodeAttribute
19835                 // so delete the blended attr val, and return TRUE
19836                 delete pBlendedAttrVal;
19837                 return TRUE;
19838             }
19839             else
19840             {
19841                 // Couldn't make a blended NodeAttribute, so give the blended attr val back
19842                 // and return FALSE
19843                 pBlendParam->SetBlendedAttrVal(pBlendedAttrVal);
19844                 return FALSE;
19845             }
19846         }
19847     }
19848 
19849     return FALSE;
19850 }

virtual AttrFillGeometry* AttrFillGeometry::ChangeAttrValue AttrValueChange  )  [inline, virtual]
 

Reimplemented in AttrFlatColourFill, AttrFlatTranspFill, AttrLinearColourFill, AttrLinearTranspFill, AttrRadialColourFill, AttrRadialTranspFill, AttrConicalColourFill, AttrConicalTranspFill, AttrSquareColourFill, AttrSquareTranspFill, AttrThreeColColourFill, AttrThreeColTranspFill, AttrFourColColourFill, AttrFourColTranspFill, AttrBitmapColourFill, AttrBitmapTranspFill, AttrTextureColourFill, AttrTextureTranspFill, AttrStrokeColour, and AttrStrokeTransp.

Definition at line 375 of file fillattr.h.

00375 { return NULL; }

void AttrFillGeometry::ChangeBlobState FillControl  HitControl,
INT32  state
[protected]
 

Sets the state of a fill blob.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/07/94
Parameters:
HitControl,the FillControl that is to be selected. [INPUTS] state = 0 = deselect blob 1 = select blob 2 = toggle blob selection

Definition at line 2102 of file fillattr.cpp.

02103 {
02104 #if !defined(EXCLUDE_FROM_RALPH)
02105 
02106     // check for a ramp index first - Added by Mike 10/3/97
02107     if (ISA_RAMPINDEX(HitControl))
02108     {
02109         FillRamp *pRamp = GetFillRamp();
02110         if (pRamp)
02111         {
02112             RenderControl(HitControl,FALSE);
02113             pRamp->SetSelState(HitControl,state);
02114             RenderControl(HitControl,state);    
02115             // TODO: NEED TO DO SOMETHING ABOUT - SetLastRenderedBlob(HitControl);
02116             //SetLastRenderedBlob(HitControl);
02117         }
02118         return;
02119     }
02120 
02121     // Can't Select DragPoints
02122     if (HitControl >= FILLCONTROL_DRAGPOINT)
02123         return;
02124 
02125     // Secondary Point selection state is a mirror of End Point selection
02126     if (HitControl == FILLCONTROL_SECONDARYPOINT)
02127         HitControl = FILLCONTROL_ENDPOINT;
02128 
02129     // Save the current state of the blob
02130     BOOL oldstate = SelectionState[HitControl];
02131     BOOL newstate = oldstate;
02132 
02133     // now alter to the new state
02134     switch (state)
02135     {
02136         case BLOBSTATE_OFF: 
02137             newstate = FALSE; 
02138         break;
02139         case BLOBSTATE_ON: 
02140             newstate = TRUE;    
02141         break;
02142         case BLOBSTATE_TOGGLE: 
02143             newstate = !oldstate;
02144         break;
02145     }
02146 
02147     // has the state changed?
02148     if (oldstate != newstate)
02149     {
02150         // Undraw the old blob
02151         RenderControl(HitControl, FALSE);
02152         SelectionState[HitControl] = newstate;
02153         // Redraw the new blob
02154         RenderControl(HitControl, TRUE);
02155         SetLastRenderedBlob(HitControl);
02156     }
02157 #endif
02158 }

AttrFillGeometry * AttrFillGeometry::ChangeColour AttrValueChange Mutator  )  [protected]
 

Changes a fill in some way.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/94
Parameters:
Mutator,The AttrFillGeometry Mutator that will change this fill in some way. [INPUTS]
Returns:
A pointer to a new AttrFillGeometry, that is a Mutated version of this Fill.
See also:
AttributeManager::AttributeSelected

Definition at line 3312 of file fillattr.cpp.

03313 {
03314     AttrFillGeometry* NewFill = NULL;
03315 
03316 #if !defined(EXCLUDE_FROM_RALPH)
03317     // Make a copy of this Fill and change the copys' control point colours
03318     NewFill = (AttrFillGeometry*)this->SimpleCopy();
03319     if (NewFill == NULL)
03320         return NULL;
03321 
03322     if (Mutator->MutateFill(NewFill))
03323         return NewFill;
03324 
03325     BOOL Changed = NewFill->ChangeControlColour( (AttrColourChange*)Mutator );
03326 
03327     // Did we change any colours ?
03328     if (!Changed)
03329     {
03330         // Only make it a flat fill if there aren't any other fill controls
03331         // selected anywhere else
03332         if (IsVisible() && SelectionCount > 0)
03333             return NewFill;
03334 
03335         // No Control points selected, so make a flat fill instead
03336         delete NewFill;
03337         NewFill = new AttrFlatColourFill;
03338         if (NewFill == NULL)
03339             return NULL;
03340 
03341         // and use the mutants colour
03342         *(FillGeometryAttribute*)(NewFill->GetAttributeValue()) = *(FillGeometryAttribute*)(Mutator->GetAttributeValue());
03343 
03344         if (GetApplication()->GetBlobManager()->GetCurrentInterest().Fill && IsVisible())
03345             RenderFillBlobs();
03346     }
03347 #endif
03348 
03349     // Return the Mutated Fill
03350     return NewFill;
03351 }

BOOL AttrFillGeometry::ChangeControlColour DocColour Col,
FillControl  Cntrl,
AttrColourDrop pColDrop = NULL
[virtual]
 

Applies a colour to a specific Fill Control Point.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/2/95

Reimplemented in AttrLinearFill, and AttrBitmapColourFill.

Definition at line 5142 of file fillattr.cpp.

05144 {
05145 // DMc for drag n drops onto fill ramp control points
05146     if (ISA_RAMPINDEX(Cntrl))
05147     {
05148         // we have a drag and drop onto a ramp control point
05149         if (GetColourRamp())
05150         {
05151             ColourRamp * pRamp = GetColourRamp();
05152 
05153             return pRamp->SetItemColour(Cntrl, &Col);
05154         }
05155 
05156         // treat as a normal ramp point
05157         Cntrl = FILLCONTROL_RAMPPOINT;
05158     }
05159 
05160     switch (Cntrl)
05161     {
05162         case FILLCONTROL_STARTPOINT:
05163             SetStartColour(&Col);
05164             break;
05165 
05166         case FILLCONTROL_ENDPOINT:
05167             SetEndColour(&Col);
05168             break;
05169 
05170         case FILLCONTROL_SECONDARYPOINT:
05171             SetEndColour(&Col);
05172             break;
05173 
05174         case FILLCONTROL_ENDPOINT2:
05175             SetEndColour2(&Col);
05176             break;
05177 
05178         case FILLCONTROL_ENDPOINT3:
05179             SetEndColour3(&Col);
05180             break;
05181         case FILLCONTROL_RAMPPOINT:
05182             if (pColDrop)
05183             {
05184                 CProfileBiasGain DefaultBiasGain;
05185 
05186                 if (!(GetProfile () == DefaultBiasGain))
05187                 {
05188                     // Load and build the question text.
05189                     String_256 QueryString(_R(IDS_ASKMULTIREPLACEPROFILE));
05190                     
05191                     // The only way of bringing up a box with a string in it
05192                     Error::SetError(0, QueryString, 0);
05193                     INT32 DlgResult = InformMessage(0, _R(IDS_YES), _R(IDS_NO));
05194                     Error::ClearError();
05195 
05196                     switch (DlgResult)
05197                     {
05198                         case 1:     // YES
05199                             SetProfile (DefaultBiasGain);       // we MUST revert to
05200                                                                 // the default profile
05201                         break;
05202                         case 2:     // NO
05203                         return (FALSE);         // break out of this stuff!
05204                     }
05205                 }
05206 
05207                 DocCoord DropPoint = pColDrop->GetDropPoint();
05208 
05209                 double dRampPoint = FindRampPoint(DropPoint, *GetStartPoint(),
05210                     *GetEndPoint());
05211 
05212                 // make a new colour ramp (if necessary)
05213                 if (GetColourRamp() == NULL)
05214                 {
05215                     FillGeometryAttribute *pAttrValue = ATTRVALUE();
05216                     if (pAttrValue->SupportsFillRamps())
05217                     {
05218                         if (pAttrValue->IS_KIND_OF(GradFillAttribute))
05219                         {
05220                             ColourRamp * pRamp = ((GradFillAttribute*)pAttrValue)->MakeNewColourRamp();
05221                             pRamp->AddEntry((float)dRampPoint, &Col);
05222                             pRamp->Dump();
05223                         }
05224                     }
05225                 }
05226                 else
05227                 {
05228                     // find out if the drag hit a ramp point
05229                     FillRamp * pRamp = GetColourRamp();
05230 
05231                     ColRampItem * pItem = (ColRampItem *)pRamp->GetHead();
05232 
05233                     while (pItem)
05234                     {
05235                         if (pItem->GetPosition() == dRampPoint)
05236                         {
05237                             // set the colour for the entry
05238                             pItem->SetColour(&Col);
05239                             break;
05240                         }
05241 
05242                         pItem = (ColRampItem *)pRamp->GetNext(pItem);
05243                     }
05244 
05245                     // it hasn't hit a ramp point so add an entry
05246                     if (!pItem)
05247                     {
05248                         GetColourRamp()->AddEntry((float)dRampPoint, &Col);
05249                         GetColourRamp()->Dump();
05250                     }
05251                 }
05252             }
05253             break;      
05254         default:
05255             SetStartColour(&Col);
05256             break;
05257     }
05258 
05259     return TRUE;}

BOOL AttrFillGeometry::ChangeControlColour AttrColourChange ColourAttr  )  [virtual]
 

Applies a colour to selected Fill Control Points.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/9/94
Parameters:
NewColour,the colour that selected control points should change to. [INPUTS]
Returns:
TRUE if a control point was selected, and the colour applied.
See also:
AttrFillGeometry::Mutate

Reimplemented in AttrFlatFill, AttrBitmapFill, AttrBitmapColourFill, and AttrTextureColourFill.

Definition at line 3423 of file fillattr.cpp.

03424 {
03425 #if !defined(EXCLUDE_FROM_RALPH)
03426     if (!GetApplication()->GetBlobManager()->GetCurrentInterest().Fill || !IsVisible())
03427         return FALSE;
03428 
03429     BOOL ColChanged = FALSE;
03430 
03431     DocColour NewColour = *ColourAttr->GetStartColour();
03432 
03433     // Is the Start Point Selected ?
03434     if (SelectionState[FILLCONTROL_STARTPOINT] /*&& GetStartColour() != NULL*/)
03435     {
03436         // Set the Start Colour
03437         SetStartColour(&NewColour);
03438         ColChanged = TRUE;
03439     }
03440 
03441     // Is the End Point Selected ?
03442     if (SelectionState[FILLCONTROL_ENDPOINT] /*&& GetEndColour() != NULL*/)
03443     {
03444         // Set the End Colour
03445         SetEndColour(&NewColour);
03446         ColChanged = TRUE;
03447     }
03448 
03449     // Is the End Point Selected ?
03450     if (SelectionState[FILLCONTROL_ENDPOINT2] /*&& GetEndColour2() != NULL*/)
03451     {
03452         // Set the End Colour
03453         SetEndColour2(&NewColour);
03454         ColChanged = TRUE;
03455     }
03456 
03457     // Is End Point 3 Selected ?
03458     if (SelectionState[FILLCONTROL_ENDPOINT3] /*&& GetEndColour3() != NULL*/)
03459     {
03460         // Set the Colour
03461         SetEndColour3(&NewColour);
03462         ColChanged = TRUE;
03463     }
03464 
03465     // set any selected colours in the colour ramp?
03466     ColourRamp *pRamp = GetColourRamp();
03467     if (pRamp)
03468     {
03469         // we have a ramp here so set its colours
03470         if (pRamp->SetSelectedColours(&NewColour)>0)
03471             ColChanged=TRUE;
03472     }
03473 
03474     // Tell the caller whether we changed anything or not
03475     return (ColChanged);
03476 #else
03477     return FALSE;
03478 #endif
03479 }

BOOL AttrFillGeometry::ChangeControlTransp AttrTranspChange TranspAttr  )  [virtual]
 

Applies a colour to selected Fill Control Points.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/9/94
Parameters:
NewColour,the colour that selected control points should change to. [INPUTS]
Returns:
TRUE if a control point was selected, and the colour applied.
See also:
AttrFillGeometry::Mutate

Reimplemented in AttrFlatFill, AttrBitmapFill, AttrBitmapTranspFill, and AttrTextureTranspFill.

Definition at line 3494 of file fillattr.cpp.

03495 {
03496 #if !defined(EXCLUDE_FROM_RALPH)
03497     if (!GetApplication()->GetBlobManager()->GetCurrentInterest().Fill || !IsVisible())
03498         return FALSE;
03499 
03500     if (GetStartTransp() == NULL)
03501         return FALSE;
03502 
03503     BOOL TranspChanged = FALSE;
03504 
03505     // Get the required new transparency
03506     UINT32 NewTransp = *TranspAttr->GetStartTransp();
03507 
03508     // Is the Start Point Selected ?
03509     if (SelectionState[FILLCONTROL_STARTPOINT])
03510     {
03511         // Set the Start Transp
03512         SetStartTransp(&NewTransp);
03513         TranspChanged = TRUE;
03514     }
03515 
03516     // Is the End Point Selected ?
03517     if (SelectionState[FILLCONTROL_ENDPOINT])
03518     {
03519         // Set the End Transp
03520         SetEndTransp(&NewTransp);
03521         TranspChanged = TRUE;
03522     }
03523 
03524     // Is the End Point Selected ?
03525     if (SelectionState[FILLCONTROL_ENDPOINT2])
03526     {
03527         // Set the End Transp
03528         SetEndTransp2(&NewTransp);
03529         TranspChanged = TRUE;
03530     }
03531 
03532     // Is the End Point Selected ?
03533     if (SelectionState[FILLCONTROL_ENDPOINT3])
03534     {
03535         // Set the End Transp
03536         SetEndTransp3(&NewTransp);
03537         TranspChanged = TRUE;
03538     }
03539 
03540     // set any selected colours in the colour ramp?
03541     TransparencyRamp *pRamp = GetTranspRamp();
03542     if (pRamp)
03543     {
03544         // we have a ramp here so set its colours
03545         if (pRamp->SetSelectedTransp(NewTransp)>0)
03546             TranspChanged=TRUE;
03547     }
03548 
03549     // Tell the caller whether we changed anything or not
03550     return TranspChanged;
03551 #else
03552     return FALSE;
03553 #endif
03554 }

AttrFillGeometry * AttrFillGeometry::ChangeTransp AttrValueChange Mutator  )  [protected]
 

Changes a fill in some way.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/8/94
Parameters:
Mutator,The AttrFillGeometry Mutator that will change this fill in some way. [INPUTS]
Returns:
A pointer to a new AttrFillGeometry, that is a Mutated version of this Fill.
See also:
AttributeManager::AttributeSelected

Definition at line