CXaraFileRectangle Class Reference

Abstract lass holding exporting code for rectangles in the new file formatAbstract class holding exporting code for rectangles for the new file format. More...

#include <cxfrect.h>

Inheritance diagram for CXaraFileRectangle:

CXaraFileRegularShape List of all members.

Static Public Member Functions

static BOOL WriteRectangle (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
 Importing and exporting code for rectangles to and from the new file format. Writes a regular shape record to the filter.
static BOOL WriteRectangleSimple (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WriteRectangleSimpleReformed (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WriteRectangleSimpleStellated (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WriteRectangleSimpleStellatedReformed (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WriteRectangleSimpleRounded (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WriteRectangleSimpleRoundedReformed (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WriteRectangleSimpleRoundedStellated (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WriteRectangleSimpleRoundedStellatedReformed (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WriteRectangleComplex (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WriteRectangleComplexReformed (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WriteRectangleComplexStellated (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WriteRectangleComplexStellatedReformed (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WriteRectangleComplexRounded (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WriteRectangleComplexRoundedReformed (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WriteRectangleComplexRoundedStellated (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WriteRectangleComplexRoundedStellatedReformed (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)

Detailed Description

Abstract lass holding exporting code for rectangles in the new file formatAbstract class holding exporting code for rectangles for the new file format.

Author:
Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
Date:
04/06/96 Base Class: CXaraFileRegularShape
See also:
class NodeRe

Definition at line 123 of file cxfrect.h.


Member Function Documentation

BOOL CXaraFileRectangle::WriteRectangle BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Importing and exporting code for rectangles to and from the new file format. Writes a regular shape record to the filter.

Author:
Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
Date:
04/06/96
Parameters:
pFilter - filter to use [INPUTS] pShape - regular shape to save to filter
Returns:
boolean value indicating success of writing record to filter

Definition at line 152 of file cxfrect.cpp.

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 }

BOOL CXaraFileRectangle::WriteRectangleComplex BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 336 of file cxfrect.cpp.

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 }

BOOL CXaraFileRectangle::WriteRectangleComplexReformed BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 351 of file cxfrect.cpp.

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 }

BOOL CXaraFileRectangle::WriteRectangleComplexRounded BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 403 of file cxfrect.cpp.

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 }

BOOL CXaraFileRectangle::WriteRectangleComplexRoundedReformed BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 419 of file cxfrect.cpp.

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 }

BOOL CXaraFileRectangle::WriteRectangleComplexRoundedStellated BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 436 of file cxfrect.cpp.

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 }

BOOL CXaraFileRectangle::WriteRectangleComplexRoundedStellatedReformed BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 455 of file cxfrect.cpp.

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 }

BOOL CXaraFileRectangle::WriteRectangleComplexStellated BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 367 of file cxfrect.cpp.

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 }

BOOL CXaraFileRectangle::WriteRectangleComplexStellatedReformed BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 384 of file cxfrect.cpp.

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 }

BOOL CXaraFileRectangle::WriteRectangleSimple BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 196 of file cxfrect.cpp.

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 }

BOOL CXaraFileRectangle::WriteRectangleSimpleReformed BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 211 of file cxfrect.cpp.

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 }

BOOL CXaraFileRectangle::WriteRectangleSimpleRounded BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 263 of file cxfrect.cpp.

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 }

BOOL CXaraFileRectangle::WriteRectangleSimpleRoundedReformed BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 279 of file cxfrect.cpp.

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 }

BOOL CXaraFileRectangle::WriteRectangleSimpleRoundedStellated BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 296 of file cxfrect.cpp.

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 }

BOOL CXaraFileRectangle::WriteRectangleSimpleRoundedStellatedReformed BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 315 of file cxfrect.cpp.

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 }

BOOL CXaraFileRectangle::WriteRectangleSimpleStellated BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 227 of file cxfrect.cpp.

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 }

BOOL CXaraFileRectangle::WriteRectangleSimpleStellatedReformed BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 244 of file cxfrect.cpp.

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 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:53:25 2007 for Camelot by  doxygen 1.4.4