Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GLViewer_Segment Class Reference

#include <GLViewer_Geom.h>

Public Member Functions

 GLViewer_Segment (const GLViewer_Pnt &thePnt1, const GLViewer_Pnt &thePnt2)
 
 GLViewer_Segment (const GLViewer_Pnt &thePnt, const GLfloat theA, const GLfloat theB, const GLfloat theC)
 Ordinary segment construction. More...
 
 ~GLViewer_Segment ()
 
bool HasIntersection (const GLViewer_Segment &theOther) const
 

Private Attributes

GLViewer_Pnt myPnt1
 
GLViewer_Pnt myPnt2
 
GLfloat myA
 
GLfloat myB
 
GLfloat myC
 

Detailed Description

Class GLViewer_Segment Segment for 2d detection

Constructor & Destructor Documentation

GLViewer_Segment::GLViewer_Segment ( const GLViewer_Pnt thePnt1,
const GLViewer_Pnt thePnt2 
)

constructs a real segment bounded by two points

References myA, myB, myC, myPnt1, myPnt2, GLViewer_Pnt::x(), and GLViewer_Pnt::y().

GLViewer_Segment::GLViewer_Segment ( const GLViewer_Pnt thePnt,
const GLfloat  theA,
const GLfloat  theB,
const GLfloat  theC 
)

Construction of a ray with given equation Ax + By + C = 0

constructs a ray starting at <thePnt> and directed along positive X axis direction (or Y axis if vertical )

References FAR_POINT, myA, myB, myC, myPnt1, myPnt2, TOLERANCE, and GLViewer_Pnt::x().

GLViewer_Segment::~GLViewer_Segment ( )

destructor, does nothing

Member Function Documentation

bool GLViewer_Segment::HasIntersection ( const GLViewer_Segment theOther) const

detects intersection with segment <theOther>

References myA, myB, myC, myPnt1, myPnt2, TOLERANCE, GLViewer_Pnt::x(), and GLViewer_Pnt::y().

Member Data Documentation

GLfloat GLViewer_Segment::myA
private
GLfloat GLViewer_Segment::myB
private
GLfloat GLViewer_Segment::myC
private
GLViewer_Pnt GLViewer_Segment::myPnt1
private
GLViewer_Pnt GLViewer_Segment::myPnt2
private

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