Version: 9.15.0
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() [1/2]

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() [2/2]

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

Ordinary segment construction.

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::~GLViewer_Segment ( )

destructor, does nothing

Member Function Documentation

◆ HasIntersection()

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

◆ myA

GLfloat GLViewer_Segment::myA
private

◆ myB

GLfloat GLViewer_Segment::myB
private

◆ myC

GLfloat GLViewer_Segment::myC
private

◆ myPnt1

GLViewer_Pnt GLViewer_Segment::myPnt1
private

◆ myPnt2

GLViewer_Pnt GLViewer_Segment::myPnt2
private

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