![]() | InDesign SDK 20.5 |
#include <PMPoint.h>
Public Types | |
| typedef base_type | data_type |
Public Member Functions | |
| constexpr | PMPoint () noexcept |
| constexpr | PMPoint (const PMPoint &) noexcept=default |
| constexpr | PMPoint (PMPoint &&) noexcept=default |
| PMPoint & | operator= (const PMPoint &) noexcept=default |
| PMPoint & | operator= (PMPoint &&) noexcept=default |
| constexpr | PMPoint (const PMReal &x_orig, const PMReal &y_orig) noexcept |
| constexpr | PMPoint (const SysPoint &p) noexcept |
| const PMReal & | X () const noexcept |
| PMReal & | X () noexcept |
| void | X (const PMReal &xParam) noexcept |
| const PMReal & | Y () const noexcept |
| PMReal & | Y () noexcept |
| void | Y (const PMReal &yParam) noexcept |
| PMReal | Distance (const PMPoint &otherPt) const |
| PMReal | VectorLength () const |
| PMReal | VectorAngle () const |
| PMPoint | MirrorPoint (const PMPoint &aligningPoint) const |
| PMPoint | ProjectOnLine (const PMPoint &pt0, const PMPoint &ptA) const |
| void | operator+= (const PMPoint &a) |
| void | operator-= (const PMPoint &a) |
| bool | operator< (const PMPoint &rhs) const noexcept |
| bool16 | ConstrainTo (const PMRect &r) |
| void | Round () |
| void | ReadWrite (IPMStream *iPMStream) |
Friends | |
| class | PMRect |
| SysPoint | ToSys (const PMPoint &pt) |
| PMPoint | operator+ (const PMPoint &a, const PMPoint &b) |
| PMPoint | operator- (const PMPoint &a, const PMPoint &b) |
| PMPoint | operator- (const PMPoint &a) |
| PMPoint | operator* (const PMReal &c, const PMPoint &pt) |
| PMPoint | operator* (const PMPoint &pt, const PMReal &c) |
| PMPoint | operator* (const PMPoint &a, const PMPoint &b) |
| PMPoint | operator/ (const PMPoint &numer, const PMPoint &denom) |
| PMPoint | operator/ (const PMPoint &numer, const PMReal &denom) |
| bool16 | operator== (const PMPoint &a, const PMPoint &b) noexcept |
| bool16 | operator!= (const PMPoint &a, const PMPoint &b) noexcept |
Simple class for representing a point in InDesign. Also used to represent a vector. Many of the operations supported by PMPoint interpret the point as a vector - PMPoints may be added together, multiplied by scalar values, have their lengths taken, etc.
| inlinenoexcept |
Default constructor. Initializes this point to the origin (0, 0).
| defaultnoexcept |
Copy/move constructor & assignments. Initializes this point to the same values as the source point.
| aPoint | IN The point to copy |
Constructs this point using specified PMReal x- and y-values.
| x_orig | IN The x-value for this point |
| y_orig | IN The y-value for this point |
| inlinenoexcept |
Constructs this point from a system point.
| p | IN The system point this point is initialized to |
| bool16 PMPoint::ConstrainTo | ( | const PMRect & | r | ) |
Constrains this point to the specified rectangle
| r | IN The rectangle to constrain to |
Returns the distance (a^2 + b^2 = c^2) from this point to the otherPt
| otherPt | IN The other point for the distance calculation |
Returns the mirror of this point, using the specified alignment point.
| aligningPoint | IN The point about which the mirror point is calculated |
| inline |
Increments this point by the specified (vector) point
| a | IN The amount by which to increment (as a vector) |
| inline |
Decrements this point by the specified (vector) point
| a | IN The amount by which to decrement (as a vector) |
| inlinenoexcept |
Define a partial ordering on PMPoints so they can be used in associative containers
Projects this point to the line defined by pt0, ptA, keeping the distance to pt0 unchanged.
| pt0 | IN The first point defining the line to project to |
| ptA | IN The second point defining the line to project to |
| void PMPoint::ReadWrite | ( | IPMStream * | iPMStream | ) |
Streams this point to an IPMStream. The point is written out if the stream is writing, and is read in if the stream is reading.
| iPMStream | IN The stream to which this point is written or read |
| inline |
Rounds this point's x- and y-values.
| PMReal PMPoint::VectorAngle | ( | ) | const |
Returns the angle (in degrees) of this point, interpreted as a vector
| inline |
Returns the length of the vector represented by this point
| inlinenoexcept |
Const-accessor for this point's x-value.
| inlinenoexcept |
Non-const-accessor for this point's x-value.
| inlinenoexcept |
Sets the x-value for this point.
| xParam | IN The new x-value for this point |
| inlinenoexcept |
Const-accessor for this point's y-value.
| inlinenoexcept |
Non-const-accessor for this point's y-value.
| inlinenoexcept |
Sets the y-value for this point.
| yParam | IN The new y-value for this point |
Compares two points for inequality.
| a | IN First point to compare |
| b | IN Second point to compare |
Multiplies a point by a scalar: result = PMPoint(pt.x * c, pt.y * c)
| c | IN The scalar to multiply by |
| pt | IN The point to multiply by |
Multiplies a point by a scalar: result = PMPoint(pt.x * c, pt.y * c)
| pt | IN The point to multiply by |
| c | IN The scalar to multiply by |
Multiplies two points: result = PMPoint(a.x * b.x, a.y * b.y)
| a | IN The first point to multiply |
| b | IN The second point to multiply |
Adds two points: result = PMPoint(a.x + b.x, a.y + b.y)
| a | IN The first point to add |
| b | IN The second point to add |
Subtracts two points: result = PMPoint(a.x - b.x, a.y - b.y)
| a | IN The first point to subtract |
| b | IN The second point to subtract |
Negates a point: result = PMPoint(-a.x, -a.y)
| a | IN The point to negate |
Divides a point by a scalar: result = PMPoint(numer.x / denom, numer.y / denom)
| numer | IN The point being divided |
| denom | IN The scalar denominator |
Compares two points for equality.
| a | IN First point to compare |
| b | IN Second point to compare |