![]() |
http://www.sim.no http://www.coin3d.org |
The SbProjector class is the abstract base projector class.Projectors are used in the Coin library for mapping 2D coordinates (typically from the position of the mouse cursor in the rendering window) to 3D "world" coordinates. More...
#include <Inventor/projectors/SbProjector.h>
Public Member Functions | |
virtual SbVec3f | project (const SbVec2f &point)=0 |
virtual void | setViewVolume (const SbViewVolume &vol) |
const SbViewVolume & | getViewVolume (void) const |
virtual void | setWorkingSpace (const SbMatrix &space) |
const SbMatrix & | getWorkingSpace (void) const |
virtual SbProjector * | copy (void) const =0 |
Protected Member Functions | |
SbProjector (void) | |
virtual | ~SbProjector () |
SbLine | getWorkingLine (const SbVec2f &point) const |
float | findVanishingDistance (void) const |
SbBool | verifyProjection (const SbVec3f &projpt) const |
Protected Attributes | |
SbViewVolume | viewVol |
SbMatrix | worldToWorking |
SbMatrix | workingToWorld |
The SbProjector class is the abstract base projector class.
Projectors are used in the Coin library for mapping 2D coordinates (typically from the position of the mouse cursor in the rendering window) to 3D "world" coordinates.
Mapping 2D coordinates to 3D coordinates is something which is done extensively in the dragger classes, to provide the user with a convenient and natural way of interacting with the 3D geometry of scenes.
For a usage example, see the class documentation for SbSphereSheetProjector.
The application programmer should normally not need to care about the projector classes, unless there are special needs in the application.
|
protected |
The constructor initializes the workingspace matrix to an identity matrix.
References SbMatrix::makeIdentity(), workingToWorld, and worldToWorking.
|
inlineprotectedvirtual |
Destructor is protected, as this is an abstract class.
Project the 2D point from normalized viewport coordinates to a 3D point. The mapping will be done in accordance with the type of the projector.
Implemented in SbCylinderSectionProjector, SbSphereSectionProjector, SbCylinderPlaneProjector, SbCylinderSheetProjector, SbSpherePlaneProjector, SbLineProjector, SbPlaneProjector, SbSphereSheetProjector, and SbCylinderProjector.
Referenced by SoVRMLSphereSensor::drag(), SoRotateSphericalDragger::drag(), SoRotateSphericalDragger::dragStart(), SoTransformerDragger::dragStart(), and SbSphereProjector::projectAndGetRotation().
|
virtual |
Set the viewing volume the projections will take place in.
References viewVol.
Referenced by SoVRMLPlaneSensor::drag(), SoVRMLSphereSensor::drag(), SoVRMLCylinderSensor::drag(), SoTranslate1Dragger::drag(), SoScale1Dragger::drag(), SoScale2Dragger::drag(), SoRotateDiscDragger::drag(), SoScale2UniformDragger::drag(), SoScaleUniformDragger::drag(), SoTranslate2Dragger::drag(), SoRotateCylindricalDragger::drag(), SoRotateSphericalDragger::drag(), SoSpotLightDragger::drag(), SoTabPlaneDragger::drag(), SoHandleBoxDragger::drag(), SoVRMLSphereSensor::dragStart(), SoRotateCylindricalDragger::dragStart(), SoRotateSphericalDragger::dragStart(), and SoTransformerDragger::dragStart().
const SbViewVolume & SbProjector::getViewVolume | ( | void | ) | const |
Return the current viewing volume used by the projections.
References viewVol.
Referenced by SbCylinderProjector::isPointInFront(), and SbSphereProjector::isPointInFront().
|
virtual |
Sets the matrix used for converting from the projector's coordinate system to the world coordinate system.
Reimplemented in SbSphereProjector, and SbCylinderProjector.
References SbMatrix::inverse(), workingToWorld, and worldToWorking.
Referenced by SoVRMLPlaneSensor::drag(), SoRotateDiscDragger::drag(), SoScale1Dragger::drag(), SoTranslate1Dragger::drag(), SoScale2Dragger::drag(), SoScale2UniformDragger::drag(), SoScaleUniformDragger::drag(), SoTranslate2Dragger::drag(), SoSpotLightDragger::drag(), SoTabPlaneDragger::drag(), SoHandleBoxDragger::drag(), SbCylinderProjector::setWorkingSpace(), and SbSphereProjector::setWorkingSpace().
const SbMatrix & SbProjector::getWorkingSpace | ( | void | ) | const |
|
pure virtual |
Construct and return a copy of this projector. The caller is responsible for destructing the new instance.
Note that if the Coin library has been built as a DLL under Microsoft Windows and you use this method from application code, you must make sure that both the Coin DLL and the application executable is using the same instance of a C Run-Time (CRT) library. Otherwise, you will get memory heap corruption upon deallocating the returned instances, eventually leading to mysterious crashes.
Implemented in SbCylinderSectionProjector, SbSphereSectionProjector, SbCylinderPlaneProjector, SbCylinderSheetProjector, SbSpherePlaneProjector, SbLineProjector, SbPlaneProjector, and SbSphereSheetProjector.
Referenced by SoRotateCylindricalDragger::copyContents(), and SoRotateSphericalDragger::copyContents().
From the 2D point in normalized screenspace coordinates, calculate the line passing through the scene.
Typically used for tracking intersection points for the mouse cursor.
References SbMatrix::multLineMatrix(), SbViewVolume::projectPointToLine(), viewVol, and worldToWorking.
Referenced by SbSphereSheetProjector::project(), SbLineProjector::project(), SbPlaneProjector::project(), SbSpherePlaneProjector::project(), SbCylinderPlaneProjector::project(), SbCylinderSheetProjector::project(), SbSphereSectionProjector::project(), and SbCylinderSectionProjector::project().
|
protected |
Finds the unit cube vanishing distance for the current projector view volume. The view volume must be a perspective view volume.
This method was not part of the Inventor v2.1 API, and is an extension specific to Coin.
References SbViewVolume::getHeight(), SbViewVolume::getProjectionDirection(), SbViewVolume::getProjectionType(), SbViewVolume::PERSPECTIVE, SbViewVolume::projectBox(), SbMatrix::setTranslate(), SbBox3f::transform(), and viewVol.
Referenced by SbLineProjector::project(), and SbPlaneProjector::project().
|
protected |
Verifies that projpt is a valid projection for the current view volume. For perspective view volumes, it does this by checking that the projection point is in front of the eye plane. For orthographic projections, this method always returns TRUE.
This method was not part of the Inventor v2.1 API, and is an extension specific to Coin.
References SbViewVolume::getPlane(), SbViewVolume::getProjectionType(), SbPlane::isInHalfSpace(), SbMatrix::multVecMatrix(), SbViewVolume::PERSPECTIVE, viewVol, and workingToWorld.
Referenced by SbLineProjector::project(), and SbPlaneProjector::project().
|
protected |
The viewVol definition.
Referenced by findVanishingDistance(), getViewVolume(), getWorkingLine(), SbPlaneProjector::project(), SbLineProjector::project(), SbSphereSheetProjector::setupPlane(), SbCylinderSheetProjector::setupPlane(), SbPlaneProjector::setupPlane(), SbCylinderSectionProjector::setupTolerance(), SbSphereSectionProjector::setupTolerance(), setViewVolume(), and verifyProjection().
|
protected |
The matrix which converts from world coordinates to coordinates in the projector's local coordinate system.
Referenced by getWorkingLine(), SbCylinderProjector::isPointInFront(), SbSphereProjector::isPointInFront(), SbLineProjector::project(), SbPlaneProjector::project(), SbProjector(), SbSphereSheetProjector::setupPlane(), SbCylinderSheetProjector::setupPlane(), SbPlaneProjector::setupPlane(), SbCylinderSectionProjector::setupTolerance(), SbSphereSectionProjector::setupTolerance(), and setWorkingSpace().
|
protected |
The matrix which converts from coordinates in the projector's local coordinate system to world coordinates.
Referenced by getWorkingSpace(), SbLineProjector::project(), SbPlaneProjector::project(), SbProjector(), setWorkingSpace(), and verifyProjection().
Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.
Generated on Fri Jul 20 2018 for Coin by Doxygen. 1.8.14