Пример #1
0
        public bool SetBarArray(MeshBarArray BarArray)
        {
            CadId = BarArray.ECadId;
            System.Diagnostics.Debug.Assert(CadId != 0);
            MeshId = BarArray.Id;
            System.Diagnostics.Debug.Assert(MeshId != 0);
            Type = CadElementType.Edge;

            ElemPtCount = 2;
            ElemCount   = (uint)BarArray.Bars.Count;
            Indexs      = new uint[ElemCount * ElemPtCount];
            for (uint ielem = 0; ielem < ElemCount; ielem++)
            {
                for (uint ipoel = 0; ipoel < ElemPtCount; ipoel++)
                {
                    Indexs[ielem * ElemPtCount + ipoel] = BarArray.Bars[(int)ielem].V[ipoel];
                }
            }

            Color[0] = 0.0f;
            Color[1] = 0.0f;
            Color[2] = 0.0f;

            return(true);
        }
Пример #2
0
        public Mesher2DDrawPart(MeshBarArray barArray)
        {
            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 = barArray.ECadId;

            MeshId = barArray.Id;
            System.Diagnostics.Debug.Assert(MeshId != 0);
            Type = ElementType.Line;

            ElemCount  = (uint)barArray.Bars.Count;
            ElemIndexs = new int[ElemCount * 2];
            for (int ibar = 0; ibar < ElemCount; ibar++)
            {
                ElemIndexs[ibar * 2 + 0] = (int)barArray.Bars[ibar].V[0];
                ElemIndexs[ibar * 2 + 1] = (int)barArray.Bars[ibar].V[1];
            }
        }