public class SbProjection extends Inventor
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).
See also:
SbProj4Projection
, SbSphericalProjection
, SoProjection
, SoGeoProjection
, SbProjectionCoordinates
Inventor.ConstructorCommand
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SbProjection()
Constructor.
|
SbProjection(SbProjection proj)
Copy constructor.
|
SbProjection(SoProjection node)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
exit()
Exit method.
|
float |
getFloatParameter(int pos)
Get float parameter at position pos.
|
int |
getNumFloatParameters()
Get number of used float parameters.
|
int |
getNumStringParameters()
Get number of used string parameters.
|
SbBox3f |
getProjectedBoundingBox()
Return projected bounding box if available.
|
SoProjection |
getProjectionNode()
Return associated projection node.
|
java.lang.String |
getStringParameter(int pos)
Get string parameter at position pos.
|
void |
init()
Initialisation method.
|
SbVec3f |
inverse()
Apply the inverse coordinate to one point.
|
SbVec3f |
project()
Apply the complete computation (matrix, pre-projection, projection, post-projection) to one point.
|
void |
setNumFloatParameters(int numParameters)
Set number of float parameters to use.
|
void |
setNumStringParameters(int numParameters)
Set number of string parameters to use.
|
void |
setParameter(int parameterId,
float parameterFloat)
Set float parameter.
|
void |
setParameter(int parameterId,
java.lang.String parameterString)
Set string parameter.
|
dispose, getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
public SbProjection(SoProjection node)
public SbProjection(SbProjection proj)
public SbProjection()
public void exit()
public SbVec3f inverse()
public void init()
public SbBox3f getProjectedBoundingBox()
It depends on the projection, and it is why by default it returns false, and should be redefined by the specific inherited projection class if it make sense.
public void setParameter(int parameterId, float parameterFloat)
public int getNumFloatParameters()
public int getNumStringParameters()
public void setNumStringParameters(int numParameters)
public void setNumFloatParameters(int numParameters)
public void setParameter(int parameterId, java.lang.String parameterString)
public SbVec3f project()
public float getFloatParameter(int pos)
public java.lang.String getStringParameter(int pos)
public SoProjection getProjectionNode()
Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com