opdrbrsh.h

Go to the documentation of this file.
00001 // $Id: opdrbrsh.h 1273 2006-06-08 19:41:59Z alex $
00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00003 ================================XARAHEADERSTART===========================
00004  
00005                Xara LX, a vector drawing and manipulation program.
00006                     Copyright (C) 1993-2006 Xara Group Ltd.
00007        Copyright on certain contributions may be held in joint with their
00008               respective authors. See AUTHORS file for details.
00009 
00010 LICENSE TO USE AND MODIFY SOFTWARE
00011 ----------------------------------
00012 
00013 This file is part of Xara LX.
00014 
00015 Xara LX is free software; you can redistribute it and/or modify it
00016 under the terms of the GNU General Public License version 2 as published
00017 by the Free Software Foundation.
00018 
00019 Xara LX and its component source files are distributed in the hope
00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00022 See the GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License along
00025 with Xara LX (see the file GPL in the root directory of the
00026 distribution); if not, write to the Free Software Foundation, Inc., 51
00027 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00028 
00029 
00030 ADDITIONAL RIGHTS
00031 -----------------
00032 
00033 Conditional upon your continuing compliance with the GNU General Public
00034 License described above, Xara Group Ltd grants to you certain additional
00035 rights. 
00036 
00037 The additional rights are to use, modify, and distribute the software
00038 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00039 library and any other such library that any version of Xara LX relased
00040 by Xara Group Ltd requires in order to compile and execute, including
00041 the static linking of that library to XaraLX. In the case of the
00042 "CDraw" library, you may satisfy obligation under the GNU General Public
00043 License to provide source code by providing a binary copy of the library
00044 concerned and a copy of the license accompanying it.
00045 
00046 Nothing in this section restricts any of the rights you have under
00047 the GNU General Public License.
00048 
00049 
00050 SCOPE OF LICENSE
00051 ----------------
00052 
00053 This license applies to this program (XaraLX) and its constituent source
00054 files only, and does not necessarily apply to other Xara products which may
00055 in part share the same code base, and are subject to their own licensing
00056 terms.
00057 
00058 This license does not apply to files in the wxXtra directory, which
00059 are built into a separate library, and are subject to the wxWindows
00060 license contained within that directory in the file "WXXTRA-LICENSE".
00061 
00062 This license does not apply to the binary libraries (if any) within
00063 the "libs" directory, which are subject to a separate license contained
00064 within that directory in the file "LIBS-LICENSE".
00065 
00066 
00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00068 ----------------------------------------------
00069 
00070 Subject to the terms of the GNU Public License (see above), you are
00071 free to do whatever you like with your modifications. However, you may
00072 (at your option) wish contribute them to Xara's source tree. You can
00073 find details of how to do this at:
00074   http://www.xaraxtreme.org/developers/
00075 
00076 Prior to contributing your modifications, you will need to complete our
00077 contributor agreement. This can be found at:
00078   http://www.xaraxtreme.org/developers/contribute/
00079 
00080 Please note that Xara will not accept modifications which modify any of
00081 the text between the start and end of this header (marked
00082 XARAHEADERSTART and XARAHEADEREND).
00083 
00084 
00085 MARKS
00086 -----
00087 
00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00089 designs are registered or unregistered trademarks, design-marks, and/or
00090 service marks of Xara Group Ltd. All rights in these marks are reserved.
00091 
00092 
00093       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00094                         http://www.xara.com/
00095 
00096 =================================XARAHEADEREND============================
00097  */
00098 
00099 // class OpDrawBrush
00100 
00101 #ifndef INC_OPDRBR
00102 #define INC_OPDRBR
00103 
00104 #include "opfree.h"
00105 #include "brshcomp.h"
00106 #include "brpress.h"
00107 
00108 class AttrBrushType;
00109 class BlendRef;
00110 class NodeBrush;
00111 class NodeBrushPath;
00112 class NodeBrushMaker;
00113 class CPathPointInfo;
00114 class DocCoord;
00115 class GRenderBrush;
00116 class ProcessPathDistance;
00117 class FreeHandTool;
00118 class BrushPointInfo;
00119 class CDistanceSampler;
00120 class CSampleData;
00121 
00122 //typedef CMap<MILLIPOINT,MILLIPOINT&,CPathPointInfo,CPathPointInfo&> PointsMap;
00123 
00124 #define OPTOKEN_DRAWBRUSH _T("DrawBrush")
00125 #define OPTOKEN_CHANGEBRUSH _T("ChangeBrush")
00126 
00127 #define OPBRUSHPOINTSCACHE
00128 
00129 
00130 /********************************************************************************************
00131 
00132 >   class OpDrawBrush : public OpFreeHand
00133 
00134     Author:     Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
00135     Created:    2/10/99
00136     Purpose:    Draws a freehand stroke, smooths it and applies a nice brush effect
00137 ********************************************************************************************/
00138 
00139 class OpDrawBrush : public OpFreeHand
00140 {
00141     CC_DECLARE_DYNCREATE(OpDrawBrush);
00142 
00143 public:
00144     // Construction/Destruction
00145     OpDrawBrush();
00146     OpDrawBrush(FreeHandTool* pTool);
00147     ~OpDrawBrush();
00148 
00149     // The all important Do functions
00150     void DoDrag(DocCoord Anchor, Spread*, INT32, BrushHandle Handle, FreeHandJoinInfo* pJoinInfo, Path* ToolPath, 
00151                 GRenderBrush* pGRndRgn, ClickModifiers ClickMods);
00152 //  virtual BOOL SnappingDrag() { return FALSE;  }
00153     
00154     // We want to know about key presses so we can see when the modifers change if the
00155     // mouse is not moving
00156 //  virtual BOOL DragKeyPress(KeyPress* pKeyPress, BOOL bSolidDrag);
00157 
00158     // Virtual functions needed for the dragging operations to work
00159     virtual void DragPointerMove(DocCoord PointerPos, ClickModifiers ClickMods, Spread*, BOOL bSolidDrag);
00160     virtual void DragPointerIdle(DocCoord PointerPos, ClickModifiers ClickMods, Spread*, BOOL bSolidDrag);
00161     virtual void DragFinished(  DocCoord PointerPos, 
00162                                 ClickModifiers ClickMods, 
00163                                 Spread*, 
00164                                 BOOL Success, BOOL bSolidDrag);
00165 
00166     // don't render any blobs whilsts dragging - v.important or it will fall over when you
00167     // try and render the view into the temporary renderregion
00168     void RenderDragBlobs( DocRect, Spread*, BOOL bSolidDrag) {}
00169     
00170     // These functions required for the OpDescriptor class
00171     static BOOL Declare();
00172     static OpState GetState(String_256* Description, OpDescriptor*);
00173 
00174     virtual BOOL IsBrushOp() { return TRUE;}
00175 public : //access
00176     BOOL SetTimeStamp(double TimeStamp); // sets the period for our timestamp (if we're using it)
00177 
00178     static CDistanceSampler* GeneratePressureData(AttrBrushType* pAttrBrush, MILLIPOINT StartDistance, 
00179                                                   MILLIPOINT EndDistance, MILLIPOINT NewPathLength);
00180 
00181     static MILLIPOINT GetCurrentLineWidthIfNotDefault(); //gets the current default line width
00182 protected: // helper functions
00183     
00184     void ResetMembers();
00185 
00186     // adds points to our internal path
00187     void AddPointsToPath(DocCoord Pos, Spread* pSpread);
00188     
00189     virtual void SetCursorAndStatus(CursorType CurType);
00190 
00191     // applies attributes to the node we create
00192     virtual BOOL ApplyAttributes(NodePath* NewPath, Document *pDocument);
00193     
00194     // does the work of getting our brush objects drawn and onto the screen
00195     void RenderStepsForTime(double TimeSlice, Spread* pSpread);
00196     
00197     
00198 
00199     // Initialisation helper functions
00200     BOOL InitialisePathProcessorBrush(BrushHandle Handle, MILLIPOINT Distance = 0);
00201     BOOL InitialiseProcessPathDistance();
00202     BOOL InitialisePressureCache();
00203 
00204     AttrBrushType* CreateNewAttribute();
00205 
00206     virtual BOOL EditBrushLists(NodePath* pNewPath, INT32 FirstChangedIndex, INT32 NumElements);
00207             
00208     // updates the timestamping list of a brush which was created using timestamping and then edited
00209     BOOL EditTimeStampList(NodePath* pNewPath, INT32 FirstChangedIndex, INT32 NumElements);
00210     
00211     // update the pressure list
00212     BOOL EditPressureList(NodePath* pNewPath, INT32 FirstChangedIndex, INT32 NumElements);
00213 
00214     virtual BOOL SimpleJoinBrush(NodePath* pNewNodePath, Path* pNewPath);
00215     virtual BOOL ReverseBrushPressure();
00216 
00217 
00218 protected:  // Timestamping functions
00219     BOOL InitialiseTimeStampList();
00220     void RenderTimeStamp();
00221 
00222     BOOL InitialisePressureSampler();
00223     // smoothing functions
00224     BOOL ApplyRetroSmoother(NodePath* pNodePath, double SmoothAmount);
00225 
00226     // applies retro smoother to a brush
00227     BOOL RetroSmoothBrush(NodePath* pNewNodePath);
00228 
00229 protected:  // data
00230     MILLIPOINT m_BrushSpacing;            // the base brush spacing
00231     MILLIPOINT m_LastSpacing;             // record the previous spacing (it is not always constant)
00232     MILLIPOINT m_DistanceSinceLastObject;  // the distance along the path since the last object rendered
00233     MILLIPOINT m_LastDistanceRendered;  // the distance along the path of the last object rendered
00234     DocCoord m_LastPoint;           // the location of the last brush object (prior to rendering)
00235     DocCoord m_StartPoint;          // the first point
00236     DocCoord m_LastPointRendered;  // location of the last point rendered
00237     INT32 m_NumBrushObjects;  // the number of brush objects drawn so far
00238     
00239     UINT32 m_NumInkObjects; // the number of different ink objects that this brush contains
00240     UINT32 m_LastInkObjectRendered; // records which ink object was last rendered
00241 
00242     double m_BrushScaling;       // our base scaling
00243 
00244     GRenderBrush*       m_pGRenderBrush;      // the render region that renders and displays what we draw
00245     PathProcessorBrush* m_pPathProcBrush;     // the path processor that controls what is drawn
00246 
00247 //#ifdef NEWFASTBRUSHES
00248     BrushDefinition* m_pBrushDefinition;    // its wasteful to keep getting hold of this inside RenderBrushAtPoint
00249                                             // lets grab it in this class
00250     BOOL mustClearStatusBar;                // helps us to avoid stupidly updating the status bar
00251     Application* pApp;                      // so we don't have to keep getting old of it
00252 //#endif
00253 
00254     ProcessPathDistance* m_pProcPathDistance; // calculates where we are along the path
00255     FreeHandTool*       m_pTool;              // our parent tool
00256 
00257     BOOL m_bFirstPointRendered;              // indicates whether or not the first point has been rendered
00258     
00259     MILLIPOINT m_FirstSpacing;              // the spacing to use for the first object
00260 
00261     INT32   m_LastPathIndexRendered;    // when we are EOR rendering the path, keep track of the last one we did
00262 
00263 #ifdef OPBRUSHPOINTSCACHE
00264     PointsMap*          m_pPointsCache;     // caches the coordinates of our brush objects
00265 #endif
00266 
00267 protected: // Time stamping data
00268 
00269     double              m_TimeStamp;  // if we are timestamping this records how often we put down an object
00270     double              m_LastTimeStamp; // the time of the last object
00271     TimeStampList*      m_pTimeStampList; // stores the timestamped points
00272     MonotonicTime       m_Timer;
00273 
00274 protected: 
00275     // pressure data
00276 
00277     PressureList*       m_pPressureList;
00278 
00279     // the new sample data
00280     CDistanceSampler*       m_pPressureSampler;
00281 
00282     UINT32 m_NumPressureVals;
00283 private:
00284     
00285     
00286 };
00287 
00288 enum ChangeBrushType  { CHANGEBRUSH_NONE,
00289                         CHANGEBRUSH_SPACING,
00290                         CHANGEBRUSH_SPACING_MAXRAND,
00291                         CHANGEBRUSH_SPACING_RANDSEED,
00292                         CHANGEBRUSH_SPACING_INCRPROP,
00293                         CHANGEBRUSH_SPACING_INCRCONST,
00294                         CHANGEBRUSH_SCALING,
00295                         CHANGEBRUSH_SCALING_INCR,
00296                         CHANGEBRUSH_SCALING_INCRCONST,
00297                         CHANGEBRUSH_SCALING_MAXRAND,
00298                         CHANGEBRUSH_SCALING_RANDSEED,
00299                         CHANGEBRUSH_SCALING_PRESSURE,
00300                         CHANGEBRUSH_OFFSET_TYPE,
00301                         CHANGEBRUSH_OFFSET_TYPE_SEED,
00302                         CHANGEBRUSH_OFFSET_VAL,
00303                         CHANGEBRUSH_OFFSET_INCRPROP,
00304                         CHANGEBRUSH_OFFSET_INCRCONST,
00305                         CHANGEBRUSH_OFFSET_MAXRAND,
00306                         CHANGEBRUSH_OFFSET_VALSEED,
00307                         CHANGEBRUSH_OFFSET_SEEDS,
00308                         CHANGEBRUSH_TILED,
00309                         CHANGEBRUSH_TANGENTIAL,
00310                         CHANGEBRUSH_ROTATE_ANGLE,
00311                         CHANGEBRUSH_ROTATE_INCRPROP,
00312                         CHANGEBRUSH_ROTATE_INCRCONST,
00313                         CHANGEBRUSH_ROTATE_MAXRAND,
00314                         CHANGEBRUSH_ROTATE_RANDSEED,
00315                         CHANGEBRUSH_ROTATE_PRESSURE,
00316                         CHANGEBRUSH_NAME,
00317                         CHANGEBRUSH_USELOCALFILLCOL,
00318                         CHANGEBRUSH_USELOCALTRANSP,
00319                         CHANGEBRUSH_USENAMEDCOL,
00320                         CHANGEBRUSH_REGEN,
00321                         CHANGEBRUSH_SEQUENCE,
00322                         CHANGEBRUSH_SEQUENCE_RANDSEED,
00323                         CHANGEBRUSH_TIMESTAMP,
00324                         CHANGEBRUSH_HUE_INCR,
00325                         CHANGEBRUSH_HUE_MAXRAND,
00326                         CHANGEBRUSH_FILL_SEEDS,
00327                         CHANGEBRUSH_SAT_MAXRAND,
00328                         CHANGEBRUSH_SAT_RANDSEED,
00329                         CHANGEBRUSH_TRANSP,
00330                         CHANGEBRUSH_TRANSP_PRESSURE,
00331                         CHANGEBRUSH_ALL
00332                                         };
00333 
00334 
00335 /********************************************************************************************
00336 
00337 >   class OpChangeBrush : public SelOperation
00338 
00339     Author:     Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
00340     Created:    12/11/99
00341     Purpose:    base class for operations to change various features of the brush
00342     SeeAlso:    -
00343 
00344 ********************************************************************************************/
00345 
00346 class OpChangeBrush : public SelOperation
00347 {
00348 CC_DECLARE_DYNCREATE(OpChangeBrush);
00349 
00350 public:
00351     // Construction/Destruction
00352     OpChangeBrush();                    
00353 
00354     ~OpChangeBrush() {}
00355 
00356     // These functions required for the OpDescriptor class
00357     static BOOL Declare();
00358     static OpState GetState(String_256* Description, OpDescriptor*);
00359 
00360     // The all-important Do() func
00361     virtual void DoWithParam(OpDescriptor*,OpParam* pOpParam);
00362     virtual void GetOpName(String_256* OpName);
00363 
00364 protected:
00365     BOOL ChangeLineWidth(const double &PropChange, NodeRenderableInk* pInk);
00366     // changes the line width applied to pInk by the proportion provided
00367 
00368 private:
00369     ChangeBrushType ChangeType;
00370 };
00371 
00372 /********************************************************************************************
00373 
00374 >   class ChangeBrushOpParam : public OpParam
00375 
00376     Author:     Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
00377     Created:    18/11/99
00378     Purpose:    The param passed to OpChangeBrush::DoWithParam
00379     SeeAlso:    -
00380 
00381 ********************************************************************************************/
00382 
00383 class ChangeBrushOpParam : public OpParam
00384 {
00385 
00386 CC_DECLARE_DYNAMIC(ChangeBrushOpParam)
00387 
00388 public:
00389     ChangeBrushOpParam();   
00390     ChangeBrushOpParam(const ChangeBrushOpParam& Other);
00391     ~ChangeBrushOpParam()   {}
00392 
00393     void InitMembers();
00394     BOOL ChangeLineWidth();
00395 
00396 public: // overridables
00397     virtual void SetOldValues(AttrBrushType* pBrushedNode);
00398     virtual void SetNewValues(AttrBrushType* pBrushedNode);
00399     virtual ChangeBrushOpParam operator=(const ChangeBrushOpParam& Other);
00400 
00401     void SwapOldAndNew();
00402     void SwapDouble(double &First, double &Second);
00403     void SwapUINT(UINT32 &First, UINT32 &Second);
00404     void SwapINT32(INT32 &First, INT32 &Second);
00405     void SwapBOOL(BOOL &First, BOOL &Second);
00406     void SetValues(BrushData Data);
00407 
00408     ChangeBrushType ChangeType;
00409 
00410     MILLIPOINT m_OldSpacing;
00411     MILLIPOINT m_NewSpacing;
00412     double     m_NewSpacingIncrProp;
00413     double     m_OldSpacingIncrProp;
00414     MILLIPOINT m_NewSpacingIncrConst;
00415     MILLIPOINT m_OldSpacingIncrConst;
00416     PressureArray* m_pPressure;
00417     UINT32     m_OldSpacingMaxRand;
00418     UINT32     m_NewSpacingMaxRand;
00419     UINT32     m_NewSpacingRandSeed;
00420     UINT32     m_OldSpacingRandSeed;
00421     double     m_OldScaling;
00422     double     m_NewScaling;
00423     double     m_NewScalingIncr;
00424     double     m_OldScalingIncr;
00425     double     m_NewScalingIncrConst;
00426     double     m_OldScalingIncrConst;
00427     UINT32     m_NewScalingMaxRand;
00428     UINT32     m_OldScalingMaxRand;
00429     UINT32     m_NewScalingRandSeed;
00430     UINT32     m_OldScalingRandSeed;
00431     UINT32     m_OldScalingMaxPressure;
00432     UINT32     m_NewScalingMaxPressure;
00433     PathOffset m_OldPathOffsetType;
00434     PathOffset m_NewPathOffsetType;
00435     UINT32     m_NewOffsetTypeRandSeed;
00436     UINT32     m_OldOffsetTypeRandSeed;
00437     MILLIPOINT m_OldPathOffsetVal;
00438     MILLIPOINT m_NewPathOffsetVal;
00439     double     m_NewOffsetIncrProp;
00440     double     m_OldOffsetIncrProp;
00441     MILLIPOINT m_NewOffsetIncrConst;
00442     MILLIPOINT m_OldOffsetIncrConst;
00443     UINT32     m_NewOffsetValMaxRand;
00444     UINT32     m_OldOffsetValMaxRand;
00445     UINT32     m_NewOffsetValRandSeed;
00446     UINT32     m_OldOffsetValRandSeed;
00447     BOOL       m_bOldTiled;
00448     BOOL       m_bNewTiled;
00449     BOOL       m_bOldRotated;
00450     BOOL       m_bNewRotated;
00451     double     m_OldRotateAngle;
00452     double     m_NewRotateAngle;
00453     double     m_OldRotationIncrProp;
00454     double     m_NewRotationIncrProp;
00455     double     m_OldRotationIncrConst;
00456     double     m_NewRotationIncrConst;
00457     UINT32     m_NewRotateMaxRand;
00458     UINT32     m_OldRotateMaxRand;
00459     UINT32     m_NewRotateRandSeed;
00460     UINT32     m_OldRotateRandSeed;
00461     UINT32     m_NewRotationMaxPressure;
00462     UINT32     m_OldRotationMaxPressure;
00463     String_32  m_OldBrushName;
00464     String_32  m_NewBrushName;
00465     BOOL       m_bOldUseLocalFillColour;
00466     BOOL       m_bNewUseLocalFillColour;
00467     BOOL       m_bNewUseLocalTransp;
00468     BOOL       m_bOldUseLocalTransp;
00469     BOOL       m_bOldUseNamed;
00470     BOOL       m_bNewUseNamed;
00471     SequenceType m_OldSequenceType;
00472     SequenceType m_NewSequenceType;
00473     UINT32      m_NewSequenceRandSeed;
00474     UINT32      m_OldSequenceRandSeed;
00475     double      m_NewHueIncrement;
00476     double      m_OldHueIncrement;
00477     UINT32      m_NewHueMaxRand;
00478     UINT32      m_OldHueMaxRand;
00479     UINT32      m_NewHueRandSeed;
00480     UINT32      m_OldHueRandSeed;
00481     UINT32      m_NewSatMaxRand;
00482     UINT32      m_OldSatMaxRand;
00483     UINT32      m_NewSatRandSeed;
00484     UINT32      m_OldSatRandSeed;
00485     INT32       m_NewTransp;
00486     INT32       m_OldTransp;
00487     UINT32      m_NewTranspPressure;
00488     UINT32      m_OldTranspPressure;
00489 
00490     double  m_OldTimeStampValue;
00491     double  m_NewTimeStampValue;
00492 };
00493 
00494 
00495 
00496 /********************************************************************************************
00497 
00498 >   class ChangeBrushAction : public Action
00499 
00500     Author:     Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
00501     Created:    21/11/94
00502     Purpose:    An action which changes one of the members of a brush attribute
00503     SeeAlso:    -
00504 
00505 ********************************************************************************************/
00506 
00507 class ChangeBrushAction : public Action
00508 {
00509 
00510 CC_DECLARE_DYNCREATE(ChangeBrushAction)
00511 
00512 public:
00513     ChangeBrushAction();
00514     ~ChangeBrushAction();
00515     virtual ActionCode Execute();
00516     static ActionCode Init( Operation* pOp,
00517                             ActionList* pActionList,
00518                             NodeRenderableInk* pBrushedNode,
00519                             ChangeBrushOpParam* pChangeParam,
00520                             ChangeBrushAction** NewAction);
00521 
00522     BOOL ChangeSelectionNoUndo(ChangeBrushOpParam* pParam);
00523 protected:  
00524     static AttrBrushType* GetAttrBrush(NodeRenderableInk* pInk);
00525     static BOOL ChangeBrush(ChangeBrushOpParam* pOpParam, AttrBrushType* pAttrBrush);
00526 
00527     // functions that set the values in the atttribute
00528     static BOOL ChangeBrushSpacing(MILLIPOINT NewSpacing, PressureArray* pArray, AttrBrushType* pAttrBrush);
00529     static BOOL ChangeSpacingIncrProp(double NewIncr, PressureArray* pArray, AttrBrushType* pAttrBrush);
00530     static BOOL ChangeSpacingIncrConst(MILLIPOINT NewIncr, PressureArray* pArray, AttrBrushType* pAttrBrush);
00531     static BOOL ChangeBrushScaling(double NewScaling, AttrBrushType* pAttrBrush);
00532     static BOOL ChangeScalingRandSeed(UINT32 NewSeed, AttrBrushType* pAttrBrush);
00533     static BOOL ChangeScalingIncr(double NewIncr, AttrBrushType* pAttrBrush);
00534     static BOOL ChangeScalingIncrConst(double NewIncr, AttrBrushType* pAttrBrush);
00535     static BOOL ChangeScalingMaxRand(UINT32 NewMax, AttrBrushType* pAttrBrush);
00536     static BOOL ChangeScalingPressure(UINT32 Pressure, AttrBrushType* pAttrBrush);
00537     static BOOL ChangeTangential(BOOL bRotate, AttrBrushType* pAttrBrush);
00538     static BOOL ChangeRotation(double NewAngle, AttrBrushType* pAttrBrush);
00539     static BOOL ChangeRotationIncrProp(double Incr, AttrBrushType* pAttrBrush);
00540     static BOOL ChangeRotationIncrConst(double Incr, AttrBrushType* pAttrBrush);
00541     static BOOL ChangeRotationRandSeed(UINT32 NewSeed, AttrBrushType* pAttrBrush);
00542     static BOOL ChangeRotationMaxRand(UINT32 NewMax, AttrBrushType* pAttrBrush);
00543     static BOOL ChangeRotationMaxPressure(UINT32 Pressure, AttrBrushType* pAttrBrush);
00544     static BOOL ChangeOffsetValue(MILLIPOINT NewOffset, AttrBrushType* pAttrBrush);
00545     static BOOL ChangeOffsetType(PathOffset NewOffset, AttrBrushType* pAttrBrush);
00546     static BOOL ChangeOffsetTypeSeed(UINT32 NewSeed, AttrBrushType* pAttrBrush);
00547     static BOOL ChangeOffsetIncrProp(double NewIncrProp, AttrBrushType* pAttrBrush);
00548     static BOOL ChangeOffsetIncrConst(MILLIPOINT NewIncrConst, AttrBrushType* pAttrBrush);
00549     static BOOL ChangeOffsetValMaxRand(UINT32 NewMax, AttrBrushType* pAttrBrush);
00550     static BOOL ChangeOffsetValRandSeed(UINT32 NewSeed, AttrBrushType* pAttrBrush);
00551     static BOOL ChangeOffsetSeeds(UINT32 NewTypeSeed, UINT32 NewOffsetSeed, AttrBrushType* pAttrBrush);
00552     static BOOL ChangeBrushTile(BOOL bTile, AttrBrushType* pAttrBrush);
00553     static BOOL ChangeSpacingMaxRand(UINT32 NewMaxRand, AttrBrushType* pAttrBrush);
00554     static BOOL ChangeSpacingRandSeed(UINT32 NewSeed, AttrBrushType* pAttrBrush);
00555     static BOOL ChangeUseLocalFillColour(BOOL bUseLocal, AttrBrushType* pAttrBrush);
00556     static BOOL ChangeUseLocalTransp(BOOL bUseLocal, AttrBrushType* pAttrBrush);
00557     static BOOL ChangeUseNamedColour(BOOL bUse, AttrBrushType* pAttr);
00558     static BOOL ChangeSequenceType(SequenceType SeqType, AttrBrushType* pAttrBrush);
00559     static BOOL ChangeSequenceSeed(UINT32 NewSeed, AttrBrushType* pAttrBrush);
00560     static BOOL ChangeAll(ChangeBrushOpParam* pParam, AttrBrushType* pAttrBrush);
00561     static BOOL ChangeHueIncrement(double NewIncr, AttrBrushType* pAttrBrush);
00562     static BOOL ChangeHueMaxRand (UINT32 Rand, AttrBrushType* pAttrBrush);
00563     static BOOL ChangeFillSeeds (UINT32 HueSeed, UINT32 SatSeed, AttrBrushType* AttrBrush);
00564     static BOOL ChangeSatMaxRand (UINT32 Rand, AttrBrushType* pAttrBrush);
00565     static BOOL ChangeSatRandSeed (UINT32 Seed, AttrBrushType* pAttrBrush);
00566     static BOOL ChangeTransparency(INT32 Transp, AttrBrushType* pAttrBrush);
00567     static BOOL ChangeTranspPressure(UINT32 Press, AttrBrushType* pAttrBrush);
00568 
00569     BOOL ChangeLineWidthChildNoUndo(double PropChange, NodeRenderableInk* pInk);
00570         // changes the line width child of an ink node by the given proportion 
00571 protected: // data
00572     NodeRenderableInk*  m_pBrushedNode;
00573     ChangeBrushOpParam  m_ChangeParam;
00574 };
00575 
00576 
00577 /********************************************************************************************
00578 
00579 >   class RemoveTimeStampPointsAction : public Action
00580 
00581     Author:     Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
00582     Created:    18/3/2000
00583     Purpose:    An action which removes points from the timestamping list of a BrushAttValue
00584     SeeAlso:    -
00585 
00586 ********************************************************************************************/
00587 
00588 class RemoveTimeStampPointsAction : public Action
00589 {
00590 CC_DECLARE_DYNCREATE(RemoveTimeStampPointsAction)
00591 
00592 public:
00593     RemoveTimeStampPointsAction();
00594     ~RemoveTimeStampPointsAction();
00595     virtual ActionCode Execute();
00596     static ActionCode Init( Operation* pOp,
00597                             ActionList* pActionList,
00598                             AttrBrushType* pAttrBrush,
00599                             MILLIPOINT StartDistance,
00600                             MILLIPOINT EndDistance, 
00601                             TimeStampList* pPointsList,
00602                             RemoveTimeStampPointsAction** NewAction);
00603 
00604 public: // data
00605     TimeStampList* m_pTimeStampList;
00606     AttrBrushType* m_pAttrBrush;
00607     MILLIPOINT     m_StartDistance;
00608     MILLIPOINT     m_EndDistance;
00609 
00610 };
00611 
00612 
00613 /********************************************************************************************
00614 
00615 >   class AddTimeStampPointsAction : public Action
00616 
00617     Author:     Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
00618     Created:    18/3/2000
00619     Purpose:    An action which adds points to the timestamping list of a BrushAttValue
00620     SeeAlso:    -
00621 
00622 ********************************************************************************************/
00623 
00624 class AddTimeStampPointsAction : public Action
00625 {
00626 CC_DECLARE_DYNCREATE(AddTimeStampPointsAction)
00627 
00628 public:
00629     AddTimeStampPointsAction();
00630     ~AddTimeStampPointsAction();
00631     virtual ActionCode Execute();
00632     static ActionCode Init( Operation* pOp,
00633                             ActionList* pActionList,
00634                             AttrBrushType* pAttrBrush,
00635                             TimeStampList* pNewPoints,
00636                             MILLIPOINT StartDistance,
00637                             MILLIPOINT EndDistance,
00638                             size_t NumPoints,
00639                             AddTimeStampPointsAction** NewAction);
00640 public:
00641     AttrBrushType* m_pAttrBrush;
00642     TimeStampList* m_pTimeStampList;
00643     MILLIPOINT m_StartDistance;
00644     MILLIPOINT m_EndDistance;
00645     size_t     m_NumPoints;
00646 };
00647 
00648 
00649 
00650 /********************************************************************************************
00651 
00652 >   class UpdateBrushAction : public Action
00653 
00654     Author:     Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
00655     Created:    18/3/2000
00656     Purpose:    An action which signals to a brush attribute that its ink node hsa changed.
00657                 It is appropriate to call this action when serious adjustments have been made
00658                 to the timestamping points list of the attrbrushtype, for instance adding or
00659                 removing subsets of the list.  It is not appropriate to call it when the coordinates
00660                 of the path have changed but you do not wish to add or remove any points from the list.
00661                 
00662 
00663     SeeAlso:    -
00664 
00665 ********************************************************************************************/
00666 
00667 class UpdateBrushAction : public Action
00668 {
00669 CC_DECLARE_DYNCREATE(UpdateBrushAction)
00670 
00671 public:
00672     UpdateBrushAction();
00673     ~UpdateBrushAction();
00674 
00675     virtual ActionCode Execute();
00676     static ActionCode Init( Operation* pOp,
00677                             ActionList* pActionList,
00678                             NodePath* pNodePath,
00679                             UpdateBrushAction** NewAction);
00680 
00681 public: //data
00682     NodePath* m_pNodePath;
00683 
00684 
00685 };
00686 
00687 
00688 /********************************************************************************************
00689 
00690 >   class SetRepositionTimeStampPointsAction : public Action
00691 
00692     Author:     Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
00693     Created:    18/3/2000
00694     Purpose:    The purpose of this action is to set a flag that determines what happens when
00695                 the brushed nodepath calls its timestamping brush attribute to update itself.
00696                 Setting this flag to TRUE indicates that our path has changed so that our 
00697                 timestamping list coordinates are no longer on the line.  Therefore we will 
00698                 reposition these points on the new line.  Setting it to FALSE indicates that 
00699                 we have added or removed points from the timestamping list and should sort 
00700                 and reorder it to make sure it is ok.
00701                 
00702 
00703     SeeAlso:    -
00704 
00705 ********************************************************************************************/
00706 
00707 
00708 class SetTimeStampUpdateTypeAction : public Action
00709 {
00710 CC_DECLARE_DYNCREATE(SetTimeStampUpdateTypeAction)
00711 
00712 public:
00713     SetTimeStampUpdateTypeAction();
00714     ~SetTimeStampUpdateTypeAction();
00715 
00716     virtual ActionCode Execute();
00717     static ActionCode Init( Operation* pOp,
00718                             ActionList* pActionList,
00719                             AttrBrushType* pAttrBrush,
00720                             NodePath* pNodePath,
00721                             ListUpdateType TypeToSet,
00722                             SetTimeStampUpdateTypeAction** NewAction);
00723 
00724 public: //data
00725     NodePath* m_pNodePath;
00726     AttrBrushType* m_pAttrBrush;
00727     ListUpdateType m_TypeToSet;
00728 
00729 };
00730 
00731 
00732 /********************************************************************************************
00733 
00734 >   class RemovePressurePointsAction : public Action
00735 
00736     Author:     Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
00737     Created:    18/3/2000
00738     Purpose:    An action which removes points from the pressure data list of a BrushAttValue
00739     SeeAlso:    -
00740 
00741 ********************************************************************************************/
00742 
00743 class RemovePressurePointsAction : public Action
00744 {
00745 CC_DECLARE_DYNCREATE(RemovePressurePointsAction)
00746 
00747 public:
00748     RemovePressurePointsAction();
00749     ~RemovePressurePointsAction();
00750     virtual ActionCode Execute();
00751     static ActionCode Init( Operation* pOp,
00752                             ActionList* pActionList,
00753                             AttrBrushType* pAttrBrush,
00754                             UINT32 StartIndex,
00755                             UINT32 NumPoints,   
00756                             CSampleData* pSampler,
00757                             RemovePressurePointsAction** NewAction);
00758 
00759 public: // data
00760     CSampleData* m_pPressureSampler;
00761     AttrBrushType* m_pAttrBrush;
00762     MILLIPOINT     m_StartIndex;
00763     MILLIPOINT     m_NumPoints;
00764 
00765 };
00766 
00767 
00768 /********************************************************************************************
00769 
00770 >   class AddPressurePointsAction : public Action
00771 
00772     Author:     Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
00773     Created:    18/3/2000
00774     Purpose:    An action which adds points to the Pressure list of a BrushAttValue
00775     SeeAlso:    -
00776 
00777 ********************************************************************************************/
00778 
00779 class AddPressurePointsAction : public Action
00780 {
00781 CC_DECLARE_DYNCREATE(AddPressurePointsAction)
00782 
00783 public:
00784     AddPressurePointsAction();
00785     ~AddPressurePointsAction();
00786     virtual ActionCode Execute();
00787     static ActionCode Init( Operation* pOp,
00788                             ActionList* pActionList,
00789                             AttrBrushType* pAttrBrush,
00790                             CSampleData* pNewPoints,
00791                             UINT32 StartIndex,
00792                             size_t NumPoints,
00793                             AddPressurePointsAction** NewAction);
00794 public:
00795     AttrBrushType*  m_pAttrBrush;
00796     CSampleData*    m_pPressureSampler;
00797     MILLIPOINT      m_StartIndex;
00798     size_t          m_NumPoints;
00799 };
00800 
00801 #endif

Generated on Sat Nov 10 03:47:46 2007 for Camelot by  doxygen 1.4.4