Open Inventor Reference
|
Line projector. More...
#include <Inventor/projectors/SbLineProjector.h>
Public Member Functions | |
SbLineProjector () | |
Constructor and destructor. | |
~SbLineProjector () | |
Constructor and destructor. | |
virtual SbProjector * | copy () const |
Returns an instance that is a copy of this instance. | |
virtual SbVec3f | project (const SbVec2f &point) |
Apply the projector using the given point, returning the point in three dimensions that it projects to. | |
void | setLine (const SbLine &line) |
Set and get the line on which to project 2D points. | |
const SbLine & | getLine () const |
Set and get the line on which to project 2D points. | |
virtual SbVec3f | getVector (const SbVec2f &mousePosition1, const SbVec2f &mousePosition2) |
Get a vector on this line given two normalized mouse points. | |
virtual SbVec3f | getVector (const SbVec2f &mousePosition) |
Get a vector given the current mouse point. | |
void | setStartPosition (const SbVec2f &mousePosition) |
Set the initial position from a mouse position. | |
void | setStartPosition (const SbVec3f &point) |
Set the initial position from a point on the projector. | |
Protected Attributes | |
SbLine | line |
SbVec3f | lastPoint |
SbLineProjector projects a 2D point, typically the location of the cursor, onto a 3D line.
Definition at line 75 of file SbLineProjector.h.
SbLineProjector::SbLineProjector | ( | ) |
The default line passes through the origin and is aligned with the Y axis.
SbLineProjector::~SbLineProjector | ( | ) | [inline] |
The default line passes through the origin and is aligned with the Y axis.
Definition at line 85 of file SbLineProjector.h.
virtual SbProjector* SbLineProjector::copy | ( | ) | const [virtual] |
The caller is responsible for deleting the copy when done.
Implements SbProjector.
const SbLine& SbLineProjector::getLine | ( | ) | const [inline] |
Definition at line 99 of file SbLineProjector.h.
virtual SbVec3f SbLineProjector::getVector | ( | const SbVec2f & | mousePosition1, |
const SbVec2f & | mousePosition2 | ||
) | [virtual] |
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.
The point should be normalized from 0-1, with (0,0) at the lower-left.
Implements SbProjector.
void SbLineProjector::setLine | ( | const SbLine & | line | ) |
void SbLineProjector::setStartPosition | ( | const SbVec2f & | mousePosition | ) | [inline] |
Definition at line 115 of file SbLineProjector.h.
References SbProjector::project().
void SbLineProjector::setStartPosition | ( | const SbVec3f & | point | ) | [inline] |
Definition at line 119 of file SbLineProjector.h.
SbVec3f SbLineProjector::lastPoint [protected] |
Definition at line 124 of file SbLineProjector.h.
SbLine SbLineProjector::line [protected] |
Definition at line 123 of file SbLineProjector.h.