Class JPanelGeodesic
- 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.JPanelGeodesic
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.FocusListener
,java.awt.event.ItemListener
,java.awt.event.KeyListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
public class JPanelGeodesic extends JPanelRendererJ3D
Title: JPanelGeodesic
Description: Geodesic drawing interface. Drawing the Geodesic curve on the surfaces. Depending on the type of surface displayed: either the SurfaceRender or the FlythruRenderer.
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 interface for drawing geodesics with a "livewire" interface. When livewire mode is selected, by checking the "Livewire Mode" checkbox, then when the user selects points along the geodesic curve with the mouse, the Dijkstra's version of the geodesic is calculated and displayed as the mouse moves.
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 lenths 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 Modifier and Type Class Description (package private) class
JPanelGeodesic.DrawingPanel
Wrapper in order to hold the control panel layout in the JScrollPane.-
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JLabel
drawLabel
Geodesic line draw control label.private Geodesic
flythruGeodesic
DOCUMENT ME!private FlythruRender
flythruRender
FlythruRender reference.private boolean
m_bPickSetFlyThru
Initialzied to true when the the Geodesic.setPickCanvas funtion is called.private boolean
m_bPickSetSurface
DOCUMENT ME!private float
m_fDijkstraCurrent
DOCUMENT ME!private float
m_fDijkstraPrevious
DOCUMENT ME!private float
m_fDijkstraTotal
DOCUMENT ME!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
DOCUMENT ME!private float
m_fGeodesicSmoothPrevious
DOCUMENT ME!private float
m_fGeodesicSmoothTotal
DOCUMENT ME!private javax.swing.JCheckBox
m_kCheckLivewire
Toggle between LiveWire Interaction and point & click interaction:.private javax.swing.JButton
m_kClearAllCutsButton
DOCUMENT ME!private javax.swing.JButton
m_kClearAllGeodesicButton
DOCUMENT ME!private javax.swing.JButton
m_kClearLastCutButton
DOCUMENT ME!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
DOCUMENT ME!private javax.swing.JLabel
m_kDijkstraDistanceValueLast
DOCUMENT ME!private javax.swing.JLabel
m_kDijkstraDistanceValueTotal
DOCUMENT ME!private javax.swing.ButtonGroup
m_kDisplayButtonGroup
DOCUMENT ME!private javax.swing.JRadioButton
m_kDisplayDijkstra
DOCUMENT ME!private javax.swing.JRadioButton
m_kDisplayEuclidian
DOCUMENT ME!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
Labels to indicate the path length between the picked points, in Euclidian distance, geodesic smoothed distance, and Dijkstra's path mesh distance.private javax.swing.JLabel
m_kEuclidianDistanceValueLast
DOCUMENT ME!private javax.swing.JLabel
m_kEuclidianDistanceValueTotal
DOCUMENT ME!private javax.swing.JButton
m_kFinishClosedGeodesicButton
DOCUMENT ME!private javax.swing.JButton
m_kFinishOpenGeodesicButton
DOCUMENT ME!private javax.swing.JLabel
m_kGeodesicSmoothDistance
DOCUMENT ME!private javax.swing.JLabel
m_kGeodesicSmoothDistanceValueLast
DOCUMENT ME!private javax.swing.JLabel
m_kGeodesicSmoothDistanceValueTotal
DOCUMENT ME!private javax.swing.JToggleButton
m_kGeodesicToggleWireframe
DOCUMENT ME!private javax.swing.JPanel
mainPanel
the main control panel.private javax.swing.JScrollPane
scroller
The scroll pane holding the panel content.private JPanelGeodesic.DrawingPanel
scrollPanel
Scroll panel that holding the all the control components.private static long
serialVersionUID
Use serialVersionUID for interoperability.private Geodesic
surfaceGeodesic
Geodesic reference.private javax.swing.JLabel
surPickLabel
Label to indicate that enable Surface pickable before drawing geodesic line.private SurfaceRender
surRender
SurfaceRender reference.-
Fields inherited from class gov.nih.mipav.view.renderer.J3D.JPanelRendererJ3D
rayBasedRender, renderBase
-
Fields inherited from class gov.nih.mipav.view.renderer.JPanelRendererBase
applyButton, cancelButton, cancelFlag, closeButton, helpButton, isActiveImage, NEW, OKButton, REPLACE, runInSeparateThread, serif12, serif12B
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description JPanelGeodesic(RenderViewBase parent)
Contructor 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
addMesh(ModelTriangleMesh kOld, ModelTriangleMesh kNew, java.lang.String kName)
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(boolean flag)
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()
Calls disposeLocal.void
finishGeodesic(boolean bOpen)
finishGeodesic, called when the "Finish Closed" or "Finish Open" buttons are pressed, finish the current geodesic polyline.javax.swing.JPanel
getMainPanel()
Get the main control panel.void
init()
Initilize the mainPanel with the geodesic drawing buttons.boolean
isGeodesicEnable()
Check whether the Geodesic drawing is enabled or not.void
replaceMesh(ModelTriangleMesh kOld, ModelTriangleMesh 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)
Resizig 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
setFlythruRender(FlythruRender _flythruRender)
Set the flythru render reference.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
toggleLivewire()
Toggles between live wire mode and point and click mode for drawing geodesics on the surfaces.void
togglePathDisplay(int which)
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
toggleWireframe()
Toggles between wireframe and filled polygon drawing for the surfaces.-
Methods inherited from class gov.nih.mipav.view.renderer.J3D.JPanelRendererJ3D
disposeLocal, getSurfaceRender, setRayBasedRender, setSurfaceRender
-
Methods inherited from class gov.nih.mipav.view.renderer.JPanelRendererBase
buildApplyButton, buildCancelButton, buildCloseButton, buildHelpButton, buildOKButton, buildTitledBorder, focusGained, focusLost, isCancelled, itemStateChanged, keyPressed, keyReleased, keyTyped, makeString, setLeftHandSystem, setVisible, setVisibleStandard, setWCSystem, testParameter
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods 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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
-
Methods 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, validateTree
-
Methods 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, 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.
-
flythruGeodesic
private Geodesic flythruGeodesic
DOCUMENT ME!
-
flythruRender
private FlythruRender flythruRender
FlythruRender reference.
-
m_bPickSetFlyThru
private boolean m_bPickSetFlyThru
Initialzied to true when the the Geodesic.setPickCanvas funtion is called.
-
m_bPickSetSurface
private boolean m_bPickSetSurface
DOCUMENT ME!
-
m_fDijkstraCurrent
private float m_fDijkstraCurrent
DOCUMENT ME!
-
m_fDijkstraPrevious
private float m_fDijkstraPrevious
DOCUMENT ME!
-
m_fDijkstraTotal
private float m_fDijkstraTotal
DOCUMENT ME!
-
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
DOCUMENT ME!
-
m_fGeodesicSmoothPrevious
private float m_fGeodesicSmoothPrevious
DOCUMENT ME!
-
m_fGeodesicSmoothTotal
private float m_fGeodesicSmoothTotal
DOCUMENT ME!
-
m_kCheckLivewire
private javax.swing.JCheckBox m_kCheckLivewire
Toggle between LiveWire Interaction and point & click interaction:.
-
m_kClearAllCutsButton
private javax.swing.JButton m_kClearAllCutsButton
DOCUMENT ME!
-
m_kClearAllGeodesicButton
private javax.swing.JButton m_kClearAllGeodesicButton
DOCUMENT ME!
-
m_kClearLastCutButton
private javax.swing.JButton m_kClearLastCutButton
DOCUMENT ME!
-
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
DOCUMENT ME!
-
m_kDijkstraDistanceValueLast
private javax.swing.JLabel m_kDijkstraDistanceValueLast
DOCUMENT ME!
-
m_kDijkstraDistanceValueTotal
private javax.swing.JLabel m_kDijkstraDistanceValueTotal
DOCUMENT ME!
-
m_kDisplayButtonGroup
private javax.swing.ButtonGroup m_kDisplayButtonGroup
DOCUMENT ME!
-
m_kDisplayDijkstra
private javax.swing.JRadioButton m_kDisplayDijkstra
DOCUMENT ME!
-
m_kDisplayEuclidian
private javax.swing.JRadioButton m_kDisplayEuclidian
DOCUMENT ME!
-
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
Labels to indicate the path length between the picked points, in Euclidian distance, geodesic smoothed distance, and Dijkstra's path mesh distance. Two labels each, one for the distances between the last two points picked, and one for the total length of the curve, from starting point to end point:
-
m_kEuclidianDistanceValueLast
private javax.swing.JLabel m_kEuclidianDistanceValueLast
DOCUMENT ME!
-
m_kEuclidianDistanceValueTotal
private javax.swing.JLabel m_kEuclidianDistanceValueTotal
DOCUMENT ME!
-
m_kFinishClosedGeodesicButton
private javax.swing.JButton m_kFinishClosedGeodesicButton
DOCUMENT ME!
-
m_kFinishOpenGeodesicButton
private javax.swing.JButton m_kFinishOpenGeodesicButton
DOCUMENT ME!
-
m_kGeodesicSmoothDistance
private javax.swing.JLabel m_kGeodesicSmoothDistance
DOCUMENT ME!
-
m_kGeodesicSmoothDistanceValueLast
private javax.swing.JLabel m_kGeodesicSmoothDistanceValueLast
DOCUMENT ME!
-
m_kGeodesicSmoothDistanceValueTotal
private javax.swing.JLabel m_kGeodesicSmoothDistanceValueTotal
DOCUMENT ME!
-
m_kGeodesicToggleWireframe
private javax.swing.JToggleButton m_kGeodesicToggleWireframe
DOCUMENT ME!
-
mainPanel
private javax.swing.JPanel mainPanel
the main control panel.
-
scroller
private javax.swing.JScrollPane scroller
The scroll pane holding the panel content. Useful when the screen is small.
-
scrollPanel
private JPanelGeodesic.DrawingPanel scrollPanel
Scroll panel that holding the all the control components.
-
surfaceGeodesic
private Geodesic surfaceGeodesic
Geodesic reference.
-
surPickLabel
private javax.swing.JLabel surPickLabel
Label to indicate that enable Surface pickable before drawing geodesic line.
-
surRender
private SurfaceRender surRender
SurfaceRender reference.
-
-
Constructor Detail
-
JPanelGeodesic
public JPanelGeodesic(RenderViewBase parent)
Contructor to initialize the geodesic control panel and create geodesic image scene graph.- Parameters:
parent
- RenderViewBase
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
Command processor to handle the geodesic button events.- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- Specified by:
actionPerformed
in classJPanelRendererBase
- Parameters:
e
- ActionEvent
-
addMesh
public void addMesh(ModelTriangleMesh kOld, ModelTriangleMesh kNew, java.lang.String kName)
Add new mesh to the volume rendering.- Parameters:
kOld
- ModelTriangleMesh old surface meshkNew
- ModelTriangleMesh new surface meshkName
- String name
-
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(boolean flag)
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.
-
getMainPanel
public javax.swing.JPanel getMainPanel()
Get the main control panel.- Specified by:
getMainPanel
in classJPanelRendererBase
- Returns:
- mainPanel main control panel
-
init
public void init()
Initilize 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.
-
replaceMesh
public void replaceMesh(ModelTriangleMesh kOld, ModelTriangleMesh 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
- ModelTriangleMesh old surface meshkNew
- ModelTriangleMesh new surface mesh
-
resizePanel
public void resizePanel(int panelWidth, int frameHeight)
Resizig the control panel with ViewJFrameVolumeView's frame width and height.- Overrides:
resizePanel
in classJPanelRendererBase
- 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 classjavax.swing.JComponent
- 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.
-
setFlythruRender
public void setFlythruRender(FlythruRender _flythruRender)
Set the flythru render reference.- Parameters:
_flythruRender
- FlythruRender
-
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.
-
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.
-
togglePathDisplay
public void togglePathDisplay(int which)
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.
-
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
Calls disposeLocal.- Overrides:
finalize
in classJPanelRendererBase
- Throws:
java.lang.Throwable
- DOCUMENT ME!
-
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.
-
-