Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SbSphericalProjection Class Reference

Spherical coordinate projection. More...

#include <Inventor/projection/SbSphericalProjection.h>

+ Inheritance diagram for SbSphericalProjection:

Public Member Functions

 SbSphericalProjection ()
 Constructor.
 
 SbSphericalProjection (SoProjection *node)
 Constructor.
 
virtual ~SbSphericalProjection ()
 Destructor.
 
virtual void inverse (SbVec3f &point)
 Apply the inverse coordinate to one point.
 
virtual bool getProjectedBoundingBox (SbBox3f &bbox)
 Compute projected bounding box.
 
- Public Member Functions inherited from SbProjection
 SbProjection ()
 Constructor.
 
 SbProjection (SoProjection *node)
 Constructor.
 
 SbProjection (const SbProjection &proj)
 Copy constructor.
 
virtual ~SbProjection ()
 Destructor.
 
virtual void init ()
 Initialisation method.
 
virtual void exit ()
 Exit method.
 
void project (SbVec3f &point)
 Apply the complete computation (matrix, pre-projection, projection, post-projection) to one point.
 
void project (int numPoints, float *points)
 Apply the complete computation to a set of points.
 
void project (int32_t numCoords, const SbVec3f *coords, SbVec3f *projectedCoords)
 Apply the complete computation to a set of coordinates.
 
SoProjectiongetProjectionNode () const
 Return associated projection node.
 
virtual void setParameter (int parameterId, const SbString &parameterString)
 Set string parameter.
 
virtual void setParameter (int parameterId, const float &parameterFloat)
 Set float parameter.
 
void setNumStringParameters (int numParameters)
 Set number of string parameters to use.
 
void setNumFloatParameters (int numParameters)
 Set number of float parameters to use.
 
int getNumStringParameters () const
 Get number of used string parameters.
 
int getNumFloatParameters () const
 Get number of used float parameters.
 
SbBool getParameter (int pos, SbString &parameter) const
 Get string parameter at position pos.
 
SbBool getParameter (int pos, float &parameter) const
 Get float parameter at position pos.
 

Detailed Description

Spherical coordinate projection.

This class performs a spherical coordinate projection and is normally used with an SoProjection or SoGeoProjection node.

Spherical coordinates can be represented using the usual coordinate classes (SbVec3f, SoMFVec3f, etc) but the three values are considered to be

  • Longitude: an angle measured in degrees in the interval [-180,180]
  • Latitude: an angle measured in degrees in the interval [-90,90]
  • Altitude (or radius): a distance in 3D units greater than zero

The parameters are :

Name Type Index Default
radius float 0 0
scaleRatio float 1 1

The radius parameter is an offset added to each altitude value before projection. This is useful when the altitude values are, for example, relative to sea level.

The scaleRatio parameter is a multiplicative ratio applied to altitude values before projection. This is useful to exaggerate altitudes for visualization purposes.

The spherical projection of a point P(lon,lat,alt) is computed as follows:

newLon = lon * degreeToRadians
newLat = lat * degreeToRadians
newRadius = radius + alt * scaleRatio
x = newRadius*cos(newlat)*cos(newlon)
y = newRadius*cos(newlat)*sin(newlon)
z = newRadius*sin(newlat)

SEE ALSO

SbProjection, SoProjection

Definition at line 82 of file SbSphericalProjection.h.

Constructor & Destructor Documentation

◆ SbSphericalProjection() [1/2]

SbSphericalProjection::SbSphericalProjection ( )

Constructor.

◆ SbSphericalProjection() [2/2]

SbSphericalProjection::SbSphericalProjection ( SoProjection node)

Constructor.

◆ ~SbSphericalProjection()

virtual SbSphericalProjection::~SbSphericalProjection ( )
virtual

Destructor.

Member Function Documentation

◆ getProjectedBoundingBox()

virtual bool SbSphericalProjection::getProjectedBoundingBox ( SbBox3f bbox)
virtual

Compute projected bounding box.

Reimplemented from SbProjection.

◆ inverse()

virtual void SbSphericalProjection::inverse ( SbVec3f point)
virtual

Apply the inverse coordinate to one point.

Modifies the given object.

Reimplemented from SbProjection.


The documentation for this class was generated from the following file: