.TH "SbProjector" 3 "Thu May 29 2014" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SbProjector \- .PP The \fBSbProjector\fP class is the abstract base projector class\&. .PP 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\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherited by \fBSbCylinderProjector\fP, \fBSbLineProjector\fP, \fBSbPlaneProjector\fP, and \fBSbSphereProjector\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual \fBSbVec3f\fP \fBproject\fP (const \fBSbVec2f\fP &point)=0" .br .ti -1c .RI "virtual void \fBsetViewVolume\fP (const \fBSbViewVolume\fP &vol)" .br .ti -1c .RI "const \fBSbViewVolume\fP & \fBgetViewVolume\fP (void) const " .br .ti -1c .RI "virtual void \fBsetWorkingSpace\fP (const \fBSbMatrix\fP &space)" .br .ti -1c .RI "const \fBSbMatrix\fP & \fBgetWorkingSpace\fP (void) const " .br .ti -1c .RI "virtual \fBSbProjector\fP * \fBcopy\fP (void) const =0" .br .ti -1c .RI "virtual SbBool \fBtryProject\fP (const \fBSbVec2f\fP &point, const float epsilon, \fBSbVec3f\fP &result)" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "\fBSbProjector\fP (void)" .br .ti -1c .RI "virtual \fB~SbProjector\fP ()" .br .ti -1c .RI "\fBSbLine\fP \fBgetWorkingLine\fP (const \fBSbVec2f\fP &point) const " .br .ti -1c .RI "float \fBfindVanishingDistance\fP (void) const " .br .ti -1c .RI "SbBool \fBverifyProjection\fP (const \fBSbVec3f\fP &projpt) const " .br .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "\fBSbViewVolume\fP \fBviewVol\fP" .br .ti -1c .RI "\fBSbMatrix\fP \fBworldToWorking\fP" .br .ti -1c .RI "\fBSbMatrix\fP \fBworkingToWorld\fP" .br .in -1c .SH "Detailed Description" .PP The \fBSbProjector\fP class is the abstract base projector class\&. .PP 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\&. .PP For a usage example, see the class documentation for \fBSbSphereSheetProjector\fP\&. .PP The application programmer should normally not need to care about the projector classes, unless there are special needs in the application\&. .PP \fBSee also:\fP .RS 4 \fBSoDragger\fP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "SbProjector::SbProjector (void)\fC [protected]\fP" The constructor initializes the workingspace matrix to an identity matrix\&. .SS "SbProjector::~SbProjector ()\fC [inline]\fP, \fC [protected]\fP, \fC [virtual]\fP" Destructor is protected, as this is an abstract class\&. .SH "Member Function Documentation" .PP .SS "\fBSbVec3f\fP SbProjector::project (const \fBSbVec2f\fP &point)\fC [pure virtual]\fP" Project the 2D \fIpoint\fP from normalized viewport coordinates to a 3D point\&. The mapping will be done in accordance with the type of the projector\&. .PP Implemented in \fBSbCylinderSectionProjector\fP, \fBSbSphereSectionProjector\fP, \fBSbCylinderPlaneProjector\fP, \fBSbCylinderSheetProjector\fP, \fBSbSpherePlaneProjector\fP, \fBSbLineProjector\fP, \fBSbPlaneProjector\fP, \fBSbSphereSheetProjector\fP, and \fBSbCylinderProjector\fP\&. .SS "void SbProjector::setViewVolume (const \fBSbViewVolume\fP &vol)\fC [virtual]\fP" Set the viewing volume the projections will take place in\&. .PP \fBSee also:\fP .RS 4 \fBgetViewVolume()\fP .RE .PP .SS "const \fBSbViewVolume\fP & SbProjector::getViewVolume (void) const" Return the current viewing volume used by the projections\&. .PP \fBSee also:\fP .RS 4 \fBsetViewVolume()\fP .RE .PP .SS "void SbProjector::setWorkingSpace (const \fBSbMatrix\fP &space)\fC [virtual]\fP" Sets the matrix used for converting from the projector's coordinate system to the world coordinate system\&. .PP Reimplemented in \fBSbSphereProjector\fP, and \fBSbCylinderProjector\fP\&. .SS "const \fBSbMatrix\fP & SbProjector::getWorkingSpace (void) const" Returns projector-to-world matrix\&. .PP \fBSee also:\fP .RS 4 \fBsetWorkingSpace()\fP .RE .PP .SS "\fBSbProjector\fP * SbProjector::copy (void) const\fC [pure virtual]\fP" Construct and return a copy of this projector\&. The caller is responsible for destructing the new instance\&. .PP \fBNote that if the Coin library has been built as a DLL under Microsoft Windows and you use this method from application code, you \fImust\fP 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 \fIwill\fP get memory heap corruption upon deallocating the returned instances, eventually leading to mysterious crashes\&.\fP .PP Implemented in \fBSbCylinderSectionProjector\fP, \fBSbSphereSectionProjector\fP, \fBSbCylinderPlaneProjector\fP, \fBSbCylinderSheetProjector\fP, \fBSbSpherePlaneProjector\fP, \fBSbLineProjector\fP, \fBSbPlaneProjector\fP, and \fBSbSphereSheetProjector\fP\&. .SS "SbBool SbProjector::tryProject (const \fBSbVec2f\fP &point, const floatepsilon, \fBSbVec3f\fP &result)\fC [virtual]\fP" Try projecting the 2D \fIpoint\fP from normalized viewport coordinates to a 3D point\&. The mapping will be done in accordance with the type of the projector\&. .PP If the projection can't be done safely (for instance when the projection plane or line is parallel to the view volume projection), this function should return FALSE\&. .PP Default implementation will call \fBproject()\fP and always return TRUE, but subclasses can override this behavior to support safe projections\&. .PP \fBSince:\fP .RS 4 Coin 3\&.0 .RE .PP .PP Reimplemented in \fBSbLineProjector\fP, and \fBSbPlaneProjector\fP\&. .SS "\fBSbLine\fP SbProjector::getWorkingLine (const \fBSbVec2f\fP &point) const\fC [protected]\fP" From the 2D \fIpoint\fP in normalized screenspace coordinates, calculate the line passing through the scene\&. .PP Typically used for tracking intersection points for the mouse cursor\&. .SS "float SbProjector::findVanishingDistance (void) const\fC [protected]\fP" Finds the unit cube vanishing distance for the current projector view volume\&. The view volume must be a perspective view volume\&. .PP This method was not part of the Inventor v2\&.1 API, and is an extension specific to Coin\&. .PP \fBSince:\fP .RS 4 Coin 1\&.1 .RE .PP .SS "SbBool SbProjector::verifyProjection (const \fBSbVec3f\fP &projpt) const\fC [protected]\fP" Verifies that \fIprojpt\fP 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 \fITRUE\fP\&. .PP This method was not part of the Inventor v2\&.1 API, and is an extension specific to Coin\&. .PP \fBSince:\fP .RS 4 Coin 1\&.1 .RE .PP .SH "Member Data Documentation" .PP .SS "SbProjector::viewVol\fC [protected]\fP" The viewVol definition\&. .SS "SbProjector::worldToWorking\fC [protected]\fP" The matrix which converts from world coordinates to coordinates in the projector's local coordinate system\&. .SS "SbProjector::workingToWorld\fC [protected]\fP" The matrix which converts from coordinates in the projector's local coordinate system to world coordinates\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.