Class JPanelGeodesic_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.JPanelGeodesic_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.RootPaneContainer
,javax.swing.WindowConstants
public class JPanelGeodesic_WM extends JInterfaceBase
Title: JPanelGeodesic
Description: Geodesic drawing interface. Drawing the Geodesic curve on the surfaces.
This file also includes the interface for cutting the mesh along the geodesic curve. The mesh can be cut along an open curve (which replaces the original mesh in the scene graph) or the mesh can be cut along a closed curve (which replaces the original mesh with two or more new meshes in the scene graph.
The user may display the geodesic in one of three ways: (1) the smoothed geodesic curve, which is based on a re-triangulation of the surface along Dijkstra's path and a smoothed version of Dijkstra's path. (2) Dijkstra's path along the original mesh vertices and triangle edges. (3) The straight-line distance between points -- Euclidian distance. Of the three display modes the Euclidian path is the only path *NOT* constrained to lie on the surface of the triangle mesh.
Distances for all three path types, for the total path lengths and the most recent point-pairs are displayed in the interface as well.
- Author:
- Alexandra Bokinsky, Ph.D.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gov.nih.mipav.view.renderer.WildMagic.Interface.JInterfaceBase
JInterfaceBase.CancelListener, JInterfaceBase.DrawingPanel, JInterfaceBase.OkColorListener
-
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
drawLabel
Geodesic line draw control label.private float
m_fDijkstraCurrent
Current Dijkstra path length.private float
m_fDijkstraPrevious
Previous Dijkstra path length.private float
m_fDijkstraTotal
Total Dijkstra path length.private float
m_fEuclidianCurrent
Values for the current path length between the last two selected points:private float
m_fEuclidianPrevious
Values for the previous current path length between the last two selected points:private float
m_fEuclidianTotal
Values for the total path lengths:.private float
m_fGeodesicSmoothCurrent
Current Geodesic path lengthprivate float
m_fGeodesicSmoothPrevious
Previous Geodesic path lengthprivate float
m_fGeodesicSmoothTotal
Total Geodesic path lengthprivate javax.swing.JCheckBox
m_kCheckLivewire
Toggle between LiveWire Interaction and point & click interaction:.private javax.swing.JButton
m_kClearAllCutsButton
Clearsall cuts.private javax.swing.JButton
m_kClearAllGeodesicButton
Clearsall Geodesic components.private javax.swing.JButton
m_kClearLastCutButton
Clear the last cut.private javax.swing.JButton
m_kClearLastGeodesicButton
Button for deleting the geodesic.private javax.swing.JButton
m_kCutGeodesicButton
Button for cutting the mesh along the geodesic:.private javax.swing.JLabel
m_kDijkstraDistance
Label displaying the current Dijkstra path length.private javax.swing.JLabel
m_kDijkstraDistanceValueLast
Label displaying the previous Dijkstra path length.private javax.swing.JLabel
m_kDijkstraDistanceValueTotal
Label displaying the total Dijkstra path length.private javax.swing.ButtonGroup
m_kDisplayButtonGroup
ButtonGroup for the different path display options.private javax.swing.JRadioButton
m_kDisplayDijkstra
Display Dijkstra's path.private javax.swing.JRadioButton
m_kDisplayEuclidian
Display the Euclidian path.private javax.swing.JRadioButton
m_kDisplayGeodesic
Radio buttons for displaying the smoothed geodesic, dijkstra's path, or the euclidian path:.private javax.swing.JToggleButton
m_kDrawGeodesicButton
Geodesic drawing interface Toggle button is down while points are added to the curve:.private javax.swing.JLabel
m_kEuclidianDistance
Label displaying the current Euclidian path length.private javax.swing.JLabel
m_kEuclidianDistanceValueLast
Label displaying the previous Euclidian path length.private javax.swing.JLabel
m_kEuclidianDistanceValueTotal
Label displaying the total Euclidian path length.private javax.swing.JButton
m_kFinishClosedGeodesicButton
Close and finish the Geodesic path.private javax.swing.JButton
m_kFinishOpenGeodesicButton
Finish the Geodesic path without closing.private javax.swing.JLabel
m_kGeodesicSmoothDistance
Label displaying the current Geodesic path length.private javax.swing.JLabel
m_kGeodesicSmoothDistanceValueLast
Label displaying the previous Geodesic path length.private javax.swing.JLabel
m_kGeodesicSmoothDistanceValueTotal
Label displaying the total Geodesic path length.private javax.swing.JToggleButton
m_kGeodesicToggleWireframe
Toggle wireframeprivate JPanelSurface_WM
m_kSurfacePanel
Surface panel.private javax.swing.JScrollPane
scroller
The scroll pane holding the panel content.private JInterfaceBase.DrawingPanel
scrollPanel
Scroll panel that holding the all the control components.private static long
serialVersionUID
Use serialVersionUID for interoperability.private Geodesic_WM
surfaceGeodesic
Geodesic reference.private javax.swing.JLabel
surPickLabel
Label to indicate that enable Surface pickable before drawing geodesic line.-
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 JPanelGeodesic_WM(VolumeTriPlanarInterface kVolumeViewer)
Constructor to initialize the geodesic control panel and create geodesic image scene graph.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
Command processor to handle the geodesic button events.void
addGeodesic(WildMagic.LibGraphics.SceneGraph.TriMesh kSurface, WildMagic.LibGraphics.SceneGraph.Geometry kNew, int iGroup)
Add a new geodesic component to the TriMesh surface display.void
addSurface(WildMagic.LibGraphics.SceneGraph.TriMesh kNew)
Add new mesh to the volume rendering.private void
clearAllCuts()
Undoes all cuts and replaces the cut mesh with the original mesh.void
clearGeodesic(boolean bAll)
clearGeodesic: called when the "Clear Geodesic" Button is pressed.private void
clearLastCut()
Undoes the last cut operation.private void
cutGeodesic()
Calls the Geodesic cut function to cut the triangle mesh along the geodesic curves.void
disposeLocal()
Sets all variables to null, disposes, and garbage collects.void
drawGeodesic()
Enables picking points and drawing the Geodesic curve on the surfaces.void
enableClearLast(boolean bEnable)
When a new line segment is added to the geodesic curve, the Geodesic object enables removing the last point added.void
enableClearLastCut(boolean bEnable)
When a new line segment is added to the geodesic curve, the Geodesic object enables removing the last point added.void
enableCut(boolean bEnable)
The Geodesic object enables cutting the mesh when the line segments are finished, either finished open or finished closed.protected void
finalize()
void
finishGeodesic(boolean bOpen)
finishGeodesic, called when the "Finish Closed" or "Finish Open" buttons are pressed, finish the current geodesic polyline.void
init()
Initialize the mainPanel with the geodesic drawing buttons.boolean
isGeodesicEnable()
Check whether the Geodesic drawing is enabled or not.void
removeAllGeodesic(WildMagic.LibGraphics.SceneGraph.TriMesh kSurface)
Removes all geodesic curves for the given surface.void
removeGeodesic(WildMagic.LibGraphics.SceneGraph.TriMesh kSurface, int iNode, int iGroup)
Remove the specific geodesic curves from the given surface.void
replaceMesh(WildMagic.LibGraphics.SceneGraph.TriMesh kOld, WildMagic.LibGraphics.SceneGraph.TriMesh kNew)
When the Geodesic object cuts the mesh along an open curve, the old mesh changes, but does not need to be deleted and no new mesh needs to be added.void
resizePanel(int panelWidth, int frameHeight)
Resizing the control panel with ViewJFrameVolumeView's frame width and height.void
setDijkstra(float fValue)
Displays the Geodesic (dijkstra's along the mesh) distance between the last two points picked in the Geodesic class, as well as the running total for the current curve.void
setEnabled(boolean flag)
Since geodesic line only apply to the texture render surface, all the buttons are enabled only if the suface vector size is greater than 0.void
setEuclidian(float fValue)
Displays the Euclidian distance between the last two points picked in the Geodesic class, as well as the running total for the current curve.void
setGeodesicSmooth(float fValue)
Displays the Geodesic (smoothed) distance between the last two points picked in the Geodesic class, as well as the running total for the current curve.void
setPickedPoint(WildMagic.LibGraphics.Collision.PickRecord kPickPoint, WildMagic.LibGraphics.SceneGraph.TriMesh kMesh)
Set the picked point.void
setSurfacePanel(JPanelSurface_WM kSurfacePanel)
Set the surface panel.void
toggleGeodesicPathDisplay(int iWhich)
Causes the Geodesic class to switch between displaying the Smoothed Geodesic, Dijkst'ra path along the mesh, or the straight-line Euclidian path between the selected endpoints.void
toggleLivewire()
Toggles between live wire mode and point and click mode for drawing geodesics on the surfaces.void
toggleWireframe()
Toggles between wireframe and filled polygon drawing for the surfaces.-
Methods inherited from class gov.nih.mipav.view.renderer.WildMagic.Interface.JInterfaceBase
buildCancelButton, buildOKButton, buildTitledBorder, getMainPanel, setButtonColor, 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, 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
-
drawLabel
private javax.swing.JLabel drawLabel
Geodesic line draw control label.
-
m_fDijkstraCurrent
private float m_fDijkstraCurrent
Current Dijkstra path length.
-
m_fDijkstraPrevious
private float m_fDijkstraPrevious
Previous Dijkstra path length.
-
m_fDijkstraTotal
private float m_fDijkstraTotal
Total Dijkstra path length.
-
m_fEuclidianCurrent
private float m_fEuclidianCurrent
Values for the current path length between the last two selected points:
-
m_fEuclidianPrevious
private float m_fEuclidianPrevious
Values for the previous current path length between the last two selected points:
-
m_fEuclidianTotal
private float m_fEuclidianTotal
Values for the total path lengths:.
-
m_fGeodesicSmoothCurrent
private float m_fGeodesicSmoothCurrent
Current Geodesic path length
-
m_fGeodesicSmoothPrevious
private float m_fGeodesicSmoothPrevious
Previous Geodesic path length
-
m_fGeodesicSmoothTotal
private float m_fGeodesicSmoothTotal
Total Geodesic path length
-
m_kCheckLivewire
private javax.swing.JCheckBox m_kCheckLivewire
Toggle between LiveWire Interaction and point & click interaction:.
-
m_kClearAllCutsButton
private javax.swing.JButton m_kClearAllCutsButton
Clearsall cuts.
-
m_kClearAllGeodesicButton
private javax.swing.JButton m_kClearAllGeodesicButton
Clearsall Geodesic components.
-
m_kClearLastCutButton
private javax.swing.JButton m_kClearLastCutButton
Clear the last cut.
-
m_kClearLastGeodesicButton
private javax.swing.JButton m_kClearLastGeodesicButton
Button for deleting the geodesic.
-
m_kCutGeodesicButton
private javax.swing.JButton m_kCutGeodesicButton
Button for cutting the mesh along the geodesic:.
-
m_kDijkstraDistance
private javax.swing.JLabel m_kDijkstraDistance
Label displaying the current Dijkstra path length.
-
m_kDijkstraDistanceValueLast
private javax.swing.JLabel m_kDijkstraDistanceValueLast
Label displaying the previous Dijkstra path length.
-
m_kDijkstraDistanceValueTotal
private javax.swing.JLabel m_kDijkstraDistanceValueTotal
Label displaying the total Dijkstra path length.
-
m_kDisplayButtonGroup
private javax.swing.ButtonGroup m_kDisplayButtonGroup
ButtonGroup for the different path display options.
-
m_kDisplayDijkstra
private javax.swing.JRadioButton m_kDisplayDijkstra
Display Dijkstra's path.
-
m_kDisplayEuclidian
private javax.swing.JRadioButton m_kDisplayEuclidian
Display the Euclidian path.
-
m_kDisplayGeodesic
private javax.swing.JRadioButton m_kDisplayGeodesic
Radio buttons for displaying the smoothed geodesic, dijkstra's path, or the euclidian path:.
-
m_kDrawGeodesicButton
private javax.swing.JToggleButton m_kDrawGeodesicButton
Geodesic drawing interface Toggle button is down while points are added to the curve:.
-
m_kEuclidianDistance
private javax.swing.JLabel m_kEuclidianDistance
Label displaying the current Euclidian path length.
-
m_kEuclidianDistanceValueLast
private javax.swing.JLabel m_kEuclidianDistanceValueLast
Label displaying the previous Euclidian path length.
-
m_kEuclidianDistanceValueTotal
private javax.swing.JLabel m_kEuclidianDistanceValueTotal
Label displaying the total Euclidian path length.
-
m_kFinishClosedGeodesicButton
private javax.swing.JButton m_kFinishClosedGeodesicButton
Close and finish the Geodesic path.
-
m_kFinishOpenGeodesicButton
private javax.swing.JButton m_kFinishOpenGeodesicButton
Finish the Geodesic path without closing.
-
m_kGeodesicSmoothDistance
private javax.swing.JLabel m_kGeodesicSmoothDistance
Label displaying the current Geodesic path length.
-
m_kGeodesicSmoothDistanceValueLast
private javax.swing.JLabel m_kGeodesicSmoothDistanceValueLast
Label displaying the previous Geodesic path length.
-
m_kGeodesicSmoothDistanceValueTotal
private javax.swing.JLabel m_kGeodesicSmoothDistanceValueTotal
Label displaying the total Geodesic path length.
-
m_kGeodesicToggleWireframe
private javax.swing.JToggleButton m_kGeodesicToggleWireframe
Toggle wireframe
-
scroller
private javax.swing.JScrollPane scroller
The scroll pane holding the panel content. Useful when the screen is small.
-
scrollPanel
private JInterfaceBase.DrawingPanel scrollPanel
Scroll panel that holding the all the control components.
-
surfaceGeodesic
private Geodesic_WM surfaceGeodesic
Geodesic reference.
-
surPickLabel
private javax.swing.JLabel surPickLabel
Label to indicate that enable Surface pickable before drawing geodesic line.
-
m_kSurfacePanel
private JPanelSurface_WM m_kSurfacePanel
Surface panel.
-
-
Constructor Detail
-
JPanelGeodesic_WM
public JPanelGeodesic_WM(VolumeTriPlanarInterface kVolumeViewer)
Constructor to initialize the geodesic control panel and create geodesic image scene graph.- Parameters:
kVolumeViewer
- parent frame
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
Command processor to handle the geodesic button events.- Parameters:
e
- ActionEvent
-
addGeodesic
public void addGeodesic(WildMagic.LibGraphics.SceneGraph.TriMesh kSurface, WildMagic.LibGraphics.SceneGraph.Geometry kNew, int iGroup)
Add a new geodesic component to the TriMesh surface display.- Parameters:
kSurface
- TriMesh surface.kNew
- geodesic component (point, line)iGroup
- display group (Dijkstra, Euclidian, Geodesic).
-
addSurface
public void addSurface(WildMagic.LibGraphics.SceneGraph.TriMesh kNew)
Add new mesh to the volume rendering.- Parameters:
kNew
- TriMesh new surface mesh
-
clearGeodesic
public void clearGeodesic(boolean bAll)
clearGeodesic: called when the "Clear Geodesic" Button is pressed.- Parameters:
bAll
- when true deletes all geodesic curves drawn on the surfaces, when false, deletes the last point drawn
-
disposeLocal
public void disposeLocal()
Sets all variables to null, disposes, and garbage collects.- Parameters:
flag
- dispose super or not, not used now.
-
drawGeodesic
public void drawGeodesic()
Enables picking points and drawing the Geodesic curve on the surfaces. Depending on the type of surface displayed: either the SurfaceRender or the FlythruRenderer.For the Geodesic object to perform picking and drawing the pickCanvas, GeodesicGroup, and triangle mesh (Surface) objects must be defined, either through the constructor, or as shown here, by the individual access functions.
-
enableClearLast
public void enableClearLast(boolean bEnable)
When a new line segment is added to the geodesic curve, the Geodesic object enables removing the last point added.- Parameters:
bEnable
- enable the remove button or not.
-
enableClearLastCut
public void enableClearLastCut(boolean bEnable)
When a new line segment is added to the geodesic curve, the Geodesic object enables removing the last point added.- Parameters:
bEnable
- enable the last cut button or not.
-
enableCut
public void enableCut(boolean bEnable)
The Geodesic object enables cutting the mesh when the line segments are finished, either finished open or finished closed.- Parameters:
bEnable
- enable the last button or not.
-
finishGeodesic
public void finishGeodesic(boolean bOpen)
finishGeodesic, called when the "Finish Closed" or "Finish Open" buttons are pressed, finish the current geodesic polyline.- Parameters:
bOpen
- bOpen when true leaves the curve open, if false, then closes the curve by connecting the last and first points.
-
init
public void init()
Initialize the mainPanel with the geodesic drawing buttons.
-
isGeodesicEnable
public boolean isGeodesicEnable()
Check whether the Geodesic drawing is enabled or not.- Returns:
- boolean
true
Geodesic drawing enabled,false
Geodesic disable.
-
removeAllGeodesic
public void removeAllGeodesic(WildMagic.LibGraphics.SceneGraph.TriMesh kSurface)
Removes all geodesic curves for the given surface.- Parameters:
kSurface
- the surface to modify.
-
removeGeodesic
public void removeGeodesic(WildMagic.LibGraphics.SceneGraph.TriMesh kSurface, int iNode, int iGroup)
Remove the specific geodesic curves from the given surface.- Parameters:
kSurface
- the surface to modify.iNode
- the node to remove.iGroup
- the group the node belongs to.
-
replaceMesh
public void replaceMesh(WildMagic.LibGraphics.SceneGraph.TriMesh kOld, WildMagic.LibGraphics.SceneGraph.TriMesh kNew)
When the Geodesic object cuts the mesh along an open curve, the old mesh changes, but does not need to be deleted and no new mesh needs to be added. This function allows the Geodesic object to replace the original mesh with the sliced mesh in the surface renderer. ReplaceMesh is also used to undo cutting operations.- Parameters:
kOld
- TriMesh old surface meshkNew
- TriMesh new surface mesh
-
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
-
setDijkstra
public void setDijkstra(float fValue)
Displays the Geodesic (dijkstra's along the mesh) distance between the last two points picked in the Geodesic class, as well as the running total for the current curve.- Parameters:
fValue
- dijkstra's current value.
-
setEnabled
public void setEnabled(boolean flag)
Since geodesic line only apply to the texture render surface, all the buttons are enabled only if the suface vector size is greater than 0. The method is called from the surfacePanel when add or remove surfaces.- Overrides:
setEnabled
in classjava.awt.Component
- Parameters:
flag
- boolean
-
setEuclidian
public void setEuclidian(float fValue)
Displays the Euclidian distance between the last two points picked in the Geodesic class, as well as the running total for the current curve.- Parameters:
fValue
- current Eclidian value.
-
setGeodesicSmooth
public void setGeodesicSmooth(float fValue)
Displays the Geodesic (smoothed) distance between the last two points picked in the Geodesic class, as well as the running total for the current curve.- Parameters:
fValue
- the current geodesic smooth value.
-
setPickedPoint
public void setPickedPoint(WildMagic.LibGraphics.Collision.PickRecord kPickPoint, WildMagic.LibGraphics.SceneGraph.TriMesh kMesh)
Set the picked point.- Parameters:
kPickPoint
- PickRecord.kMesh
- picked TriMesh
-
setSurfacePanel
public void setSurfacePanel(JPanelSurface_WM kSurfacePanel)
Set the surface panel.- Parameters:
kSurfacePanel
- JPanelSurface
-
toggleGeodesicPathDisplay
public void toggleGeodesicPathDisplay(int iWhich)
Causes the Geodesic class to switch between displaying the Smoothed Geodesic, Dijkst'ra path along the mesh, or the straight-line Euclidian path between the selected endpoints. Both the Geodesic and Dijkstr'a paths are constrained to lie on the surface of the mesh, whereas the straight-line distance may penetrate the mesh or be through space.- Parameters:
which
- path index.
-
toggleLivewire
public void toggleLivewire()
Toggles between live wire mode and point and click mode for drawing geodesics on the surfaces. When live wire is active, then the use clicks to add the first point in a curve and then moves the mouse to see Dijkstra's path drawn between that point and the Mesh vertex that is nearest the mouse. When the user clicks again the point is drawn, and the displaay is between the last point clicked and the current mouse point.
-
toggleWireframe
public void toggleWireframe()
Toggles between wireframe and filled polygon drawing for the surfaces. Useful for testing the Geodesic curves:
-
finalize
protected void finalize() throws java.lang.Throwable
- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
-
clearAllCuts
private void clearAllCuts()
Undoes all cuts and replaces the cut mesh with the original mesh.
-
clearLastCut
private void clearLastCut()
Undoes the last cut operation.
-
cutGeodesic
private void cutGeodesic()
Calls the Geodesic cut function to cut the triangle mesh along the geodesic curves.
-
-