SbLined Class Reference

Directed line in 3D (double precision). More...

#include <Inventor/SbLine.h>

List of all members.

Public Member Functions

 SbLined ()
 SbLined (const SbVec3d &p0, const SbVec3d &p1)
void setValue (const SbVec3d &p0, const SbVec3d &p1)
void setPosDir (const SbVec3d &position, const SbVec3d &direction)
void setValue (const SbLine &line)
SbBool getClosestPoints (const SbLined &line2, SbVec3d &ptOnThis, SbVec3d &ptOnLine2) const
SbVec3d getClosestPoint (const SbVec3d &point) const
const SbVec3dgetPosition () const
const SbVec3dgetDirection () const

Static Public Member Functions

static void setIntersectEpsilon (const double epsilon)

Detailed Description

Directed line in 3D (double precision).

Represents a (double precision) directed line in 3D. This is a basic Open Inventor datatype that is used for representing a 3D line. It is used as input and output by a variety of Open Inventor classes.


SbVec3d, SbLine, SbPlane

Constructor & Destructor Documentation

SbLined::SbLined (  )  [inline]

Default constructor.

The line is not initialized.

SbLined::SbLined ( const SbVec3d p0,
const SbVec3d p1 


The line is directed from p0 to p1.
To construct a line from a position and direction you can use: SbLine(p0, p0 + dir), but using the default constructor followed by the setPosDir() method is recommended to avoid floating point precision problems.

Member Function Documentation

SbVec3d SbLined::getClosestPoint ( const SbVec3d point  )  const

Returns the closest point on the line to the given point.

SbBool SbLined::getClosestPoints ( const SbLined line2,
SbVec3d ptOnThis,
SbVec3d ptOnLine2 
) const

Finds the two closest points between this line and line2, and loads them into ptOnThis and ptOnLine2.

Returns FALSE if the lines are parallel (results undefined), and returns TRUE otherwise.

const SbVec3d& SbLined::getDirection (  )  const [inline]

Returns direction vector of line.

const SbVec3d& SbLined::getPosition ( void   )  const [inline]

Returns position of line origin point.

static void SbLined::setIntersectEpsilon ( const double  epsilon  )  [static]

Setup epsilon to detect intersection of very small geometry.

void SbLined::setPosDir ( const SbVec3d position,
const SbVec3d direction 

Sets line using a position and a direction vector.

The direction vector will be normalized automatically. This method is preferred over setValue when the point has very large magnitude, for example 1e6, because adding a normalized direction vector to such a point may not be significant.

void SbLined::setValue ( const SbLine line  )  [inline]

Set value from single precision line.

void SbLined::setValue ( const SbVec3d p0,
const SbVec3d p1 

Sets line to pass through points p0 and p1.

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

Open Inventor Toolkit reference manual, generated on 8 Apr 2021
Copyright © Thermo Fisher Scientific All rights reserved.