Line projector. More...
#include <Inventor/projectors/SbLineProjector.h>
Public Member Functions | |
SbLineProjector () | |
virtual | ~SbLineProjector () |
virtual SbProjector * | copy () const |
virtual SbVec3f | project (const SbVec2f &point) |
virtual SbBool | project (const SbVec2f &point, SbVec3f &projectedPoint) |
virtual SbVec3f | intersect (const SbLine &line) |
void | setLine (const SbLine &line) |
const SbLine & | getLine () const |
virtual SbVec3f | getVector (const SbVec2f &mousePosition1, const SbVec2f &mousePosition2) |
virtual SbVec3f | getVector (const SbVec2f &mousePosition) |
void | setStartPosition (const SbVec2f &mousePosition) |
void | setStartPosition (const SbVec3f &point) |
Line projector.
SbLineProjector projects a 2D point, typically the location of the cursor, onto a 3D line.
SbCylinderProjector, SbCylinderPlaneProjector, SbCylinderSectionProjector, SbCylinderSheetProjector, SbPlaneProjector, SbSpherePlaneProjector, SbSphereProjector, SbSphereSectionProjector, SbSphereSheetProjector
SbLineProjector::SbLineProjector | ( | ) |
Constructor.
The default line passes through the origin and is aligned with the Y axis.
virtual SbLineProjector::~SbLineProjector | ( | ) | [inline, virtual] |
Destructor.
virtual SbProjector* SbLineProjector::copy | ( | ) | const [virtual] |
Returns an instance that is a copy of this instance.
The caller is responsible for deleting the copy when done.
Implements SbProjector.
const SbLine& SbLineProjector::getLine | ( | ) | const [inline] |
Gets the line on which to project 2D points.
Gets a vector given the current mouse point.
Uses the last point on this projector from the previous call to getVector() or setStartPostion(). Do not use this if the working space transform is changing since the new point will be in a different space than the old one.
virtual SbVec3f SbLineProjector::getVector | ( | const SbVec2f & | mousePosition1, | |
const SbVec2f & | mousePosition2 | |||
) | [virtual] |
Gets a vector on this line given two normalized mouse points.
Applies the projector using the given line in world coordinates, returning the point in three dimensions that it projects to.
New for v3.0.
Implements SbProjector.
virtual SbBool SbLineProjector::project | ( | const SbVec2f & | point, | |
SbVec3f & | projectedPoint | |||
) | [virtual] |
Applies the projector using the given point, returning the point in three dimensions that it projects to and the status.
The point should be normalized from 0-1, with (0,0) at the lower-left.
Applies the projector using the given point, returning the point in three dimensions that it projects to.
The point should be normalized from 0-1, with (0,0) at the lower-left.
Implements SbProjector.
void SbLineProjector::setLine | ( | const SbLine & | line | ) |
Sets the line on which to project 2D points.
void SbLineProjector::setStartPosition | ( | const SbVec3f & | point | ) | [inline] |
Sets the initial position from a point on the projector.
void SbLineProjector::setStartPosition | ( | const SbVec2f & | mousePosition | ) | [inline] |
Sets the initial position from a mouse position.