ai_grad.h

Go to the documentation of this file.
00001 // $Id: ai_grad.h 751 2006-03-31 15:43:49Z alex $
00002 // ai_grad.h: interface for the AIGradientProcessor class.
00003 //
00005 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00006 ================================XARAHEADERSTART===========================
00007  
00008                Xara LX, a vector drawing and manipulation program.
00009                     Copyright (C) 1993-2006 Xara Group Ltd.
00010        Copyright on certain contributions may be held in joint with their
00011               respective authors. See AUTHORS file for details.
00012 
00013 LICENSE TO USE AND MODIFY SOFTWARE
00014 ----------------------------------
00015 
00016 This file is part of Xara LX.
00017 
00018 Xara LX is free software; you can redistribute it and/or modify it
00019 under the terms of the GNU General Public License version 2 as published
00020 by the Free Software Foundation.
00021 
00022 Xara LX and its component source files are distributed in the hope
00023 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00024 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00025 See the GNU General Public License for more details.
00026 
00027 You should have received a copy of the GNU General Public License along
00028 with Xara LX (see the file GPL in the root directory of the
00029 distribution); if not, write to the Free Software Foundation, Inc., 51
00030 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00031 
00032 
00033 ADDITIONAL RIGHTS
00034 -----------------
00035 
00036 Conditional upon your continuing compliance with the GNU General Public
00037 License described above, Xara Group Ltd grants to you certain additional
00038 rights. 
00039 
00040 The additional rights are to use, modify, and distribute the software
00041 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00042 library and any other such library that any version of Xara LX relased
00043 by Xara Group Ltd requires in order to compile and execute, including
00044 the static linking of that library to XaraLX. In the case of the
00045 "CDraw" library, you may satisfy obligation under the GNU General Public
00046 License to provide source code by providing a binary copy of the library
00047 concerned and a copy of the license accompanying it.
00048 
00049 Nothing in this section restricts any of the rights you have under
00050 the GNU General Public License.
00051 
00052 
00053 SCOPE OF LICENSE
00054 ----------------
00055 
00056 This license applies to this program (XaraLX) and its constituent source
00057 files only, and does not necessarily apply to other Xara products which may
00058 in part share the same code base, and are subject to their own licensing
00059 terms.
00060 
00061 This license does not apply to files in the wxXtra directory, which
00062 are built into a separate library, and are subject to the wxWindows
00063 license contained within that directory in the file "WXXTRA-LICENSE".
00064 
00065 This license does not apply to the binary libraries (if any) within
00066 the "libs" directory, which are subject to a separate license contained
00067 within that directory in the file "LIBS-LICENSE".
00068 
00069 
00070 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00071 ----------------------------------------------
00072 
00073 Subject to the terms of the GNU Public License (see above), you are
00074 free to do whatever you like with your modifications. However, you may
00075 (at your option) wish contribute them to Xara's source tree. You can
00076 find details of how to do this at:
00077   http://www.xaraxtreme.org/developers/
00078 
00079 Prior to contributing your modifications, you will need to complete our
00080 contributor agreement. This can be found at:
00081   http://www.xaraxtreme.org/developers/contribute/
00082 
00083 Please note that Xara will not accept modifications which modify any of
00084 the text between the start and end of this header (marked
00085 XARAHEADERSTART and XARAHEADEREND).
00086 
00087 
00088 MARKS
00089 -----
00090 
00091 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00092 designs are registered or unregistered trademarks, design-marks, and/or
00093 service marks of Xara Group Ltd. All rights in these marks are reserved.
00094 
00095 
00096       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00097                         http://www.xara.com/
00098 
00099 =================================XARAHEADEREND============================
00100  */
00101 
00102 #if !defined(AFX_AI_GRAD_H__CFD00AD1_0547_11D4_836F_006008484641__INCLUDED_)
00103 #define AFX_AI_GRAD_H__CFD00AD1_0547_11D4_836F_006008484641__INCLUDED_
00104 
00105 class AI5EPSFilter;
00106 class ColourRamp;
00107 
00108 
00109 /********************************************************************************************
00110 
00111 >   class AIHighlight
00112 
00113     Author:     Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
00114     Created:    28/03/00
00115     Purpose:    Helps with the import of Adobe Illustrator 8.0 files.
00116                 Holds the definition of a highlight to be used in subsequent fills.
00117                 (not interpreted at present)
00118 
00119 ********************************************************************************************/
00120 class AIHighlight
00121 {
00122 public:
00123     AIHighlight( const INT32 nAngle, const double& dLength, const DocCoord& hilight ) :
00124         mnAngle(nAngle), mdLength(dLength), mHilight(hilight)
00125     {}
00126 
00127     INT32       mnAngle;
00128     double      mdLength;
00129     DocCoord    mHilight;
00130 };
00131 
00132 
00133 /********************************************************************************************
00134 
00135 >   class AI5Gradient : public ListItem
00136 
00137     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00138     Created:    12/08/94
00139     Purpose:    Used to hold the definition of an Illustrator 5 gradient fill, while we
00140                 are importing an AI5 file.
00141     SeeAlso:    AI5EPSFilter
00142 
00143 ********************************************************************************************/
00144 
00145 class AI5Gradient : public ListItem
00146 {
00147 public:
00148     String_64       Name;
00149     BOOL            IsRadial;
00150     DocColour       StartColour;
00151     DocColour       EndColour;
00152     ColourRamp*     mpCurrentRamp;
00153     AIHighlight*    mpHighlight;
00154     INT32           midPoint;
00155 
00156 public:
00157     AI5Gradient();
00158     virtual ~AI5Gradient();
00159 };
00160 
00161 
00162 /********************************************************************************************
00163 
00164 >   class AIGradientProcessor  
00165 
00166     Author:     Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
00167     Created:    28/03/00
00168     Purpose:    Helps with the import of Adobe Illustrator 8.0 files.
00169                 (at the time of writing only the version 7.0 documentation was available
00170                 so some omissions are inevitable).
00171                 It creates a list gradient fills and allows the filter to extract them.
00172 
00173 ********************************************************************************************/
00174 class AIGradientProcessor  
00175 {
00176 public:
00177     AIGradientProcessor();
00178     virtual ~AIGradientProcessor();
00179 
00180     BOOL BeginGradient();
00181     BOOL DecodeBd( AI5EPSFilter& filter );
00182     BOOL DecodeBS( AI5EPSFilter& filter );
00183     BOOL DecodeBh( AI5EPSFilter& filter );
00184     BOOL EndGradient( AI5EPSFilter& filter );
00185 
00186     AI5Gradient* FindGradient( const StringBase& name );
00187 private:
00188 
00189     BOOL Approx (const double & d1, const double & d2);
00190 
00191     // The list of imported grad fills
00192     List            mGradFills;
00193 
00194     // Used to indicsate if we found any gradient fills too complex to handle properly.
00195     BOOL            mbGradFillTooComplex;
00196 
00197     // The grad fill we are currently reading in (if any)
00198     AI5Gradient*    mpCurrentFill;
00199 
00200     // (ChrisG 3/4/2001) The midpoint for the fill (used to set the bias). Since Xara X
00201     //  profiling is for the entire fill, not individual points, this will; just be the
00202     //  first valid value read in.
00203     INT32           mMidPoint;
00204     INT32           mLastRampPoint;
00205 };
00206 
00207 #endif // !defined(AFX_AI_GRAD_H__CFD00AD1_0547_11D4_836F_006008484641__INCLUDED_)

Generated on Sat Nov 10 03:44:09 2007 for Camelot by  doxygen 1.4.4