ppbrush.h

Go to the documentation of this file.
00001 // $Id: ppbrush.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 // PathProcessorBrush header
00100 
00101 #ifndef PPBRUSH
00102 #define PPBRUSH
00103 
00104 #include "pathpcs.h"
00105 #include "brshcomp.h"
00106 #include "brshattr.h"
00107 #include "brpress.h"
00108 
00109 class AttrBrushType;
00110 class BrushAttrValue;
00111 class Pathshape;
00112 class BlendPathOffset;
00113 class BaseCamelotFilter;
00114 class MTRand;
00115 class BrushData;
00116 class HandleBrushBecomeA;
00117 class AttrFlatTranspFill;
00118 class CNamedColourReplacer;
00119 class CHSVChanger;
00120 class CTransparencyReplacer;
00121 class CDistanceSampler;
00122 class ValueFunction;
00123 class CSampleItem;
00124 
00125 typedef std::vector< UINT32 >   UINTArray;
00126 const INT32 DEFAULT_ARRAY_SIZE = 500;
00127 typedef std::list< CPathPointInfo > CPathPointList;
00128 
00129 #define USE_MTRNG  // uncomment when we resolve the problems with the MTRand object
00130 
00131 
00132 /********************************************************************************************
00133 
00134 >   class PathProcessorBrush : public PathProcessor
00135 
00136     Author:     Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
00137     Created:    20/12/96
00138 
00139     Purpose:    This path processor renders the new brush objects in place of the paths that 
00140                 are passed to it.  It contains many variant members which can affect the placing,
00141                 scaling and other aspects of the objects that are rendered.  The ink objects that 
00142                 are actually rendered come from a BrushDefinition object. 
00143                 The path processor maintains a pointer to an AttrBrushType which is the attribute
00144                 node that 'owns' the processor.
00145 
00146     SeeAlso:    RenderRegion::DrawPath; PathProcessor::ProcessPath
00147 
00148 ********************************************************************************************/
00149 
00150 class PathProcessorBrush : public PathProcessor
00151 {
00152 #ifdef NEWFASTBRUSHES
00153 private:
00154     BrushAttrValue* pLinkedAttr;
00155 public:
00156     void SetLinkedAttribute (BrushAttrValue* attr) { pLinkedAttr = attr; }
00157 #endif
00158 
00159 CC_DECLARE_DYNAMIC(PathProcessorBrush);
00160 
00161 public:
00162     PathProcessorBrush();
00163     ~PathProcessorBrush(); 
00164 
00165 public:         // RenderRegion path-processing interface
00166     virtual void ProcessPath(Path *pPath, RenderRegion *pRender,
00167                             PathShape ShapePath = PATHSHAPE_PATH);
00168     virtual BOOL WillChangeFillAndBrushSeparately(void);
00169 
00170     virtual BOOL IsAPathProcessorBrush();
00171 public:         // Specialised interface
00172     virtual BOOL IsDifferent(PathProcessorBrush *pOther);
00173             // Returns TRUE if the pOther is considered to be a different processor type
00174 
00175     virtual PathProcessorBrush *Clone(void);
00176             // Creates a copy of this object. Must be overridden by derived classes!
00177 
00178     virtual BOOL NeedsTransparency(void) const {return FALSE;};
00179             // Returns TRUE if this path processor makes use of transparency
00180 
00181     virtual BOOL IsBlended() { return FALSE;}
00182 
00183     virtual BOOL DoBecomeA(BecomeA* pBecomeA, Path* pPath, Node* pParent);
00184 
00185     virtual BOOL DoesActuallyDoAnything(RenderRegion* pRender); 
00186             // returns TRUE if the PP actually alters the path to be rendered
00187 
00188 public: // write processor details to a record
00189      BOOL WriteNative(BaseCamelotFilter *pFilter);
00190 
00191 
00192 public: // calculates the bounding box of this brush applied to the given path
00193     DocRect CalculateBoundingBox(Path* pPath, NodeRenderableInk* pParent);
00194     DocRect TimeStampBoundingBox();
00195 
00196     void    SetCalculateBoundingBox(BOOL Set);  // tells the PPB to calculate the bounding rect on its next render
00197     DocRect GetCachedRect();    // returns the cached bounding rect
00198 
00199 public: // assorted helpful public funs.
00200     INT32 GetObjectCountToDistance(MILLIPOINT Distance);
00201     MILLIPOINT GetDistanceToObject(UINT32 ObjectNum);
00202     
00203     // gets distance to the next object on the given path after Distance
00204     MILLIPOINT GetSpacingAtDistance(MILLIPOINT Distance);
00205 
00206     BOOL GetSpacingAndScalingAtDistance(MILLIPOINT Distance, MILLIPOINT* pSpacing,
00207                                         double* pScaling, UINT32* pPressure = NULL);
00208 
00209     // advances this brush to the given distance
00210     BOOL AdvanceBrushToDistance(MILLIPOINT Distance);
00211     UINT32 GetLastObject(); // retrieves the last object along the path
00212 
00213     // is there a PPB with the same handle on the renderstack?
00214     BOOL        IsThisPathProcessorOnTheStack(RenderRegion* pRender);
00215 
00216     void        AdjustSpacingForClosedPath(NodeRenderableInk* pInk);
00217     void        AdjustSpacingForClosedPath(Path* pPath, double dPathLength);
00218 
00219 public:  // access functions
00220     // set/retrieve the brush definition handle for this PPB
00221     void        SetBrushDefinition(BrushHandle Handle);
00222     BrushHandle GetBrushDefinitionHandle(void);
00223     // retrieve the actual definition itself
00224     virtual BrushDefinition* GetOurBrushDefinition();
00225 public:
00226     // spacing access fns
00227     MILLIPOINT  GetSpacing(void);
00228     BOOL        SetSpacing(MILLIPOINT Spacing);
00229     BOOL        SetSpacingIncrProp(double Incr);
00230     double      GetSpacingIncrProp();
00231     BOOL        SetSpacingIncrConst(MILLIPOINT Incr);
00232     MILLIPOINT  GetSpacingIncrConst();
00233     UINT32      GetSpacingMaxRand();
00234     BOOL        SetSpacingMaxRand(UINT32 Value);
00235     UINT32      GetSpacingRandSeed();
00236     BOOL        SetSpacingRandSeed(UINT32 Value);
00237     void        SetSpacingRandCache(UINTArray* pArray);
00238     BOOL        SetSpacingMaxPressure(UINT32 NewMax);
00239     UINT32      GetSpacingMaxPressure();
00240     MILLIPOINT  GetLastSpacing();
00241 
00242 public:
00243     // offset access fns
00244     PathOffset  GetPathOffsetType(void);
00245     MILLIPOINT  GetPathOffsetValue(void);
00246     void        SetPathOffsetType(PathOffset Offset);
00247     void        SetPathOffsetValue(MILLIPOINT Value);
00248     BOOL        SetPathOffsetIncrProp(double Incr);
00249     double      GetPathOffsetIncrProp();
00250     BOOL        SetPathOffsetIncrConst(MILLIPOINT Incr);
00251     MILLIPOINT  GetPathOffsetIncrConst();
00252 
00253     void        SetOffsetTypeRandCache(UINTArray* pArray);
00254     UINT32      GetOffsetTypeRandSeed();
00255     BOOL        SetOffsetTypeRandSeed(UINT32 Seed);
00256     UINT32      GetOffsetValueMaxRand();
00257     BOOL        SetOffsetValueMaxRand(UINT32 Value);
00258     UINT32      GetOffsetValueRandSeed();
00259     BOOL        SetOffsetValueRandSeed(UINT32 Seed);
00260     void        SetOffsetValueRandCache(UINTArray* pArray);
00261 public:
00262     // tiling functions
00263     void        SetTiling(BOOL Value);
00264     BOOL        IsTiled();
00265 
00266 public: // rotation access
00267     BOOL        SetRotationAngle(double Angle);
00268     double      GetRotationAngle();
00269     double      GetRotationIncrConst();
00270     BOOL        SetRotationIncrConst(double Value);
00271     double      GetRotationIncrProp();
00272     BOOL        SetRotationIncrProp(double Value);
00273     void        SetRotated(BOOL Value);
00274     BOOL        IsRotated();
00275     UINT32      GetRotationMaxRand();
00276     BOOL        SetRotationMaxRand(UINT32 Value);
00277     UINT32      GetRotationRandSeed();
00278     void        SetRotationRandSeed(UINT32 Seed);
00279     UINT32      GetRotationMaxPressure();
00280     BOOL        SetRotationMaxPressure(UINT32 Value);
00281 
00282 public: // scaling access
00283     double      GetBrushScaling();
00284     BOOL        SetBrushScaling(double Scale);
00285     double      GetBrushScalingIncr();
00286     BOOL        SetBrushScalingIncr(double Incr);
00287     double      GetBrushScalingIncrConst();
00288     BOOL        SetBrushScalingIncrConst(double Value); 
00289     UINT32      GetScalingMaxRand();
00290     BOOL        SetScalingMaxRand(UINT32 Value);
00291     UINT32      GetScalingRandSeed();
00292     BOOL        SetScalingRandSeed(UINT32 Value);
00293     //void      SetScalingRandCache(UINTArray* pArray);
00294     UINT32      GetScalingMaxPressure();
00295     BOOL        SetScalingMaxPressure(UINT32 Max);
00296     double      GetLastScaling();
00297 
00298     void        SetScaleToLineWidth(BOOL Value);  
00299     BOOL        IsScalingToLineWidth() { return m_bScaleToLineWidth;}
00300 
00301     void        ScaleToValue(MILLIPOINT Width, BOOL IgnorePressure = FALSE);
00302     double      GetScaleValue(MILLIPOINT Width);
00303 
00304 public: // colour fns.
00305     double      GetHueIncrement();
00306     BOOL        SetHueIncrement(double Incr);
00307     UINT32      GetHueMaxRand();
00308     BOOL        SetHueMaxRand(UINT32 Max);
00309     UINT32      GetHueRandSeed();
00310     BOOL        SetHueRandSeed(UINT32 Seed);
00311 
00312     double      GetSatIncrement();
00313     BOOL        SetSatIncrement(double Incr);
00314     UINT32      GetSatMaxRand();
00315     BOOL        SetSatMaxRand(UINT32 Max);
00316     UINT32      GetSatRandSeed();
00317     BOOL        SetSatRandSeed(UINT32 Seed);
00318 
00319 
00320 public :    // sequence fns
00321     SequenceType GetSequenceType();
00322     void         SetSequenceType(SequenceType Type);
00323     UINT32       GetSequenceSeed();
00324     void         SetSequenceSeed(UINT32 Seed);
00325 
00326 public:  // use local attribute fns.
00327     BOOL        GetUseLocalFillColour();
00328     void        SetUseLocalFillColour(BOOL UseLocal);
00329 
00330     BOOL        GetUseLocalTransp();
00331     void        SetUseLocalTransp(BOOL);
00332 
00333     BOOL        GetUseNamedColours();
00334     void        SetUseNamedColours(BOOL Value);
00335 
00336 public: // transparency access
00337     INT32       GetBrushTransparency();
00338     BOOL        SetBrushTransparency(INT32 Value);
00339     UINT32      GetTransparencyPressure();
00340     BOOL        SetTransparencyPressure(UINT32 Value);
00341 
00342 public: // other access fns.
00343     // number of ink objects in this brush
00344     UINT32      GetNumBrushObjects();   
00345 
00346     // set/retrieve parent attribute pointer
00347     void        SetParentAttribute(AttrBrushType* pAttr);
00348     AttrBrushType* GetParentAttribute();
00349     
00350     void        SetMaxScaling(double Scale);
00351 
00352     void        SetCurrentPressure(UINT32 Pressure);
00353     UINT32      GetCurrentPressure();
00354 
00355     void        CopyBrushData(BrushData* pData);
00356     void        CopyDataFromObject(BrushData* pData);
00357 
00358     MILLIPOINT  GetBrushSize(BOOL IgnorePressure = FALSE); //gets the size of the brush, to use as equivalent linewidth
00359 
00360     void SetStrokeColour(DocColour Col); //tells the PP what stroke colour to use
00361 
00362 public: 
00363     // draws a single brush object at the given point, needs to be public as it is called by OpDrawBrush
00364     void RenderBrushAtPoint(DocCoord Point, double Angle, 
00365                             UINT32 BrushObjectIndex, UINT32 Counter, RenderRegion* pRender, 
00366                             HandleBrushBecomeA* pBecomeA = NULL, BOOL RealtimeBrush = FALSE,
00367                             BrushDefinition* pBrushDefinition = NULL);
00368     
00369     // resets the RNG's to the start of their sequences
00370     BOOL ResetRandomNumberGenerators();
00371 
00372     CDistanceSampler* GetPressureCacheAndInitialise();
00373     CDistanceSampler* GetPressureCacheAndInitialise(RenderRegion* pRegion, ValueFunction** ppValFunc);
00374     CDistanceSampler* GetPressureCacheAndInitialise(NodeRenderableInk* pInkNode, ValueFunction** ppValFunc);
00375 
00376 public: // these functions reset member variables to the state they should be in at the start
00377     // of a rendering pass.  They also need to be called by OpDrawBrush hence public status
00378     void SwitchAlternateValue();
00379     void Reset();
00380 
00381     // returns maximum and minimum limits on our random range, called by CBrushEditDlg hence public
00382     static void GetRandomLimits(UINT32 Base, UINT32 MaxRand, UINT32* pLower, UINT32* pUpper);
00383     static void GetRotationRandomLimits(UINT32 Base, UINT32 MaxRand, UINT32* pLower, UINT32* pUpper);
00384 
00385 protected:  // helper functions
00386     
00387     // renders the attributes into the render region
00388     void RenderAttributes(RenderRegion* pRender, CCAttrMap* pAttrMap, 
00389                           CHSVChanger* pReplacer, CTransparencyReplacer* pTranspRep);
00390 
00391     // makes the variations on fill attributes but without rendering
00392     void AdjustFillAttributes(CCAttrMap* pAttrMap, CHSVChanger* pReplacer, CTransparencyReplacer* pTransRep);
00393 
00394     // adjusts the position of the point to be rendered according to the offset
00395     DocCoord AdjustPositionForOffset(DocCoord OriginalPosition, double Angle, double Scaling, 
00396                                     MILLIPOINT, UINT32 OffsetType);
00397                              
00398     // if we have multiple blendpaths (ie a group) this takes care of the offset of each 
00399     // blendpath from the centre of the group
00400     DocCoord AdjustPositionForBlendPathOffset(DocCoord OriginalPosition, BlendPathOffset* pOffset, 
00401                                             double Scaling, double Angle);
00402 
00403     // determine which points on the line are to be rendered
00404     void AddPointsInRectToList(DocRect Rect, Path* pPath, CPathPointList * pList);
00405     void AddAllPointsToList(Path* pPath, CPathPointList* pList);
00406 
00407     // retrieves the point at the given distance along thepath
00408     BOOL GetPointAtDistance(Path* pPath, MILLIPOINT Distance, DocCoord* pPoint, 
00409                                                 double* pTangent);
00410     
00411     void RenderTimeStampPoints(RenderRegion* pRender);
00412 
00413     // works out how many objects we can fit in the specified distance
00414     INT32       HowManyObjectsInDistance(MILLIPOINT Distance);
00415 
00416     UINT32      GetCurrentPressureEffect(UINT32 MaxEffect, BOOL FixedMax = FALSE);  // works out as a % the effect of the current pressure
00417 
00418     // uses the rand function to get a random sequence, largely superceded by the use of the MTRand objects
00419 /*  UINT32      GetFirstRandomNumber(UINT32 Seed = 0);
00420     UINT32      GetNextRandomNumber();
00421     UINT32      GetNextRandomNumberScaled(UINT32 MaxValue, UINT32 MinValue = 0);
00422 */
00423     // does our transparency adjustments and renders into the region
00424     void        AdjustAndRenderTransparency(RenderRegion* pRender, AttrFillGeometry* pAttrTransp, 
00425                                             CTransparencyReplacer* pRep);           
00426 
00427 protected: // functions to determine transformations to use when rendering the next 
00428             // brush object.
00429     double      GetNextAngle();
00430     MILLIPOINT  GetNextOffset();
00431     double      GetNextSaturationMultiplier();
00432     double      GetNextHueMultiplier();
00433     double      GetNextTransparencyAdjust();
00434     double      GetNextPressureTranspAdjust();
00435 
00436     // tests to see if a brush object is within the given rect
00437     BOOL        ObjectIsWithinRect(DocRect Rect, DocCoord Centre, MILLIPOINT HalfWidth,
00438                             MILLIPOINT HalfHeight, double Scaling, double Angle = 0);
00439 
00440     CSampleItem GetNextSampleItem(CDistanceSampler* pSampler, ValueFunction* pValFunc, double PathProportion = 0);
00441 
00442 public: // helper fns. but they need to be public as they are used by OpDrawBrush
00443     double GetNextScaling(UINT32 Index);
00444     MILLIPOINT GetNextSpacing();
00445     UINT32   GetNextInkObject(UINT32 LastObject, UINT32 NumObjects);
00446     UINT32   GetNextOffsetType();
00447     void   SetNextOffsetType();
00448     
00449     // sets up arrays etc. to record our cached transformation data
00450     BOOL        PrepareForRenderingLoop(UINT32 NumBrushObjects);
00451     void        CleanUpAfterRender();
00452 
00453     BOOL        SetLastRenderedData(UINT32 BrushObject, double Scaling, double Tangent, double Rotation);
00454     void        DecideWhetherToUseActualScaling(UINT32 BrushObject);
00455     
00456 
00457 protected:  //DATA  
00458     BrushHandle m_BrushHandle; // identifies which brush definition to use
00459 
00460     // Helper members
00461 
00462     // These members are used to store the last brush effect value that were rendered with,
00463     // so that we can work out subsequent values
00464     double      m_LastScalingRendered;
00465 
00466     BOOL*       m_pObjectRendered;  // array to hold flags which are set after we render the first object
00467     BOOL        m_UseActualScaling;  // set when we should use our absolute scaling value rather
00468                                      // than a relative one (see GetNextScaling)
00469     
00470     double*     m_pLastScalingRendered; // holds the last scaling value for each object
00471 
00472     double*     m_pLastTangent;  // stores the last tangent for each object
00473     double*     m_pLastRotation; //stores the last rotation for each object
00474 
00475     DocColour   m_CurrentStrokeCol;  // the current stroke colour in our render region (used for overriding colours)
00476 
00477     BOOL        m_DisableMe;     // flag set when we don't want to process anything
00478 
00479     // brush specific data, used to determine the appearance of the brush. Most
00480     // of these can be set by the user one way or another
00481 
00482 /***************Spacing values***************/
00483     MILLIPOINT          m_BrushSpacing;  // the basic spacing along the path
00484     double              m_BrushSpacingIncrProp; // the proportional spacing increment - NOT CURRENTLY IN USE!
00485     MILLIPOINT          m_BrushSpacingIncrConst; // the constant spacing increment - NOT CURRENTLY IN USE!
00486     UINT32              m_BrushSpacingMaxRand; // the upper bound for spacing randomness    
00487     UINT32              m_BrushSpacingRandSeed; // the random seed for spacing
00488     UINT32              m_SpacingMaxPressure;
00489     MILLIPOINT          m_LastSpacing;  //records the last brush spacing
00490 
00491     BOOL                m_bTile;  // do we tile the fill attribute?
00492     BOOL                m_bRotate; //do we rotate tangentially along the path
00493     
00494 /****************Rotation values************/   
00495     double              m_RotateAngle; // sets a constant rotation angle (in degrees)
00496     double              m_RotAngleIncrProp; // - NOT CURRENTLY IN USE!
00497     double              m_RotAngleIncrConst;
00498     double              m_LastAngle;
00499     UINT32              m_RotationMaxRand; 
00500     UINT32              m_RotationRandSeed; 
00501     UINT32              m_RotationMaxPressure;
00502 
00503 /****************Offset values****************/
00504     PathOffset          m_PathOffsetType;  // the type of offset pattern (see enum in brshcomp.h)
00505     MILLIPOINT          m_PathOffsetValue; // size of the offset
00506     double              m_PathOffsetIncrProp; // proportional offset increment - NOT CURRENTLY IN USE!
00507     MILLIPOINT          m_PathOffsetIncrConst; // Constant offset increment - NOT CURRENTLY IN USE!
00508     UINT32              m_OffsetMaxPressure;
00509     MILLIPOINT          m_LastOffset;
00510     UINT32              m_LastOffsetType;
00511     UINT32              m_OffsetTypeRandSeed;
00512     UINT32              m_OffsetValueMaxRand; // maximum random offset value
00513     UINT32              m_OffsetValueRandSeed;
00514     
00515 /********************Scaling values******************/
00516     double              m_BrushScaling;    // how much to scale the objects by
00517     double              m_BrushScalingIncr; // the scaling increment - NOT CURRENTLY IN USE!
00518     double              m_BrushScalingIncrConst; //the constant increment as a percentage of the original scaling - NOT CURRENTLY IN USE!
00519     double              m_LastScaling;      // the last scaling
00520     double              m_CurrentScaling;
00521     UINT32              m_BrushScalingMaxRand; // the upper bound for scaling randomness    
00522     UINT32              m_BrushScalingRandSeed; // the random seed for scaling
00523     UINT32              m_ScalingMaxPressure;   // the extent to which pressure affects scaling
00524 
00525 /********************Hue and saturation values********/
00526     double              m_BrushHueIncrement;  // the amount that the hue increases/decreases each time - NOT CURRENTLY IN USE!
00527     UINT32              m_BrushHueMaxRand;    // the maximum random amount of hue
00528     UINT32              m_BrushHueRandSeed;
00529     UINT32              m_HueMaxPressure;
00530     double              m_LastHueMultiplier;      //UNUSED
00531     double              m_BrushSatIncrement;  // as above but for saturation - NOT CURRENTLY IN USE!
00532     UINT32              m_BrushSatMaxRand;     
00533     UINT32              m_BrushSatRandSeed;
00534     UINT32              m_SatMaxPressure;
00535     double              m_LastSatMultiplier;   //UNUSED
00536 
00537 /*********************Sequence values********************/
00538     SequenceType        m_SequenceType;     // the type of sequence (if we have > 1 ink object)
00539     UINT32              m_SequenceRandSeed; // if we have a random sequence this is the seed
00540     BOOL                m_MirrorSeqAscend; // if we have a mirror sequence are we ascending?
00541 
00542 
00543     BOOL                m_bUseLocalFillColour;  //flag to say whether or not to ignore our cached fill colour and use the local line
00544                                                 // colour 
00545     BOOL                m_bUseLocalTransp;      //as above but for transparencies
00546 
00547     BOOL                m_bUseNamedColours;     // same again for named colours
00548 
00549 /**********************Transparency values**************/
00550     INT32               m_BrushTransparency;    // the new transparency control
00551     UINT32              m_TranspMaxPressure;
00552 
00553     UINT32              m_TimeStampMaxPressure; // not sure if we will ever use this 
00554 
00555 protected: // helper member variables, these are not visible to the user
00556 
00557     UINT32              m_AltValue;    // keeps track of alternating offsets
00558 
00559     MILLIPOINT          m_LineWidth;   // the line width of the path we are processing
00560     BOOL                m_bScaleToLineWidth; // do we scale to the line width?
00561     
00562     BOOL                m_bRenderAllAttributes; // flag to say whether or not to render all applied attributes 
00563                                                 // (for simple brushes we can get away with rendering them only once)
00564     AttrBrushType*      m_pParentAttr;     // pointer to the attribute node that we belong to
00565 
00566     PressureItem        m_CurrentPressure;  // records the current pressure value for the 
00567                                             // object currently being rendered (-1 means don't use pressure)
00568 
00569     DocRect             m_CachedRect;       // stores our cached bounding rect
00570     BOOL                m_bCalculateRect;   // flag indicating whether or not we are currently calculating the bounding rect
00571 
00572     BOOL                m_bValidPressure;   // set when we get a proper pressure cache
00573 
00574     AttrFlatTranspFill* m_pDefaultTransp;   // render this to wipe out previous transparencies
00575 
00576     MILLIPOINT          m_LastSpacingNoRandom; // records the amount of randomness added to spacing by the random effect
00577     MILLIPOINT          m_LastOffsetNoRandom; 
00578     double              m_LastScalingNoRandom;
00579     double              m_LastRotationNoRandom;
00580 
00581     double              m_MaxScaling;           // the scaling that will keep the size of objects to MAX_BRUSH_SIZE
00582 
00583     UINT32              m_LastObject;          // for multiple object brushes, keeps track of the last object in the sequence
00584 
00585 #ifdef USE_MTRNG // the random number generators
00586     MTRand*             m_pSpacingRNG;   
00587     MTRand*             m_pScalingRNG;
00588     MTRand*             m_pOffsetTypeRNG;
00589     MTRand*             m_pOffsetValueRNG;
00590     MTRand*             m_pRotationRNG;
00591     MTRand*             m_pSaturationRNG;
00592     MTRand*             m_pHueRNG;
00593     MTRand*             m_pSequenceRNG;
00594 #endif
00595     
00596 };
00597 
00598 
00599 
00600 /***********************************************************************************************
00601 
00602 >   class BrushSubRenderContext: public SubRenderContext
00603 
00604     Author:     Diccon_Yamanaka (Xara Group Ltd) <camelotdev@xara.com>
00605     Created:    22/8/2000
00606     Purpose:    Used during rendering to store the render context of a brush node if it has
00607                 taken too long to render so far.
00608 
00609 ***********************************************************************************************/
00610 
00611 PORTNOTE("other","SubRenderContext removed")
00612 #ifndef EXCLUDE_FROM_XARALX
00613 class BrushSubRenderContext: public SubRenderContext
00614 {
00615 CC_DECLARE_DYNCREATE(BrushSubRenderContext);
00616 public:
00617     BrushSubRenderContext() { m_Distance = 0; }
00618 
00619     MILLIPOINT m_Distance;
00620 };
00621 #endif
00622 
00623 #endif

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