InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IPathGeometry.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Scott Chai
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //
23 // Purpose:
24 // IPathGeometry is designed to support geometric data of straight and curved paths.
25 //
26 // Path geometry can contain multiple paths. Each path is either open (the default) or closed.
27 // The relationship between the paths is only that they exist as part of the same object
28 //
29 // IPathGeometry is a required interface of spline type page items.
30 //
31 //========================================================================================
32 
33 #ifndef __IPathGeometry__
34 #define __IPathGeometry__
35 
36 #include "IPMUnknown.h"
37 #include "GraphicsID.h"
38 #include "PMPathPoint.h"
39 
40 class PMMatrix;
41 class PMRect;
42 class PMPathPoint;
43 class IOutlineInfo;
44 
53 class IPathGeometry : public IPMUnknown
54 {
55 public:
59  enum { kDefaultIID = IID_IPATHGEOMETRY } ;
60 
64  enum { kDefaultPathSize = 8 };
65 
71  virtual int32 GetNumPaths() const = 0;
72 
79  virtual int32 GetNumPoints(int32 whichPath) const = 0;
80 
87  virtual int32 GetNumSegments(int32 whichPath) const = 0;
88 
99  virtual PMPathSegmentType GetNthSegment( int32 whichPath, int32 whichSegment, PMPathPointList& pathPtList ) const = 0 ;
100 
109  virtual const PMPathPoint& GetNthPoint(int32 whichPath, int32 n) const = 0;
110 
118  virtual void GetNthPath( int32 whichPath, PMPathPointList& pathPtList ) const = 0 ;
119 
125  virtual int32 GetTotalPoints() const = 0 ;
126 
132  virtual bool16 IsEmpty() const = 0 ;
133 
140  virtual bool16 IsSinglePoint( PMPathPoint* pt = nil ) const = 0 ;
141 
147  virtual bool16 IsMultiPoint() const = 0 ;
148 
156  virtual int32 AddNewPath(int32 preallocatePoints = kDefaultPathSize) = 0;
157 
166  virtual void InsertNewPath( int32 before, int32 preallocatePoints = kDefaultPathSize ) = 0 ;
167 
174  virtual ErrorCode RemoveNthPath(int32 whichPath) = 0;
175 
181  virtual void RemoveAllPaths() = 0;
182 
189  virtual void RemoveAllButNthPath( int32 whichPath ) = 0 ;
190 
199  virtual ErrorCode AddPoint(int32 whichPath, const PMPathPoint &pt) = 0;
200 
208  virtual ErrorCode RemoveNthPoint(int32 whichPath, int32 z) = 0;
209 
216  virtual ErrorCode RemoveAllPoints (int32 whichPath) = 0;
217 
226  virtual ErrorCode InsertNthPoint(int32 whichPath, int32 before, const PMPathPoint &pt) = 0;
227 
236  virtual ErrorCode ModifyNthPoint(int32 whichPath, int32 index, const PMPathPoint& pt) = 0;
237 
244  virtual void CopyPath (IPathGeometry* fromPath) = 0;
245 
255  virtual void CopyNthPath( int32 copyToPathIndex, IPathGeometry* fromPath, int32 copyFromPathIndex ) = 0 ;
256 
263  virtual PMRect GetCtrlPointsBoundingBox(const PMMatrix& theMatrix) const = 0;
264 
270  virtual PMRect GetCtrlPointsBoundingBox() const = 0;
271 
278  virtual void SetCtrlPointsBoundingBox (const PMRect& newPtBBox) = 0;
279 
287  virtual void SetCtrlPointsBoundingBox (const PMMatrix& theMatrix, const PMRect& newPtBBox) = 0;
288 
295  virtual PMRect GetPathBoundingBox(const PMMatrix& theMatrix) const = 0;
296 
302  virtual PMRect GetPathBoundingBox() const = 0;
303 
311  virtual void SetPathBoundingBox(const PMMatrix& theMatrix, const PMRect& newBBox) = 0;
312 
319  virtual void SetPathBoundingBox(const PMRect& newBBox) = 0;
320 
327  virtual void TransformPath (const PMMatrix& theMatrix) = 0;
328 
338  virtual void TransformPathPoints( const PointSelectorList& pts,
339  const PMMatrix& mat,
340  bool16 ignoreSegments,
341  bool16 permitFlips ) = 0;
342 
349  virtual void GetOutlineInfo (IOutlineInfo* iOutlineInfo) const = 0;
350 
357  virtual ErrorCode OpenPath(int32 whichPath) = 0;
358 
365  virtual ErrorCode ClosePath(int32 whichPath) = 0;
366 
373  virtual bool16 IsPathOpen(int32 whichPath) const = 0;
374 
381  virtual ErrorCode ReversePath( int32 whichPath ) = 0 ;
382 
389  virtual void GetOutlineInfo( IOutlineInfo* iOutlineInfo, int32 whichPath ) const = 0 ;
390 
397  virtual bool16 IsPathClosed( int32 whichPath ) const = 0 ;
398 } ;
399 
400 #endif // __IPathGeometry__