artofillusion
Class ObjectPreviewCanvas

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

public class ObjectPreviewCanvas
extends ViewerCanvas

The ObjectPreviewCanvas class displays a single object which the user can move and rotate, but not edit.


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
ObjectPreviewCanvas(ObjectInfo obj)
          Create an ObjectPreviewCanvas for previewing a particular object.
ObjectPreviewCanvas(ObjectInfo obj, RowContainer p)
          Create an ObjectPreviewCanvas for previewing a particular object.
 
Method Summary
 double[] estimateDepthRange()
          Estimate the range of depth values that the camera will need to render.
 ObjectInfo getObject()
          Get the object being previewed.
 void objectChanged()
          This should be called whenever the object has changed.
 void setObject(Object3D obj)
          Set the object being previewed.
 void updateImage()
          Subclasses should override this to draw the contents of the canvas, but should begin by calling super.updateImage() to display the grid.
 
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, getDefaultRotationCenter, getDrawFocus, getGridSpacing, getMinimumSize, getOrientation, getPreferredSize, getRenderMode, getRotationCenter, getScale, getScene, 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, setOrientation, setPerspective, setPopupMenuManager, setPreferredSize, setRenderMode, setRotationCenter, setScale, setShowAxes, setShowTemplate, setTemplateImage, setTemplateImage, setTool, viewChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectPreviewCanvas

public ObjectPreviewCanvas(ObjectInfo obj)
Create an ObjectPreviewCanvas for previewing a particular object.


ObjectPreviewCanvas

public ObjectPreviewCanvas(ObjectInfo obj,
                           RowContainer p)
Create an ObjectPreviewCanvas for previewing a particular object. The controls for setting scale, projection, and view direction will be add to the Panel.

Method Detail

objectChanged

public void objectChanged()
This should be called whenever the object has changed.


getObject

public ObjectInfo getObject()
Get the object being previewed.


setObject

public void setObject(Object3D obj)
Set the object being previewed.


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}

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


Copyright © 1999-2011 by Peter Eastman.