Open Inventor Reference
SbPlaneProjector Class Reference

Plane projector. More...

#include <Inventor/projectors/SbPlaneProjector.h>

Inheritance diagram for SbPlaneProjector:
SbProjector

Public Member Functions

 SbPlaneProjector (bool orient=FALSE)
 Constructor. More...
 
 SbPlaneProjector (const SbPlane &plane, bool orient=FALSE)
 Constructor that takes a plane. More...
 
 ~SbPlaneProjector ()
 Destructor. More...
 
virtual SbProjectorcopy () const
 Returns an instance that is a copy of this instance. More...
 
virtual SbVec3f project (const SbVec2f &point)
 Apply the projector using the given point, returning the point in three dimensions that it projects to. More...
 
void setPlane (const SbPlane &plane)
 Set and get the plane to use. More...
 
const SbPlanegetPlane () const
 Set and get the plane to use. More...
 
void setOrientToEye (bool orientToEye)
 Set whether the projector should be oriented towards the eye. More...
 
bool isOrientToEye () const
 Get whether the projector should be oriented towards the eye. More...
 
virtual SbVec3f getVector (const SbVec2f &mousePosition1, const SbVec2f &mousePosition2)
 Get a vector on this plane given two normalized mouse points. More...
 
virtual SbVec3f getVector (const SbVec2f &mousePosition)
 Get a vector given the current mouse point. More...
 
void setStartPosition (const SbVec2f &mousePosition)
 Set the initial mouse position. More...
 
void setStartPosition (const SbVec3f &point)
 Set the initial position from a point on the projector. More...
 
- Public Member Functions inherited from SbProjector
virtual void setViewVolume (const SbViewVolume &vol)
 Set the view volume to use for the projection. More...
 
const SbViewVolumegetViewVolume () const
 Get the view volume to use for the projection. More...
 
virtual void setWorkingSpace (const SbMatrix &space)
 Set the transform space to work in. More...
 
const SbMatrixgetWorkingSpace () const
 Get the transform space to work in. More...
 

Protected Member Functions

void setupPlane ()
 Sets up plane orientation, if necessary. More...
 
- Protected Member Functions inherited from SbProjector
 SbProjector ()
 Default constructor. More...
 
virtual ~SbProjector ()
 
SbLine getWorkingLine (const SbVec2f &point) const
 Given this mouse point, return the line it projects to in working space. More...
 

Protected Attributes

SbPlane plane
 
bool orientToEye
 TRUE is plane should be oriented to eye. More...
 
bool needSetup
 Set TRUE when plane or orientToEye changes. More...
 
SbPlane nonOrientPlane
 Non-EyeOriented plane. More...
 
SbVec3f lastPoint
 Cached last point. More...
 
- Protected Attributes inherited from SbProjector
SbViewVolume viewVol
 
SbMatrix worldToWorking
 
SbMatrix workingToWorld
 

Detailed Description

SbPlaneProjector projects the mouse onto a plane. This is typically used to write interactive 3D manipulators and viewers.

See Also
SbCylinderProjector, SbCylinderPlaneProjector, SbCylinderSectionProjector, SbCylinderSheetProjector, SbLineProjector, SbSpherePlaneProjector, SbSphereProjector, SbSphereSectionProjector, SbSphereSheetProjector

Definition at line 78 of file SbPlaneProjector.h.

Constructor & Destructor Documentation

◆ SbPlaneProjector() [1/2]

SbPlaneProjector::SbPlaneProjector ( bool  orient = FALSE)

The default plane passes through the origin and is oriented perpendicular to the Z axis.

◆ SbPlaneProjector() [2/2]

SbPlaneProjector::SbPlaneProjector ( const SbPlane plane,
bool  orient = FALSE 
)

◆ ~SbPlaneProjector()

SbPlaneProjector::~SbPlaneProjector ( )
inline

Definition at line 91 of file SbPlaneProjector.h.

Member Function Documentation

◆ copy()

virtual SbProjector* SbPlaneProjector::copy ( ) const
virtual

The caller is responsible for deleting the copy when done.

Implements SbProjector.

◆ getPlane()

const SbPlane& SbPlaneProjector::getPlane ( ) const
inline

Definition at line 107 of file SbPlaneProjector.h.

◆ getVector() [1/2]

virtual SbVec3f SbPlaneProjector::getVector ( const SbVec2f mousePosition)
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.

◆ getVector() [2/2]

virtual SbVec3f SbPlaneProjector::getVector ( const SbVec2f mousePosition1,
const SbVec2f mousePosition2 
)
virtual

◆ isOrientToEye()

bool SbPlaneProjector::isOrientToEye ( ) const
inline

Definition at line 117 of file SbPlaneProjector.h.

◆ project()

virtual SbVec3f SbPlaneProjector::project ( const SbVec2f point)
virtual

The point should be normalized from 0-1, with (0,0) at the lower-left.

Implements SbProjector.

◆ setOrientToEye()

void SbPlaneProjector::setOrientToEye ( bool  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.

◆ setPlane()

void SbPlaneProjector::setPlane ( const SbPlane plane)

◆ setStartPosition() [1/2]

void SbPlaneProjector::setStartPosition ( const SbVec2f mousePosition)
inline

Definition at line 134 of file SbPlaneProjector.h.

References SbProjector::project().

◆ setStartPosition() [2/2]

void SbPlaneProjector::setStartPosition ( const SbVec3f point)
inline

Definition at line 138 of file SbPlaneProjector.h.

◆ setupPlane()

void SbPlaneProjector::setupPlane ( )
protected

Member Data Documentation

◆ lastPoint

SbVec3f SbPlaneProjector::lastPoint
protected

Definition at line 147 of file SbPlaneProjector.h.

◆ needSetup

bool SbPlaneProjector::needSetup
protected

Definition at line 144 of file SbPlaneProjector.h.

◆ nonOrientPlane

SbPlane SbPlaneProjector::nonOrientPlane
protected

Definition at line 145 of file SbPlaneProjector.h.

◆ orientToEye

bool SbPlaneProjector::orientToEye
protected

Definition at line 143 of file SbPlaneProjector.h.

◆ plane

SbPlane SbPlaneProjector::plane
protected

Definition at line 142 of file SbPlaneProjector.h.


The documentation for this class was generated from the following file: