public bool SetTriArray(MeshTriArray2D triArray) { CadId = triArray.LCadId; System.Diagnostics.Debug.Assert(CadId != 0); MeshId = triArray.Id; System.Diagnostics.Debug.Assert(MeshId != 0); Type = CadElementType.Loop; ElemPtCount = 3; ElemCount = (uint)triArray.Tris.Count; Indexs = new uint[ElemCount * ElemPtCount]; for (uint ielem = 0; ielem < ElemCount; ielem++) { for (uint ipoel = 0; ipoel < ElemPtCount; ipoel++) { Indexs[ielem * ElemPtCount + ipoel] = triArray.Tris[(int)ielem].V[ipoel]; } } /* * Color[0] = 0.8f; * Color[1] = 0.8f; * Color[2] = 0.8f; */ Color[0] = 0.2f; Color[1] = 0.2f; Color[2] = 0.2f; return(true); }
public Mesher2DDrawPart(MeshTriArray2D triArray) { IsSelected = false; IsShown = true; Color[0] = 0.8; Color[1] = 0.8; Color[2] = 0.8; LineWidth = 1; Height = 0; ElemIndexs = null; EdgeIndexs = null; CadId = triArray.LCadId; MeshId = triArray.Id; System.Diagnostics.Debug.Assert(MeshId != 0); Type = ElementType.Tri; ElemCount = (uint)triArray.Tris.Count; { // 面のセット ElemIndexs = new int[ElemCount * 3]; for (int itri = 0; itri < ElemCount; itri++) { ElemIndexs[itri * 3 + 0] = (int)triArray.Tris[itri].V[0]; ElemIndexs[itri * 3 + 1] = (int)triArray.Tris[itri].V[1]; ElemIndexs[itri * 3 + 2] = (int)triArray.Tris[itri].V[2]; } } { // 辺のセット EdgeCount = ElemCount * 3; EdgeIndexs = new int[EdgeCount * 2]; for (int itri = 0; itri < ElemCount; itri++) { EdgeIndexs[(itri * 3) * 2 + 0] = (int)triArray.Tris[itri].V[0]; EdgeIndexs[(itri * 3) * 2 + 1] = (int)triArray.Tris[itri].V[1]; EdgeIndexs[(itri * 3 + 1) * 2 + 0] = (int)triArray.Tris[itri].V[1]; EdgeIndexs[(itri * 3 + 1) * 2 + 1] = (int)triArray.Tris[itri].V[2]; EdgeIndexs[(itri * 3 + 2) * 2 + 0] = (int)triArray.Tris[itri].V[2]; EdgeIndexs[(itri * 3 + 2) * 2 + 1] = (int)triArray.Tris[itri].V[0]; } } }