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 395 of file cugl.h.

Constructor & Destructor Documentation

◆ Line() [1/2]

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

Construct the Line from Point p to Point q.

Definition at line 2697 of file cugl.h.

◆ Line() [2/2]

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

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

Definition at line 2701 of file cugl.h.

Member Function Documentation

◆ draw()

void cugl::Line::draw ( ) const

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

Friends And Related Function Documentation

◆ meet

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

Find the point where this line meets the plane p.

◆ operator!=

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 2713 of file cugl.h.

◆ operator<<

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.

◆ operator==

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 2708 of file cugl.h.

Member Data Documentation

◆ f

Point cugl::Line::f
private

Finish point of line.

Definition at line 450 of file cugl.h.

◆ s

Point cugl::Line::s
private

Start point of line.

Definition at line 447 of file cugl.h.


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