CDRActionTransform Class Reference

A transform action. More...

#include <cdrfiltr.h>

Inheritance diagram for CDRActionTransform:

CDRActionListItem ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 CDRActionTransform ()
 ~CDRActionTransform ()
 destructor
BOOL Init (RIFFFile *RIFF, CDRVersion Version)
 sets up a transform action - stored given chunk
BOOL DoAction (CDRFilter *C)
 transforms the last object converted
void ImportFailure (CDRFilter *C)
 don't actually need to do anything - the chunk will be deleted on object destruction
void SetIsAGroupTransform (BOOL IsOne)

Public Attributes

ADDR Chunk
INT32 ChunkSize
BOOL LinkTrans

Private Member Functions

 CC_DECLARE_DYNAMIC (CDRActionTransform)

Private Attributes

friend CDRActionList
friend CDRFilter
BOOL IsAGroupTransform

Detailed Description

A transform action.

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
23 03 95

Definition at line 551 of file cdrfiltr.h.


Constructor & Destructor Documentation

CDRActionTransform::CDRActionTransform  )  [inline]
 

Definition at line 559 of file cdrfiltr.h.

CDRActionTransform::~CDRActionTransform  ) 
 

destructor

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
27 03 95
Parameters:
none [INPUTS]
Returns:
error flag
See also:

Definition at line 1951 of file cdrfiltr.cpp.

01952 {
01953     CCFree(Chunk);
01954 }


Member Function Documentation

CDRActionTransform::CC_DECLARE_DYNAMIC CDRActionTransform   )  [private]
 

BOOL CDRActionTransform::DoAction CDRFilter C  )  [virtual]
 

transforms the last object converted

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
27 03 95
Parameters:
none [INPUTS]
Returns:
error flag
See also:

Implements CDRActionListItem.

Definition at line 1879 of file cdrfiltr.cpp.

01880 {
01881     ERROR3IF(Chunk == 0, "CDRActionTransform not initialised");
01882     
01883     if(LinkTrans)
01884     {
01885         return TRUE;
01886     }
01887     
01888     ADDR Transform = Chunk;
01889 
01890     // if this is a version 3 file we need to find the transform in the data - it's in
01891     // a standard offset header
01892     if(C->Version == CDRVERSION_3)
01893     {
01894         cdrfOffsetHeader *Header = (cdrfOffsetHeader *)Chunk;
01895 
01896         // if there isn't a transform, then we're not worried
01897         if((Transform = C->FindDataInObject(Header, cdrfOBJOFFSETTYPE_TRANSFORM_V3)) == 0)
01898             return TRUE;
01899     }
01900 
01901     // transform the last node created
01902 
01903     // unlink it from the tree first...
01904     Node *pNext = C->pLevelNodeList->FindNext();
01905     C->pLevelNodeList->UnlinkNodeFromTree();
01906 
01907     // we don't want to scale it to translate the origin because it's already been done
01908     if(!LinkTrans && C->pLevelNodeList != 0)
01909         C->TransformConvertedObject(&C->pLevelNodeList, Transform, ChunkSize, FALSE, IsAGroupTransform, TRUE);
01910 
01911     // relink it in
01912     if(pNext != 0)
01913         C->pLevelNodeList->AttachNode(pNext, PREV);
01914     
01915     return TRUE;
01916 }

void CDRActionTransform::ImportFailure CDRFilter C  )  [virtual]
 

don't actually need to do anything - the chunk will be deleted on object destruction

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
27 03 95
Parameters:
none [INPUTS]
Returns:
error flag
See also:

Implements CDRActionListItem.

Definition at line 1933 of file cdrfiltr.cpp.

01934 {
01935 }

BOOL CDRActionTransform::Init RIFFFile RIFF,
CDRVersion  Version
 

sets up a transform action - stored given chunk

Author:
Ben_Summers (Xara Group Ltd) <camelotdev@xara.com>
Date:
27 03 95
Parameters:
none [INPUTS]
Returns:
error flag
See also:

Definition at line 1832 of file cdrfiltr.cpp.

01833 {
01834     if(Version == CDRVERSION_3)
01835     {
01836         // it's a version 3 file, so get the chunk
01837         ERROR3IF(RIFF->GetObjType() != RIFFOBJECTTYPE_CHUNK, "CDRActionTransform::Init called with RIFFFile in wrong state");
01838 
01839         ERROR3IF(Chunk != 0, "CDRActionTransform::Init called more than once");
01840 
01841         // claim some memory to put the transform in
01842         if((Chunk = (ADDR)CCMalloc(RIFF->GetObjSize())) == 0)
01843             return FALSE;
01844 
01845         // and get the chunk data into this nice block
01846         if(!RIFF->GetChunkData(Chunk, RIFF->GetObjSize()))
01847             return FALSE;
01848     }
01849     else
01850     {
01851         // it's a version 5 file, so get the list contents
01852         ERROR3IF(RIFF->GetObjType() != RIFFOBJECTTYPE_LISTSTART, "CDRActionTransform::Init called with RIFFFile in wrong state");
01853 
01854         ERROR3IF(Chunk != 0, "CDRActionTransform::Init called more than once");
01855     
01856         // get the list contents
01857         if(!RIFF->GetListContents(&Chunk, &ChunkSize))
01858             return FALSE;
01859     }
01860 
01861     // that's it for now
01862     return TRUE;
01863 }

void CDRActionTransform::SetIsAGroupTransform BOOL  IsOne  )  [inline]
 

Definition at line 567 of file cdrfiltr.h.

00567 {IsAGroupTransform = IsOne;};


Member Data Documentation

friend CDRActionTransform::CDRActionList [private]
 

Reimplemented from CDRActionListItem.

Definition at line 553 of file cdrfiltr.h.

friend CDRActionTransform::CDRFilter [private]
 

Definition at line 554 of file cdrfiltr.h.

ADDR CDRActionTransform::Chunk
 

Definition at line 567 of file cdrfiltr.h.

INT32 CDRActionTransform::ChunkSize
 

Definition at line 571 of file cdrfiltr.h.

BOOL CDRActionTransform::IsAGroupTransform [private]
 

Definition at line 574 of file cdrfiltr.h.

BOOL CDRActionTransform::LinkTrans
 

Definition at line 572 of file cdrfiltr.h.


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