org.ogre4j
Class Viewport

java.lang.Object
  extended by org.xbig.base.NativeObject
      extended by org.ogre4j.Viewport
All Implemented Interfaces:
IAllocatedObject<IRenderSysAllocPolicy>, IRenderSysAllocatedObject, IViewport, INativeObject

public class Viewport
extends NativeObject
implements IViewport


Field Summary
 
Fields inherited from class org.xbig.base.NativeObject
deleted, object, remote
 
Constructor Summary
  Viewport(ICamera camera, IRenderTarget target, float left, float top, float width, float height, int ZOrder)
          The usual constructor.
  Viewport(InstancePointer p)
          This constructor is public for internal useage only!
protected Viewport(InstancePointer p, boolean remote)
          Creates a Java wrapper object for an existing C++ object.
  Viewport(WithoutNativeObject val)
          Allows creation of Java objects without C++ objects.
 
Method Summary
 void _clearUpdatedFlag()
           
 long _getNumRenderedBatches()
          Gets the number of rendered batches in the last update.
 long _getNumRenderedFaces()
          Gets the number of rendered faces in the last update.
 IRenderQueueInvocationSequence _getRenderQueueInvocationSequence()
           
 boolean _isUpdated()
           
 void _updateDimensions()
          Notifies the viewport of a possible change in dimensions.
 void delete()
          Deletes the corresponding C++ object.
 void finalize()
           
 void getActualDimensions(IntegerPointer left, IntegerPointer top, IntegerPointer width, IntegerPointer height)
          Access to actual dimensions (based on target size).
 int getActualHeight()
          Gets one of the actual dimensions of the viewport, a value in pixels.
 int getActualLeft()
          Gets one of the actual dimensions of the viewport, a value in pixels.
 int getActualTop()
          Gets one of the actual dimensions of the viewport, a value in pixels.
 int getActualWidth()
          Gets one of the actual dimensions of the viewport, a value in pixels.
 IColourValue getBackgroundColour()
          Gets the background colour.
 ICamera getCamera()
          Retrieves a pointer to the camera for this viewport.
 long getClearBuffers()
          Gets which buffers are to be cleared each frame.
 boolean getClearEveryFrame()
          Determines if the viewport is cleared before every frame.
 float getHeight()
          Gets one of the relative dimensions of the viewport, a value between 0.0 and 1.0.
 float getLeft()
          Gets one of the relative dimensions of the viewport, a value between 0.0 and 1.0.
 java.lang.String getMaterialScheme()
          Get the material scheme which the viewport should use.
 boolean getOverlaysEnabled()
          Returns whether or not objects (created in the ) are displayed in this viewport.
 java.lang.String getRenderQueueInvocationSequenceName()
          Gets the name of the render queue invocation sequence for this target.
 boolean getShadowsEnabled()
          Returns whether or not shadows (defined in the ) are displayed in this viewport.
 boolean getSkiesEnabled()
          Returns whether or not skies (created in the ) are displayed in this viewport.
 IRenderTarget getTarget()
          Retrieves a pointer to the render target for this viewport.
 float getTop()
          Gets one of the relative dimensions of the viewport, a value between 0.0 and 1.0.
 long getVisibilityMask()
          Gets a per-viewport visibility mask.
 float getWidth()
          Gets one of the relative dimensions of the viewport, a value between 0.0 and 1.0.
 int getZOrder()
          Gets the Z-Order of this viewport.
 void setBackgroundColour(IColourValue colour)
          Sets the initial background colour of the viewport (before rendering).
 void setCamera(ICamera cam)
          Sets the camera to use for rendering to this viewport.
 void setClearEveryFrame(boolean clear, long buffers)
          Determines whether to clear the viewport before rendering.
 void setDimensions(float left, float top, float width, float height)
          Sets the dimensions (after creation).
 void setMaterialScheme(java.lang.String schemeName)
          Set the material scheme which the viewport should use.
 void setOverlaysEnabled(boolean enabled)
          Tells this viewport whether it should display objects.
 void setRenderQueueInvocationSequenceName(java.lang.String sequenceName)
          Sets the use of a custom for rendering this target.
 void setShadowsEnabled(boolean enabled)
          Tells this viewport whether it should display shadows.
 void setSkiesEnabled(boolean enabled)
          Tells this viewport whether it should display skies.
 void setVisibilityMask(long mask)
          Sets a per-viewport visibility mask.
 void update()
          Instructs the viewport to updates its contents.
 
Methods inherited from class org.xbig.base.NativeObject
disconnectFromNativeObject, equals, getInstancePointer, hashCode, setInstancePointer, setInstancePointer, setInstancePointer, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xbig.base.INativeObject
disconnectFromNativeObject, getInstancePointer, setInstancePointer, setInstancePointer, setInstancePointer
 

Constructor Detail

Viewport

public Viewport(InstancePointer p)
This constructor is public for internal useage only! Do not use it!


Viewport

protected Viewport(InstancePointer p,
                   boolean remote)
Creates a Java wrapper object for an existing C++ object. If remote is set to 'true' this object cannot be deleted in Java.


Viewport

public Viewport(WithoutNativeObject val)
Allows creation of Java objects without C++ objects.

See Also:
WithoutNativeObject, INativeObject.disconnectFromNativeObject()

Viewport

public Viewport(ICamera camera,
                IRenderTarget target,
                float left,
                float top,
                float width,
                float height,
                int ZOrder)
The usual constructor.

Method Detail

delete

public void delete()
Description copied from interface: INativeObject
Deletes the corresponding C++ object.

Subclasses must implement this but if the native instance was created by the underlying library the native call to dispose must not happen!

Specified by:
delete in interface INativeObject
Specified by:
delete in class NativeObject
See Also:
#remote

finalize

public void finalize()
Overrides:
finalize in class NativeObject

_updateDimensions

public void _updateDimensions()
Notifies the viewport of a possible change in dimensions.

Specified by:
_updateDimensions in interface IViewport

update

public void update()
Instructs the viewport to updates its contents.

Specified by:
update in interface IViewport

getTarget

public IRenderTarget getTarget()
Retrieves a pointer to the render target for this viewport.

Specified by:
getTarget in interface IViewport

getCamera

public ICamera getCamera()
Retrieves a pointer to the camera for this viewport.

Specified by:
getCamera in interface IViewport

setCamera

public void setCamera(ICamera cam)
Sets the camera to use for rendering to this viewport.

Specified by:
setCamera in interface IViewport

getZOrder

public int getZOrder()
Gets the Z-Order of this viewport.

Specified by:
getZOrder in interface IViewport

getLeft

public float getLeft()
Gets one of the relative dimensions of the viewport, a value between 0.0 and 1.0.

Specified by:
getLeft in interface IViewport

getTop

public float getTop()
Gets one of the relative dimensions of the viewport, a value between 0.0 and 1.0.

Specified by:
getTop in interface IViewport

getWidth

public float getWidth()
Gets one of the relative dimensions of the viewport, a value between 0.0 and 1.0.

Specified by:
getWidth in interface IViewport

getHeight

public float getHeight()
Gets one of the relative dimensions of the viewport, a value between 0.0 and 1.0.

Specified by:
getHeight in interface IViewport

getActualLeft

public int getActualLeft()
Gets one of the actual dimensions of the viewport, a value in pixels.

Specified by:
getActualLeft in interface IViewport

getActualTop

public int getActualTop()
Gets one of the actual dimensions of the viewport, a value in pixels.

Specified by:
getActualTop in interface IViewport

getActualWidth

public int getActualWidth()
Gets one of the actual dimensions of the viewport, a value in pixels.

Specified by:
getActualWidth in interface IViewport

getActualHeight

public int getActualHeight()
Gets one of the actual dimensions of the viewport, a value in pixels.

Specified by:
getActualHeight in interface IViewport

setDimensions

public void setDimensions(float left,
                          float top,
                          float width,
                          float height)
Sets the dimensions (after creation).

Specified by:
setDimensions in interface IViewport

setBackgroundColour

public void setBackgroundColour(IColourValue colour)
Sets the initial background colour of the viewport (before rendering).

Specified by:
setBackgroundColour in interface IViewport

getBackgroundColour

public IColourValue getBackgroundColour()
Gets the background colour.

Specified by:
getBackgroundColour in interface IViewport

setClearEveryFrame

public void setClearEveryFrame(boolean clear,
                               long buffers)
Determines whether to clear the viewport before rendering.

Specified by:
setClearEveryFrame in interface IViewport

getClearEveryFrame

public boolean getClearEveryFrame()
Determines if the viewport is cleared before every frame.

Specified by:
getClearEveryFrame in interface IViewport

getClearBuffers

public long getClearBuffers()
Gets which buffers are to be cleared each frame.

Specified by:
getClearBuffers in interface IViewport

setMaterialScheme

public void setMaterialScheme(java.lang.String schemeName)
Set the material scheme which the viewport should use.

Specified by:
setMaterialScheme in interface IViewport

getMaterialScheme

public java.lang.String getMaterialScheme()
Get the material scheme which the viewport should use.

Specified by:
getMaterialScheme in interface IViewport

getActualDimensions

public void getActualDimensions(IntegerPointer left,
                                IntegerPointer top,
                                IntegerPointer width,
                                IntegerPointer height)
Access to actual dimensions (based on target size).

Specified by:
getActualDimensions in interface IViewport

_isUpdated

public boolean _isUpdated()
Specified by:
_isUpdated in interface IViewport

_clearUpdatedFlag

public void _clearUpdatedFlag()
Specified by:
_clearUpdatedFlag in interface IViewport

_getNumRenderedFaces

public long _getNumRenderedFaces()
Gets the number of rendered faces in the last update.

Specified by:
_getNumRenderedFaces in interface IViewport

_getNumRenderedBatches

public long _getNumRenderedBatches()
Gets the number of rendered batches in the last update.

Specified by:
_getNumRenderedBatches in interface IViewport

setOverlaysEnabled

public void setOverlaysEnabled(boolean enabled)
Tells this viewport whether it should display objects.

Specified by:
setOverlaysEnabled in interface IViewport

getOverlaysEnabled

public boolean getOverlaysEnabled()
Returns whether or not objects (created in the ) are displayed in this viewport.

Specified by:
getOverlaysEnabled in interface IViewport

setSkiesEnabled

public void setSkiesEnabled(boolean enabled)
Tells this viewport whether it should display skies.

Specified by:
setSkiesEnabled in interface IViewport

getSkiesEnabled

public boolean getSkiesEnabled()
Returns whether or not skies (created in the ) are displayed in this viewport.

Specified by:
getSkiesEnabled in interface IViewport

setShadowsEnabled

public void setShadowsEnabled(boolean enabled)
Tells this viewport whether it should display shadows.

Specified by:
setShadowsEnabled in interface IViewport

getShadowsEnabled

public boolean getShadowsEnabled()
Returns whether or not shadows (defined in the ) are displayed in this viewport.

Specified by:
getShadowsEnabled in interface IViewport

setVisibilityMask

public void setVisibilityMask(long mask)
Sets a per-viewport visibility mask.

Specified by:
setVisibilityMask in interface IViewport

getVisibilityMask

public long getVisibilityMask()
Gets a per-viewport visibility mask.

Specified by:
getVisibilityMask in interface IViewport

setRenderQueueInvocationSequenceName

public void setRenderQueueInvocationSequenceName(java.lang.String sequenceName)
Sets the use of a custom for rendering this target.

Specified by:
setRenderQueueInvocationSequenceName in interface IViewport

getRenderQueueInvocationSequenceName

public java.lang.String getRenderQueueInvocationSequenceName()
Gets the name of the render queue invocation sequence for this target.

Specified by:
getRenderQueueInvocationSequenceName in interface IViewport

_getRenderQueueInvocationSequence

public IRenderQueueInvocationSequence _getRenderQueueInvocationSequence()
Specified by:
_getRenderQueueInvocationSequence in interface IViewport


Copyright © 2007 netAllied GmbH. All Rights Reserved.