Package com.anylogic.engine
- java.lang.Object
- com.anylogic.engine.Scale
- All Implemented Interfaces:
Serializable
public class Scale extends Object implements Serializable
- See Also:
- Serialized Form
Modifier and Type | Field | Description |
---|---|---|
static final Scale | DEFAULT_SCALE |
Constructor | Description |
---|---|
Scale |
Modifier and Type | Method | Description |
---|---|---|
double | pixelsPerUnit |
Returns the number of pixels corresponding to one given unit,
according to the scaling settings of this objects
|
double | toLengthUnits |
Converts the given pixel length to the length units
|
double | toPixels |
Converts the length in the given length units to pixels
|
public static final Scale DEFAULT_SCALE
public Scale(double pixelsPerMeter)
public double pixelsPerUnit(LengthUnits unit)
Returns the number of pixels corresponding to one given unit,
according to the scaling settings of this objects
public double toLengthUnits(double lengthInPixels, LengthUnits units)
Converts the given pixel length to the length units
- Parameters:
lengthInPixels
- the length in pixels (in the scope of underlying agent which acts as 'Space')units
- length units- Returns:
- result in length units
public double toPixels(double lengthInUnits, LengthUnits units)
Converts the length in the given length units to pixels
- Parameters:
lengthInUnits
- the length inunits
units
- length units- Returns:
- result in pixels (in the scope of underlying agent which acts as 'Space')