All Packages Class Hierarchy This Package Previous Next Index
Class crw.data2.Conversion2
java.lang.Object
|
+----crw.data2.Conversion2
- public class Conversion2
- extends Object
A class to perform conversion between physical values
and screen scales.
- Version:
- 1.0, 1998/10/9
- Author:
- C. R. Wie
-
Conversion2()
-
Default constructor with unity conversion factors.
-
Conversion2(double)
-
Constructor with specified conversion factors.
-
getFillFactor()
-
Returns the fillfactor.
-
setFactor(int, double)
-
Conversion factor is caluculated from the screen
pixel width and the maximum physical range.
-
setFactor(int, FloatRange)
- Sets the conversion factors from the physical value range
-
setFactor(IntRange, FloatRange)
- Sets the conversion factors from the physical value range
-
setFillFactor(double)
- Sets the fillfactor to a new value.
-
setPhysToScr(double)
-
Sets the conversion factor from physical to screen.
-
toPhys(int)
-
Converts to the physical value.
-
toScr(double)
-
Converts to the screen scale.
-
toScr(double[])
- Converts to screen scale for an entire array of physical values.
-
toScr(double[][])
- Converts to the screen scale for the entire array.
-
toScr(int)
- Converts to the screen pixel scale.
-
toScr(Vector)
- Converts to screen pixels for an entire Vector.
-
toScr(Vector, Vector)
- Converts to screen pixel scale for an entire Vector, and puts the
resulting vector of screen-scales into scr.
Conversion2
public Conversion2()
- Default constructor with unity conversion factors.
Conversion2
public Conversion2(double toScr)
- Constructor with specified conversion factors.
- Parameters:
- toScr - the physical-to-screen conversion factor.
toScr
public int toScr(double phys)
- Converts to the screen scale.
- Parameters:
- phys - the physical value to convert to screen scale.
- Returns:
- the screen pixel size.
toScr
public int[] toScr(double phys[])
- Converts to screen scale for an entire array of physical values.
- Parameters:
- phys - the physical value array.
- Returns:
- the screen pixel array.
toScr
public Vector toScr(Vector phys)
- Converts to screen pixels for an entire Vector.
- Parameters:
- phys - the Vector that constains the physical values, Double objects.
- Returns:
- the corresponding Vector of screen scales, Integer objects.
toScr
public int toScr(int phys)
- Converts to the screen pixel scale.
- Parameters:
- phys - the physical value.
- Returns:
- the screen pixel value.
toScr
public int[][] toScr(double phys[][])
- Converts to the screen scale for the entire array.
- Parameters:
- phys - the physical 2D array.
- Returns:
- the 2D array of screen values.
toScr
public void toScr(Vector phys,
Vector scr)
- Converts to screen pixel scale for an entire Vector, and puts the
resulting vector of screen-scales into scr.
- Parameters:
- phys - Vector that constains the physical values.
param scr the corresponding Vector of screen scales.
toPhys
public double toPhys(int scr)
- Converts to the physical value.
- Parameters:
- scr - the screen pixel value.
- Returns:
- the physical double value.
setPhysToScr
public void setPhysToScr(double toScr)
- Sets the conversion factor from physical to screen.
It also sets the conversion factor for screen-to-physical.
- Parameters:
- toScr - the new physical-to-screen conversion factor.
setFactor
public void setFactor(int screenWidth,
double max)
- Conversion factor is caluculated from the screen
pixel width and the maximum physical range. Default fill
factor is 1.0 (the entire screen width).
- Parameters:
- screenWidth - the screen width.
- max - the maximum range of physical value.
setFactor
public void setFactor(int scrWidth,
FloatRange physRange)
- Sets the conversion factors from the physical value range
- Parameters:
- scrWidth - the screen dimension.
- physRange - the value range.
setFactor
public void setFactor(IntRange scrRange,
FloatRange physRange)
- Sets the conversion factors from the physical value range
- Parameters:
- scrRange - the screen dimension.
- physRange - the value range.
setFillFactor
public void setFillFactor(double fillFactor)
- Sets the fillfactor to a new value. 0.0 < factor <= 1.0
The conversion factors adjust to the new fillFactor.
- Parameters:
- fillFactor - the new fillfactor.
getFillFactor
public double getFillFactor()
- Returns the fillfactor.
- Returns:
- the fillfactor.
All Packages Class Hierarchy This Package Previous Next Index