Open Inventor Reference
|
Plane projector. More...
#include <Inventor/projectors/SbPlaneProjector.h>
Public Member Functions | |
SbPlaneProjector (SbBool orient=FALSE) | |
Constructor. | |
SbPlaneProjector (const SbPlane &plane, SbBool orient=FALSE) | |
Constructor that takes a plane. | |
~SbPlaneProjector () | |
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 | setPlane (const SbPlane &plane) |
Set and get the plane to use. | |
const SbPlane & | getPlane () const |
Set and get the plane to use. | |
void | setOrientToEye (SbBool orientToEye) |
Set whether the projector should be oriented towards the eye. | |
SbBool | isOrientToEye () const |
Get whether the projector should be oriented towards the eye. | |
virtual SbVec3f | getVector (const SbVec2f &mousePosition1, const SbVec2f &mousePosition2) |
Get a vector on this plane 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 mouse position. | |
void | setStartPosition (const SbVec3f &point) |
Set the initial position from a point on the projector. | |
Protected Member Functions | |
void | setupPlane () |
Sets up plane orientation, if necessary. | |
Protected Attributes | |
SbPlane | plane |
SbBool | orientToEye |
TRUE is plane should be oriented to eye. | |
SbBool | needSetup |
Set TRUE when plane or orientToEye changes. | |
SbPlane | nonOrientPlane |
Non-EyeOriented plane. | |
SbVec3f | lastPoint |
Cached last point. |
SbPlaneProjector projects the mouse onto a plane. This is typically used to write interactive 3D manipulators and viewers.
Definition at line 78 of file SbPlaneProjector.h.
SbPlaneProjector::SbPlaneProjector | ( | SbBool | orient = FALSE | ) |
The default plane passes through the origin and is oriented perpendicular to the Z axis.
SbPlaneProjector::~SbPlaneProjector | ( | ) | [inline] |
Definition at line 91 of file SbPlaneProjector.h.
virtual SbProjector* SbPlaneProjector::copy | ( | ) | const [virtual] |
The caller is responsible for deleting the copy when done.
Implements SbProjector.
const SbPlane& SbPlaneProjector::getPlane | ( | ) | const [inline] |
Definition at line 107 of file SbPlaneProjector.h.
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 SbPlaneProjector::getVector | ( | const SbVec2f & | mousePosition1, |
const SbVec2f & | mousePosition2 | ||
) | [virtual] |
SbBool SbPlaneProjector::isOrientToEye | ( | ) | const [inline] |
Definition at line 117 of file SbPlaneProjector.h.
The point should be normalized from 0-1, with (0,0) at the lower-left.
Implements SbProjector.
void SbPlaneProjector::setOrientToEye | ( | SbBool | orientToEye | ) |
If orientToEye is set to TRUE, the given plane's direction is ignored, and the plane will be oriented to the eye. It will pass through the same point from the origin defined by the original dir * dist. Set to FALSE if the plane's direction should remain in working space.
void SbPlaneProjector::setPlane | ( | const SbPlane & | plane | ) |
void SbPlaneProjector::setStartPosition | ( | const SbVec3f & | point | ) | [inline] |
Definition at line 138 of file SbPlaneProjector.h.
void SbPlaneProjector::setStartPosition | ( | const SbVec2f & | mousePosition | ) | [inline] |
Definition at line 134 of file SbPlaneProjector.h.
References SbProjector::project().
void SbPlaneProjector::setupPlane | ( | ) | [protected] |
SbVec3f SbPlaneProjector::lastPoint [protected] |
Definition at line 147 of file SbPlaneProjector.h.
SbBool SbPlaneProjector::needSetup [protected] |
Definition at line 144 of file SbPlaneProjector.h.
SbPlane SbPlaneProjector::nonOrientPlane [protected] |
Definition at line 145 of file SbPlaneProjector.h.
SbBool SbPlaneProjector::orientToEye [protected] |
Definition at line 143 of file SbPlaneProjector.h.
SbPlane SbPlaneProjector::plane [protected] |
Definition at line 142 of file SbPlaneProjector.h.