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 | (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 SoProjection node applies a coordinate projection to geometry nodes. A valid instance of a SbProjection class is needed by an SoProjection node put in a scene graph.
To create a new projection class, implement a class inheriting from SbProjection. The only mandatory method to define a projection is the apply() method. To obtain the result of a projected point, call the project() method, which internally computes the result and calls apply(). You can also define the inverse() 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 setParameter() or getParameter()
The projection routine can get parameter values from the fields of the associated SoProjection node (if any). The parameters for a projection should be stored in the SoProjection node, as it is the only entry in the scene graph. The SoProjection.floatParameters field stores the float values that are synchronized with the float parameters of the projection class. The SoProjection.parameters field stores the string values that are synchronized with the string parameters of the projection class.
The init() method is called each time a parameter of the associated SoProjection node is modified. The exit() method is called at the SbProjection instance destruction.
If using the VolumeViz extension, defining the getProjectedBoundingBox() method will improve the rendering speed (see getProjectedBoundingBox comments).