Class JPanelSurface_WM
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Dialog
-
- javax.swing.JDialog
-
- gov.nih.mipav.view.renderer.WildMagic.Interface.JInterfaceBase
-
- gov.nih.mipav.view.renderer.WildMagic.Interface.JPanelSurface_WM
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
,javax.swing.event.ChangeListener
,javax.swing.event.ListSelectionListener
,javax.swing.RootPaneContainer
,javax.swing.WindowConstants
public class JPanelSurface_WM extends JInterfaceBase implements javax.swing.event.ListSelectionListener, javax.swing.event.ChangeListener
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
JPanelSurface_WM.OkColorListener
Pick up the selected color and call method to change the color.-
Nested classes/interfaces inherited from class gov.nih.mipav.view.renderer.WildMagic.Interface.JInterfaceBase
JInterfaceBase.CancelListener, JInterfaceBase.DrawingPanel
-
Nested classes/interfaces inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
-
Nested classes/interfaces inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
-
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JLabel
areaLabel
The area label.private javax.swing.JTextField
areaText
Displays the area of triangle.private javax.swing.JButton
colorButton
The color button, which calls a color chooser.private javax.swing.JLabel
colorLabel
The color button label.private javax.swing.JLabel
comboLabel
The polygon mode combo box label.private javax.swing.JButton
convexHull
Smooth button.private javax.swing.JButton
decimateButton
Decimate button.private double
decimationPercentage
Decimation Percentageprivate javax.swing.JLabel
detailLabel
The level of detail slider label.private javax.swing.JSlider
detailSlider
Level of detail slider.private javax.swing.JLabel[]
detailSliderLabels
The labels below the detail slider.private javax.swing.JButton
extractConnected
Smooth button.private static WildMagic.LibFoundation.Mathematics.ColorRGB[]
fixedColor
The colors for the surfaces.private javax.swing.JButton
invertNormals
Smooth button.private javax.swing.DefaultListModel<java.lang.String>
listModel
private java.util.Vector<SurfaceState>
m_akSurfaceStates
private javax.swing.JButton
m_kAdvancedMaterialOptionsButton
The material options button, which launches the material editor window.private SurfacePaint_WM
m_kSurfacePaint
Paint tool-bar (contained in the SurfacePaint class)private javax.swing.JButton
m_kSurfaceTextureButton
Opens SurfaceTexture dialog:.private javax.swing.JLabel
opacityLabel
The opacity slider label.private javax.swing.JSlider
opacitySlider
Opacity slider, not enabled yet.private javax.swing.JLabel[]
opacitySliderLabels
The labels below the opacity slider.private javax.swing.JComboBox
polygonModeCB
The combo box for the polygon mode to display.private int
polylineCounter
constant polyline counterprivate javax.swing.DefaultListModel
polylineCounterList
Polyline counter listprivate javax.swing.JList
polylineList
Polyline list box in the dialog for surfaces.private javax.swing.JButton
savePLYSurfaceButton
Save .PLY surface button.private javax.swing.JButton
saveSTLSurfaceButton
Save .STL surface button.private javax.swing.JButton
saveSurfaceButton
Save surface button.private javax.swing.JScrollPane
scroller
The scroll pane holding the panel content.private static long
serialVersionUID
Use serialVersionUID for interoperability.private javax.swing.JButton
smooth1Button
Smooth button.private javax.swing.JButton
smooth2Button
Smooth button.private javax.swing.JButton
smooth3Button
Smooth button.private javax.swing.JButton
subdivideTriangles
Smooth button.private javax.swing.JCheckBox
surfaceBackFaceCB
Check Box for surface back face culling.private javax.swing.JCheckBox
surfaceClipCB
Check Box for surface clpping of the volume render.private javax.swing.JList<java.lang.String>
surfaceList
The list box in the dialog for surfaces.private javax.swing.JCheckBox
surfacePickableCB
Check Box for surface picking.private javax.swing.JCheckBox
surfaceTransparencyCB
Check Box for surface transparency.private TriangleMesh[]
tmesh
triangle mesh for decimation.private javax.swing.JLabel
triangleLabel
The number of triangles label.private javax.swing.JTextField
triangleText
Displays the number of triangles.private javax.swing.JCheckBox
volumeCoordsCheck
loads mesh files in basic volume coordinatesprivate javax.swing.JLabel
volumeLabel
The volume label.private javax.swing.JTextField
volumeText
Displays the volume of triangle.-
Fields inherited from class gov.nih.mipav.view.renderer.WildMagic.Interface.JInterfaceBase
cancelButton, colorChooser, m_kVolumeViewer, mainPanel, OKButton, rayBasedRenderWM
-
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description JPanelSurface_WM(VolumeTriPlanarInterface kVolumeViewer)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent event)
The override necessary to be an ActionListener.void
addPolyline()
Add polyline to the render.private void
addSurface()
Add surface to the volume image.void
addSurfaces(WildMagic.LibGraphics.SceneGraph.TriMesh[] akSurfaces)
Add surfaces to the Volume Tri-Planar renderer.private void
buildToolBar()
Build the toolbar.private float[]
CalcMinMaxEdgeLength(WildMagic.LibGraphics.SceneGraph.TriMesh mesh)
void
changePolyMode(WildMagic.LibGraphics.Rendering.WireframeState.FillMode mode)
Changes the polygon mode of the selected surface by detaching it, calling the appropriate method, and reattaching it.private void
convexHull(int[] aiSelected)
private WildMagic.LibGraphics.SceneGraph.TriMesh
convexHull(WildMagic.LibGraphics.SceneGraph.TriMesh mesh)
private javax.swing.JLabel
createLabel(java.lang.String title)
Creates a label in the proper font and color.private void
decimate(int[] aiSelected)
Decimate the selected surfaces.private void
displayAdvancedMaterialOptions(int[] aiSelected)
Display the Surface Material dialog for the selected surfaces.void
disposeLocal()
Dispose the local memory.void
enableSurfacePaint(boolean bEnable)
Enables/Disables the SurfacePaint per-vertex functions.void
enableSurfacePaintCan(boolean bEnable)
Enables/Disables the SurfacePaint Paint Can function.private void
extractConnectedComponents(int[] aiSelected)
Decimate the selected surfaces.private int
fillModeToPolygonIndex(WildMagic.LibGraphics.Rendering.WireframeState.FillMode mode)
static WildMagic.LibFoundation.Mathematics.ColorRGB
getNewSurfaceColor(int index)
static function returns the next default surface color, based on the current number of surfaces displayed.int
getSelected()
java.lang.String
getSelectedSurface()
Return the name of the selected surface.java.lang.String[]
getSelectedSurfaces()
Return the names of the selected surfaces.java.util.Vector<SurfaceState>
getSurfaceStates()
void
ImageAsTexture(boolean bTextureOn, boolean bUseNewImage, boolean bUseNewLUT)
Turn surface texture on/off.private void
init()
Initializes the GUI components.private void
invertNormals(int[] aiSelected)
Decimate the selected surfaces.boolean
isSurfacePickableSelected()
Check if the surface pickable checkbox be selected or not.private WildMagic.LibGraphics.Rendering.WireframeState.FillMode
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:private void
removePolyline()
Remove polyline from the renderprivate void
removeSurface()
Remove the selected surfaces.private WildMagic.LibGraphics.SceneGraph.TriMesh
removeUnusedVertices(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh)
void
resizePanel(int panelWidth, int frameHeight)
Resizing the control panel with ViewJFrameVolumeView's frame width and height.private void
saveProstateSurfaces(int[] aiSelected, java.lang.String kCommand)
Save the selected surfaces.private void
saveSurfaces(int[] aiSelected, java.lang.String kCommand)
Save the selected surfaces.private void
setBackface(int[] aiSelected)
Turn backface culling on/off for the selected surfaces.void
setButtonColor(javax.swing.JButton _button, java.awt.Color _color)
Set the color of the button.private void
setClipping(int[] aiSelected)
Turns Clipping on/off for the selected surfaces.void
setDropperColor(WildMagic.LibFoundation.Mathematics.ColorRGBA kDropperColor, WildMagic.LibFoundation.Mathematics.Vector3f kPickPoint)
Set the paint can color.private void
setElementsEnabled(boolean flag)
Sets the surface options GUI panel to enabled or disabled.void
SetImageNew(ModelImage kImage)
Set the user-specified ModelImage to use as the surface texture.void
SetLUTNew(ModelStorageBase kLUT)
Set the user-specified LUT for surface texture.void
setMaterial(WildMagic.LibGraphics.Rendering.MaterialState kMaterial, int iIndex)
Called from the JPanelSurfaceMAterialProperties.java dialog when the dialog is used to change the material properties of a surface.private void
setPickable(int[] aiSelected)
Turn picking culling on/off for the selected surfaces.void
setSelected(int i)
void
setSurfaceStates(java.util.Vector<SurfaceState> kSurfaces)
private void
setTransparency(int[] aiSelected)
Turns Transparency on/off for the selected surfaces.private void
smoothSurface(int[] aiSelected, int iSmoothType)
Smoothes the selected surfaces.void
stateChanged(javax.swing.event.ChangeEvent event)
private void
subDivideTriangles(int[] aiSelected)
boolean
surfaceAdded()
Returns true if a surface exists in the Renderer.void
toggleGeodesicPathDisplay(int iWhich)
Toggle which type of Geodesic is displayed on the surface (Euclidian, Dijkstra, Geodesic).private void
updateSelected(int i)
void
valueChanged(javax.swing.event.ListSelectionEvent kEvent)
-
Methods inherited from class gov.nih.mipav.view.renderer.WildMagic.Interface.JInterfaceBase
buildCancelButton, buildOKButton, buildTitledBorder, getMainPanel, updateColorButton
-
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
-
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBack
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
volumeCoordsCheck
private javax.swing.JCheckBox volumeCoordsCheck
loads mesh files in basic volume coordinates
-
fixedColor
private static WildMagic.LibFoundation.Mathematics.ColorRGB[] fixedColor
The colors for the surfaces.
-
areaLabel
private javax.swing.JLabel areaLabel
The area label.
-
areaText
private javax.swing.JTextField areaText
Displays the area of triangle.
-
colorButton
private javax.swing.JButton colorButton
The color button, which calls a color chooser.
-
colorLabel
private javax.swing.JLabel colorLabel
The color button label.
-
comboLabel
private javax.swing.JLabel comboLabel
The polygon mode combo box label.
-
decimateButton
private javax.swing.JButton decimateButton
Decimate button.
-
detailLabel
private javax.swing.JLabel detailLabel
The level of detail slider label.
-
detailSlider
private javax.swing.JSlider detailSlider
Level of detail slider.
-
detailSliderLabels
private javax.swing.JLabel[] detailSliderLabels
The labels below the detail slider.
-
saveSurfaceButton
private javax.swing.JButton saveSurfaceButton
Save surface button.
-
savePLYSurfaceButton
private javax.swing.JButton savePLYSurfaceButton
Save .PLY surface button.
-
saveSTLSurfaceButton
private javax.swing.JButton saveSTLSurfaceButton
Save .STL surface button.
-
m_kSurfacePaint
private SurfacePaint_WM m_kSurfacePaint
Paint tool-bar (contained in the SurfacePaint class)
-
m_kAdvancedMaterialOptionsButton
private javax.swing.JButton m_kAdvancedMaterialOptionsButton
The material options button, which launches the material editor window.
-
m_kSurfaceTextureButton
private javax.swing.JButton m_kSurfaceTextureButton
Opens SurfaceTexture dialog:.
-
opacityLabel
private javax.swing.JLabel opacityLabel
The opacity slider label.
-
opacitySlider
private javax.swing.JSlider opacitySlider
Opacity slider, not enabled yet.
-
opacitySliderLabels
private javax.swing.JLabel[] opacitySliderLabels
The labels below the opacity slider.
-
polygonModeCB
private javax.swing.JComboBox polygonModeCB
The combo box for the polygon mode to display.
-
scroller
private javax.swing.JScrollPane scroller
The scroll pane holding the panel content. Useful when the screen is small.
-
invertNormals
private javax.swing.JButton invertNormals
Smooth button.
-
smooth1Button
private javax.swing.JButton smooth1Button
Smooth button.
-
smooth2Button
private javax.swing.JButton smooth2Button
Smooth button.
-
smooth3Button
private javax.swing.JButton smooth3Button
Smooth button.
-
convexHull
private javax.swing.JButton convexHull
Smooth button.
-
subdivideTriangles
private javax.swing.JButton subdivideTriangles
Smooth button.
-
extractConnected
private javax.swing.JButton extractConnected
Smooth button.
-
polylineList
private javax.swing.JList polylineList
Polyline list box in the dialog for surfaces.
-
surfaceList
private javax.swing.JList<java.lang.String> surfaceList
The list box in the dialog for surfaces.
-
listModel
private javax.swing.DefaultListModel<java.lang.String> listModel
-
surfacePickableCB
private javax.swing.JCheckBox surfacePickableCB
Check Box for surface picking.
-
surfaceBackFaceCB
private javax.swing.JCheckBox surfaceBackFaceCB
Check Box for surface back face culling.
-
surfaceClipCB
private javax.swing.JCheckBox surfaceClipCB
Check Box for surface clpping of the volume render.
-
surfaceTransparencyCB
private javax.swing.JCheckBox surfaceTransparencyCB
Check Box for surface transparency.
-
triangleLabel
private javax.swing.JLabel triangleLabel
The number of triangles label.
-
triangleText
private javax.swing.JTextField triangleText
Displays the number of triangles.
-
volumeLabel
private javax.swing.JLabel volumeLabel
The volume label.
-
volumeText
private javax.swing.JTextField volumeText
Displays the volume of triangle.
-
polylineCounterList
private javax.swing.DefaultListModel polylineCounterList
Polyline counter list
-
polylineCounter
private int polylineCounter
constant polyline counter
-
decimationPercentage
private double decimationPercentage
Decimation Percentage
-
tmesh
private TriangleMesh[] tmesh
triangle mesh for decimation.
-
m_akSurfaceStates
private java.util.Vector<SurfaceState> m_akSurfaceStates
-
-
Constructor Detail
-
JPanelSurface_WM
public JPanelSurface_WM(VolumeTriPlanarInterface kVolumeViewer)
Constructor.- Parameters:
kVolumeViewer
- parent frame.
-
-
Method Detail
-
getNewSurfaceColor
public static WildMagic.LibFoundation.Mathematics.ColorRGB 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
public void actionPerformed(java.awt.event.ActionEvent event)
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:
actionPerformed
in interfacejava.awt.event.ActionListener
- Parameters:
event
- The action event.
-
addSurface
private 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.
-
getSurfaceStates
public java.util.Vector<SurfaceState> getSurfaceStates()
-
setSurfaceStates
public void setSurfaceStates(java.util.Vector<SurfaceState> kSurfaces)
-
addSurfaces
public void addSurfaces(WildMagic.LibGraphics.SceneGraph.TriMesh[] akSurfaces)
Add surfaces to the Volume Tri-Planar renderer.- Parameters:
akSurfaces
- new surfaces.
-
changePolyMode
public void changePolyMode(WildMagic.LibGraphics.Rendering.WireframeState.FillMode 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.
-
disposeLocal
public void disposeLocal()
Dispose the local 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.
-
getSelectedSurface
public java.lang.String getSelectedSurface()
Return the name of the selected surface.- Returns:
- name of the selected surface.
-
getSelectedSurfaces
public java.lang.String[] getSelectedSurfaces()
Return the names of the selected surfaces.- Returns:
- names of the selected surfaces.
-
ImageAsTexture
public void ImageAsTexture(boolean bTextureOn, boolean bUseNewImage, boolean bUseNewLUT)
Turn surface texture on/off.- Parameters:
bTextureOn
- texture on/off.bUseNewImage
- when true use the user-specified ModelImage, when false use default ModelImage.bUseNewLUT
- when true use the user-specified LUT, when false use the defaulet LUT.
-
isSurfacePickableSelected
public boolean isSurfacePickableSelected()
Check if the surface pickable checkbox be selected or not.- Returns:
- isSelected Surface pickable check box selected or not.
-
resizePanel
public void resizePanel(int panelWidth, int frameHeight)
Resizing the control panel with ViewJFrameVolumeView's frame width and height.- Parameters:
panelWidth
- int widthframeHeight
- int height
-
setButtonColor
public void setButtonColor(javax.swing.JButton _button, java.awt.Color _color)
Description copied from class:JInterfaceBase
Set the color of the button. Derived classes may also perform other functions.- Overrides:
setButtonColor
in classJInterfaceBase
- Parameters:
_button
- button._color
- color.
-
setDropperColor
public void setDropperColor(WildMagic.LibFoundation.Mathematics.ColorRGBA kDropperColor, WildMagic.LibFoundation.Mathematics.Vector3f kPickPoint)
Set the paint can color.- Parameters:
kDropperColor
- color.kPickPoint
- picked point on the surface.
-
SetImageNew
public void SetImageNew(ModelImage kImage)
Set the user-specified ModelImage to use as the surface texture.- Parameters:
kImage
- ModelImage to use as the surface texture.
-
SetLUTNew
public void SetLUTNew(ModelStorageBase kLUT)
Set the user-specified LUT for surface texture.- Parameters:
kLUT
- ModelLUTkRGBT
- ModelRGB for color images.
-
setMaterial
public void setMaterial(WildMagic.LibGraphics.Rendering.MaterialState 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
-
stateChanged
public void stateChanged(javax.swing.event.ChangeEvent event)
- Specified by:
stateChanged
in interfacejavax.swing.event.ChangeListener
-
surfaceAdded
public boolean surfaceAdded()
Returns true if a surface exists in the Renderer.- Returns:
- true if a surface exists in the Renderer.
-
toggleGeodesicPathDisplay
public void toggleGeodesicPathDisplay(int iWhich)
Toggle which type of Geodesic is displayed on the surface (Euclidian, Dijkstra, Geodesic).- Parameters:
iWhich
- type of Geodesic is displayed on the surface (Euclidian, Dijkstra, Geodesic).
-
valueChanged
public void valueChanged(javax.swing.event.ListSelectionEvent kEvent)
- Specified by:
valueChanged
in interfacejavax.swing.event.ListSelectionListener
-
getSelected
public int getSelected()
-
setSelected
public void setSelected(int i)
-
updateSelected
private void updateSelected(int i)
-
addPolyline
public void addPolyline()
Add polyline to the render.
-
buildToolBar
private void buildToolBar()
Build the toolbar.
-
createLabel
private javax.swing.JLabel createLabel(java.lang.String title)
Creates a label in the proper font and color.- Parameters:
title
- The title of the label.- Returns:
- The new label.
-
decimate
private void decimate(int[] aiSelected)
Decimate the selected surfaces.- Parameters:
aiSelected
- selected surfaces.
-
invertNormals
private void invertNormals(int[] aiSelected)
Decimate the selected surfaces.- Parameters:
aiSelected
- selected surfaces.
-
extractConnectedComponents
private void extractConnectedComponents(int[] aiSelected)
Decimate the selected surfaces.- Parameters:
aiSelected
- selected surfaces.
-
convexHull
private void convexHull(int[] aiSelected)
-
CalcMinMaxEdgeLength
private float[] CalcMinMaxEdgeLength(WildMagic.LibGraphics.SceneGraph.TriMesh mesh)
-
subDivideTriangles
private void subDivideTriangles(int[] aiSelected)
-
convexHull
private WildMagic.LibGraphics.SceneGraph.TriMesh convexHull(WildMagic.LibGraphics.SceneGraph.TriMesh mesh)
-
displayAdvancedMaterialOptions
private void displayAdvancedMaterialOptions(int[] aiSelected)
Display the Surface Material dialog for the selected surfaces.- Parameters:
aiSelected
- the selected surfaces.
-
init
private void init()
Initializes the GUI components.
-
polygonIndexToMode
private WildMagic.LibGraphics.Rendering.WireframeState.FillMode 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.
-
fillModeToPolygonIndex
private int fillModeToPolygonIndex(WildMagic.LibGraphics.Rendering.WireframeState.FillMode mode)
-
removePolyline
private void removePolyline()
Remove polyline from the render
-
removeSurface
private void removeSurface()
Remove the selected surfaces.
-
removeUnusedVertices
private WildMagic.LibGraphics.SceneGraph.TriMesh removeUnusedVertices(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh)
-
saveSurfaces
private void saveSurfaces(int[] aiSelected, java.lang.String kCommand)
Save the selected surfaces. The kCommand parameter determines the file type.- Parameters:
aiSelected
- selected surfaces.kCommand
- save command, specifies the file type.
-
saveProstateSurfaces
private void saveProstateSurfaces(int[] aiSelected, java.lang.String kCommand)
Save the selected surfaces. The kCommand parameter determines the file type.- Parameters:
aiSelected
- selected surfaces.kCommand
- save command, specifies the file type.
-
setBackface
private void setBackface(int[] aiSelected)
Turn backface culling on/off for the selected surfaces.- Parameters:
aiSelected
- selected surfaces.
-
setClipping
private void setClipping(int[] aiSelected)
Turns Clipping on/off for the selected surfaces.- Parameters:
aiSelected
- 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
private void setPickable(int[] aiSelected)
Turn picking culling on/off for the selected surfaces.- Parameters:
aiSelected
- selected surfaces.
-
setTransparency
private void setTransparency(int[] aiSelected)
Turns Transparency on/off for the selected surfaces.- Parameters:
aiSelected
- the list of selected surfaces (SurfaceAttributes)
-
smoothSurface
private void smoothSurface(int[] aiSelected, int iSmoothType)
Smoothes the selected surfaces. One dialog per group of selected surfaces is displayed (not a different dialog per-surface).- Parameters:
aiSelected
- the list of selected surfaces (SurfaceAttributes)iSmoothType
- the level of smoothing JDialogSmoothMesh.SMOOTH1, JDialogSmoothMesh.SMOOTH2, or JDialogSmoothMesh.SMOOTH3
-
-