InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ITransform Class Referenceabstract

#include <ITransform.h>

Inheritance diagram for ITransform:
IPMUnknownCPMUnknown< ITransform >CTransform

Public Types

enum  { kDefaultIID = IID_ITRANSFORM }
 
enum  MatrixType { kDynamicMatrix, kStaticMatrix }
 

Public Member Functions

virtual PMReal GetItemScaleX () const =0
 
virtual PMReal GetItemScaleY () const =0
 
virtual PMReal GetItemSkewAngle () const =0
 
virtual PMReal GetItemRotationAngle () const =0
 
virtual void ScaleItemBy (PMReal xScale, PMReal yScale, const PMPoint &center)=0
 
virtual void ScaleItemTo (PMReal xScale, PMReal yScale, const PMPoint &center)=0
 
virtual void SkewItemTo (PMReal xSkewAngle, const PMPoint &center)=0
 
virtual void SkewItemBy (PMReal xSkewAngle, const PMPoint &center)=0
 
virtual void RotateItemBy (PMReal angle, const PMPoint &center)=0
 
virtual void RotateItemTo (PMReal angle, const PMPoint &center)=0
 
virtual void TranslateItemBy (const PMPoint &delta)=0
 
virtual void TranslateItemTo (const PMPoint &location)=0
 
virtual void SetInnerToParentMatrix (const PMMatrix &matrix)=0
 
virtual const PMMatrixGetInnerToParentMatrix () const =0
 
virtual const PMMatrixGetParentToInnerMatrix () const =0
 
virtual ITransform::MatrixType GetInnerToRootMatrix (PMMatrix *pMatrix, const ITransform *pRoot=nil) const =0
 
virtual bool16 IsTransformParentDependent () const =0
 
virtual IPMUnknownQueryTransformParent ()=0
 
virtual void ConcatItemTransform (IGraphicsPort *gPort)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

A persistant interface containing transformation data(3x3 tranform) for a page item.

Member Enumeration Documentation

Get the inner to root matrix by walking up the hierarchy. Some items such as inline have specific implementations of this interface to compute the matrix differently. Some implementations of ITransform may want to cache the result of GetInnerToRootMatrix But other implementations of ITransform may be generated dynamically thereby rendering all child caches invalid. On items that have dynamic transforms, GetInnerToRootMatrix will return kDynamicMatrix and that return value should be passed down the hierarchy. kStaticMatrix means the matrix is set via the normal SetMatrix call which will result in a parentchanged call. It is OK to cache the matrix when GetInnerToRootMatrix returns kStaticMatrix. But you should never cache the matrix when GetInnerToRootMatrix returns kDynamicMatrix.

Parameters
pMatrix[IN] parameter which is to perform the post concatenate.
pRoot[IN] parameter the root item's transform information.
Returns
MatrixType either kStaticMatrix or kDynamicMatrix.

Member Function Documentation

virtual void ITransform::ConcatItemTransform (IGraphicsPortgPort)
pure virtual

Concatenate this item's transformation, if necessary, into the gPort. Typically this is a simple gPort->concat(CurrentMatrix()), but for some it involves an additional transform as well, and for others (like standoffs), the transform needs to be ignored. Used by TransformUtils::TransformFromRoot().

Parameters
gPort[IN] parameter the graphics port that does the concatenate.
Returns
void.

Implemented in CTransform.

virtual const PMMatrix& ITransform::GetInnerToParentMatrix () const
pure virtual

Get this item's current inner-to-parent matrix. Note even though the matrix is returned by reference, you must use the result immediately or copy the result to another PMMatrix.

Returns
const PMMatrix the item's matrix.

Implemented in CTransform.

virtual PMReal ITransform::GetItemRotationAngle () const
pure virtual

Get item's rotate angle.

Returns
PMReal rotate angle ranges from 0 to 360.

Implemented in CTransform.

virtual PMReal ITransform::GetItemScaleX () const
pure virtual

Get item's x direction scale percentage.

Returns
PMReal x scale percentage.

Implemented in CTransform.

virtual PMReal ITransform::GetItemScaleY () const
pure virtual

Get item's y direction scale percentage.

Returns
PMReal y scale percentage.

Implemented in CTransform.

virtual PMReal ITransform::GetItemSkewAngle () const
pure virtual

Get item's x direction skew angle.

Returns
PMReal the angle ranges from -90 to 90.

Implemented in CTransform.

virtual const PMMatrix& ITransform::GetParentToInnerMatrix () const
pure virtual

Get this item's current parent-to_inner matrix. Note even though the matrix is returned by reference, you must use the result immediately or copy the result to another PMMatrix.

Returns
const PMMatrix the item's inverse matrix.

Implemented in CTransform.

virtual bool16 ITransform::IsTransformParentDependent () const
pure virtual

Check whether the item can be transformed independent of its parent or not.

Returns
bool16 kTrue if the item is dependent of its parent, otherwise kFalse.

Implemented in CTransform.

virtual IPMUnknown* ITransform::QueryTransformParent ()
pure virtual

Return an interface pointer to the "transformational parent" of this item. That is, the item whose transformation is concatenated to the current state before ours. For a typical pageitem, this would use IHierarchy::QueryParent() and return that item, but for some (like inlines and standoffs), it's not so simple. Used by TransformUtils::TransformFromRoot().

Returns
IPMUnknown* the returned interface and caller should deference the interface.

Implemented in CTransform.

virtual void ITransform::RotateItemBy (PMReal angle,
const PMPointcenter 
)
pure virtual

Rotate item with certain angle based on the given reference point.

Parameters
angle[IN] parameter the angle the item rotate by.
center[IN] parameter the reference point in parent coordinate.
Returns
void.

Implemented in CTransform.

virtual void ITransform::RotateItemTo (PMReal angle,
const PMPointcenter 
)
pure virtual

Rotate item to certain angle based on the given reference point.

Parameters
angle[IN] parameter the absolute angle the item rotate to.
center[IN] parameter the reference point in parent coordinate.
Returns
void.

Implemented in CTransform.

virtual void ITransform::ScaleItemBy (PMReal xScale,
PMReal yScale,
const PMPointcenter 
)
pure virtual

Scale item with certain x/y values based on the given reference point.

Parameters
xScale[IN] parameter the x value the item scale by.
yScale[IN] parameter the y value the item scale by.
center[IN] parameter the reference point in parent coordinate.
Returns
void.

Implemented in CTransform.

virtual void ITransform::ScaleItemTo (PMReal xScale,
PMReal yScale,
const PMPointcenter 
)
pure virtual

Scale item to certain x/y values based on the given reference point.

Parameters
xScale[IN] parameter the absolute x value the item scale by.
yScale[IN] parameter the absolute y value the item scale by.
center[IN] parameter the reference point in parent coordinate.
Returns
void.

Implemented in CTransform.

virtual void ITransform::SetInnerToParentMatrix (const PMMatrixmatrix)
pure virtual

Re-orient the item relative to its parent with a new transformation matrix.

Parameters
matrix[IN] parameter the given matrix to be set.
Returns
void.

Implemented in CTransform.

virtual void ITransform::SkewItemBy (PMReal xSkewAngle,
const PMPointcenter 
)
pure virtual

Skew item with certain angle based on the given reference point. We only directly support xSkew but not ySkew. To perform a skew in the y direction, skew in the x direction by the angle desired, and then rotate by the same angle.

See Also
GetXSkewAngle for more information.
Parameters
xSkewAngle[IN] parameter the angle the item skew by.
center[IN] parameter the reference point in parent coordinate.
Returns
void.

Implemented in CTransform.

virtual void ITransform::SkewItemTo (PMReal xSkewAngle,
const PMPointcenter 
)
pure virtual

Skew item to certain angle based on the given reference point. We only directly support xSkew but not ySkew. To perform a skew in the y direction, skew in the x direction by the angle desired, and then rotate by the same angle.

See Also
GetXSkewAngle for more information.
Parameters
xSkewAngle[IN] parameter the absolute angle the item skew by.
center[IN] parameter the reference point in parent coordinate.
Returns
void.

Implemented in CTransform.

virtual void ITransform::TranslateItemBy (const PMPointdelta)
pure virtual

Move item with delta amount of distance.

Parameters
delta[IN] parameter the amount of distance in parent coordinate.
Returns
void.

Implemented in CTransform.

virtual void ITransform::TranslateItemTo (const PMPointlocation)
pure virtual

Move item to the specified location.

Parameters
location[IN] parameter the place in parent coordinate where the item will move to.
Returns
void.

Implemented in CTransform.