CXaraFilePolygon Class Reference

Abstract class holding exporting code for polygons in the new file formatAbstract class holding exporting code for polygon for the new file format. More...

#include <cxfpoly.h>

Inheritance diagram for CXaraFilePolygon:

CXaraFileRegularShape List of all members.

Static Public Member Functions

static BOOL WritePolygon (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
 Importing and exporting code for polygons to and from the new file format. Writes a polygon record to the filter.
static BOOL WritePolygonComplex (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WritePolygonComplexReformed (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WritePolygonComplexStellated (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WritePolygonComplexStellatedReformed (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WritePolygonComplexRounded (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WritePolygonComplexRoundedReformed (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WritePolygonComplexRoundedStellated (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)
static BOOL WritePolygonComplexRoundedStellatedReformed (BaseCamelotFilter *pFilter, NodeRegularShape *pShape)

Detailed Description

Abstract class holding exporting code for polygons in the new file formatAbstract class holding exporting code for polygon for the new file format.

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

Definition at line 123 of file cxfpoly.h.


Member Function Documentation

BOOL CXaraFilePolygon::WritePolygon BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Importing and exporting code for polygons to and from the new file format. Writes a polygon record to the filter.

Author:
Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/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 144 of file cxfpoly.cpp.

00145 {
00146     BOOL ok;
00147 
00148     // we need to determine how is polygon has been altered, i.e. rotated, rounded, stellated
00149     // or reformed. using this information we jump to one of the following functions to write
00150     // the information out for us.
00151 
00152     const INT32 REFORMED    = 0x1;
00153     const INT32 STELLATED   = 0x2;
00154     const INT32 ROUNDED = 0x4;
00155 
00156     INT32 PolygonType = 0;
00157 
00158     if (IsReformed(pShape)) PolygonType |= REFORMED;
00159     if (IsStellated(pShape)) PolygonType |= STELLATED;
00160     if (IsRounded(pShape)) PolygonType |= ROUNDED;
00161 
00162     switch (PolygonType)
00163     {
00164         case 0                          : ok = WritePolygonComplex(pFilter, pShape); break;
00165         case REFORMED                   : ok = WritePolygonComplexReformed(pFilter, pShape); break;
00166         case STELLATED                  : ok = WritePolygonComplexStellated(pFilter, pShape); break;
00167         case STELLATED|REFORMED         : ok = WritePolygonComplexStellatedReformed(pFilter, pShape); break;
00168         case ROUNDED                    : ok = WritePolygonComplexRounded(pFilter, pShape); break;
00169         case ROUNDED|REFORMED           : ok = WritePolygonComplexRoundedReformed(pFilter, pShape); break;
00170         case ROUNDED|STELLATED          : ok = WritePolygonComplexRoundedStellated(pFilter, pShape); break;
00171         case ROUNDED|STELLATED|REFORMED : ok = WritePolygonComplexRoundedStellatedReformed(pFilter, pShape); break;
00172         default                         : ok = WriteShapeInvalid(pFilter, pShape); break;
00173     }
00174 
00175     return ok;
00176 }

BOOL CXaraFilePolygon::WritePolygonComplex BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 178 of file cxfpoly.cpp.

00179 {
00180     BOOL ok;
00181 
00182     CamelotFileRecord Rec(pFilter,TAG_POLYGON_COMPLEX, TAG_POLYGON_COMPLEX_SIZE);
00183 
00184     ok = Rec.Init();
00185     if (ok) ok = Rec.WriteUINT16(GetNumberOfSides(pShape));
00186     if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape));
00187     if (ok) ok = Rec.WriteCoordTrans(GetMajorAxis(pShape),0,0);
00188     if (ok) ok = Rec.WriteCoordTrans(GetMinorAxis(pShape),0,0);
00189     if (ok) ok = pFilter->Write(&Rec);
00190 
00191     return ok;
00192 }

BOOL CXaraFilePolygon::WritePolygonComplexReformed BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 194 of file cxfpoly.cpp.

00195 {
00196     BOOL ok;
00197 
00198     CamelotFileRecord Rec(pFilter,TAG_POLYGON_COMPLEX_REFORMED, TAG_POLYGON_COMPLEX_REFORMED_SIZE);
00199 
00200     ok = Rec.Init();
00201     if (ok) ok = Rec.WriteUINT16(GetNumberOfSides(pShape));
00202     if (ok) ok = Rec.WriteCoordTrans(GetUTMajorAxis(pShape),0,0);
00203     if (ok) ok = Rec.WriteCoordTrans(GetUTMinorAxis(pShape),0,0);
00204     if (ok) ok = Rec.WriteMatrix(GetTransformMatrix(pShape));
00205     if (ok) ok = Rec.WritePath(GetEdgePath(pShape));
00206     if (ok) ok = pFilter->Write(&Rec);
00207 
00208     return ok;
00209 }

BOOL CXaraFilePolygon::WritePolygonComplexRounded BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 249 of file cxfpoly.cpp.

00250 {
00251     BOOL ok;
00252 
00253     CamelotFileRecord Rec(pFilter,TAG_POLYGON_COMPLEX_ROUNDED, TAG_POLYGON_COMPLEX_ROUNDED_SIZE);
00254 
00255     ok = Rec.Init();
00256     if (ok) ok = Rec.WriteUINT16(GetNumberOfSides(pShape));
00257     if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape));
00258     if (ok) ok = Rec.WriteCoordTrans(GetMajorAxis(pShape),0,0);
00259     if (ok) ok = Rec.WriteCoordTrans(GetMinorAxis(pShape),0,0);
00260     if (ok) ok = Rec.WriteDOUBLE(GetCurvature(pShape));
00261     if (ok) ok = pFilter->Write(&Rec);
00262 
00263     return ok;
00264 }

BOOL CXaraFilePolygon::WritePolygonComplexRoundedReformed BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 266 of file cxfpoly.cpp.

00267 {
00268     BOOL ok;
00269 
00270     CamelotFileRecord Rec(pFilter,TAG_POLYGON_COMPLEX_ROUNDED_REFORMED, TAG_POLYGON_COMPLEX_ROUNDED_REFORMED_SIZE);
00271 
00272     ok = Rec.Init();
00273     if (ok) ok = Rec.WriteUINT16(GetNumberOfSides(pShape));
00274     if (ok) ok = Rec.WriteCoordTrans(GetUTMajorAxis(pShape),0,0);
00275     if (ok) ok = Rec.WriteCoordTrans(GetUTMinorAxis(pShape),0,0);
00276     if (ok) ok = Rec.WriteMatrix(GetTransformMatrix(pShape));
00277     if (ok) ok = Rec.WriteDOUBLE(GetCurvature(pShape));
00278     if (ok) ok = Rec.WritePath(GetEdgePath(pShape));
00279     if (ok) ok = pFilter->Write(&Rec);
00280 
00281     return ok;
00282 }

BOOL CXaraFilePolygon::WritePolygonComplexRoundedStellated BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 284 of file cxfpoly.cpp.

00285 {
00286     BOOL ok;
00287 
00288     CamelotFileRecord Rec(pFilter,TAG_POLYGON_COMPLEX_ROUNDED_STELLATED, TAG_POLYGON_COMPLEX_ROUNDED_STELLATED_SIZE);
00289 
00290     ok = Rec.Init();
00291     if (ok) ok = Rec.WriteUINT16(GetNumberOfSides(pShape));
00292     if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape));
00293     if (ok) ok = Rec.WriteCoordTrans(GetMajorAxis(pShape),0,0);
00294     if (ok) ok = Rec.WriteCoordTrans(GetMinorAxis(pShape),0,0);
00295     if (ok) ok = Rec.WriteDOUBLE(GetStellationRadius(pShape));
00296     if (ok) ok = Rec.WriteDOUBLE(GetStellationOffset(pShape));
00297     if (ok) ok = Rec.WriteDOUBLE(GetPrimaryCurvature(pShape));
00298     if (ok) ok = Rec.WriteDOUBLE(GetSecondaryCurvature(pShape));
00299     if (ok) ok = pFilter->Write(&Rec);
00300 
00301     return ok;
00302 }

BOOL CXaraFilePolygon::WritePolygonComplexRoundedStellatedReformed BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 304 of file cxfpoly.cpp.

00305 {
00306     BOOL ok;
00307 
00308     CamelotFileRecord Rec(pFilter,TAG_POLYGON_COMPLEX_ROUNDED_STELLATED_REFORMED, TAG_POLYGON_COMPLEX_ROUNDED_STELLATED_REFORMED_SIZE);
00309 
00310     ok = Rec.Init();
00311     if (ok) ok = Rec.WriteUINT16(GetNumberOfSides(pShape));
00312     if (ok) ok = Rec.WriteCoordTrans(GetUTMajorAxis(pShape),0,0);
00313     if (ok) ok = Rec.WriteCoordTrans(GetUTMinorAxis(pShape),0,0);
00314     if (ok) ok = Rec.WriteMatrix(GetTransformMatrix(pShape));
00315     if (ok) ok = Rec.WriteDOUBLE(GetStellationRadius(pShape));
00316     if (ok) ok = Rec.WriteDOUBLE(GetStellationOffset(pShape));
00317     if (ok) ok = Rec.WriteDOUBLE(GetPrimaryCurvature(pShape));
00318     if (ok) ok = Rec.WriteDOUBLE(GetSecondaryCurvature(pShape));
00319     if (ok) ok = Rec.WritePath(GetPrimaryEdgePath(pShape));
00320     if (ok) ok = Rec.WritePath(GetSecondaryEdgePath(pShape));
00321     if (ok) ok = pFilter->Write(&Rec);
00322 
00323     return ok;
00324 }

BOOL CXaraFilePolygon::WritePolygonComplexStellated BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 211 of file cxfpoly.cpp.

00212 {
00213     BOOL ok;
00214 
00215     CamelotFileRecord Rec(pFilter,TAG_POLYGON_COMPLEX_STELLATED, TAG_POLYGON_COMPLEX_STELLATED_SIZE);
00216 
00217     ok = Rec.Init();
00218     if (ok) ok = Rec.WriteUINT16(GetNumberOfSides(pShape));
00219     if (ok) ok = Rec.WriteCoord(GetCentrePoint(pShape));
00220     if (ok) ok = Rec.WriteCoordTrans(GetMajorAxis(pShape),0,0);
00221     if (ok) ok = Rec.WriteCoordTrans(GetMinorAxis(pShape),0,0);
00222     if (ok) ok = Rec.WriteDOUBLE(GetStellationRadius(pShape));
00223     if (ok) ok = Rec.WriteDOUBLE(GetStellationOffset(pShape));
00224     if (ok) ok = pFilter->Write(&Rec);
00225 
00226     return ok;
00227 }

BOOL CXaraFilePolygon::WritePolygonComplexStellatedReformed BaseCamelotFilter pFilter,
NodeRegularShape pShape
[static]
 

Definition at line 229 of file cxfpoly.cpp.

00230 {
00231     BOOL ok;
00232 
00233     CamelotFileRecord Rec(pFilter,TAG_POLYGON_COMPLEX_STELLATED_REFORMED, TAG_POLYGON_COMPLEX_STELLATED_REFORMED_SIZE);
00234 
00235     ok = Rec.Init();
00236     if (ok) ok = Rec.WriteUINT16(GetNumberOfSides(pShape));
00237     if (ok) ok = Rec.WriteCoordTrans(GetUTMajorAxis(pShape),0,0);
00238     if (ok) ok = Rec.WriteCoordTrans(GetUTMinorAxis(pShape),0,0);
00239     if (ok) ok = Rec.WriteMatrix(GetTransformMatrix(pShape));
00240     if (ok) ok = Rec.WriteDOUBLE(GetStellationRadius(pShape));
00241     if (ok) ok = Rec.WriteDOUBLE(GetStellationOffset(pShape));
00242     if (ok) ok = Rec.WritePath(GetPrimaryEdgePath(pShape));
00243     if (ok) ok = Rec.WritePath(GetSecondaryEdgePath(pShape));
00244     if (ok) ok = pFilter->Write(&Rec);
00245 
00246     return ok;
00247 }


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