public MorseVertice ComputeMorseVertice(TriMesh mesh, double[] function) { EnumMorseVertexType[] morseType = ComputeMorse(mesh, function); MorseVertice morseVertice = new MorseVertice(); for (int i = 0; i < morseType.Length; i++) { switch (morseType[i]) { case EnumMorseVertexType.Saddle: morseVertice.SaddleList.Add(mesh.Vertices[i]); break; case EnumMorseVertexType.Maxium: morseVertice.MaxList.Add(mesh.Vertices[i]); break; case EnumMorseVertexType.Minum: morseVertice.MinList.Add(mesh.Vertices[i]); break; } } return(morseVertice); }
public MorseComplex(TriMesh mesh) { this.mesh = mesh; morseVertice = RetrieveMorseVertice(mesh); }
private void Init() { TriMeshModify.RepairSimpleHoles(this.mesh); AdjustFunction(mesh, ref function); morseType = ComputeMorse(mesh, function); morseVertice = ComputeMorseVertice(morseType); }
public string BuildMorseTheory(TriMesh mesh, double[] function) { morseVertice = ComputeMorseVertice(mesh, function); string morseinfo = " Vertices - Edges + Faces= "; morseinfo += TriMeshUtil.CountEulerCharacteristic(mesh) + "\r\n"; morseinfo += " Saddle: " + morseVertice.SaddleList.Count + "\r\n"; morseinfo += " Maxima: " + morseVertice.MaxList.Count + "\r\n"; morseinfo += " Minima: " + morseVertice.MinList.Count + "\r\n"; morseinfo += " Minima - Saddle + Maxima = "; morseinfo += morseVertice.MinList.Count - morseVertice.SaddleList.Count + morseVertice.MaxList.Count + "\r\n"; return(morseinfo); }
public void DrawSaddleToMax(TriMesh mesh, double[] function) { MorseVertice morseVertice = ComputeMorseVertice(mesh, function); foreach (TriMesh.Vertex saddle in morseVertice.SaddleList) { foreach (TriMesh.HalfEdge[] path in FindPath(saddle, true)) { foreach (TriMesh.HalfEdge hf in path) { hf.Edge.Traits.SelectedFlag = 1; hf.Edge.Traits.Color = Color4.Purple; } } } }
public MorseVertice ComputeMorseVertice(EnumMorseVertexType[] morseType) { MorseVertice morseVertice = new MorseVertice(); for (int i = 0; i < morseType.Length; i++) { switch (morseType[i]) { case EnumMorseVertexType.Saddle: morseVertice.SaddleList.Add(mesh.Vertices[i]); break; case EnumMorseVertexType.Maxium: morseVertice.MaxList.Add(mesh.Vertices[i]); break; case EnumMorseVertexType.Minum: morseVertice.MinList.Add(mesh.Vertices[i]); break; } } return(morseVertice); }
public MorseVertice RetrieveMorseVertice(TriMesh mesh) { MorseVertice morse = new MorseVertice(); foreach (TriMesh.Vertex v in mesh.Vertices) { if (v.Traits.SelectedFlag == 1) { morse.MinList.Add(v); } if (v.Traits.SelectedFlag == 2) { morse.MaxList .Add(v); } if (v.Traits.SelectedFlag >=3) { morse.SaddleList.Add(v); } } return morse; }
public MorseVertice RetrieveMorseVertice(TriMesh mesh) { MorseVertice morse = new MorseVertice(); foreach (TriMesh.Vertex v in mesh.Vertices) { if (v.Traits.SelectedFlag == 1) { morse.MinList.Add(v); } if (v.Traits.SelectedFlag == 2) { morse.MaxList.Add(v); } if (v.Traits.SelectedFlag >= 3) { morse.SaddleList.Add(v); } } return(morse); }
public string BuildMorseTheory(TriMesh mesh, double[] function) { morseVertice = ComputeMorseVertice(mesh, function); string morseinfo = " Vertices - Edges + Faces= "; morseinfo += TriMeshUtil.CountEulerCharacteristic(mesh)+"\r\n"; morseinfo += " Saddle: " + morseVertice.SaddleList.Count+"\r\n"; morseinfo += " Maxima: " + morseVertice.MaxList.Count + "\r\n"; morseinfo += " Minima: " + morseVertice.MinList.Count + "\r\n"; morseinfo += " Minima - Saddle + Maxima = "; morseinfo += morseVertice.MinList.Count - morseVertice.SaddleList.Count + morseVertice.MaxList.Count + "\r\n"; return morseinfo; }
public MorseVertice ComputeMorseVertice(EnumMorseVertexType[] morseType) { MorseVertice morseVertice = new MorseVertice(); for (int i = 0; i < morseType.Length; i++) { switch (morseType[i]) { case EnumMorseVertexType.Saddle: morseVertice.SaddleList.Add(mesh.Vertices[i]); break; case EnumMorseVertexType.Maxium: morseVertice.MaxList.Add(mesh.Vertices[i]); break; case EnumMorseVertexType.Minum: morseVertice.MinList.Add(mesh.Vertices[i]); break; } } return morseVertice; }
public MorseVertice ComputeMorseVertice(TriMesh mesh, double[] function) { EnumMorseVertexType[] morseType = ComputeMorse(mesh,function); MorseVertice morseVertice= new MorseVertice(); for(int i=0;i<morseType.Length ;i++) { switch (morseType[i]) { case EnumMorseVertexType.Saddle: morseVertice.SaddleList.Add(mesh.Vertices[i]); break; case EnumMorseVertexType.Maxium: morseVertice.MaxList.Add(mesh.Vertices[i]); break; case EnumMorseVertexType.Minum: morseVertice.MinList.Add(mesh.Vertices[i]); break; } } return morseVertice; }
private void Init() { TriMeshModify.RepairSimpleHoles(this.mesh); AdjustFunction(mesh,ref function); morseType=ComputeMorse(mesh, function); morseVertice = ComputeMorseVertice(morseType); }