MouldTransform Class Reference

Defines the mould transform class. This class is used by a moulder when it needs to ask other objects to transform themselves geometrically. It provides various functions for nodes to call to transform coordinates or paths. More...

#include <moldshap.h>

Inheritance diagram for MouldTransform:

TransformBase CCObject SimpleCCObject List of all members.

Public Member Functions

 MouldTransform (MouldGeometry *pGeom)
 MouldTransform constructor sets the internal shape pointer.
 ~MouldTransform ()
 MouldTransform destructor.
virtual void Transform (DocCoord *Coords, INT32 NumCoords)
 Takes each coordinate from Coords in turn, transforming it by the defined mould and writing back the result.
virtual BOOL IsInvertable ()
virtual BOOL TransformPath (Path *const pSource, Path *pDestin)
 This function will create a destination path by transforming the coords in the source path. However, unlike MouldTransform::Transform() there is not a 1:1 correspondence between these points. ie this complex transform produces complex results. The output path can be much larger than the input. You could theoretically call the Transform function on the coordinates of the path. The nature of the transform (being none affine) will give you an inaccurate result for lines and an invalid result for curves. So its better to use this function for paths. I suppose the criteria is, if you dont mind a linear response in the output domain of what you are transforming, (such as simple transforms of grad fills) then you can use Transform() otherwise, use this function if you can represent your data as paths.

Private Attributes

MouldGeometrypMouldGeom

Detailed Description

Defines the mould transform class. This class is used by a moulder when it needs to ask other objects to transform themselves geometrically. It provides various functions for nodes to call to transform coordinates or paths.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/01/95

Definition at line 200 of file moldshap.h.


Constructor & Destructor Documentation

MouldTransform::MouldTransform MouldGeometry pGeom  ) 
 

MouldTransform constructor sets the internal shape pointer.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/01/94
Parameters:
pShape = a pointer to a mould shape object [INPUTS]

Definition at line 355 of file moldshap.cpp.

00356 {
00357     ERROR3IF(pGeom==NULL, "MouldTransform constructor passed a null shape");
00358 
00359     pMouldGeom = pGeom;
00360     TransFills = TRUE;
00361     TransLines = TRUE;
00362 
00363 //  FIXED16 a(1);
00364 //  SetScaleFactor(a);
00365 }

MouldTransform::~MouldTransform  ) 
 

MouldTransform destructor.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/01/94
Parameters:
[INPUTS] 

Definition at line 379 of file moldshap.cpp.

00380 {
00381     // does nothing at moment
00382 }


Member Function Documentation

virtual BOOL MouldTransform::IsInvertable  )  [inline, virtual]
 

Implements TransformBase.

Definition at line 209 of file moldshap.h.

00209 { return FALSE; }

void MouldTransform::Transform DocCoord Coords,
INT32  NumCoords
[virtual]
 

Takes each coordinate from Coords in turn, transforming it by the defined mould and writing back the result.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/01/94
Parameters:
Coords = a pointer to a set of document coordinates [INPUTS] NumCoords = the number of coordinates to transform.
Coords holds the results of the transformation. All coordinates will have [OUTPUTS] been processed.

Implements TransformBase.

Definition at line 400 of file moldshap.cpp.

00401 {
00402     ERROR3IF(Coords==NULL, "MouldTransform::Transform() called with illegal coord pointer");
00403 
00404     for (INT32 i=0; i<NumCoords; i++)
00405         pMouldGeom->MouldPoint(Coords[i],Coords[i]);
00406 }

BOOL MouldTransform::TransformPath Path *const   pSource,
Path pDestin
[virtual]
 

This function will create a destination path by transforming the coords in the source path. However, unlike MouldTransform::Transform() there is not a 1:1 correspondence between these points. ie this complex transform produces complex results. The output path can be much larger than the input. You could theoretically call the Transform function on the coordinates of the path. The nature of the transform (being none affine) will give you an inaccurate result for lines and an invalid result for curves. So its better to use this function for paths. I suppose the criteria is, if you dont mind a linear response in the output domain of what you are transforming, (such as simple transforms of grad fills) then you can use Transform() otherwise, use this function if you can represent your data as paths.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/01/94
Parameters:
pSource = a pointer to the source path to transform [INPUTS] pDestin = a pointer to an initialised path to take the result of the transformation. Outputs pDestin holds the result of the transformation

Definition at line 434 of file moldshap.cpp.

00435 {
00436     ERROR2IF(pSource==NULL,FALSE,"MouldTransform::TransformPath() called with a null source path");
00437     ERROR2IF(pDestin==NULL,FALSE,"MouldTransform::TransformPath() called with a null source path");
00438 
00439     return pMouldGeom->MouldPathToPath(pSource,pDestin);
00440 }


Member Data Documentation

MouldGeometry* MouldTransform::pMouldGeom [private]
 

Definition at line 213 of file moldshap.h.


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