Ejemplo n.º 1
0
 public void SetParameter(IMultiPolygon sSection, IMultiPolygon eSection, IPolyline polyline)
 {
     try
     {
         base._cullModel = gviCullFaceMode.gviCullNone;
         this.SetColorRender(new uint[] { uint.MaxValue, uint.MaxValue, uint.MaxValue, uint.MaxValue });
         if ((sSection != null) && (eSection != null))
         {
             IPolygon geometry = sSection.GetGeometry(0) as IPolygon;
             if (geometry != null)
             {
                 if (geometry.QueryNormal().Z < 0.0)
                 {
                     GeometryTool.ReversePolygon(ref geometry);
                 }
                 this._pillarSection = new PillarSection(geometry);
                 DrawGeometry.GetPolylineVtxs(polyline, ref this._x, ref this._y, ref this._z, ref this._route);
             }
         }
     }
     catch (Exception exception)
     {
         SystemLog.Instance.Log(exception.StackTrace);
     }
 }
Ejemplo n.º 2
0
        // Polyline类型  FX 2014.04.08
        public void SetParameter1(IGeometry geometry, double hTop, double hBottom)
        {
            base._hTop    = hTop;
            base._hBottom = hBottom;
            base._minX    = 999999.9;
            base._maxX    = -999999.9;
            base._minY    = 999999.9;
            base._maxY    = -999999.9;
            try
            {
                IPolygon polygon;
                base._z     = hTop;
                this._depth = base._hTop - base._hBottom;
                switch (geometry.GeometryType)
                {
                case gviGeometryType.gviGeometryPoint:
                {
                    IPoint point = geometry as IPoint;
                    base._x = point.X;
                    base._y = point.Y;
                    DrawGeometry.GetRoundVtxs(point, 1.0, 0x18, ref this._vtx, ref this._minX, ref this._maxX, ref this._minY, ref this._maxY);
                    break;
                }

                case gviGeometryType.gviGeometryPolyline:
                    goto Label_00CD;
                }
                return;

Label_00CD:
                // 将polyline转化为polygon
                IPolyline polyline = geometry as IPolyline;
                if (polyline.PointCount < 4)
                {
                    return;
                }
                polygon = geoFactory.CreateGeometry(gviGeometryType.gviGeometryPolygon, gviVertexAttribute.gviVertexAttributeZ) as IPolygon;
                if (polygon != null)
                {
                    for (int i = 0; i < polyline.PointCount; i++)
                    {
                        IPoint point = polyline.GetPoint(i);
                        polygon.ExteriorRing.AppendPoint(point);
                    }
                }
                if (!polygon.IsClosed)
                {
                    polygon.Close();
                }
                if (polygon.QueryNormal().Z > 0.0)
                {
                    ReversePolygon(ref polygon);
                }
                DrawGeometry.GetPolygonVtxs(polygon, ref this._x, ref this._y, ref this._vtx, ref this._minX, ref this._maxX, ref this._minY, ref this._maxY);
            }
            catch (Exception exception)
            {
            }
        }
Ejemplo n.º 3
0
        //public override bool Draw(out IModelPoint mp, out IModel fmodel, out IModel smodel)
        //{
        //    int[] index = null;
        //    base.Draw(out mp, out fmodel, out smodel);
        //    try
        //    {
        //        IDrawGroup group;
        //        if ((base._vtx.Length == 4) && (base._sections.Length == 4))
        //        {
        //            index = new int[] { 0, 1, 2, 3 };
        //            if (!PipeSection.SetConnectIndex(base._sections, base._vtx, out index))
        //            {
        //                return false;
        //            }
        //            if (!DrawGeometry.Compare(base._vtx[index[0]][0], base._vtx[index[1]][0], false))
        //            {
        //                return false;
        //            }
        //            object renderInfo = (base._renderType == RenderType.Texture) ? ((object)base._tcNames) : ((object)base._colors);
        //            int[] numArray2 = new int[3];
        //            numArray2[1] = 1;
        //            numArray2[2] = 2;
        //            if (base.NewEmptyModel(numArray2, base._renderType, renderInfo, out fmodel))
        //            {
        //                int[] numArray3 = new int[1];
        //                if (base.NewEmptyModel(numArray3, base._renderType, renderInfo, out smodel))
        //                {
        //                    goto Label_00DF;
        //                }
        //            }
        //        }
        //        return false;
        //    Label_00DF:
        //        group = null;
        //        group = fmodel.GetGroup(0);
        //        IDrawPrimitive primitive = group.GetPrimitive(0);
        //        group.GetPrimitive(1);
        //        group.GetPrimitive(2);
        //        IDrawPrimitive primitive2 = smodel.GetGroup(0).GetPrimitive(0);
        //        base.DrawConBetween(new Vector[][] { base._vtx[index[0]], base._vtx[index[1]] }, new IPipeSection[] { base._sections[index[0]], base._sections[index[1]] }, ref fmodel);
        //        base.DrawConSingle(base._vtx[index[2]], base._sections[index[2]], ref fmodel);
        //        base.DrawConSingle(base._vtx[index[3]], base._sections[index[3]], ref fmodel);
        //        primitive2.Material.CullMode = gviCullFaceMode.gviCullNone;
        //        primitive2.VertexArray = primitive.VertexArray;
        //        primitive2.NormalArray = primitive.NormalArray;
        //        primitive2.TexcoordArray = primitive.TexcoordArray;
        //        primitive2.IndexArray = primitive.IndexArray;
        //        return true;
        //    }
        //    catch (Exception exception)
        //    {
        //        SystemLog.Instance.Log(exception.StackTrace);
        //        return false;
        //    }
        //}
        #endregion

        #region 单壁绘制--冯欣修改20131101
        public override bool Draw(out IModelPoint mp, out IModel fmodel, out IModel smodel)
        {
            int[] index = null;
            base.Draw(out mp, out fmodel, out smodel);
            try
            {
                IDrawGroup group;
                if ((base._vtx.Length == 4) && (base._sections.Length == 4))
                {
                    index = new int[] { 0, 1, 2, 3 };
                    if (!PipeSection.SetConnectIndex(base._sections, base._vtx, out index))
                    {
                        return(false);
                    }
                    if (!DrawGeometry.Compare(base._vtx[index[0]][0], base._vtx[index[1]][0], false))
                    {
                        return(false);
                    }
                    object renderInfo = (base._renderType == RenderType.Texture) ? ((object)base._tcNames) : ((object)base._colors);
                    int[]  numArray2  = new int[1];
                    if (base.NewEmptyModel(numArray2, base._renderType, renderInfo, out fmodel))
                    {
                        int[] numArray3 = new int[1];
                        if (base.NewEmptyModel(numArray3, base._renderType, renderInfo, out smodel))
                        {
                            goto Label_00DF;
                        }
                    }
                }
                return(false);

Label_00DF:
                group = null;
                group = fmodel.GetGroup(0);
                IDrawPrimitive primitive  = group.GetPrimitive(0);
                IDrawPrimitive primitive2 = smodel.GetGroup(0).GetPrimitive(0);
                base.DrawConBetween(new Vector[][] { base._vtx[index[0]], base._vtx[index[1]] }, new IPipeSection[] { base._sections[index[0]], base._sections[index[1]] }, ref fmodel);
                base.DrawConSingle(base._vtx[index[2]], base._sections[index[2]], ref fmodel);
                base.DrawConSingle(base._vtx[index[3]], base._sections[index[3]], ref fmodel);
                primitive2.Material.CullMode = gviCullFaceMode.gviCullNone;
                primitive2.VertexArray       = primitive.VertexArray;
                primitive2.NormalArray       = primitive.NormalArray;
                primitive2.TexcoordArray     = primitive.TexcoordArray;
                primitive2.IndexArray        = primitive.IndexArray;
                return(true);
            }
            catch (Exception exception)
            {
                return(false);
            }
        }
Ejemplo n.º 4
0
        // Polygon类型
        public void SetParameter(IGeometry geometry, double hTop, double hBottom)
        {
            base._hTop    = hTop;
            base._hBottom = hBottom;
            base._minX    = 999999.9;
            base._maxX    = -999999.9;
            base._minY    = 999999.9;
            base._maxY    = -999999.9;
            try
            {
                IPolygon polygon;
                base._z     = hTop;
                this._depth = base._hTop - base._hBottom;
                switch (geometry.GeometryType)
                {
                case gviGeometryType.gviGeometryPoint:
                {
                    IPoint point = geometry as IPoint;
                    base._x = point.X;
                    base._y = point.Y;
                    DrawGeometry.GetRoundVtxs(point, 1.0, 0x18, ref this._vtx, ref this._minX, ref this._maxX, ref this._minY, ref this._maxY);
                    break;
                }

                case gviGeometryType.gviGeometryPolygon:
                    goto Label_00CD;
                }
                return;

Label_00CD:
                polygon = geometry as IPolygon;
                if (polygon != null)
                {
                    if (polygon.QueryNormal().Z > 0.0)
                    {
                        ReversePolygon(ref polygon);
                    }
                    DrawGeometry.GetPolygonVtxs(polygon, ref this._x, ref this._y, ref this._vtx, ref this._minX, ref this._maxX, ref this._minY, ref this._maxY);
                }
            }
            catch (Exception exception)
            {
            }
        }
Ejemplo n.º 5
0
        public static bool ConvertBuildingParam(IPolygon footprint, double startZ, double height, out IMultiPolygon segPolygon, out IPolyline route)
        {
            segPolygon = null;
            route      = null;
            IPoint    point      = null;
            IPoint    pointValue = null;
            IEnvelope envelope   = null;
            IPolygon  polygon    = null;

            if (footprint == null)
            {
                return(false);
            }
            try
            {
                envelope   = footprint.Envelope;
                segPolygon = DrawGeometry.geoFactory.CreateGeometry(gviGeometryType.gviGeometryMultiPolygon, gviVertexAttribute.gviVertexAttributeZ) as IMultiPolygon;
                route      = DrawGeometry.geoFactory.CreateGeometry(gviGeometryType.gviGeometryPolyline, gviVertexAttribute.gviVertexAttributeZ) as IPolyline;
                point      = DrawGeometry.geoFactory.CreatePoint(gviVertexAttribute.gviVertexAttributeZ);
                point.SetCoords(envelope.Center.X, envelope.Center.Y, 0.0, 0.0, 0);
                pointValue   = point.Clone() as IPoint;
                pointValue.Z = startZ;
                route.AppendPoint(pointValue);
                pointValue   = point.Clone() as IPoint;
                pointValue.Z = startZ + height;
                route.AppendPoint(pointValue);
                int pointCount = footprint.ExteriorRing.PointCount;
                polygon = DrawGeometry.geoFactory.CreateGeometry(gviGeometryType.gviGeometryPolygon, gviVertexAttribute.gviVertexAttributeZ) as IPolygon;
                for (int i = 0; i < pointCount; i++)
                {
                    pointValue    = footprint.ExteriorRing.GetPoint(i).Clone() as IPoint;
                    pointValue.X -= point.X;
                    pointValue.Y -= point.Y;
                    polygon.ExteriorRing.AppendPoint(pointValue);
                }
                segPolygon.AddPolygon(polygon);
                return(true);
            }
            catch (Exception exception)
            {
                DrawGeometry.WriteLog(exception.StackTrace);
                return(false);
            }
        }
Ejemplo n.º 6
0
 public void SetParameter(IPipeSection pipeSection, IPolyline polyline, int flowDir)
 {
     try
     {
         this._pipeSection = pipeSection;
         base._cullModel   = gviCullFaceMode.gviCullNone;
         DrawGeometry.GetPolylineVtxs(polyline, ref this._x, ref this._y, ref this._z, ref this._route);
         this._flowDir = flowDir;
         if (this._flowDir == 1)
         {
             List <Vector> list = new List <Vector>();
             for (int i = this._route.Count - 1; i >= 0; i--)
             {
                 list.Add(this._route[i]);
             }
             this._route = list;
         }
     }
     catch (Exception exception)
     {
     }
 }
Ejemplo n.º 7
0
 public void SetParameter(IPoint position, double hTop, double hBottom, double maxDia)
 {
     base._hTop    = hTop;
     base._hBottom = hBottom;
     base._minX    = 999999.9;
     base._maxX    = -999999.9;
     base._minY    = 999999.9;
     base._maxY    = -999999.9;
     try
     {
         base._x       = position.X;
         base._y       = position.Y;
         base._z       = hTop;
         this._maxDia  = maxDia;
         this._depth   = base._hTop - base._hBottom;
         this._rBottom = this.GetWellDia(this._maxDia);
         DrawGeometry.GetRoundVtxs(position, this._rBottom, 0x18, ref this._vtxsBottom);
         DrawGeometry.GetRoundVtxs(position, 1.0, 0x18, ref this._vtx, ref this._minX, ref this._maxX, ref this._minY, ref this._maxY);
     }
     catch (Exception exception)
     {
     }
 }
Ejemplo n.º 8
0
        public override bool Draw(out IModelPoint mp, out IModel fmodel, out IModel smodel)
        {
            int            index      = -1;
            IDrawPrimitive primitive  = null;
            IDoubleArray   vArray     = null;
            IUInt16Array   indexArray = null;
            IFloatArray    array3     = null;
            IDoubleArray   norms      = null;

            base.Draw(out mp, out fmodel, out smodel);
            try
            {
                object renderInfo = (base._renderType == RenderType.Texture) ? ((object)base._tcNames) : ((object)base._colors);
                int[]  numArray   = new int[2];
                numArray[1] = 1;
                if (!base.NewEmptyModel(numArray, base._renderType, renderInfo, out fmodel))
                {
                    return(false);
                }
                primitive = fmodel.GetGroup(0).GetPrimitive(0);
                if (DrawGeometry.ConvertPolygon(base._vtx, 0.0, 0, out vArray, out indexArray, out array3, out norms))
                {
                    for (index = 0; index < vArray.Length; index++)
                    {
                        primitive.VertexArray.Append((float)vArray.Array[index]);
                    }
                    for (index = 0; index < indexArray.Length; index++)
                    {
                        primitive.IndexArray.Append(indexArray.Array[index]);
                    }
                    double naN = double.NaN;
                    double ty  = double.NaN;
                    for (index = 0; index < (vArray.Length / 3); index++)
                    {
                        base.GetTexcoord(vArray.Array[index * 3], vArray.Array[(index * 3) + 1], out naN, out ty);
                        primitive.TexcoordArray.Append((float)naN);
                        primitive.TexcoordArray.Append((float)ty);
                    }
                    for (index = 0; index < norms.Length; index++)
                    {
                        primitive.NormalArray.Append((float)norms.Array[index]);
                    }
                }
                primitive = fmodel.GetGroup(0).GetPrimitive(1);
                if (DrawGeometry.ConvertPolygon(base._vtx, -this._depth, 1, out vArray, out indexArray, out array3, out norms))
                {
                    for (index = 0; index < vArray.Length; index++)
                    {
                        primitive.VertexArray.Append((float)vArray.Array[index]);
                    }
                    for (index = 0; index < indexArray.Length; index++)
                    {
                        primitive.IndexArray.Append(indexArray.Array[index]);
                    }
                    for (index = 0; index < (vArray.Length / 3); index++)
                    {
                        float num2 = (float)vArray.Array[index * 3];
                        primitive.TexcoordArray.Append(num2);
                        num2 = (float)vArray.Array[(index * 3) + 1];
                        primitive.TexcoordArray.Append(num2);
                    }
                    for (index = 0; index < norms.Length; index++)
                    {
                        primitive.NormalArray.Append((float)norms.Array[index]);
                    }
                }
                int           num5 = base._vtx.Length / 2;
                List <ushort> list = new List <ushort>();
                for (index = 0; index < num5; index++)
                {
                    primitive.VertexArray.Append((float)base._vtx[index * 2]);
                    primitive.VertexArray.Append((float)base._vtx[(index * 2) + 1]);
                    primitive.VertexArray.Append(0f);
                    list.Add((ushort)((primitive.VertexArray.Length / 3) - 1));
                    primitive.VertexArray.Append((float)base._vtx[index * 2]);
                    primitive.VertexArray.Append((float)base._vtx[(index * 2) + 1]);
                    primitive.VertexArray.Append(-((float)this._depth));
                    list.Add((ushort)((primitive.VertexArray.Length / 3) - 1));
                    primitive.TexcoordArray.Append((index * 4f) / ((float)(num5 - 1)));
                    primitive.TexcoordArray.Append(0f);
                    primitive.TexcoordArray.Append((index * 4f) / ((float)(num5 - 1)));
                    primitive.TexcoordArray.Append((float)this._depth);
                    primitive.NormalArray.Append((float)Math.Sin((6.2831853071795862 * index) / 24.0));
                    primitive.NormalArray.Append((float)Math.Cos((6.2831853071795862 * index) / 24.0));
                    primitive.NormalArray.Append(0f);
                    primitive.NormalArray.Append((float)Math.Sin((6.2831853071795862 * index) / 24.0));
                    primitive.NormalArray.Append((float)Math.Cos((6.2831853071795862 * index) / 24.0));
                    primitive.NormalArray.Append(0f);
                }
                for (index = 0; index < (num5 - 1); index++)
                {
                    primitive.IndexArray.Append(list[index * 2]);
                    primitive.IndexArray.Append(list[((index + 1) * 2) + 1]);
                    primitive.IndexArray.Append(list[(index * 2) + 1]);
                    primitive.IndexArray.Append(list[index * 2]);
                    primitive.IndexArray.Append(list[(index + 1) * 2]);
                    primitive.IndexArray.Append(list[((index + 1) * 2) + 1]);
                }
                return(true);
            }
            catch (Exception exception)
            {
                return(false);
            }
        }
Ejemplo n.º 9
0
        public override bool Draw(out IModelPoint mp, out IModel fmodel, out IModel smodel)
        {
            base.Draw(out mp, out fmodel, out smodel);
            try
            {
                if (base._vtx == null)
                {
                    return(false);
                }
                if ((base._vtx.Length != 1) && (base._vtx.Length != 2))
                {
                    return(false);
                }
                object renderInfo = (base._renderType == RenderType.Texture) ? ((object)base._tcNames) : ((object)base._colors);
                //int[] index = new int[3];
                //index[1] = 1;
                //index[2] = 2;
                int[] index = new int[2];
                index[1] = 1;
                if (!base.NewEmptyModel(index, base._renderType, renderInfo, out fmodel))
                {
                    return(false);
                }
                IDrawGroup group = null;
                group = fmodel.GetGroup(0);
                IDrawPrimitive primitive = group.GetPrimitive(0);
                group.GetPrimitive(1);
                group.GetPrimitive(2);
                if (base._vtx.Length == 1)
                {
                    // 生成类似断头的管线20161111
                    IPipeSection[] dSections = new IPipeSection[] { base._sections[0], DrawGeometry.DefaultSection(base._sections[0].SecShape) };
                    base.DrawConSingle1(base._vtx[0], base._sections[0], ref fmodel);

                    // 原代码
                    //Vector[][] dVtxs = new Vector[][] { base._vtx[0], new Vector[] { base._vtx[0][0], new Vector(base._vtx[0][0].X, base._vtx[0][0].Y, 0.0) } };
                    //IPipeSection[] dSections = new IPipeSection[] { base._sections[0], DrawGeometry.DefaultSection(base._sections[0].SecShape) };
                    //base.DrawConBetween(dVtxs, dSections, ref fmodel);
                }
                else
                {
                    base.DrawConBetween(new Vector[][] { base._vtx[0], base._vtx[1] }, new IPipeSection[] { base._sections[0], base._sections[1] }, ref fmodel);
                    Vector[] dVtx = new Vector[] { base._vtx[0][0], new Vector(base._vtx[0][0].X, base._vtx[0][0].Y, 0.0) };
                    base.DrawConSingle(dVtx, DrawGeometry.DefaultSection(base._sections[0].SecShape), ref fmodel);
                }
                IDrawGroup drawGroup = null;
                if (this._bfModel.GroupCount > 0)
                {
                    for (int i = 0; i < this._bfModel.GroupCount; i++)
                    {
                        drawGroup = this._bfModel.GetGroup(i);
                        fmodel.AddGroup(drawGroup);
                    }
                }
                if (this._bsModel != null)
                {
                    int[] numArray2 = new int[1];
                    base.NewEmptyModel(numArray2, base._renderType, renderInfo, out smodel);
                    IDrawPrimitive primitive2 = smodel.GetGroup(0).GetPrimitive(0);
                    primitive2.Material.CullMode = gviCullFaceMode.gviCullNone;
                    primitive2.VertexArray       = primitive.VertexArray;
                    primitive2.NormalArray       = primitive.NormalArray;
                    primitive2.TexcoordArray     = primitive.TexcoordArray;
                    primitive2.IndexArray        = primitive.IndexArray;
                    if (this._bsModel.GroupCount > 0)
                    {
                        for (int j = 0; j < this._bsModel.GroupCount; j++)
                        {
                            drawGroup = this._bsModel.GetGroup(j);
                            smodel.AddGroup(drawGroup);
                        }
                    }
                }
                return(true);
            }
            catch (Exception exception)
            {
                return(false);
            }
        }
Ejemplo n.º 10
0
        //public override bool Draw(out IModelPoint mp, out IModel fmodel, out IModel smodel)
        //{
        //    Vector[] array = null;
        //    double[][] numArray = null;
        //    List<ushort> list = null;
        //    List<ushort> list2 = null;
        //    List<ushort> list3 = null;
        //    base.Draw(out mp, out fmodel, out smodel);
        //    try
        //    {
        //        int segCount;
        //        SecShape secShape;
        //        int num2;
        //        int num3;
        //        double[] numArray2;
        //        IDrawGroup group;
        //        if ((base._vtx.Length == 2) && (base._sections.Length == 2))
        //        {
        //            if (base._sections[0].SecShape != base._sections[1].SecShape)
        //            {
        //                return false;
        //            }
        //            if (!DrawGeometry.Compare(base._vtx[0][0], base._vtx[1][0], true))
        //            {
        //                return false;
        //            }
        //            segCount = base._sections[0].SegCount;
        //            secShape = base._sections[0].SecShape;
        //            list = new List<ushort>();
        //            list2 = new List<ushort>();
        //            list3 = new List<ushort>();
        //            List<Vector> vtxs = new List<Vector>();
        //            if ((base._vtx[0][0].Z - base._vtx[1][0].Z) > base._sections[0].Diameter)
        //            {
        //                for (num2 = base._vtx[0].Length - 1; num2 >= 0; num2--)
        //                {
        //                    vtxs.Add(base._vtx[0][num2]);
        //                }
        //                for (num2 = 0; num2 < base._vtx[0].Length; num2++)
        //                {
        //                    vtxs.Add(base._vtx[1][num2]);
        //                }
        //                vtxs = Maths.DisperseArc(vtxs, Math.Min(base._sections[0].Diameter, base._sections[1].Diameter));
        //            }
        //            else
        //            {
        //                num2 = base._vtx[0].Length - 1;
        //                while (num2 >= 0)
        //                {
        //                    vtxs.Add(base._vtx[0][num2]);
        //                    num2--;
        //                }
        //                for (num2 = 1; num2 < base._vtx[0].Length; num2++)
        //                {
        //                    vtxs.Add(base._vtx[1][num2]);
        //                }
        //                vtxs = Maths.DisperseArc(vtxs, Math.Min(base._sections[0].Diameter, base._sections[1].Diameter));
        //            }
        //            Vector vector7 = (base._vtx[0][base._vtx.Length - 1] - base._vtx[0][0]).UnitVector();
        //            Vector vector8 = (base._vtx[1][base._vtx.Length - 1] - base._vtx[1][0]).UnitVector();
        //            array = new Vector[vtxs.Count + 4];
        //            array[0] = vtxs[0] + ((Vector)((vector7 * base._sections[0].Diameter) / 2.0));
        //            array[1] = vtxs[0] + ((Vector)(vector7 * base._sections[0].Thick));
        //            vtxs.CopyTo(array, 2);
        //            array[array.Length - 2] = vtxs[vtxs.Count - 1] + ((Vector)(vector8 * base._sections[0].Thick));
        //            array[array.Length - 1] = vtxs[vtxs.Count - 1] + ((Vector)((vector8 * base._sections[1].Diameter) / 2.0));
        //            numArray2 = new double[array.Length];
        //            for (num2 = 0; num2 < array.Length; num2++)
        //            {
        //                if (num2 == 0)
        //                {
        //                    numArray2[num2] = 0.0;
        //                }
        //                else
        //                {
        //                    numArray2[num2] = (array[num2] - array[num2 - 1]).Length + numArray2[num2 - 1];
        //                }
        //            }
        //            double naN = double.NaN;
        //            numArray = new double[array.Length][];
        //            if (base._sections[0].Diameter != base._sections[1].Diameter)
        //            {
        //                double diameter = base._sections[0].Diameter;
        //                double num6 = base._sections[1].Diameter - base._sections[0].Diameter;
        //                for (num2 = 0; num2 < array.Length; num2++)
        //                {
        //                    switch (num2)
        //                    {
        //                        case 0:
        //                        case 1:
        //                            naN = (base._sections[0].Thick + base._sections[0].Diameter) / base._sections[0].Diameter;
        //                            numArray[num2] = base._sections[0].GetVtxs(naN, 0.0, base._sections[0].Thick);
        //                            break;

        //                        default:
        //                            if ((num2 == (array.Length - 2)) || (num2 == (array.Length - 1)))
        //                            {
        //                                naN = (base._sections[1].Thick + base._sections[1].Diameter) / base._sections[1].Diameter;
        //                                numArray[num2] = base._sections[1].GetVtxs(naN, 0.0, base._sections[1].Thick);
        //                            }
        //                            else
        //                            {
        //                                naN = (((numArray2[num2] - numArray2[2]) / (numArray2[numArray2.Length - 3] - numArray2[2])) * num6) / diameter;
        //                                numArray[num2] = base._sections[0].GetVtxs(naN + 1.0, 0.0, 0.0);
        //                            }
        //                            break;
        //                    }
        //                }
        //            }
        //            else
        //            {
        //                naN = (base._sections[0].Thick + base._sections[0].Diameter) / base._sections[0].Diameter;
        //                for (num2 = 0; num2 < array.Length; num2++)
        //                {
        //                    if (((num2 == 0) || (num2 == 1)) || ((num2 == (array.Length - 2)) || (num2 == (array.Length - 1))))
        //                    {
        //                        numArray[num2] = base._sections[0].GetVtxs(naN, 0.0, base._sections[0].Thick);
        //                    }
        //                    else
        //                    {
        //                        numArray[num2] = base._sections[0].GetVtxs();
        //                    }
        //                }
        //            }
        //            object renderInfo = (base._renderType == RenderType.Texture) ? ((object)base._tcNames) : ((object)base._colors);
        //            int[] index = new int[3];
        //            index[1] = 1;
        //            index[2] = 2;
        //            if (base.NewEmptyModel(index, base._renderType, renderInfo, out fmodel))
        //            {
        //                int[] numArray4 = new int[1];
        //                if (base.NewEmptyModel(numArray4, base._renderType, renderInfo, out smodel))
        //                {
        //                    goto Label_05D6;
        //                }
        //            }
        //        }
        //        return false;
        //    Label_05D6:
        //        group = null;
        //        group = fmodel.GetGroup(0);
        //        IDrawPrimitive primitive = group.GetPrimitive(0);
        //        IDrawPrimitive primitive2 = group.GetPrimitive(1);
        //        IDrawPrimitive primitive3 = group.GetPrimitive(2);
        //        IDrawPrimitive primitive4 = smodel.GetGroup(0).GetPrimitive(0);
        //        for (num2 = 0; num2 < array.Length; num2++)
        //        {
        //            Vector vector;
        //            Vector vector2;
        //            Vector vector3;
        //            if (num2 == (array.Length - 1))
        //            {
        //                vector = (array[num2] - array[num2 - 1]).UnitVector();
        //            }
        //            else
        //            {
        //                vector = (array[num2 + 1] - array[num2]).UnitVector();
        //            }
        //            Maths.GenerateComplementBasis(vector, out vector2, out vector3);
        //            num3 = 0;
        //            while (num3 <= segCount)
        //            {
        //                Vector vector6 = (((numArray[num2][num3 * 4] - base._sections[0].OffsetX) * vector2) + ((numArray[num2][(num3 * 4) + 1] - base._sections[0].OffsetY) * vector3)).UnitVector();
        //                Vector vector4 = array[num2] + ((Vector)((numArray[num2][num3 * 4] * vector2) + (numArray[num2][(num3 * 4) + 1] * vector3)));
        //                Vector vector5 = array[num2] + ((Vector)((numArray[num2][(num3 * 4) + 2] * vector2) + (numArray[num2][(num3 * 4) + 3] * vector3)));
        //                if ((num2 == 0) || (num2 == (array.Length - 1)))
        //                {
        //                    primitive3.VertexArray.Append((float)vector4.X);
        //                    primitive3.VertexArray.Append((float)vector4.Y);
        //                    primitive3.VertexArray.Append((float)vector4.Z);
        //                    list3.Add((ushort)((primitive3.VertexArray.Length / 3) - 1));
        //                    primitive3.VertexArray.Append((float)vector5.X);
        //                    primitive3.VertexArray.Append((float)vector5.Y);
        //                    primitive3.VertexArray.Append((float)vector5.Z);
        //                    list3.Add((ushort)((primitive3.VertexArray.Length / 3) - 1));
        //                    if (base._renderType == RenderType.Texture)
        //                    {
        //                        primitive3.TexcoordArray.Append(num2 * 0.4f);
        //                        primitive3.TexcoordArray.Append(num3 * 0.4f);
        //                        primitive3.TexcoordArray.Append(num2 * 0.6f);
        //                        primitive3.TexcoordArray.Append(num3 * 0.6f);
        //                    }
        //                    primitive3.NormalArray.Append(-((float)vector.X));
        //                    primitive3.NormalArray.Append(-((float)vector.Y));
        //                    primitive3.NormalArray.Append(-((float)vector.Z));
        //                    primitive3.NormalArray.Append((float)vector.X);
        //                    primitive3.NormalArray.Append((float)vector.Y);
        //                    primitive3.NormalArray.Append((float)vector.Z);
        //                }
        //                if (secShape == SecShape.CircleRing)
        //                {
        //                    primitive.VertexArray.Append((float)vector4.X);
        //                    primitive.VertexArray.Append((float)vector4.Y);
        //                    primitive.VertexArray.Append((float)vector4.Z);
        //                    list.Add((ushort)((primitive.VertexArray.Length / 3) - 1));
        //                    primitive2.VertexArray.Append((float)vector5.X);
        //                    primitive2.VertexArray.Append((float)vector5.Y);
        //                    primitive2.VertexArray.Append((float)vector5.Z);
        //                    list2.Add((ushort)((primitive2.VertexArray.Length / 3) - 1));
        //                    if (base._renderType == RenderType.Texture)
        //                    {
        //                        primitive.TexcoordArray.Append((float)numArray2[num2]);
        //                        primitive.TexcoordArray.Append((num3 * 8f) / ((float)segCount));
        //                        primitive2.TexcoordArray.Append((float)numArray2[num2]);
        //                        primitive2.TexcoordArray.Append((num3 * 8f) / ((float)segCount));
        //                    }
        //                    primitive.NormalArray.Append((float)vector6.X);
        //                    primitive.NormalArray.Append((float)vector6.Y);
        //                    primitive.NormalArray.Append((float)vector6.Z);
        //                    primitive2.NormalArray.Append(-((float)vector6.X));
        //                    primitive2.NormalArray.Append(-((float)vector6.Y));
        //                    primitive2.NormalArray.Append(-((float)vector6.Z));
        //                }
        //                else
        //                {
        //                    primitive.VertexArray.Append((float)vector4.X);
        //                    primitive.VertexArray.Append((float)vector4.Y);
        //                    primitive.VertexArray.Append((float)vector4.Z);
        //                    list.Add((ushort)((primitive.VertexArray.Length / 3) - 1));
        //                    primitive.VertexArray.Append((float)vector4.X);
        //                    primitive.VertexArray.Append((float)vector4.Y);
        //                    primitive.VertexArray.Append((float)vector4.Z);
        //                    list.Add((ushort)((primitive.VertexArray.Length / 3) - 1));
        //                    primitive2.VertexArray.Append((float)vector5.X);
        //                    primitive2.VertexArray.Append((float)vector5.Y);
        //                    primitive2.VertexArray.Append((float)vector5.Z);
        //                    list2.Add((ushort)((primitive2.VertexArray.Length / 3) - 1));
        //                    primitive2.VertexArray.Append((float)vector5.X);
        //                    primitive2.VertexArray.Append((float)vector5.Y);
        //                    primitive2.VertexArray.Append((float)vector5.Z);
        //                    list2.Add((ushort)((primitive2.VertexArray.Length / 3) - 1));
        //                    if (base._renderType == RenderType.Texture)
        //                    {
        //                        primitive.TexcoordArray.Append((float)numArray2[num2]);
        //                        primitive.TexcoordArray.Append((num3 * 8f) / ((float)segCount));
        //                        primitive.TexcoordArray.Append((float)numArray2[num2]);
        //                        primitive.TexcoordArray.Append((num3 * 8f) / ((float)segCount));
        //                        primitive2.TexcoordArray.Append((float)numArray2[num2]);
        //                        primitive2.TexcoordArray.Append((num3 * 8f) / ((float)segCount));
        //                        primitive2.TexcoordArray.Append((float)numArray2[num2]);
        //                        primitive2.TexcoordArray.Append((num3 * 8f) / ((float)segCount));
        //                    }
        //                    primitive.NormalArray.Append((float)vector3.X);
        //                    primitive.NormalArray.Append((float)vector3.Y);
        //                    primitive.NormalArray.Append((float)vector3.Z);
        //                    primitive.NormalArray.Append((float)-vector2.X);
        //                    primitive.NormalArray.Append((float)-vector2.Y);
        //                    primitive.NormalArray.Append((float)-vector2.Z);
        //                    primitive2.NormalArray.Append(-((float)-vector3.X));
        //                    primitive2.NormalArray.Append(-((float)-vector3.Y));
        //                    primitive2.NormalArray.Append(-((float)-vector3.Z));
        //                    primitive2.NormalArray.Append(-((float)vector2.X));
        //                    primitive2.NormalArray.Append(-((float)vector2.Y));
        //                    primitive2.NormalArray.Append(-((float)vector2.Z));
        //                }
        //                num3++;
        //            }
        //        }
        //        int num7 = (segCount + 1) * 2;
        //        for (num2 = 0; num2 < (array.Length - 1); num2++)
        //        {
        //            for (num3 = 0; num3 < segCount; num3++)
        //            {
        //                if (num2 == 0)
        //                {
        //                    primitive3.IndexArray.Append(list3[num3 * 2]);
        //                    primitive3.IndexArray.Append(list3[(num3 * 2) + 1]);
        //                    primitive3.IndexArray.Append(list3[((num3 + 1) * 2) + 1]);
        //                    primitive3.IndexArray.Append(list3[num3 * 2]);
        //                    primitive3.IndexArray.Append(list3[((num3 + 1) * 2) + 1]);
        //                    primitive3.IndexArray.Append(list3[(num3 + 1) * 2]);
        //                }
        //                if (secShape == SecShape.CircleRing)
        //                {
        //                    primitive.IndexArray.Append(list[(num2 * (segCount + 1)) + num3]);
        //                    primitive.IndexArray.Append(list[(((num2 + 1) * (segCount + 1)) + num3) + 1]);
        //                    primitive.IndexArray.Append(list[((num2 + 1) * (segCount + 1)) + num3]);
        //                    primitive.IndexArray.Append(list[(num2 * (segCount + 1)) + num3]);
        //                    primitive.IndexArray.Append(list[((num2 * (segCount + 1)) + num3) + 1]);
        //                    primitive.IndexArray.Append(list[(((num2 + 1) * (segCount + 1)) + num3) + 1]);
        //                    primitive2.IndexArray.Append(list2[(num2 * (segCount + 1)) + num3]);
        //                    primitive2.IndexArray.Append(list2[((num2 + 1) * (segCount + 1)) + num3]);
        //                    primitive2.IndexArray.Append(list2[(((num2 + 1) * (segCount + 1)) + num3) + 1]);
        //                    primitive2.IndexArray.Append(list2[(num2 * (segCount + 1)) + num3]);
        //                    primitive2.IndexArray.Append(list2[(((num2 + 1) * (segCount + 1)) + num3) + 1]);
        //                    primitive2.IndexArray.Append(list2[((num2 * (segCount + 1)) + num3) + 1]);
        //                }
        //                else
        //                {
        //                    primitive.IndexArray.Append(list[(((num2 * (segCount + 1)) * 2) + (num3 * 2)) + 1]);
        //                    primitive.IndexArray.Append(list[((((num2 + 1) * (segCount + 1)) * 2) + (num3 * 2)) + 2]);
        //                    primitive.IndexArray.Append(list[((((num2 + 1) * (segCount + 1)) * 2) + (num3 * 2)) + 1]);
        //                    primitive.IndexArray.Append(list[(((num2 * (segCount + 1)) * 2) + (num3 * 2)) + 1]);
        //                    primitive.IndexArray.Append(list[(((num2 * (segCount + 1)) * 2) + (num3 * 2)) + 2]);
        //                    primitive.IndexArray.Append(list[((((num2 + 1) * (segCount + 1)) * 2) + (num3 * 2)) + 2]);
        //                    primitive2.IndexArray.Append(list2[(((num2 * (segCount + 1)) * 2) + (num3 * 2)) + 1]);
        //                    primitive2.IndexArray.Append(list2[((((num2 + 1) * (segCount + 1)) * 2) + (num3 * 2)) + 1]);
        //                    primitive2.IndexArray.Append(list2[((((num2 + 1) * (segCount + 1)) * 2) + (num3 * 2)) + 2]);
        //                    primitive2.IndexArray.Append(list2[(((num2 * (segCount + 1)) * 2) + (num3 * 2)) + 1]);
        //                    primitive2.IndexArray.Append(list2[((((num2 + 1) * (segCount + 1)) * 2) + (num3 * 2)) + 2]);
        //                    primitive2.IndexArray.Append(list2[(((num2 * (segCount + 1)) * 2) + (num3 * 2)) + 2]);
        //                }
        //                if (num2 == (array.Length - 2))
        //                {
        //                    primitive3.IndexArray.Append(list3[num7 + (num3 * 2)]);
        //                    primitive3.IndexArray.Append(list3[(num7 + ((num3 + 1) * 2)) + 1]);
        //                    primitive3.IndexArray.Append(list3[(num7 + (num3 * 2)) + 1]);
        //                    primitive3.IndexArray.Append(list3[num7 + (num3 * 2)]);
        //                    primitive3.IndexArray.Append(list3[num7 + ((num3 + 1) * 2)]);
        //                    primitive3.IndexArray.Append(list3[(num7 + ((num3 + 1) * 2)) + 1]);
        //                }
        //            }
        //        }
        //        primitive4.Material.CullMode = gviCullFaceMode.gviCullNone;
        //        primitive4.VertexArray = primitive.VertexArray;
        //        primitive4.NormalArray = primitive.NormalArray;
        //        primitive4.TexcoordArray = primitive.TexcoordArray;
        //        primitive4.IndexArray = primitive.IndexArray;
        //        return true;
        //    }
        //    catch (Exception exception)
        //    {
        //        SystemLog.Instance.Log(exception);
        //        return false;
        //    }
        //}
        #endregion

        #region 单壁绘制--冯欣修改20131101
        public override bool Draw(out IModelPoint mp, out IModel fmodel, out IModel smodel)
        {
            Vector[]      array    = null;
            double[][]    numArray = null;
            List <ushort> list     = null;
            List <ushort> list2    = null;
            List <ushort> list3    = null;

            base.Draw(out mp, out fmodel, out smodel);
            try
            {
                int        segCount;
                SecShape   secShape;
                int        num2;
                int        num3;
                double[]   numArray2;
                IDrawGroup group;
                if ((base._vtx.Length == 2) && (base._sections.Length == 2))
                {
                    if (base._sections[0].SecShape != base._sections[1].SecShape)
                    {
                        return(false);
                    }
                    if (!DrawGeometry.Compare(base._vtx[0][0], base._vtx[1][0], true))
                    {
                        return(false);
                    }
                    segCount = base._sections[0].SegCount;
                    secShape = base._sections[0].SecShape;
                    list     = new List <ushort>();
                    list2    = new List <ushort>();
                    list3    = new List <ushort>();
                    List <Vector> vtxs = new List <Vector>();
                    if ((base._vtx[0][0].Z - base._vtx[1][0].Z) > base._sections[0].Diameter)
                    {
                        for (num2 = base._vtx[0].Length - 1; num2 >= 0; num2--)
                        {
                            vtxs.Add(base._vtx[0][num2]);
                        }
                        for (num2 = 0; num2 < base._vtx[0].Length; num2++)
                        {
                            vtxs.Add(base._vtx[1][num2]);
                        }
                        vtxs = Maths.DisperseArc(vtxs, Math.Min(base._sections[0].Diameter, base._sections[1].Diameter));
                    }
                    else
                    {
                        num2 = base._vtx[0].Length - 1;
                        while (num2 >= 0)
                        {
                            vtxs.Add(base._vtx[0][num2]);
                            num2--;
                        }
                        for (num2 = 1; num2 < base._vtx[0].Length; num2++)
                        {
                            vtxs.Add(base._vtx[1][num2]);
                        }
                        vtxs = Maths.DisperseArc(vtxs, Math.Min(base._sections[0].Diameter, base._sections[1].Diameter));
                    }
                    Vector vector7 = (base._vtx[0][base._vtx.Length - 1] - base._vtx[0][0]).UnitVector();
                    Vector vector8 = (base._vtx[1][base._vtx.Length - 1] - base._vtx[1][0]).UnitVector();
                    array    = new Vector[vtxs.Count + 4];
                    array[0] = vtxs[0] + ((Vector)((vector7 * base._sections[0].Diameter) / 2.0));
                    array[1] = vtxs[0] + ((Vector)(vector7 * base._sections[0].Thick));
                    vtxs.CopyTo(array, 2);
                    array[array.Length - 2] = vtxs[vtxs.Count - 1] + ((Vector)(vector8 * base._sections[0].Thick));
                    array[array.Length - 1] = vtxs[vtxs.Count - 1] + ((Vector)((vector8 * base._sections[1].Diameter) / 2.0));
                    numArray2 = new double[array.Length];
                    for (num2 = 0; num2 < array.Length; num2++)
                    {
                        if (num2 == 0)
                        {
                            numArray2[num2] = 0.0;
                        }
                        else
                        {
                            numArray2[num2] = (array[num2] - array[num2 - 1]).Length + numArray2[num2 - 1];
                        }
                    }
                    double naN = double.NaN;
                    numArray = new double[array.Length][];
                    if (base._sections[0].Diameter != base._sections[1].Diameter)
                    {
                        double diameter = base._sections[0].Diameter;
                        double num6     = base._sections[1].Diameter - base._sections[0].Diameter;
                        for (num2 = 0; num2 < array.Length; num2++)
                        {
                            switch (num2)
                            {
                            case 0:
                            case 1:
                                naN            = (base._sections[0].Thick + base._sections[0].Diameter) / base._sections[0].Diameter;
                                numArray[num2] = base._sections[0].GetVtxs(naN, 0.0, base._sections[0].Thick);
                                break;

                            default:
                                if ((num2 == (array.Length - 2)) || (num2 == (array.Length - 1)))
                                {
                                    naN            = (base._sections[1].Thick + base._sections[1].Diameter) / base._sections[1].Diameter;
                                    numArray[num2] = base._sections[1].GetVtxs(naN, 0.0, base._sections[1].Thick);
                                }
                                else
                                {
                                    naN            = (((numArray2[num2] - numArray2[2]) / (numArray2[numArray2.Length - 3] - numArray2[2])) * num6) / diameter;
                                    numArray[num2] = base._sections[0].GetVtxs(naN + 1.0, 0.0, 0.0);
                                }
                                break;
                            }
                        }
                    }
                    else
                    {
                        naN = (base._sections[0].Thick + base._sections[0].Diameter) / base._sections[0].Diameter;
                        for (num2 = 0; num2 < array.Length; num2++)
                        {
                            if (((num2 == 0) || (num2 == 1)) || ((num2 == (array.Length - 2)) || (num2 == (array.Length - 1))))
                            {
                                numArray[num2] = base._sections[0].GetVtxs(naN, 0.0, base._sections[0].Thick);
                            }
                            else
                            {
                                numArray[num2] = base._sections[0].GetVtxs();
                            }
                        }
                    }
                    object renderInfo = (base._renderType == RenderType.Texture) ? ((object)base._tcNames) : ((object)base._colors);
                    int[]  index      = new int[1];
                    if (base.NewEmptyModel(index, base._renderType, renderInfo, out fmodel))
                    {
                        int[] numArray4 = new int[1];
                        if (base.NewEmptyModel(numArray4, base._renderType, renderInfo, out smodel))
                        {
                            goto Label_05D6;
                        }
                    }
                }
                return(false);

Label_05D6:
                group = null;
                group = fmodel.GetGroup(0);
                IDrawPrimitive primitive  = group.GetPrimitive(0);
                IDrawPrimitive primitive4 = smodel.GetGroup(0).GetPrimitive(0);
                for (num2 = 0; num2 < array.Length; num2++)
                {
                    Vector vector;
                    Vector vector2;
                    Vector vector3;
                    if (num2 == (array.Length - 1))
                    {
                        vector = (array[num2] - array[num2 - 1]).UnitVector();
                    }
                    else
                    {
                        vector = (array[num2 + 1] - array[num2]).UnitVector();
                    }
                    Maths.GenerateComplementBasis(vector, out vector2, out vector3);
                    num3 = 0;
                    while (num3 <= segCount)
                    {
                        Vector vector6 = (((numArray[num2][num3 * 4] - base._sections[0].OffsetX) * vector2) + ((numArray[num2][(num3 * 4) + 1] - base._sections[0].OffsetY) * vector3)).UnitVector();
                        Vector vector4 = array[num2] + ((Vector)((numArray[num2][num3 * 4] * vector2) + (numArray[num2][(num3 * 4) + 1] * vector3)));
                        Vector vector5 = array[num2] + ((Vector)((numArray[num2][(num3 * 4) + 2] * vector2) + (numArray[num2][(num3 * 4) + 3] * vector3)));
                        if (secShape == SecShape.CircleRing)
                        {
                            primitive.VertexArray.Append((float)vector4.X);
                            primitive.VertexArray.Append((float)vector4.Y);
                            primitive.VertexArray.Append((float)vector4.Z);
                            list.Add((ushort)((primitive.VertexArray.Length / 3) - 1));
                            if (base._renderType == RenderType.Texture)
                            {
                                primitive.TexcoordArray.Append((float)numArray2[num2]);
                                primitive.TexcoordArray.Append((num3 * 8f) / ((float)segCount));
                            }
                            primitive.NormalArray.Append((float)vector6.X);
                            primitive.NormalArray.Append((float)vector6.Y);
                            primitive.NormalArray.Append((float)vector6.Z);
                        }
                        else
                        {
                            primitive.VertexArray.Append((float)vector4.X);
                            primitive.VertexArray.Append((float)vector4.Y);
                            primitive.VertexArray.Append((float)vector4.Z);
                            list.Add((ushort)((primitive.VertexArray.Length / 3) - 1));
                            primitive.VertexArray.Append((float)vector4.X);
                            primitive.VertexArray.Append((float)vector4.Y);
                            primitive.VertexArray.Append((float)vector4.Z);
                            list.Add((ushort)((primitive.VertexArray.Length / 3) - 1));
                            if (base._renderType == RenderType.Texture)
                            {
                                primitive.TexcoordArray.Append((float)numArray2[num2]);
                                primitive.TexcoordArray.Append((num3 * 8f) / ((float)segCount));
                                primitive.TexcoordArray.Append((float)numArray2[num2]);
                                primitive.TexcoordArray.Append((num3 * 8f) / ((float)segCount));
                            }
                            primitive.NormalArray.Append((float)vector3.X);
                            primitive.NormalArray.Append((float)vector3.Y);
                            primitive.NormalArray.Append((float)vector3.Z);
                            primitive.NormalArray.Append((float)-vector2.X);
                            primitive.NormalArray.Append((float)-vector2.Y);
                            primitive.NormalArray.Append((float)-vector2.Z);
                        }
                        num3++;
                    }
                }
                primitive.Material.CullMode = gviCullFaceMode.gviCullNone;
                int num7 = (segCount + 1) * 2;
                for (num2 = 0; num2 < (array.Length - 1); num2++)
                {
                    for (num3 = 0; num3 < segCount; num3++)
                    {
                        if (secShape == SecShape.CircleRing)
                        {
                            primitive.IndexArray.Append(list[(num2 * (segCount + 1)) + num3]);
                            primitive.IndexArray.Append(list[(((num2 + 1) * (segCount + 1)) + num3) + 1]);
                            primitive.IndexArray.Append(list[((num2 + 1) * (segCount + 1)) + num3]);
                            primitive.IndexArray.Append(list[(num2 * (segCount + 1)) + num3]);
                            primitive.IndexArray.Append(list[((num2 * (segCount + 1)) + num3) + 1]);
                            primitive.IndexArray.Append(list[(((num2 + 1) * (segCount + 1)) + num3) + 1]);
                        }
                        else
                        {
                            primitive.IndexArray.Append(list[(((num2 * (segCount + 1)) * 2) + (num3 * 2)) + 1]);
                            primitive.IndexArray.Append(list[((((num2 + 1) * (segCount + 1)) * 2) + (num3 * 2)) + 2]);
                            primitive.IndexArray.Append(list[((((num2 + 1) * (segCount + 1)) * 2) + (num3 * 2)) + 1]);
                            primitive.IndexArray.Append(list[(((num2 * (segCount + 1)) * 2) + (num3 * 2)) + 1]);
                            primitive.IndexArray.Append(list[(((num2 * (segCount + 1)) * 2) + (num3 * 2)) + 2]);
                            primitive.IndexArray.Append(list[((((num2 + 1) * (segCount + 1)) * 2) + (num3 * 2)) + 2]);
                        }
                    }
                }
                primitive4.Material.CullMode = gviCullFaceMode.gviCullNone;
                primitive4.VertexArray       = primitive.VertexArray;
                primitive4.NormalArray       = primitive.NormalArray;
                primitive4.TexcoordArray     = primitive.TexcoordArray;
                primitive4.IndexArray        = primitive.IndexArray;
                return(true);
            }
            catch (Exception exception)
            {
                return(false);
            }
        }
Ejemplo n.º 11
0
        public override bool Draw(out IModelPoint mp, out IModel fmodel, out IModel smodel)
        {
            int            index      = -1;
            IDrawPrimitive primitive  = null;
            IDoubleArray   vArray     = null;
            IUInt16Array   indexArray = null;
            IFloatArray    array3     = null;
            IDoubleArray   norms      = null;

            base.Draw(out mp, out fmodel, out smodel);
            try
            {
                object renderInfo = (base._renderType == RenderType.Texture) ? ((object)base._tcNames) : ((object)base._colors);
                int[]  numArray   = new int[2];
                numArray[1] = 1;
                if (!base.NewEmptyModel(numArray, base._renderType, renderInfo, out fmodel))
                {
                    return(false);
                }
                //绘制底部
                primitive = fmodel.GetGroup(0).GetPrimitive(0);
                if (DrawGeometry.ConvertPolygon(this._vtx2, 0.0, 0, out vArray, out indexArray, out array3, out norms))
                {
                    for (index = 0; index < vArray.Length; index++)
                    {
                        primitive.VertexArray.Append((float)vArray.Array[index]);
                    }
                    for (index = 0; index < indexArray.Length; index++)
                    {
                        primitive.IndexArray.Append(indexArray.Array[index]);
                    }
                    for (index = 0; index < (vArray.Length / 3); index++)
                    {
                        float num2 = (float)vArray.Array[index * 3];
                        primitive.TexcoordArray.Append(num2);
                        num2 = (float)vArray.Array[(index * 3) + 1];
                        primitive.TexcoordArray.Append(num2);
                    }
                    for (index = 0; index < norms.Length; index++)
                    {
                        primitive.NormalArray.Append((float)norms.Array[index]);
                    }
                }
                double        num3 = 0.0;
                int           num4 = base._vtx.Length / 2;
                List <ushort> list = new List <ushort>();
                primitive = fmodel.GetGroup(0).GetPrimitive(1);
                for (index = 0; index < num4; index++)
                {
                    primitive.VertexArray.Append((float)base._vtx[index * 2]);
                    primitive.VertexArray.Append((float)base._vtx[(index * 2) + 1]);
                    primitive.VertexArray.Append((float)(this._terrainLine[index] - base._hBottom));
                    list.Add((ushort)((primitive.VertexArray.Length / 3) - 1));
                    primitive.VertexArray.Append((float)this._vtx2[index * 2]);
                    primitive.VertexArray.Append((float)this._vtx2[(index * 2) + 1]);
                    primitive.VertexArray.Append(0f);
                    list.Add((ushort)((primitive.VertexArray.Length / 3) - 1));
                    num3 = (index == 0) ? num3 : (num3 += this._segLenth[index - 1]);
                    primitive.TexcoordArray.Append((float)num3);
                    primitive.TexcoordArray.Append((float)(this._terrainLine[index] - base._hBottom));
                    primitive.TexcoordArray.Append((float)num3);
                    primitive.TexcoordArray.Append(0f);
                    IVector3 vector = new Vector3Class
                    {
                        X = base._vtx[index * 2],
                        Y = base._vtx[(index * 2) + 1],
                        Z = 0.0
                    };
                    vector.Normalize();
                    primitive.NormalArray.Append((float)vector.X);
                    primitive.NormalArray.Append((float)vector.Y);
                    primitive.NormalArray.Append((float)vector.Z);
                    //工程开挖挖洞效果贴图模型出错,添加法向量数组,使其与顶点数组数量一致
                    primitive.NormalArray.Append((float)vector.X);
                    primitive.NormalArray.Append((float)vector.Y);
                    primitive.NormalArray.Append((float)vector.Z);
                }
                for (index = 0; index < (num4 - 1); index++)
                {
                    primitive.IndexArray.Append(list[index * 2]);
                    primitive.IndexArray.Append(list[(index * 2) + 1]);
                    primitive.IndexArray.Append(list[((index + 1) * 2) + 1]);
                    primitive.IndexArray.Append(list[index * 2]);
                    primitive.IndexArray.Append(list[((index + 1) * 2) + 1]);
                    primitive.IndexArray.Append(list[(index + 1) * 2]);
                }
                return(true);
            }
            catch (Exception exception)
            {
                return(false);
            }
        }