j3d.org Aviatrix3D

org.j3d.aviatrix3d
Interface RenderPipelineManager

All Known Implementing Classes:
MultiThreadRenderManager, SingleThreadRenderManager

public interface RenderPipelineManager

A marker interface that represents a class capable of managing the complete rendering pipeline.

A manager is used to handle a system-specific rendering technique. The goal is to manage the contained pipeline(s) in a way that is most efficient to the hardware provided. Thus, it is expected there will be many different types of managers to suit the many hardware configurations available.

Example implementations of the pipeline manager would be one that handles all the pipelines with simultaneous threads, each pinned to a particular CPU/Graphics pipe that the machine has. Another implementation may hold all the pipelines for sequential evaluation piping the output from one into the input for another (eg for handling dynamic cubic environment maps).

Basic common methods are provided for all implementations to use. It is expected that implementations will add additional technique-specific extension methods to the basic features.

Version:
$Revision: 1.9 $
Author:
Justin Couch

Method Summary
 void addAudioPipeline(AudioPipeline pipe)
          Add a pipeline to be rendered to the manager.
 void addPipeline(RenderPipeline pipe)
          Add a pipeline to be rendered to the manager.
 void getLayers(Layer[] layers)
          Fetch the current layers that are set.
 int getMinimumFrameInterval()
          Fetch the currently set duty cycle value.
 Scene getScene()
          Fetch the currently set scene.
 boolean isEnabled()
          Get the current render state of the manager.
 int numLayers()
          Get the number of layers that are currently set.
 void removeAudioPipeline(AudioPipeline pipe)
          Remove an already registered pipeline from the manager.
 void removePipeline(RenderPipeline pipe)
          Remove an already registered pipeline from the manager.
 void renderOnce()
          Force a single render of all pipelines now.
 void setApplicationObserver(ApplicationUpdateObserver obs)
          Register an observer that can be used to know when the application is safe to update the scene graph.
 void setEnabled(boolean state)
          Tell render to start or stop rendering.
 void setLayers(Layer[] layers, int numLayers)
          Set the set of layers for this manager.
 void setMinimumFrameInterval(int cycleTime)
          Set the minimum duty cycle of the render manager.
 void setScene(Scene scene)
          Set the scene for this manager.
 

Method Detail

setEnabled

public void setEnabled(boolean state)
Tell render to start or stop rendering. If currently running, it will wait until all the pipelines have completed their current cycle and will then halt.

Parameters:
state - True if to enable rendering

isEnabled

public boolean isEnabled()
Get the current render state of the manager.

Returns:
true if the manager is currently running

renderOnce

public void renderOnce()
                throws java.lang.IllegalStateException
Force a single render of all pipelines now. Ignores the enabled and cycle time settings to cause a single render at this point in time. If a render is currently in progress, an exception is generated. If this method is called, the application observer is not called beforehand. It assumes that you'll be making the scene graph updates yourself before calling this method.

Throws:
java.lang.IllegalStateException - The system is currently rendering and should be disabled first.

setScene

public void setScene(Scene scene)
Set the scene for this manager. Setting a value of null will remove the currently set scene. If this is set while a current collection of layers is set, then the layers will be cleared.

Parameters:
scene - The new scene

getScene

public Scene getScene()
Fetch the currently set scene. If layers are set, then this will return null.

Returns:
The current scene, or null

setLayers

public void setLayers(Layer[] layers,
                      int numLayers)
Set the set of layers for this manager. Setting a value of null will remove the currently set of layers. If this is set while a current scene is set, then the scene will be cleared. Layers are presented in depth order - layers[0] is rendered before layers[1] etc.

Parameters:
layers - The collection of layers, in order, to render
numLayers - The number of valid layers to use

numLayers

public int numLayers()
Get the number of layers that are currently set. If no layers are set, or a scene is set, this will return zero.

Returns:
a value greater than or equal to zero

getLayers

public void getLayers(Layer[] layers)
Fetch the current layers that are set. The values will be copied into the user-provided array. That array must be at least numLayers() in length. If not, this method does nothing (the provided array will be unchanged).

Parameters:
layers - An array to copy the values into

setMinimumFrameInterval

public void setMinimumFrameInterval(int cycleTime)
Set the minimum duty cycle of the render manager. This is the type in milliseconds that should be the minimum between frames and can be used to throttle the rendering loop to a maximum frame rate should other systems require CPU time. This can be changed at any time

Parameters:
cycleTime - The minimum time in milliseconds between frames

getMinimumFrameInterval

public int getMinimumFrameInterval()
Fetch the currently set duty cycle value.

Returns:
The duty cycle time, in milliseconds

addPipeline

public void addPipeline(RenderPipeline pipe)
                 throws java.lang.IllegalStateException
Add a pipeline to be rendered to the manager. A duplicate registration or null value is ignored.

Parameters:
pipe - The new pipe instance to be added
Throws:
java.lang.IllegalStateException - The system is currently rendering and should be disabled first.

removePipeline

public void removePipeline(RenderPipeline pipe)
                    throws java.lang.IllegalStateException
Remove an already registered pipeline from the manager. A or null value or one that is not currently registered is ignored.

Parameters:
pipe - The pipe instance to be removed
Throws:
java.lang.IllegalStateException - The system is currently rendering and should be disabled first.

addAudioPipeline

public void addAudioPipeline(AudioPipeline pipe)
                      throws java.lang.IllegalStateException
Add a pipeline to be rendered to the manager. A duplicate registration or null value is ignored.

Parameters:
pipe - The new pipe instance to be added
Throws:
java.lang.IllegalStateException - The system is currently rendering and should be disabled first.

removeAudioPipeline

public void removeAudioPipeline(AudioPipeline pipe)
                         throws java.lang.IllegalStateException
Remove an already registered pipeline from the manager. A or null value or one that is not currently registered is ignored.

Parameters:
pipe - The pipe instance to be removed
Throws:
java.lang.IllegalStateException - The system is currently rendering and should be disabled first.

setApplicationObserver

public void setApplicationObserver(ApplicationUpdateObserver obs)
Register an observer that can be used to know when the application is safe to update the scene graph. A value of null will remove the currently set value.

Parameters:
obs - The observer instance to use

j3d.org Aviatrix3D

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - j3d.org