KSD_EXPORT_CLASSclass TLine

A line shape object.

Inheritance:


Public Methods

[more] TLine()
[more] TLine(ksd::fixed slope, ksd::fixed yintercept, int start, int stop)
Create a line with the given attributes
[more] TLine(int xintercept, int top, int bottom)
This is the verticle line constructor
[more] TLine(const TPoint2D& point1, const TPoint2D& point2)
Create a line that connects the two given points
[more]bool IsVerticle() const
Returns true id the line is verticle
[more]bool IsHorizontal() const
Returns true if the line is horizontal
[more]ksd::fixed GetSlope() const
Returns the slopr of the line
[more]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
[more]int GetStart() const
Returns the value that the segment starts on
[more]int GetStop() const
Returns the value that the segment stops on,
[more]void SetVerticle(bool _verticle)
Allows you to change this to or from a verticle line
[more]void SetSlope(ksd::fixed _slope)
Sets the line slope
[more]void SetIntercept(ksd::fixed _intercept)
Sets the line intercept
[more]void SetStart(int _start)
Sets the segment start
[more]void SetStop(int _stop)
Sets the segment stop
[more]void CreateLine(ksd::fixed slope, ksd::fixed yintercept, int start, int stop)
Creates a line using the given sttributes
[more]void CreateHLine(int y, int start, int stop)
Creates a horizontal line
[more]void CreateVLine(int x, int start, int stop)
Creates a verticle line
[more]TLine PerpendicularLine(const TPoint2D& start, bool& Touches) const
Returns a line perpendicular to this line at the gvien point.
[more]ksd::fixed Length()
Returns the length of the line at a given point
[more]ksd::fixed Solve(int Value)
Returns the y-value for a given x-value (y=mx+b)
[more]void SetEndPoints(const TPoint2D& point1, const TPoint2D& point2)
Creates a line using two endpoitns
[more]TPoint2D GetStartPoint()
Returns the start point (Is slower than you may think)
[more]TPoint2D GetEndPoint()
Returns the end point (Is slower than you may think)


Inherited from TShape2D:

Public Methods

ovirtual bool IsInside(const TPoint2D& V) const
ovirtual void Move(int X, int Y)
ovirtual void MoveTo(int X, int Y)
ovoid Move(const TPoint2D& p)
ovoid MoveTo(const TPoint2D& p)
ovirtual 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.
o TLine()

o TLine(ksd::fixed slope, ksd::fixed yintercept, int start, int stop)
Create a line with the given attributes

o TLine(int xintercept, int top, int bottom)
This is the verticle line constructor

o TLine(const TPoint2D& point1, const TPoint2D& point2)
Create a line that connects the two given points

obool IsVerticle() const
Returns true id the line is verticle

obool IsHorizontal() const
Returns true if the line is horizontal

oksd::fixed GetSlope() const
Returns the slopr of the line

oksd::fixed GetIntercept() const
Returns the y-intercept of the line, unless this is a verticle line, in which case it returns the x-intercept

oint GetStart() const
Returns the value that the segment starts on

oint GetStop() const
Returns the value that the segment stops on,

ovoid SetVerticle(bool _verticle)
Allows you to change this to or from a verticle line

ovoid SetSlope(ksd::fixed _slope)
Sets the line slope

ovoid SetIntercept(ksd::fixed _intercept)
Sets the line intercept

ovoid SetStart(int _start)
Sets the segment start

ovoid SetStop(int _stop)
Sets the segment stop

ovoid CreateLine(ksd::fixed slope, ksd::fixed yintercept, int start, int stop)
Creates a line using the given sttributes

ovoid CreateHLine(int y, int start, int stop)
Creates a horizontal line

ovoid CreateVLine(int x, int start, int stop)
Creates a verticle line

oTLine 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.

oksd::fixed Length()
Returns the length of the line at a given point

oksd::fixed Solve(int Value)
Returns the y-value for a given x-value (y=mx+b)

ovoid SetEndPoints(const TPoint2D& point1, const TPoint2D& point2)
Creates a line using two endpoitns

oTPoint2D GetStartPoint()
Returns the start point (Is slower than you may think)

oTPoint2D 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++.