Class Geodesic_WM
- Author:
- Alexandra Bokinsky, Ph.D. Under contract from Magic Software.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean[]List of triangles to remove.private int[]The indices of the triangle containing the end of the new line.private int[]The indices of the triangle containing the first point on the new line.private int[]vertices array.private int[]For shifting the triangle indices after removing triangles from the mesh.private int[]The indices of the triangle containing the previous start point.private int[]The indices of the triangle containing the start of the new line.private LinkedList<Integer>[]Data members used in Dijkstra's search.private booleanTurned on when picking with the mouse is enabled:.private booleanFlag to indicates end point changes.private booleanClosing the Geodesic path:.private booleanprivate booleanFlag for clearing the Geodesic curves, if it is false, no curves have been added to the GeodesicGroup.private booleanLive wire last point.private booleanLive wire or point and click mode.private booleanClose path or not.private boolean[]For Dijkstra search.private floatPath length statistics for each type of path:.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 floatLength of the smoothed geodesic pathprivate float[]For Dijkstra search.private intThe number of line segments on the Dijkstra curve.private intThe index of the vertex in the triangle mesh where the Geodesic curve is to end.private intThe number of line segments on the Euclidian curve.private intindex count.private intThe index of the last node on a closed path.private intNumber of vertices in the geodesic curve.private intNumber of meshes.private intNumber of triangles not removed during a cut mesh operation.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 removed during a cut mesh operation.private intNumber of triangles in the mesh, after the new triangles are added:.private intnumber of vertices in the path.private int[]For Dijkstra search.private intRoot group for different path.private intThe start index value 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 LinkedList<Integer> Data member for Dijkstra's search.private WildMagic.LibFoundation.Mathematics.Vector3fEnd point on the curve.private WildMagic.LibGraphics.SceneGraph.TriMeshSurface the End point is on.private WildMagic.LibGraphics.SceneGraph.TriMeshThe finished TriMeshprivate WildMagic.LibFoundation.Mathematics.Vector3fFirst point, for closing the Geodesic curve:.private LinkedList<LinkedList<WildMagic.LibFoundation.Mathematics.Vector4f>> For finished paths, either open or closed:.private LinkedList<LinkedList<WildMagic.LibFoundation.Mathematics.Vector4f>> LinkedLists to contain the working paths in progress, and all finished paths, open and closed for the smoothed geodesics and dijkstra's geodesics.private LinkedList<LinkedList<Integer>> LinkedLists to contain the working paths in progress, and all finished paths, open and closed for the smoothed geodesics and dijkstra's geodesics.private LinkedList<LinkedList<Integer>> LinkedLists to contain the working paths in progress, and all finished paths, open and closed for the smoothed geodesics and dijkstra's geodesics.private WildMagic.LibFoundation.Mathematics.Vector3f[]The final list of points in the Geodesic curve.private WildMagic.LibGraphics.SceneGraph.TriMeshPrevious cut meshprivate WildMagic.LibGraphics.SceneGraph.TriMeshPrevious mesh with a finished curveprivate WildMagic.LibGraphics.SceneGraph.TriMeshCurrent modified meshprivate LinkedList<WildMagic.LibFoundation.Mathematics.ColorRGBA> New Colors link list.private LinkedList<WildMagic.LibFoundation.Mathematics.Vector3f> New normal link list.private LinkedList<WildMagic.LibFoundation.Mathematics.Vector3f> New texCoords link list.private LinkedList<WildMagic.LibFoundation.Mathematics.Vector3f> new triangle link list.private LinkedList<WildMagic.LibFoundation.Mathematics.Vector3f> New vertices link list.private WildMagic.LibGraphics.SceneGraph.TriMeshData members for the Geodesic Class: Triangle mesh:.(package private) JPanelGeodesic_WMReference to the JPanelGeodesic:.private JProgressBarVolume renderer progress bar:.private WildMagic.LibFoundation.Mathematics.ColorRGB[]Color of the first and successive points on the Geodesic curve:.private WildMagic.LibFoundation.Mathematics.Vector3fPrevious start point on the new line segment.private LinkedList<WildMagic.LibFoundation.Mathematics.Vector3f> Removed triangle link list.private LinkedList<LinkedList<WildMagic.LibFoundation.Mathematics.Vector3f>> link list to hold the path.private WildMagic.LibFoundation.Mathematics.Vector3fStart and End points -- pair of points for which a Geodesic is calculated, must be in TriangleMesh coordinates:.private WildMagic.LibGraphics.SceneGraph.TriMeshTriMesh containing the start point on the new line segmentprivate WildMagic.LibGraphics.SceneGraph.TriMeshCurrent TriMesh surfaceprivate WildMagic.LibGraphics.SceneGraph.TriMeshBackup surface. -
Constructor Summary
ConstructorsConstructorDescriptionInstantiation without initializing the progress bar, pickCanvas, GeodesicGroup, triangle mesh or sphere radius, each of those can be set through individual member access functions:.Geodesic_WM(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, float fRadius) Instantiation 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 TriMesh. -
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(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, WildMagic.LibFoundation.Mathematics.Vector3f kPoint, int[] aiTriIndex, WildMagic.LibFoundation.Mathematics.Vector3f kNormal, WildMagic.LibFoundation.Mathematics.Vector3f kTexCoord, WildMagic.LibFoundation.Mathematics.ColorRGBA 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, WildMagic.LibFoundation.Mathematics.Vector3f kNewTri) Contains determines if the linked list kTriList contains the input triangle, which is specified by three vertex indices.private intcontainsVector(LinkedList<WildMagic.LibFoundation.Mathematics.Vector3f> kVecList, WildMagic.LibFoundation.Mathematics.Vector3f kNewTri) Return index of the Vector3f in the list.private booleancreateEdgeLists(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh) Create the edges list from the given surface triangle mesh.private WildMagic.LibGraphics.SceneGraph.TriMeshcreateNewMesh(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, int iVertexCount, int iOldVertexCount) creates a new mesh after triangulation or when a mesh is cut along the geodesic.booleancreatePath(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, 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(WildMagic.LibFoundation.Mathematics.Vector3f kPoint1, WildMagic.LibFoundation.Mathematics.Vector3f kPoint2) Calculate the Euclidean distance between two points.voiddrawDijkstraEuclidianPath(WildMagic.LibGraphics.SceneGraph.TriMesh kParent, WildMagic.LibGraphics.SceneGraph.TriMesh kWorking, 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(WildMagic.LibGraphics.SceneGraph.TriMesh kParent, WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.ColorRGB 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(WildMagic.LibGraphics.SceneGraph.TriMesh kParent, 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(WildMagic.LibGraphics.SceneGraph.TriMesh kParent, WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.ColorRGB 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(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, 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(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.ColorRGB 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(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, WildMagic.LibFoundation.Mathematics.Vector3f kStart, int iMiddle, int iSide, WildMagic.LibFoundation.Mathematics.Vector3f kEnd, WildMagic.LibFoundation.Mathematics.Vector4f kNewPoint4) findMin finds the point (newpoint) along the edge that connects the points Side-Middle that minimizes the distance Start-newpoint-End.private intfindNewMeshes(WildMagic.LibGraphics.SceneGraph.TriMesh 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<Integer> 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 WildMagic.LibFoundation.Mathematics.ColorRGBAgetColor(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, int[] aiIndex) Calculates and returns the start point color for a new starting point inside an existing triangle.private WildMagic.LibFoundation.Mathematics.ColorRGBAgetColor(WildMagic.LibGraphics.SceneGraph.TriMesh 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 WildMagic.LibFoundation.Mathematics.Vector3fgetNormal(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, int[] aiIndex) Calculates and returns the start point normal for a new starting point inside an existing triangle.private WildMagic.LibFoundation.Mathematics.Vector3fgetNormal(WildMagic.LibGraphics.SceneGraph.TriMesh 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, WildMagic.LibFoundation.Mathematics.Vector3f kPoint) Access to the i-th point on the Geodesic curve.voidgetPathPoints(WildMagic.LibFoundation.Mathematics.Vector3f[] 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 WildMagic.LibFoundation.Mathematics.Vector3fgetTexCoord(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, int[] aiIndex) Calculates and returns the start point texture coordinate for a new starting point inside an existing triangle.private WildMagic.LibFoundation.Mathematics.Vector3fgetTexCoord(WildMagic.LibGraphics.SceneGraph.TriMesh 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.private booleanonRight(WildMagic.LibGraphics.SceneGraph.TriMesh 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 voidoutputDeletedAsNew(WildMagic.LibGraphics.SceneGraph.TriMesh kSourceMesh) creating new meshes to export to the scene graph.private voidrelaxEdges(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, 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(WildMagic.LibFoundation.Mathematics.Vector3f kPoint) Sets the end point of the geodesic curve on the mesh.private voidsetEndSurface(WildMagic.LibGraphics.SceneGraph.TriMesh 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.voidsetPanel(JPanelGeodesic_WM kPanel) Access to the JPanelGeodesic interface object.voidsetPickedPoint(WildMagic.LibGraphics.Collision.PickRecord kPickPoint, WildMagic.LibGraphics.SceneGraph.TriMesh kMesh) voidsetPreviousStartIndices(int[] iIndices) Sets the indices of the triangle that the previous start point is located in.private voidsetPreviousStartPoint(WildMagic.LibFoundation.Mathematics.Vector3f 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(WildMagic.LibFoundation.Mathematics.Vector3f kPoint, boolean bFirst) Sets the start point of the geodesic curve on the mesh.private voidsetStartSurface(WildMagic.LibGraphics.SceneGraph.TriMesh 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(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh) Access function to set the triangle mesh that the geodesic curve is calculated on.private intsmoothPath(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, int iNode, LinkedList<Integer> kLeft, LinkedList<Integer> kMiddle, LinkedList<Integer> kRight, LinkedList<Integer> kLeftTemp, LinkedList<Integer> kRightTemp, LinkedList<WildMagic.LibFoundation.Mathematics.Vector4f> kNewVertTemp) Smooth the path.private voidsortTriIndex(WildMagic.LibFoundation.Mathematics.Vector3f aiAddTri, WildMagic.LibGraphics.SceneGraph.VertexBuffer kVBuffer) 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 renderingvoidToggle 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(WildMagic.LibFoundation.Mathematics.Vector3f kTri) Check to see if the triangle specified in the triangle list.private inttriangulate(WildMagic.LibGraphics.SceneGraph.TriMesh 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(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, LinkedList<WildMagic.LibFoundation.Mathematics.Vector4f> kPath, int iVertexCount, boolean bOpen, LinkedList<Integer> 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_WM m_kPanelReference to the JPanelGeodesic:. -
m_abRemoveTris
private boolean[] m_abRemoveTrisList of triangles to remove. -
m_aiEndIndex
private int[] m_aiEndIndexThe indices of the triangle containing the end of the new line. -
m_aiFirstIndex
private int[] m_aiFirstIndexThe indices of the triangle containing the first point on the new line. -
m_aiIndex
private int[] m_aiIndexvertices array. -
m_aiIndexShift
private int[] m_aiIndexShiftFor shifting the triangle indices after removing triangles from the mesh. -
m_aiPreviousStartIndex
private int[] m_aiPreviousStartIndexThe indices of the triangle containing the previous start point. -
m_aiStartIndex
private int[] m_aiStartIndexThe indices of the triangle containing the start of the new line. -
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_bEnabled
private boolean m_bEnabledTurned on when picking with the mouse is enabled:. -
m_bEndpointChanged
private boolean m_bEndpointChangedFlag to indicates end point changes. -
m_bFinished
private boolean m_bFinishedClosing the Geodesic path:. -
m_bFirstWire
private boolean m_bFirstWire -
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_bLastWireLive wire last point. -
m_bLivewire
private boolean m_bLivewireLive wire or point and click mode. -
m_bOpen
private boolean m_bOpenClose path or not. -
m_bRelaxed
private boolean[] m_bRelaxedFor Dijkstra search. -
m_fDijkstraPathLength
private float m_fDijkstraPathLengthPath length statistics for each type of path:. -
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_fSmoothedPathLengthLength of the smoothed geodesic path -
m_fWeight
private float[] m_fWeightFor Dijkstra search. -
m_iEnd
private int m_iEndThe index of the vertex in the triangle mesh where the Geodesic curve is to end. -
m_iIndexCount
private int m_iIndexCountindex count. -
m_iLineClosed
private int m_iLineClosedThe index of the last node on a closed path. -
m_iNumGeodesicVertices
private int m_iNumGeodesicVerticesNumber of vertices in the geodesic curve. -
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_iPreviousFor Dijkstra search. -
m_iStart
private int m_iStartThe start index value 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_kBorder
Data member 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_iDijkstraGeodesicGroup
private int m_iDijkstraGeodesicGroupThe number of line segments on the Dijkstra curve. -
m_kEndPoint
private WildMagic.LibFoundation.Mathematics.Vector3f m_kEndPointEnd point on the curve. -
m_kEndSurface
private WildMagic.LibGraphics.SceneGraph.TriMesh m_kEndSurfaceSurface the End point is on. -
m_iEuclidianGeodesicGroup
private int m_iEuclidianGeodesicGroupThe number of line segments on the Euclidian curve. -
m_kFinished
private WildMagic.LibGraphics.SceneGraph.TriMesh m_kFinishedThe finished TriMesh -
m_kFirstPoint
private WildMagic.LibFoundation.Mathematics.Vector3f 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
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_Right
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_kGeodesicVertices
private WildMagic.LibFoundation.Mathematics.Vector3f[] m_kGeodesicVerticesThe final list of points in the Geodesic curve. All points are constrained to lie on the triangle mesh, -
m_kLastCut
private WildMagic.LibGraphics.SceneGraph.TriMesh m_kLastCutPrevious cut mesh -
m_kLastFinished
private WildMagic.LibGraphics.SceneGraph.TriMesh m_kLastFinishedPrevious mesh with a finished curve -
m_kModified
private WildMagic.LibGraphics.SceneGraph.TriMesh m_kModifiedCurrent modified mesh -
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
private WildMagic.LibGraphics.SceneGraph.TriMesh m_kOriginalData members for the Geodesic Class: Triangle mesh:. -
m_kPBar
Volume renderer progress bar:. -
m_kPickColors
private WildMagic.LibFoundation.Mathematics.ColorRGB[] m_kPickColorsColor of the first and successive points on the Geodesic curve:. -
m_kPreviousStartPoint
private WildMagic.LibFoundation.Mathematics.Vector3f m_kPreviousStartPointPrevious start point on the new line segment. -
m_kRemoveTriangles
Removed triangle link list. -
m_iSmoothedGeodesicGroup
private int m_iSmoothedGeodesicGroupRoot group for different path. -
m_kStartEndList
link list to hold the path. -
m_kStartPoint
private WildMagic.LibFoundation.Mathematics.Vector3f m_kStartPointStart and End points -- pair of points for which a Geodesic is calculated, must be in TriangleMesh coordinates:. -
m_kStartSurface
private WildMagic.LibGraphics.SceneGraph.TriMesh m_kStartSurfaceTriMesh containing the start point on the new line segment -
m_kSurface
private WildMagic.LibGraphics.SceneGraph.TriMesh m_kSurfaceCurrent TriMesh surface -
m_kSurfaceBackup
private WildMagic.LibGraphics.SceneGraph.TriMesh m_kSurfaceBackupBackup surface. -
m_iNumRemoved
private int m_iNumRemovedNumber of triangles removed during a cut mesh operation. -
m_iNumNotRemoved
private int m_iNumNotRemovedNumber of triangles not removed during a cut mesh operation.
-
-
Constructor Details
-
Geodesic_WM
public Geodesic_WM()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_WM
public Geodesic_WM(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, float fRadius) Instantiation 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 TriMesh.- Parameters:
kMesh- TriMesh surfacefRadius- float marker sphere radiuskPickCanvas- PickCanvaskGeodesicGroup- Group
-
-
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 smoothes and stores the shortest path.- Returns:
- true on successful path creation.
-
createPath
public boolean createPath(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, 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(WildMagic.LibGraphics.SceneGraph.TriMesh kParent, WildMagic.LibGraphics.SceneGraph.TriMesh kWorking, 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(WildMagic.LibGraphics.SceneGraph.TriMesh kParent, 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(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, 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, WildMagic.LibFoundation.Mathematics.Vector3f kPoint) Access to the i-th point on the Geodesic curve. All points on the geodesic curve lie on the triangle mesh.- Parameters:
iPoint- i-th point indexkPoint- Vector3f point's coordinate
-
getPathPoints
public void getPathPoints(WildMagic.LibFoundation.Mathematics.Vector3f[] akPoints) Access to the all the points on the Geodesic curve. All points on the geodesic curve lie on the triangle mesh.- Parameters:
akPoints- Vector3f[] points coordinates array
-
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(WildMagic.LibFoundation.Mathematics.Vector3f 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.
-
setPanel
Access to the JPanelGeodesic interface object.- Parameters:
kPanel- JPanelGeodesic geodesic panel
-
setPickedPoint
public void setPickedPoint(WildMagic.LibGraphics.Collision.PickRecord kPickPoint, WildMagic.LibGraphics.SceneGraph.TriMesh kMesh) -
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(WildMagic.LibFoundation.Mathematics.Vector3f 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.
-
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(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, WildMagic.LibFoundation.Mathematics.Vector3f kPoint, int[] aiTriIndex, WildMagic.LibFoundation.Mathematics.Vector3f kNormal, WildMagic.LibFoundation.Mathematics.Vector3f kTexCoord, WildMagic.LibFoundation.Mathematics.ColorRGBA 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- TriMesh surfacekPoint- Vector3faiTriIndex- 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.
-
containsVector
private int containsVector(LinkedList<WildMagic.LibFoundation.Mathematics.Vector3f> kVecList, WildMagic.LibFoundation.Mathematics.Vector3f kNewTri) Return index of the Vector3f in the list.- Parameters:
kVecList- list of Vector3fkNewTri- Vector3f- Returns:
- index of the Vector in the list, -1 if it is not in the list.
-
createEdgeLists
private boolean createEdgeLists(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh) Create the edges list from the given surface triangle mesh.- Parameters:
kMesh- surface- Returns:
- boolean success or not
-
createNewMesh
private WildMagic.LibGraphics.SceneGraph.TriMesh createNewMesh(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, int iVertexCount, int iOldVertexCount) creates a new mesh after triangulation or when a mesh is cut along the geodesic.- Parameters:
kMesh- TriMesh surfaceiVertexCount- int new vertex countiOldVertexCount- int old vertex cunt- Returns:
- TriMesh surface
-
distance
private float distance(WildMagic.LibFoundation.Mathematics.Vector3f kPoint1, WildMagic.LibFoundation.Mathematics.Vector3f kPoint2) Calculate the Euclidean distance between two points.- Parameters:
kPoint1- Point3f starting pointkPoint2- Point3f ending point- Returns:
- float distance
-
drawDijkstraEuclidianPoint
private void drawDijkstraEuclidianPoint(WildMagic.LibGraphics.SceneGraph.TriMesh kParent, WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.ColorRGB 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(WildMagic.LibGraphics.SceneGraph.TriMesh kParent, WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.ColorRGB 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(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.ColorRGB 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(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, WildMagic.LibFoundation.Mathematics.Vector3f kStart, int iMiddle, int iSide, WildMagic.LibFoundation.Mathematics.Vector3f kEnd, WildMagic.LibFoundation.Mathematics.Vector4f 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
private int findNewMeshes(WildMagic.LibGraphics.SceneGraph.TriMesh kSourceMesh, LinkedList kGeodesic_Closed_Loops) Used in cutting closed paths and creating new meshes to export to the scene graph.- Parameters:
kSourceMesh- TriMesh 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
-
getColor
private WildMagic.LibFoundation.Mathematics.ColorRGBA getColor(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, int iIndex1, int iIndex2) Get the the triangle color from the given triangle index.- Parameters:
kMesh- TriMesh surface meshiIndex1- int triangle point index 1iIndex2- int triangle point index 2- Returns:
- interpolated color the triangle
-
getColor
private WildMagic.LibFoundation.Mathematics.ColorRGBA getColor(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, int[] aiIndex) 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- TriMesh surface meshaiIndex- int[] 3 triangle points- Returns:
- Color4f Average color of the triangle.
-
getNormal
private WildMagic.LibFoundation.Mathematics.Vector3f getNormal(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, int iIndex1, int iIndex2) Get the the triangle normal from the given triangle index.- Parameters:
kMesh- TriMesh surface meshiIndex1- int triangle point index 1iIndex2- int triangle point index 2- Returns:
- Vector3f normal of the triangle
-
getNormal
private WildMagic.LibFoundation.Mathematics.Vector3f getNormal(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, int[] aiIndex) 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- TriMesh surface meshaiIndex- int[] 3 triangle points- Returns:
- Vector3f Average normal of 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
-
getTexCoord
private WildMagic.LibFoundation.Mathematics.Vector3f getTexCoord(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, int iIndex1, int iIndex2) Get the the triangle texture coordinate from the given triangle index.- Parameters:
kMesh- TriMesh surface meshiIndex1- int triangle point index 1iIndex2- int triangle point index 2- Returns:
- interpolated texture coordinate the triangle
-
getTexCoord
private WildMagic.LibFoundation.Mathematics.Vector3f getTexCoord(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, int[] aiIndex) 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- TriMesh surface meshaiIndex- int[] 3 triangle points- Returns:
- Texture3f Average texture coordinate of the triangle.
-
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
private boolean onRight(WildMagic.LibGraphics.SceneGraph.TriMesh 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.- Parameters:
kMesh- TriMesh 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(WildMagic.LibGraphics.SceneGraph.TriMesh kSourceMesh) creating new meshes to export to the scene graph. -
relaxEdges
private void relaxEdges(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, 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
private void setEndSurface(WildMagic.LibGraphics.SceneGraph.TriMesh 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.- Parameters:
kMesh- TriMesh surface mesh
-
setPreviousStartPoint
private void setPreviousStartPoint(WildMagic.LibFoundation.Mathematics.Vector3f 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
private void setStartSurface(WildMagic.LibGraphics.SceneGraph.TriMesh 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.- Parameters:
kMesh- surface mesh
-
setSurface
private void setSurface(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh) Access function to set the triangle mesh that the geodesic curve is calculated on.- Parameters:
kMesh- the new triangle mesh
-
smoothPath
private int smoothPath(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, int iNode, LinkedList<Integer> kLeft, LinkedList<Integer> kMiddle, LinkedList<Integer> kRight, LinkedList<Integer> kLeftTemp, LinkedList<Integer> kRightTemp, LinkedList<WildMagic.LibFoundation.Mathematics.Vector4f> 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(WildMagic.LibFoundation.Mathematics.Vector3f aiAddTri, WildMagic.LibGraphics.SceneGraph.VertexBuffer kVBuffer) 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 vertices
-
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- first triangle indice 0i1- first triangle indice 1i2- first triangle indice 2iP0- second triangle indice 0iP1- second triangle indice 1iP2- second triangle indice 2- Returns:
- boolean true equal, false not
-
triangleExists
private boolean triangleExists(WildMagic.LibFoundation.Mathematics.Vector3f 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(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, LinkedList kPath, LinkedList kLeftPath, LinkedList kRightPath, int iVertexCount) triangulates the mesh along a single geodesic.- Parameters:
kMesh- TriMesh 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(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, LinkedList<WildMagic.LibFoundation.Mathematics.Vector4f> kPath, int iVertexCount, boolean bOpen, LinkedList<Integer> 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- TriMesh 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
-