KSD_EXPORT_CLASSclass TLine
A line shape object.
Inheritance:
Public Methods
-
TLine()
-
TLine(ksd::fixed slope, ksd::fixed yintercept, int start, int stop)
- Create a line with the given attributes
-
TLine(int xintercept, int top, int bottom)
- This is the verticle line constructor
-
TLine(const TPoint2D& point1, const TPoint2D& point2)
- Create a line that connects the two given points
-
bool IsVerticle() const
- Returns true id the line is verticle
-
bool IsHorizontal() const
- Returns true if the line is horizontal
-
ksd::fixed GetSlope() const
- Returns the slopr of the line
-
ksd::fixed GetIntercept() const
- Returns the y-intercept of the line, unless this is a verticle line, in which case it returns the x-intercept
-
int GetStart() const
- Returns the value that the segment starts on
-
int GetStop() const
- Returns the value that the segment stops on,
-
void SetVerticle(bool _verticle)
- Allows you to change this to or from a verticle line
-
void SetSlope(ksd::fixed _slope)
- Sets the line slope
-
void SetIntercept(ksd::fixed _intercept)
- Sets the line intercept
-
void SetStart(int _start)
- Sets the segment start
-
void SetStop(int _stop)
- Sets the segment stop
-
void CreateLine(ksd::fixed slope, ksd::fixed yintercept, int start, int stop)
- Creates a line using the given sttributes
-
void CreateHLine(int y, int start, int stop)
- Creates a horizontal line
-
void CreateVLine(int x, int start, int stop)
- Creates a verticle line
-
TLine PerpendicularLine(const TPoint2D& start, bool& Touches) const
- Returns a line perpendicular to this line at the gvien point.
-
ksd::fixed Length()
- Returns the length of the line at a given point
-
ksd::fixed Solve(int Value)
- Returns the y-value for a given x-value (y=mx+b)
-
void SetEndPoints(const TPoint2D& point1, const TPoint2D& point2)
- Creates a line using two endpoitns
-
TPoint2D GetStartPoint()
- Returns the start point (Is slower than you may think)
-
TPoint2D GetEndPoint()
- Returns the end point (Is slower than you may think)
Public Methods
-
virtual bool IsInside(const TPoint2D& V) const
-
virtual void Move(int X, int Y)
-
virtual void MoveTo(int X, int Y)
-
void Move(const TPoint2D& p)
-
void MoveTo(const TPoint2D& p)
-
virtual void Visit(Visitor*)
Public Members
-
class Visitor
- Used to add new operations to a shape without modifying the source
Documentation
A line shape object. Used to describe edges in screen space. This
particular line implementation is good for collision detection but
not much more. It is help in slope-intercept format (y=mx+b) with
two limiting values to describe the start and end of the line segment.
This is makes it a very slow operation to move the line.
- TLine()
- TLine(ksd::fixed slope, ksd::fixed yintercept, int start, int stop)
- Create a line with the given attributes
- TLine(int xintercept, int top, int bottom)
- This is the verticle line constructor
- TLine(const TPoint2D& point1, const TPoint2D& point2)
- Create a line that connects the two given points
- bool IsVerticle() const
- Returns true id the line is verticle
- bool IsHorizontal() const
- Returns true if the line is horizontal
- ksd::fixed GetSlope() const
- Returns the slopr of the line
- ksd::fixed GetIntercept() const
- Returns the y-intercept of the line, unless this is a verticle line, in
which case it returns the x-intercept
- int GetStart() const
- Returns the value that the segment starts on
- int GetStop() const
- Returns the value that the segment stops on,
- void SetVerticle(bool _verticle)
- Allows you to change this to or from a verticle line
- void SetSlope(ksd::fixed _slope)
- Sets the line slope
- void SetIntercept(ksd::fixed _intercept)
- Sets the line intercept
- void SetStart(int _start)
- Sets the segment start
- void SetStop(int _stop)
- Sets the segment stop
- void CreateLine(ksd::fixed slope, ksd::fixed yintercept, int start, int stop)
- Creates a line using the given sttributes
- void CreateHLine(int y, int start, int stop)
- Creates a horizontal line
- void CreateVLine(int x, int start, int stop)
- Creates a verticle line
- TLine PerpendicularLine(const TPoint2D& start, bool& Touches) const
- Returns a line perpendicular to this line at the gvien point. Sets
the Touches variable to true if the new line infact touches this line.
- ksd::fixed Length()
- Returns the length of the line at a given point
- ksd::fixed Solve(int Value)
- Returns the y-value for a given x-value (y=mx+b)
- void SetEndPoints(const TPoint2D& point1, const TPoint2D& point2)
- Creates a line using two endpoitns
- TPoint2D GetStartPoint()
- Returns the start point (Is slower than you may think)
- TPoint2D GetEndPoint()
- Returns the end point (Is slower than you may think)
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.