CamelotFileRecord Class Reference

This derived class does all the things that are Camelot-specific. More...

#include <cxfrec.h>

Inheritance diagram for CamelotFileRecord:

CXaraFileRecord CCObject SimpleCCObject List of all members.

Public Member Functions

 CamelotFileRecord (BaseCamelotFilter *pFilter, UINT32 Tag, INT32 Size=-1)
 Creates a record object. These are used by CXaraFile for reading and writing records.
 ~CamelotFileRecord ()
 Default destructor.
virtual BOOL WriteCoord (const DocCoord &Coord)
 Writes out the coord to the record.
virtual BOOL WriteCoordInterleaved (const DocCoord &Coord)
 Writes out the coord to the record, in an interleaved format.
virtual BOOL WritePath (Path *pPath)
 Writes out the path to the record.
virtual BOOL WritePathRelative (Path *pPath)
 Writes out the relative path to the record.
virtual BOOL WriteMatrix (const Matrix &m)
virtual BOOL WriteXOrd (INT32 XOrdinate)
 Writes out the x ordinate to the record.
virtual BOOL WriteYOrd (INT32 YOrdinate)
virtual BOOL ReadCoord (DocCoord *pCoord)
 Read in the coord from the record.
virtual BOOL ReadCoordInterleaved (DocCoord *pCoord)
virtual BOOL ReadPath (Path *pPath)
 Reads a path from the record.
virtual BOOL ReadPathRelative (Path *pPath)
 Reads a relative path from the record.
virtual BOOL ReadMatrix (Matrix *pMatrix)
virtual BOOL ReadXOrd (INT32 *pXOrdinate)
 Reads the x ordinate from the record.
virtual BOOL ReadYOrd (INT32 *pYOrdinate)

Private Member Functions

 CC_DECLARE_DYNAMIC (CamelotFileRecord)

Private Attributes

DocCoord CoordOrigin

Detailed Description

This derived class does all the things that are Camelot-specific.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/6/96

Definition at line 273 of file cxfrec.h.


Constructor & Destructor Documentation

CamelotFileRecord::CamelotFileRecord BaseCamelotFilter pFilter,
UINT32  Tag,
INT32  Size = -1
 

Creates a record object. These are used by CXaraFile for reading and writing records.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/6/96
Parameters:
pFilter - ptr to the filter doing the importing/exporting [INPUTS] Tag - Tag value for the record Size - The exact size of the record in bytes, or CXF_UNKNOWN_SIZE
This derived version sets up the coord origin using the supplied BaseCamelotFilter. This origin is used when writing & reading coords.
Returns:
Errors: -
See also:
-

Definition at line 2036 of file cxfrec.cpp.

02036                                                                                      : CXaraFileRecord(Tag,Size)
02037 {
02038 #if !defined(EXCLUDE_FROM_XARLIB)
02039     CoordOrigin = DocCoord(0,0);
02040 
02041     if (pFilter != NULL)
02042         CoordOrigin = pFilter->GetCoordOrigin();
02043 #endif
02044 }

CamelotFileRecord::~CamelotFileRecord  ) 
 

Default destructor.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/6/96
Returns:
Errors: -
See also:
-

Definition at line 2058 of file cxfrec.cpp.

02059 {
02060 }


Member Function Documentation

CamelotFileRecord::CC_DECLARE_DYNAMIC CamelotFileRecord   )  [private]
 

BOOL CamelotFileRecord::ReadCoord DocCoord pCoord  )  [virtual]
 

Read in the coord from the record.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/6/96
Parameters:
pCoord = ptr coord to read into [INPUTS]
Returns:
TRUE if OK, FALSE otherwise
The Coord is translated to the origin set up in the filter that was used to construct this object
Returns:
Errors: -
See also:
-

Reimplemented from CXaraFileRecord.

Definition at line 2227 of file cxfrec.cpp.

02228 {
02229     return ReadCoordTrans(pCoord,CoordOrigin.x,CoordOrigin.y);
02230 }

BOOL CamelotFileRecord::ReadCoordInterleaved DocCoord pCoord  )  [virtual]
 

Reimplemented from CXaraFileRecord.

Definition at line 2232 of file cxfrec.cpp.

02233 {
02234     return ReadCoordTransInterleaved(pCoord,CoordOrigin.x,CoordOrigin.y);
02235 }

BOOL CamelotFileRecord::ReadMatrix Matrix pMatrix  )  [virtual]
 

Reimplemented from CXaraFileRecord.

Definition at line 2237 of file cxfrec.cpp.

02238 {
02239     return ReadMatrixTrans(pm,CoordOrigin.x,CoordOrigin.y);
02240 }

BOOL CamelotFileRecord::ReadPath Path pPath  )  [virtual]
 

Reads a path from the record.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/6/96
Parameters:
pPath = ptr to a path [INPUTS]
Returns:
TRUE if OK, FALSE otherwise
All Coords in the path are translated to the origin set up in the filter that was used to construct this object
Returns:
Errors: -
See also:
-

Reimplemented from CXaraFileRecord.

Definition at line 2183 of file cxfrec.cpp.

02184 {
02185     return ReadPathTrans(pPath,CoordOrigin.x,CoordOrigin.y);
02186 }

BOOL CamelotFileRecord::ReadPathRelative Path pPath  )  [virtual]
 

Reads a relative path from the record.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/8/96
Parameters:
pPath = ptr to a path [INPUTS]
Returns:
TRUE if OK, FALSE otherwise
All Coords in the path are translated to the origin set up in the filter that was used to construct this object
Returns:
Errors: -
See also:
-

Reimplemented from CXaraFileRecord.

Definition at line 2205 of file cxfrec.cpp.

02206 {
02207     return ReadPathRelativeTrans(pPath,CoordOrigin.x,CoordOrigin.y);
02208 }

BOOL CamelotFileRecord::ReadXOrd INT32 *  pXOrdinate  )  [virtual]
 

Reads the x ordinate from the record.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/8/96
Parameters:
pXOrdinate = ptr place to stick the x ordinate read in [INPUTS]
Returns:
TRUE if OK, FALSE otherwise
The ordinate is translated to the origin set up in the filter that was used to construct this object
Returns:
Errors: -
See also:
-

Reimplemented from CXaraFileRecord.

Definition at line 2259 of file cxfrec.cpp.

02260 {
02261     if (ReadINT32(pXOrdinate))
02262     {
02263         *pXOrdinate += CoordOrigin.x;
02264         return TRUE;
02265     }
02266 
02267     return FALSE;
02268 }

BOOL CamelotFileRecord::ReadYOrd INT32 *  pYOrdinate  )  [virtual]
 

Reimplemented from CXaraFileRecord.

Definition at line 2270 of file cxfrec.cpp.

02271 {
02272     if (ReadINT32(pYOrdinate))
02273     {
02274         *pYOrdinate += CoordOrigin.y;
02275         return TRUE;
02276     }
02277 
02278     return FALSE;
02279 }

BOOL CamelotFileRecord::WriteCoord const DocCoord Coord  )  [virtual]
 

Writes out the coord to the record.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/6/96
Parameters:
Coord = coord to write to the record [INPUTS]
Returns:
TRUE if OK, FALSE otherwise
The Coord is translated to the origin set up in the filter that was used to construct this object
Returns:
Errors: -
See also:
-

Reimplemented from CXaraFileRecord.

Definition at line 2124 of file cxfrec.cpp.

02125 {
02126     return WriteCoordTrans(Coord,-CoordOrigin.x,-CoordOrigin.y);
02127 }

BOOL CamelotFileRecord::WriteCoordInterleaved const DocCoord Coord  )  [virtual]
 

Writes out the coord to the record, in an interleaved format.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/8/96
Parameters:
Coord = coord to write to the record [INPUTS]
Returns:
TRUE if OK, FALSE otherwise
The Coord is translated to the origin set up in the filter that was used to construct this object

This version interleaves the bytes of the X & Y components, to try and maximise the run of common bytes, in order to improve the zlib compression.

It writes out the top byte of x, then top byte of y, then next byte of x, then next byte of y, and so on.

Returns:
Errors: -
See also:
-

Reimplemented from CXaraFileRecord.

Definition at line 2129 of file cxfrec.cpp.

02130 {
02131     return WriteCoordTransInterleaved(Coord,-CoordOrigin.x,-CoordOrigin.y);
02132 }

BOOL CamelotFileRecord::WriteMatrix const Matrix m  )  [virtual]
 

Reimplemented from CXaraFileRecord.

Definition at line 2134 of file cxfrec.cpp.

02135 {
02136     return WriteMatrixTrans(m,-CoordOrigin.x,-CoordOrigin.y);
02137 }

BOOL CamelotFileRecord::WritePath Path pPath  )  [virtual]
 

Writes out the path to the record.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/6/96
Parameters:
pPath = ptr to a path [INPUTS]
Returns:
TRUE if OK, FALSE otherwise
All Coords in the path are translated to the origin set up in the filter that was used to construct this object
Returns:
Errors: -
See also:
-

Reimplemented from CXaraFileRecord.

Definition at line 2080 of file cxfrec.cpp.

02081 {
02082     return WritePathTrans(pPath,-CoordOrigin.x,-CoordOrigin.y);
02083 }

BOOL CamelotFileRecord::WritePathRelative Path pPath  )  [virtual]
 

Writes out the relative path to the record.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/6/96
Parameters:
pPath = ptr to a path [INPUTS]
Returns:
TRUE if OK, FALSE otherwise
All Coords in the path are translated to the origin set up in the filter that was used to construct this object
Returns:
Errors: -
See also:
-

Reimplemented from CXaraFileRecord.

Definition at line 2102 of file cxfrec.cpp.

02103 {
02104     return WritePathRelativeTrans(pPath,-CoordOrigin.x,-CoordOrigin.y);
02105 }

BOOL CamelotFileRecord::WriteXOrd INT32  XOrdinate  )  [virtual]
 

Writes out the x ordinate to the record.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/8/96
Parameters:
XOrdinate = x ordinate to write to the record [INPUTS]
Returns:
TRUE if OK, FALSE otherwise
The ordinate is translated to the origin set up in the filter that was used to construct this object
Returns:
Errors: -
See also:
-

Reimplemented from CXaraFileRecord.

Definition at line 2156 of file cxfrec.cpp.

02157 {
02158     return WriteINT32(XOrdinate-CoordOrigin.x);
02159 }

BOOL CamelotFileRecord::WriteYOrd INT32  YOrdinate  )  [virtual]
 

Reimplemented from CXaraFileRecord.

Definition at line 2161 of file cxfrec.cpp.

02162 {
02163     return WriteINT32(YOrdinate-CoordOrigin.y);
02164 }


Member Data Documentation

DocCoord CamelotFileRecord::CoordOrigin [private]
 

Definition at line 302 of file cxfrec.h.


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