mx::Line Struct Reference

#include <mxtype.h>

List of all members.

Public Member Functions

 Line ()
 Line (Point p_1, Point p_2)
 Line (int start_x, int start_y, int stop_x, int stop_y)
const int x1 () const
const int y1 () const
const int x2 () const
const int y2 () const

Public Attributes

Point p1
Point p2


Detailed Description

structure to stand for a line, containing two points

Definition at line 140 of file mxtype.h.


Constructor & Destructor Documentation

mx::Line::Line (  )  [inline]

default constructor

Definition at line 146 of file mxtype.h.

00146 { }

mx::Line::Line ( Point  p_1,
Point  p_2 
) [inline]

constructor taking two points

Parameters:
p_1 point one (starting)
p_2 point two (stoping)

Definition at line 151 of file mxtype.h.

00151 : p1(p_1), p2(p_2) { }

mx::Line::Line ( int  start_x,
int  start_y,
int  stop_x,
int  stop_y 
) [inline]

constructor taking 2 points in four variables

Parameters:
start_x x1 coordinate
start_y y1 coordinate
stop_x x2 coordinate
stop_y y2 coordinate

Definition at line 158 of file mxtype.h.

References p1, and p2.

00159                 {
00160                         p1 = Point(start_x, start_y);
00161                         p2 = Point(stop_x, stop_y);
00162                 }


Member Function Documentation

const int mx::Line::x1 (  )  const [inline]

return x1

Returns:
x1

Definition at line 164 of file mxtype.h.

References p1, and mx::Point::x.

00164 { return p1.x; }

const int mx::Line::x2 (  )  const [inline]

return x2

Returns:
x2

Definition at line 168 of file mxtype.h.

References p2, and mx::Point::x.

00168 { return p2.x; }

const int mx::Line::y1 (  )  const [inline]

return y1

Returns:
y1

Definition at line 166 of file mxtype.h.

References p1, and mx::Point::y.

00166 { return p1.y; }

const int mx::Line::y2 (  )  const [inline]

return y2

Returns:
y2

Definition at line 170 of file mxtype.h.

References p2, and mx::Point::y.

00170 { return p2.y; }


Member Data Documentation

starting point

Definition at line 142 of file mxtype.h.

Referenced by Line(), x1(), and y1().

ending point

Definition at line 144 of file mxtype.h.

Referenced by Line(), x2(), and y2().


The documentation for this struct was generated from the following file:

Generated on Wed Jun 10 14:52:02 2009 for libmx by  doxygen 1.5.8