InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CTransform Class Reference
Inheritance diagram for CTransform:
CPMUnknown< ITransform >ITransformIPMUnknown

Public Member Functions

 CTransform (IPMUnknown *boss=nil)
 
virtual PMReal GetItemScaleX () const
 
virtual PMReal GetItemScaleY () const
 
virtual PMReal GetItemSkewAngle () const
 
virtual PMReal GetItemRotationAngle () const
 
virtual void ScaleItemBy (PMReal xScale, PMReal yScale, const PMPoint &center)
 
virtual void ScaleItemTo (PMReal xScale, PMReal yScale, const PMPoint &center)
 
virtual void SkewItemBy (PMReal xSkew, const PMPoint &center)
 
virtual void SkewItemTo (PMReal xSkew, const PMPoint &center)
 
virtual void RotateItemBy (PMReal angle, const PBPMPoint &center)
 
virtual void RotateItemTo (PMReal angle, const PBPMPoint &center)
 
virtual void TranslateItemBy (const PBPMPoint &delta)
 
virtual void TranslateItemTo (const PBPMPoint &location)
 
virtual void SetInnerToParentMatrix (const PMMatrix &matrix)
 
virtual const PMMatrixGetInnerToParentMatrix () const
 
virtual const PMMatrixGetParentToInnerMatrix () const
 
virtual ITransform::MatrixType GetInnerToRootMatrix (PMMatrix *pMatrix, const ITransform *pRoot=nil) const
 
virtual bool16 IsTransformParentDependent () const
 
virtual IPMUnknownQueryTransformParent ()
 
virtual void ConcatItemTransform (IGraphicsPort *gPort)
 
- Public Member Functions inherited from CPMUnknown< ITransform >
IPMUnknownQueryInterface (PMIID interfaceID) const
 
void AddRef () const
 
void Release () const
 
void PreDirty (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
void PreDirtyNoMessage (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
 CPMUnknown (const CPMUnknown &)=delete
 
CPMUnknownoperator= (const CPMUnknown &)=delete
 

Protected Member Functions

bool16 MoveAndPositiveScaleOnly (void) const
 
void UpdateInverseCTM () const
 
- Protected Member Functions inherited from CPMUnknown< ITransform >
 CPMUnknown (IPMUnknown *boss)
 

Protected Attributes

PMMatrix fCTM
 
PMMatrix fInverseCTM
 
bool16 fInverseIsCurrent
 
- Protected Attributes inherited from CPMUnknown< ITransform >
HelperInterface fHelperInterface
 

Additional Inherited Members

- Public Types inherited from ITransform
enum  { kDefaultIID = IID_ITRANSFORM }
 
enum  MatrixType { kDynamicMatrix, kStaticMatrix }
 

Member Function Documentation

virtual void CTransform::ConcatItemTransform (IGraphicsPortgPort)
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.

Implements ITransform.

virtual const PMMatrix& CTransform::GetInnerToParentMatrix () const
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.

Implements ITransform.

virtual PMReal CTransform::GetItemRotationAngle () const
virtual

Get item's rotate angle.

Returns
PMReal rotate angle ranges from 0 to 360.

Implements ITransform.

virtual PMReal CTransform::GetItemScaleX () const
virtual

Get item's x direction scale percentage.

Returns
PMReal x scale percentage.

Implements ITransform.

virtual PMReal CTransform::GetItemScaleY () const
virtual

Get item's y direction scale percentage.

Returns
PMReal y scale percentage.

Implements ITransform.

virtual PMReal CTransform::GetItemSkewAngle () const
virtual

Get item's x direction skew angle.

Returns
PMReal the angle ranges from -90 to 90.

Implements ITransform.

virtual const PMMatrix& CTransform::GetParentToInnerMatrix () const
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.

Implements ITransform.

virtual bool16 CTransform::IsTransformParentDependent () const
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.

Implements ITransform.

virtual IPMUnknown* CTransform::QueryTransformParent ()
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.

Implements ITransform.

virtual void CTransform::RotateItemBy (PMReal angle,
const PBPMPointcenter 
)
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.

Implements ITransform.

virtual void CTransform::RotateItemTo (PMReal angle,
const PBPMPointcenter 
)
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.

Implements ITransform.

virtual void CTransform::ScaleItemBy (PMReal xScale,
PMReal yScale,
const PMPointcenter 
)
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.

Implements ITransform.

virtual void CTransform::ScaleItemTo (PMReal xScale,
PMReal yScale,
const PMPointcenter 
)
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.

Implements ITransform.

virtual void CTransform::SetInnerToParentMatrix (const PMMatrixmatrix)
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.

Implements ITransform.

virtual void CTransform::SkewItemBy (PMReal xSkewAngle,
const PMPointcenter 
)
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.

Implements ITransform.

virtual void CTransform::SkewItemTo (PMReal xSkewAngle,
const PMPointcenter 
)
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.

Implements ITransform.

virtual void CTransform::TranslateItemBy (const PBPMPointdelta)
virtual

Move item with delta amount of distance.

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

Implements ITransform.

virtual void CTransform::TranslateItemTo (const PBPMPointlocation)
virtual

Move item to the specified location.

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

Implements ITransform.