.TH "SbLine" 3 "Thu May 29 2014" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SbLine \- .PP The \fBSbLine\fP class represents a line in 3D space\&. .PP \fBSbLine\fP provides a way of specifying a directed line, through a 3D point (origin) and a vector direction in 3D space\&. .SH SYNOPSIS .br .PP .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBSbLine\fP (void)" .br .ti -1c .RI "\fBSbLine\fP (const \fBSbVec3f\fP &origin, const \fBSbVec3f\fP &point)" .br .ti -1c .RI "void \fBsetValue\fP (const \fBSbVec3f\fP &origin, const \fBSbVec3f\fP &point)" .br .ti -1c .RI "void \fBsetPosDir\fP (const \fBSbVec3f\fP &position, const \fBSbVec3f\fP &direction)" .br .ti -1c .RI "SbBool \fBgetClosestPoints\fP (const \fBSbLine\fP &line2, \fBSbVec3f\fP &ptOnThis, \fBSbVec3f\fP &ptOnLine2) const " .br .ti -1c .RI "\fBSbVec3f\fP \fBgetClosestPoint\fP (const \fBSbVec3f\fP &point) const " .br .ti -1c .RI "const \fBSbVec3f\fP & \fBgetPosition\fP (void) const " .br .ti -1c .RI "const \fBSbVec3f\fP & \fBgetDirection\fP (void) const " .br .ti -1c .RI "void \fBprint\fP (FILE *file) const " .br .in -1c .SH "Detailed Description" .PP The \fBSbLine\fP class represents a line in 3D space\&. .PP \fBSbLine\fP provides a way of specifying a directed line, through a 3D point (origin) and a vector direction in 3D space\&. It is context dependent whether or not an \fBSbLine\fP is considered as a \fIray\fP extending from the starting point in only one direction, or as a \fIline\fP intersecting the origin point and extending infinitely from it in both directions\&. .PP \fBSbLine\fP is used by many other classes in Coin\&. .PP \fBSee also:\fP .RS 4 \fBSbVec3f\fP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "SbLine::SbLine (void)" The default constructor does nothing\&. The line will be uninitialized until the first assignment or \fBsetValue()\fP call\&. .SS "SbLine::SbLine (const \fBSbVec3f\fP &origin, const \fBSbVec3f\fP &point)" Constructor with \fIorigin\fP specifying the line origin point, and \fIpoint\fP specifying another point on the line that is used to determine the line's direction\&. \fIpoint\fP should not be the same as \fIorigin\fP, as this will lead to the line having a null vector as the direction vector\&. This will cause division by zero problems in some of the other methods on this class\&. .PP Be aware that the direction vector will be normalized and not be the same as \fIpoint\fP - \fIorigin\fP\&. .PP \fBSee also:\fP .RS 4 \fBsetValue\fP, getOrigin, \fBgetDirection\fP .RE .PP .SH "Member Function Documentation" .PP .SS "void SbLine::setValue (const \fBSbVec3f\fP &origin, const \fBSbVec3f\fP &point)" Set new position and direction of the line by specifying line origin and another point on the line that is used to determine the line's direction\&. \fIpoint\fP should not be the same as \fIorigin\fP, as this will lead to having a null vector as the direction vector\&. This will cause division by zero problems in some of the other methods on this class\&. .PP Be aware that the direction vector will be normalized and not be the same as \fIpoint\fP - \fIorigin\fP\&. .PP \fBSee also:\fP .RS 4 \fBsetValue\fP, getOrigin, \fBgetDirection\fP .RE .PP .SS "void SbLine::setPosDir (const \fBSbVec3f\fP &position, const \fBSbVec3f\fP &direction)" Set position and direction .PP \fBSince:\fP .RS 4 Coin 4\&.0 .RE .PP .SS "SbBool SbLine::getClosestPoints (const \fBSbLine\fP &line2, \fBSbVec3f\fP &ptOnThis, \fBSbVec3f\fP &ptOnLine2) const" Returns the two closest points on the lines\&. If the lines are parallel, all points are equally close and we return \fCFALSE\fP\&. If the lines are not parallel, the point positions will be stored in \fIptOnThis\fP and \fIptOnLine2\fP, and we'll return \fCTRUE\fP\&. .PP Note that both \fBSbLine\fP instances are considered to be infinite in both directions from their definition points, as far as this function is concerned\&. .PP \fBSee also:\fP .RS 4 \fBgetClosestPoint()\fP\&. .RE .PP .SS "\fBSbVec3f\fP SbLine::getClosestPoint (const \fBSbVec3f\fP &point) const" Returns the point on the line which is closest to \fIpoint:\fP .PP .PP .nf _ Q D SP x-----x-------> \ | \ | \ | \ | \| x P P = argument point _ SP = line starting point, and D = line direction of this line Q = point to find and return from function.fi .PP .PP The vector defined by \fIpoint\fP and the returned point will be normal to the line\&. .PP Note that the \fBSbLine\fP instance is considered to be infinite in both directions from its definition point, as far as this function is concerned\&. .PP \fBSee also:\fP .RS 4 \fBgetClosestPoints()\fP\&. .RE .PP .SS "const \fBSbVec3f\fP & SbLine::getPosition (void) const" Return a vector representing the origin point on the line\&. .PP \fBSee also:\fP .RS 4 \fBsetValue\fP .RE .PP .SS "const \fBSbVec3f\fP & SbLine::getDirection (void) const" Return a vector representing the direction of the line\&. The direction vector will always be normalized\&. .SS "void SbLine::print (FILE *fp) const" Dump the state of this object to the \fIfile\fP stream\&. Only works in debug version of library, method does nothing in an optimized compile\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.