Class JPanelSurface
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
gov.nih.mipav.view.renderer.JPanelRendererBase
gov.nih.mipav.view.renderer.J3D.JPanelRendererJ3D
gov.nih.mipav.view.renderer.J3D.surfaceview.JPanelSurface
- All Implemented Interfaces:
ActionListener,FocusListener,ItemListener,KeyListener,MouseListener,MouseMotionListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,ChangeListener,ListSelectionListener
public class JPanelSurface
extends JPanelRendererJ3D
implements ListSelectionListener, MouseListener, MouseMotionListener, ChangeListener
A Java3D-based dialog for surfaces represented as triangle meshes. The surfaces are displayed in the 3D viewer that
already contains a 3D image. The mouse behavior is the same for the image as it is for the surfaces, so that when the
user zooms or rotates, it looks like the surfaces are part of the tri-image.
- Author:
- David Eberly, Neva Cherniavsky
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classCancel the color dialog, change nothing.(package private) classPick up the selected color and call method to change the surface color.Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intRecord the current active index of light bulb, which is being picked.private JLabelThe area label.private JTextFieldDisplays the area of triangle.private JButtonThe color button, which calls a color chooser.private ViewJColorChooserColor chooser for when the user wants to change the color of the surface.private JLabelThe color button label.private JLabelThe polygon mode combo box label.private intCurrent surface index being highlighted.private JButtonDecimate button.private JLabelThe level of detail slider label.private JSliderLevel of detail slider.private JLabel[]The labels below the detail slider.private int[]private booleanflag indicates arbitrary clpping bounding frame being picked.private booleanflag indicates the probe being picked.private static javax.vecmath.Color3f[]The colors for the surfaces.private JButtonSave surface button.private JButtonSave surface button.private JButtonSave surface button.private JButtonSave surface button.private javax.media.j3d.Light[]An array of eight lights that can be used for illuminating the surfaces in the scene.private javax.media.j3d.BranchGroup[]The branch groups to which the lights are attached.private ViewJComponentLightBulbsThe structure for the light bulbs.private final int[]The index of the lights in JPanelLights is different from the order maintained here.private final int[]The index of the lights in JPanelLights is different from the order maintained here.private GeneralLight[]The description of the lights so they can be duplicated in the "Advanced Material Properties" dialog:.private JButtonThe material options button, which launches the material editor window.(package private) javax.media.j3d.BranchGroupFor displaying the fiber bundle tracts in the orthogonal slice view:private javax.media.j3d.BranchGroupFor drawing the geodesic lines on the triangle mesh:.private JPanelLightsLight dialog for when the user clicks the light button.private javax.media.j3d.TransformGroupFor drawing the flythru path in the triangle mesh:.private JButtonStereo render button, launches the JStereoWindow for viewing the ModelTriangleMesh in stereo:.private JButtonOpens SurfaceTexture dialog:.private floatModelImage max dimension: (Extents * resolutions).private SurfaceMaskSurface mask.private SurfacePaintPaint interface/algorithm for allowing the user to interactively paint the vertices of the ModelTriangleMesh.private JLabelThe opacity slider label.private JSliderOpacity slider, not enabled yet.private JLabel[]The labels below the opacity slider.private SurfaceRenderThe parent object that holds necessary the structures to which the surfaces will be added and modified.private com.sun.j3d.utils.picking.PickCanvasThe PickCanvas object that ties together the canvas and the surfaces branch group to allow pick operations on the scene.private JComboBoxThe combo box for the polygon mode to display.private float[]private JScrollPaneThe scroll pane holding the panel content.private static final longUse serialVersionUID for interoperability.private booleanIndicator for the opacity slider moves.private JButtonSmooth button.private JButtonSmooth button.private JButtonSmooth button.private com.sun.j3d.utils.geometry.SphereSphere showing where the user clicked in the surface.private javax.media.j3d.BranchGroupBranch group parent of the sphere.private booleanFlag indicating if the sphere is currently showing.private javax.media.j3d.TransformGroupTransform group parent of the sphere.private javax.media.j3d.BranchGroupStatic light hehavior branch group.private javax.media.j3d.BranchGroupThe branch group that holds the static light bulb.private ViewJComponentLightBulbsThe structure for the static light bulb.private javax.media.j3d.TransformGroupThe transform group that holds the static light branch group.private com.sun.j3d.utils.behaviors.mouse.MouseTranslateStatic light translate behavior.private com.sun.j3d.utils.behaviors.mouse.MouseZoomStatic light zoom behavior.private JCheckBoxCheck Box for surface back face culling.private JCheckBoxCheck Box for surface clpping of the volume render.private StringThe directory where a surface file was last loaded/saved.private JListThe list box in the dialog for surfaces.private MouseEventVectorSurface opacity changes event queue.private intSurface volume opacity.private JCheckBoxCheck Box for surface pickable.private javax.media.j3d.BranchGroupThe branch group that holds all the surfaces together.private javax.media.j3d.TransformGroupThe transform group to which the model lights are attached.private intCounter for surface opacity slider moves.private JCheckBoxCheck Box for surface transparency.private Vector<SurfaceAttributes> A list of the surfaces.private JLabelThe number of triangles label.private JTextFieldDisplays the number of triangles.private JLabelThe volume label.private JTextFieldDisplays the volume of triangle.Fields inherited from class gov.nih.mipav.view.renderer.J3D.JPanelRendererJ3D
rayBasedRender, renderBaseFields inherited from class gov.nih.mipav.view.renderer.JPanelRendererBase
applyButton, cancelButton, cancelFlag, closeButton, helpButton, isActiveImage, mainPanel, NEW, OKButton, REPLACE, runInSeparateThread, serif12, serif12BFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionJPanelSurface(SurfaceRender parent, javax.media.j3d.Canvas3D canvas, javax.media.j3d.TransformGroup surfaceRoot, float xBox, float yBox, float zBox) Creates the Java3D scene graph for the application. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) The override necessary to be an ActionListener.voidAdd any attached surfaces the current image has in its file info (if the file info is in the xml format).voidaddBranch(javax.media.j3d.BranchGroup kBranch, ModelTriangleMesh kMesh, javax.vecmath.Point3f kMeshCenter) Adds a BranchGroup to the display.voidaddFlightPath(javax.media.j3d.Shape3D kPathShape, javax.vecmath.Point3f kPosition) Adds the flythru path shape and current view position to the display.javax.media.j3d.BranchGroupaddLineArray(javax.media.j3d.LineArray kLine, int iGroup) Called from the JDialogDTIInput.voidaddMesh(ModelTriangleMesh kOld, ModelTriangleMesh kNew, String kName) Called when a mesh is changed by the Geodesic class, when a mesh is cut along the geodesic curve it may be divided into two or more meshes.voidAdd surface to the volume image.voidaddSurfaces(SurfaceAttributes[] surfaces, boolean pickable) Adds an array of surfaces described by their SurfaceAttributes to the scene graph.voidaddSurfaces(String dir, File surfaceFile) Adding the surface with specific directory and file name.private voidBuild the toolbar.floatcalcVolume(ModelImage imageA, ModelTriangleMesh[] kMesh) private voidchangePolyMode(int mode) Changes the polygon mode of the selected surface by detaching it, calling the appropriate method, and reattaching it.private SurfaceAttributes[]containsMesh returns the SurfaceAttributes[] containing the input ModelTriangleMesh parameter, where the SurfaceAttributes[] array is of length 1.private JLabelcreateLabel(String title) Creates a label in the proper font and color.private voidcreateSurface(SurfaceAttributes surface, boolean pickable) Creates a surface in the scene graph from an array of triangle meshes.private voiddecimate(SurfaceAttributes[] surfaces) Decimate the surface.private voiddisplayAdvancedMaterialOptions(SurfaceAttributes[] surfaces) For each file in the selected list, launch the AdvancedMaterialOptions dialog:private voiddisplayImageAsTexture(SurfaceAttributes[] surfaces) Displays the selected surfaces with the ModelImage as a 3D texture map on the surface triangle mesh.private voiddisplayStereo(SurfaceAttributes[] surfaces) For each file in the selected list, launch the stereo viewer:voiddispose()Dispose memory.private com.sun.j3d.utils.picking.PickResultdoPick(MouseEvent kEvent) Locate the surface that corresponds to a picking operation in the viewer window.private voidenableStaticLightBehavior(boolean flag) Enable static light behavior.voidenableSurfacePaint(boolean bEnable) Enables/Disables the SurfacePaint per-vertex functions.voidenableSurfacePaintCan(boolean bEnable) Enables/Disables the SurfacePaint Paint Can function.voidfindPickedObject(MouseEvent kEvent) One of the overrides necessary to be a MouseListener.voidgenerateNewTextureCoords(ModelImage kImage, boolean bVertexColors, boolean bUseImageMask) Generates new texture coordinates for all surfaces, based on the new ModelImage texture-source.private voidgetColorChange(Color color) This is called when the user chooses a new color for the surface.javax.media.j3d.BranchGroupReturn access to the Group data member m_kGeodesicGroup so Geodesic object can draw on the triangle mesh.javax.vecmath.Color3fgetLightColor(int i) The only caller of this method is the light attribute dialog, an object from class JDialogSurfaceLight.intThe number of lights supported by the viewer (currently 9).Return the surface light control dialog box.Return the main surface panel.static javax.vecmath.Color4fgetNewSurfaceColor(int index) static function returns the next default surface color, based on the current number of surfaces displayed.Get the current surface opacity slider.com.sun.j3d.utils.picking.PickCanvasGet the pick canvas.private SurfaceAttributes[]getSelectedSurfaces(int[] aiSelected) Returns an array of SurfaceAttributes based on which surfaces are selected by the user in the surfaceList combo-box.Get the surface clip check box.Get the reference to the surface list.Returns the SurfaceMask object.intGet the current surface opacity value.Return the surface vector reference.Returns the ModelImage used to generate the Texture3D.intReturns the texture status, either TEXTURE, VERTEX_COLOR, or NONE.private voidinit()Initializes the GUI components.private voidInitialize the sphere scene graph objects for the sphere showing where the user clicked in the surface.booleanIf probe being picked or not.private booleanCheck static light is enable or not.private booleanIndicates whether the static light bulb being picked by the mouse.booleanCheck if the surface pickable checkbox be selected or not.voidmouseClicked(MouseEvent kEvent) One of the overrides necessary to be a MouseListener.voidmouseDragged(MouseEvent kEvent) One of the overrides necessary to be a MouseMotionListener.voidmouseEntered(MouseEvent kEvent) One of the overrides necessary to be a MouseListener.voidmouseExited(MouseEvent kEvent) One of the overrides necessary to be a MouseListener.voidmouseMoved(MouseEvent kEvent) One of the overrides necessary to be a MouseMotionListener.voidmousePressed(MouseEvent kEvent) DOCUMENT ME!voidmouseReleased(MouseEvent kEvent) DOCUMENT ME!private intpolygonIndexToMode(int index) Convert from the polygon mode combo-box list index to the PolygonAttributes.POLYGON_LINE, PolygonAttributes.POLYGON_POINT, and PolygonAttributes.POLYGON_FILL values:private voidreadSurface(String dir, File surfaceFile, float surfaceOpacity) Adding the surface with specific directory, file name, and surfaceOpacity.voidremoveBranch(javax.media.j3d.BranchGroup kBranch, boolean bRemoveMesh) Removes a BranchGroup to the display.voidremoveLineArray(javax.media.j3d.BranchGroup kBranch) Called from the JDialogDTIInput.voidRemove the surface from the volume render.voidremoveSurface(javax.media.j3d.BranchGroup root) Remove the specified surface subtree from the scene graph.private voidremoveSurfaces(SurfaceAttributes[] surfaces) The action taken when the Remove button is clicked in the list box.voidreplaceMesh(ModelTriangleMesh kOld, ModelTriangleMesh kNew) ReplaceMesh is used by the Geodesic when a mesh is cut along either an open or closed geodesic curve, the original mesh is changed, but not deleted and no new mesh is added.voidresizePanel(int panelWidth, int frameHeight) Resizing the control panel with ViewJFrameVolumeView's frame width and height.voidrestorePerVertexColor(javax.media.j3d.Material kMaterial, int index) Restores the per-vertex colors for the surface at the index parameter.voidRestores the vertex colors for the surfaces.private voidsetBackface(SurfaceAttributes[] surfaces) Turns BackFace Culling on/off for the selected surfaces.private voidsetClipping(SurfaceAttributes[] surfaces) Turns Clipping on/off for the selected surfaces.private voidsetElementsEnabled(boolean flag) Sets the surface options GUI panel to enabled or disabled.voidsetLightAttributes(int iIndex) Update the properties of the specified light bulb.voidsetLightBulbsVisible(boolean flag) Sets the light bulbs to visible or invisible.voidsetMaterial(javax.media.j3d.Material kMaterial, int iIndex) Called from the JPanelSurfaceMAterialProperties.java dialog when the dialog is used to change the material properties of a surface.voidsetPathPosition(javax.vecmath.Point3f kPosition) Updates the position of the flythru view point along the flythru path.private voidsetPickable(SurfaceAttributes[] surfaces) Turns picking on/off for the selected surfaces.private voidsetTransparency(SurfaceAttributes[] surfaces) Turns Transparency on/off for the selected surfaces.private voidsetupLights(javax.media.j3d.TransformGroup surfaceRoot) Create and initialize the nine lights in the scene graph.private voidsmoothSurface(SurfaceAttributes[] surfaces, int smoothType) Smoothes the selected surfaces.voidstateChanged(ChangeEvent event) The override necessary to be a ChangeListener for a JSlider.voidToggle between wireframe and filled polygon mode.private voidupdateSurfaceNameList(int[] selected) Called when surfaces are added or removed from the surfaceVector SurfaceAttributes list.private voidupdateSurfaceRender(boolean bUpdateProbe) Updates the SurfaceRenderer.voidupdateVolumeTexture(BitSet paintMask, javax.vecmath.Color4f kColor) Called from SurfacePaint.voidvalueChanged(ListSelectionEvent kEvent) The override necessary to be a ListSelectionListener.voidwindowClosing(WindowEvent event) Overrides method in JDialogBase so dialog isn't disposed, just hidden.Methods inherited from class gov.nih.mipav.view.renderer.J3D.JPanelRendererJ3D
disposeLocal, getSurfaceRender, setRayBasedRender, setSurfaceRenderMethods inherited from class gov.nih.mipav.view.renderer.JPanelRendererBase
buildApplyButton, buildCancelButton, buildCloseButton, buildHelpButton, buildOKButton, buildTitledBorder, finalize, focusGained, focusLost, isCancelled, itemStateChanged, keyPressed, keyReleased, keyTyped, makeString, setLeftHandSystem, setVisible, setVisibleStandard, setWCSystem, testParameterMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.event.FocusListener
focusGained, focusLostMethods inherited from interface java.awt.event.ItemListener
itemStateChangedMethods inherited from interface java.awt.event.KeyListener
keyPressed, keyReleased, keyTyped
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
fixedColor
private static javax.vecmath.Color3f[] fixedColorThe colors for the surfaces. -
activeLightBulbIndex
private int activeLightBulbIndexRecord the current active index of light bulb, which is being picked. -
areaLabel
The area label. -
areaText
Displays the area of triangle. -
colorButton
The color button, which calls a color chooser. -
colorChooser
Color chooser for when the user wants to change the color of the surface. -
colorLabel
The color button label. -
comboLabel
The polygon mode combo box label. -
currentIndex
private int currentIndexCurrent surface index being highlighted. -
decimateButton
Decimate button. -
detailLabel
The level of detail slider label. -
detailSlider
Level of detail slider. -
detailSliderLabels
The labels below the detail slider. -
findArbitraryClipping
private boolean findArbitraryClippingflag indicates arbitrary clpping bounding frame being picked. -
findProbe
private boolean findProbeflag indicates the probe being picked. -
levelSButton
Save surface button. -
levelVButton
Save surface button. -
levelWButton
Save surface button. -
levelXMLButton
Save surface button. -
lightArray
private javax.media.j3d.Light[] lightArrayAn array of eight lights that can be used for illuminating the surfaces in the scene. The lights at indices 0 and 7 are initially enabled; the other lights are initially disabled. The default positions for the lights are at the 8 corners of the cube [0,1]^3. Light 0 is at (0,0,0) and light 7 is at (1,1,1), thereby providing suitable lighting for the visible surfaces in the scene. Other lights can be enabled as desired through the light attribute dialog. -
lightArrayBG
private javax.media.j3d.BranchGroup[] lightArrayBGThe branch groups to which the lights are attached. -
lightBulbs
The structure for the light bulbs. -
m_aiMapIndexToJPanelLightsIndex
private final int[] m_aiMapIndexToJPanelLightsIndexThe index of the lights in JPanelLights is different from the order maintained here. This array maps from our index to JPanelLights' index. -
m_aiMapJPanelLightsIndexToIndex
private final int[] m_aiMapJPanelLightsIndexToIndexThe index of the lights in JPanelLights is different from the order maintained here. This array maps from JPanelLights' index to our index. -
m_akLights
The description of the lights so they can be duplicated in the "Advanced Material Properties" dialog:. -
m_kAdvancedMaterialOptionsButton
The material options button, which launches the material editor window. -
m_kGeodesicGroup
private javax.media.j3d.BranchGroup m_kGeodesicGroupFor drawing the geodesic lines on the triangle mesh:. -
m_kFiberTractGroup
javax.media.j3d.BranchGroup m_kFiberTractGroupFor displaying the fiber bundle tracts in the orthogonal slice view: -
m_kLightsControl
Light dialog for when the user clicks the light button. -
m_kPathPositionTG
private javax.media.j3d.TransformGroup m_kPathPositionTGFor drawing the flythru path in the triangle mesh:. -
m_kStereoButton
Stereo render button, launches the JStereoWindow for viewing the ModelTriangleMesh in stereo:. -
m_kSurfaceTextureButton
Opens SurfaceTexture dialog:. -
maxBox
private float maxBoxModelImage max dimension: (Extents * resolutions). -
resolutions
private float[] resolutions -
extents
private int[] extents -
mSurfaceMask
Surface mask. -
mSurfacePaint
Paint interface/algorithm for allowing the user to interactively paint the vertices of the ModelTriangleMesh. -
opacityLabel
The opacity slider label. -
opacitySlider
Opacity slider, not enabled yet. -
opacitySliderLabels
The labels below the opacity slider. -
parentScene
The parent object that holds necessary the structures to which the surfaces will be added and modified. -
pickCanvas
private com.sun.j3d.utils.picking.PickCanvas pickCanvasThe PickCanvas object that ties together the canvas and the surfaces branch group to allow pick operations on the scene. -
polygonModeCB
The combo box for the polygon mode to display. -
scroller
The scroll pane holding the panel content. Useful when the screen is small. -
setSurfaceOpacityFlag
private boolean setSurfaceOpacityFlagIndicator for the opacity slider moves. -
smooth1Button
Smooth button. -
smooth2Button
Smooth button. -
smooth3Button
Smooth button. -
sphere
private com.sun.j3d.utils.geometry.Sphere sphereSphere showing where the user clicked in the surface. -
sphereBranch
private javax.media.j3d.BranchGroup sphereBranchBranch group parent of the sphere. -
sphereShowing
private boolean sphereShowingFlag indicating if the sphere is currently showing. -
sphereTransform
private javax.media.j3d.TransformGroup sphereTransformTransform group parent of the sphere. -
staticLightBehaviorBG
private javax.media.j3d.BranchGroup staticLightBehaviorBGStatic light hehavior branch group. -
staticLightBG
private javax.media.j3d.BranchGroup staticLightBGThe branch group that holds the static light bulb. -
staticLightBulb
The structure for the static light bulb. -
staticLightTG
private javax.media.j3d.TransformGroup staticLightTGThe transform group that holds the static light branch group. -
staticLightTranslate
private com.sun.j3d.utils.behaviors.mouse.MouseTranslate staticLightTranslateStatic light translate behavior. -
staticLightZoom
private com.sun.j3d.utils.behaviors.mouse.MouseZoom staticLightZoomStatic light zoom behavior. -
surfaceBackFaceCB
Check Box for surface back face culling. -
surfaceClipCB
Check Box for surface clpping of the volume render. -
surfaceDirectoryName
The directory where a surface file was last loaded/saved. Defaults to MIPAV default directory. -
surfaceList
The list box in the dialog for surfaces. -
surfaceOpacityEvents
Surface opacity changes event queue. -
surfaceOpacitySlice
private int surfaceOpacitySliceSurface volume opacity. -
surfacePickableCB
Check Box for surface pickable. -
surfaceRootBG
private javax.media.j3d.BranchGroup surfaceRootBGThe branch group that holds all the surfaces together. -
surfaceRootTG
private javax.media.j3d.TransformGroup surfaceRootTGThe transform group to which the model lights are attached. -
surfaceSliderCount
private int surfaceSliderCountCounter for surface opacity slider moves. -
surfaceTransparencyCB
Check Box for surface transparency. -
surfaceVector
A list of the surfaces. The elements are of type SurfaceAttributes. -
triangleLabel
The number of triangles label. -
triangleText
Displays the number of triangles. -
volumeLabel
The volume label. -
volumeText
Displays the volume of triangle.
-
-
Constructor Details
-
JPanelSurface
public JPanelSurface(SurfaceRender parent, javax.media.j3d.Canvas3D canvas, javax.media.j3d.TransformGroup surfaceRoot, float xBox, float yBox, float zBox) Creates the Java3D scene graph for the application. The surfaces are all children of the BranchGroup surfaceRootBG, which is in turn a child of the TransformGroup in ViewJFrameTriImage3D. That transform group controls how both the surfaces and the three image planes are displayed; by making the surfaces a child of the transform, the surfaces and image planes move together. The BranchGroup created here is used for the PickCanvas, so that the pick tool ignores the image planes when the mouse is clicked and just looks for the surfaces.This constructor also adds lights to the scene. Because of the texture maps on the image planes, lights don't make a difference in how the image planes are displayed. Therefore, the lights are only necessary for the surfaces.
- Parameters:
parent- SurfaceRender referencecanvas- Canvas3D referencesurfaceRoot- TransformGroup root to add surfacesxBox- red box x dimensionyBox- red box y dimensionzBox- red box z dimension
-
-
Method Details
-
getNewSurfaceColor
public static javax.vecmath.Color4f getNewSurfaceColor(int index) static function returns the next default surface color, based on the current number of surfaces displayed. If the number of surfaces is less than the fixedColor.length then fixedColor is the source of the surface color, otherwise a random color is generated.- Parameters:
index- the number of the new surface- Returns:
- Color4f, the default surface color for the new surface.
-
actionPerformed
The override necessary to be an ActionListener. This callback is executed whenever the Add or Remove buttons are clicked, or when the color button or light button is clicked, or when the combo box changes. If the Add button is clicked, a file dialog is launched to allow the user to select new surface meshes to load from disk. If the Remove button is clicked, the currently selected surfaces in the list box are removed from the scene graph.- Specified by:
actionPerformedin interfaceActionListener- Specified by:
actionPerformedin classJPanelRendererBase- Parameters:
event- The action event.
-
addAttachedSurfaces
public void addAttachedSurfaces()Add any attached surfaces the current image has in its file info (if the file info is in the xml format). -
addBranch
public void addBranch(javax.media.j3d.BranchGroup kBranch, ModelTriangleMesh kMesh, javax.vecmath.Point3f kMeshCenter) Adds a BranchGroup to the display.- Parameters:
kBranch- BranchGroup branch groupkMesh- ModelTriangleMesh surface meshkMeshCenter- Point3f center of mass
-
addFlightPath
public void addFlightPath(javax.media.j3d.Shape3D kPathShape, javax.vecmath.Point3f kPosition) Adds the flythru path shape and current view position to the display.- Parameters:
kPathShape- the flythru path geometrykPosition- the current viewpoint.
-
addLineArray
public javax.media.j3d.BranchGroup addLineArray(javax.media.j3d.LineArray kLine, int iGroup) Called from the JDialogDTIInput. Adds a line array representing the fiber bundle tract to the SurfaceRender.- Parameters:
kLine- LineArray to addiGroup- branch group index to add the line to.- Returns:
- the BranchGroup the line is added to.
-
removeLineArray
public void removeLineArray(javax.media.j3d.BranchGroup kBranch) Called from the JDialogDTIInput. Removes the line array representing the fiber bundle tract from the SurfaceRender.- Parameters:
kBranch- the BranchGroup the line is in.
-
addMesh
Called when a mesh is changed by the Geodesic class, when a mesh is cut along the geodesic curve it may be divided into two or more meshes. This function allows the Geodesic class to add meshes to the scene renderer. It follows the pattern of adding a surface through the surface dialog.- Parameters:
kOld- ModelTriangleMesh old meshkNew- ModelTriangleMesh new meshkName- String mesh name
-
addSurface
public void addSurface()Add surface to the volume image. Calls the FileSurface.openSurfaces function to open a file dialog so the user can choose the surfaces to add. -
addSurfaces
Adding the surface with specific directory and file name. Called from the ViewJFrameVolumeView class from the JPanelEndoscopy loadingSurface function.- Parameters:
dir- directory namesurfaceFile- file name
-
addSurfaces
Adds an array of surfaces described by their SurfaceAttributes to the scene graph.- Parameters:
surfaces- the new surfaces (SurfaceAttributes[]) to add to the scene graph.pickable- when true turn picking on for the new surfaces, when false disable picking.
-
dispose
public void dispose()Dispose memory. -
enableSurfacePaint
public void enableSurfacePaint(boolean bEnable) Enables/Disables the SurfacePaint per-vertex functions.- Parameters:
bEnable- when true the SurfacePaint per-vertex functions (PaintBrush, Dropper, Eraser, BrushSize) are enabled, when false they are disabled.
-
enableSurfacePaintCan
public void enableSurfacePaintCan(boolean bEnable) Enables/Disables the SurfacePaint Paint Can function.- Parameters:
bEnable- when true the Paint Can function is enabled, when false it is disabled.
-
findPickedObject
One of the overrides necessary to be a MouseListener. The surface attribute dialog was added as a listener to the 3D canvas on which the scene is drawn. Whenever a picking operation occurs on the canvas, this member function is called. The pick operation returns the Shape3D object (null, if no object is situated at the pick location). The root of the subtree for the picked surface is looked up within the surfaces list. If found, the list box, color button, detail slider, triangle text, and polygon mode are updated to display the selected surface.
Note. The use of Shape3D by the picker and BranchGroup by the surfaces list appears to be more complicated than necessary, and instead both should use Shape3D or BranchGroup. In fact it is necessary to structure the code as it currently is. The picker needs to locate actual geometry, so Shape3D objects must enable themselves to be picked with ray-triangle intersection testing. If the surfaces in the list were set up to be Shape3D instead of BranchGroup, then all add/remove operations would have to be based on Shape3D, not on BranchGroups. These operations are not allowed in compiled scene graphs.
Note. The iteration over the surface list checking for the BranchGroup whose child is the picked surface is also necessary. Simpler would be to query the Shape3D object for its parent. Such a query is also not supported in a compiled scene graph.- Parameters:
kEvent- The mouse event.
-
generateNewTextureCoords
public void generateNewTextureCoords(ModelImage kImage, boolean bVertexColors, boolean bUseImageMask) Generates new texture coordinates for all surfaces, based on the new ModelImage texture-source. If bVertexColors is true, the ModelImage is displayed as per-vertex colors.- Parameters:
kImage- the new ModelImage used to texture-map the ModelTriangleMesh polygons.bVertexColors- when true display the ModelImage as per-vertex colors, when false, display the ModelImage as a 3D Texture.bUseImageMask- DOCUMENT ME!
-
getGeodesicGroup
public javax.media.j3d.BranchGroup getGeodesicGroup()Return access to the Group data member m_kGeodesicGroup so Geodesic object can draw on the triangle mesh.- Returns:
- BranchGroup root of the geodesic group reference.
-
getLightColor
public javax.vecmath.Color3f getLightColor(int i) The only caller of this method is the light attribute dialog, an object from class JDialogSurfaceLight. The dialog calls this to initialize its color button.- Parameters:
i- The light index (must be in [0..8]).- Returns:
- The color of light i.
-
getLightCount
public int getLightCount()The number of lights supported by the viewer (currently 9). The only caller of this method is the light attribute dialog, an object from class JDialogSurfaceLight. The dialog uses the count to create a list of lights in the scene. If the number of supported lights ever changes, the dialog code does not have to change.- Returns:
- The number of supported lights in the scene.
-
getLightDialog
Return the surface light control dialog box.- Returns:
- lights Surface light dialog box
-
getMainPanel
Return the main surface panel.- Specified by:
getMainPanelin classJPanelRendererBase- Returns:
- the surface panel
-
getOpacitySlider
Get the current surface opacity slider.- Returns:
- opacitySlider Surface opacity slider
-
getPickCanvas
public com.sun.j3d.utils.picking.PickCanvas getPickCanvas()Get the pick canvas.- Returns:
- pickCanvas pick canvas.
-
getSurfaceClipCB
Get the surface clip check box.- Returns:
- surfaceClipCB surface clip check box.
-
getSurfaceList
Get the reference to the surface list. This method is called by the probePanel.- Returns:
- surfaceList reference to surfaceList
-
getSurfaceMask
Returns the SurfaceMask object.- Returns:
- mSurfaceMask.
-
getSurfaceOpacity
public int getSurfaceOpacity()Get the current surface opacity value.- Returns:
- surfaceOpaictySlice Surface opacity slider value
-
getSurfaceVector
Return the surface vector reference.- Returns:
- surfaceVector surface vector
-
getTextureImage
Returns the ModelImage used to generate the Texture3D.- Returns:
- the JPanelSurfaceTexture ModelImage data source for the Texture3D object.
-
getTextureStatus
public int getTextureStatus()Returns the texture status, either TEXTURE, VERTEX_COLOR, or NONE.- Returns:
- the texture status, either TEXTURE, VERTEX_COLOR, or NONE
-
isProbePicked
public boolean isProbePicked()If probe being picked or not.- Returns:
- boolean probe picked or not
-
isSurfacePickableSelected
public boolean isSurfacePickableSelected()Check if the surface pickable checkbox be selected or not.- Returns:
- isSelected Surface pickable check box selected or not.
-
mouseClicked
One of the overrides necessary to be a MouseListener. This member only exists to satisfy the conditions of being a MouseListener. It does nothing when invoked.- Specified by:
mouseClickedin interfaceMouseListener- Parameters:
kEvent- The mouse event.
-
mouseDragged
One of the overrides necessary to be a MouseMotionListener. This member only exists to satisfy the conditions of being a MouseMotionListener. It does nothing when invoked.- Specified by:
mouseDraggedin interfaceMouseMotionListener- Parameters:
kEvent- The mouse event.
-
mouseEntered
One of the overrides necessary to be a MouseListener. This member only exists to satisfy the conditions of being a MouseListener. It does nothing when invoked.- Specified by:
mouseEnteredin interfaceMouseListener- Parameters:
kEvent- The mouse event.
-
mouseExited
One of the overrides necessary to be a MouseListener. This member only exists to satisfy the conditions of being a MouseListener. It does nothing when invoked.- Specified by:
mouseExitedin interfaceMouseListener- Parameters:
kEvent- The mouse event.
-
mouseMoved
One of the overrides necessary to be a MouseMotionListener. This member only exists to satisfy the conditions of being a MouseMotionListener. It does nothing when invoked.- Specified by:
mouseMovedin interfaceMouseMotionListener- Parameters:
kEvent- The mouse event.
-
mousePressed
DOCUMENT ME!- Specified by:
mousePressedin interfaceMouseListener- Parameters:
kEvent- The mouse event.
-
mouseReleased
DOCUMENT ME!- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
kEvent- The mouse event.
-
removeBranch
public void removeBranch(javax.media.j3d.BranchGroup kBranch, boolean bRemoveMesh) Removes a BranchGroup to the display.- Parameters:
kBranch- BranchGroup surface branch group reference.bRemoveMesh- boolean flag to remove the surface mesh or not
-
removeSurface
public void removeSurface()Remove the surface from the volume render. -
removeSurface
public void removeSurface(javax.media.j3d.BranchGroup root) Remove the specified surface subtree from the scene graph.- Parameters:
root- The root of the subtree to remove.
-
replaceMesh
ReplaceMesh is used by the Geodesic when a mesh is cut along either an open or closed geodesic curve, the original mesh is changed, but not deleted and no new mesh is added. The orginal mesh, kOld, is replced by the new mesh, kNew- Parameters:
kOld- ModelTriangleMesh old mesh referencekNew- ModelTriangleMesh new mesh reference
-
resizePanel
public void resizePanel(int panelWidth, int frameHeight) Resizing the control panel with ViewJFrameVolumeView's frame width and height.- Overrides:
resizePanelin classJPanelRendererBase- Parameters:
panelWidth- int widthframeHeight- int height
-
restorePerVertexColor
public void restorePerVertexColor(javax.media.j3d.Material kMaterial, int index) Restores the per-vertex colors for the surface at the index parameter. Called by the AdvancedMaterialProperties dialog.- Parameters:
kMaterial- the original Material to restoreindex- the surface index
-
restoreVertexColors
public void restoreVertexColors()Restores the vertex colors for the surfaces. -
setLightAttributes
public void setLightAttributes(int iIndex) Update the properties of the specified light bulb.- Parameters:
iIndex- int Index of the bulb in the array as stored in JPanelLights.
-
setLightBulbsVisible
public void setLightBulbsVisible(boolean flag) Sets the light bulbs to visible or invisible.- Parameters:
flag-truemeans visible.
-
setMaterial
public void setMaterial(javax.media.j3d.Material kMaterial, int iIndex) Called from the JPanelSurfaceMAterialProperties.java dialog when the dialog is used to change the material properties of a surface. The surface is determined by the index iIndex. The color button is set to the Material diffuse color.- Parameters:
kMaterial- Material referenceiIndex- int material index
-
setPathPosition
public void setPathPosition(javax.vecmath.Point3f kPosition) Updates the position of the flythru view point along the flythru path.- Parameters:
kPosition- Point3f
-
stateChanged
The override necessary to be a ChangeListener for a JSlider.When a change occurs to the detailSlider, the user has requested that the level of detail be changed for the currently active surface. The slider range is [0,100] and is treated as a percent of maximum level of detail. A change has no effect on ModelTriangleMesh objects, but it does change the level of detail for an ModelClodMesh object. The number of triangles is also updated.
When a change occurs to the opacity slider, the surface transparency is updated.
- Specified by:
stateChangedin interfaceChangeListener- Parameters:
event- The change event.
-
toggleWireframe
public void toggleWireframe()Toggle between wireframe and filled polygon mode. -
updateVolumeTexture
Called from SurfacePaint. Used to paint the ModelImage texture with the paint can function.- Parameters:
paintMask- the paint mask to add to the texture.kColor- DOCUMENT ME!
-
valueChanged
The override necessary to be a ListSelectionListener. This callback is executed whenever the user selects a new item (or items) in the list box. If a single item is selected, then the selection index is remembered iniSelectand the interface items are initialized with the appropriate values corresponding to the selected surface. If multiple items are selected, then the selection index is -1 and the color button is set to the background color. The slider and polygon mode are set to the values found in the minimum selected surface.- Specified by:
valueChangedin interfaceListSelectionListener- Parameters:
kEvent- The list selection event.
-
windowClosing
Overrides method in JDialogBase so dialog isn't disposed, just hidden.- Parameters:
event- Event that triggered this method.
-
buildToolBar
private void buildToolBar()Build the toolbar. -
changePolyMode
private void changePolyMode(int mode) Changes the polygon mode of the selected surface by detaching it, calling the appropriate method, and reattaching it.- Parameters:
mode- The new polygon mode to set.
-
containsMesh
containsMesh returns the SurfaceAttributes[] containing the input ModelTriangleMesh parameter, where the SurfaceAttributes[] array is of length 1. If the input mesh is not in the scene graph, then null is returned.- Parameters:
kOld- the ModelTriangleMesh that is being searched for in the scene graph- Returns:
- SurfaceAttributes[1], an array of 1 containing the SurfaceAttributes describing the input mesh, null if the mesh is not found.
-
createLabel
Creates a label in the proper font and color.- Parameters:
title- The title of the label.- Returns:
- The new label.
-
createSurface
Creates a surface in the scene graph from an array of triangle meshes.- Parameters:
surface- Triangle meshes that make up surfacepickable- Color of surface
-
decimate
Decimate the surface.- Parameters:
surfaces- DOCUMENT ME!
-
displayAdvancedMaterialOptions
For each file in the selected list, launch the AdvancedMaterialOptions dialog:- Parameters:
surfaces- the list of selected surfaces (SurfaceAttributes)
-
displayImageAsTexture
Displays the selected surfaces with the ModelImage as a 3D texture map on the surface triangle mesh.- Parameters:
surfaces- the list of selected surfaces (SurfaceAttributes)
-
displayStereo
For each file in the selected list, launch the stereo viewer:- Parameters:
surfaces- the list of selected surfaces (SurfaceAttributes)
-
doPick
Locate the surface that corresponds to a picking operation in the viewer window. This member is called via the mouse listener callback. If a surface is picked, the list box is updated to show that the surface is selected and the corresponding information is set for the color button, the detail slider, and the number of triangles.- Parameters:
kEvent- The mouse event generated by the picking operation.- Returns:
- The picked surface, or null if no surface is located at the pick location.
-
enableStaticLightBehavior
private void enableStaticLightBehavior(boolean flag) Enable static light behavior.- Parameters:
flag- true enable and false disable.
-
getColorChange
This is called when the user chooses a new color for the surface. It changes the color of the surface.- Parameters:
color- Color to change surface to.
-
getSelectedSurfaces
Returns an array of SurfaceAttributes based on which surfaces are selected by the user in the surfaceList combo-box. Only surfaces are selected, VOI points are ignored.- Parameters:
aiSelected- the list of selected indices in the surfaceList- Returns:
- an array of SurfaceAttributes that contains the corresponding list of surfaces from the surfaceVector.
-
init
private void init()Initializes the GUI components. -
initSphere
private void initSphere()Initialize the sphere scene graph objects for the sphere showing where the user clicked in the surface. -
isStaticLightEnabled
private boolean isStaticLightEnabled()Check static light is enable or not.- Returns:
- staticLightEnable
truemeans enable,falsemeans disable.
-
isStaticPicked
private boolean isStaticPicked()Indicates whether the static light bulb being picked by the mouse.- Returns:
- whether the static light bulb is being picked
-
polygonIndexToMode
private int polygonIndexToMode(int index) Convert from the polygon mode combo-box list index to the PolygonAttributes.POLYGON_LINE, PolygonAttributes.POLYGON_POINT, and PolygonAttributes.POLYGON_FILL values:- Parameters:
index- the index of the selected polygon mode in the polygonModeCB combo box.- Returns:
- the corresponding PolygonAttributes defined value.
-
readSurface
Adding the surface with specific directory, file name, and surfaceOpacity.- Parameters:
dir- directory namesurfaceFile- file namesurfaceOpacity- opacity
-
removeSurfaces
The action taken when the Remove button is clicked in the list box. All selected surfaces in the list box are removed from the scene graph.- Parameters:
surfaces- the selected surfaces (SurfaceAttributes[]) to be removed.
-
setBackface
Turns BackFace Culling on/off for the selected surfaces.- Parameters:
surfaces- the list of selected surfaces (SurfaceAttributes)
-
setClipping
Turns Clipping on/off for the selected surfaces.- Parameters:
surfaces- the list of selected surfaces (SurfaceAttributes)
-
setElementsEnabled
private void setElementsEnabled(boolean flag) Sets the surface options GUI panel to enabled or disabled. If there are 0 or multiple surfaces selected, all the options should be disabled.- Parameters:
flag- Enable or disable.
-
setPickable
Turns picking on/off for the selected surfaces.- Parameters:
surfaces- the list of selected surfaces (SurfaceAttributes)
-
setTransparency
Turns Transparency on/off for the selected surfaces.- Parameters:
surfaces- the list of selected surfaces (SurfaceAttributes)
-
setupLights
private void setupLights(javax.media.j3d.TransformGroup surfaceRoot) Create and initialize the nine lights in the scene graph. The first eight lights are positioned at the eight vertices of the cube [-1,1]^3. Light 0 is at (-1,-1,-1) and light 7 is at (1,1,1), both enabled by default. The default color for all lights is white. The default intensity is 1. All surfaces in the scene are illuminated by all enabled lights. The ninth light is ambient light, light that seems to come from all directions.- Parameters:
surfaceRoot- Transform group to attach lights to.
-
smoothSurface
Smoothes the selected surfaces. One dialog per group of selected surfaces is displayed (not a different dialog per-serface).- Parameters:
surfaces- the list of selected surfaces (SurfaceAttributes)smoothType- the level of smoothing JDialogSmoothMesh.SMOOTH1, JDialogSmoothMesh.SMOOTH2, or JDialogSmoothMesh.SMOOTH3
-
updateSurfaceNameList
private void updateSurfaceNameList(int[] selected) Called when surfaces are added or removed from the surfaceVector SurfaceAttributes list. Updates the surfaceList combo-box displayed in the user-interface.- Parameters:
selected- array of names that are currently selected.
-
updateSurfaceRender
private void updateSurfaceRender(boolean bUpdateProbe) Updates the SurfaceRenderer.- Parameters:
bUpdateProbe- when true update the ProbeDialog.
-
calcVolume
-