ChangeBrushAction Class Reference

An action which changes one of the members of a brush attribute. More...

#include <opdrbrsh.h>

Inheritance diagram for ChangeBrushAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ChangeBrushAction ()
 Constructor for the action.
 ~ChangeBrushAction ()
 destructor for the action
virtual ActionCode Execute ()
 Executes the action. This will reset the brush variables to their old values.
BOOL ChangeSelectionNoUndo (ChangeBrushOpParam *pParam)
 In order to avoid generating undo information for each single slider movement in the brush edit dialog I am introducing this system where we only generate an undoable action on a slider_pos_set message. For slider moving messages we call this method, which will any brushes in the selection but not generate any undo information.

Static Public Member Functions

static ActionCode Init (Operation *pOp, ActionList *pActionList, NodeRenderableInk *pBrushedNode, ChangeBrushOpParam *pChangeParam, ChangeBrushAction **NewAction)
 This is the function which creates an instance of this action. If there is no room in the undo buffer (which is determined by the base class Init function called within) the function will either return AC_NO_RECORD which means the operation can continue, but no undo information needs to be stored, or AC_OK which means the operation should continue AND record undo information. If the function returns AC_FAIL, there was not enough memory to record the undo information, and the user has decided not to continue with the operation.

Protected Member Functions

BOOL ChangeLineWidthChildNoUndo (double PropChange, NodeRenderableInk *pInk)
 To change the line width of the child attribute if this ink node. Note that we only change child attributes because we don't want to mess up any other inknodes.

Static Protected Member Functions

static AttrBrushTypeGetAttrBrush (NodeRenderableInk *pInk)
 Returns the brush attribute that applies to this node. However there is a little trickery needed to cope with the likes of shadow nodes etc. as the brushed node will be a sibling of that node.
static BOOL ChangeBrush (ChangeBrushOpParam *pOpParam, AttrBrushType *pAttrBrush)
 Changes pBrush according to the data provided in pParam.
static BOOL ChangeBrushSpacing (MILLIPOINT NewSpacing, PressureArray *pArray, AttrBrushType *pAttrBrush)
 To set the brush spacing of this attribute node.
static BOOL ChangeSpacingIncrProp (double NewIncr, PressureArray *pArray, AttrBrushType *pAttrBrush)
 To set the brush spacing of this attribute node.
static BOOL ChangeSpacingIncrConst (MILLIPOINT NewIncr, PressureArray *pArray, AttrBrushType *pAttrBrush)
 To set the brush spacing of this attribute node.
static BOOL ChangeBrushScaling (double NewScaling, AttrBrushType *pAttrBrush)
 To set the brush scaling of this attribute node.
static BOOL ChangeScalingRandSeed (UINT32 NewSeed, AttrBrushType *pAttrBrush)
 Sets a new seed for the scaling RNG.
static BOOL ChangeScalingIncr (double NewIncr, AttrBrushType *pAttrBrush)
 To set the brush scaling of this attribute node.
static BOOL ChangeScalingIncrConst (double NewIncr, AttrBrushType *pAttrBrush)
 To set the brush scaling increment.
static BOOL ChangeScalingMaxRand (UINT32 NewMax, AttrBrushType *pAttrBrush)
 To set the amount of brush scaling determined by randomness.
static BOOL ChangeScalingPressure (UINT32 Pressure, AttrBrushType *pAttrBrush)
 To set the amount of brush scaling determined by randomness.
static BOOL ChangeTangential (BOOL bRotate, AttrBrushType *pAttrBrush)
static BOOL ChangeRotation (double NewAngle, AttrBrushType *pAttrBrush)
static BOOL ChangeRotationIncrProp (double Incr, AttrBrushType *pAttrBrush)
static BOOL ChangeRotationIncrConst (double Incr, AttrBrushType *pAttrBrush)
static BOOL ChangeRotationRandSeed (UINT32 NewSeed, AttrBrushType *pAttrBrush)
static BOOL ChangeRotationMaxRand (UINT32 NewMax, AttrBrushType *pAttrBrush)
static BOOL ChangeRotationMaxPressure (UINT32 Pressure, AttrBrushType *pAttrBrush)
static BOOL ChangeOffsetValue (MILLIPOINT NewOffset, AttrBrushType *pAttrBrush)
 To set the offset value of this attribute node.
static BOOL ChangeOffsetType (PathOffset NewOffset, AttrBrushType *pAttrBrush)
 To set the offset value of this attribute node.
static BOOL ChangeOffsetTypeSeed (UINT32 NewSeed, AttrBrushType *pAttrBrush)
 Sets the seed for the offset type RNG.
static BOOL ChangeOffsetIncrProp (double NewIncrProp, AttrBrushType *pAttrBrush)
 To set the offset value of this attribute node.
static BOOL ChangeOffsetIncrConst (MILLIPOINT NewIncrConst, AttrBrushType *pAttrBrush)
 To set the offset value of this attribute node.
static BOOL ChangeOffsetValMaxRand (UINT32 NewMax, AttrBrushType *pAttrBrush)
 To set how much the offset is determined randomly.
static BOOL ChangeOffsetValRandSeed (UINT32 NewSeed, AttrBrushType *pAttrBrush)
 To set the seed for the offset value RNG.
static BOOL ChangeOffsetSeeds (UINT32 NewTypeSeed, UINT32 NewOffsetSeed, AttrBrushType *pAttrBrush)
 This sets both the offset random seeds, this enables us to change both seeds with only one button on the infobar.
static BOOL ChangeBrushTile (BOOL bTile, AttrBrushType *pAttrBrush)
static BOOL ChangeSpacingMaxRand (UINT32 NewMaxRand, AttrBrushType *pAttrBrush)
 To set the maximum random value for spacing for this attribute node.
static BOOL ChangeSpacingRandSeed (UINT32 NewSeed, AttrBrushType *pAttrBrush)
 To set the random seed for spacing for this attribute node.
static BOOL ChangeUseLocalFillColour (BOOL bUseLocal, AttrBrushType *pAttrBrush)
 Sets the flag telling this attribute whether to use local attributes.
static BOOL ChangeUseLocalTransp (BOOL bUseLocal, AttrBrushType *pAttrBrush)
 Sets the flag telling this attribute whether to use local attributes.
static BOOL ChangeUseNamedColour (BOOL bUse, AttrBrushType *pAttr)
 Sets the flag telling this attribute whether to use local attributes.
static BOOL ChangeSequenceType (SequenceType SeqType, AttrBrushType *pAttrBrush)
 Sets the flag telling this attribute what type of object sequence to use.
static BOOL ChangeSequenceSeed (UINT32 NewSeed, AttrBrushType *pAttrBrush)
 Seeds the sequence random number generator.
static BOOL ChangeAll (ChangeBrushOpParam *pParam, AttrBrushType *pAttrBrush)
 Sets all the variables in the opparam.
static BOOL ChangeHueIncrement (double NewIncr, AttrBrushType *pAttrBrush)
static BOOL ChangeHueMaxRand (UINT32 Rand, AttrBrushType *pAttrBrush)
 as above
static BOOL ChangeFillSeeds (UINT32 HueSeed, UINT32 SatSeed, AttrBrushType *AttrBrush)
 Seeds the sequence random number generator.
static BOOL ChangeSatMaxRand (UINT32 Rand, AttrBrushType *pAttrBrush)
 sa above
static BOOL ChangeSatRandSeed (UINT32 Seed, AttrBrushType *pAttrBrush)
 Seeds the sequence random number generator.
static BOOL ChangeTransparency (INT32 Transp, AttrBrushType *pAttrBrush)
 sets the replacement transparency value
static BOOL ChangeTranspPressure (UINT32 Press, AttrBrushType *pAttrBrush)
 sets the extent to which pressure affects brush transparency

Protected Attributes

NodeRenderableInkm_pBrushedNode
ChangeBrushOpParam m_ChangeParam

Detailed Description

An action which changes one of the members of a brush attribute.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/11/94
See also:
-

Definition at line 507 of file opdrbrsh.h.


Constructor & Destructor Documentation

ChangeBrushAction::ChangeBrushAction  ) 
 

Constructor for the action.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 2810 of file opdrbrsh.cpp.

02811 {
02812     m_pBrushedNode  = NULL;
02813 }

ChangeBrushAction::~ChangeBrushAction  ) 
 

destructor for the action

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 2832 of file opdrbrsh.cpp.

02833 {
02834 }


Member Function Documentation

BOOL ChangeBrushAction::ChangeAll ChangeBrushOpParam pParam,
AttrBrushType pAttrBrush
[static, protected]
 

Sets all the variables in the opparam.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
pParam - the opparam containing the data to change in our brush [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 4471 of file opdrbrsh.cpp.

04472 {
04473     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL in ChangeBrushAction::ChangeAll");
04474     ERROR2IF(pParam == NULL, FALSE, "OpParam is NULL in ChangeBrushAction::ChangeAll");
04475     // get the path processor
04476     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
04477     if (pPPB == NULL)
04478         return FALSE;
04479     
04480     BOOL ok = pPPB->SetBrushScaling(pParam->m_NewScaling);
04481     if (ok) ok = pPPB->SetBrushScalingIncr(pParam->m_NewScalingIncr);
04482     if (ok) ok = pPPB->SetBrushScalingIncrConst(pParam->m_NewScalingIncrConst);
04483     if (ok) ok = pPPB->SetScalingMaxRand(pParam->m_NewScalingMaxRand);
04484     if (ok) ok = pPPB->SetScalingRandSeed(pParam->m_NewScalingRandSeed);
04485     if (ok) ok = pPPB->SetSpacing(pParam->m_NewSpacing);
04486     if (ok) ok = pPPB->SetSpacingIncrConst(pParam->m_NewSpacingIncrConst);
04487     if (ok) ok = pPPB->SetSpacingIncrProp(pParam->m_NewSpacingIncrProp);
04488     if (ok) ok = pPPB->SetSpacingMaxRand(pParam->m_NewSpacingMaxRand);
04489     if (ok) ok = pPPB->SetSpacingRandSeed(pParam->m_NewSpacingRandSeed);
04490     if (ok) ok = pPPB->SetHueMaxRand(pParam->m_NewHueMaxRand);
04491     if (ok) ok = pPPB->SetHueRandSeed(pParam->m_NewHueRandSeed);
04492     if (ok) ok = pPPB->SetSatMaxRand(pParam->m_NewSatMaxRand);
04493     if (ok) ok = pPPB->SetSatRandSeed(pParam->m_NewSatRandSeed);
04494     pPPB->SetPathOffsetType(pParam->m_NewPathOffsetType);
04495     pPPB->SetPathOffsetValue(pParam->m_NewPathOffsetVal);
04496     if (ok) ok = pPPB->SetOffsetTypeRandSeed(pParam->m_NewOffsetTypeRandSeed);
04497     if (ok) ok = pPPB->SetOffsetValueMaxRand(pParam->m_NewOffsetValMaxRand);
04498     if (ok) ok = pPPB->SetOffsetValueRandSeed(pParam->m_NewOffsetValRandSeed);
04499     pPPB->SetRotated(pParam->m_bNewTiled);
04500     if (ok) ok = pPPB->SetRotationAngle(pParam->m_NewRotateAngle);
04501     pPPB->SetSequenceType(pParam->m_NewSequenceType);
04502     pPPB->SetSequenceSeed(pParam->m_NewSequenceRandSeed);
04503     pPPB->SetTiling(pParam->m_bNewTiled);
04504     pPPB->SetUseLocalFillColour(pParam->m_bNewUseLocalFillColour);
04505     pPPB->SetRotationIncrConst(pParam->m_NewRotationIncrConst);
04506     pPPB->SetRotationIncrProp(pParam->m_NewRotationIncrProp);
04507     pPPB->SetRotationMaxPressure(pParam->m_NewRotationMaxPressure);
04508 
04509     return ok;
04510 }

BOOL ChangeBrushAction::ChangeBrush ChangeBrushOpParam pChangeParam,
AttrBrushType pAttrBrush
[static, protected]
 

Changes pBrush according to the data provided in pParam.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/10/2000
Parameters:
pParam - object containing the data about what to change [INPUTS] pBrush - the brush attribute to be changed
- [OUTPUTS]
Returns:
TRUE if successful, ,FALSE otherwise

Errors: -

See also:
Action::Init()

Definition at line 3018 of file opdrbrsh.cpp.

03019 {
03020     ERROR2IF(pChangeParam == NULL || pAttrBrush == NULL, FALSE, "Invalid inputs to ChangeBrushAction::ChangeBrush");
03021 
03022     ChangeBrushType ChangeType = pChangeParam->ChangeType;
03023     
03024     BOOL Retval = FALSE;
03025 
03026     switch (ChangeType)
03027     {
03028         case CHANGEBRUSH_SPACING:           
03029             Retval = ChangeBrushSpacing(pChangeParam->m_NewSpacing, 
03030                                     pChangeParam->m_pPressure,  pAttrBrush);
03031             
03032             break;
03033         case CHANGEBRUSH_SPACING_INCRPROP:
03034             Retval = ChangeSpacingIncrProp(pChangeParam->m_NewSpacingIncrProp, pChangeParam->m_pPressure, pAttrBrush);
03035             break;
03036         case CHANGEBRUSH_SPACING_INCRCONST:
03037             Retval = ChangeSpacingIncrConst(pChangeParam->m_NewSpacingIncrConst, pChangeParam->m_pPressure, pAttrBrush);
03038             break;
03039         case CHANGEBRUSH_SCALING_INCR:
03040             Retval = ChangeScalingIncr(pChangeParam->m_NewScalingIncr, pAttrBrush);
03041             break;
03042         case  CHANGEBRUSH_SCALING_INCRCONST:
03043             Retval = ChangeScalingIncrConst(pChangeParam->m_NewScalingIncrConst, pAttrBrush);
03044             break;
03045         case CHANGEBRUSH_SCALING:
03046             Retval = ChangeBrushScaling(pChangeParam->m_NewScaling, pAttrBrush);
03047             break;
03048         case CHANGEBRUSH_SCALING_MAXRAND:
03049             Retval = ChangeScalingMaxRand(pChangeParam->m_NewScalingMaxRand, pAttrBrush);
03050             break;
03051         case CHANGEBRUSH_SCALING_RANDSEED:
03052             Retval = ChangeScalingRandSeed(pChangeParam->m_NewScalingRandSeed, pAttrBrush);
03053             break;
03054         case CHANGEBRUSH_SCALING_PRESSURE:
03055             Retval = ChangeScalingPressure(pChangeParam->m_NewScalingMaxPressure, pAttrBrush);
03056             break;
03057         case CHANGEBRUSH_TILED:
03058             Retval = ChangeBrushTile(pChangeParam->m_bNewTiled, pAttrBrush);
03059             break;
03060         case CHANGEBRUSH_TANGENTIAL:
03061             Retval = ChangeTangential(pChangeParam->m_bNewRotated, pAttrBrush);
03062             break;
03063         case CHANGEBRUSH_OFFSET_TYPE:
03064             Retval = ChangeOffsetType(pChangeParam->m_NewPathOffsetType, pAttrBrush);
03065             break;
03066         case CHANGEBRUSH_OFFSET_TYPE_SEED:
03067             Retval = ChangeOffsetTypeSeed(pChangeParam->m_NewOffsetTypeRandSeed, pAttrBrush);
03068             break;
03069         case CHANGEBRUSH_OFFSET_SEEDS:
03070             Retval = ChangeOffsetSeeds(pChangeParam->m_NewOffsetTypeRandSeed, pChangeParam->m_NewOffsetValRandSeed,
03071                                     pAttrBrush);
03072             break;
03073         case CHANGEBRUSH_OFFSET_VAL:
03074             Retval = ChangeOffsetValue(pChangeParam->m_NewPathOffsetVal, pAttrBrush);
03075             break;
03076         case CHANGEBRUSH_OFFSET_INCRPROP:
03077             Retval = ChangeOffsetIncrProp(pChangeParam->m_NewOffsetIncrProp, pAttrBrush);
03078             break;
03079         case CHANGEBRUSH_OFFSET_INCRCONST:
03080             Retval = ChangeOffsetIncrConst(pChangeParam->m_NewOffsetIncrConst, pAttrBrush);
03081             break;
03082         case CHANGEBRUSH_OFFSET_MAXRAND:
03083             Retval = ChangeOffsetValMaxRand(pChangeParam->m_NewOffsetValMaxRand, pAttrBrush);
03084             break;
03085         case CHANGEBRUSH_OFFSET_VALSEED:
03086             Retval = ChangeOffsetValRandSeed(pChangeParam->m_NewOffsetValRandSeed, pAttrBrush);
03087             break;
03088         case CHANGEBRUSH_ROTATE_ANGLE:
03089             Retval = ChangeRotation(pChangeParam->m_NewRotateAngle, pAttrBrush);
03090             break;
03091         case CHANGEBRUSH_ROTATE_INCRPROP:
03092             Retval = ChangeRotationIncrProp(pChangeParam->m_NewRotationIncrProp, pAttrBrush);
03093             break;
03094         case CHANGEBRUSH_ROTATE_INCRCONST:
03095             Retval = ChangeRotationIncrConst(pChangeParam->m_NewRotationIncrConst, pAttrBrush);
03096             break;
03097         case CHANGEBRUSH_ROTATE_MAXRAND:
03098             Retval = ChangeRotationMaxRand(pChangeParam->m_NewRotateMaxRand, pAttrBrush);
03099             break;
03100         case CHANGEBRUSH_ROTATE_RANDSEED:
03101             Retval = ChangeRotationRandSeed(pChangeParam->m_NewRotateRandSeed, pAttrBrush);
03102             break;
03103         case CHANGEBRUSH_ROTATE_PRESSURE:
03104             Retval = ChangeRotationMaxPressure(pChangeParam->m_NewRotationMaxPressure, pAttrBrush);
03105             break;
03106         case CHANGEBRUSH_SPACING_MAXRAND:
03107             Retval = ChangeSpacingMaxRand(pChangeParam->m_NewSpacingMaxRand, pAttrBrush);
03108             break;
03109         case CHANGEBRUSH_SPACING_RANDSEED:
03110             Retval = ChangeSpacingRandSeed(pChangeParam->m_NewSpacingRandSeed, pAttrBrush);
03111             break;
03112         case CHANGEBRUSH_USELOCALFILLCOL:
03113             Retval = ChangeUseLocalFillColour(pChangeParam->m_bNewUseLocalFillColour, pAttrBrush);
03114             break;
03115         case CHANGEBRUSH_USELOCALTRANSP:
03116             Retval = ChangeUseLocalTransp(pChangeParam->m_bNewUseLocalTransp, pAttrBrush);
03117             break;
03118         case CHANGEBRUSH_USENAMEDCOL:
03119             Retval = ChangeUseNamedColour(pChangeParam->m_bNewUseNamed, pAttrBrush);
03120             break;
03121         case CHANGEBRUSH_SEQUENCE:
03122             Retval = ChangeSequenceType(pChangeParam->m_NewSequenceType, pAttrBrush);
03123             break;
03124         case CHANGEBRUSH_SEQUENCE_RANDSEED:
03125             Retval = ChangeSequenceSeed(pChangeParam->m_NewSequenceRandSeed, pAttrBrush);
03126             break;
03127         case CHANGEBRUSH_ALL:
03128             Retval = ChangeAll(pChangeParam, pAttrBrush);
03129             break;
03130         case CHANGEBRUSH_TIMESTAMP:
03131             break;
03132         case CHANGEBRUSH_HUE_INCR:
03133             Retval = ChangeHueIncrement(pChangeParam->m_NewHueIncrement, pAttrBrush);
03134             break;
03135         case CHANGEBRUSH_HUE_MAXRAND:
03136             Retval = ChangeHueMaxRand(pChangeParam->m_NewHueMaxRand, pAttrBrush);
03137             break;
03138         case CHANGEBRUSH_FILL_SEEDS:
03139             Retval = ChangeFillSeeds(pChangeParam->m_NewHueRandSeed, pChangeParam->m_NewSatRandSeed,
03140                                 pAttrBrush);
03141             break;
03142         case CHANGEBRUSH_SAT_MAXRAND:
03143             Retval = ChangeSatMaxRand(pChangeParam->m_NewSatMaxRand, pAttrBrush);
03144             break;
03145         case CHANGEBRUSH_SAT_RANDSEED:
03146             Retval = ChangeSatRandSeed(pChangeParam->m_NewSatRandSeed, pAttrBrush);
03147             break;
03148         case CHANGEBRUSH_TRANSP:
03149             Retval = ChangeTransparency(pChangeParam->m_NewTransp, pAttrBrush);
03150             break;
03151         case CHANGEBRUSH_TRANSP_PRESSURE:
03152             Retval = ChangeTranspPressure(pChangeParam->m_NewTranspPressure, pAttrBrush);
03153             break;
03154 
03155         default : ERROR2(FALSE,"Unknown change brush type"); break;
03156         
03157     } // end switch
03158     return Retval;
03159 }

BOOL ChangeBrushAction::ChangeBrushScaling double  NewScaling,
AttrBrushType pAttrBrush
[static, protected]
 

To set the brush scaling of this attribute node.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
NewScaling - the value to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 3452 of file opdrbrsh.cpp.

03453 {
03454     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03455     
03456     // get the path processor
03457     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
03458     if (pPPB == NULL)
03459         return FALSE;   
03460 
03461     // In order to find out whether or not we need to tell the processor whether or not to
03462     // scale to line width we need to find the line width, get the scaling required to scale
03463     // to that value and compare it with the scaling that we want to do here.
03464     MILLIPOINT LineWidth = pAttrBrush->GetAppliedLineWidth();
03465     double Scaling = pPPB->GetScaleValue(LineWidth);
03466 
03467     if (Scaling != NewScaling)
03468         pPPB->SetScaleToLineWidth(FALSE);
03469     else
03470         pPPB->SetScaleToLineWidth(TRUE);
03471 
03472     // clear out our cached bounding rect as we are changing size
03473     pAttrBrush->ClearCachedRect();
03474 
03475 
03476     return pAttrBrush->SetScaling(NewScaling);
03477 }

BOOL ChangeBrushAction::ChangeBrushSpacing MILLIPOINT  NewSpacing,
PressureArray pArray,
AttrBrushType pAttrBrush
[static, protected]
 

To set the brush spacing of this attribute node.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
NewSpacing - the value to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 3370 of file opdrbrsh.cpp.

03372 {
03373     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03374 //  if (pArray != NULL)
03375 //      pAttrBrush->SetPressureCache(pArray);
03376     return pAttrBrush->SetSpacing(NewSpacing);
03377 }

BOOL ChangeBrushAction::ChangeBrushTile BOOL  bTile,
AttrBrushType pAttrBrush
[static, protected]
 

Definition at line 3804 of file opdrbrsh.cpp.

03805 {
03806     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03807     return pAttrBrush->SetTiled(bTile);
03808 }

BOOL ChangeBrushAction::ChangeFillSeeds UINT32  HueSeed,
UINT32  SatSeed,
AttrBrushType pAttrBrush
[static, protected]
 

Seeds the sequence random number generator.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
Seed - the seed for the hue RNG [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 4334 of file opdrbrsh.cpp.

04335 {
04336     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
04337     
04338     // get the path processor
04339     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
04340     if (pPPB == NULL)
04341         return FALSE;
04342 
04343     pPPB->SetHueRandSeed(HueSeed);
04344     pPPB->SetSatRandSeed(SatSeed);
04345     return TRUE;
04346 }

BOOL ChangeBrushAction::ChangeHueIncrement double  NewIncr,
AttrBrushType pAttrBrush
[static, protected]
 

Definition at line 4280 of file opdrbrsh.cpp.

04281 {
04282     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
04283     
04284     // get the path processor
04285     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
04286     if (pPPB == NULL)
04287         return FALSE;
04288 
04289     return pPPB->SetHueIncrement(NewIncr);
04290 }

BOOL ChangeBrushAction::ChangeHueMaxRand UINT32  Rand,
AttrBrushType pAttrBrush
[static, protected]
 

as above

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
Rand - the maximum random effect on hue [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 4307 of file opdrbrsh.cpp.

04308 {
04309     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
04310     
04311     // get the path processor
04312     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
04313     if (pPPB == NULL)
04314         return FALSE;
04315 
04316     return pPPB->SetHueMaxRand(Rand);
04317 }

BOOL ChangeBrushAction::ChangeLineWidthChildNoUndo double  ChangeProp,
NodeRenderableInk pInk
[protected]
 

To change the line width of the child attribute if this ink node. Note that we only change child attributes because we don't want to mess up any other inknodes.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
ChangeProp - the proportion to change the line width by [INPUTS] pInk - the ink node to search under
- [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 3309 of file opdrbrsh.cpp.

03310 {
03311     PORTNOTETRACE("other","ChangeBrushAction::ChangeLineWidthChildNoUndo - do nothing");
03312 #ifndef EXCLUDE_FROM_XARALX
03313     ERROR2IF(ChangeProp <= 0.0, FALSE, "Invalid change proportion in ChangeBrushAction::ChangeLineWidthChildNoUndo");
03314     ERROR2IF(pInk == NULL, FALSE, "Ink node is NULL in ChangeBrushAction::ChangeLineWidthChildNoUndo");
03315 
03316     // search for the line width attribute
03317     Node* pNode = pInk->FindFirstChild();
03318     AttrLineWidth* pLineWidth = NULL;
03319     
03320     while (pNode != NULL)
03321     {
03322         if (pNode->IsAnAttribute() && ((NodeAttribute*)pNode)->IsALineWidthAttr())
03323         {
03324             pLineWidth = (AttrLineWidth*)pNode;
03325             break;
03326         }
03327         pNode = pNode->FindNext();
03328     }
03329 
03330     if (pLineWidth == NULL)
03331         return FALSE;
03332 
03333     // get the old value, multiply by our proportion
03334     double OldWidth = (double)pLineWidth->Value.LineWidth;
03335     double NewWidth = OldWidth * ChangeProp;
03336     
03337     pLineWidth->Value.LineWidth = (MILLIPOINT)NewWidth;
03338 
03339     // change the line width gadgets by abusing an op descriptor
03340     OpChangeLineWidthOpDesc* pDesc = (OpChangeLineWidthOpDesc*)OpDescriptor::FindOpDescriptor(OPTOKEN_CHANGELINEWIDTH);
03341     if (pDesc)
03342     {
03343         String_256 StrWidth = TEXT("");
03344         Convert::DoubleToString(NewWidth*0.001, &StrWidth, 2);
03345         StrWidth += TEXT("pt");
03346         pDesc->SetLineWidthGadgets(StrWidth);
03347     }
03348 
03349     return TRUE;
03350 #else
03351     return FALSE;
03352 #endif
03353 }

BOOL ChangeBrushAction::ChangeOffsetIncrConst MILLIPOINT  NewIncrConst,
AttrBrushType pAttrBrush
[static, protected]
 

To set the offset value of this attribute node.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
NewIncrProp - the value to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 3906 of file opdrbrsh.cpp.

03907 {
03908     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03909     
03910     // clear out our cached bounding rect as we are changing size
03911     pAttrBrush->ClearCachedRect();
03912 
03913     // get the path processor
03914     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
03915     if (pPPB == NULL)
03916         return FALSE;   
03917 
03918     return pPPB->SetPathOffsetIncrConst(NewIncrConst);
03919 }

BOOL ChangeBrushAction::ChangeOffsetIncrProp double  NewIncrProp,
AttrBrushType pAttrBrush
[static, protected]
 

To set the offset value of this attribute node.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
NewIncrProp - the value to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 3875 of file opdrbrsh.cpp.

03876 {
03877     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03878     
03879     // clear out our cached bounding rect as we are changing size
03880     pAttrBrush->ClearCachedRect();
03881 
03882     // get the path processor
03883     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
03884     if (pPPB == NULL)
03885         return FALSE;   
03886 
03887     return pPPB->SetPathOffsetIncrProp(NewIncrProp);
03888 }

BOOL ChangeBrushAction::ChangeOffsetSeeds UINT32  NewTypeSeed,
UINT32  NewValSeed,
AttrBrushType pAttrBrush
[static, protected]
 

This sets both the offset random seeds, this enables us to change both seeds with only one button on the infobar.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
NewTypeSeed - the seed for the offset sequence [INPUTS] NewValSeed - the seed for the offset value
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 4054 of file opdrbrsh.cpp.

04055 {
04056     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
04057 
04058     // clear out our cached bounding rect as we are changing size
04059     pAttrBrush->ClearCachedRect();  
04060 
04061     // get the path processor
04062     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
04063     if (pPPB == NULL)
04064         return FALSE;
04065 
04066     pPPB->SetOffsetTypeRandSeed(NewTypeSeed);
04067     pPPB->SetOffsetValueRandSeed(NewValSeed);
04068 
04069     return TRUE;
04070 }

BOOL ChangeBrushAction::ChangeOffsetType PathOffset  NewOffset,
AttrBrushType pAttrBrush
[static, protected]
 

To set the offset value of this attribute node.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
NewOffset - the offset type to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 3996 of file opdrbrsh.cpp.

03997 {
03998     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03999         
04000     // clear out our cached bounding rect as we are changing size
04001     pAttrBrush->ClearCachedRect();
04002 
04003     return pAttrBrush->SetPathOffsetType(NewOffset);    
04004 }

BOOL ChangeBrushAction::ChangeOffsetTypeSeed UINT32  NewSeed,
AttrBrushType pAttrBrush
[static, protected]
 

Sets the seed for the offset type RNG.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
NewSeed - the offset type to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 4021 of file opdrbrsh.cpp.

04022 {
04023     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
04024 
04025     // clear out our cached bounding rect as we are changing size
04026     pAttrBrush->ClearCachedRect();
04027     // get the path processor
04028     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
04029     if (pPPB == NULL)
04030         return FALSE;   
04031 
04032     return pPPB->SetOffsetTypeRandSeed(NewSeed);
04033 }

BOOL ChangeBrushAction::ChangeOffsetValMaxRand UINT32  NewMax,
AttrBrushType pAttrBrush
[static, protected]
 

To set how much the offset is determined randomly.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
NewMax - the value to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 3937 of file opdrbrsh.cpp.

03938 {
03939     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03940     
03941     // clear out our cached bounding rect as we are changing size
03942     pAttrBrush->ClearCachedRect();
03943 
03944     // get the path processor
03945     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
03946     if (pPPB == NULL)
03947         return FALSE;   
03948 
03949     return pPPB->SetOffsetValueMaxRand(NewMax);
03950 }

BOOL ChangeBrushAction::ChangeOffsetValRandSeed UINT32  NewSeed,
AttrBrushType pAttrBrush
[static, protected]
 

To set the seed for the offset value RNG.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
NewSeed - the value to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 3967 of file opdrbrsh.cpp.

03968 {
03969     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03970     
03971     // clear out our cached bounding rect as we are changing size
03972     pAttrBrush->ClearCachedRect();
03973 
03974     // get the path processor
03975     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
03976     if (pPPB == NULL)
03977         return FALSE;   
03978 
03979     return pPPB->SetOffsetValueRandSeed(NewSeed);
03980 }

BOOL ChangeBrushAction::ChangeOffsetValue MILLIPOINT  NewOffset,
AttrBrushType pAttrBrush
[static, protected]
 

To set the offset value of this attribute node.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
NewOffset - the value to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 3850 of file opdrbrsh.cpp.

03851 {
03852     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03853     
03854     // clear out our cached bounding rect as we are changing size
03855     pAttrBrush->ClearCachedRect();
03856     
03857     return pAttrBrush->SetPathOffsetValue(NewOffset);
03858 }

BOOL ChangeBrushAction::ChangeRotation double  NewAngle,
AttrBrushType pAttrBrush
[static, protected]
 

Definition at line 3635 of file opdrbrsh.cpp.

03636 {
03637     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03638 
03639     // clear out our cached bounding rect as we are changing size
03640     pAttrBrush->ClearCachedRect();
03641 
03642     return pAttrBrush->SetRotateAngle(NewAngle);
03643 }

BOOL ChangeBrushAction::ChangeRotationIncrConst double  Incr,
AttrBrushType pAttrBrush
[static, protected]
 

Definition at line 3688 of file opdrbrsh.cpp.

03689 {
03690     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03691     
03692     // clear out our cached bounding rect as we are changing size
03693     pAttrBrush->ClearCachedRect();
03694 
03695     // get the path processor
03696     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
03697     if (pPPB == NULL)
03698         return FALSE;   
03699 
03700     return pPPB->SetRotationIncrConst(Incr);
03701 }

BOOL ChangeBrushAction::ChangeRotationIncrProp double  Incr,
AttrBrushType pAttrBrush
[static, protected]
 

Definition at line 3659 of file opdrbrsh.cpp.

03660 {
03661     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03662     
03663     // clear out our cached bounding rect as we are changing size
03664     pAttrBrush->ClearCachedRect();
03665 
03666     // get the path processor
03667     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
03668     if (pPPB == NULL)
03669         return FALSE;   
03670 
03671     return pPPB->SetRotationIncrProp(Incr);
03672 }

BOOL ChangeBrushAction::ChangeRotationMaxPressure UINT32  Pressure,
AttrBrushType pAttrBrush
[static, protected]
 

Definition at line 3777 of file opdrbrsh.cpp.

03778 {
03779     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03780     
03781     // clear out our cached bounding rect as we are changing size
03782     pAttrBrush->ClearCachedRect();
03783 
03784     // get the path processor
03785     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
03786     if (pPPB == NULL)
03787         return FALSE;   
03788 
03789     return pPPB->SetRotationMaxPressure(Pressure);
03790 }

BOOL ChangeBrushAction::ChangeRotationMaxRand UINT32  NewMax,
AttrBrushType pAttrBrush
[static, protected]
 

Definition at line 3717 of file opdrbrsh.cpp.

03718 {
03719     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03720     
03721     // clear out our cached bounding rect as we are changing size
03722     pAttrBrush->ClearCachedRect();
03723 
03724     // get the path processor
03725     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
03726     if (pPPB == NULL)
03727         return FALSE;   
03728 
03729     return pPPB->SetRotationMaxRand(NewMax);
03730 }

BOOL ChangeBrushAction::ChangeRotationRandSeed UINT32  NewSeed,
AttrBrushType pAttrBrush
[static, protected]
 

Definition at line 3746 of file opdrbrsh.cpp.

03747 {
03748     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03749     
03750     // clear out our cached bounding rect as we are changing size
03751     pAttrBrush->ClearCachedRect();
03752 
03753     // get the path processor
03754     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
03755     if (pPPB == NULL)
03756         return FALSE;   
03757 
03758     pPPB->SetRotationRandSeed(NewSeed);
03759 
03760     return TRUE;
03761 }

BOOL ChangeBrushAction::ChangeSatMaxRand UINT32  Rand,
AttrBrushType pAttrBrush
[static, protected]
 

sa above

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
Rand - the maximum random effect on Saturation [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 4363 of file opdrbrsh.cpp.

04364 {
04365     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
04366     
04367     // get the path processor
04368     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
04369     if (pPPB == NULL)
04370         return FALSE;
04371 
04372     return pPPB->SetSatMaxRand(Rand);
04373 }

BOOL ChangeBrushAction::ChangeSatRandSeed UINT32  Seed,
AttrBrushType pAttrBrush
[static, protected]
 

Seeds the sequence random number generator.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
Seed - the seed for the Saturation RNG [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 4390 of file opdrbrsh.cpp.

04391 {
04392     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
04393     
04394     // get the path processor
04395     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
04396     if (pPPB == NULL)
04397         return FALSE;
04398 
04399     return pPPB->SetSatRandSeed(Seed);
04400 }

BOOL ChangeBrushAction::ChangeScalingIncr double  NewIncr,
AttrBrushType pAttrBrush
[static, protected]
 

To set the brush scaling of this attribute node.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
NewScaling - the value to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 3494 of file opdrbrsh.cpp.

03495 {
03496     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03497 
03498     // clear out our cached bounding rect as we are changing size
03499     pAttrBrush->ClearCachedRect();
03500 
03501 
03502     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
03503     if (pPPB == NULL)
03504         return FALSE;   
03505 
03506     return pPPB->SetBrushScalingIncr(NewIncr);
03507 }

BOOL ChangeBrushAction::ChangeScalingIncrConst double  Incr,
AttrBrushType pAttrBrush
[static, protected]
 

To set the brush scaling increment.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
Incr - the increment to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 3524 of file opdrbrsh.cpp.

03525 {
03526     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03527 
03528     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
03529     if (pPPB == NULL)
03530         return FALSE;   
03531 
03532     return pPPB->SetBrushScalingIncrConst(Incr);
03533 }

BOOL ChangeBrushAction::ChangeScalingMaxRand UINT32  NewMax,
AttrBrushType pAttrBrush
[static, protected]
 

To set the amount of brush scaling determined by randomness.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
NewMax - the value to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 3549 of file opdrbrsh.cpp.

03550 {
03551     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03552 
03553     // clear out our cached bounding rect as we are changing size
03554     pAttrBrush->ClearCachedRect();
03555 
03556 
03557     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
03558     if (pPPB == NULL)
03559         return FALSE;   
03560 
03561     return pPPB->SetScalingMaxRand(NewMax);
03562 }

BOOL ChangeBrushAction::ChangeScalingPressure UINT32  Pressure,
AttrBrushType pAttrBrush
[static, protected]
 

To set the amount of brush scaling determined by randomness.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
NewMax - the value to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 3579 of file opdrbrsh.cpp.

03580 {
03581     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03582 
03583     // clear out our cached bounding rect as we are changing size
03584     pAttrBrush->ClearCachedRect();
03585 
03586 
03587     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
03588     if (pPPB == NULL)
03589         return FALSE;   
03590     
03591     return pPPB->SetScalingMaxPressure(Pressure);
03592 }

BOOL ChangeBrushAction::ChangeScalingRandSeed UINT32  NewSeed,
AttrBrushType pAttrBrush
[static, protected]
 

Sets a new seed for the scaling RNG.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
NewSeed - the value to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 3607 of file opdrbrsh.cpp.

03608 {
03609     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03610 
03611     // clear out our cached bounding rect as we are changing size
03612     pAttrBrush->ClearCachedRect();
03613 
03614 
03615     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
03616     if (pPPB == NULL)
03617         return FALSE;   
03618 
03619     return pPPB->SetScalingRandSeed(NewSeed);
03620 }

BOOL ChangeBrushAction::ChangeSelectionNoUndo ChangeBrushOpParam pParam  ) 
 

In order to avoid generating undo information for each single slider movement in the brush edit dialog I am introducing this system where we only generate an undoable action on a slider_pos_set message. For slider moving messages we call this method, which will any brushes in the selection but not generate any undo information.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/10/2000
Parameters:
pParam - object containing the data about what to change [INPUTS]
- [OUTPUTS]
Returns:
TRUE if successful, ,FALSE otherwise
This is potentially a bit naughty as it means we bypass the AllowOp mechanism but its been given to me as a showstopper...

Returns:
Errors: -
See also:
Action::ChangeBrush()

Definition at line 3185 of file opdrbrsh.cpp.

03186 {
03187     PORTNOTETRACE("other","ChangeBrushAction::ChangeSelectionNoUndo - do nothing");
03188 #ifndef EXCLUDE_FROM_XARALX
03189     ERROR2IF(pParam == NULL, FALSE, "Invalid inputs to ChangeBrushAction::ChangeSelectionNoUndo");
03190 
03191     // find all the brushes in the current selection
03192     List NodeList;
03193     BevelTools::BuildListOfSelectedNodes(&NodeList, CC_RUNTIME_CLASS(NodeRenderableInk));
03194 
03195     BOOL ok = !NodeList.IsEmpty();
03196 
03197     NodeListItem * pItem = NULL;
03198     
03199     Spread* pSpread = Document::GetSelectedSpread();
03200     if (pSpread == NULL)
03201     {
03202         ERROR3("Wheres the spread!?");
03203         return FALSE;
03204     }
03205     DocView* pDocView = DocView::GetCurrent();
03206     if (pDocView == NULL)
03207     {
03208         ERROR3("No DocView!");
03209         return FALSE;
03210     }
03211     
03212     if (ok)
03213     {
03214         
03215         pItem = (NodeListItem *)NodeList.GetHead();
03216 
03217         Node* pSelNode = NULL;
03218 
03219         if (pItem)
03220         {
03221             pSelNode = pItem->pNode;
03222         }
03223         
03224         AttrBrushType* pAttrBrush = NULL;
03225         
03226         while (pSelNode != NULL && ok)
03227         {
03228             Node* pNode = pSelNode;
03229 
03230             pItem = (NodeListItem *)NodeList.GetNext(pItem);
03231 
03232             if (pItem)
03233             {
03234                 pSelNode = pItem->pNode;
03235             }
03236             else
03237             {
03238                 pSelNode = NULL;
03239             }
03240             
03241             pAttrBrush = GetAttrBrush((NodeRenderableInk*)pNode);
03242     
03243             if (pAttrBrush != NULL && pAttrBrush->GetBrushHandle() != BrushHandle_NoBrush)          
03244             {
03245                 // invalidate it before
03246                 DocRect PreActRect = ((NodeRenderableBounded*)pNode)->GetBoundingRect();
03247                 if (pNode->IsAnObject()) ((NodeRenderableInk*)pNode)->ReleaseCached();
03248                 if (ok) 
03249                     pDocView->ForceRedraw(pSpread, PreActRect);
03250 
03251                 // make sure we recalculate the rect
03252                 ((NodeRenderableBounded*)pNode)->InvalidateBoundingRect();
03253 
03254                     
03255                 INT32 OldSize = pAttrBrush->GetDefaultLineWidth();
03256 
03257                 // change the brush in an non-undoable way
03258                 if (ok) ok = ChangeBrush(pParam, pAttrBrush);
03259                 
03260 
03261                 // have we changed the size of the brush?  If so then we will have applied a new line width
03262                 // in the action, so factor out
03263                 INT32 NewSize = pAttrBrush->GetDefaultLineWidth();
03264                 
03265                 if (NewSize != OldSize && ok)
03266                 {
03267                     double SizeChange = (double)NewSize / (double)OldSize;
03268                     ok = ChangeLineWidthChildNoUndo(SizeChange, (NodeRenderableInk*)pNode);
03269                 }
03270                 
03271             
03272                 DocRect PostActRect = ((NodeRenderableBounded*)pNode)->GetBoundingRect();
03273             
03274                 if (pNode->IsAnObject()) ((NodeRenderableInk*)pNode)->ReleaseCached();
03275                 
03276                 // invalidate it after
03277                 if (ok)
03278                     pDocView->ForceRedraw(pSpread, PostActRect);
03279                 
03280             }
03281             
03282         }
03283     }
03284     NodeList.DeleteAll();
03285     
03286     return ok;
03287 #else
03288     return FALSE;
03289 #endif
03290 }

BOOL ChangeBrushAction::ChangeSequenceSeed UINT32  NewSeed,
AttrBrushType pAttrBrush
[static, protected]
 

Seeds the sequence random number generator.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
NewSeed - the seed to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 4253 of file opdrbrsh.cpp.

04254 {
04255     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
04256     
04257     // get the path processor
04258     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
04259     if (pPPB == NULL)
04260         return FALSE;
04261 
04262     pPPB->SetSequenceSeed(NewSeed);
04263     return TRUE;
04264 }

BOOL ChangeBrushAction::ChangeSequenceType SequenceType  NewSeq,
AttrBrushType pAttrBrush
[static, protected]
 

Sets the flag telling this attribute what type of object sequence to use.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
NewSeq - the sequence type to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 4224 of file opdrbrsh.cpp.

04225 {
04226     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
04227     
04228     // get the path processor
04229     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
04230     if (pPPB == NULL)
04231         return FALSE;
04232 
04233     pPPB->SetSequenceType(NewSeq);
04234     return TRUE;
04235 }

BOOL ChangeBrushAction::ChangeSpacingIncrConst MILLIPOINT  NewIncr,
PressureArray pArray,
AttrBrushType pAttrBrush
[static, protected]
 

To set the brush spacing of this attribute node.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
NewSpacing - the value to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 3423 of file opdrbrsh.cpp.

03424 {
03425     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03426     //if (pArray != NULL)
03427     //  pAttrBrush->SetPressureCache(pArray);
03428 
03429         // get the path processor
03430     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
03431     if (pPPB == NULL)
03432         return FALSE;
03433 
03434     return pPPB->SetSpacingIncrConst(NewIncr);
03435 }

BOOL ChangeBrushAction::ChangeSpacingIncrProp double  NewIncr,
PressureArray pArray,
AttrBrushType pAttrBrush
[static, protected]
 

To set the brush spacing of this attribute node.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
NewSpacing - the value to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 3394 of file opdrbrsh.cpp.

03395 {
03396     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03397 //  if (pArray != NULL)
03398     //  pAttrBrush->SetPressureCache(pArray);
03399 
03400         // get the path processor
03401     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
03402     if (pPPB == NULL)
03403         return FALSE;
03404 
03405     return pPPB->SetSpacingIncrProp(NewIncr);
03406 }

BOOL ChangeBrushAction::ChangeSpacingMaxRand UINT32  NewMaxRand,
AttrBrushType pAttrBrush
[static, protected]
 

To set the maximum random value for spacing for this attribute node.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
MaxRand - the new maximum random number [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 4086 of file opdrbrsh.cpp.

04087 {
04088     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
04089     
04090     // can't be bothered to write any more natty access fn's in the attribute
04091     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
04092     if (pPPB == NULL)
04093         return FALSE;
04094     return pPPB->SetSpacingMaxRand(NewMaxRand);
04095 }

BOOL ChangeBrushAction::ChangeSpacingRandSeed UINT32  NewSeed,
AttrBrushType pAttrBrush
[static, protected]
 

To set the random seed for spacing for this attribute node.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
RandSeed - seed to use for random spacing [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 4112 of file opdrbrsh.cpp.

04113 {
04114     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
04115     
04116     TRACEUSER( "Diccon", _T("Setting Random Seed\n"));
04117 
04118     // get the path processor
04119     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
04120     if (pPPB == NULL)
04121         return FALSE;
04122 
04123     // ok now that the sequence tab is on the same page they have to share a button
04124     pPPB->SetSequenceSeed(NewSeed);
04125     return pPPB->SetSpacingRandSeed(NewSeed);
04126 }

BOOL ChangeBrushAction::ChangeTangential BOOL  bRotate,
AttrBrushType pAttrBrush
[static, protected]
 

Definition at line 3824 of file opdrbrsh.cpp.

03825 {
03826     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
03827 
03828     // clear out our cached bounding rect as we are changing size
03829     pAttrBrush->ClearCachedRect();
03830 
03831     
03832     return pAttrBrush->SetRotated(bRotate);
03833 }

BOOL ChangeBrushAction::ChangeTransparency INT32  Transp,
AttrBrushType pAttrBrush
[static, protected]
 

sets the replacement transparency value

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
Transp - the value to set (-1 means don't replace transparency) [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 4417 of file opdrbrsh.cpp.

04418 {
04419     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
04420     
04421     // get the path processor
04422     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
04423     if (pPPB == NULL)
04424         return FALSE;
04425 
04426     return pPPB->SetBrushTransparency(Transp);
04427 }

BOOL ChangeBrushAction::ChangeTranspPressure UINT32  Press,
AttrBrushType pAttrBrush
[static, protected]
 

sets the extent to which pressure affects brush transparency

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
Press - the extent to which pressure affects brush transparency [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 4444 of file opdrbrsh.cpp.

04445 {
04446     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
04447     
04448     // get the path processor
04449     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
04450     if (pPPB == NULL)
04451         return FALSE;
04452 
04453     return pPPB->SetTransparencyPressure(Press);
04454 }

BOOL ChangeBrushAction::ChangeUseLocalFillColour BOOL  bUseLocal,
AttrBrushType pAttrBrush
[static, protected]
 

Sets the flag telling this attribute whether to use local attributes.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
UseLocal - the flag to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 4143 of file opdrbrsh.cpp.

04144 {
04145     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
04146     
04147     // get the path processor
04148     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
04149     if (pPPB == NULL)
04150         return FALSE;
04151     pPPB->SetUseLocalFillColour(bUseLocal);
04152     return TRUE;
04153 }

BOOL ChangeBrushAction::ChangeUseLocalTransp BOOL  UseLocal,
AttrBrushType pAttrBrush
[static, protected]
 

Sets the flag telling this attribute whether to use local attributes.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
UseLocal - the flag to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 4170 of file opdrbrsh.cpp.

04171 {
04172     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
04173     
04174     // get the path processor
04175     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
04176     if (pPPB == NULL)
04177         return FALSE;
04178     pPPB->SetUseLocalTransp(UseLocal);
04179     return TRUE;
04180 }

BOOL ChangeBrushAction::ChangeUseNamedColour BOOL  UseNamed,
AttrBrushType pAttrBrush
[static, protected]
 

Sets the flag telling this attribute whether to use local attributes.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
UseLocal - the flag to set [INPUTS]
pAttrBrush - the brush attribute to change [OUTPUTS]
Returns:
TRUE if successful, FALSE otherwise
See also:
-

Definition at line 4197 of file opdrbrsh.cpp.

04198 {
04199     ERROR2IF(pAttrBrush == NULL, FALSE, "brush attribute is NULL");
04200     
04201     // get the path processor
04202     PathProcessorBrush* pPPB = pAttrBrush->GetPathProcessor();
04203     if (pPPB == NULL)
04204         return FALSE;
04205     pPPB->SetUseNamedColours(UseNamed);
04206 
04207     return TRUE;
04208 }

ActionCode ChangeBrushAction::Execute  )  [virtual]
 

Executes the action. This will reset the brush variables to their old values.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL

Errors: -

See also:
Action::Init()

Reimplemented from Action.

Definition at line 2938 of file opdrbrsh.cpp.

02939 {
02940     m_ChangeParam.SwapOldAndNew();
02941 
02942     ActionCode Act;
02943     ChangeBrushAction* pAction;
02944     TRACEUSER( "Diccon", _T("Undoing Change Brush Action\n"));
02945     Act = ChangeBrushAction::Init(pOperation,pOppositeActLst,m_pBrushedNode,&m_ChangeParam,&pAction);
02946 
02947     return Act;
02948 }

AttrBrushType * ChangeBrushAction::GetAttrBrush NodeRenderableInk pInk  )  [static, protected]
 

Returns the brush attribute that applies to this node. However there is a little trickery needed to cope with the likes of shadow nodes etc. as the brushed node will be a sibling of that node.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
pInk - the ink node that has the applied brush [INPUTS]
- [OUTPUTS]
Returns:
the applied brush attribute

Errors: -

See also:
Action::Init()

Definition at line 2969 of file opdrbrsh.cpp.

02970 {
02971     NodeAttribute* pAttr = NULL;
02972     
02973     if (pInk->IS_KIND_OF(NodeShadow) || pInk->IS_KIND_OF(NodeBevel) || pInk->IS_KIND_OF(NodeContour))
02974     {
02975         // cycle through the siblings and see if one has an AttrBrushType as a child
02976         BOOL Found = FALSE;
02977         Node* pSibling = pInk->FindNext();
02978         while (pSibling != NULL && Found == FALSE)
02979         {
02980             Node* pChild = pSibling->FindFirstChild();
02981             while (pChild != NULL && !Found)
02982             {
02983                 if (pChild->IS_KIND_OF(AttrBrushType))
02984                 {
02985                     pAttr = (NodeAttribute*)pChild;
02986                     Found = TRUE;
02987                     break;
02988                 }
02989                 pChild = pChild->FindNext();
02990             }
02991             pSibling = pSibling->FindNext();
02992         }
02993     }
02994     else
02995         pInk->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrBrushType), &pAttr);
02996 
02997     return (AttrBrushType*)pAttr;
02998 }

ActionCode ChangeBrushAction::Init Operation pOp,
ActionList pActionList,
NodeRenderableInk pBrushedNode,
ChangeBrushOpParam pChangeParam,
ChangeBrushAction **  ppNewAction
[static]
 

This is the function which creates an instance of this action. If there is no room in the undo buffer (which is determined by the base class Init function called within) the function will either return AC_NO_RECORD which means the operation can continue, but no undo information needs to be stored, or AC_OK which means the operation should continue AND record undo information. If the function returns AC_FAIL, there was not enough memory to record the undo information, and the user has decided not to continue with the operation.

Author:
Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/99
Parameters:
pOp = ptr to the operation to which this action belongs [INPUTS] pActionList = ptr to action list to which this action should be added pBrushedNode = ptr to node with brush attribute to change pChangeParam = ptr to class that details how the blend should be changed.
ppNewAction = ptr to a ptr to an action, allowing the function to return [OUTPUTS] a pointer to the created action
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL
This function actually changes the blend node in a way specified in pChangeParam
Returns:
Errors: -
See also:
Action::Init()

Definition at line 2869 of file opdrbrsh.cpp.

02874 {
02875     ERROR2IF(pBrushedNode == NULL,AC_FAIL,"pNodeBrush is NULL");
02876     ERROR2IF(pChangeParam == NULL,AC_FAIL,"pChangeParam is NULL");
02877 
02878     // just check that we do actually have a brush attribute
02879     
02880 /*  NodeAttribute* pAttr = NULL;
02881     pBrushedNode->FindAppliedAttribute(CC_RUNTIME_CLASS(AttrBrushType), &pAttr);
02882     ERROR2IF(pAttr == NULL, AC_FAIL, "No applied brush attribute");*/
02883 
02884     AttrBrushType* pAttrBrush = GetAttrBrush(pBrushedNode);
02885     if (pAttrBrush == NULL)
02886     {
02887         ERROR3("AttrBrushType is NULL in ChangeBrushAction::Init");
02888         return AC_FAIL;
02889     }
02890     if (pAttrBrush->GetBrushHandle() == BrushHandle_NoBrush)
02891     {
02892     //  ERROR3("Brush handle = BrushHandle_NoBrush in ChangeBrushAction::Init");
02893         return AC_OK;
02894     }
02895 
02896     // make the new action
02897     UINT32 ActSize = sizeof(ChangeBrushAction);
02898     ChangeBrushAction* pNewAction;
02899     ActionCode Ac = Action::Init(pOp,pActionList,ActSize,CC_RUNTIME_CLASS(ChangeBrushAction),(Action**)&pNewAction);
02900     *ppNewAction = pNewAction;
02901 
02902     if (Ac != AC_FAIL && pNewAction != NULL)
02903     {
02904         ChangeBrushType ChangeType = pChangeParam->ChangeType;
02905 
02906         // set data in the new action
02907         pNewAction->m_pBrushedNode           = pBrushedNode;
02908         pNewAction->m_ChangeParam.ChangeType = ChangeType;
02909         pNewAction->m_ChangeParam.SetOldValues(pAttrBrush);
02910         
02911         if (!ChangeBrush(pChangeParam, pAttrBrush))
02912             Ac = AC_FAIL;
02913 
02914         pBrushedNode->InvalidateBoundingRect();
02915         pNewAction->m_ChangeParam.SetNewValues(pAttrBrush);
02916     } // end if (AC != ..
02917 
02918     return Ac;
02919 }


Member Data Documentation

ChangeBrushOpParam ChangeBrushAction::m_ChangeParam [protected]
 

Definition at line 573 of file opdrbrsh.h.

NodeRenderableInk* ChangeBrushAction::m_pBrushedNode [protected]
 

Definition at line 572 of file opdrbrsh.h.


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