#include <Txq2dLineSeg.h>
Inheritance diagram for Txq2dLineSeg::

Public Methods | |
| Txq2dLineSeg () | |
| Default construction of a Txq2dLineSeg with the default start and end points and default color white. More... | |
| Txq2dLineSeg (int x1, int y1, int x2, int y2) | |
| Constructs with the starting and ending points of the line segment in the real-world cartesian coordinates,. More... | |
| Txq2dLineSeg (QPoint p1, QPoint p2) | |
| Constructs with the starting and ending points of the line segment in the real-world cartesian coordinates. More... | |
| Txq2dLineSeg (TxqDoublePoint p1, TxqDoublePoint p2) | |
| Constructs with the starting and ending points of the line segment in the real-world cartesian coordinates. More... | |
| Txq2dLineSeg (double x1, double y1, double x2, double y2) | |
| Constructs with the starting and ending points of the line segment in the real-world cartesian coordinates. More... | |
| virtual | ~Txq2dLineSeg () |
| The destructor. More... | |
| void | calculateParameters () |
| Calculates the slope, intercept, angle, and bounds of the segment given the current start and end points. More... | |
| void | setBoundsToPoints () |
| Recalculates the bounds given the current starting and ending points. More... | |
| void | setPoints (int x1, int y1, int x2, int y2) |
| Set the starting and ending points of the line segment in the real-world cartesian coordinates,. More... | |
| void | setPoints (QPoint p1, QPoint p2) |
| Set the starting and ending points of the line segment in the real-world cartesian coordinates. More... | |
| void | setPoints (TxqDoublePoint p1, TxqDoublePoint p2) |
| Set the starting and ending points of the line segment in the real-world cartesian coordinates. More... | |
| void | setPoints (double x1, double y1, double x2, double y2) |
| Set the starting and ending points of the line segment in the real-world cartesian coordinates. More... | |
| void | setStartPoint (TxqDoublePoint sp) |
| Set the starting point of the line segment in the real-world cartesian coordinates. More... | |
| void | setStartPoint (int x, int y) |
| Set the starting point of the line segment in the real-world cartesian coordinates. More... | |
| void | setEndPoint (TxqDoublePoint ep) |
| Set the ending point of the line segment in the real-world cartesian coordinates. More... | |
| void | setEndPoint (int x, int y) |
| Set the ending point of the line segment in the real-world cartesian coordinates. More... | |
| void | setPointAndAngle (TxqDoublePoint sp, double myAngle) |
| Resets the line segment to one starting from the point {x1,y1}, having slope m, and having a size marked off by dx in the x-direction and dy in the y-direction. More... | |
| void | stretchToMax () |
| Stretches current line to a large boundary. More... | |
| void | setAngle (double myAngle) |
| Set the slope of the ray. More... | |
| void | setSlope (double m) |
| Set the slope of the line keeping the same intercept. More... | |
| double | getSlope () |
| Gets the current slope. More... | |
| void | setIntercept (double b) |
| Set the y-intercept of the line keeping the same slope. More... | |
| double | getIntercept () |
| Gets the current y-intercept. More... | |
| int | findY (int x) |
| Returns the y value of the line at the specified x position. More... | |
| double | findY (double x) |
| Returns the y value of the line at the specified x position. More... | |
| int | findX (int y) |
| Returns the x value of the line at the specified y position. More... | |
| double | findX (double y) |
| Returns the x value of the line at the specified y position. More... | |
| TxqDoublePoint | intersection (TxqDoublePoint p, double m) |
| Finds the interscetion point of this Txq2dLineSeg with the the ray segment specified by the starting point and slope. More... | |
| TxqDoublePoint | intersection (Txq2dLineSeg segline) |
| Returns the intersection point of this line segment and the specified line segment. More... | |
| QPoint | getPointAtPosition (int pixels) |
| Returns the Point on the ray segment that corresponds to the specified number of pixels away from the start point. More... | |
| bool | inBetweenEnds (TxqDoublePoint p) |
| Returns a bool telling whether a specified point lies inside the bounds defined by the two endpoints. More... | |
| bool | onLineSegment (TxqDoublePoint p) |
| Returns a bool telling whether a specified point lies on the line segment. More... | |
| void | findCenterFromBounds () |
| Makes a center of rotation the starting point instead of the center of the bounds. More... | |
| void | paint (QPainter *g) |
| Paints the line using the end points. More... | |
| void | dump (QTextStream *ts) |
| Dump the objects contents to the text stream ts. More... | |
Protected Methods | |
| virtual void | initialize () |
| initialize the class data members. More... | |
Private Attributes | |
| double | slope |
| The slope value. More... | |
| double | intercept |
| The intercept value. More... | |
| int | numPoints |
| number of points in the line segment. More... | |
Static Private Attributes | |
| const double | MAX_SIZE |
| A MAX_SIXE constant. More... | |
Caution: Much of this class is not tested. One should be careful with the slope intercept and bound calculations.
Copyright 2000 by Tech-X Corporation
Definition at line 42 of file Txq2dLineSeg.h.
|
|
Default construction of a Txq2dLineSeg with the default start and end points and default color white.
|
|
|
Constructs with the starting and ending points of the line segment in the real-world cartesian coordinates,.
|
|
|
Constructs with the starting and ending points of the line segment in the real-world cartesian coordinates.
|
|
|
Constructs with the starting and ending points of the line segment in the real-world cartesian coordinates.
|
|
|
Constructs with the starting and ending points of the line segment in the real-world cartesian coordinates.
|
|
|
The destructor.
|
|
|
Calculates the slope, intercept, angle, and bounds of the segment given the current start and end points.
|
|
|
Dump the objects contents to the text stream ts.
Reimplemented from TxqDrawable. Reimplemented in Txq2dLine, and Txq2dVector. |
|
|
Makes a center of rotation the starting point instead of the center of the bounds.
Reimplemented from TxqDrawable. |
|
|
Returns the x value of the line at the specified y position. If the lines is horizontal then infinity is returned.
|
|
|
Returns the x value of the line at the specified y position. If the lines is horizontal then infinity is returned.
|
|
|
Returns the y value of the line at the specified x position. If the lines is vertical then zero is returned.
|
|
|
Returns the y value of the line at the specified x position. If the lines is vertical then zero is returned.
|
|
|
Gets the current y-intercept.
|
|
|
Returns the Point on the ray segment that corresponds to the specified number of pixels away from the start point.
|
|
|
Gets the current slope.
|
|
|
Returns a bool telling whether a specified point lies inside the bounds defined by the two endpoints.
|
|
|
initialize the class data members.
Reimplemented from TxqDrawable. Reimplemented in Txq2dLine, and Txq2dVector. |
|
|
Returns the intersection point of this line segment and the specified line segment.
|
|
|
Finds the interscetion point of this Txq2dLineSeg with the the ray segment specified by the starting point and slope.
|
|
|
Returns a bool telling whether a specified point lies on the line segment.
|
|
|
Paints the line using the end points.
Reimplemented from Txq2dSeg. Reimplemented in Txq2dLine, and Txq2dVector. |
|
|
Set the slope of the ray. This takes the starting point previous set and along with the specified angle and then calls setPointAndAngle.
Reimplemented from TxqDrawable. |
|
|
Recalculates the bounds given the current starting and ending points.
|
|
|
Set the ending point of the line segment in the real-world cartesian coordinates.
|
|
|
Set the ending point of the line segment in the real-world cartesian coordinates.
Reimplemented from Txq2dSeg. |
|
|
Set the y-intercept of the line keeping the same slope. This is equivalent to translating the line up or down.
|
|
|
Resets the line segment to one starting from the point {x1,y1}, having slope m, and having a size marked off by dx in the x-direction and dy in the y-direction.
|
|
|
Set the starting and ending points of the line segment in the real-world cartesian coordinates.
|
|
|
Set the starting and ending points of the line segment in the real-world cartesian coordinates.
|
|
|
Set the starting and ending points of the line segment in the real-world cartesian coordinates.
|
|
|
Set the starting and ending points of the line segment in the real-world cartesian coordinates,.
|
|
|
Set the slope of the line keeping the same intercept. This is like rotating the line about the y-intercept point.
|
|
|
Set the starting point of the line segment in the real-world cartesian coordinates.
|
|
|
Set the starting point of the line segment in the real-world cartesian coordinates.
Reimplemented from Txq2dSeg. |
|
|
Stretches current line to a large boundary.
|
|
|
A MAX_SIXE constant.
Definition at line 340 of file Txq2dLineSeg.h. |
|
|
The intercept value.
Definition at line 335 of file Txq2dLineSeg.h. |
|
|
number of points in the line segment.
Definition at line 345 of file Txq2dLineSeg.h. |
|
|
The slope value.
Definition at line 330 of file Txq2dLineSeg.h. |
Copyright Tech-X Corporation, all rights reserved.