artofillusion
Class ObjectViewer

java.lang.Object
  extended by CustomWidget
      extended by artofillusion.ViewerCanvas
          extended by artofillusion.ObjectViewer
Direct Known Subclasses:
MeshViewer

public abstract class ObjectViewer
extends ViewerCanvas

The ObjectViewer class is the abstract superclass of components which display a single object and allow the user to edit it.


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
ObjectViewer(MeshEditController controller, RowContainer p)
           
 
Method Summary
 void beginDraggingSelection(java.awt.Point p, boolean square)
          Begin dragging a selection region.
 void endDraggingSelection()
          Finish dragging a selection region.
 double[] estimateDepthRange()
          Estimate the range of depth values that the camera will need to render.
 MeshEditController getController()
          Get the controller which maintains the state for this viewer.
 CoordinateSystem getDisplayCoordinates()
          Get the coordinate system in which the object is displayed.
 boolean getFreehandSelection()
          Get whether freehand selection mode is currently in use.
 Scene getScene()
          Get the scene this object is part of, or null if there is none.
 boolean getSceneVisible()
          Get whether the entire scene is visible.
 boolean getUseWorldCoords()
          Get whether to use world coordinates.
 void previewObject()
           
 boolean selectionRegionContains(java.awt.Point p)
          Determine whether the selection region contains the specified point.
 boolean selectionRegionIntersects(java.awt.Point p1, java.awt.Point p2)
          Determine whether the selection region intersects the segment specified by the 2 points.
 void setFreehandSelection(boolean freehand)
          Set whether to use freehand selection mode.
 void setScene(Scene sc, ObjectInfo thisObject)
          Set the scene this object is part of.
 void setSceneVisible(boolean visible)
          Set whether the entire scene is visible.
 void setUseWorldCoords(boolean use)
          Set whether to use world coordinates.
 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, getDefaultRotationCenter, 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, setOrientation, 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

ObjectViewer

public ObjectViewer(MeshEditController controller,
                    RowContainer p)
Method Detail

getController

public MeshEditController getController()
Get the controller which maintains the state for this viewer.


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}

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

getDisplayCoordinates

public CoordinateSystem getDisplayCoordinates()
Get the coordinate system in which the object is displayed. This will vary depending on whether the user has selected Local or Scene coordinates.


getFreehandSelection

public boolean getFreehandSelection()
Get whether freehand selection mode is currently in use.


setFreehandSelection

public void setFreehandSelection(boolean freehand)
Set whether to use freehand selection mode.


getScene

public Scene getScene()
Get the scene this object is part of, or null if there is none.

Overrides:
getScene in class ViewerCanvas

setScene

public void setScene(Scene sc,
                     ObjectInfo thisObject)
Set the scene this object is part of.


getSceneVisible

public boolean getSceneVisible()
Get whether the entire scene is visible.


setSceneVisible

public void setSceneVisible(boolean visible)
Set whether the entire scene is visible.


getUseWorldCoords

public boolean getUseWorldCoords()
Get whether to use world coordinates.


setUseWorldCoords

public void setUseWorldCoords(boolean use)
Set whether to use world coordinates.


beginDraggingSelection

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


endDraggingSelection

public void endDraggingSelection()
Finish dragging a selection region.


selectionRegionContains

public boolean selectionRegionContains(java.awt.Point p)
Determine whether the selection region contains the specified point.


selectionRegionIntersects

public boolean selectionRegionIntersects(java.awt.Point p1,
                                         java.awt.Point p2)
Determine whether the selection region intersects the segment specified by the 2 points.

The selection intersects the line if either:


previewObject

public void previewObject()


Copyright © 1999-2011 by Peter Eastman.