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.
 
 SbPlaneProjector (const SbPlane &plane, bool orient=FALSE)
 Constructor that takes a plane.
 
 ~SbPlaneProjector ()
 Destructor.
 
virtual SbProjectorcopy () 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 SbPlanegetPlane () const
 Set and get the plane to use.
 
void setOrientToEye (bool orientToEye)
 Set whether the projector should be oriented towards the eye.
 
bool 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.
 
- Public Member Functions inherited from SbProjector
virtual SbVec3f project (const SbVec2f &point)=0
 Apply the projector using the given point, returning the point in three dimensions that it projects to.
 
virtual void setViewVolume (const SbViewVolume &vol)
 Set the view volume to use for the projection.
 
const SbViewVolumegetViewVolume () const
 Get the view volume to use for the projection.
 
virtual void setWorkingSpace (const SbMatrix &space)
 Set the transform space to work in.
 
const SbMatrixgetWorkingSpace () const
 Get the transform space to work in.
 
virtual SbProjectorcopy () const =0
 Creates and returns an exact copy of the projector.
 

Protected Member Functions

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

Protected Attributes

SbPlane plane
 
bool orientToEye
 TRUE is plane should be oriented to eye.
 
bool needSetup
 Set TRUE when plane or orientToEye changes.
 
SbPlane nonOrientPlane
 Non-EyeOriented plane.
 
SbVec3f lastPoint
 Cached last point.
 
- 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: