artofillusion
Class SceneViewer

java.lang.Object
  extended by CustomWidget
      extended by artofillusion.ViewerCanvas
          extended by artofillusion.SceneViewer

public class SceneViewer
extends ViewerCanvas

The SceneViewer class is a component which displays a view of a Scene.


Field Summary
 
Fields inherited from class artofillusion.ViewerCanvas
backgroundColor, disabledColor, handleColor, highlightColor, highValueColor, lineColor, lowValueColor, RENDER_FLAT, RENDER_RENDERED, RENDER_SMOOTH, RENDER_TEXTURED, RENDER_TRANSPARENT, RENDER_WIREFRAME, specialHighlightColor, surfaceColor, surfaceRGBColor, transparentColor, VIEW_BACK, VIEW_BOTTOM, VIEW_FRONT, VIEW_LEFT, VIEW_OTHER, VIEW_RIGHT, VIEW_TOP
 
Constructor Summary
SceneViewer(Scene s, RowContainer p, EditingWindow fr)
           
SceneViewer(Scene s, RowContainer p, EditingWindow fr, boolean forceSoftwareRendering)
           
 
Method Summary
 void beginDraggingBox(java.awt.Point p, boolean square)
          Begin dragging a box.
 double[] estimateDepthRange()
          Estimate the range of depth values that the camera will need to render.
 ObjectInfo[] getCameras()
          Get the list of cameras in the scene which can be used as predefined orientations.
 Vec3 getDefaultRotationCenter()
          Get the default location around which the view should be rotated.
 EditingWindow getEditingWindow()
          Get the EditingWindow in which this canvas is displayed.
 Scene getScene()
          Get the Scene displayed in this canvas.
 void mouseClicked(MouseClickedEvent e)
          Double-clicking on object should bring up its editor.
 void rebuildCameraList()
          Add all SceneCameras in the scene to list of available views.
 void setOrientation(int which)
          Deal with selecting a SceneCamera from the choice menu.
 void updateImage()
          Subclasses should override this to draw the contents of the canvas, but should begin by calling super.updateImage() to display the grid.
 void viewChanged(boolean selectionOnly)
          This is called when the content of the view has changed.
 
Methods inherited from class artofillusion.ViewerCanvas
addViewerControl, addViewerControl, adjustCamera, copyOrientationFromCamera, drawBorder, drawBox, drawBoxes, drawDraggedShape, drawHRule, drawImage, drawLine, drawShape, drawString, drawVRule, fillShape, frameBox, getActionProcessor, getBoundCamera, getCamera, getCanvasDrawer, getCurrentTool, getDrawFocus, getGridSpacing, getMinimumSize, getOrientation, getPreferredSize, getRenderMode, getRotationCenter, getScale, getShowAxes, getShowGrid, getSnapToGrid, getSnapToSubdivisions, getTemplateImage, getTemplateShown, getViewerControls, getViewerControlWidgets, isOpenGLAvailable, isPerspective, prepareCameraForRendering, removeViewerControl, renderBox, renderBoxes, renderImage, renderLine, renderLine, renderMesh, renderMeshTransparent, renderWireframe, setAltTool, setBoundCamera, setDrawFocus, setGrid, setMetaTool, setPerspective, setPopupMenuManager, setPreferredSize, setRenderMode, setRotationCenter, setScale, setShowAxes, setShowTemplate, setTemplateImage, setTemplateImage, setTool
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SceneViewer

public SceneViewer(Scene s,
                   RowContainer p,
                   EditingWindow fr)

SceneViewer

public SceneViewer(Scene s,
                   RowContainer p,
                   EditingWindow fr,
                   boolean forceSoftwareRendering)
Method Detail

getEditingWindow

public EditingWindow getEditingWindow()
Get the EditingWindow in which this canvas is displayed.


getScene

public Scene getScene()
Get the Scene displayed in this canvas.

Overrides:
getScene in class ViewerCanvas

rebuildCameraList

public void rebuildCameraList()
Add all SceneCameras in the scene to list of available views.


getCameras

public ObjectInfo[] getCameras()
Get the list of cameras in the scene which can be used as predefined orientations.


setOrientation

public void setOrientation(int which)
Deal with selecting a SceneCamera from the choice menu.

Overrides:
setOrientation in class ViewerCanvas

estimateDepthRange

public double[] estimateDepthRange()
Estimate the range of depth values that the camera will need to render. This need not be exact, but should err on the side of returning bounds that are slightly too large.

Specified by:
estimateDepthRange in class ViewerCanvas
Returns:
the two element array {minDepth, maxDepth}

getDefaultRotationCenter

public Vec3 getDefaultRotationCenter()
Description copied from class: ViewerCanvas
Get the default location around which the view should be rotated. This value will be used if ViewerCanvas.getRotationCenter() returns null.

Overrides:
getDefaultRotationCenter in class ViewerCanvas

viewChanged

public void viewChanged(boolean selectionOnly)
Description copied from class: ViewerCanvas
This is called when the content of the view has changed.

Overrides:
viewChanged in class ViewerCanvas
Parameters:
selectionOnly - if true, the only change to the view is what is currently selected

updateImage

public void updateImage()
Description copied from class: ViewerCanvas
Subclasses should override this to draw the contents of the canvas, but should begin by calling super.updateImage() to display the grid.

Overrides:
updateImage in class ViewerCanvas

beginDraggingBox

public void beginDraggingBox(java.awt.Point p,
                             boolean square)
Begin dragging a box. The variable square determines whether the box should be constrained to be square.


mouseClicked

public void mouseClicked(MouseClickedEvent e)
Double-clicking on object should bring up its editor.



Copyright © 1999-2011 by Peter Eastman.