com.azalient.api.draw
Interface IViewport


public interface IViewport

The Viewport holds information about the current view of the model - including the location of the viewpoint, the rotation, the zoom, the tilt angle and which layers are currently visible.


Field Summary
static double DEPTH_MAX
           
static Integer[] DRAW_INTERVALS
           
static double NEW_TRACT_SIZE
           
static int SCOPE_INIT
           
static int SCOPE_MAX
           
static int SCOPE_MIN
           
 
Method Summary
 IXyz box()
          Return the (x,y,z) location of the box cursor
 IXyz boxNewLocation()
           
 void canBeExploded(boolean b)
          Toggle view explosion from within an object.
 void change()
          Force all IDrawables to be redrawn at the next refresh.
 void clearPicks()
          Clear all picked objects
 IAngle compass()
          Return the compass bearing angle
 boolean contains(IXyz p)
          Return true if the given point is inside the viewport
 boolean containsXY(IXyz p)
          Return true if the given point is inside the viewport bounds, regardless of height
 IAspect currentAspect()
          Return the current visible aspect.
 boolean currentAspect(int a)
          Set the current visible aspect.
 double depth()
          Return the depth slice height
 boolean dragging()
          Return true if currently dragging
 int drawInterval()
          Return the draw-interval, in seconds.
 int drawIntervalLevel()
          Return the draw-interval by its level: 0 = every time step, 1 = every second, 2 = every 5 seconds etc
 boolean drawIntervalLevel(int i)
          Set the draw-interval by its level: 0 = every time step, 1 = every second, 2 = every 5 seconds etc
 double explodedScale()
          return the current exploded-view scale: a value of 1.0 means not exploded
 IXyz eye()
          Return the (x,y,z) location of the viewpoint
 void gotoObject()
          Raise the "Find" window, which will search for an object and move the viewpoint to that object using moveTo(com.azalient.api.a.position.IXyz)
 boolean inField(IXyz p)
          Return true if the given point is inside the current depth slice
 boolean inField(IXyz p, double h)
          Return true if the given point, adjusted by height h, is inside the current depth slice
 IMouseState mouse()
          Return a handle to the mouse state, which is cached on each mouse event
 void moveTo(IXyz p)
          Move the cursor to the given point P
 boolean moving()
          Return true if currently panning
 OpenGLWindow openGLWindow()
          Return a handle to the OpenGL Window object
 boolean picking()
          Return true if currently picking
 boolean pickingAll()
          Return true if all objects should be picked, regardless of visibility (SHIFT is pressed).
 void promptIfInvisible(IViewable viewable)
          Set a toggle to prompt once only for a given viewable.
 void refresh()
          Force a redraw of all objects
 IShape.RenderMode renderMode()
          Return the current rendering mode: Flat, Solid etc
 void renderMode(IShape.RenderMode rm)
          Set the current rendering mode: Flat, Solid etc
 int rgb(IFeature feature)
          Return the RGB colour of the given feature in the currently selected Aspect
 int rgb(IViewable viewable)
          Return the RGB colour of the given viewable in the currently selected Aspect
 void rotateTo(IAngle a)
          Rotate the view bearing to the given angle
 int scope()
          Return the current scope, 1..10
 boolean scope(int newScope)
          Set the scope value, a value between 1 and 10
 IXyz side()
          Return a unit vector to the left of the cursor, given the current view rotation
 IXyz sideT()
          Return a unit vector from the cursor to the marked side point, given the current view rotation and the rotation of the cursor
 int tag()
          A tag for display lists.
 IXyz tee()
          Return the (x,y,z) location of the T point, the distant end of a new road or walkway
 IXyz teeNewLocation()
           
 IAngle tilt()
          Return the tilt angle
 void tiltTo(double d)
          Change the tilt angle of the view to the given angle in degrees
 boolean visible(IFeature feature)
          Return true if the given feature is currently visible
 boolean visible(IViewable viewable)
          Return true if the given viewable is currently visible
 int visibleLayer()
          Deprecated. use currentAspect()
 boolean visibleLayer(int v)
          Deprecated. use currentAspect(int)
 OpenGLWindow window()
          Deprecated. Use openGLWindow()
 double zoom()
          Return the zoom (view point) height
 void zoomTo(double z)
          Change the zoom (the viewpoint height) to the given value
 

Field Detail

NEW_TRACT_SIZE

static final double NEW_TRACT_SIZE
See Also:
Constant Field Values

DRAW_INTERVALS

static final Integer[] DRAW_INTERVALS

SCOPE_MIN

static final int SCOPE_MIN
See Also:
Constant Field Values

SCOPE_INIT

static final int SCOPE_INIT
See Also:
Constant Field Values

SCOPE_MAX

static final int SCOPE_MAX
See Also:
Constant Field Values

DEPTH_MAX

static final double DEPTH_MAX
See Also:
Constant Field Values
Method Detail

refresh

void refresh()
Force a redraw of all objects


change

void change()
Force all IDrawables to be redrawn at the next refresh. Calling this does not force a redraw, merely toggles the changed state so that it appears as if the viewpoint has moved and all objects must be redrawn. This might be called if an object changes its visible state during a simulation call-back and it is necessary to redraw it at the end of the time-step, even if the viewpoint has not moved


gotoObject

void gotoObject()
Raise the "Find" window, which will search for an object and move the viewpoint to that object using moveTo(com.azalient.api.a.position.IXyz)


renderMode

void renderMode(IShape.RenderMode rm)
Set the current rendering mode: Flat, Solid etc


canBeExploded

void canBeExploded(boolean b)
Toggle view explosion from within an object. This allows you to explode some parts and not others


tiltTo

void tiltTo(double d)
Change the tilt angle of the view to the given angle in degrees


moveTo

void moveTo(IXyz p)
Move the cursor to the given point P


rotateTo

void rotateTo(IAngle a)
Rotate the view bearing to the given angle


zoomTo

void zoomTo(double z)
Change the zoom (the viewpoint height) to the given value


clearPicks

void clearPicks()
Clear all picked objects


promptIfInvisible

void promptIfInvisible(IViewable viewable)
Set a toggle to prompt once only for a given viewable. This would be used, for example, if you were to add a new crossing, but crossing were not currently visible


drawIntervalLevel

boolean drawIntervalLevel(int i)
Set the draw-interval by its level: 0 = every time step, 1 = every second, 2 = every 5 seconds etc


scope

boolean scope(int newScope)
Set the scope value, a value between 1 and 10


currentAspect

boolean currentAspect(int a)
Set the current visible aspect. An aspect is a collection of layers


window

OpenGLWindow window()
Deprecated. Use openGLWindow()

Return a handle to the OpenGL Window object


openGLWindow

OpenGLWindow openGLWindow()
Return a handle to the OpenGL Window object


mouse

IMouseState mouse()
Return a handle to the mouse state, which is cached on each mouse event


currentAspect

IAspect currentAspect()
Return the current visible aspect. An aspect is a collection of layers


renderMode

IShape.RenderMode renderMode()
Return the current rendering mode: Flat, Solid etc


scope

int scope()
Return the current scope, 1..10


drawIntervalLevel

int drawIntervalLevel()
Return the draw-interval by its level: 0 = every time step, 1 = every second, 2 = every 5 seconds etc


drawInterval

int drawInterval()
Return the draw-interval, in seconds. A value of zero means every time step


zoom

double zoom()
Return the zoom (view point) height


depth

double depth()
Return the depth slice height


explodedScale

double explodedScale()
return the current exploded-view scale: a value of 1.0 means not exploded


compass

IAngle compass()
Return the compass bearing angle


tilt

IAngle tilt()
Return the tilt angle


box

IXyz box()
Return the (x,y,z) location of the box cursor


tee

IXyz tee()
Return the (x,y,z) location of the T point, the distant end of a new road or walkway


eye

IXyz eye()
Return the (x,y,z) location of the viewpoint


side

IXyz side()
Return a unit vector to the left of the cursor, given the current view rotation


sideT

IXyz sideT()
Return a unit vector from the cursor to the marked side point, given the current view rotation and the rotation of the cursor


boxNewLocation

IXyz boxNewLocation()

teeNewLocation

IXyz teeNewLocation()

moving

boolean moving()
Return true if currently panning


dragging

boolean dragging()
Return true if currently dragging


picking

boolean picking()
Return true if currently picking


pickingAll

boolean pickingAll()
Return true if all objects should be picked, regardless of visibility (SHIFT is pressed). If dragging out a box, sometimes we want to pick even those things that are hidden, like the loops, signs and stands on a lane


visible

boolean visible(IFeature feature)
Return true if the given feature is currently visible


visible

boolean visible(IViewable viewable)
Return true if the given viewable is currently visible


contains

boolean contains(IXyz p)
Return true if the given point is inside the viewport


containsXY

boolean containsXY(IXyz p)
Return true if the given point is inside the viewport bounds, regardless of height


inField

boolean inField(IXyz p)
Return true if the given point is inside the current depth slice


inField

boolean inField(IXyz p,
                double h)
Return true if the given point, adjusted by height h, is inside the current depth slice


rgb

int rgb(IFeature feature)
Return the RGB colour of the given feature in the currently selected Aspect


rgb

int rgb(IViewable viewable)
Return the RGB colour of the given viewable in the currently selected Aspect


tag

int tag()
A tag for display lists. DO NOT USE in API !


visibleLayer

int visibleLayer()
Deprecated. use currentAspect()


visibleLayer

boolean visibleLayer(int v)
Deprecated. use currentAspect(int)