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

#include <IPathGeometry.h>

Inheritance diagram for IPathGeometry:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IPATHGEOMETRY }
 
enum  { kDefaultPathSize = 8 }
 

Public Member Functions

virtual int32 GetNumPaths () const =0
 
virtual int32 GetNumPoints (int32 whichPath) const =0
 
virtual int32 GetNumSegments (int32 whichPath) const =0
 
virtual PMPathSegmentType GetNthSegment (int32 whichPath, int32 whichSegment, PMPathPointList &pathPtList) const =0
 
virtual const PMPathPointGetNthPoint (int32 whichPath, int32 n) const =0
 
virtual void GetNthPath (int32 whichPath, PMPathPointList &pathPtList) const =0
 
virtual int32 GetTotalPoints () const =0
 
virtual bool16 IsEmpty () const =0
 
virtual bool16 IsSinglePoint (PMPathPoint *pt=nil) const =0
 
virtual bool16 IsMultiPoint () const =0
 
virtual int32 AddNewPath (int32 preallocatePoints=kDefaultPathSize)=0
 
virtual void InsertNewPath (int32 before, int32 preallocatePoints=kDefaultPathSize)=0
 
virtual ErrorCode RemoveNthPath (int32 whichPath)=0
 
virtual void RemoveAllPaths ()=0
 
virtual void RemoveAllButNthPath (int32 whichPath)=0
 
virtual ErrorCode AddPoint (int32 whichPath, const PMPathPoint &pt)=0
 
virtual ErrorCode RemoveNthPoint (int32 whichPath, int32 z)=0
 
virtual ErrorCode RemoveAllPoints (int32 whichPath)=0
 
virtual ErrorCode InsertNthPoint (int32 whichPath, int32 before, const PMPathPoint &pt)=0
 
virtual ErrorCode ModifyNthPoint (int32 whichPath, int32 index, const PMPathPoint &pt)=0
 
virtual void CopyPath (IPathGeometry *fromPath)=0
 
virtual void CopyNthPath (int32 copyToPathIndex, IPathGeometry *fromPath, int32 copyFromPathIndex)=0
 
virtual PMRect GetCtrlPointsBoundingBox (const PMMatrix &theMatrix) const =0
 
virtual PMRect GetCtrlPointsBoundingBox () const =0
 
virtual void SetCtrlPointsBoundingBox (const PMRect &newPtBBox)=0
 
virtual void SetCtrlPointsBoundingBox (const PMMatrix &theMatrix, const PMRect &newPtBBox)=0
 
virtual PMRect GetPathBoundingBox (const PMMatrix &theMatrix) const =0
 
virtual PMRect GetPathBoundingBox () const =0
 
virtual void SetPathBoundingBox (const PMMatrix &theMatrix, const PMRect &newBBox)=0
 
virtual void SetPathBoundingBox (const PMRect &newBBox)=0
 
virtual void TransformPath (const PMMatrix &theMatrix)=0
 
virtual void TransformPathPoints (const PointSelectorList &pts, const PMMatrix &mat, bool16 ignoreSegments, bool16 permitFlips)=0
 
virtual void GetOutlineInfo (IOutlineInfo *iOutlineInfo) const =0
 
virtual ErrorCode OpenPath (int32 whichPath)=0
 
virtual ErrorCode ClosePath (int32 whichPath)=0
 
virtual bool16 IsPathOpen (int32 whichPath) const =0
 
virtual ErrorCode ReversePath (int32 whichPath)=0
 
virtual void GetOutlineInfo (IOutlineInfo *iOutlineInfo, int32 whichPath) const =0
 
virtual bool16 IsPathClosed (int32 whichPath) const =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

IPathGeometry is designed to support geometric data of straight and curved paths.

Path geometry can contain multiple paths. Each path is either open (the default) or closed. The relationship between the paths is only that they exist as part of the same object.

IPathGeometry is a required interface of spline type page items.

Member Enumeration Documentation

anonymous enum

Define the default interface IID as IID_IPATHGEOMETRY.

anonymous enum

kDefaultPathSize = 8 which defines the default number of path points for each path is 8.

Member Function Documentation

virtual int32 IPathGeometry::AddNewPath (int32 preallocatePoints = kDefaultPathSize)
pure virtual

Appends a new path to the object.

Parameters
preallocatePoints[IN] parameter an optimization which allows the IPathGeometry implementation to pre-allocate a large enough path if the number of points to add is known ahead of time.
Returns
int32 the index of the new path in the object.
virtual ErrorCode IPathGeometry::AddPoint (int32 whichPath,
const PMPathPointpt 
)
pure virtual

Add the point to whichPath. The path must have been created with AddNewPath(). If whichPath doesn't exist the call fails.

Parameters
whichPath[IN] parameter specifies the index of path on the object.
pt[IN] parameter the specified path point.
Returns
ErrorCode result of the operation.
virtual ErrorCode IPathGeometry::ClosePath (int32 whichPath)
pure virtual

Mark the path as closed.

Parameters
whichPath[IN] parameter specifies the index of path on the object.
Returns
ErrorCode result of the operation.
virtual void IPathGeometry::CopyNthPath (int32 copyToPathIndex,
IPathGeometryfromPath,
int32 copyFromPathIndex 
)
pure virtual

Replaces a subpath in this with a subpath copied from another path object. If copyToPathIndex is not a valid path index in this, a new path is appended to this instead.

Parameters
copyToPathIndex[IN] parameter the path index of target object(this).
fromPath[IN] parameter the path geometry information of the source object.
copyFromPathIndex[IN] parameter the path index of source object.
Returns
void.
virtual void IPathGeometry::CopyPath (IPathGeometryfromPath)
pure virtual

Copies all paths from fromPath to this. Implicitly removes existing paths in this before copying.

Parameters
fromPath[IN] parameter specifies the source path geometry information which we copy from.
Returns
void.
virtual PMRect IPathGeometry::GetCtrlPointsBoundingBox (const PMMatrixtheMatrix) const
pure virtual

Get the bounding box of all points and all paths with specified coordicate system.

Parameters
theMatrix[IN] parameter indicates which coordicnate space to compute the result bounding box such as InnerToPasteboard.
Returns
PMRect the result bounding box.
virtual PMRect IPathGeometry::GetCtrlPointsBoundingBox () const
pure virtual

Get the bounding box of all points and all paths with inner coordinate system.

Returns
PMRect the result bounding box.
virtual void IPathGeometry::GetNthPath (int32 whichPath,
PMPathPointListpathPtList 
) const
pure virtual

Get the path points information that make up the nth path.

Parameters
whichPath[IN] parameter specifies the index of path on the object.
pathPtList[OUT] parameter stored the returned path point list.
Returns
void.
virtual const PMPathPoint& IPathGeometry::GetNthPoint (int32 whichPath,
int32 n 
) const
pure virtual

Get the nth point information associated with whichPath and the which point.

Parameters
whichPath[IN] parameter specifies the index of path on the object.
n[IN] parameter specified which point.
Returns
const PMPathPoint& the information of nth point on the given path.
See Also
PMPathPoint.h for the definition of PMPathPoint.
virtual PMPathSegmentType IPathGeometry::GetNthSegment (int32 whichPath,
int32 whichSegment,
PMPathPointListpathPtList 
) const
pure virtual

Get the list of path points associated with whichPath and whichSegment.

Parameters
whichPath[IN] parameter specifies the index of path on the object.
whichSegment[IN] parameter specified which segment within the give path.
pathPtList[OUT] parameter stored the returned path point list.
Returns
PMPathSegmentType type of segments that could be line, curve or no segment.
See Also
PathTypes.h for the definition of PMPathSegmentType.
PathPathPoint.h for the definition of PMPathPointList.
virtual int32 IPathGeometry::GetNumPaths () const
pure virtual

Get the total number of paths of this item.

Returns
int32 the total number of paths.
virtual int32 IPathGeometry::GetNumPoints (int32 whichPath) const
pure virtual

Get the total number of points associated with whichPath.

Parameters
whichPath[IN] parameter specifies the index of path on the object.
Returns
int32 total number of points, return 0 if whichPath is out of range.
virtual int32 IPathGeometry::GetNumSegments (int32 whichPath) const
pure virtual

Get the total number of actual segments associated with whichPath.

Parameters
whichPath[IN] parameter specifies the index of path on the object.
Returns
int32 total number of segments, returns 0 if whichPath is out of range.
virtual void IPathGeometry::GetOutlineInfo (IOutlineInfoiOutlineInfo) const
pure virtual

Get the outline information of all paths. Iterate over all paths and call back via iOutlineInfo.

Parameters
iOutlineInfo[IN] parameter used as the call back function.
Returns
void.
virtual void IPathGeometry::GetOutlineInfo (IOutlineInfoiOutlineInfo,
int32 whichPath 
) const
pure virtual

Get the outline information of the given path. Iterate over a path and call back via iOutlineInfo.

Parameters
iOutlineInfo[IN] parameter used as the call back function.
whichPath[IN] parameter specifies the index of path on the object.
virtual PMRect IPathGeometry::GetPathBoundingBox (const PMMatrixtheMatrix) const
pure virtual

Get the bounding box of the path excluding ctrl points.

Parameters
theMatrix[In] parameter indicates which space to compute the box such as InnerToPasteboard.
Returns
PMRect the result bounding box.
virtual PMRect IPathGeometry::GetPathBoundingBox () const
pure virtual

Get the bounding box of the path in inner coordinate system.

Returns
PMRect the result bounding box.
virtual int32 IPathGeometry::GetTotalPoints () const
pure virtual

Get the total number of points on all paths (if any).

Returns
int32 the total number of points.
virtual void IPathGeometry::InsertNewPath (int32 before,
int32 preallocatePoints = kDefaultPathSize 
)
pure virtual

Inserts a new path to the object.

Parameters
before[IN] parameter the location where we insert into.
preallocatePoints[IN] param an optimization which allows the IPathGeometry implementation to pre-allocate a large enough path if the number of points to add is known ahead of time.
Returns
void.
virtual ErrorCode IPathGeometry::InsertNthPoint (int32 whichPath,
int32 before,
const PMPathPointpt 
)
pure virtual

Insert point on the path.

Parameters
whichPath[IN] parameter specifies the index of path on the object.
before[IN] parameter specifies the location of the point to be inserted into.
pt[IN] parameter the point information that is inserted.
Returns
ErrorCode result of the operation.
virtual bool16 IPathGeometry::IsEmpty () const
pure virtual

Check if there are any points on any of the paths (if any).

Returns
bool16 kTrue if there is no points at all, otherwise kFalse.
virtual bool16 IPathGeometry::IsMultiPoint () const
pure virtual

Check if there are two or more points in the object.

Returns
bool16 kTrue if there are multiple points, otherwise kFalse.
virtual bool16 IPathGeometry::IsPathClosed (int32 whichPath) const
pure virtual

Check if the specified path is closed or not.

Parameters
whichPath[IN] parameter specifies the index of path on the object.
Returns
bool16 kTrue if path is closed, otherwise kFalse.
virtual bool16 IPathGeometry::IsPathOpen (int32 whichPath) const
pure virtual

Check if the specified path is open or not.

Parameters
whichPath[IN] parameter specifies the index of path on the object.
Returns
bool16 kTrue if path is closed, otherwise kFalse.
virtual bool16 IPathGeometry::IsSinglePoint (PMPathPointpt = nil) const
pure virtual

Check if there is only a single point in the object.

Parameters
pt[OUT] parameter that is set to the single point (if any).
Returns
kTrue if there is only a single point, otherwise kFalse.
virtual ErrorCode IPathGeometry::ModifyNthPoint (int32 whichPath,
int32 index,
const PMPathPointpt 
)
pure virtual

Modify the point on the path.

Parameters
whichPath[IN] parameter specifies the index of path on the object.
before[IN] parameter specifies the location of the point to be inserted into.
pt[IN] parameter the point information that is inserted.
Returns
ErrorCode result of the operation.
virtual ErrorCode IPathGeometry::OpenPath (int32 whichPath)
pure virtual

Mark the path as open.

Parameters
whichPath[IN] parameter specifies the index of path on the object.
Returns
ErrorCode result of the operation.
virtual void IPathGeometry::RemoveAllButNthPath (int32 whichPath)
pure virtual

Remove all paths and their associated points on those path except the specified path.

Parameters
whichPath[IN] parameter specifies the index of path on the object that will NOT be removed.
Returns
void.
virtual void IPathGeometry::RemoveAllPaths ()
pure virtual

Remove all paths and points of the object.

Returns
void.
virtual ErrorCode IPathGeometry::RemoveAllPoints (int32 whichPath)
pure virtual

Remove all the points of whichPath. Don't delete the path itself.

Parameters
whichPath[IN] parameter specifies the index of path on the object.
Returns
ErrorCode result of the operation.
virtual ErrorCode IPathGeometry::RemoveNthPath (int32 whichPath)
pure virtual

Remove the specified path and all associated points on the path.

Parameters
whichPath[IN] parameter specifies the index of path on the object.
Returns
ErrorCode result of the operation.
virtual ErrorCode IPathGeometry::RemoveNthPoint (int32 whichPath,
int32 z 
)
pure virtual

Remove the nth point from the given path.

Parameters
whichPath[IN] parameter specifies the index of path on the object.
z[IN] parameter the index of point on whichPath.
Returns
ErrorCode result of the operation.
virtual ErrorCode IPathGeometry::ReversePath (int32 whichPath)
pure virtual

Reverse the path.

Parameters
whichPath[IN] parameter specifies the index of path on the object.
Returns
ErrorCode result of the operation.
virtual void IPathGeometry::SetCtrlPointsBoundingBox (const PMRectnewPtBBox)
pure virtual

Set the bounding box in inner coordinate system.

Parameters
newPtBBox[IN] parameter specified the new bounding box.
Returns
void.
virtual void IPathGeometry::SetCtrlPointsBoundingBox (const PMMatrixtheMatrix,
const PMRectnewPtBBox 
)
pure virtual

Set the bounding box with the specified coordinate system.

Parameters
theMatrix[In] parameter that may change the transform of the item depending on the implementation of IPathGeometry.
newBBox[In] parameter used to set the new bounding box.
Returns
void.
virtual void IPathGeometry::SetPathBoundingBox (const PMMatrixtheMatrix,
const PMRectnewBBox 
)
pure virtual

Set the bounding box of the path excluding ctrl points.

Parameters
theMatrix[IN] parameter indicates which space to compute the bounding box such as InnerToPasteboard.
newBBox[In] parameter used to set the new bounding box.
Returns
void.
virtual void IPathGeometry::SetPathBoundingBox (const PMRectnewBBox)
pure virtual

Set the path bounding box in inner coordinate system.

Parameters
newBBox[In] parameter used to set the new bounding box.
Returns
void.
virtual void IPathGeometry::TransformPath (const PMMatrixtheMatrix)
pure virtual

Iterate over all the path and transform them based on the given matrix.

Parameters
theMatrix[IN] parameter indicates which coordinate system to use to transform such as InnerToPasteboard.
Returns
void.
virtual void IPathGeometry::TransformPathPoints (const PointSelectorListpts,
const PMMatrixmat,
bool16 ignoreSegments,
bool16 permitFlips 
)
pure virtual

Iterate over all path points and transform them based on the given matrix. Does not ignore locked item.

Parameters
pts[IN] parameter indicates which points should be transformed in this object.
mat[IN] parameter indicates which coordinate system to use to transform such as InnerToPasteboard.
ignoreSegments[IN] parameter indicates if we should exclude segments or not.
permitFlips[IN] parameter indicates if we allow to flip or not.
Returns
void.