![]() | InDesign SDK 20.5 |
#include <PMPathPoint.h>
Public Types | |
| typedef base_type | data_type |
Public Member Functions | |
| constexpr | PMPathPoint () noexcept |
| PMPathPoint (PMPathPointType pointType, const PMPointList &ptList) | |
| PMPathPoint (PMPathPointType pointType, const PMPoint &leftDirPt, const PMPoint &anchorPt, const PMPoint &rightDirPt) | |
| PMPathPoint (const PMPointList &ptList) | |
| PMPathPoint (const PMPoint &linePt) noexcept | |
| PMPathPoint (const PMPoint &leftDirPt, const PMPoint &anchorPt, const PMPoint &rightDirPt) | |
| const PMPoint & | GetPoint (PathPointIndex ptIndex) const |
| const PMPoint & | GetLeftDirPoint () const noexcept |
| const PMPoint & | GetAnchorPoint () const noexcept |
| const PMPoint & | GetRightDirPoint () const noexcept |
| PMPathPointType | GetAnchorType () const noexcept |
| void | ModifyPoint (PathPointIndex ptIndex, const PMPoint &newPoint, bool16 bMirrorPt=kFalse, PMRect *constrainRect=nil) |
| void | SetPoint (PathPointIndex ptIndex, const PMPoint &newPoint) |
| void | SetLeftDirPoint (const PMPoint &newPoint) noexcept |
| void | SetAnchorPoint (const PMPoint &newPoint) noexcept |
| void | SetRightDirPoint (const PMPoint &newPoint) noexcept |
| void | Flip () |
| void | ModifyAnchorType (PMPathPointType newType) |
| PMRect | GetBoundingBox () const |
| void | TransformPoints (const PMMatrix &xForm) |
| bool16 | HitTest (const PMRect &hitRect, PathPointIndex &whichPt, const PMReal &handleSize=0.0) const |
| void | ReadWrite (IPMStream *iPMStream) |
| void | operator*= (const PMReal &a) |
| void | operator/= (const PMReal &a) |
| PMPathPoint (const PMPathPoint &rhs) noexcept=default | |
| PMPathPoint (PMPathPoint &&rhs) noexcept=default | |
| PMPathPoint & | operator= (const PMPathPoint &rhs) noexcept=default |
| PMPathPoint & | operator= (PMPathPoint &&rhs) noexcept=default |
Friends | |
| PMPathPoint | operator* (const PMReal &c, const PMPathPoint &pt) |
| PMPathPoint | operator* (const PMPathPoint &pt, const PMReal &c) |
| PMPathPoint | operator/ (const PMPathPoint &numer, const PMReal &denom) |
| bool16 | operator== (const PMPathPoint &a, const PMPathPoint &b) noexcept |
| bool16 | operator!= (const PMPathPoint &a, const PMPathPoint &b) noexcept |
Data class for a InDesign path point.
| inlinenoexcept |
Constructs a line path point at 0,0.
| PMPathPoint::PMPathPoint | ( | PMPathPointType | pointType, |
| const PMPointList & | ptList | ||
| ) |
Construct a path point of type PMPathPointType fromt a list of points. If pointType is kL, ptList.Length() == 1. If pointType is kCS or kCK ptList.Length() == 3. For both kCS and kCK the first point is the left dir pt, the second point is the anchor point, and the third point is the right dir pt.
| pointType | specifies the path point type. |
| ptList | is the list of points. |
| PMPathPoint::PMPathPoint | ( | PMPathPointType | pointType, |
| const PMPoint & | leftDirPt, | ||
| const PMPoint & | anchorPt, | ||
| const PMPoint & | rightDirPt | ||
| ) |
Construct a path point of type PMPathPointType. If pointType is kL, only leftDirPt needs to be specified. For both kCS and kCK, three points are required.
| pointType | specifies the path point type. |
| leftDirPt | is the first point. |
| anchorPt | is the second point. |
| rightDirPt | is the third point. |
| PMPathPoint::PMPathPoint | ( | const PMPointList & | ptList | ) |
Construct a path point heuristically. If the length of ptList is 1 then create a line (kL) path point. If the length of ptList is 3 then create a kCS if the direction points are on the same line, or create a kCK if the direction points are discontinuous. If length is 3 the order is leftDirPt, anchorPt, rightDirPt.
| ptList | is the list of at least one point or at most three points. |
| noexcept |
Construct a line path point
| PMPathPoint::PMPathPoint | ( | const PMPoint & | leftDirPt, |
| const PMPoint & | anchorPt, | ||
| const PMPoint & | rightDirPt | ||
| ) |
Construct a curve pt, determining kCK or kCS from the direction points
| void PMPathPoint::Flip | ( | ) |
Set right direction point to location of left direciont pt and vice versa
| noexcept |
| noexcept |
Returns the anchor type. This should be one of kL, kCS, or kCK.
| PMRect PMPathPoint::GetBoundingBox | ( | ) | const |
Returns the bounding box of the point. If a single point the bbox is empty centered on the point.
| noexcept |
| const PMPoint& PMPathPoint::GetPoint | ( | PathPointIndex | ptIndex | ) | const |
| noexcept |
| bool16 PMPathPoint::HitTest | ( | const PMRect & | hitRect, |
| PathPointIndex & | whichPt, | ||
| const PMReal & | handleSize = 0.0 | ||
| ) | const |
Return the point that falls inside of hitRect. The anchor point is checked first before direction handles.
| hitRect | is the rectangle to test. |
| whichPt | is the index of the path point to test. |
| handleSize | is the optional parameter inciating the size of the relevant handles. |
| void PMPathPoint::ModifyAnchorType | ( | PMPathPointType | newType | ) |
Change the type of the anchor point. If changing to a kL, it removes the extra direction points, if changing to a kCS or kCK from kL it creates the direction points equal to the anchor point.
| newType | is the type of anchor point to change to. |
| void PMPathPoint::ModifyPoint | ( | PathPointIndex | ptIndex, |
| const PMPoint & | newPoint, | ||
| bool16 | bMirrorPt = kFalse, | ||
| PMRect * | constrainRect = nil | ||
| ) |
Modify the point. The point is modified so that the entire path point fits inside the constrain rectangle. bMirrorPt is ignored if the ptIndex points to an anchor point. If ptIndex points to a direction point and the anchor point is kCS then the other direction point is mirrored. if ptIndex points to a direction point, bMirrorPt is false, and the anchor point is kCS, them the other direction point is projected onto the tangent line.
| ptIndex | is the path point index to modify. |
| newPoint | is the new point to set to. |
| bMirrorPt | is ignored if ptIndex points to an anchor point. |
| constrainRect | is the constraining rectangle. |
| void PMPathPoint::ReadWrite | ( | IPMStream * | iPMStream | ) |
Read/Write to the specified stream.
| iPMStream | is the stream to read from or write to. |
| noexcept |
Sets the anchor point with the specified new point.
| newPoint | is the new point to set to. |
| noexcept |
Sets the left direction point with the specified new point.
| newPoint | is the new point to set to. |
| void PMPathPoint::SetPoint | ( | PathPointIndex | ptIndex, |
| const PMPoint & | newPoint | ||
| ) |
Generally you will want to use ModifyPoint to get the expected behavior for the UI, but sometimes you just want to directly set the point.Sets the point index with the new point.
| ptIndex | is the point index to set. |
| newPoint | is the new point to set to. |
| noexcept |
Sets the right direction point with the specified new point.
| newPoint | is the new point to set to. |
| void PMPathPoint::TransformPoints | ( | const PMMatrix & | xForm | ) |
Transform the points with the given matrix.
| xForm | is the matrix to transform with. |
| friend |
Compare two PMPathPoint.
| friend |
Compare two PMPathPoint.