cxfrect.cpp

Go to the documentation of this file.
00001 // $Id: cxfrect.cpp 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 /********************************************************************************************
00099 
00100 >   cxfrect.cpp
00101 
00102     Author:     Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
00103     Created:    04/06/96
00104     Purpose:    Importing and exporting code for rectangles to and from the new
00105                 file format.
00106     SeeAlso:    Class NodeRegularShape
00107 
00108 ********************************************************************************************/
00109 
00110 #include "camtypes.h"
00111 
00112 //#include "doccoord.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00113 //#include "paths.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00114 #include "nodershp.h"
00115 #include "cxftags.h"
00116 //#include "cxfdefs.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00117 //#include "camfiltr.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00118 #include "cxfile.h"
00119 //#include "cxfrec.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00120 #include "cxfrgshp.h"
00121 #include "cxfrect.h"
00122 
00123 /********************************************************************************************
00124 
00125 >   BOOL CXaraFileRectangle::WriteRectangle(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00126     BOOL CXaraFileRectangle::WriteRectangleSimple(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00127     BOOL CXaraFileRectangle::WriteRectangleSimpleReformed(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00128     BOOL CXaraFileRectangle::WriteRectangleSimpleStellated(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00129     BOOL CXaraFileRectangle::WriteRectangleSimpleStellatedReformed(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00130     BOOL CXaraFileRectangle::WriteRectangleSimpleRounded(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00131     BOOL CXaraFileRectangle::WriteRectangleSimpleRoundedReformed(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00132     BOOL CXaraFileRectangle::WriteRectangleSimpleRoundedStellated(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00133     BOOL CXaraFileRectangle::WriteRectangleSimpleRoundedStellatedReformed(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00134     BOOL CXaraFileRectangle::WriteRectangleComplex(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00135     BOOL CXaraFileRectangle::WriteRectangleComplexReformed(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00136     BOOL CXaraFileRectangle::WriteRectangleComplexStellated(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00137     BOOL CXaraFileRectangle::WriteRectangleComplexStellatedReformed(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00138     BOOL CXaraFileRectangle::WriteRectangleComplexRounded(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00139     BOOL CXaraFileRectangle::WriteRectangleComplexRoundedReformed(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00140     BOOL CXaraFileRectangle::WriteRectangleComplexRoundedStellated(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00141     BOOL CXaraFileRectangle::WriteRectangleComplexRoundedStellatedReformed(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00142 
00143     Author:     Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
00144     Created:    04/06/96
00145     Inputs:     pFilter - filter to use
00146                 pShape  - regular shape to save to filter
00147     Returns:    boolean value indicating success of writing record to filter
00148     Purpose:    Writes a regular shape record to the filter
00149 
00150 ********************************************************************************************/
00151 
00152 BOOL CXaraFileRectangle::WriteRectangle(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00153 {
00154     BOOL ok;
00155 
00156     // we need to determine how is rectangle has been altered, i.e. rotated, rounded, stellated
00157     // or reformed. using this information we jump to one of the following functions to write
00158     // the information out for us.
00159 
00160     const INT32 REFORMED    = 0x1;
00161     const INT32 STELLATED   = 0x2;
00162     const INT32 ROUNDED = 0x4;
00163     const INT32 COMPLEX = 0x8;
00164 
00165     INT32 RectangleType = 0;
00166 
00167     if (IsReformed(pShape)) RectangleType |= REFORMED;
00168     if (IsStellated(pShape)) RectangleType |= STELLATED;
00169     if (IsRounded(pShape)) RectangleType |= ROUNDED;
00170     if (IsComplex(pShape)) RectangleType |= COMPLEX;
00171 
00172     switch (RectangleType)
00173     {
00174         case 0                                  : ok = WriteRectangleSimple(pFilter, pShape); break;
00175         case REFORMED                           : ok = WriteRectangleSimpleReformed(pFilter, pShape); break;
00176         case STELLATED                          : ok = WriteRectangleSimpleStellated(pFilter, pShape); break;
00177         case STELLATED|REFORMED                 : ok = WriteRectangleSimpleStellatedReformed(pFilter, pShape); break;
00178         case ROUNDED                            : ok = WriteRectangleSimpleRounded(pFilter, pShape); break;
00179         case ROUNDED|REFORMED                   : ok = WriteRectangleSimpleRoundedReformed(pFilter, pShape); break;
00180         case ROUNDED|STELLATED                  : ok = WriteRectangleSimpleRoundedStellated(pFilter, pShape); break;
00181         case ROUNDED|STELLATED|REFORMED         : ok = WriteRectangleSimpleRoundedStellatedReformed(pFilter, pShape); break;
00182         case COMPLEX                            : ok = WriteRectangleComplex(pFilter, pShape); break;
00183         case COMPLEX|REFORMED                   : ok = WriteRectangleComplexReformed(pFilter, pShape); break;
00184         case COMPLEX|STELLATED                  : ok = WriteRectangleComplexStellated(pFilter, pShape); break;
00185         case COMPLEX|STELLATED|REFORMED         : ok = WriteRectangleComplexStellatedReformed(pFilter, pShape); break;
00186         case COMPLEX|ROUNDED                    : ok = WriteRectangleComplexRounded(pFilter, pShape); break;
00187         case COMPLEX|ROUNDED|REFORMED           : ok = WriteRectangleComplexRoundedReformed(pFilter, pShape); break;
00188         case COMPLEX|ROUNDED|STELLATED          : ok = WriteRectangleComplexRoundedStellated(pFilter, pShape); break;
00189         case COMPLEX|ROUNDED|STELLATED|REFORMED : ok = WriteRectangleComplexRoundedStellatedReformed(pFilter, pShape); break;
00190         default                                 : ok = WriteShapeInvalid(pFilter, pShape); break;
00191     }
00192 
00193     return ok;
00194 }
00195 
00196 BOOL CXaraFileRectangle::WriteRectangleSimple(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00197 {
00198     BOOL ok;
00199 
00200     CamelotFileRecord Rec(pFilter,TAG_RECTANGLE_SIMPLE, TAG_RECTANGLE_SIMPLE_SIZE);
00201 
00202     ok = Rec.Init();
00203     if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape));
00204     if (ok) ok = Rec.WriteINT32(GetWidth(pShape));
00205     if (ok) ok = Rec.WriteINT32(GetHeight(pShape));
00206     if (ok) ok = pFilter->Write(&Rec);
00207 
00208     return ok;
00209 }
00210 
00211 BOOL CXaraFileRectangle::WriteRectangleSimpleReformed(BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
00212 {
00213     BOOL ok;
00214 
00215     CamelotFileRecord Rec(pFilter,TAG_RECTANGLE_SIMPLE_REFORMED, TAG_RECTANGLE_SIMPLE_REFORMED_SIZE);
00216 
00217     ok = Rec.Init();
00218     if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape));
00219     if (ok) ok = Rec.WriteINT32(GetWidth(pShape));
00220     if (ok) ok = Rec.WriteINT32(GetHeight(pShape));
00221     if (ok) ok = Rec.WritePath(GetEdgePath(pShape));
00222     if (ok) ok = pFilter->Write(&Rec);
00223 
00224     return ok;
00225 }
00226     
00227 BOOL CXaraFileRectangle::WriteRectangleSimpleStellated(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00228 {
00229     BOOL ok;
00230 
00231     CamelotFileRecord Rec(pFilter,TAG_RECTANGLE_SIMPLE_STELLATED, TAG_RECTANGLE_SIMPLE_STELLATED_SIZE);
00232 
00233     ok = Rec.Init();
00234     if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape));
00235     if (ok) ok = Rec.WriteINT32(GetWidth(pShape));
00236     if (ok) ok = Rec.WriteINT32(GetHeight(pShape));
00237     if (ok) ok = Rec.WriteDOUBLE(GetStellationRadius(pShape));
00238     if (ok) ok = Rec.WriteDOUBLE(GetStellationOffset(pShape));
00239     if (ok) ok = pFilter->Write(&Rec);
00240 
00241     return ok;
00242 }
00243 
00244 BOOL CXaraFileRectangle::WriteRectangleSimpleStellatedReformed(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00245 {
00246     BOOL ok;
00247 
00248     CamelotFileRecord Rec(pFilter,TAG_RECTANGLE_SIMPLE_STELLATED_REFORMED, TAG_RECTANGLE_SIMPLE_STELLATED_REFORMED_SIZE);
00249 
00250     ok = Rec.Init();
00251     if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape));
00252     if (ok) ok = Rec.WriteINT32(GetWidth(pShape));
00253     if (ok) ok = Rec.WriteINT32(GetHeight(pShape));
00254     if (ok) ok = Rec.WriteDOUBLE(GetStellationRadius(pShape));
00255     if (ok) ok = Rec.WriteDOUBLE(GetStellationOffset(pShape));
00256     if (ok) ok = Rec.WritePath(GetPrimaryEdgePath(pShape));
00257     if (ok) ok = Rec.WritePath(GetSecondaryEdgePath(pShape));
00258     if (ok) ok = pFilter->Write(&Rec);
00259 
00260     return ok;
00261 }
00262 
00263 BOOL CXaraFileRectangle::WriteRectangleSimpleRounded(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00264 {
00265     BOOL ok;
00266 
00267     CamelotFileRecord Rec(pFilter,TAG_RECTANGLE_SIMPLE_ROUNDED, TAG_RECTANGLE_SIMPLE_ROUNDED_SIZE);
00268 
00269     ok = Rec.Init();
00270     if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape));
00271     if (ok) ok = Rec.WriteINT32(GetWidth(pShape));
00272     if (ok) ok = Rec.WriteINT32(GetHeight(pShape));
00273     if (ok) ok = Rec.WriteDOUBLE(GetCurvature(pShape));
00274     if (ok) ok = pFilter->Write(&Rec);
00275 
00276     return ok;
00277 }
00278 
00279 BOOL CXaraFileRectangle::WriteRectangleSimpleRoundedReformed(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00280 {
00281     BOOL ok;
00282 
00283     CamelotFileRecord Rec(pFilter,TAG_RECTANGLE_SIMPLE_ROUNDED_REFORMED, TAG_RECTANGLE_SIMPLE_ROUNDED_REFORMED_SIZE);
00284 
00285     ok = Rec.Init();
00286     if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape));
00287     if (ok) ok = Rec.WriteINT32(GetWidth(pShape));
00288     if (ok) ok = Rec.WriteINT32(GetHeight(pShape));
00289     if (ok) ok = Rec.WriteDOUBLE(GetCurvature(pShape));
00290     if (ok) ok = Rec.WritePath(GetEdgePath(pShape));
00291     if (ok) ok = pFilter->Write(&Rec);
00292 
00293     return ok;
00294 }
00295 
00296 BOOL CXaraFileRectangle::WriteRectangleSimpleRoundedStellated(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00297 {
00298     BOOL ok;
00299 
00300     CamelotFileRecord Rec(pFilter,TAG_RECTANGLE_SIMPLE_ROUNDED_STELLATED, TAG_RECTANGLE_SIMPLE_ROUNDED_STELLATED_SIZE);
00301 
00302     ok = Rec.Init();
00303     if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape));
00304     if (ok) ok = Rec.WriteINT32(GetWidth(pShape));
00305     if (ok) ok = Rec.WriteINT32(GetHeight(pShape));
00306     if (ok) ok = Rec.WriteDOUBLE(GetStellationRadius(pShape));
00307     if (ok) ok = Rec.WriteDOUBLE(GetStellationOffset(pShape));
00308     if (ok) ok = Rec.WriteDOUBLE(GetPrimaryCurvature(pShape));
00309     if (ok) ok = Rec.WriteDOUBLE(GetSecondaryCurvature(pShape));
00310     if (ok) ok = pFilter->Write(&Rec);
00311 
00312     return ok;
00313 }
00314 
00315 BOOL CXaraFileRectangle::WriteRectangleSimpleRoundedStellatedReformed(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00316 {
00317     BOOL ok;
00318 
00319     CamelotFileRecord Rec(pFilter,TAG_RECTANGLE_SIMPLE_ROUNDED_STELLATED_REFORMED, TAG_RECTANGLE_SIMPLE_ROUNDED_STELLATED_REFORMED_SIZE);
00320 
00321     ok = Rec.Init();
00322     if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape));
00323     if (ok) ok = Rec.WriteINT32(GetWidth(pShape));
00324     if (ok) ok = Rec.WriteINT32(GetHeight(pShape));
00325     if (ok) ok = Rec.WriteDOUBLE(GetStellationRadius(pShape));
00326     if (ok) ok = Rec.WriteDOUBLE(GetStellationOffset(pShape));
00327     if (ok) ok = Rec.WriteDOUBLE(GetPrimaryCurvature(pShape));
00328     if (ok) ok = Rec.WriteDOUBLE(GetSecondaryCurvature(pShape));
00329     if (ok) ok = Rec.WritePath(GetPrimaryEdgePath(pShape));
00330     if (ok) ok = Rec.WritePath(GetSecondaryEdgePath(pShape));
00331     if (ok) ok = pFilter->Write(&Rec);
00332 
00333     return ok;
00334 }
00335 
00336 BOOL CXaraFileRectangle::WriteRectangleComplex(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00337 {
00338     BOOL ok;
00339 
00340     CamelotFileRecord Rec(pFilter,TAG_RECTANGLE_COMPLEX, TAG_RECTANGLE_COMPLEX_SIZE);
00341 
00342     ok = Rec.Init();
00343     if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape));
00344     if (ok) ok = Rec.WriteCoordTrans(GetMajorAxis(pShape),0,0);
00345     if (ok) ok = Rec.WriteCoordTrans(GetMinorAxis(pShape),0,0);
00346     if (ok) ok = pFilter->Write(&Rec);
00347 
00348     return ok;
00349 }
00350 
00351 BOOL CXaraFileRectangle::WriteRectangleComplexReformed(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00352 {
00353     BOOL ok;
00354 
00355     CamelotFileRecord Rec(pFilter,TAG_RECTANGLE_COMPLEX_REFORMED, TAG_RECTANGLE_COMPLEX_REFORMED_SIZE);
00356 
00357     ok = Rec.Init();
00358     if (ok) ok = Rec.WriteCoordTrans(GetUTMajorAxis(pShape),0,0);
00359     if (ok) ok = Rec.WriteCoordTrans(GetUTMinorAxis(pShape),0,0);
00360     if (ok) ok = Rec.WriteMatrix(GetTransformMatrix(pShape));
00361     if (ok) ok = Rec.WritePath(GetEdgePath(pShape));
00362     if (ok) ok = pFilter->Write(&Rec);
00363 
00364     return ok;
00365 }
00366 
00367 BOOL CXaraFileRectangle::WriteRectangleComplexStellated(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00368 {
00369     BOOL ok;
00370 
00371     CamelotFileRecord Rec(pFilter,TAG_RECTANGLE_COMPLEX_STELLATED, TAG_RECTANGLE_COMPLEX_STELLATED_SIZE);
00372 
00373     ok = Rec.Init();
00374     if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape));
00375     if (ok) ok = Rec.WriteCoordTrans(GetMajorAxis(pShape),0,0);
00376     if (ok) ok = Rec.WriteCoordTrans(GetMinorAxis(pShape),0,0);
00377     if (ok) ok = Rec.WriteDOUBLE(GetStellationRadius(pShape));
00378     if (ok) ok = Rec.WriteDOUBLE(GetStellationOffset(pShape));
00379     if (ok) ok = pFilter->Write(&Rec);
00380 
00381     return ok;
00382 }
00383 
00384 BOOL CXaraFileRectangle::WriteRectangleComplexStellatedReformed(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00385 {
00386     BOOL ok;
00387 
00388     CamelotFileRecord Rec(pFilter,TAG_RECTANGLE_COMPLEX_STELLATED_REFORMED, TAG_RECTANGLE_COMPLEX_STELLATED_REFORMED_SIZE);
00389 
00390     ok = Rec.Init();
00391     if (ok) ok = Rec.WriteCoordTrans(GetUTMajorAxis(pShape),0,0);
00392     if (ok) ok = Rec.WriteCoordTrans(GetUTMinorAxis(pShape),0,0);
00393     if (ok) ok = Rec.WriteMatrix(GetTransformMatrix(pShape));
00394     if (ok) ok = Rec.WriteDOUBLE(GetStellationRadius(pShape));
00395     if (ok) ok = Rec.WriteDOUBLE(GetStellationOffset(pShape));
00396     if (ok) ok = Rec.WritePath(GetPrimaryEdgePath(pShape));
00397     if (ok) ok = Rec.WritePath(GetSecondaryEdgePath(pShape));
00398     if (ok) ok = pFilter->Write(&Rec);
00399 
00400     return ok;
00401 }
00402 
00403 BOOL CXaraFileRectangle::WriteRectangleComplexRounded(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00404 {
00405     BOOL ok;
00406 
00407     CamelotFileRecord Rec(pFilter,TAG_RECTANGLE_COMPLEX_ROUNDED, TAG_RECTANGLE_COMPLEX_ROUNDED_SIZE);
00408 
00409     ok = Rec.Init();
00410     if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape));
00411     if (ok) ok = Rec.WriteCoordTrans(GetMajorAxis(pShape),0,0);
00412     if (ok) ok = Rec.WriteCoordTrans(GetMinorAxis(pShape),0,0);
00413     if (ok) ok = Rec.WriteDOUBLE(GetCurvature(pShape));
00414     if (ok) ok = pFilter->Write(&Rec);
00415 
00416     return ok;
00417 }
00418 
00419 BOOL CXaraFileRectangle::WriteRectangleComplexRoundedReformed(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00420 {
00421     BOOL ok;
00422 
00423     CamelotFileRecord Rec(pFilter,TAG_RECTANGLE_COMPLEX_ROUNDED_REFORMED, TAG_RECTANGLE_COMPLEX_ROUNDED_REFORMED_SIZE);
00424 
00425     ok = Rec.Init();
00426     if (ok) ok = Rec.WriteCoordTrans(GetUTMajorAxis(pShape),0,0);
00427     if (ok) ok = Rec.WriteCoordTrans(GetUTMinorAxis(pShape),0,0);
00428     if (ok) ok = Rec.WriteMatrix(GetTransformMatrix(pShape));
00429     if (ok) ok = Rec.WriteDOUBLE(GetCurvature(pShape));
00430     if (ok) ok = Rec.WritePath(GetEdgePath(pShape));
00431     if (ok) ok = pFilter->Write(&Rec);
00432 
00433     return ok;
00434 }
00435 
00436 BOOL CXaraFileRectangle::WriteRectangleComplexRoundedStellated(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00437 {
00438     BOOL ok;
00439 
00440     CamelotFileRecord Rec(pFilter,TAG_RECTANGLE_COMPLEX_ROUNDED_STELLATED, TAG_RECTANGLE_COMPLEX_ROUNDED_STELLATED_SIZE);
00441 
00442     ok = Rec.Init();
00443     if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape));
00444     if (ok) ok = Rec.WriteCoordTrans(GetMajorAxis(pShape),0,0);
00445     if (ok) ok = Rec.WriteCoordTrans(GetMinorAxis(pShape),0,0);
00446     if (ok) ok = Rec.WriteDOUBLE(GetStellationRadius(pShape));
00447     if (ok) ok = Rec.WriteDOUBLE(GetStellationOffset(pShape));
00448     if (ok) ok = Rec.WriteDOUBLE(GetPrimaryCurvature(pShape));
00449     if (ok) ok = Rec.WriteDOUBLE(GetSecondaryCurvature(pShape));
00450     if (ok) ok = pFilter->Write(&Rec);
00451 
00452     return ok;
00453 }
00454 
00455 BOOL CXaraFileRectangle::WriteRectangleComplexRoundedStellatedReformed(BaseCamelotFilter * pFilter, NodeRegularShape * pShape)
00456 {
00457     BOOL ok;
00458 
00459     CamelotFileRecord Rec(pFilter,TAG_RECTANGLE_COMPLEX_ROUNDED_STELLATED_REFORMED, TAG_RECTANGLE_COMPLEX_ROUNDED_STELLATED_REFORMED_SIZE);
00460 
00461     ok = Rec.Init();
00462     if (ok) ok = Rec.WriteCoordTrans(GetUTMajorAxis(pShape),0,0);
00463     if (ok) ok = Rec.WriteCoordTrans(GetUTMinorAxis(pShape),0,0);
00464     if (ok) ok = Rec.WriteMatrix(GetTransformMatrix(pShape));
00465     if (ok) ok = Rec.WriteDOUBLE(GetStellationRadius(pShape));
00466     if (ok) ok = Rec.WriteDOUBLE(GetStellationOffset(pShape));
00467     if (ok) ok = Rec.WriteDOUBLE(GetPrimaryCurvature(pShape));
00468     if (ok) ok = Rec.WriteDOUBLE(GetSecondaryCurvature(pShape));
00469     if (ok) ok = Rec.WritePath(GetPrimaryEdgePath(pShape));
00470     if (ok) ok = Rec.WritePath(GetSecondaryEdgePath(pShape));
00471     if (ok) ok = pFilter->Write(&Rec);
00472 
00473     return ok;
00474 }
00475 

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