Esempio n. 1
0
        public static IMultiPatch EnvelopeToBoundingBox(IEnvelope2 ienvelope2_0)
        {
            object value = Missing.Value;
            double double_;
            double double_2;
            double double_3;
            double double_4;

            ienvelope2_0.QueryCoords(out double_, out double_2, out double_3, out double_4);
            double              zMin               = ienvelope2_0.ZMin;
            double              zMax               = ienvelope2_0.ZMax;
            IMultiPatch         multiPatch         = new MultiPatch() as IMultiPatch;
            IGeometryCollection geometryCollection = multiPatch as IGeometryCollection;
            IPointCollection    pointCollection    = new TriangleStrip();

            Utils3D.MakeZMAware(pointCollection as IGeometry, true);
            pointCollection.AddPoint(Utils3D.Create3DPoint(double_, double_2, zMin), ref value, ref value);
            pointCollection.AddPoint(Utils3D.Create3DPoint(double_, double_2, zMax), ref value, ref value);
            pointCollection.AddPoint(Utils3D.Create3DPoint(double_3, double_2, zMin), ref value, ref value);
            pointCollection.AddPoint(Utils3D.Create3DPoint(double_3, double_2, zMax), ref value, ref value);
            pointCollection.AddPoint(Utils3D.Create3DPoint(double_3, double_4, zMin), ref value, ref value);
            pointCollection.AddPoint(Utils3D.Create3DPoint(double_3, double_4, zMax), ref value, ref value);
            pointCollection.AddPoint(Utils3D.Create3DPoint(double_, double_4, zMin), ref value, ref value);
            pointCollection.AddPoint(Utils3D.Create3DPoint(double_, double_4, zMax), ref value, ref value);
            pointCollection.AddPoint(Utils3D.Create3DPoint(double_, double_2, zMin), ref value, ref value);
            pointCollection.AddPoint(Utils3D.Create3DPoint(double_, double_2, zMax), ref value, ref value);
            geometryCollection.AddGeometry(pointCollection as IGeometry, ref value, ref value);
            return(multiPatch);
        }
Esempio n. 2
0
 public static void MakeConstantZ(IGeometry igeometry_0, double double_0)
 {
     if (igeometry_0 is IZ)
     {
         Utils3D.MakeZMAware(igeometry_0, true);
         IZ iZ = igeometry_0 as IZ;
         iZ.CalculateNonSimpleZs();
         iZ.SetConstantZ(double_0);
     }
 }
Esempio n. 3
0
        private static IPointCollection ReturnMidPoints(IPointCollection ipointCollection_0)
        {
            IPointCollection pointCollection = new Polyline();
            object           value           = Missing.Value;

            for (int i = 1; i <= ipointCollection_0.PointCount - 2; i++)
            {
                IPoint point  = ipointCollection_0.get_Point(i);
                IPoint point2 = ipointCollection_0.get_Point(i + 1);
                IPath  path   = new Path() as IPath;
                Utils3D.MakeZMAware(path, true);
                path.FromPoint = point;
                path.ToPoint   = point2;
                IPoint point3 = new Point();
                Utils3D.MakeZMAware(point3, true);
                path.QueryPoint(esriSegmentExtension.esriNoExtension, 0.5, true, point3);
                point3.Z = (point.Z + point2.Z) / 2.0;
                pointCollection.AddPoint(Utils3D.CreateClone(point3 as IClone) as IPoint, ref value, ref value);
            }
            return(null);
        }
Esempio n. 4
0
        public static IElement AddSimpleGraphic(IGeometry igeometry_0, IRgbColor irgbColor_0, int int_0, string string_0, object object_0)
        {
            IElement element = null;
            IElement result;

            if (igeometry_0.IsEmpty)
            {
                result = null;
            }
            else
            {
                esriGeometryType geometryType = igeometry_0.GeometryType;
                IElement         element2;
                switch (geometryType)
                {
                case esriGeometryType.esriGeometryPoint:
                {
                    element2 = new MarkerElement();
                    IMarkerElement markerElement = element2 as IMarkerElement;
                    markerElement.Symbol = new SimpleMarkerSymbol
                    {
                        Color = irgbColor_0,
                        Size  = (double)int_0,
                        Style = esriSimpleMarkerStyle.esriSMSCircle
                    };
                    goto IL_132;
                }

                case esriGeometryType.esriGeometryMultipoint:
                    break;

                case esriGeometryType.esriGeometryPolyline:
                {
                    element2 = new LineElement();
                    ILineElement lineElement = element2 as ILineElement;
                    lineElement.Symbol = new SimpleLineSymbol
                    {
                        Width = (double)int_0,
                        Color = irgbColor_0,
                        Style = esriSimpleLineStyle.esriSLSSolid
                    };
                    goto IL_132;
                }

                case esriGeometryType.esriGeometryPolygon:
                {
                    ISimpleLineSymbol simpleLineSymbol = new SimpleLineSymbol();
                    simpleLineSymbol.Width = (double)int_0;
                    simpleLineSymbol.Color = irgbColor_0;
                    simpleLineSymbol.Style = esriSimpleLineStyle.esriSLSSolid;
                    element2 = new PolygonElement();
                    IFillShapeElement fillShapeElement = element2 as IFillShapeElement;
                    fillShapeElement.Symbol = new SimpleFillSymbol
                    {
                        Color   = irgbColor_0,
                        Outline = simpleLineSymbol
                    };
                    goto IL_132;
                }

                default:
                    if (geometryType == esriGeometryType.esriGeometryMultiPatch)
                    {
                        element2 = new MultiPatchElement();
                        IFillShapeElement fillShapeElement2 = element2 as IFillShapeElement;
                        IFillSymbol       symbol            = fillShapeElement2.Symbol;
                        symbol.Color             = irgbColor_0;
                        fillShapeElement2.Symbol = symbol;
                        goto IL_132;
                    }
                    break;
                }
                result = element;
                return(result);

IL_132:
                Utils3D.MakeZMAware(igeometry_0, true);
                element2.Geometry = igeometry_0;
                IElementProperties elementProperties = element2 as IElementProperties;
                elementProperties.Name = string_0;
                if (object_0 is IGraphicsContainer3D)
                {
                    IGraphicsContainer3D graphicsContainer3D = object_0 as IGraphicsContainer3D;
                    graphicsContainer3D.AddElement(element2);
                }
                else if (object_0 is IScenePlugin)
                {
                    IGraphicsContainer3D graphicsContainer3D2 = (object_0 as IScenePlugin).Scene.BasicGraphicsLayer as IGraphicsContainer3D;
                    graphicsContainer3D2.AddElement(element2);
                }
                else if (object_0 is IGroupElement)
                {
                    IGroupElement groupElement = object_0 as IGroupElement;
                    groupElement.AddElement(element2);
                }
                result = element2;
            }
            return(result);
        }