Provided by: libcoin80-doc_3.1.4~abc9f50-4ubuntu2_all

**NAME**

SbDPLine - TheSbDPLineclass represents a line in 3D space.SbDPLineis used by many other classes in Coin. It provides a way of specifying a directed line (also known as a ray) through a specified point (origin) and a direction in 3D space. Note that the line is infinite in both directions from its definition point.

**SYNOPSIS**

PublicMemberFunctionsSbDPLine(void)SbDPLine(constSbVec3d&p0, constSbVec3d&p1) voidsetValue(constSbVec3d&p0, constSbVec3d&p1) voidsetPosDir(constSbVec3d&position, constSbVec3d&direction) SbBoolgetClosestPoints(constSbDPLine&line2,SbVec3d&ptOnThis,SbVec3d&ptOnLine2) constSbVec3dgetClosestPoint(constSbVec3d&point) const constSbVec3d&getPosition(void) const constSbVec3d&getDirection(void) const void

**Detailed** **Description**

TheSbDPLineclass represents a line in 3D space.SbDPLineis used by many other classes in Coin. It provides a way of specifying a directed line (also known as a ray) through a specified point (origin) and a direction in 3D space. Note that the line is infinite in both directions from its definition point. Be aware that this class is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.SeeAlso:SbVec3dSince:Coin 2.0

**Constructor** **&** **Destructor** **Documentation**

SbDPLine::SbDPLine(void)The empty constructor does nothing. The line will be uninitialized until the first assignment orsetValue()call.SbDPLine::SbDPLine(constSbVec3d&p0,constSbVec3d&p1)Constructor withp0specifying the line start point andp1the line end point.p0should not be the same asp1, as this will lead to having a null vector as the direction vector, which would cause division by zero problems in some of the other methods on this class.

**Member** **Function** **Documentation**

voidSbDPLine::setValue(constSbVec3d&p0,constSbVec3d&p1)Set new position and direction of the line by specifying line start point and end point.p0should not be the same asp1, as this will lead to having a null vector as the direction vector, which would cause division by zero problems in some of the other methods on this class.voidSbDPLine::setPosDir(constSbVec3d&position,constSbVec3d&direction)Set position and directionSince:Coin 4.0SbBoolSbDPLine::getClosestPoints(constSbDPLine&line2,SbVec3d&ptOnThis,SbVec3d&ptOnLine2)constReturns the two closest points on the lines. If the lines are parallel, all points are equally close and we return FALSE. If the lines are not parallel, the point positions will be stored inptOnThisandptOnLine2, and we'll return TRUE.SeeAlso:getClosestPoint().SbVec3dSbDPLine::getClosestPoint(constSbVec3d&point)constReturns the point on the line which is closest topoint.SeeAlso:getClosestPoints().constSbVec3d&SbDPLine::getPosition(void)constReturn a vector representing a point on the line.constSbVec3d&SbDPLine::getDirection(void)constReturn a vector representing the direction of the line. The direction vector will always be normalized.voidSbDPLine::print(FILE*fp)constDump the state of this object to thefilestream. Only works in debug version of library, method does nothing in an optimized compile.

**Author**

Generated automatically by Doxygen for Coin from the source code.