.TH "SbProjector" 3 "Fri Sep 6 2024 15:32:06" "Version 4.0.3" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SbProjector \- The \fBSbProjector\fP class is the abstract base projector class\&. .SH SYNOPSIS .br .PP .PP \fR#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\&. 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\&. .PP 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 )\fR [protected]\fP" The constructor initializes the working space matrix to an identity matrix\&. .SS "virtual SbProjector::~SbProjector ()\fR [inline]\fP, \fR [protected]\fP, \fR [virtual]\fP" Destructor is protected, as this is an abstract class\&. .SH "Member Function Documentation" .PP .SS "virtual \fBSbVec3f\fP SbProjector::project (const \fBSbVec2f\fP & point)\fR [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 \fBSbCylinderPlaneProjector\fP, \fBSbCylinderProjector\fP, \fBSbCylinderSectionProjector\fP, \fBSbCylinderSheetProjector\fP, \fBSbLineProjector\fP, \fBSbPlaneProjector\fP, \fBSbSpherePlaneProjector\fP, \fBSbSphereSectionProjector\fP, and \fBSbSphereSheetProjector\fP\&. .SS "void SbProjector::setViewVolume (const \fBSbViewVolume\fP & vol)\fR [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)\fR [virtual]\fP" Sets the matrix used for converting from the projector's coordinate system to the world coordinate system\&. .PP Reimplemented in \fBSbCylinderProjector\fP, and \fBSbSphereProjector\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 "virtual \fBSbProjector\fP * SbProjector::copy (void ) const\fR [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 are 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 .br .br .PP Implemented in \fBSbCylinderPlaneProjector\fP, \fBSbCylinderSectionProjector\fP, \fBSbCylinderSheetProjector\fP, \fBSbLineProjector\fP, \fBSbPlaneProjector\fP, \fBSbSpherePlaneProjector\fP, \fBSbSphereSectionProjector\fP, and \fBSbSphereSheetProjector\fP\&. .SS "SbBool SbProjector::tryProject (const \fBSbVec2f\fP & point, const float epsilon, \fBSbVec3f\fP & result)\fR [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\fR [protected]\fP" From the 2D \fIpoint\fP in normalized screen space 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\fR [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\fR [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 "\fBSbViewVolume\fP SbProjector::viewVol\fR [protected]\fP" The viewing volume definition\&. .SS "\fBSbMatrix\fP SbProjector::worldToWorking\fR [protected]\fP" The matrix which converts from world coordinates to coordinates in the projector's local coordinate system\&. .SS "\fBSbMatrix\fP SbProjector::workingToWorld\fR [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\&.