Click or drag to resize
SbProjection Class

Base class for coordinate projection classes.

Inheritance Hierarchy

Namespace: OIV.Inventor.Projection
Assembly: OIV.Inventor (in OIV.Inventor.dll) Version: 2023.1.3.0 (2023.1.3)
Syntax
public class SbProjection : SoNetBase

The SbProjection type exposes the following members.

Constructors
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodExit

Exit method.

Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodGetNumFloatParameters

Get number of used float parameters.

Public methodGetNumStringParameters

Get number of used string parameters.

Public methodGetParameter(Int32, Single)

Get float parameter at position pos.

Public methodGetParameter(Int32, String)

Get string parameter at position pos.

Public methodGetProjectedBoundingBox

Return projected bounding box if available.

Public methodGetProjectionNode

Return associated projection node.

Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInit

Initialisation method.

Public methodInverse

Apply the inverse coordinate to one point.

Public methodProject(SbVec3f)

Apply the complete computation (matrix, pre-projection, projection, post-projection) to one point.

Public methodProject(SbVec3f, SbVec3f)

Apply the complete computation to a set of coordinates.

Public methodSetNumFloatParameters

Set number of float parameters to use.

Public methodSetNumStringParameters

Set number of string parameters to use.

Public methodSetParameter(Int32, Single)

Set float parameter.

Public methodSetParameter(Int32, String)

Set string parameter.

Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

This is the base class for classes that define a coordinate projection. The projection of a point P consists of computing a point P' and replacing internally the coordinates of P with the coordinates of P'. Projections can modify points in complex ways that are not possible with a transformation matrix. For example, projections allow the use of spherical coordinates, geospatial coordinates and others. An OIV.Inventor.Nodes.SoProjection node applies a coordinate projection to geometry nodes. A valid instance of a OIV.Inventor.Projection.SbProjection class is needed by an OIV.Inventor.Nodes.SoProjection node put in a scene graph.

To create a new projection class, implement a class inheriting from OIV.Inventor.Projection.SbProjection. The only mandatory method to define a projection is the apply() method. To obtain the result of a projected point, call the OIV.Inventor.Projection.SbProjection.Project(OIV.Inventor.SbVec3f@) method, which internally computes the result and calls apply(). You can also define the OIV.Inventor.Projection.SbProjection.Inverse(OIV.Inventor.SbVec3f@) method, which is only used for applications that must compute the inverse of a projected point.

The applyPreProjection() method can be defined and will be called just before a point is projected. The applyPostProjection() method can be defined and will be called just after a point has been projected.

A projection class stores a list of string parameters and a list of float parameters. You can set or inquire a parameter using OIV.Inventor.Projection.SbProjection.SetParameter(System.Int32, System.String) or OIV.Inventor.Projection.SbProjection.GetParameter(System.Int32, System.String@)

The projection routine can get parameter values from the fields of the associated OIV.Inventor.Nodes.SoProjection node (if any). The parameters for a projection should be stored in the OIV.Inventor.Nodes.SoProjection node, as it is the only entry in the scene graph. The OIV.Inventor.Nodes.SoProjection.floatParameters field stores the float values that are synchronized with the float parameters of the projection class. The OIV.Inventor.Nodes.SoProjection.parameters field stores the string values that are synchronized with the string parameters of the projection class.

The OIV.Inventor.Projection.SbProjection.Init() method is called each time a parameter of the associated OIV.Inventor.Nodes.SoProjection node is modified. The OIV.Inventor.Projection.SbProjection.Exit() method is called at the OIV.Inventor.Projection.SbProjection instance destruction.

If using the VolumeViz extension, defining the OIV.Inventor.Projection.SbProjection.GetProjectedBoundingBox(OIV.Inventor.SbBox3f@) method will improve the rendering speed (see OIV.Inventor.Projection.SbProjection.GetProjectedBoundingBox(OIV.Inventor.SbBox3f@) comments).

OIV.Inventor.Projection.SbProj4Projection, OIV.Inventor.Projection.SbSphericalProjection, OIV.Inventor.Nodes.SoProjection, OIV.Inventor.Nodes.SoGeoProjection, OIV.Inventor.Projection.SbProjectionCoordinates

See Also