artofillusion.texture
Class UVMappingViewer

java.lang.Object
  extended by CustomWidget
      extended by artofillusion.ViewerCanvas
          extended by artofillusion.ObjectViewer
              extended by artofillusion.MeshViewer
                  extended by artofillusion.texture.UVMappingViewer

public class UVMappingViewer
extends MeshViewer

UVMappingViewer appears in the UVMappingWindow, and is used for editing the UV texture coordinates at each vertex of a mesh.


Field Summary
 
Fields inherited from class artofillusion.MeshViewer
HANDLE_SIZE
 
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
UVMappingViewer(Texture2D tex, UVMappingWindow window, double minu, double maxu, double minv, double maxv, int component, int sampling, double time, double[] param)
           
 
Method Summary
 double[] estimateDepthRange()
          Estimate the range of depth values that the camera will need to render.
 MeshEditController getController()
          Get the controller for editing the UV mesh.
 double getMaxU()
          Get the maximum U value.
 double getMaxV()
          Get the maximum V value.
 double getMinU()
          Get the minimum U value.
 double getMinV()
          Get the minimum V value.
 boolean[] getSelection()
          Get a list of which vertices are selected.
 boolean isDragInProgress()
          Get whether a mouse drag is currently in progress.
 void objectChanged()
          This is called whenever the mesh has changed.
 void setDisplayedVertices(Vec2[] coord, boolean[] display)
          Rebuild the list of vertices to display.
 void setMesh(Mesh mesh)
          Set the Mesh object for this viewer.
 void setParameters(double minu, double maxu, double minv, double maxv)
          Set the parameters for what part of the texture to display.
 void setParameters(double minu, double maxu, double minv, double maxv, int component, int sampling)
          Set the parameters for what part of the texture to display.
 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 updateVertexPositions(Vec2[] coord)
          Update the positions of the displayed vertices.
 
Methods inherited from class artofillusion.MeshViewer
getLockedJoints, getMeshVisible, getSelectedJoint, getSkeletonDetached, getSkeletonVisible, getSurfaceTextureParameter, getSurfaceVisible, isJointLocked, lockJoint, setMeshVisible, setSelectedJoint, setSkeletonDetached, setSkeletonVisible, setSurfaceTextureParameter, setSurfaceVisible, unlockJoint
 
Methods inherited from class artofillusion.ObjectViewer
beginDraggingSelection, endDraggingSelection, getDisplayCoordinates, getFreehandSelection, getScene, getSceneVisible, getUseWorldCoords, previewObject, selectionRegionContains, selectionRegionIntersects, setFreehandSelection, setScene, setSceneVisible, setUseWorldCoords, viewChanged
 
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

UVMappingViewer

public UVMappingViewer(Texture2D tex,
                       UVMappingWindow window,
                       double minu,
                       double maxu,
                       double minv,
                       double maxv,
                       int component,
                       int sampling,
                       double time,
                       double[] param)
Method Detail

getController

public MeshEditController getController()
Get the controller for editing the UV mesh.

Overrides:
getController in class ObjectViewer

setParameters

public void setParameters(double minu,
                          double maxu,
                          double minv,
                          double maxv)
Set the parameters for what part of the texture to display.


setParameters

public void setParameters(double minu,
                          double maxu,
                          double minv,
                          double maxv,
                          int component,
                          int sampling)
Set the parameters for what part of the texture to display.


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.

Overrides:
estimateDepthRange in class MeshViewer
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 ObjectViewer

getSelection

public boolean[] getSelection()
Get a list of which vertices are selected. The array length is equal to the total number of vertices in the object being edited, not just the ones currently displayed in this viewer.


setMesh

public void setMesh(Mesh mesh)
Set the Mesh object for this viewer.


setDisplayedVertices

public void setDisplayedVertices(Vec2[] coord,
                                 boolean[] display)
Rebuild the list of vertices to display.


updateVertexPositions

public void updateVertexPositions(Vec2[] coord)
Update the positions of the displayed vertices.


getMinU

public double getMinU()
Get the minimum U value.


getMaxU

public double getMaxU()
Get the maximum U value.


getMinV

public double getMinV()
Get the minimum V value.


getMaxV

public double getMaxV()
Get the maximum V value.


isDragInProgress

public boolean isDragInProgress()
Get whether a mouse drag is currently in progress.


objectChanged

public void objectChanged()
This is called whenever the mesh has changed.



Copyright © 1999-2011 by Peter Eastman.