EllipseRecordHandler Class Reference

Handles ellipse type records from the new file formatRecord handler for ellipses, used when importing ellipses from the new file format. Derived from the regular shape record handler, so we use all the functions in that class to complete the regular shape. More...

#include <rechellp.h>

Inheritance diagram for EllipseRecordHandler:

RegularShapeRecordHandler CamelotRecordHandler CXaraFileRecordHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 EllipseRecordHandler ()
 ~EllipseRecordHandler ()
UINT32GetTagList ()
 Returns an array of records handled by this class. See Also: EllispeRecordHandler::HandleRecord.
BOOL HandleRecord (CXaraFileRecord *pCXaraFileRecord)
 Handles ellipse type records for the new file format.

Private Member Functions

 CC_DECLARE_DYNAMIC (EllipseRecordHandler)
BOOL ReadEllipseSimple (CXaraFileRecord *pCXaraFileRecord)
 Reads in an ellise record.
BOOL ReadEllipseComplex (CXaraFileRecord *pCXaraFileRecord)

Detailed Description

Handles ellipse type records from the new file formatRecord handler for ellipses, used when importing ellipses from the new file format. Derived from the regular shape record handler, so we use all the functions in that class to complete the regular shape.

Author:
Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/06/96 Base Class: RegularShapeRecordHandler

Definition at line 124 of file rechellp.h.


Constructor & Destructor Documentation

EllipseRecordHandler::EllipseRecordHandler  )  [inline]
 

Definition at line 130 of file rechellp.h.

00130 {};

EllipseRecordHandler::~EllipseRecordHandler  )  [inline]
 

Definition at line 131 of file rechellp.h.

00131 {};


Member Function Documentation

EllipseRecordHandler::CC_DECLARE_DYNAMIC EllipseRecordHandler   )  [private]
 

UINT32 * EllipseRecordHandler::GetTagList  )  [virtual]
 

Returns an array of records handled by this class. See Also: EllispeRecordHandler::HandleRecord.

Author:
Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/06/96
Parameters:
- [INPUTS]
Returns:
UINT32* to an array of records handled by this class. The last entry in the array is CXFRH_TAG_LIST_END

Reimplemented from RegularShapeRecordHandler.

Definition at line 138 of file rechellp.cpp.

00139 {
00140     static UINT32 TagList[] = {TAG_ELLIPSE_SIMPLE,
00141                                 TAG_ELLIPSE_COMPLEX,
00142                                 CXFRH_TAG_LIST_END};
00143     return &TagList[0];
00144 }

BOOL EllipseRecordHandler::HandleRecord CXaraFileRecord pCXaraFileRecord  )  [virtual]
 

Handles ellipse type records for the new file format.

Author:
Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/06/96
Parameters:
pCXaraFileRecord - CXaraFileRecord object to read [INPUTS]
Returns:
TRUE if successful, FALSE otherwise

Reimplemented from RegularShapeRecordHandler.

Definition at line 158 of file rechellp.cpp.

00159 {
00160     BOOL ok;
00161 
00162     switch (pCXaraFileRecord->GetTag())
00163     {
00164         case TAG_ELLIPSE_SIMPLE     : ok = ReadEllipseSimple(pCXaraFileRecord); break;
00165         case TAG_ELLIPSE_COMPLEX    : ok = ReadEllipseComplex(pCXaraFileRecord); break;
00166         default                     : ok = ReadShapeInvalid(pCXaraFileRecord); break;
00167     }
00168     
00169     return ok;
00170 }

BOOL EllipseRecordHandler::ReadEllipseComplex CXaraFileRecord pCXaraFileRecord  )  [private]
 

Definition at line 212 of file rechellp.cpp.

00213 {
00214     BOOL ok = TRUE;
00215 
00216     NodeRegularShape *pEllipse;
00217     DocCoord CentrePoint;
00218     DocCoord MajorAxis;
00219     DocCoord MinorAxis;
00220 
00221     pEllipse = new NodeRegularShape;
00222 
00223     if (ok) ok = SetupShape(pEllipse);
00224     if (ok) ok = SetIsCircular(pEllipse, TRUE);
00225 
00226     if (ok) ok = pCXaraFileRecord->ReadCoord(&CentrePoint);
00227     if (ok) ok = SetCentrePoint(pEllipse, CentrePoint);
00228 
00229     if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&MajorAxis,0,0);
00230     if (ok) ok = SetMajorAxis(pEllipse, MajorAxis);
00231 
00232     if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&MinorAxis,0,0);
00233     if (ok) ok = SetMinorAxis(pEllipse, MinorAxis);
00234 
00235     if (ok) ok = InvalidateCache(pEllipse);
00236     if (ok) ok = InsertNode(pEllipse);
00237 
00238     return ok;
00239 }

BOOL EllipseRecordHandler::ReadEllipseSimple CXaraFileRecord pCXaraFileRecord  )  [private]
 

Reads in an ellise record.

Author:
Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/06/96
Parameters:
pCXaraFileRecord - pointer to the record to read [INPUTS]
Returns:
TRUE if successfull, false otherwise

Definition at line 185 of file rechellp.cpp.

00186 {
00187     BOOL ok = TRUE;
00188 
00189     NodeRegularShape * pEllipse;
00190     DocCoord CentrePoint;
00191     INT32 Height;
00192     INT32 Width;
00193 
00194     pEllipse = new NodeRegularShape;
00195 
00196     if (ok) ok = SetupShape(pEllipse);
00197     if (ok) ok = SetIsCircular(pEllipse, TRUE);
00198 
00199     if (ok) ok = pCXaraFileRecord->ReadCoord(&CentrePoint);
00200     if (ok) ok = SetCentrePoint(pEllipse, CentrePoint);
00201 
00202     if (ok) ok = pCXaraFileRecord->ReadINT32(&Width);
00203     if (ok) ok = pCXaraFileRecord->ReadINT32(&Height);
00204     if (ok) ok = SetHeightAndWidth(pEllipse, Height, Width);
00205 
00206     if (ok) ok = InvalidateCache(pEllipse);
00207     if (ok) ok = InsertNode(pEllipse);
00208 
00209     return ok;
00210 }


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