SbProjector(3)

πŸ“¦ version 2.5.0, in fedora 43, fedora 44

πŸ’– SbProjector(3) πŸ’–

okay bestie, welcome to the Library Functions Manual entry for SbProjector(3) β€” yes the (3) means it's a library function page, we love a well-organized section. pull up a chair, grab a boba, we're learning the abstract base projector class together 🫢


✨ NAME ✨

SbProjector β€” the SbProjector class is the abstract base projector class. that's it, that's the whole name section, she's mysterious, she's foundational, she's giving main character energy πŸ‘‘


🌈 SYNOPSIS 🌈

#include <Inventor/projectors/SbProjector.h>

Inherited by SbCylinderProjector, SbLineProjector, SbPlaneProjector, and SbSphereProjector. (so many iconic children, she's literally the mother of projectors 😭)

🌸 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

πŸ’… Detailed Description πŸ’…

The SbProjector class is the abstract base projector class. no cap.

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. it's giving glow-up from flat screen to full 3D reality ✨

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. like, that's the whole vibe β€” you drag, it moves, everybody's happy πŸ’–

For a usage example, see the class documentation for SbSphereSheetProjector. (go read it, it's a whole tutorial moment)

The application programmer should normally not need to care about the projector classes, unless there are special needs in the application. lowkey you can ignore this whole page unless you're doing something fancy, and that's on periodt πŸ’…

See also

  • SoDragger

πŸ‘‘ Constructor & Destructor Documentation πŸ‘‘

SbProjector::SbProjector (void ) [protected]

The constructor initializes the workingspace matrix to an identity matrix. clean slate, blank canvas, fresh start energy 🧚

References workingToWorld, and worldToWorking.

Referenced by copy().

virtual SbProjector::~SbProjector () [inline], [protected], [virtual]

Destructor is protected, as this is an abstract class. she doesn't do public goodbyes, she's exclusive like that πŸ™ˆ


🌟 Member Function Documentation 🌟

virtual SbVec3f SbProjector::project (const SbVec2f & point) [pure virtual]

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. she's abstract, so she's like "you figure out the how, I'll hold the what" πŸ’β™€οΈ

Implemented in SbCylinderPlaneProjector, SbCylinderProjector, SbCylinderSectionProjector, SbCylinderSheetProjector, SbLineProjector, SbPlaneProjector, SbSpherePlaneProjector, SbSphereSectionProjector, and SbSphereSheetProjector.

References getViewVolume(), getWorkingSpace(), setViewVolume(), and setWorkingSpace().

Referenced by SbSphereProjector::projectAndGetRotation().

void SbProjector::setViewVolume (const SbViewVolume & vol) [virtual]

Set the viewing volume the projections will take place in. tell her where the party's at and she'll show up πŸŽ‰

See also

  • getViewVolume()

References viewVol.

Referenced by project().

const SbViewVolume & SbProjector::getViewVolume (void ) const

Return the current viewing volume used by the projections. receipts, basically πŸ“‹

See also

  • setViewVolume()

References viewVol.

Referenced by SbCylinderProjector::isPointInFront(), SbSphereProjector::isPointInFront(), and project().

void SbProjector::setWorkingSpace (const SbMatrix & space) [virtual]

Sets the matrix used for converting from the projector's coordinate system to the world coordinate system. translation era 🚚✨

Reimplemented in SbCylinderProjector, and SbSphereProjector.

References SbMatrix::inverse(), workingToWorld, and worldToWorking.

Referenced by project(), SbCylinderProjector::setWorkingSpace(), and SbSphereProjector::setWorkingSpace().

const SbMatrix & SbProjector::getWorkingSpace (void ) const

Returns projector-to-world matrix. the whole map, handed to you πŸ—ΊοΈ

See also

  • setWorkingSpace()

References workingToWorld.

Referenced by project().

virtual SbProjector * SbProjector::copy (void ) const [pure virtual]

Construct and return a copy of this projector. The caller is responsible for destructing the new instance. you made the clone, you clean up the clone, that's the rule bestie πŸ’…

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. πŸ’€ not the mysterious crashes, we do NOT want those, so pls pls pls get this right πŸ™

Implemented in SbCylinderPlaneProjector, SbCylinderSectionProjector, SbCylinderSheetProjector, SbLineProjector, SbPlaneProjector, SbSpherePlaneProjector, SbSphereSectionProjector, and SbSphereSheetProjector.

References SbProjector().

Referenced by SoRotateCylindricalDragger::copyContents(), and SoRotateSphericalDragger::copyContents().

SbLine SbProjector::getWorkingLine (const SbVec2f & point) const [protected]

From the 2D point in normalized screenspace coordinates, calculate the line passing through the scene. draw the line, follow the line, it's giving laser pointer energy πŸ”¦

Typically used for tracking intersection points for the mouse cursor. where's the cursor? on the line. always has been πŸ–±οΈ

References viewVol, and worldToWorking.

Referenced by SbCylinderPlaneProjector::project(), SbCylinderSectionProjector::project(), SbCylinderSheetProjector::project(), SbLineProjector::project(), SbPlaneProjector::project(), SbSpherePlaneProjector::project(), SbSphereSectionProjector::project(), and SbSphereSheetProjector::project().

float SbProjector::findVanishingDistance (void ) const [protected]

Finds the unit cube vanishing distance for the current projector view volume. The view volume must be a perspective view volume. like, non-negotiable, perspective only, orthographic need not apply 🚫

This method was not part of the Inventor v2.1 API, and is an extension specific to Coin. so if you're kicking it old-school, heads up.

Since

  • 1.1.0

References SbViewVolume::getHeight(), SbViewVolume::getProjectionType(), SbViewVolume::PERSPECTIVE, SbViewVolume::projectBox(), SbMatrix::setTranslate(), SbBox3f::transform(), and viewVol.

Referenced by SbLineProjector::project(), and SbPlaneProjector::project().

SbBool SbProjector::verifyProjection (const SbVec3f & projpt) const [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. so chill, ortho girlies, you're always valid πŸ’–

This method was not part of the Inventor v2.1 API, and is an extension specific to Coin. same disclaimer as above, iykyk.

Since

  • 1.1.0

References SbPlane::isInHalfSpace(), SbViewVolume::PERSPECTIVE, viewVol, and workingToWorld.

Referenced by SbLineProjector::project(), and SbPlaneProjector::project().


πŸ“ Member Data Documentation πŸ“

SbViewVolume SbProjector::viewVol [protected]

The viewVol definition. short, sweet, does exactly what it says on the tin ✨

Referenced by findVanishingDistance(), getViewVolume(), getWorkingLine(), SbLineProjector::project(), SbPlaneProjector::project(), SbCylinderSheetProjector::setupPlane(), SbPlaneProjector::setupPlane(), SbSphereSheetProjector::setupPlane(), SbCylinderSectionProjector::setupTolerance(), SbSphereSectionProjector::setupTolerance(), setViewVolume(), and verifyProjection().

SbMatrix SbProjector::worldToWorking [protected]

The matrix which converts from world coordinates to coordinates in the projector's local coordinate system. the "translate me back home" matrix 🏠

Referenced by getWorkingLine(), SbCylinderProjector::isPointInFront(), SbSphereProjector::isPointInFront(), SbLineProjector::project(), SbPlaneProjector::project(), SbProjector(), SbCylinderSheetProjector::setupPlane(), SbPlaneProjector::setupPlane(), SbSphereSheetProjector::setupPlane(), SbCylinderSectionProjector::setupTolerance(), SbSphereSectionProjector::setupTolerance(), and setWorkingSpace().

SbMatrix SbProjector::workingToWorld [protected]

The matrix which converts from coordinates in the projector's local coordinate system to world coordinates. and this one is the "translate me out into the world" matrix 🌍

Referenced by getWorkingSpace(), SbLineProjector::project(), SbPlaneProjector::project(), SbProjector(), setWorkingSpace(), and verifyProjection().


🌈 Author 🌈

Generated automatically by Doxygen for Coin from the source code. (yes bestie, a robot wrote the skeleton of this and we're just here to make it cute πŸ’…)


okay that's the whole page!! πŸŽ€ and for the cute sign-off moment you asked for: this absolute icon of a document is from Coin, Version 2.5.0, and it's the SbProjector(3) page. go forth and project things in 3D, you've got this πŸ«Άβœ¨πŸ’–

πŸ“¦ where this page comes from