CDRTransformConvertor5 Class Reference

#include <cdrfiltr.h>

Inheritance diagram for CDRTransformConvertor5:

CDRTransformConvertor List of all members.

Public Member Functions

BOOL Init (ADDR Data, INT32 Size)
 intialises this convertor
UINT32 GetNTransforms ()
CDRTransformType GetTransformType (UINT32 n)
 gets a transform type from an trfd chunk
BOOL GetMatrix (cdrMatrix *M, UINT32 n)
 converts a matrix from position N
BOOL GetPerspective (cdrPerspective *P, UINT32 n)
 converts a perspective from position N
BOOL GetEnvelope (Path **P, DocRect *OriginalBBox, INT32 *Corners, UINT32 n)
 converts a envelope from position N
BOOL GetExtrude (cdrExtrudeInfo *Info, UINT32 n)
 converts a matrix from position N

Private Member Functions

 CC_DECLARE_MEMDUMP (CDRTransformConvertor5)

Private Attributes

cdrfTransformTrans
ADDR List
INT32 ListSize

Detailed Description

Definition at line 1012 of file cdrfiltr.h.


Member Function Documentation

CDRTransformConvertor5::CC_DECLARE_MEMDUMP CDRTransformConvertor5   )  [private]
 

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

converts a envelope from position N

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/05/95
Parameters:
pointer to a pointer to a nodepath to fill in, a docrect for the orignial BBox [INPUTS] and the position
Returns:
a transform type
See also:
CDRFilter

Implements CDRTransformConvertor.

Definition at line 4446 of file cdrfiltr.cpp.

04447 {
04448     if(n >= CDRDATA_WORD(Trans->NTransforms))
04449         return FALSE;
04450 
04451     cdrfTransformHeader *Hdr;
04452 
04453     // run through to this entry counting the number of entries before this one
04454     INT32 EnvelopesSoFar = 0;
04455     for(UINT32 l = 0; l <= n; l++)
04456     {
04457         Hdr = (cdrfTransformHeader *)(((ADDR)Trans) + CDRDATA_WORD(Trans->TransformOffsets[l]));
04458 
04459         // increment the number of envelopes so far...
04460         if(CDRDATA_WORD(Hdr->Type) == cdrfTRANSFORMTYPE_ENVELOPE)
04461             EnvelopesSoFar++;
04462     }
04463 
04464     ERROR2IF(EnvelopesSoFar <= 0, FALSE, "No envelopes found!");
04465     
04466     // OK, convert this entry...
04467     if(!ConvertEnvelopeBBox((ADDR)Hdr, OriginalBBox, Corners))
04468         return FALSE;
04469 
04470     if(!ConvertEnvelopePath(List, ListSize, EnvelopesSoFar - 1, P))
04471         return FALSE;
04472 
04473     return TRUE;
04474 }

BOOL CDRTransformConvertor5::GetExtrude cdrExtrudeInfo Info,
UINT32  n
[virtual]
 

converts a matrix from position N

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
08/01/96
Parameters:
extrude info to convert to, transform number [INPUTS]
Returns:
a transform type
See also:
CDRFilter

Implements CDRTransformConvertor.

Definition at line 4239 of file cdrfiltr.cpp.

04240 {
04241     if(n >= CDRDATA_WORD(Trans->NTransforms))
04242         return FALSE;
04243 
04244     cdrfTransformHeader *Hdr = (cdrfTransformHeader *)(((ADDR)Trans) + CDRDATA_WORD(Trans->TransformOffsets[n]));
04245 
04246     return ConvertExtrudeInfo((cdrfTransformExtrude *)Hdr, Info);
04247 }

BOOL CDRTransformConvertor5::GetMatrix cdrMatrix M,
UINT32  n
[virtual]
 

converts a matrix from position N

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

Implements CDRTransformConvertor.

Definition at line 3894 of file cdrfiltr.cpp.

03895 {
03896     if(n >= CDRDATA_WORD(Trans->NTransforms))
03897         return FALSE;
03898 
03899     cdrfTransformHeader *Hdr = (cdrfTransformHeader *)(((ADDR)Trans) + CDRDATA_WORD(Trans->TransformOffsets[n]));
03900 
03901     ERROR3IF(CDRDATA_WORD(Hdr->Type) != cdrfTRANSFORMTYPE_MATRIX, "GetMatrix called for a non matrix trfd entry");
03902     ERROR3IF((sizeof(FLOAT8) / 2) != sizeof(DWORD) || sizeof(DWORD) != 4, "Non valid sizeof assumptions");
03903 
03904     // OK, so apparently either PCs or Acorns store them the wrong way round. Oh well.
03905     FLOAT8 *TData = (FLOAT8 *)(Hdr + 1);
03906     FLOAT8 *Out = (FLOAT8 *)M;
03907 
03908     INT32 l;
03909     for(l = 0; l < 6; l++)
03910     {
03911         Out[l] = CDRDATA_FLOAT8(TData[l]);
03912     }
03913     
03914     // change the translation vector to be in millipoints
03915     M->c *= CDRCOORDS_TO_MILLIPOINTS;
03916     M->f *= CDRCOORDS_TO_MILLIPOINTS;
03917 
03918     return TRUE;
03919 }

UINT32 CDRTransformConvertor5::GetNTransforms  )  [inline, virtual]
 

Implements CDRTransformConvertor.

Definition at line 1018 of file cdrfiltr.h.

01018 {return CDRDATA_WORD(Trans->NTransforms);};

BOOL CDRTransformConvertor5::GetPerspective cdrPerspective P,
UINT32  n
[virtual]
 

converts a perspective from position N

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

Implements CDRTransformConvertor.

Definition at line 3987 of file cdrfiltr.cpp.

03988 {
03989     if(n >= CDRDATA_WORD(Trans->NTransforms))
03990         return FALSE;
03991 
03992     cdrfTransformHeader *Hdr = (cdrfTransformHeader *)(((ADDR)Trans) + CDRDATA_WORD(Trans->TransformOffsets[n]));
03993 
03994     ERROR3IF(CDRDATA_WORD(Hdr->Type) != cdrfTRANSFORMTYPE_PERSPECTIVE, "GetPerspective called for a non matrix trfd entry");
03995 
03996     cdrfPerspectiveEntry *Per = (cdrfPerspectiveEntry *)Hdr;
03997 
03998     return ConvertPerspective(P, &Per->Trans);
03999 }

CDRTransformType CDRTransformConvertor5::GetTransformType UINT32  n  )  [virtual]
 

gets a transform type from an trfd chunk

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
26 03 95
Parameters:
transform number [INPUTS]
Returns:
a transform type
See also:
CDRFilter

Implements CDRTransformConvertor.

Definition at line 3795 of file cdrfiltr.cpp.

03796 {
03797     if(n >= CDRDATA_WORD(Trans->NTransforms))
03798         return CDRTRANSFORMTYPE_UNKNOWN;
03799 
03800     cdrfTransformHeader *Hdr = (cdrfTransformHeader *)(((ADDR)Trans) + CDRDATA_WORD(Trans->TransformOffsets[n]));
03801 
03802     switch(CDRDATA_WORD(Hdr->Type))
03803     {
03804         case cdrfTRANSFORMTYPE_MATRIX:
03805             return CDRTRANSFORMTYPE_MATRIX;
03806             break;
03807         
03808         case cdrfTRANSFORMTYPE_PERSPECTIVE:
03809             return CDRTRANSFORMTYPE_PERSPECTIVE;
03810             break;
03811         
03812 #ifdef CDR_DOEXTRUDE
03813         case cdrfTRANSFORMTYPE_EXTRUDE:
03814             return CDRTRANSFORMTYPE_EXTRUDE;
03815             break;
03816 #endif
03817 
03818         case cdrfTRANSFORMTYPE_ENVELOPE:
03819             return CDRTRANSFORMTYPE_ENVELOPE;
03820             break;
03821         
03822         default:
03823             TRACEUSER( "Ben", _T("[] Unknown v5 transform type\n"));
03824             break;
03825     }
03826 
03827     return CDRTRANSFORMTYPE_UNKNOWN;
03828 }

BOOL CDRTransformConvertor5::Init ADDR  Data,
INT32  Size
[virtual]
 

intialises this convertor

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/06/95
Parameters:
pointer to trfl list and it's size [INPUTS]
Returns:
whether the contents are OK
See also:
CDRFilter

Implements CDRTransformConvertor.

Definition at line 3737 of file cdrfiltr.cpp.

03738 {
03739     List = Data;
03740     ListSize = Size;
03741  
03742     ADDR TransformData;
03743 
03744     if(!RIFFFile::FindChunkWithinListContents(List, ListSize, cdrT_trfd, 0, &TransformData, 0))
03745         return 0;
03746 
03747     Trans = (cdrfTransform *)TransformData;
03748  
03749     return TRUE;
03750  }


Member Data Documentation

ADDR CDRTransformConvertor5::List [private]
 

Definition at line 1026 of file cdrfiltr.h.

INT32 CDRTransformConvertor5::ListSize [private]
 

Definition at line 1027 of file cdrfiltr.h.

cdrfTransform* CDRTransformConvertor5::Trans [private]
 

Definition at line 1025 of file cdrfiltr.h.


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