SbProjection Class |
Base class for coordinate projection classes.
Namespace: OIV.Inventor.Projection
The SbProjection type exposes the following members.
Name | Description | |
---|---|---|
SbProjection | Constructor. | |
SbProjection(SoProjection) | Constructor. |
Name | Description | |
---|---|---|
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Exit | Exit method. | |
GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) | |
GetNumFloatParameters | Get number of used float parameters. | |
GetNumStringParameters | Get number of used string parameters. | |
GetParameter(Int32, Single) | Get float parameter at position pos. | |
GetParameter(Int32, String) | Get string parameter at position pos. | |
GetProjectedBoundingBox | Return projected bounding box if available. | |
GetProjectionNode | Return associated projection node. | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Init | Initialisation method. | |
Inverse | Apply the inverse coordinate to one point. | |
Project(SbVec3f) | Apply the complete computation (matrix, pre-projection, projection, post-projection) to one point. | |
Project(SbVec3f, SbVec3f) | Apply the complete computation to a set of coordinates. | |
SetNumFloatParameters | Set number of float parameters to use. | |
SetNumStringParameters | Set number of string parameters to use. | |
SetParameter(Int32, Single) | Set float parameter. | |
SetParameter(Int32, String) | Set string parameter. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
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