CUGL  2.0
Public Member Functions | Private Attributes | Friends | List of all members
cugl::Line Class Reference

#include <cugl.h>

Collaboration diagram for cugl::Line:
Collaboration graph
[legend]

Public Member Functions

 Line (const Point &p, const Point &q)
 
 Line (const Point &p, const Vector &v)
 
void draw () const
 

Private Attributes

Point s
 
Point f
 

Friends

class Plane
 
Point meet (const Line &k, const Plane &p)
 
bool operator== (const Line &x, const Line &y)
 
bool operator!= (const Line &x, const Line &y)
 
std::ostream & operator<< (std::ostream &os, const Line &k)
 

Detailed Description

An instance is a line defined by two Points. Lines are occasionally useful. For example, it is simple to display surface normals using this class. A Line is represented by the two Points which are its end-points.

Definition at line 383 of file cugl.h.

Constructor & Destructor Documentation

cugl::Line::Line ( const Point p,
const Point q 
)
inline

Construct the Line from Point p to Point q.

Definition at line 2685 of file cugl.h.

cugl::Line::Line ( const Point p,
const Vector v 
)
inline

Construct the Line from Point p to Point p+v.

Definition at line 2689 of file cugl.h.

Member Function Documentation

void cugl::Line::draw ( ) const

Draw the line using glBegin(GL_LINE) ....

Friends And Related Function Documentation

Point meet ( const Line k,
const Plane p 
)
friend

Find the point where this line meets the plane p.

bool operator!= ( const Line x,
const Line y 
)
friend

Compare two lines. This function returns false only if corresponding components are exactly equal. Values that are theoretically equal but computed in different ways are likely to be unequal according to this function.

Definition at line 2701 of file cugl.h.

std::ostream& operator<< ( std::ostream &  os,
const Line k 
)
friend

Write a representation of the line to the output stream. The format is pt->pt where "\a pt" is the format used for points. If setw is used to set the width, it is passed to the inserter for Point.

bool operator== ( const Line x,
const Line y 
)
friend

Compare two lines. This function returns true only if corresponding components are exactly equal. Values that are theoretically equal but computed in different ways are likely to be unequal according to this function.

Definition at line 2696 of file cugl.h.

Member Data Documentation

Point cugl::Line::f
private

Finish point of line.

Definition at line 438 of file cugl.h.

Referenced by cugl::operator==().

Point cugl::Line::s
private

Start point of line.

Definition at line 435 of file cugl.h.

Referenced by cugl::operator==().


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