Version: 6.3.1
Public Member Functions | Private Attributes

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.
 ~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().


Field Documentation

GLfloat GLViewer_Segment.myA [private]
GLfloat GLViewer_Segment.myB [private]
GLfloat GLViewer_Segment.myC [private]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS