com.metsci.glimpse.support.projection
Interface Projection

All Known Implementing Classes:
FlatProjection, GenericProjection, PolarProjection, TangentPlaneProjection

public interface Projection

Provides a mapping from a texture coordinate to the lower left corner of the polygon which it should be mapped onto. The mapping should provide values for at least one texture coordinate beyond the edge of the texture, since these define the top and right side of the polygons on the edge of the texture.

Author:
ulman

Method Summary
 int getSizeX(int textureSizeX)
          Returns the number of quads in the x direction that the array of data (the texture) should be broken into.
 int getSizeY(int textureSizeY)
           
 void getVertexXY(double dataFractionX, double dataFractionY, float[] resultXY)
          Given a position in a rectangular array of data (the texture), return the corresponding location in physical units.
 void getVertexXYZ(double dataFractionX, double dataFractionY, float[] resultXYZ)
          Given a position in a rectangular array of data (the texture), return the corresponding location in physical units.
 

Method Detail

getVertexXY

void getVertexXY(double dataFractionX,
                 double dataFractionY,
                 float[] resultXY)
Given a position in a rectangular array of data (the texture), return the corresponding location in physical units. The position is given as relative coordinates, with 0.0 indicating the 0th data index and 1.0 indicating the last data index.

This method computes the physical coordinate of the data at (textureFractionX, textureFractionY), and stores them in the resultXY output parameter.

Parameters:
dataFractionX - a relative x index (from 0.0 to 1.0) into the data array
dataFractionY - a relative y index (from 0.0 to 1.0) into the data array
resultXY - output parameter to be populated with physical coords of the data

getVertexXYZ

void getVertexXYZ(double dataFractionX,
                  double dataFractionY,
                  float[] resultXYZ)
Given a position in a rectangular array of data (the texture), return the corresponding location in physical units. The position is given as relative coordinates, with 0.0 indicating the 0th data index and 1.0 indicating the last data index.

This method computes the physical coordinate of the data at (textureFractionX, textureFractionY), and stores them in the resultXYZ output parameter.

Assigning z coordinates to vertices can be useful even for 2D graphics. For example, it can be used together with z-clipping to avoid rendering some facets.

Parameters:
dataFractionX - a relative x index (from 0.0 to 1.0) into the data array
dataFractionY - a relative y index (from 0.0 to 1.0) into the data array
resultXYZ - output parameter to be populated with physical coords of the data

getSizeX

int getSizeX(int textureSizeX)
Returns the number of quads in the x direction that the array of data (the texture) should be broken into. If the projection is linear in the x direction (for example, if the data/texture is simply being displayed on a rectangle) then only one quad is needed.

For more complicated projections, the value returned essentially defines the granularity or resolution of the projection (since the projection will ultimately be approximated when displayed by drawing a set of small quads).

Parameters:
textureSizeX - the length of the data array (the texture) in the x direction
Returns:
the number of quads in the x direction to draw

getSizeY

int getSizeY(int textureSizeY)
Parameters:
textureSizeY - the length of the data array (the texture) in the y direction
Returns:
the number of quads in the y direction to draw
See Also:
getSizeX( int )


Copyright © 2012 Metron, Inc.. All Rights Reserved.