edu.uthscsa.ric.visualization
Interface SurfaceFormat


public interface SurfaceFormat

A class that implements SurfaceFormat can be registered with Mango to extend the number of surface formats supported.


Method Summary
 Object clone()
          Returns a copy of the object.
 String getName()
          Deprecated.  
 String getPreferredFileExtension()
          Returns the preferred file extension of this format.
 boolean isThisFormat(File file)
          Used to determine if a file is of this format (e.g., read magic number, check file size, check file extension, etc).
 SurfaceData[] readFormat(File file, ViewerController vc)
          Reads surface data from file.
 void writeFormat(File file, SurfaceData[] data, ViewerController vc)
          Writes surface data to file.
 

Method Detail

readFormat

SurfaceData[] readFormat(File file,
                         ViewerController vc)
Reads surface data from file. For returned data, if triangle data is in the form of strip counts, then normals data must be present. If triangle data is in the form of indices, then normals data may or may not be present.

Parameters:
file - the file to read
vc - the ViewerController object can be used to access image dimensions, orientation, lookup tables, etc.
Returns:
the read surface data; the first index in the return array specifies the base image surface.

writeFormat

void writeFormat(File file,
                 SurfaceData[] data,
                 ViewerController vc)
Writes surface data to file. Triangle data is always passed to this method as strip counts.

Parameters:
file - the file to write
data - the data to write; the first index in data specifies the base image surface
vc - the ViewerController object can be used to access image dimensions, orientation, lookup tables, etc.

isThisFormat

boolean isThisFormat(File file)
Used to determine if a file is of this format (e.g., read magic number, check file size, check file extension, etc).

Parameters:
file - the file to read
Returns:
returns true if this file can be read by this format, false otherwise

getPreferredFileExtension

String getPreferredFileExtension()
Returns the preferred file extension of this format.

Returns:
the preferred file extension

getName

String getName()
Deprecated. 

Returns the name of this format.

Returns:
the name of this format

clone

Object clone()
Returns a copy of the object.

Returns:
a copy