![]() | InDesign SDK 20.5 |
#include <PMLineSeg.h>
Public Member Functions | |
| PMLineSeg () | |
| PMLineSeg (const PMPoint &P1, const PMPoint &P2) | |
| PMLineSeg (const PMPoint &P1, const PMReal &xDistance, const PMReal &yDistance) | |
| PMLineSeg (const PMReal &p1x, const PMReal &p1y, const PMReal &p2x, const PMReal &p2y) | |
| bool16 | IsHorizontal () const |
| bool16 | IsVertical () const |
| PMReal | DeltaX () const |
| PMReal | DeltaY () const |
| const PMPoint & | TopPoint () const |
| const PMPoint & | BottomPoint () const |
| const PMReal & | Top () const |
| PMReal & | Top () |
| void | Top (const PMReal &newP1y) |
| const PMReal & | Bottom () const |
| PMReal & | Bottom () |
| void | Bottom (const PMReal &newP2y) |
| const PMReal & | Left () const |
| PMReal & | Left () |
| void | Left (const PMReal &newLeft) |
| const PMReal & | Right () const |
| PMReal & | Right () |
| void | Right (const PMReal &newRight) |
| void | SetX (const PMReal &x1, const PMReal &x2) |
| void | SetY (const PMReal &y1, const PMReal &y2) |
| void | SetHorizontal (const PMReal &x1, const PMReal &x2) |
| void | SetVertical (const PMReal &y1, const PMReal &y2) |
| PMLineSeg & | MoveRel (const PMReal &dx, const PMReal &dy) |
| PMLineSeg & | MoveRel (const PMPoint &point) |
Friends | |
| bool16 | operator== (const PMLineSeg &a, const PMLineSeg &b) |
| bool16 | operator!= (const PMLineSeg &a, const PMLineSeg &b) |
A C++ class for line segment. This line segment is defined by two points.
| inline |
The default constructor makes no assumptions about what a default line is.
Creates a line given two points. (Current) usage is such that, usually P1 is "less than" P2, resulting in DeltaY being positive. We assert the fact that P1.Y() < P2.Y(). The x-dimension can be arbitrary. Therefore it is assumed that P1 is the top point and P2 the bottom.
| P1 | is the first point. |
| P2 | is the second point. |
| inline |
Creates a line given a point and x and y distances. It is assumed that P1 is the top point and P2 the bottom
| P1 | is the point. |
| xDistance | is the distance to the y-axis (P2). |
| yDistance | is the distance to the x-axis (P2). |
| inline |
Cosntruct a line given two points as x and y each. It is assumed that P1 is the top point and P2 the bottom
| p1x | is the x position of the first point (P1). |
| p1y | is the y position of the first point (P1). |
| p1x | is the x position of the second point (P2). |
| p1y | is the y position of the second point (P2). |
| inline |
the bottom point y value.
| inline |
Return the bottom point y value. Caution when using this method - you should ASSERT(fTop.Y() <= fBottom.Y()); the bottom point y value.
| inline |
Set the bottom point y value.
| newP2y | is the new y value for bottom point. |
| inline |
the bottom point.
| inline |
| inline |
| inline |
| inline |
| inline |
| inline |
| inline |
Set the new left value
| newLeft | specifies the new left value. |
Move the line segmenet by delta amount in both x and y direction.
| dx | the amount in x position to move. |
| dy | is the amount in y position to move. |
Move the line segmenet by delta amount in both x and y direction specified by point.
| point | the amount to move. |
| inline |
| inline |
| inline |
Set the new right value
| newRight | specifies the new right value. |
Turn the line segment to a horizontal line that passes through x1 and x2.
| x1 | is the new left value for the horizontal line. |
| x2 | is the new right value for the horizontal line. |
Turn the line segment to a vertical line that passes through y1 and y2.
| y1 | is the new top value for the vertical line. |
| y2 | is the new bottom value for the vertical line. |
Set the new x values for top and bottom points.
| x1 | is the x value for the top point. |
| x2 | is the x value for the bottom point. |
Set the new top and bottom value for the points.
| y1 | is the new top value for the top point. |
| y2 | is the new bottom value for the bottom point. |
| inline |
the top point y value.
| inline |
Return the top point y value. Caution when using this method - you should ASSERT(fTop.Y() <= fBottom.Y()); the top point y value.
| inline |
Set the top point y value.
| newP1y | is the new y value for top point. |
| inline |
the top point.
Return true if two PMLineSeg are not equal.
| a | is first line segment. |
| b | is second line segment. |