CDRTransformConvertor Class Reference

#include <cdrfiltr.h>

Inheritance diagram for CDRTransformConvertor:

CDRTransformConvertor3 CDRTransformConvertor4 CDRTransformConvertor5 List of all members.

Public Member Functions

virtual BOOL Init (ADDR Data, INT32 Size)=0
virtual UINT32 GetNTransforms ()=0
virtual CDRTransformType GetTransformType (UINT32 n)=0
virtual BOOL GetMatrix (cdrMatrix *M, UINT32 n)=0
virtual BOOL GetPerspective (cdrPerspective *P, UINT32 n)=0
virtual BOOL GetEnvelope (Path **P, DocRect *OriginalBBox, INT32 *Corners, UINT32 n)=0
virtual BOOL GetExtrude (cdrExtrudeInfo *Info, UINT32 n)=0

Protected Member Functions

BOOL ConvertPerspective (cdrPerspective *P, cdrfPerspectiveTransform *Trans)
 converts corel perspective - used by all the convertors
BOOL ConvertEnvelopeBBox (ADDR Entry, DocRect *BBox, INT32 *Corners)
 converts a envelope original bounding box
BOOL ConvertEnvelopePath (ADDR List, INT32 ListSize, INT32 Entry, Path **ppPath)
 converts a envelope path
BOOL ConvertExtrudeInfo (cdrfTransformExtrude *pTransform, cdrExtrudeInfo *pInfo)
 converts an extrude thingy from a v4,5,6 file

Private Member Functions

 CC_DECLARE_MEMDUMP (CDRTransformConvertor)

Detailed Description

Definition at line 992 of file cdrfiltr.h.


Member Function Documentation

CDRTransformConvertor::CC_DECLARE_MEMDUMP CDRTransformConvertor   )  [private]
 

BOOL CDRTransformConvertor::ConvertEnvelopeBBox ADDR  Entry,
DocRect BBox,
INT32 *  Corners
[protected]
 

converts a envelope original bounding box

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/06/95
Parameters:
Pointer to entry in transform chunk and an output DocRect [INPUTS]
Returns:
sucess
See also:
CDRFilter

Definition at line 4330 of file cdrfiltr.cpp.

04331 {
04332     // get the bounding box;
04333     cdrfTransformEnvelope *En = (cdrfTransformEnvelope *)Entry;
04334 
04335     INT32 x0, y0, y1, x1;
04336     x0 = CDRDATA_SWORD(En->Ox0) * CDRCOORDS_TO_MILLIPOINTS;
04337     y0 = CDRDATA_SWORD(En->Oy0) * CDRCOORDS_TO_MILLIPOINTS;
04338     x1 = CDRDATA_SWORD(En->Ox1) * CDRCOORDS_TO_MILLIPOINTS;
04339     y1 = CDRDATA_SWORD(En->Oy1) * CDRCOORDS_TO_MILLIPOINTS;
04340 
04341     if(x0 > x1)
04342     {
04343         INT32 t = x1;
04344         x1 = x0;
04345         x0 = t;
04346     }
04347     
04348     if(y0 > y1)
04349     {
04350         INT32 t = y1;
04351         y1 = y0;
04352         y0 = t;
04353     }
04354 
04355     BBox->lo.x = x0;
04356     BBox->lo.y = y0;
04357     BBox->hi.x = x1;
04358     BBox->hi.y = y1;
04359 
04360     // fill in the corners
04361     for(INT32 l = 0; l < 4; l++)
04362     {
04363         Corners[l] = CDRDATA_WORD(En->Corners[l]);
04364     }
04365 
04366     return TRUE;
04367 }

BOOL CDRTransformConvertor::ConvertEnvelopePath ADDR  List,
INT32  ListSize,
INT32  Entry,
Path **  ppPath
[protected]
 

converts a envelope path

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/06/95
Parameters:
pointer to list, list size, entry number to get and a pointer to a path to fill in [INPUTS]
Returns:
sucess
See also:
CDRFilter

Definition at line 4383 of file cdrfiltr.cpp.

04384 {
04385     // find the envd chunk we're interested in
04386     ADDR Chunk;
04387     INT32 ChunkSize;
04388     if(!RIFFFile::FindChunkWithinListContents(List, ListSize, cdrT_envd, Entry, &Chunk, &ChunkSize))
04389         return FALSE;
04390 
04391     // right, got the thingy...
04392     cdrfOffsetHeader *Hdr = (cdrfOffsetHeader *)Chunk;
04393     INT32 NCoords = CDRDATA_WORD(Hdr->ObjectType);  // hold the number of coords...
04394 
04395     // find the things within the chunk
04396     ADDR Coords = CDRFilter::FindDataInObject(Hdr, cdrfENVELOPEOFFSETTYPE_COORDS);
04397     ADDR Types = CDRFilter::FindDataInObject(Hdr, cdrfENVELOPEOFFSETTYPE_TYPES);
04398 
04399     if(Coords == 0 || Types == 0)
04400         return FALSE;
04401 
04402     // make a path from this all...
04403     // knock up a path node
04404     Path *pPath = new Path;
04405     if(pPath == 0 || (!pPath->Initialise()))
04406     {
04407         delete pPath;
04408         return FALSE;           // no room to create it
04409     }
04410 
04411     // position the new elements at the beginning of the path
04412     pPath->FindStartOfPath();
04413 
04414     if(!CDRFilter::AddElementsToPath(pPath, NCoords, (cdrfCoord *)Coords, Types, 0))
04415         return FALSE;
04416 
04417     // check that the path is OK
04418     if(!pPath->EnsureValid())
04419     {
04420         // no, it's completely knackered
04421         delete pPath;
04422         return FALSE;
04423     }
04424 
04425     // return it...
04426     (*ppPath) = pPath;
04427     
04428     return TRUE;
04429 }

BOOL CDRTransformConvertor::ConvertExtrudeInfo cdrfTransformExtrude pTransform,
cdrExtrudeInfo Info
[protected]
 

converts an extrude thingy from a v4,5,6 file

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/01/96
Parameters:
pointer to transform from file, extrude info to convert to [INPUTS]
Returns:
error flag
See also:
CDRFilter

Definition at line 4178 of file cdrfiltr.cpp.

04179 {
04180     Info->Trans.cf11 = (FLOAT8)CDRDATA_SWORD(pTransform->cf11b) + ((FLOAT8)CDRDATA_WORD(pTransform->cf11a) / 0xffff);
04181     Info->Trans.cf12 = (FLOAT8)CDRDATA_SWORD(pTransform->cf12b) + ((FLOAT8)CDRDATA_WORD(pTransform->cf12a) / 0xffff);
04182     Info->Trans.cf13 = (FLOAT8)CDRDATA_SWORD(pTransform->cf13b) + ((FLOAT8)CDRDATA_WORD(pTransform->cf13a) / 0xffff);
04183     Info->Trans.cf21 = (FLOAT8)CDRDATA_SWORD(pTransform->cf21b) + ((FLOAT8)CDRDATA_WORD(pTransform->cf21a) / 0xffff);
04184     Info->Trans.cf22 = (FLOAT8)CDRDATA_SWORD(pTransform->cf22b) + ((FLOAT8)CDRDATA_WORD(pTransform->cf22a) / 0xffff);
04185     Info->Trans.cf23 = (FLOAT8)CDRDATA_SWORD(pTransform->cf23b) + ((FLOAT8)CDRDATA_WORD(pTransform->cf23a) / 0xffff);
04186     Info->Trans.cf31 = (FLOAT8)CDRDATA_SWORD(pTransform->cf31b) + ((FLOAT8)CDRDATA_WORD(pTransform->cf31a) / 0xffff);
04187     Info->Trans.cf32 = (FLOAT8)CDRDATA_SWORD(pTransform->cf32b) + ((FLOAT8)CDRDATA_WORD(pTransform->cf32a) / 0xffff);
04188     Info->Trans.cf33 = (FLOAT8)CDRDATA_SWORD(pTransform->cf33b) + ((FLOAT8)CDRDATA_WORD(pTransform->cf33a) / 0xffff);
04189     Info->Trans.cf41 = (FLOAT8)CDRDATA_DWORD(pTransform->f41);
04190     Info->Trans.cf42 = (FLOAT8)CDRDATA_DWORD(pTransform->f42);
04191     Info->Trans.cf43 = (FLOAT8)CDRDATA_DWORD(pTransform->f43);
04192 
04193     Info->Camera.x = CDRDATA_SWORD(pTransform->Cx) * CDRCOORDS_TO_MILLIPOINTS;
04194     Info->Camera.y = CDRDATA_SWORD(pTransform->Cy) * CDRCOORDS_TO_MILLIPOINTS;
04195     Info->Camera.z = CDRDATA_DWORD(pTransform->Cz) * CDRCOORDS_TO_MILLIPOINTS;
04196 
04197     return TRUE;
04198 }

BOOL CDRTransformConvertor::ConvertPerspective cdrPerspective P,
cdrfPerspectiveTransform Tran
[protected]
 

converts corel perspective - used by all the convertors

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/05/95
Parameters:
perspective to convert into, transform number [INPUTS]
Returns:
a transform type
See also:
CDRFilter

Definition at line 3935 of file cdrfiltr.cpp.

03936 {
03937     // knock up the bbox
03938     INT32 x0, y0, y1, x1;
03939     x0 = CDRDATA_SWORD(Tran->Ox0) * CDRCOORDS_TO_MILLIPOINTS;
03940     y0 = CDRDATA_SWORD(Tran->Oy0) * CDRCOORDS_TO_MILLIPOINTS;
03941     x1 = CDRDATA_SWORD(Tran->Ox1) * CDRCOORDS_TO_MILLIPOINTS;
03942     y1 = CDRDATA_SWORD(Tran->Oy1) * CDRCOORDS_TO_MILLIPOINTS;
03943 
03944     if(x0 > x1)
03945     {
03946         INT32 t = x1;
03947         x1 = x0;
03948         x0 = t;
03949     }
03950     
03951     if(y0 > y1)
03952     {
03953         INT32 t = y1;
03954         y1 = y0;
03955         y0 = t;
03956     }
03957 
03958     P->OriginalBBox.lo.x = x0;
03959     P->OriginalBBox.lo.y = y0;
03960     P->OriginalBBox.hi.x = x1;
03961     P->OriginalBBox.hi.y = y1;
03962 
03963     // and the new corners
03964     for(INT32 l = 0; l < 4; l++)
03965     {
03966         P->NewCorners[l].x = CDRDATA_SWORD(Tran->NewCorners[l].X) * CDRCOORDS_TO_MILLIPOINTS;
03967         P->NewCorners[l].y = CDRDATA_SWORD(Tran->NewCorners[l].Y) * CDRCOORDS_TO_MILLIPOINTS;
03968     }
03969 
03970     return TRUE;
03971 }

virtual BOOL CDRTransformConvertor::GetEnvelope Path **  P,
DocRect OriginalBBox,
INT32 *  Corners,
UINT32  n
[pure virtual]
 

Implemented in CDRTransformConvertor5, CDRTransformConvertor4, and CDRTransformConvertor3.

virtual BOOL CDRTransformConvertor::GetExtrude cdrExtrudeInfo Info,
UINT32  n
[pure virtual]
 

Implemented in CDRTransformConvertor5, CDRTransformConvertor4, and CDRTransformConvertor3.

virtual BOOL CDRTransformConvertor::GetMatrix cdrMatrix M,
UINT32  n
[pure virtual]
 

Implemented in CDRTransformConvertor5, CDRTransformConvertor4, and CDRTransformConvertor3.

virtual UINT32 CDRTransformConvertor::GetNTransforms  )  [pure virtual]
 

Implemented in CDRTransformConvertor5, CDRTransformConvertor4, and CDRTransformConvertor3.

virtual BOOL CDRTransformConvertor::GetPerspective cdrPerspective P,
UINT32  n
[pure virtual]
 

Implemented in CDRTransformConvertor5, CDRTransformConvertor4, and CDRTransformConvertor3.

virtual CDRTransformType CDRTransformConvertor::GetTransformType UINT32  n  )  [pure virtual]
 

Implemented in CDRTransformConvertor5, CDRTransformConvertor4, and CDRTransformConvertor3.

virtual BOOL CDRTransformConvertor::Init ADDR  Data,
INT32  Size
[pure virtual]
 

Implemented in CDRTransformConvertor5, CDRTransformConvertor4, and CDRTransformConvertor3.


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