valfunc.h

Go to the documentation of this file.
00001 // $Id: valfunc.h 1282 2006-06-09 09:46:49Z 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 // Definition of ValueFunction classes (used in stroke providing)
00099 
00100 #ifndef INC_VALFUNC
00101 #define INC_VALFUNC
00102 
00103 //#include "listitem.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00104 
00105 class CamelotFileRecord;
00106 class BaseCamelotFilter;
00107 class CXaraFileRecord;
00108 
00109 
00111 // Unique ID values
00112 // Used when storing ValueFunctions in Native/Web file formats, so they MUST NOT CHANGE
00113 // Hence, add any new ones to the END of the list.
00115 
00116 typedef enum
00117 {
00118     ValueFunctionID_None = 0,
00119     ValueFunctionID_Constant,
00120     ValueFunctionID_Random,
00121     ValueFunctionID_RampLinear,
00122     ValueFunctionID_RampS,
00123     ValueFunctionID_Pressure,
00124     ValueFunctionID_PressureS,
00125     ValueFunctionID_Teardrop,
00126     ValueFunctionID_Ellipse,
00127     ValueFunctionID_Blip,
00128     ValueFunctionID_Thumbtack,
00129     ValueFunctionID_RampL,
00130     ValueFunctionID_RampL2,
00131     ValueFunctionID_RampS2,
00132     ValueFunctionID_TeardropCurvedEnd,
00133     ValueFunctionID_SawTooth,
00134     ValueFunctionID_Propeller,
00135     ValueFunctionID_DoubleRampS,
00136     ValueFunctionID_Intestine,
00137     ValueFunctionID_Decay,
00138     ValueFunctionID_BevelEnds,
00139     //You can gladly tack stuff on the end, but don't screw up the ordering
00140     //around these 'ere parts!!! Matt
00141     ValueFunctionID_SS_Reed,
00142     ValueFunctionID_SS_Meteor,
00143     ValueFunctionID_SS_Petal,
00144     ValueFunctionID_SS_Comet,
00145     ValueFunctionID_SS_Barb,
00146     ValueFunctionID_SS_Concave,
00147     ValueFunctionID_SS_Convex,
00148     ValueFunctionID_SS_Iron,
00149     ValueFunctionID_SS_Torpedo,
00150     ValueFunctionID_SS_Missile,
00151     ValueFunctionID_SS_Goldfish,
00152     ValueFunctionID_SS_OceanLiner,
00153     ValueFunctionID_SS_Yacht,
00154     ValueFunctionID_SS_SlimBlip,
00155     ValueFunctionID_SS_Cigar,
00156     ValueFunctionID_SS_Cigar2,
00157     ValueFunctionID_SS_Cigar3,
00158     ValueFunctionID_SS_Fallout
00159 } ValueFunctionID;
00160 
00161 
00162 
00164 // Base class
00166 
00167 
00168 /******************************************************************************************
00169 
00170 >   class ValueFunction : public CCObject
00171 
00172     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00173     Created:    30/12/96
00174 
00175     Purpose:    Abstract Base class
00176                 Provides an interface by which the caller can obtain the value of a
00177                 given function at a given "position".
00178 
00179                 The function may be whatever you desire. Likely derived classes
00180                 might return a functional result such as a Sine, or interpolate
00181                 between 2 other values, or possibly look the position up in a
00182                 table.
00183 
00184                 This is quite a generic class, but it is mainly used by the stroke
00185                 provider system for handling variable line width functions.
00186 
00187     Notes:      Positions passed into these functions will always be within the
00188                 range 0.0 to 1.0.
00189 
00190                 Generally, outputs from these functions will lie between -1.0
00191                 and 1.0, although there is no reason why the derived classes
00192                 cannot be passed ranges (e.g. see the Ramp classes below)
00193 
00194 ******************************************************************************************/
00195 
00196 class ValueFunction : public ListItem
00197 {
00198     CC_DECLARE_DYNAMIC(ValueFunction);
00199 
00200 public:
00201     static  BOOL Init(void);
00202     static  void DeInit(void);
00203             // Initialises/Deinitialises all ValueFunctions currently in valfunc.cpp
00204 
00205 public:
00206     virtual double GetValue(double Position) = 0;
00207             // Returns the function value for a given position (0.0 - 1.0)
00208 
00209     virtual ValueFunction *Clone(void) = 0;
00210             // Makes a copy of this ValueFunction object
00211 
00212     virtual BOOL IsDifferent(ValueFunction *pOther);
00213             // Equality operator
00214 
00215 
00216 public:     // File format support
00217     virtual CamelotFileRecord *WriteFileRecord(INT32 RecordTag, INT32 ExtraBytes, BaseCamelotFilter *pFilter) = 0;
00218             // Writes this ValueFunction out to a native/web filter as part of a record with the
00219             // given tag, and with ExtraBytes reserved in the record for the caller to fill in on return.
00220 
00221     static  ValueFunction *ReadFileRecord(CXaraFileRecord *pInputRecord);
00222             // Reads a ValueFunction description out of the given file record, and creates a new
00223             // object of the appropriate type & settings from it.
00224 
00225 public:
00226         virtual ValueFunctionID GetUniqueID(void) = 0;
00227             // Retrieves a unique ID for this class of ValueFunction.
00228             // Used as an ID tag in the file format
00229 
00230         virtual INT32 GetMinimumRecursionDepth() { return 0; };
00231             // Overridable - indicates the minimum number of recursions the path stroker should
00232             // perform before declaring the function 'flat' enough - ensures that the path stroking
00233             // can always identify your value function correctly
00234 
00235 protected:
00236     CamelotFileRecord *CreateAndWriteFileRecord(INT32 RecordTag, INT32 DerivedBytes, INT32 ExtraBytes,
00237                                                 BaseCamelotFilter *pFilter);
00238             // Writes out header information for a standard ValueFunction record structure
00239 
00240 
00241     virtual ValueFunction *CreateAndReadFileRecord(CXaraFileRecord *pInputRecord) = 0;
00242             // Reads the given record and creates a ValueFunciton of an appropriate type from it
00243 
00244 protected:
00245     static  List RegisteredFunctions;
00246 };
00247 
00248 
00249 
00251 // Derived classes
00253 
00254 
00255 /******************************************************************************************
00256 
00257 >   class ValueFunctionConstant : public ValueFunction
00258 
00259     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00260     Created:    30/12/96
00261 
00262     Purpose:    Provides an interface by which the caller can obtain the value of a
00263                 given function at a given "position".
00264 
00265                 This derived class simply returns a constant value
00266 
00267 ******************************************************************************************/
00268 
00269 class ValueFunctionConstant : public ValueFunction
00270 {
00271     CC_DECLARE_DYNAMIC(ValueFunctionConstant);
00272 
00273 public:
00274     ValueFunctionConstant(double Value = 1.0);
00275     virtual double GetValue(double Position);
00276     virtual ValueFunction *Clone(void);
00277     virtual BOOL IsDifferent(ValueFunction *pOther);
00278 
00279 public:     // File format support
00280     virtual CamelotFileRecord *WriteFileRecord(INT32 RecordTag, INT32 ExtraBytes, BaseCamelotFilter *pFilter);
00281 
00282     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_Constant); };
00283 
00284 protected:
00285     virtual ValueFunction *CreateAndReadFileRecord(CXaraFileRecord *pInputRecord);
00286 
00287 
00288 protected:
00289     double Value1;
00290 };
00291 
00292 
00293 
00294 
00295 /******************************************************************************************
00296 
00297 >   class ValueFunctionRandom : public ValueFunction
00298 
00299     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00300     Created:    30/12/96
00301 
00302     Purpose:    Provides an interface by which the caller can obtain the value of a
00303                 given function at a given "position".
00304 
00305                 This derived class simply returns a "Random" value. Actually, the
00306                 random value is seeded from the Position plus the seed passed to the
00307                 constructor, so the same position will always give the same value.
00308 
00309     Notes:      This class actually generates 512 random numbers, and returns samples
00310                 from that array. This is so that when used for path stroking, it is
00311                 possible to limit the flattening of the generated curve - with truly
00312                 random results, you can never know when you have flattened enough!
00313 
00314 ******************************************************************************************/
00315 
00316 const INT32 NumRandomValues = 512;
00317 
00318 class ValueFunctionRandom : public ValueFunction
00319 {
00320     CC_DECLARE_DYNAMIC(ValueFunctionRandom);
00321 
00322 public:
00323     ValueFunctionRandom(UINT32 Seed = 0, double Min = 0.8, double Max = 1.0);
00324     virtual double GetValue(double Position);
00325     virtual ValueFunction *Clone(void);
00326     virtual BOOL IsDifferent(ValueFunction *pOther);
00327 
00328 public:     // File format support
00329     virtual CamelotFileRecord *WriteFileRecord(INT32 RecordTag, INT32 ExtraBytes, BaseCamelotFilter *pFilter);
00330 
00331     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_Random); };
00332 
00333 protected:
00334     virtual ValueFunction *CreateAndReadFileRecord(CXaraFileRecord *pInputRecord);
00335     
00336 
00337 protected:
00338     short  Array[NumRandomValues];
00339     UINT32   SeedValue;
00340     double MinValue;
00341     double MaxValue;
00342 };
00343 
00344 
00345 
00346 
00347 /******************************************************************************************
00348 
00349 >   class ValueFunctionRamp         : public ValueFunction      (abstract base class)
00350 >   class ValueFunctionRampLinear   : public ValueFunctionRamp
00351 >   class ValueFunctionRampS        : public ValueFunctionRamp
00352 
00353     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00354     Created:    30/12/96
00355 
00356     Purpose:    Provides an interface by which the caller can obtain the value of a
00357                 given function at a given "position".
00358 
00359                 ValueFunctionRampLinear
00360                         provides a linear ramp between 2 values
00361 
00362                 ValueFunctionRampS
00363                         provides a half-sine-wave (S) ramp between 2 values
00364 
00365 ******************************************************************************************/
00366 
00367 class ValueFunctionRamp : public ValueFunction
00368 {
00369     CC_DECLARE_DYNAMIC(ValueFunctionRamp);
00370 
00371 public:
00372     ValueFunctionRamp(double StartValue = 1.0, double EndValue = 0.0);
00373     virtual BOOL IsDifferent(ValueFunction *pOther);
00374 
00375 public:     // File format support
00376     virtual CamelotFileRecord *WriteFileRecord(INT32 RecordTag, INT32 ExtraBytes, BaseCamelotFilter *pFilter);
00377 
00378 protected:
00379     double Value1;
00380     double Value2;
00381 };
00382 
00383 // -------------------------------------------------------------------------------------
00384 
00385 class ValueFunctionRampLinear : public ValueFunctionRamp
00386 {
00387     CC_DECLARE_DYNAMIC(ValueFunctionRampLinear);
00388 
00389 public:
00390     ValueFunctionRampLinear(double StartValue = 1.0, double EndValue = 0.0)
00391                     :   ValueFunctionRamp(StartValue, EndValue)
00392                     {};
00393 
00394     virtual double GetValue(double Position);
00395     virtual ValueFunction *Clone(void);
00396 
00397     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_RampLinear); };
00398 
00399 protected:      // File format support
00400     virtual ValueFunction *CreateAndReadFileRecord(CXaraFileRecord *pInputRecord);
00401     
00402 };
00403 
00404 // -------------------------------------------------------------------------------------
00405 
00406 class ValueFunctionRampS : public ValueFunctionRamp
00407 {
00408     CC_DECLARE_DYNAMIC(ValueFunctionRampS);
00409 
00410 public:
00411     ValueFunctionRampS(double StartValue = 1.0, double EndValue = 0.0)
00412                     :   ValueFunctionRamp(StartValue, EndValue)
00413                     {};
00414 
00415     virtual double GetValue(double Position);
00416     virtual ValueFunction *Clone(void);
00417     virtual INT32 GetMinimumRecursionDepth();
00418 
00419     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_RampS); };
00420 
00421 protected:      // File format support
00422     virtual ValueFunction *CreateAndReadFileRecord(CXaraFileRecord *pInputRecord);
00423     
00424 };
00425 
00426 // -------------------------------------------------------------------------------------
00427 
00428 class ValueFunctionRampS2 : public ValueFunctionRamp
00429 {
00430     CC_DECLARE_DYNAMIC(ValueFunctionRampS2);
00431 
00432 public:
00433     ValueFunctionRampS2(double StartValue = 1.0, double EndValue = 0.2)
00434                     :   ValueFunctionRamp(StartValue, EndValue)
00435                     {};
00436 
00437     virtual double GetValue(double Position);
00438     virtual ValueFunction *Clone(void);
00439     virtual INT32 GetMinimumRecursionDepth();
00440 
00441     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_RampS2); };
00442 
00443 protected:      // File format support
00444     virtual ValueFunction *CreateAndReadFileRecord(CXaraFileRecord *pInputRecord);
00445     
00446 };
00447 
00448 // -------------------------------------------------------------------------------------
00449 
00450 class ValueFunctionRampL : public ValueFunctionRamp
00451 {
00452     CC_DECLARE_DYNAMIC(ValueFunctionRampL);
00453 
00454 public:
00455     ValueFunctionRampL(double StartValue = 1.0, double EndValue = 0.0)
00456                     :   ValueFunctionRamp(StartValue, EndValue)
00457                     {};
00458 
00459     virtual double GetValue(double Position);
00460     virtual ValueFunction *Clone(void);
00461     virtual INT32 GetMinimumRecursionDepth();
00462 
00463     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_RampL); };
00464 
00465 protected:      // File format support
00466     virtual ValueFunction *CreateAndReadFileRecord(CXaraFileRecord *pInputRecord);
00467     
00468 };
00469 
00470 // -------------------------------------------------------------------------------------
00471 
00472 class ValueFunctionRampL2 : public ValueFunctionRamp
00473 {
00474     CC_DECLARE_DYNAMIC(ValueFunctionRampL2);
00475 
00476 public:
00477     ValueFunctionRampL2(double StartValue = 1.0, double EndValue = 0.2)
00478                     :   ValueFunctionRamp(StartValue, EndValue)
00479                     {};
00480 
00481     virtual double GetValue(double Position);
00482     virtual ValueFunction *Clone(void);
00483     virtual INT32 GetMinimumRecursionDepth();
00484 
00485     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_RampL2); };
00486 
00487 protected:      // File format support
00488     virtual ValueFunction *CreateAndReadFileRecord(CXaraFileRecord *pInputRecord);
00489     
00490 };
00491 
00492 
00493 
00494 // -------------------------------------------------------------------------------------
00495 
00496 class ValueFunctionSawTooth : public ValueFunctionRamp
00497 {
00498     CC_DECLARE_DYNAMIC(ValueFunctionSawTooth);
00499 
00500 public:
00501     ValueFunctionSawTooth(double StartValue = 1.0, double EndValue = 0.0)
00502                     :   ValueFunctionRamp(StartValue, EndValue)
00503                     {};
00504 
00505     virtual double GetValue(double Position);
00506     virtual ValueFunction *Clone(void);
00507 
00508     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SawTooth); };
00509 
00510     virtual INT32 GetMinimumRecursionDepth();
00511 
00512 protected:      // File format support
00513     virtual ValueFunction *CreateAndReadFileRecord(CXaraFileRecord *pInputRecord);
00514     
00515 };
00516 
00517 // -------------------------------------------------------------------------------------
00518 
00519 class ValueFunctionPropeller : public ValueFunctionRamp
00520 {
00521     CC_DECLARE_DYNAMIC(ValueFunctionPropeller);
00522 
00523 public:
00524     ValueFunctionPropeller(double StartValue = 1.0, double EndValue = 0.0)
00525                     :   ValueFunctionRamp(StartValue, EndValue)
00526                     {};
00527 
00528     virtual double GetValue(double Position);
00529     virtual ValueFunction *Clone(void);
00530 
00531     virtual INT32 GetMinimumRecursionDepth();
00532 
00533     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_Propeller); };
00534 
00535 protected:      // File format support
00536     virtual ValueFunction *CreateAndReadFileRecord(CXaraFileRecord *pInputRecord);
00537     
00538 };
00539 
00540 // -------------------------------------------------------------------------------------
00541 
00542 class ValueFunctionDoubleRampS : public ValueFunctionRamp
00543 {
00544     CC_DECLARE_DYNAMIC(ValueFunctionDoubleRampS);
00545 
00546 public:
00547     ValueFunctionDoubleRampS(double StartValue = 1.0, double EndValue = 0.0)
00548                     :   ValueFunctionRamp(StartValue, EndValue)
00549                     {};
00550 
00551     virtual double GetValue(double Position);
00552     virtual ValueFunction *Clone(void);
00553 
00554     virtual INT32 GetMinimumRecursionDepth();
00555 
00556     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_DoubleRampS); };
00557 
00558 protected:      // File format support
00559     virtual ValueFunction *CreateAndReadFileRecord(CXaraFileRecord *pInputRecord);
00560     
00561 };
00562 
00563 // -------------------------------------------------------------------------------------
00564 
00565 class ValueFunctionBevelEnds : public ValueFunctionRamp
00566 {
00567     CC_DECLARE_DYNAMIC(ValueFunctionBevelEnds);
00568 
00569 public:
00570     ValueFunctionBevelEnds(double StartValue = 1.0, double EndValue = 0.0)
00571                     :   ValueFunctionRamp(StartValue, EndValue)
00572                     {};
00573 
00574     virtual double GetValue(double Position);
00575     virtual ValueFunction *Clone(void);
00576 
00577     virtual INT32 GetMinimumRecursionDepth();
00578 
00579     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_BevelEnds); };
00580 
00581 protected:      // File format support
00582     virtual ValueFunction *CreateAndReadFileRecord(CXaraFileRecord *pInputRecord);
00583     
00584 };
00585 
00586 // -------------------------------------------------------------------------------------
00587 
00588 class ValueFunctionIntestine : public ValueFunctionRamp
00589 {
00590     CC_DECLARE_DYNAMIC(ValueFunctionIntestine);
00591 
00592 public:
00593     ValueFunctionIntestine(double StartValue = 1.0, double EndValue = 0.0)
00594                     :   ValueFunctionRamp(StartValue, EndValue)
00595                     {};
00596 
00597     virtual double GetValue(double Position);
00598     virtual ValueFunction *Clone(void);
00599 
00600     virtual INT32 GetMinimumRecursionDepth();
00601 
00602     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_Intestine); };
00603 
00604 protected:      // File format support
00605     virtual ValueFunction *CreateAndReadFileRecord(CXaraFileRecord *pInputRecord);
00606     
00607 };
00608 
00609 // -------------------------------------------------------------------------------------
00610 
00611 class ValueFunctionDecay : public ValueFunctionRamp
00612 {
00613     CC_DECLARE_DYNAMIC(ValueFunctionDecay);
00614 
00615 public:
00616     ValueFunctionDecay(double StartValue = 1.0, double EndValue = 0.0)
00617                     :   ValueFunctionRamp(StartValue, EndValue)
00618                         {};
00619 
00620     virtual double GetValue(double Position);
00621     virtual ValueFunction *Clone(void);
00622 
00623     virtual INT32 GetMinimumRecursionDepth();
00624 
00625     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_Decay); };
00626 
00627 protected:      // File format support
00628     virtual ValueFunction *CreateAndReadFileRecord(CXaraFileRecord *pInputRecord);
00629     
00630 };
00631 
00632 
00633 
00635 // Blips (functions which go from 0.0 to 1.0 and back again)
00637 
00638 
00639 /******************************************************************************************
00640 
00641 >   class ValueFunctionBlip : public ValueFunction
00642 
00643     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00644     Created:    30/12/96
00645 
00646     Purpose:    Provides an interface by which the caller can obtain the value of a
00647                 given function at a given "position".
00648 
00649                 This derived class returns a basic Blip shape:
00650                                  ______
00651                            __----      ----__
00652                     ____---                  ---____
00653 
00654                 Classes derived from this override the "blip" with different shapes
00655 
00656                 In all cases, the constructor takes a "maxposition" value which
00657                 indicates at which position the maximum function value occurs,
00658                 as some blips are not symmetrical.
00659 
00660 ******************************************************************************************/
00661 
00662 class ValueFunctionBlip : public ValueFunction
00663 {
00664     CC_DECLARE_DYNAMIC(ValueFunctionBlip);
00665 
00666 public:
00667     ValueFunctionBlip(double MaxPosition = 0.50);
00668     virtual double GetValue(double Position);
00669     virtual ValueFunction *Clone(void);
00670     virtual BOOL IsDifferent(ValueFunction *pOther);
00671 
00672 public:     // File format support
00673     virtual CamelotFileRecord *WriteFileRecord(INT32 RecordTag, INT32 ExtraBytes, BaseCamelotFilter *pFilter);
00674 
00675     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_Blip); };
00676 
00677 protected:
00678     virtual ValueFunction *CreateAndReadFileRecord(CXaraFileRecord *pInputRecord);
00679     
00680 
00681 protected:  // Derived class overrides
00682     virtual ValueFunctionBlip *CreateInstance(void);
00683 
00684 protected:
00685     double MaxPos;
00686 };
00687 
00688 
00689 
00690 /******************************************************************************************
00691 
00692 >   class ValueFunctionTeardrop : public ValueFunctionBlip
00693 
00694     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00695     Created:    30/12/96
00696 
00697     Purpose:    Provides an interface by which the caller can obtain the value of a
00698                 given function at a given "position".
00699 
00700                 This derived class returns a Teardrop shape:
00701                       ___
00702                      /    ---___
00703                     |           ---___
00704 
00705 ******************************************************************************************/
00706 
00707 class ValueFunctionTeardrop : public ValueFunctionBlip
00708 {
00709     CC_DECLARE_DYNAMIC(ValueFunctionTeardrop);
00710 
00711 public:
00712     ValueFunctionTeardrop(double MaxPosition = 0.20) : ValueFunctionBlip(MaxPosition) {};
00713     virtual double GetValue(double Position);
00714 
00715     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_Teardrop); };
00716 
00717 protected:
00718     
00719     virtual ValueFunctionBlip *CreateInstance(void);
00720 };
00721 
00722 
00723 /******************************************************************************************
00724 
00725 >   class ValueFunctionTeardropCurvedEnd : public ValueFunctionBlip
00726 
00727     Author:     Priestley (Xara Group Ltd) <camelotdev@xara.com> from Jason
00728     Created:    9/10/2000
00729 
00730     Purpose:    Provides an interface by which the caller can obtain the value of a
00731                 given function at a given "position".
00732 
00733                 This derived class returns a Teardrop shape with a curved trailing edge
00734 
00735 ******************************************************************************************/
00736 
00737 class ValueFunctionTeardropCurvedEnd : public ValueFunctionBlip
00738 {
00739     CC_DECLARE_DYNAMIC(ValueFunctionTeardropCurvedEnd);
00740 
00741 public:
00742     ValueFunctionTeardropCurvedEnd(double MaxPosition = 0.20) : ValueFunctionBlip(MaxPosition) {};
00743     virtual double GetValue(double Position);
00744     virtual INT32 GetMinimumRecursionDepth();
00745 
00746     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_TeardropCurvedEnd); };
00747 
00748 protected:
00749     
00750     virtual ValueFunctionBlip *CreateInstance(void);
00751 };
00752 
00753 
00754 /******************************************************************************************
00755 
00756 >   class ValueFunctionEllipse : public ValueFunction
00757 
00758     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00759     Created:    30/12/96
00760 
00761     Purpose:    Provides an interface by which the caller can obtain the value of a
00762                 given function at a given "position".
00763 
00764                 This derived class returns an elliptical arc:
00765                       ___
00766                      /   \
00767                     |     | 
00768 
00769 ******************************************************************************************/
00770 
00771 class ValueFunctionEllipse : public ValueFunctionBlip
00772 {
00773     CC_DECLARE_DYNAMIC(ValueFunctionEllipse);
00774 
00775 public:
00776     virtual double GetValue(double Position);
00777 
00778     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_Ellipse); };
00779 
00780 protected:
00781     virtual ValueFunctionBlip *CreateInstance(void);
00782 };
00783 
00784 
00785 
00786 /******************************************************************************************
00787 
00788 >   class ValueFunctionThumbtack : public ValueFunction
00789 
00790     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00791     Created:    26/2/97
00792 
00793     Purpose:    Provides an interface by which the caller can obtain the value of a
00794                 given function at a given "position".
00795 
00796                 This derived class returns a Thumbtack shape built of 2 quarter circles
00797                 back to back:
00798                       
00799                        /\
00800                     __-  -__
00801 
00802 ******************************************************************************************/
00803 
00804 class ValueFunctionThumbtack : public ValueFunctionBlip
00805 {
00806     CC_DECLARE_DYNAMIC(ValueFunctionThumbtack);
00807 
00808 public:
00809     virtual double GetValue(double Position);
00810 
00811     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_Thumbtack); };
00812 
00813 protected:
00814     virtual ValueFunctionBlip *CreateInstance(void);
00815 };
00816 
00817 
00818 
00819 
00820 
00822 // ValueFunctionPressure
00824 
00825 
00826 /******************************************************************************************
00827 
00828 >   class ValueFunctionPressure  : public ValueFunction
00829 >   class ValueFunctionPressureS : public ValueFunction
00830 
00831     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00832     Created:    20/1/97
00833 
00834     Purpose:    Stores Pressure-sensitive pen values (as used for variable-width strokes)
00835                 and allows the caller to retrieve values from such recorded information.
00836 
00837                 ValueFunctionPressure linearly interpolates all pressure samples, while
00838                 ValueFunctionPressureS interpolates with an S-shaped curve. (This latter
00839                 one is used for smoothed pressure information, and have a vastly reduced
00840                 storage footprint. See Also kernel\pressure.cpp for the smoothing code)
00841 
00842     SeeAlso:    tools\opfree.cpp (freehand tool pressure recording)
00843 
00844 ******************************************************************************************/
00845 
00846 typedef struct
00847 {
00848     float Position;         // Pos must be stored as a float - less than 32bits is not enough accuracy
00849     float Pressure;         // Pressure is stored as a float, as there is a very high probability that
00850                             // the compiler will pad the struct out to 8 bytes anyway, and this reduces
00851                             // the on-the-fly calculation required marginally.
00852 } VFPressureRecord;
00853 
00854 class ValueFunctionPressure : public ValueFunction
00855 {
00856     CC_DECLARE_DYNAMIC(ValueFunctionPressure);
00857 
00858 public:     // Overridden virtuals
00859     ValueFunctionPressure();
00860     ~ValueFunctionPressure();
00861 
00862     virtual double GetValue(double Position);
00863     virtual ValueFunction *Clone(void);
00864     virtual BOOL IsDifferent(ValueFunction *pOther);
00865 
00866 
00867 public:     // Specialised interface
00868     BOOL AddPressure(float Position, float PressureValue);
00869             // Appends the given pressure information to the end of the pressure table
00870 
00871     void NormalisePositions(void);
00872             // Post-processing pass. Normalises all position values on the assumption that
00873             // the last position entry is the largest position in the array.
00874 
00875 public:     // File format support
00876     virtual CamelotFileRecord *WriteFileRecord(INT32 RecordTag, INT32 ExtraBytes, BaseCamelotFilter *pFilter);
00877 
00878 
00879     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_Pressure); };
00880 
00881 protected:
00882     virtual ValueFunction *CreateAndReadFileRecord(CXaraFileRecord *pInputRecord);
00883     
00884 
00885 
00886 protected:
00887     BOOL ExpandArray(INT32 NewSize);
00888             // Expands the array to contain no fewer than NewSize entries. Returns FALSE if it fails
00889 
00890 protected:
00891     virtual ValueFunctionPressure *CreateInstance(void);
00892             // Creates a new instance of a Pressure or derived class
00893 
00894 protected:
00895     VFPressureRecord *pArray;       // A dynamic array of pressure information records
00896     INT32 ArraySize;                    // The current (maximum) size of the array
00897     INT32 NextFree;                 // The number of entries used at present (indexes next free space)
00898 };
00899 
00900 // -------------------------------------------------------------------------------------
00901 
00902 class ValueFunctionPressureS : public ValueFunctionPressure
00903 {
00904     CC_DECLARE_DYNAMIC(ValueFunctionPressureS);
00905 
00906 public:
00907     virtual double GetValue(double Position);
00908 
00909     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_PressureS); };
00910 
00911 protected:
00912     
00913     virtual ValueFunctionPressure *CreateInstance(void);
00914 };
00915 
00916 /******************************************************************************************
00917 
00918     Author:     Priestley (Xara Group Ltd) <camelotdev@xara.com>
00919     Created:    10/10/2000
00920 
00921     Purpose:    Provides an interface by which the caller can obtain the value of a
00922                 given function at a given "position".
00923 
00924 ******************************************************************************************/
00925 
00926 class ValueFunctionSmoothStroke : public ValueFunction
00927 {
00928     CC_DECLARE_DYNAMIC(ValueFunctionSmoothStroke);
00929 
00930 public:
00931     ValueFunctionSmoothStroke(double newValue1y, double newValue2x, double newValue2y, double newValue3x, double newValue3y, double newValue4y);
00932     virtual ~ValueFunctionSmoothStroke();
00933     virtual BOOL IsDifferent(ValueFunction *pOther);
00934     virtual INT32 GetMinimumRecursionDepth();
00935     virtual CamelotFileRecord *WriteFileRecord(INT32 RecordTag, INT32 ExtraBytes, BaseCamelotFilter *pFilter);
00936     virtual ValueFunction *CreateAndReadFileRecord(CXaraFileRecord *pInputRecord);
00937     virtual ValueFunctionSmoothStroke *CreateInstance(void);
00938     virtual double GetValue(double Position);
00939 
00940     void MakeTable();
00941 
00942 protected:
00943     double Value1y;
00944     double Value2x;
00945     double Value2y;
00946     double Value3x;
00947     double Value3y;
00948     double Value4y;
00949 
00950     static double xvalue[18][256];
00951     static double yvalue[18][256];
00952 };
00953 
00954 
00955 
00956 class ValueFunctionSS_Yacht : public ValueFunctionSmoothStroke
00957 {
00958     CC_DECLARE_DYNAMIC(ValueFunctionSS_Yacht);
00959 
00960 public:
00961     ValueFunctionSS_Yacht(double newValue1y = 0.5, double newValue2x = 0.333, double newValue2y = 1.0, double newValue3x = 0.667, double newValue3y = 1.0, double newValue4y = 0.0)
00962         :   ValueFunctionSmoothStroke(newValue1y, newValue2x, newValue2y, newValue3x, newValue3y, newValue4y) { if (!bMadeTable) { MakeTable(); bMadeTable = true; } };
00963 
00964     virtual ValueFunction *Clone(void) { ValueFunction *pClone = new ValueFunctionSS_Yacht(Value1y, Value2x, Value2y, Value3x, Value3y, Value4y); return(pClone); };
00965     virtual ValueFunctionSmoothStroke *CreateInstance(void) { return(new ValueFunctionSS_Yacht); };
00966     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SS_Yacht); };
00967     static bool bMadeTable;
00968 };
00969 
00970 
00971 class ValueFunctionSS_Iron : public ValueFunctionSmoothStroke
00972 {
00973     CC_DECLARE_DYNAMIC(ValueFunctionSS_Iron);
00974 
00975 public:
00976     ValueFunctionSS_Iron(double newValue1y = 1.0, double newValue2x = 0.333, double newValue2y = 1.0, double newValue3x = 0.667, double newValue3y = 1.0, double newValue4y = 0.0)
00977         :   ValueFunctionSmoothStroke(newValue1y, newValue2x, newValue2y, newValue3x, newValue3y, newValue4y) { if (!bMadeTable) { MakeTable(); bMadeTable = true; } };
00978 
00979     virtual ValueFunction *Clone(void) { ValueFunction *pClone = new ValueFunctionSS_Iron(Value1y, Value2x, Value2y, Value3x, Value3y, Value4y); return(pClone); };
00980     virtual ValueFunctionSmoothStroke *CreateInstance(void) { return(new ValueFunctionSS_Iron); };
00981     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SS_Iron); };
00982     static bool bMadeTable;
00983 };
00984 
00985 class ValueFunctionSS_Reed : public ValueFunctionSmoothStroke
00986 {
00987     CC_DECLARE_DYNAMIC(ValueFunctionSS_Reed);
00988 
00989 public:
00990     ValueFunctionSS_Reed(double newValue1y = 0.0, double newValue2x = 0.333, double newValue2y = 1.0, double newValue3x = 0.667, double newValue3y = 0.5, double newValue4y = 0.0)
00991         :   ValueFunctionSmoothStroke(newValue1y, newValue2x, newValue2y, newValue3x, newValue3y, newValue4y) { if (!bMadeTable) { MakeTable(); bMadeTable = true; } };
00992 
00993     virtual ValueFunction *Clone(void) { ValueFunction *pClone = new ValueFunctionSS_Reed(Value1y, Value2x, Value2y, Value3x, Value3y, Value4y); return(pClone); };
00994     virtual ValueFunctionSmoothStroke *CreateInstance(void) { return(new ValueFunctionSS_Reed); };
00995     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SS_Reed); };
00996     static bool bMadeTable;
00997 };
00998 
00999 class ValueFunctionSS_Meteor : public ValueFunctionSmoothStroke
01000 {
01001     CC_DECLARE_DYNAMIC(ValueFunctionSS_Meteor);
01002 
01003 public:
01004     ValueFunctionSS_Meteor(double newValue1y = 0.0, double newValue2x = 0.15, double newValue2y = 1.0, double newValue3x = 0.667, double newValue3y = 0.0, double newValue4y = 0.0)
01005         :   ValueFunctionSmoothStroke(newValue1y, newValue2x, newValue2y, newValue3x, newValue3y, newValue4y) { if (!bMadeTable) { MakeTable(); bMadeTable = true; } };
01006 
01007     virtual ValueFunction *Clone(void) { ValueFunction *pClone = new ValueFunctionSS_Meteor(Value1y, Value2x, Value2y, Value3x, Value3y, Value4y); return(pClone); };
01008     virtual ValueFunctionSmoothStroke *CreateInstance(void) { return(new ValueFunctionSS_Meteor); };
01009     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SS_Meteor); };
01010     static bool bMadeTable;
01011 };
01012 
01013 class ValueFunctionSS_Petal : public ValueFunctionSmoothStroke
01014 {
01015     CC_DECLARE_DYNAMIC(ValueFunctionSS_Petal);
01016 
01017 public:
01018     ValueFunctionSS_Petal(double newValue1y = 0.0, double newValue2x = 0.15, double newValue2y = 1.0, double newValue3x = 0.3, double newValue3y = 1.0, double newValue4y = 0.0)
01019         :   ValueFunctionSmoothStroke(newValue1y, newValue2x, newValue2y, newValue3x, newValue3y, newValue4y) { if (!bMadeTable) { MakeTable(); bMadeTable = true; } };
01020 
01021     virtual ValueFunction *Clone(void) { ValueFunction *pClone = new ValueFunctionSS_Petal(Value1y, Value2x, Value2y, Value3x, Value3y, Value4y); return(pClone); };
01022     virtual ValueFunctionSmoothStroke *CreateInstance(void) { return(new ValueFunctionSS_Petal); };
01023     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SS_Petal); };
01024     static bool bMadeTable;
01025 };
01026 
01027 
01028 class ValueFunctionSS_Comet : public ValueFunctionSmoothStroke
01029 {
01030     CC_DECLARE_DYNAMIC(ValueFunctionSS_Comet);
01031 
01032 public:
01033     ValueFunctionSS_Comet(double newValue1y = 0.1, double newValue2x = 0.05, double newValue2y = 1.6, double newValue3x = 0.15, double newValue3y = 0.2, double newValue4y = 0.05)
01034         :   ValueFunctionSmoothStroke(newValue1y, newValue2x, newValue2y, newValue3x, newValue3y, newValue4y) { if (!bMadeTable) { MakeTable(); bMadeTable = true; } };
01035 
01036     virtual ValueFunction *Clone(void) { ValueFunction *pClone = new ValueFunctionSS_Comet(Value1y, Value2x, Value2y, Value3x, Value3y, Value4y); return(pClone); };
01037     virtual ValueFunctionSmoothStroke *CreateInstance(void) { return(new ValueFunctionSS_Comet); };
01038     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SS_Comet); };
01039     static bool bMadeTable;
01040 };
01041 
01042 
01043 class ValueFunctionSS_Fallout : public ValueFunctionSmoothStroke
01044 {
01045     CC_DECLARE_DYNAMIC(ValueFunctionSS_Fallout);
01046 
01047 public:
01048     ValueFunctionSS_Fallout(double newValue1y = 1.0, double newValue2x = 0.333, double newValue2y = 1.0, double newValue3x = 0.667, double newValue3y = 1.0, double newValue4y = 0.5)
01049         :   ValueFunctionSmoothStroke(newValue1y, newValue2x, newValue2y, newValue3x, newValue3y, newValue4y) { if (!bMadeTable) { MakeTable(); bMadeTable = true; } };
01050 
01051     virtual ValueFunction *Clone(void) { ValueFunction *pClone = new ValueFunctionSS_Fallout(Value1y, Value2x, Value2y, Value3x, Value3y, Value4y); return(pClone); };
01052     virtual ValueFunctionSmoothStroke *CreateInstance(void) { return(new ValueFunctionSS_Fallout); };
01053     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SS_Fallout); };
01054     static bool bMadeTable;
01055 };
01056 
01057 class ValueFunctionSS_Torpedo : public ValueFunctionSmoothStroke
01058 {
01059     CC_DECLARE_DYNAMIC(ValueFunctionSS_Torpedo);
01060 
01061 public:
01062     ValueFunctionSS_Torpedo(double newValue1y = 1.0, double newValue2x = 0.333, double newValue2y = 0.5, double newValue3x = 0.667, double newValue3y = 1.0, double newValue4y = 0.0)
01063         :   ValueFunctionSmoothStroke(newValue1y, newValue2x, newValue2y, newValue3x, newValue3y, newValue4y) { if (!bMadeTable) { MakeTable(); bMadeTable = true; } };
01064 
01065     virtual ValueFunction *Clone(void) { ValueFunction *pClone = new ValueFunctionSS_Torpedo(Value1y, Value2x, Value2y, Value3x, Value3y, Value4y); return(pClone); };
01066     virtual ValueFunctionSmoothStroke *CreateInstance(void) { return(new ValueFunctionSS_Torpedo); };
01067     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SS_Torpedo); };
01068     static bool bMadeTable;
01069 };
01070 
01071 class ValueFunctionSS_Missile : public ValueFunctionSmoothStroke
01072 {
01073     CC_DECLARE_DYNAMIC(ValueFunctionSS_Missile);
01074 
01075 public:
01076     ValueFunctionSS_Missile(double newValue1y = 1.0, double newValue2x = 0.333, double newValue2y = 0.0, double newValue3x = 0.667, double newValue3y = 1.0, double newValue4y = 0.0)
01077         :   ValueFunctionSmoothStroke(newValue1y, newValue2x, newValue2y, newValue3x, newValue3y, newValue4y) { if (!bMadeTable) { MakeTable(); bMadeTable = true; } };
01078 
01079     virtual ValueFunction *Clone(void) { ValueFunction *pClone = new ValueFunctionSS_Missile(Value1y, Value2x, Value2y, Value3x, Value3y, Value4y); return(pClone); };
01080     virtual ValueFunctionSmoothStroke *CreateInstance(void) { return(new ValueFunctionSS_Missile); };
01081     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SS_Missile); };
01082     static bool bMadeTable;
01083 };
01084 
01085 class ValueFunctionSS_Convex : public ValueFunctionSmoothStroke
01086 {
01087     CC_DECLARE_DYNAMIC(ValueFunctionSS_Convex);
01088 
01089 public:
01090     ValueFunctionSS_Convex(double newValue1y = 1.0, double newValue2x = 0.55, double newValue2y = 1.3, double newValue3x = 0.667, double newValue3y = 0.4, double newValue4y = 0.33)
01091         :   ValueFunctionSmoothStroke(newValue1y, newValue2x, newValue2y, newValue3x, newValue3y, newValue4y) { if (!bMadeTable) { MakeTable(); bMadeTable = true; } };
01092 
01093     virtual ValueFunction *Clone(void) { ValueFunction *pClone = new ValueFunctionSS_Convex(Value1y, Value2x, Value2y, Value3x, Value3y, Value4y); return(pClone); };
01094     virtual ValueFunctionSmoothStroke *CreateInstance(void) { return(new ValueFunctionSS_Convex); };
01095     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SS_Convex); };
01096     static bool bMadeTable;
01097 };
01098 
01099 class ValueFunctionSS_Concave : public ValueFunctionSmoothStroke
01100 {
01101     CC_DECLARE_DYNAMIC(ValueFunctionSS_Concave);
01102 
01103 public:
01104     ValueFunctionSS_Concave(double newValue1y = 1.0, double newValue2x = 0.3, double newValue2y = 0.2, double newValue3x = 0.667, double newValue3y = 0.15, double newValue4y = 0.2)
01105         :   ValueFunctionSmoothStroke(newValue1y, newValue2x, newValue2y, newValue3x, newValue3y, newValue4y) { if (!bMadeTable) { MakeTable(); bMadeTable = true; } };
01106 
01107     virtual ValueFunction *Clone(void) { ValueFunction *pClone = new ValueFunctionSS_Concave(Value1y, Value2x, Value2y, Value3x, Value3y, Value4y); return(pClone); };
01108     virtual ValueFunctionSmoothStroke *CreateInstance(void) { return(new ValueFunctionSS_Concave); };
01109     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SS_Concave); };
01110     static bool bMadeTable;
01111 };
01112 
01113 
01114 
01115 
01116 class ValueFunctionSS_Cigar : public ValueFunctionSmoothStroke
01117 {
01118     CC_DECLARE_DYNAMIC(ValueFunctionSS_Cigar);
01119 
01120 public:
01121     ValueFunctionSS_Cigar(double newValue1y = 0.4, double newValue2x = 0.333, double newValue2y = 1.3, double newValue3x = 0.667, double newValue3y = 1.3, double newValue4y = 0.4)
01122         :   ValueFunctionSmoothStroke(newValue1y, newValue2x, newValue2y, newValue3x, newValue3y, newValue4y) { if (!bMadeTable) { MakeTable(); bMadeTable = true; } };
01123 
01124     virtual ValueFunction *Clone(void) { ValueFunction *pClone = new ValueFunctionSS_Cigar(Value1y, Value2x, Value2y, Value3x, Value3y, Value4y); return(pClone); };
01125     virtual ValueFunctionSmoothStroke *CreateInstance(void) { return(new ValueFunctionSS_Cigar); };
01126     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SS_Cigar); };
01127     static bool bMadeTable;
01128 };
01129 
01130 class ValueFunctionSS_Cigar2 : public ValueFunctionSmoothStroke
01131 {
01132     CC_DECLARE_DYNAMIC(ValueFunctionSS_Cigar2);
01133 
01134 public:
01135     ValueFunctionSS_Cigar2(double newValue1y = 0.4, double newValue2x = 0.333, double newValue2y = 1.0, double newValue3x = 0.667, double newValue3y = 1.0, double newValue4y = 0.4)
01136         :   ValueFunctionSmoothStroke(newValue1y, newValue2x, newValue2y, newValue3x, newValue3y, newValue4y) { if (!bMadeTable) { MakeTable(); bMadeTable = true; } };
01137 
01138     virtual ValueFunction *Clone(void) { ValueFunction *pClone = new ValueFunctionSS_Cigar2(Value1y, Value2x, Value2y, Value3x, Value3y, Value4y); return(pClone); };
01139     virtual ValueFunctionSmoothStroke *CreateInstance(void) { return(new ValueFunctionSS_Cigar2); };
01140     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SS_Cigar2); };
01141     static bool bMadeTable;
01142 };
01143 
01144 class ValueFunctionSS_Cigar3 : public ValueFunctionSmoothStroke
01145 {
01146     CC_DECLARE_DYNAMIC(ValueFunctionSS_Cigar3);
01147 
01148 public:
01149     ValueFunctionSS_Cigar3(double newValue1y = 0.4, double newValue2x = 0.333, double newValue2y = 0.7, double newValue3x = 0.667, double newValue3y = 0.7, double newValue4y = 0.4)
01150         :   ValueFunctionSmoothStroke(newValue1y, newValue2x, newValue2y, newValue3x, newValue3y, newValue4y) { if (!bMadeTable) { MakeTable(); bMadeTable = true; } };
01151 
01152     virtual ValueFunction *Clone(void) { ValueFunction *pClone = new ValueFunctionSS_Cigar3(Value1y, Value2x, Value2y, Value3x, Value3y, Value4y); return(pClone); };
01153     virtual ValueFunctionSmoothStroke *CreateInstance(void) { return(new ValueFunctionSS_Cigar3); };
01154     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SS_Cigar3); };
01155     static bool bMadeTable;
01156 };
01157 
01158 class ValueFunctionSS_SlimBlip : public ValueFunctionSmoothStroke
01159 {
01160     CC_DECLARE_DYNAMIC(ValueFunctionSS_SlimBlip);
01161 
01162 public:
01163     ValueFunctionSS_SlimBlip(double newValue1y = 0.0, double newValue2x = 0.15, double newValue2y = 1.2, double newValue3x = 0.85, double newValue3y = 1.2, double newValue4y = 0.0)
01164         :   ValueFunctionSmoothStroke(newValue1y, newValue2x, newValue2y, newValue3x, newValue3y, newValue4y) { if (!bMadeTable) { MakeTable(); bMadeTable = true; } };
01165 
01166     virtual ValueFunction *Clone(void) { ValueFunction *pClone = new ValueFunctionSS_SlimBlip(Value1y, Value2x, Value2y, Value3x, Value3y, Value4y); return(pClone); };
01167     virtual ValueFunctionSmoothStroke *CreateInstance(void) { return(new ValueFunctionSS_SlimBlip); };
01168     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SS_SlimBlip); };
01169     static bool bMadeTable;
01170 };
01171 
01172 class ValueFunctionSS_OceanLiner : public ValueFunctionSmoothStroke
01173 {
01174     CC_DECLARE_DYNAMIC(ValueFunctionSS_OceanLiner);
01175 
01176 public:
01177     ValueFunctionSS_OceanLiner(double newValue1y = 0.5, double newValue2x = 0.333, double newValue2y = 0.5, double newValue3x = 0.667, double newValue3y = 1.0, double newValue4y = 0.0)
01178         :   ValueFunctionSmoothStroke(newValue1y, newValue2x, newValue2y, newValue3x, newValue3y, newValue4y) { if (!bMadeTable) { MakeTable(); bMadeTable = true; } };
01179 
01180     virtual ValueFunction *Clone(void) { ValueFunction *pClone = new ValueFunctionSS_OceanLiner(Value1y, Value2x, Value2y, Value3x, Value3y, Value4y); return(pClone); };
01181     virtual ValueFunctionSmoothStroke *CreateInstance(void) { return(new ValueFunctionSS_OceanLiner); };
01182     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SS_OceanLiner); };
01183     static bool bMadeTable;
01184 };
01185 
01186 class ValueFunctionSS_Goldfish : public ValueFunctionSmoothStroke
01187 {
01188     CC_DECLARE_DYNAMIC(ValueFunctionSS_Goldfish);
01189 
01190 public:
01191     ValueFunctionSS_Goldfish(double newValue1y = 0.5, double newValue2x = 0.333, double newValue2y = 0.0, double newValue3x = 0.667, double newValue3y = 1.0, double newValue4y = 0.0)
01192         :   ValueFunctionSmoothStroke(newValue1y, newValue2x, newValue2y, newValue3x, newValue3y, newValue4y) { if (!bMadeTable) { MakeTable(); bMadeTable = true; } };
01193 
01194     virtual ValueFunction *Clone(void) { ValueFunction *pClone = new ValueFunctionSS_Goldfish(Value1y, Value2x, Value2y, Value3x, Value3y, Value4y); return(pClone); };
01195     virtual ValueFunctionSmoothStroke *CreateInstance(void) { return(new ValueFunctionSS_Goldfish); };
01196     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SS_Goldfish); };
01197     static bool bMadeTable;
01198 };
01199 
01200 class ValueFunctionSS_Barb : public ValueFunctionSmoothStroke
01201 {
01202     CC_DECLARE_DYNAMIC(ValueFunctionSS_Barb);
01203 
01204 public:
01205     ValueFunctionSS_Barb(double newValue1y = 0.5, double newValue2x = 0.333, double newValue2y = 1.0, double newValue3x = 0.667, double newValue3y = 0.5, double newValue4y = 0.0)
01206         :   ValueFunctionSmoothStroke(newValue1y, newValue2x, newValue2y, newValue3x, newValue3y, newValue4y) { if (!bMadeTable) { MakeTable(); bMadeTable = true; } };
01207 
01208     virtual ValueFunction *Clone(void) { ValueFunction *pClone = new ValueFunctionSS_Barb(Value1y, Value2x, Value2y, Value3x, Value3y, Value4y); return(pClone); };
01209     virtual ValueFunctionSmoothStroke *CreateInstance(void) { return(new ValueFunctionSS_Barb); };
01210     virtual ValueFunctionID GetUniqueID(void)   { return(ValueFunctionID_SS_Barb); };
01211     static bool bMadeTable;
01212 };
01213 
01214 
01215 #endif
01216 
01217 

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