![]() |
http://www.sim.no http://www.coin3d.org |
The SbSphereProjector class is the abstract base class for mapping to spherical surfaces.The sphere projectors map 2D points to various surface types based on spherical shapes. More...
#include <Inventor/projectors/SbSphereProjector.h>
Public Member Functions | |
SbVec3f | projectAndGetRotation (const SbVec2f &point, SbRotation &rot) |
virtual SbRotation | getRotation (const SbVec3f &point1, const SbVec3f &point2)=0 |
void | setSphere (const SbSphere &sph) |
const SbSphere & | getSphere (void) const |
void | setOrientToEye (const SbBool orienttoeye) |
SbBool | isOrientToEye (void) const |
void | setFront (const SbBool infront) |
SbBool | isFront (void) const |
SbBool | isPointInFront (const SbVec3f &point) const |
virtual void | setWorkingSpace (const SbMatrix &space) |
Protected Member Functions | |
SbSphereProjector (const SbBool orienttoeye) | |
SbSphereProjector (const SbSphere &s, const SbBool orienttoeye) | |
SbBool | intersectSphereFront (const SbLine &l, SbVec3f &result) |
Protected Attributes | |
SbBool | intersectFront |
SbSphere | sphere |
SbBool | orientToEye |
SbBool | needSetup |
SbVec3f | lastPoint |
The SbSphereProjector class is the abstract base class for mapping to spherical surfaces.
The sphere projectors map 2D points to various surface types based on spherical shapes.
SbSphereProjector::SbSphereProjector | ( | const SbBool | orienttoeye | ) | [protected] |
Default constructor sets up a sphere at the origin with radius 1.
SbSphereProjector::SbSphereProjector | ( | const SbSphere & | s, |
const SbBool | orienttoeye | ||
) | [protected] |
Constructor taking an explicit sphere projection definition.
SbVec3f SbSphereProjector::projectAndGetRotation | ( | const SbVec2f & | point, |
SbRotation & | rot | ||
) |
Project the 2D point to a 3D coordinate on the spherical surface, and find the rotation from the last projection to this one.
References lastPoint, SbProjector::project(), and getRotation().
SbRotation SbSphereProjector::getRotation | ( | const SbVec3f & | point1, |
const SbVec3f & | point2 | ||
) | [pure virtual] |
Returns rotation on the projection surface which re-orients point1 to point2.
Implemented in SbSphereSectionProjector, SbSpherePlaneProjector, and SbSphereSheetProjector.
Referenced by projectAndGetRotation(), and SoRotateSphericalDragger::drag().
void SbSphereProjector::setSphere | ( | const SbSphere & | sph | ) |
Set sphere to project onto.
References sphere, and needSetup.
Referenced by SoRotateSphericalDragger::dragStart(), and SoTransformerDragger::dragStart().
const SbSphere & SbSphereProjector::getSphere | ( | void | ) | const |
Returns projection sphere.
References sphere.
void SbSphereProjector::setOrientToEye | ( | const SbBool | orienttoeye | ) |
Sets whether or not the projection surface should be oriented towards the eye of the viewer. Default is TRUE
.
References orientToEye, and needSetup.
SbBool SbSphereProjector::isOrientToEye | ( | void | ) | const |
Returns the state of the sphere orientation flag.
References orientToEye.
Referenced by SbSphereSheetProjector::project().
void SbSphereProjector::setFront | ( | const SbBool | infront | ) |
Set whether to intersect with the outside of the sphere (infront equal to TRUE
), or the inside.
References intersectFront, and needSetup.
Referenced by SoRotateSphericalDragger::dragStart(), and SoTransformerDragger::dragStart().
SbBool SbSphereProjector::isFront | ( | void | ) | const |
Returns value of the flag which decides whether to intersect with the outside or inside of the sphere.
References intersectFront.
Referenced by intersectSphereFront().
SbBool SbSphereProjector::isPointInFront | ( | const SbVec3f & | point | ) | const |
Check if point is on the frontside or the backside of the cylinder.
References SbProjector::getViewVolume(), SbViewVolume::getProjectionType(), SbProjector::worldToWorking, SbMatrix::multVecMatrix(), SbViewVolume::getProjectionPoint(), sphere, SbSphere::getCenter(), SbMatrix::multDirMatrix(), SbViewVolume::zVector(), and SbVec3f::dot().
Referenced by SoRotateSphericalDragger::dragStart(), and SoTransformerDragger::dragStart().
void SbSphereProjector::setWorkingSpace | ( | const SbMatrix & | space | ) | [virtual] |
Sets the matrix used for converting from the projector's coordinate system to the world coordinate system.
Reimplemented from SbProjector.
References needSetup, and SbProjector::setWorkingSpace().
Referenced by SoRotateSphericalDragger::dragStart(), SoRotateSphericalDragger::drag(), and SoTransformerDragger::dragStart().
Intersect line with the SbSphereProjector::sphere and place the intersection point (if any) in result. Considers setFront() settings.
Returns TRUE
if line actually hits the sphere, FALSE
if it doesn't intersect with it.
References sphere, SbSphere::intersect(), and isFront().
Referenced by SbSpherePlaneProjector::project(), SbSphereSectionProjector::project(), and SbSphereSheetProjector::project().
SbSphereProjector::intersectFront [protected] |
Flag which says whether or not we should map to the outside or inside of the sphere surface.
Referenced by setFront(), isFront(), SbSphereSectionProjector::setupTolerance(), SbSphereSheetProjector::project(), and SbSphereSheetProjector::setupPlane().
SbSphereProjector::sphere [protected] |
Projection sphere.
Referenced by SbSpherePlaneProjector::getRotation(), setSphere(), getSphere(), isPointInFront(), intersectSphereFront(), SbSphereSectionProjector::project(), SbSphereSectionProjector::getRotation(), SbSphereSectionProjector::setupTolerance(), SbSphereSheetProjector::project(), and SbSphereSheetProjector::setupPlane().
SbSphereProjector::orientToEye [protected] |
Which direction the spherical surface is oriented.
Referenced by setOrientToEye(), isOrientToEye(), SbSphereSectionProjector::setupTolerance(), and SbSphereSheetProjector::setupPlane().
SbSphereProjector::needSetup [protected] |
Set to TRUE
whenever the projection surface needs to be recalculated according to the setting of the SbSphereProjector::orientToEye flag.
Referenced by SbSpherePlaneProjector::project(), setSphere(), setOrientToEye(), setFront(), setWorkingSpace(), SbSphereSectionProjector::project(), SbSphereSectionProjector::setTolerance(), SbSphereSectionProjector::isWithinTolerance(), SbSphereSectionProjector::setupTolerance(), SbSphereSheetProjector::project(), SbSphereSheetProjector::getRotation(), and SbSphereSheetProjector::setupPlane().
SbSphereProjector::lastPoint [protected] |
Stores the previously projected 3D point.
Referenced by SbSpherePlaneProjector::project(), projectAndGetRotation(), SbSphereSectionProjector::project(), and SbSphereSheetProjector::project().
Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.
Generated on Tue Feb 7 2012 for Coin by Doxygen. 1.7.5