Class Geodesic
- All Implemented Interfaces:
KeyListener,MouseListener,MouseMotionListener,EventListener
- Author:
- Alexandra Bokinsky, Ph.D. Under contract from Magic Software.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean[]DOCUMENT ME!private int[]DOCUMENT ME!private int[]DOCUMENT ME!private int[]vertices array.private int[]DOCUMENT ME!private int[]DOCUMENT ME!private int[]The index values in the Vertex array for the triangle that the Start, First, and End points fall in, if they are inside a triangle and not on a triangle vertex:.private javax.vecmath.Color4f[]triangle color array.private javax.vecmath.Point3f[]triangle index coordinate array.private LinkedList[]Data members used in Dijkstra's search.private javax.vecmath.Vector3f[]triangle normal array.private javax.vecmath.TexCoord3f[]triangle texture coordinate array.private booleantoggle for displaying Dijkstra's path as well as the smoothed path:.private booleanTurned on when picking with the mouse is enabled:.private booleanFlag to indicates end ponit changes.private booleanClosing the Geodesic path:.private booleanDOCUMENT ME!private booleanFlag for clearing the Geodesic curves, if it is false, no curves have been added to the GeodesicGroup.private booleanDOCUMENT ME!private booleanLive wire or point and click mode:.private booleanDOCUMENT ME!private booleanMouse events.private booleanDOCUMENT ME!private booleanClose path or not.private boolean[]DOCUMENT ME!private floatPath length statistics for each type of path:.private floatError correction Epsilon.private floatRadius of the sphere displayed to mark the points on the Geodesic.private float[]Weights, relaxed flags, and previous vertex index for Dijkstra's search:.private floatDOCUMENT ME!private float[]DOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intDOCUMENT ME!private intindex count.private intDOCUMENT ME!private intDOCUMENT ME!private intNumber of meshes.private intKeeps track of the of picking, so that when a pair of points has been picked the Geodesic is calculated:.private intNumber of triangles in the mesh, after the new triangles are added:.private intnumber of vertices in the path.private int[]DOCUMENT ME!private intThe start, first, and end index values for the pair of points:.private intLocal copies of the Vertex and Index arrays: a local copy is kept so that when the start or end points fall inside a triangle, a new vertex is added to the vertex array, and three new triangles are added to the triangle index array, new normals are added to the Normal array:.private intDOCUMENT ME!private LinkedListData memebr for Dijkstra's search.private javax.media.j3d.BranchGroupDOCUMENT ME!private javax.vecmath.Point3fDOCUMENT ME!private ModelTriangleMeshDOCUMENT ME!private javax.media.j3d.BranchGroupDOCUMENT ME!private ModelTriangleMeshDOCUMENT ME!private javax.vecmath.Point3fFirst point, for closing the Geodesic curve:.private LinkedListFor finished paths, either open or closed:.private LinkedListLinkedLists to contain the working paths in progress, and all finished paths, open and closed for the smoothed geodesics and dijkstra's geodesics.private LinkedListDOCUMENT ME!private LinkedListDOCUMENT ME!private javax.media.j3d.GroupGroup for drawing the Geodesic on the triangle mesh, assumes that the Group is created in the same branch tree as the triangle mesh surface, so when the mesh is transformed (rotated,scaled,translated) the polyline drawn and stored in the Group m_kSmoothedGeodesicGroup will be transformed in the same way:.private javax.vecmath.Point3f[]The final list of points in the Geodesic curve.private ModelTriangleMeshDOCUMENT ME!private ModelTriangleMeshDOCUMENT ME!private ModelTriangleMeshDOCUMENT ME!private MouseEventDOCUMENT ME!private LinkedListNew Colors link list.private LinkedListNew normal link list.private LinkedListNew texCoords link list.private LinkedListnew triangle link list.private LinkedListNew vertices link list.private ModelTriangleMeshData members for the Geodesic Class: Triangle mesh:.(package private) JPanelGeodesicReference to the JPanelGeodesic:.private JProgressBarVolume renderer progress bar:.private com.sun.j3d.utils.picking.PickCanvasPickCanvas, created by the class that creates the triangle mesh and the geodesic group:.private javax.vecmath.Color3f[]Color of the first and sucessive points on the Geodesic curve:.private javax.vecmath.Point3fDOCUMENT ME!private LinkedListRemoved triangle link list.private javax.media.j3d.BranchGroupRoot group for different path.private LinkedListlink list to hold the path.private javax.vecmath.Point3fStart and End points -- pair of points for which a Geodesic is calculated, must be in TriangleMesh coordinates:.private ModelTriangleMeshDOCUMENT ME!private ModelTriangleMeshDOCUMENT ME!private ModelTriangleMeshDOCUMENT ME!private javax.media.j3d.SwitchDOCUMENT ME! -
Constructor Summary
ConstructorsConstructorDescriptionGeodesic()Instantiation without initializing the progress bar, pickCanvas, GeodesicGroup, triangle mesh or sphere radius, each of those can be set through individual member access functions:.Geodesic(com.sun.j3d.utils.picking.PickCanvas kPickCanvas, javax.media.j3d.Group kGeodesicGroup, ModelTriangleMesh kMesh, float fRadius) Instantiaion of the Geodesic object, with the objects necessary for the Geodesic to serve as a MouseListener that performs picking and with the Group kGeodesicGroup so that the Geodesic curve can be drawn directly on the ModelTriangleMesh. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddEdge(int iEdgeIndex, int iNewEdge) Add the edge to the EdgeList, check to make sure that edge has not already been added.private intcheckOnEdge(ModelTriangleMesh kMesh, javax.vecmath.Point3f kPoint, int[] aiTriIndex, javax.vecmath.Vector3f kNormal, javax.vecmath.TexCoord3f kTexCoord, javax.vecmath.Color4f kColor) Given a point which is known to be inside a triangle, and that triangle, this function determines which edge, if any, that point falls on.private voidcleanUp()cleanUp deletes the data stuctures used for the Dijkstra's search, but does not delete the array of points on the Geodesic curve.voidclear(boolean bAll) Clear all geodesics curves drawn on the surface.private voidclears the all the points added in livewire mode when clear all is called from the user interface.voidclearCut(boolean bAll) Clear the current geodesics curve drawn on the surface.private voidclears the last points added in livewire mode when clear last point is called from the user interface.booleancomputeGeodesic(float fPercentage, boolean bSmoothed) Compute the Geodesic curve.private booleancontains(LinkedList kTriList, javax.vecmath.Point3i kNewTri) Contains determines if the linked list kTriList contains the input triangle, which is specified by three vertex indices.private booleancreateEdgeLists(ModelTriangleMesh kMesh) Create the edges list from the given surface triangle mesh.private ModelTriangleMeshcreateNewMesh(ModelTriangleMesh kMesh, int iVertexCount, int iOldVertexCount) creates a new mesh after triangulation or when a mesh is cut along the geodesic.booleancreatePath(int iStart, int iEnd) createPath starts with the results of Dijkstra's minimum path algorithm.voidcut()Cut the m_kModified mesh.voiddispose()Deletes all member variables, clean memory.private floatdistance(javax.vecmath.Point3f kPoint1, javax.vecmath.Point3f kPoint2) Calculate the Euclidean distance between two points.voiddrawDijkstraEuclidianPath(int iStart, int iEnd) drawPath draws the Dijkstra path and Euclidian paths and adds them to the corresponding m_kDijkstraGeodesicGroup and m_kEuclidianGeodesicGroups.private voiddrawDijkstraEuclidianPoint(javax.vecmath.Point3f kStart, javax.vecmath.Color3f kColor) Draw the user-selected point as a sphere on the triangle mesh, the sphere is added to all three drawing groups: m_kSmoothedGeodesicGroup, m_kDijkstraGeodesicGroup, and m_kEuclidianGeodesicGroup.voiddrawGeodesicPath(int iStart, int iEnd) drawPath draws the Geodesic path as a LineArray and adds it to the children of the m_kSmoothedGeodesicGroup object, it also draws the Dijkstra path and Euclidian paths and adds them to the corresponding m_kDijkstraGeodesicGroup and m_kEuclidianGeodesicGroups.private voiddrawGeodesicPoint(javax.vecmath.Point3f kStart, javax.vecmath.Color3f kColor) Draw the user-selected point as a sphere on the triangle mesh, the sphere is added to all three drawing groups: m_kSmoothedGeodesicGroup, m_kDijkstraGeodesicGroup, and m_kEuclidianGeodesicGroup.voiddrawPath(int iStart, int iEnd) drawPath draws the Geodesic path as a LineArray and adds it to the children of the m_kSmoothedGeodesicGroup object, it also draws the Dijkstra path and Euclidian paths and adds them to the corresponding m_kDijkstraGeodesicGroup and m_kEuclidianGeodesicGroups.private voiddrawPoint(javax.vecmath.Point3f kStart, javax.vecmath.Color3f kColor) Draw the user-selected point as a sphere on the triangle mesh, the sphere is added to all three drawing groups: m_kSmoothedGeodesicGroup, m_kDijkstraGeodesicGroup, and m_kEuclidianGeodesicGroup.private intextractNewMesh(LinkedList kLoop) Used in cutting closed paths and creating new meshes to export to the scene graph.private voidfindEdges(int iIndex, boolean[] bFound) Go through the edge list find the the edge specified.private floatfindMin(javax.vecmath.Point3f kStart, int iMiddle, int iSide, javax.vecmath.Point3f kEnd, javax.vecmath.Point4f kNewPoint4) findMin finds the point (newpoint) along the edge that connects the points Side-Middle that minimizes the distance Start-newpoint-End.private intfindNewMeshes(ModelTriangleMesh kSourceMesh, LinkedList kGeodesic_Closed_Loops) Used in cutting closed paths and creating new meshes to export to the scene graph.private intThe findSmallest function searches through the list of vertices that are not yet relaxed but that have been visited by the Dijkstra Search, so that the weight factor is not Float.MAX_VALUE, but also is not the minimum value for that node.private intfindTriPoints(int iNode1, int iNode2, LinkedList kEndPoints) Find the next side triangle index.voidfinish(boolean bOpen) Closes the geodesic curve.private voidfinishWorkingLists(boolean bOpen) Adds the working paths to the finished path lists, combining the segments in the working paths into one path.private javax.vecmath.Color4fgetColor(ModelTriangleMesh kMesh, int[] aiIndex) Calculates and returns the start point color for a new starting point inside an existing triangle.private javax.vecmath.Color4fgetColor(ModelTriangleMesh kMesh, int iIndex1, int iIndex2) Get the the triangle color from the given triangle index.booleanAccess on when picking with the mouse is enabled.private javax.vecmath.Vector3fgetNormal(ModelTriangleMesh kMesh, int[] aiIndex) Calculates and returns the start point normal for a new starting point inside an existing triangle.private javax.vecmath.Vector3fgetNormal(ModelTriangleMesh kMesh, int iIndex1, int iIndex2) Get the the triangle normal from the given triangle index.intReturns the number of points in the geodesic curve.private intgetPathIndex(LinkedList kPath, int iVertexCount, int iIndex, boolean bOpen) getPathIndex returns what the new vertex index should be.voidgetPathPoint(int iPoint, javax.vecmath.Point3f kPoint) Access to the ith point on the Geodesic curve.voidgetPathPoints(javax.vecmath.Point3f[] akPoints) Access to the all the points on the Geodesic curve.private voidgetStartEnd(int iWhich) In livewire mode the endpoints of each path segment along Dijkstra's curve -- between each of the user-selected points -- are stored so that the smoothed geodesic may be calculated and displayed later.private javax.vecmath.TexCoord3fgetTexCoord(ModelTriangleMesh kMesh, int[] aiIndex) Calculates and returns the start point texture coordinate for a new starting point inside an existing triangle.private javax.vecmath.TexCoord3fgetTexCoord(ModelTriangleMesh kMesh, int iIndex1, int iIndex2) Get the the triangle texture coordinate from the given triangle index.private voidInitializes the colors for the first point on the curve, and the successive points.private voidinitializeGeodesic(float fPercentage) initializeGeodesic copies the triangle mesh and initializes the data structures for Dijkstra's Single-Source shortest path algorithm.voidkeyPressed(KeyEvent kEvent) Invoked when a key has been pressed.voidkeyReleased(KeyEvent kEvent) Invoked when a key has been released.voidInvoked when a key has been typed.voidmouseClicked(MouseEvent kMouseEvent) One of the overrides necessary to be a MouseListener.voidmouseDragged(MouseEvent kMouseEvent) mouseDragged.voidmouseEntered(MouseEvent kMouseEvent) One of the overrides necessary to be a MouseListener.voidmouseExited(MouseEvent kMouseEvent) One of the overrides necessary to be a MouseListener.voidmouseMoved(MouseEvent kMouseEvent) mouseMoved.voidmousePressed(MouseEvent kMouseEvent) One of the overrides necessary to be a MouseListener.voidmouseReleased(MouseEvent kMouseEvent) One of the overrides necessary to be a MouseListener.private booleanonRight(ModelTriangleMesh kMesh, int iPrevIndex, int iIndex, int iSideIndex) onRight determines if a given point on a triangle, kSide, is to the right of or to the left of the vector specified by the vertices kPrev - kPoint.private voidcreating new meshes to export to the scene graph.private voidrelaxEdges(int iNode) This function determines the shortest path from the start vertex through the input vertex to the vertices that neighbor the input vertex.private voidRemove all the geodesic lines and reset to draw the new geodesic lines.private voidIn livewire mode the endpoints of each path segment along Dijkstra's curve -- between each of the user-selected points -- are stored so that the smoothed geodesic may be calculated and displayed later.voidsetEnable(boolean bEnable) Enables picking with the mouse and drawing the curve on the mesh.voidsetEndIndex(int iIndex) Set the index of the vertex in the triangle mesh where the Geodesic curve is to end.voidsetEndIndices(int[] iIndices) Sets the indices of the triangle that the end point is located in.voidsetEndPoint(javax.vecmath.Point3f kPoint) Sets the end point of the geodesic curve on the mesh.private voidsetEndSurface(ModelTriangleMesh kMesh) The start and end surfaces ensure that the points on the geodesic curve all fall on one mesh, and that the algorithm isn't trying to find a path between two unconnected meshes.private voidDetermines an appropriate epsilon, based on the size of the triangles in the mesh.voidsetGeodesicGroup(javax.media.j3d.Group kGeodesicGroup) Access function to set the Group object m_kGeodesicGroup.voidsetPanel(JPanelGeodesic kPanel) Access to the JPanelGeodesic interface object.voidsetPickCanvas(com.sun.j3d.utils.picking.PickCanvas kPickCanvas) Access function to set the pickCanvas.voidsetPreviousStartIndices(int[] iIndices) Sets the indices of the triangle that the previous start point is located in.private voidsetPreviousStartPoint(javax.vecmath.Point3f kPoint) Sets the previous start point of the geodesic curve on the mesh.voidsetRadius(float fRadius) Set the radius of the spheres used to mark the start and end points on the geodesic curve.voidsetStartIndex(int iIndex) Set the index of the vertex in the triangle mesh where the Geodesic curve is to start.voidsetStartIndices(int[] iIndices, boolean bFirst) Sets the indices of the triangle that the start point is located in.voidsetStartPoint(javax.vecmath.Point3f kPoint, boolean bFirst) Sets the start point of the geodesic curve on the mesh.private voidsetStartSurface(ModelTriangleMesh kMesh) The start and end surfaces ensure that the points on the geodesic curve all fall on one mesh, and that the algorithm isn't trying to find a path between two unconnected meshes.private voidsetSurface(ModelTriangleMesh kMesh) Access function to set the triangle mesh that the geodesic curve is calculated on.private intsmoothPath(int iNode, LinkedList kLeft, LinkedList kMiddle, LinkedList kRight, LinkedList kLeftTemp, LinkedList kRightTemp, LinkedList kNewVertTemp) Smooth the path.private voidsortTriIndex(javax.vecmath.Point3i aiAddTri, javax.vecmath.Point3f[] akVertices, javax.vecmath.Vector3f[] akNormals) Used when new triangles are added to the mesh, either when the mesh is triangulated along the smoothed geodesic curve, or when the mesh is cut. sortTriIndex sorts the triangle indices so that the triangle is always front-facing and that the normals are correct for renderingvoidtoggleDisplay(int iWhich) Called by the JPanelGeodesic interface to switch between displaying the Smoothed Geodesic, Dijkstra's path, or the Euclidian path.voidToggle between livewire mode and point invalid input: '&' click mode.private inttriangleEdge(int i0, int i1, int i2, int iP0, int iP1) if the two of the first three triangle indices equal the second two indices, then the third index is returned.private booleantriangleEquals(int i0, int i1, int i2, int iP0, int iP1, int iP2) Returns true if the first three triangle indices equal the second three indices.private booleantriangleExists(javax.vecmath.Point3i kTri) Check to see if the triangle specified in the triangle list.private inttriangulate(ModelTriangleMesh kMesh, LinkedList kPath, LinkedList kLeftPath, LinkedList kRightPath, int iVertexCount) triangulates the mesh along a single geodesic.private voidre-triangulates the mesh along the Smoothed Geodesic.private intunZip(ModelTriangleMesh kMesh, LinkedList kPath, int iVertexCount, boolean bOpen, LinkedList kNewPath) unZip cuts along the smoothed geodesic path by creating new vertices for each point on the path, and updating the triangles that are connected to the path and that fall on the right of the path to contain the new path vertices.
-
Field Details
-
m_kPanel
JPanelGeodesic m_kPanelReference to the JPanelGeodesic:. -
m_abRemoveTris
private boolean[] m_abRemoveTrisDOCUMENT ME! -
m_aiEndIndex
private int[] m_aiEndIndexDOCUMENT ME! -
m_aiFirstIndex
private int[] m_aiFirstIndexDOCUMENT ME! -
m_aiIndex
private int[] m_aiIndexvertices array. -
m_aiIndexShift
private int[] m_aiIndexShiftDOCUMENT ME! -
m_aiPreviousStartIndex
private int[] m_aiPreviousStartIndexDOCUMENT ME! -
m_aiStartIndex
private int[] m_aiStartIndexThe index values in the Vertex array for the triangle that the Start, First, and End points fall in, if they are inside a triangle and not on a triangle vertex:. -
m_akCoordinates
private javax.vecmath.Point3f[] m_akCoordinatestriangle index coordinate array. -
m_akEdgeList
Data members used in Dijkstra's search. The Edgelist is a list for each vertex of all the vertices that it is connected to by one edge. The vertices are stored in the Edgelist as the vertex index. -
m_akNormals
private javax.vecmath.Vector3f[] m_akNormalstriangle normal array. -
m_akTexCoords
private javax.vecmath.TexCoord3f[] m_akTexCoordstriangle texture coordinate array. -
m_akColors
private javax.vecmath.Color4f[] m_akColorstriangle color array. -
m_bDisplayDijkstra
private boolean m_bDisplayDijkstratoggle for displaying Dijkstra's path as well as the smoothed path:. -
m_bEnabled
private boolean m_bEnabledTurned on when picking with the mouse is enabled:. -
m_bEndpointChanged
private boolean m_bEndpointChangedFlag to indicates end ponit changes. -
m_bFinished
private boolean m_bFinishedClosing the Geodesic path:. -
m_bFirstWire
private boolean m_bFirstWireDOCUMENT ME! -
m_bGroupAdded
private boolean m_bGroupAddedFlag for clearing the Geodesic curves, if it is false, no curves have been added to the GeodesicGroup. -
m_bLastWire
private boolean m_bLastWireDOCUMENT ME! -
m_bLivewire
private boolean m_bLivewireLive wire or point and click mode:. -
m_bMouseMotion
private boolean m_bMouseMotionDOCUMENT ME! -
m_bMousePressed
private boolean m_bMousePressedMouse events. Setting mousePressed and mouseReleased explicitly when the mouse events are received has deals with getting multiply mouse event notifications for the same mouse press. -
m_bMouseReleased
private boolean m_bMouseReleasedDOCUMENT ME! -
m_bOpen
private boolean m_bOpenClose path or not. -
m_bRelaxed
private boolean[] m_bRelaxedDOCUMENT ME! -
m_fDijkstraPathLength
private float m_fDijkstraPathLengthPath length statistics for each type of path:. -
m_fEpsilon
private float m_fEpsilonError correction Epsilon. -
m_fRadius
private float m_fRadiusRadius of the sphere displayed to mark the points on the Geodesic. This can be set directly by the class using the Geodesic object. -
m_fRemainingWeight
private float[] m_fRemainingWeightWeights, relaxed flags, and previous vertex index for Dijkstra's search:. -
m_fSmoothedPathLength
private float m_fSmoothedPathLengthDOCUMENT ME! -
m_fWeight
private float[] m_fWeightDOCUMENT ME! -
m_iDijkstraCount
private int m_iDijkstraCountDOCUMENT ME! -
m_iEnd
private int m_iEndDOCUMENT ME! -
m_iFirst
private int m_iFirstDOCUMENT ME! -
m_iIndexCount
private int m_iIndexCountindex count. -
m_iLineClosed
private int m_iLineClosedDOCUMENT ME! -
m_iNumGeodesicVertices
private int m_iNumGeodesicVerticesDOCUMENT ME! -
m_iNumNewMeshes
private int m_iNumNewMeshesNumber of meshes. -
m_iNumPicked
private int m_iNumPickedKeeps track of the of picking, so that when a pair of points has been picked the Geodesic is calculated:. -
m_iNumTriangles
private int m_iNumTrianglesNumber of triangles in the mesh, after the new triangles are added:. -
m_iNumWorking
private int m_iNumWorkingnumber of vertices in the path. -
m_iPrevious
private int[] m_iPreviousDOCUMENT ME! -
m_iStart
private int m_iStartThe start, first, and end index values for the pair of points:. -
m_iVertexCount
private int m_iVertexCountLocal copies of the Vertex and Index arrays: a local copy is kept so that when the start or end points fall inside a triangle, a new vertex is added to the vertex array, and three new triangles are added to the triangle index array, new normals are added to the Normal array:. -
m_iWhich
private int m_iWhichDOCUMENT ME! -
m_kBorder
Data memebr for Dijkstra's search. The m_kBorder list stores all the vertices that have been visited by Dijkstra's search, but that have not yet been relaxed. It is used to speed up the search for the non-relaxed vertex with the smallest path distance -
m_kDijkstraGeodesicGroup
private javax.media.j3d.BranchGroup m_kDijkstraGeodesicGroupDOCUMENT ME! -
m_kEndPoint
private javax.vecmath.Point3f m_kEndPointDOCUMENT ME! -
m_kEndSurface
DOCUMENT ME! -
m_kEuclidianGeodesicGroup
private javax.media.j3d.BranchGroup m_kEuclidianGeodesicGroupDOCUMENT ME! -
m_kFinished
DOCUMENT ME! -
m_kFirstPoint
private javax.vecmath.Point3f m_kFirstPointFirst point, for closing the Geodesic curve:. -
m_kGeodesic_Finished
For finished paths, either open or closed:. -
m_kGeodesic_Working
LinkedLists to contain the working paths in progress, and all finished paths, open and closed for the smoothed geodesics and dijkstra's geodesics. These are used in the cutting operations: For paths that are not finished, points may still be added to these paths: -
m_kGeodesic_Working_Left
DOCUMENT ME! -
m_kGeodesic_Working_Right
DOCUMENT ME! -
m_kGeodesicGroup
private javax.media.j3d.Group m_kGeodesicGroupGroup for drawing the Geodesic on the triangle mesh, assumes that the Group is created in the same branch tree as the triangle mesh surface, so when the mesh is transformed (rotated,scaled,translated) the polyline drawn and stored in the Group m_kSmoothedGeodesicGroup will be transformed in the same way:. -
m_kGeodesicVertices
private javax.vecmath.Point3f[] m_kGeodesicVerticesThe final list of points in the Geodesic curve. All points are constrained to lie on the triangle mesh, -
m_kLastCut
DOCUMENT ME! -
m_kLastFinished
DOCUMENT ME! -
m_kModified
DOCUMENT ME! -
m_kMouseEvent
DOCUMENT ME! -
m_kNewNormals
New normal link list. -
m_kNewTexCoords
New texCoords link list. -
m_kNewColors
New Colors link list. -
m_kNewTriangles
new triangle link list. -
m_kNewVerts
New vertices link list. -
m_kOriginal
Data members for the Geodesic Class: Triangle mesh:. -
m_kPBar
Volume renderer progress bar:. -
m_kPickCanvas
private com.sun.j3d.utils.picking.PickCanvas m_kPickCanvasPickCanvas, created by the class that creates the triangle mesh and the geodesic group:. -
m_kPickColors
private javax.vecmath.Color3f[] m_kPickColorsColor of the first and sucessive points on the Geodesic curve:. -
m_kPreviousStartPoint
private javax.vecmath.Point3f m_kPreviousStartPointDOCUMENT ME! -
m_kRemoveTriangles
Removed triangle link list. -
m_kSmoothedGeodesicGroup
private javax.media.j3d.BranchGroup m_kSmoothedGeodesicGroupRoot group for different path. -
m_kStartEndList
link list to hold the path. -
m_kStartPoint
private javax.vecmath.Point3f m_kStartPointStart and End points -- pair of points for which a Geodesic is calculated, must be in TriangleMesh coordinates:. -
m_kStartSurface
DOCUMENT ME! -
m_kSurface
DOCUMENT ME! -
m_kSurfaceBackup
DOCUMENT ME! -
m_kSwitchDisplay
private javax.media.j3d.Switch m_kSwitchDisplayDOCUMENT ME!
-
-
Constructor Details
-
Geodesic
public Geodesic()Instantiation without initializing the progress bar, pickCanvas, GeodesicGroup, triangle mesh or sphere radius, each of those can be set through individual member access functions:. -
Geodesic
public Geodesic(com.sun.j3d.utils.picking.PickCanvas kPickCanvas, javax.media.j3d.Group kGeodesicGroup, ModelTriangleMesh kMesh, float fRadius) Instantiaion of the Geodesic object, with the objects necessary for the Geodesic to serve as a MouseListener that performs picking and with the Group kGeodesicGroup so that the Geodesic curve can be drawn directly on the ModelTriangleMesh.- Parameters:
kPickCanvas- PickCanvaskGeodesicGroup- GroupkMesh- ModelTriangleMesh surfacefRadius- float marker sphere radius
-
-
Method Details
-
clear
public void clear(boolean bAll) Clear all geodesics curves drawn on the surface.- Parameters:
bAll- bAll, when true clears all the geodesic curves, when false, clears the last point drawn:
-
clearCut
public void clearCut(boolean bAll) Clear the current geodesics curve drawn on the surface.- Parameters:
bAll- bAll, when true clears all the geodesic curves, when false, clears the last point drawn:
-
computeGeodesic
public boolean computeGeodesic(float fPercentage, boolean bSmoothed) Compute the Geodesic curve. The triangle mesh, start, and end points, start and end indices must be defined before this function is called.- Parameters:
fPercentage- float, the optimization parameter for Dijkstra's shortest-path search. Values between 0-100, (increasing optimization).bSmoothed- flag to smooths and stores the shortest path.- Returns:
- DOCUMENT ME!
-
createPath
public boolean createPath(int iStart, int iEnd) createPath starts with the results of Dijkstra's minimum path algorithm. It smooths the path, and stores the resulting points in the m_kGeodesicPath data member.- Parameters:
iStart- int given geodesic line starting pointiEnd- int given geodesic line ending point- Returns:
- boolean success or not
-
cut
public void cut()Cut the m_kModified mesh. -
dispose
public void dispose()Deletes all member variables, clean memory. -
drawDijkstraEuclidianPath
public void drawDijkstraEuclidianPath(int iStart, int iEnd) drawPath draws the Dijkstra path and Euclidian paths and adds them to the corresponding m_kDijkstraGeodesicGroup and m_kEuclidianGeodesicGroups.- Parameters:
iStart- int Dijkstra path starting pointiEnd- int Dijkstra path ending point
-
drawGeodesicPath
public void drawGeodesicPath(int iStart, int iEnd) drawPath draws the Geodesic path as a LineArray and adds it to the children of the m_kSmoothedGeodesicGroup object, it also draws the Dijkstra path and Euclidian paths and adds them to the corresponding m_kDijkstraGeodesicGroup and m_kEuclidianGeodesicGroups.- Parameters:
iStart- int Geodesic path starting pointiEnd- int Geodesic path ending point
-
drawPath
public void drawPath(int iStart, int iEnd) drawPath draws the Geodesic path as a LineArray and adds it to the children of the m_kSmoothedGeodesicGroup object, it also draws the Dijkstra path and Euclidian paths and adds them to the corresponding m_kDijkstraGeodesicGroup and m_kEuclidianGeodesicGroups.- Parameters:
iStart- int Geodesic path starting pointiEnd- int Geodesic path ending point
-
finish
public void finish(boolean bOpen) Closes the geodesic curve.- Parameters:
bOpen- bOpen: when true leaves the geodesic open, when false closes the geodesic by connecting to the first point on the polyline sequence.
-
getEnable
public boolean getEnable()Access on when picking with the mouse is enabled.- Returns:
- boolean picking is enabled or not.
-
getNumPathPoints
public int getNumPathPoints()Returns the number of points in the geodesic curve.- Returns:
- int, the number of points on the Geodesic.
-
getPathPoint
public void getPathPoint(int iPoint, javax.vecmath.Point3f kPoint) Access to the ith point on the Geodesic curve. All points on the geodesic curve lie on the triangle mesh.- Parameters:
iPoint- ith point indexkPoint- Point3f point's coordinate
-
getPathPoints
public void getPathPoints(javax.vecmath.Point3f[] akPoints) Access to the all the points on the Geodesic curve. All points on the geodesic curve lie on the triangle mesh.- Parameters:
akPoints- Point3f[] points coordinates array
-
keyPressed
Invoked when a key has been pressed.- Specified by:
keyPressedin interfaceKeyListener- Parameters:
kEvent- KeyEvent
-
keyReleased
Invoked when a key has been released.- Specified by:
keyReleasedin interfaceKeyListener- Parameters:
kEvent- KeyEvent
-
keyTyped
Invoked when a key has been typed.- Specified by:
keyTypedin interfaceKeyListener- Parameters:
kEvent- KeyEvent
-
mouseClicked
One of the overrides necessary to be a MouseListener. This function is invoked when a button has been pressed and released.- Specified by:
mouseClickedin interfaceMouseListener- Parameters:
kMouseEvent- the mouse event generated by a mouse clicked
-
mouseDragged
mouseDragged.- Specified by:
mouseDraggedin interfaceMouseMotionListener- Parameters:
kMouseEvent- MouseEvent
-
mouseEntered
One of the overrides necessary to be a MouseListener. Invoked when the mouse enters a component.- Specified by:
mouseEnteredin interfaceMouseListener- Parameters:
kMouseEvent- the mouse event generated by a mouse entered
-
mouseExited
One of the overrides necessary to be a MouseListener. Invoked when the mouse leaves a component.- Specified by:
mouseExitedin interfaceMouseListener- Parameters:
kMouseEvent- the mouse event generated by a mouse exit
-
mouseMoved
mouseMoved. In livewire mode the mouseMoved function updates the endpoints of the Dijkstra's geodesic and computes Dijkstra's path between the last point added and the mouse position. Only Dijkstra's and the Euclidian paths are updated, the smoothed geodesic is not calculated or displayed:- Specified by:
mouseMovedin interfaceMouseMotionListener- Parameters:
kMouseEvent- MouseEvent
-
mousePressed
One of the overrides necessary to be a MouseListener. Invoked when a mouse button is pressed.- Specified by:
mousePressedin interfaceMouseListener- Parameters:
kMouseEvent- the mouse event generated by a mouse press
-
mouseReleased
One of the overrides necessary to be a MouseListener. Invoked when a mouse button is released.- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
kMouseEvent- the mouse event generated by a mouse release
-
setEnable
public void setEnable(boolean bEnable) Enables picking with the mouse and drawing the curve on the mesh.- Parameters:
bEnable- set the mouse picking enabled or not.
-
setEndIndex
public void setEndIndex(int iIndex) Set the index of the vertex in the triangle mesh where the Geodesic curve is to end. The index must be less than or equal to the number of vertices in the triangle mesh.- Parameters:
iIndex- int the index of the vertex in the triangle mesh where the Geodesic curve is to end.
-
setEndIndices
public void setEndIndices(int[] iIndices) Sets the indices of the triangle that the end point is located in. This is used when the end point falls on the inside of a triangle in the mesh, the indices parameter defines which triangle the end point falls in.- Parameters:
iIndices- int[3] array of vertex indices defining the end triangle.
-
setEndPoint
public void setEndPoint(javax.vecmath.Point3f kPoint) Sets the end point of the geodesic curve on the mesh. The point coordinates must be in local mesh coordinates.- Parameters:
kPoint- the point on the triangle mesh where the geodesic curve is to end, in mesh coordinates.
-
setGeodesicGroup
public void setGeodesicGroup(javax.media.j3d.Group kGeodesicGroup) Access function to set the Group object m_kGeodesicGroup. This is necessary for the Geodesic object to draw the geodesic curve on the mesh. The curve may be drawn in one of three ways: (1) the straight-line Euclidian curve, which is not constrained to lie on the mesh surface, or (2) Dijkstra's path, which falls along the original mesh triangle edges, or (3) the Smoothed Geodesic, which is constrained to lie on the mesh surface, but which may cross triangle edges. All three display modes are represented by a different BranchGroup.- Parameters:
kGeodesicGroup- Geodesic image scene graph node.
-
setPanel
Access to the JPanelGeodesic interface object.- Parameters:
kPanel- JPanelGeodesic geodesic panel
-
setPickCanvas
public void setPickCanvas(com.sun.j3d.utils.picking.PickCanvas kPickCanvas) Access function to set the pickCanvas. This is necessary for the Geodesic class to do picking with the mouse.- Parameters:
kPickCanvas- PickCanvas
-
setPreviousStartIndices
public void setPreviousStartIndices(int[] iIndices) Sets the indices of the triangle that the previous start point is located in. This is used when the start point falls on the inside of a triangle in the mesh, the indices parameter defines which triangle the start point falls in.- Parameters:
iIndices- index coordinate
-
setRadius
public void setRadius(float fRadius) Set the radius of the spheres used to mark the start and end points on the geodesic curve.- Parameters:
fRadius- the size of the marker sphere to be drawn on the mesh
-
setStartIndex
public void setStartIndex(int iIndex) Set the index of the vertex in the triangle mesh where the Geodesic curve is to start. The index must be less than or equal to the number of vertices in the triangle mesh.- Parameters:
iIndex- int the index of the vertex in the triangle mesh where the Geodesic curve is to start.
-
setStartIndices
public void setStartIndices(int[] iIndices, boolean bFirst) Sets the indices of the triangle that the start point is located in. This is used when the start point falls on the inside of a triangle in the mesh, the indices parameter defines which triangle the start point falls in.- Parameters:
iIndices- int[3] array of vertex indices defining the start triangle.bFirst- flag indicate the first indices defining the start triangle.
-
setStartPoint
public void setStartPoint(javax.vecmath.Point3f kPoint, boolean bFirst) Sets the start point of the geodesic curve on the mesh. The point coordinates must be in local mesh coordinates.- Parameters:
kPoint- the point on the triangle mesh where the geodesic curve is to start, in mesh coordinates.bFirst- flag indicate the first indices defining the start triangle.
-
toggleDisplay
public void toggleDisplay(int iWhich) Called by the JPanelGeodesic interface to switch between displaying the Smoothed Geodesic, Dijkstra's path, or the Euclidian path.- Parameters:
iWhich- display group index
-
toggleLivewire
public void toggleLivewire()Toggle between livewire mode and point invalid input: '&' click mode. -
addEdge
private void addEdge(int iEdgeIndex, int iNewEdge) Add the edge to the EdgeList, check to make sure that edge has not already been added.- Parameters:
iEdgeIndex- edge indexiNewEdge- int added edge index
-
checkOnEdge
private int checkOnEdge(ModelTriangleMesh kMesh, javax.vecmath.Point3f kPoint, int[] aiTriIndex, javax.vecmath.Vector3f kNormal, javax.vecmath.TexCoord3f kTexCoord, javax.vecmath.Color4f kColor) Given a point which is known to be inside a triangle, and that triangle, this function determines which edge, if any, that point falls on.- Parameters:
kMesh- ModelTriangleMesh surfacekPoint- Point3faiTriIndex- int[]kNormal- Vector3f- Returns:
- int
-
cleanUp
private void cleanUp()cleanUp deletes the data stuctures used for the Dijkstra's search, but does not delete the array of points on the Geodesic curve. -
clearAllStartEnd
private void clearAllStartEnd()clears the all the points added in livewire mode when clear all is called from the user interface. -
clearLastStartEnd
private void clearLastStartEnd()clears the last points added in livewire mode when clear last point is called from the user interface. -
contains
Contains determines if the linked list kTriList contains the input triangle, which is specified by three vertex indices. The LinkedList member function contains is not used because the indices may be in a different order, and the function must return true if any of the triangles in the list match the input triangle regardless of the order the vertices are specified- Parameters:
kTriList- Link ListkNewTri- Point3i input triangle vertex indices- Returns:
- boolean contains the triangle or not.
-
createEdgeLists
Create the edges list from the given surface triangle mesh.- Parameters:
kMesh- ModelTriangleMesh surface- Returns:
- boolean success or not
-
createNewMesh
private ModelTriangleMesh createNewMesh(ModelTriangleMesh kMesh, int iVertexCount, int iOldVertexCount) creates a new mesh after triangulation or when a mesh is cut along the geodesic.- Parameters:
kMesh- ModelTriangleMesh surfaceiVertexCount- int new vertex countiOldVertexCount- int old vertex cunt- Returns:
- ModelTriangleMesh surface
-
distance
private float distance(javax.vecmath.Point3f kPoint1, javax.vecmath.Point3f kPoint2) Calculate the Euclidean distance between two points.- Parameters:
kPoint1- Point3f starting pointkPoint2- Point3f ending point- Returns:
- float distance
-
drawDijkstraEuclidianPoint
private void drawDijkstraEuclidianPoint(javax.vecmath.Point3f kStart, javax.vecmath.Color3f kColor) Draw the user-selected point as a sphere on the triangle mesh, the sphere is added to all three drawing groups: m_kSmoothedGeodesicGroup, m_kDijkstraGeodesicGroup, and m_kEuclidianGeodesicGroup.- Parameters:
kStart- Point3f starting pointkColor- Color3f ending point
-
drawGeodesicPoint
private void drawGeodesicPoint(javax.vecmath.Point3f kStart, javax.vecmath.Color3f kColor) Draw the user-selected point as a sphere on the triangle mesh, the sphere is added to all three drawing groups: m_kSmoothedGeodesicGroup, m_kDijkstraGeodesicGroup, and m_kEuclidianGeodesicGroup.- Parameters:
kStart- Point3f starting pointkColor- Color3f ending point
-
drawPoint
private void drawPoint(javax.vecmath.Point3f kStart, javax.vecmath.Color3f kColor) Draw the user-selected point as a sphere on the triangle mesh, the sphere is added to all three drawing groups: m_kSmoothedGeodesicGroup, m_kDijkstraGeodesicGroup, and m_kEuclidianGeodesicGroup.- Parameters:
kStart- Point3f point coordinatekColor- Color3f point color
-
extractNewMesh
Used in cutting closed paths and creating new meshes to export to the scene graph.- Parameters:
kLoop- LinkedList surface mesh link list- Returns:
- int number of deleted vertices
-
findEdges
private void findEdges(int iIndex, boolean[] bFound) Go through the edge list find the the edge specified.- Parameters:
iIndex- int edge indexbFound- boolean[] edge being found
-
findMin
private float findMin(javax.vecmath.Point3f kStart, int iMiddle, int iSide, javax.vecmath.Point3f kEnd, javax.vecmath.Point4f kNewPoint4) findMin finds the point (newpoint) along the edge that connects the points Side-Middle that minimizes the distance Start-newpoint-End.- Parameters:
kStart- Point3f starting pointiMiddle- int middle pointiSide- int side point indexkEnd- Point3f end indexkNewPoint4- Point4f new point- Returns:
- float find min point index
-
findNewMeshes
Used in cutting closed paths and creating new meshes to export to the scene graph.- Parameters:
kSourceMesh- ModelTriangleMesh surface meshkGeodesic_Closed_Loops- LinkedList closed path- Returns:
- int
-
findSmallest
private int findSmallest()The findSmallest function searches through the list of vertices that are not yet relaxed but that have been visited by the Dijkstra Search, so that the weight factor is not Float.MAX_VALUE, but also is not the minimum value for that node. In Dijkstra's search the vertex with the smallest weight is relaxed first, a greedy algorithm that chooses the locally closest vertex to add to the path. The final weight for the vertex is determined when it is relaxed.This function uses the data member m_kBorder -- the linked list of vertices that have been visited by Dijkstra's search, but which have not yet been relaxed.
- Returns:
- int index of the vertex with the smallest weight
-
findTriPoints
Find the next side triangle index.- Parameters:
iNode1- int node 1 along the sideiNode2- int node 2 along the sidekEndPoints- end point Link List- Returns:
- int next side triangle index
-
finishWorkingLists
private void finishWorkingLists(boolean bOpen) Adds the working paths to the finished path lists, combining the segments in the working paths into one path.- Parameters:
bOpen- boolean close path or not
-
getNormal
Calculates and returns the start point normal for a new starting point inside an existing triangle. The new normal is the average of the normals at each point in the triangle the starting point is inside- Parameters:
kMesh- ModelTriangleMesh surface meshaiIndex- int[] 3 triangle points- Returns:
- Vector3f Average normal of the triangle.
-
getTexCoord
Calculates and returns the start point texture coordinate for a new starting point inside an existing triangle. The new texture coordinate is the average of the texture coordinates at each point in the triangle the starting point is inside- Parameters:
kMesh- ModelTriangleMesh surface meshaiIndex- int[] 3 triangle points- Returns:
- Texture3f Average texture coordinate of the triangle.
-
getColor
Calculates and returns the start point color for a new starting point inside an existing triangle. The new color is the average of the colors at each point in the triangle the starting point is inside- Parameters:
kMesh- ModelTriangleMesh surface meshaiIndex- int[] 3 triangle points- Returns:
- Color4f Average color of the triangle.
-
getNormal
Get the the triangle normal from the given triangle index.- Parameters:
kMesh- ModelTriangleMesh surface meshiIndex1- int triangle point index 1iIndex2- int triangle point index 2- Returns:
- Vector3f normal of the triangle
-
getTexCoord
Get the the triangle texture coordinate from the given triangle index.- Parameters:
kMesh- ModelTriangleMesh surface meshiIndex1- int triangle point index 1iIndex2- int triangle point index 2- Returns:
- interpolated texture coordinate the triangle
-
getColor
Get the the triangle color from the given triangle index.- Parameters:
kMesh- ModelTriangleMesh surface meshiIndex1- int triangle point index 1iIndex2- int triangle point index 2- Returns:
- interpolated color the triangle
-
getPathIndex
getPathIndex returns what the new vertex index should be. If the input index, iIndex, does fall on the cut path, kPath, then that point on the path is going to be duplicated to disconnect the triangles on either side of the cut path. Therefore the input index needs to be translated into a new vertex index, based on the current iVertexCount, the point's position along the path, and wehter or not the path is open or closed.- Parameters:
kPath- LinkedList path link listiVertexCount- int vertex countiIndex- int path indexbOpen- boolean close path or not- Returns:
- int the new vertex index
-
getStartEnd
private void getStartEnd(int iWhich) In livewire mode the endpoints of each path segment along Dijkstra's curve -- between each of the user-selected points -- are stored so that the smoothed geodesic may be calculated and displayed later. This function retrieves the stored values when the livewire path is finished- Parameters:
iWhich- int path index
-
initColors
private void initColors()Initializes the colors for the first point on the curve, and the successive points. -
initializeGeodesic
private void initializeGeodesic(float fPercentage) initializeGeodesic copies the triangle mesh and initializes the data structures for Dijkstra's Single-Source shortest path algorithm.If the start and end vertices do not fall on a triangle vertex, then the triangle they fall inside split into three new triangles, by connecting the new vertex to each of the triangle vertices.
- Parameters:
fPercentage- float the optimization parameter for Dijkstra's shortest-path search
-
onRight
onRight determines if a given point on a triangle, kSide, is to the right of or to the left of the vector specified by the vertices kPrev - kPoint.- Parameters:
kMesh- ModelTriangleMesh surface meshiPrevIndex- int previous verticeiIndex- int specified vertice indexiSideIndex- int side vertice index- Returns:
- boolean a point on the right or triangle or not.
-
outputDeletedAsNew
private void outputDeletedAsNew()creating new meshes to export to the scene graph. -
relaxEdges
private void relaxEdges(int iNode) This function determines the shortest path from the start vertex through the input vertex to the vertices that neighbor the input vertex.The function relaxEdges looks at all the vertices connected by triangle edges to the input vertex and calculated the weight factors for each of those vertices, adding those vertices that are not yet "relaxed" to the list of vertices on the border.
Once the weight factors for each of the vertices connected to the input vertex are set, the input vertex is labeled "relaxed" and removed from the list of vertices on the border.
- Parameters:
iNode- int input vertex index
-
resetDrawGeodesic
private void resetDrawGeodesic()Remove all the geodesic lines and reset to draw the new geodesic lines. -
saveStartEnd
private void saveStartEnd()In livewire mode the endpoints of each path segment along Dijkstra's curve -- between each of the user-selected points -- are stored so that the smoothed geodesic may be calculated and displayed later. -
setEndSurface
The start and end surfaces ensure that the points on the geodesic curve all fall on one mesh, and that the algorithm isn't trying to find a path between two unconnected meshes.- Parameters:
kMesh- ModelTriangleMesh surface mesh
-
setEpsilon
private void setEpsilon()Determines an appropriate epsilon, based on the size of the triangles in the mesh. The epsilon is used to determine if points are "close enough" to the triangle vertices or edges. -
setPreviousStartPoint
private void setPreviousStartPoint(javax.vecmath.Point3f kPoint) Sets the previous start point of the geodesic curve on the mesh. Used when the last point is deleted, the start point reverts to the previous start point. The point coordinates must be in local mesh coordinates.- Parameters:
kPoint- the point on the triangle mesh where the geodesic curve is to start, in mesh coordinates.
-
setStartSurface
The start and end surfaces ensure that the points on the geodesic curve all fall on one mesh, and that the algorithm isn't trying to find a path between two unconnected meshes.- Parameters:
kMesh- surface mesh
-
setSurface
Access function to set the triangle mesh that the geodesic curve is calculated on.- Parameters:
kMesh- DOCUMENT ME!
-
smoothPath
private int smoothPath(int iNode, LinkedList kLeft, LinkedList kMiddle, LinkedList kRight, LinkedList kLeftTemp, LinkedList kRightTemp, LinkedList kNewVertTemp) Smooth the path.- Parameters:
iNode- int vertex indexkLeft- LinkedList left pointkMiddle- LinkedList middle pointkRight- LinkedList right pointkLeftTemp- LinkedList left point temporarykRightTemp- LinkedList right point temporarykNewVertTemp- LinkedList new point temporary- Returns:
- int success or not
-
sortTriIndex
private void sortTriIndex(javax.vecmath.Point3i aiAddTri, javax.vecmath.Point3f[] akVertices, javax.vecmath.Vector3f[] akNormals) Used when new triangles are added to the mesh, either when the mesh is triangulated along the smoothed geodesic curve, or when the mesh is cut. sortTriIndex sorts the triangle indices so that the triangle is always front-facing and that the normals are correct for rendering- Parameters:
aiAddTri- Point3i added triangle verticesakVertices- Point3f[] triangle vertices arrrayakNormals- Vector3f[] triangle vertices normal array
-
triangleEdge
private int triangleEdge(int i0, int i1, int i2, int iP0, int iP1) if the two of the first three triangle indices equal the second two indices, then the third index is returned.- Parameters:
i0- int first triangle indice 1i1- int first triangle indice 2i2- int first triangle indice 3iP0- int second triangle indice 1iP1- int second triangle indice 2- Returns:
- int third index
-
triangleEquals
private boolean triangleEquals(int i0, int i1, int i2, int iP0, int iP1, int iP2) Returns true if the first three triangle indices equal the second three indices.- Parameters:
i0- int first triangle indice 1i1- int first triangle indice 2i2- int first triangle indice 3iP0- int second triangle indice 1iP1- int second triangle indice 2iP2- DOCUMENT ME!- Returns:
- boolean true equal, false not
-
triangleExists
private boolean triangleExists(javax.vecmath.Point3i kTri) Check to see if the triangle specified in the triangle list.- Parameters:
kTri- Point3i triangle specified- Returns:
- boolean true in the list, false not in the list
-
triangulate
private int triangulate(ModelTriangleMesh kMesh, LinkedList kPath, LinkedList kLeftPath, LinkedList kRightPath, int iVertexCount) triangulates the mesh along a single geodesic.- Parameters:
kMesh- ModelTriangleMesh surface meshkPath- LinkedList path link listkLeftPath- LinkedList left path link listkRightPath- LinkedList right path link listiVertexCount- int vertex count- Returns:
- int number of vertices
-
triangulateMeshPath
private void triangulateMeshPath()re-triangulates the mesh along the Smoothed Geodesic. -
unZip
private int unZip(ModelTriangleMesh kMesh, LinkedList kPath, int iVertexCount, boolean bOpen, LinkedList kNewPath) unZip cuts along the smoothed geodesic path by creating new vertices for each point on the path, and updating the triangles that are connected to the path and that fall on the right of the path to contain the new path vertices. This cuts the mesh by disconnecting the triangles that are on the left and right sides of the geodesic path.- Parameters:
kMesh- ModelTriangleMesh surface meshkPath- LinkedList path link listiVertexCount- int vertex countbOpen- boolean closed path or notkNewPath- LinkedList new path link list- Returns:
- int new number of vertices
-