Ejemplo n.º 1
0
        public TreeNodeComLayer GetTreeLayerByFeatureClassID(int id)
        {
            TreeNodeComLayer treeLayer = null;

            foreach (TreeNodeComLayer tr in listTreeLayer)
            {
                if (tr.CustomValue == null)
                {
                    continue;
                }
                if (tr.CustomValue is IGeoFeatureLayer)
                {
                    IGeoFeatureLayer geoFL = tr.CustomValue as IGeoFeatureLayer;
                    IFeatureClass    fc    = geoFL.FeatureClass;
                    if (fc.FeatureClassID == id)
                    {
                        treeLayer = tr;
                    }
                }
                else
                {
                    continue;
                }
            }
            return(treeLayer);
        }
Ejemplo n.º 2
0
 public void Add(TreeNodeComLayer node)
 {
     if (this.ExistTN(node.Name))
     {
         return;
     }
     this.listTreeLayer.Add(node);
 }
Ejemplo n.º 3
0
        public DF2DFeatureClass(IFeatureClass fc, TreeNodeComLayer treeLayer)
        {
            this.fc        = fc;
            this.treeLayer = treeLayer;
            string temp = Dictionary2DTable.Instance.GetFacilityClassNameByDFFeatureClassID(fc.FeatureClassID.ToString());

            if (temp == null || temp == "")
            {
                return;
            }
            this.AttachFacilityClassByName(temp);
        }
Ejemplo n.º 4
0
        private TreeListNode AddCadNodeToTreeList(ICadLayer layer)
        {
            if (_dictCadLyr.ContainsValue(layer))
            {
                XtraMessageBox.Show("该图层已添加,请勿重复添加该图层!"); return(null);
            }
            TreeNodeComLayer comLayerNode = new TreeNodeComLayer()
            {
                Name = layer.Name, CustomValue = layer
            };

            comLayerNode.OwnNode    = _baseTree.AppendNode(new object[] { comLayerNode.Name }, null);//为树创建根节点
            comLayerNode.ImageIndex = 0;
            comLayerNode.Visible    = true;
            return(comLayerNode.OwnNode);
        }
Ejemplo n.º 5
0
 private void LayerCheckOnOffControl(IBaseLayer layer)
 {
     if (layer is TreeNodeComLayer)
     {
         TreeNodeComLayer node = layer as TreeNodeComLayer;
         node.CheckOn = node.Visible;
         List <IBaseLayer> childNodes = node.SelectAllSubLayers();
         if (childNodes.Count > 0)
         {
             foreach (IBaseLayer cn in childNodes)
             {
                 LayerCheckOnOffControl(cn);
             }
         }
     }
     else if (layer is TreeNodeLogicGroup2D)
     {
         TreeNodeLogicGroup2D lg     = layer as TreeNodeLogicGroup2D;
         List <IBaseLayer>    listBL = lg.SelectAllSubLayers();
         if (listBL.Count > 0)
         {
             foreach (IBaseLayer bl in listBL)
             {
                 LayerCheckOnOffControl(bl);
             }
         }
     }
     else if (layer is TreeNodeMajorClass2D)
     {
         TreeNodeMajorClass2D node = layer as TreeNodeMajorClass2D;
         node.CheckOn = node.Visible;
         List <IBaseLayer> childNodes = node.SelectAllSubLayers();
         if (childNodes.Count > 0)
         {
             foreach (IBaseLayer cn in childNodes)
             {
                 LayerCheckOnOffControl(cn);
             }
         }
     }
     else if (layer is TreeNodeSubClass2D)
     {
         TreeNodeSubClass2D node = layer as TreeNodeSubClass2D;
         node.CheckOn = node.Visible;
     }
 }
Ejemplo n.º 6
0
 public DF2DRaster(IRaster raster, TreeNodeComLayer treeLayer)
 {
     this.raster    = raster;
     this.treeLayer = treeLayer;
 }
Ejemplo n.º 7
0
        private bool HaveOne(FacilityClass facc, IGeometry pGeo)
        {
            bool haveone = false;

            string[] fc2D = facc.Fc2D.Split(';');
            if (fc2D.Length == 0)
            {
                return(false);
            }
            string           facID  = fc2D[0];
            DF2DFeatureClass dffacc = DF2DFeatureClassManager.Instance.GetFeatureClassByID(facID);
            //如果图层不显示,则不查询
            TreeNodeComLayer treeLayer = dffacc.GetTreeLayer();

            if (treeLayer == null || !treeLayer.Visible)
            {
                return(false);
            }

            IFeatureClass  fc     = dffacc.GetFeatureClass();
            ISpatialFilter filter = new SpatialFilter();

            filter            = new SpatialFilter();
            filter.Geometry   = pGeo;
            filter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;
            IFeatureCursor cursor  = fc.Search(filter, false);
            IFeature       feature = cursor.NextFeature();

            if (feature != null)
            {
                haveone = true;
                DataTable dt = new DataTable();
                dt.TableName = facc.Name;
                DataColumn oidcol = new DataColumn();
                oidcol.ColumnName = "oid";
                oidcol.Caption    = "ID";
                dt.Columns.Add(oidcol);
                foreach (DFDataConfig.Class.FieldInfo fitemp in facc.FieldInfoCollection)
                {
                    if (!fitemp.CanQuery)
                    {
                        continue;
                    }
                    DataColumn col = new DataColumn();
                    col.ColumnName = fitemp.Name;
                    col.Caption    = fitemp.Alias;
                    dt.Columns.Add(col);
                }

                DataRow dtRow = dt.NewRow();
                dtRow["oid"] = feature.get_Value(feature.Fields.FindField("OBJECTID"));
                foreach (DataColumn col in dt.Columns)
                {
                    int index1 = feature.Fields.FindField(col.ColumnName);
                    if (index1 < 0)
                    {
                        continue;
                    }
                    object obj1 = GetFieldValueByIndex(feature, index1);
                    string str  = "";
                    if (obj1 != null)
                    {
                        IField field = feature.Fields.get_Field(index1);
                        switch (field.Type)
                        {
                        case esriFieldType.esriFieldTypeBlob:
                        case esriFieldType.esriFieldTypeGeometry:
                        case esriFieldType.esriFieldTypeRaster:
                            continue;

                        case esriFieldType.esriFieldTypeDouble:

                            double d;
                            if (double.TryParse(obj1.ToString(), out d))
                            {
                                str = d.ToString("0.00");
                            }
                            break;

                        default:
                            str = obj1.ToString();
                            break;
                        }
                    }
                    dtRow[col.ColumnName] = str;
                }
                dt.Rows.Add(dtRow);
                if (dt.Rows.Count > 0)
                {
                    this._dict[facc.Alias] = dt;
                }
            }
            return(haveone);
        }
Ejemplo n.º 8
0
        public override void OnExtentUpdated(object displayTransformation, bool sizeChanged, object newEnvelope)
        {
            DF2DApplication app = DF2DApplication.Application;

            if (app == null)
            {
                return;
            }
            double sMapScale = app.Current2DMapControl.MapScale;
            //List<TreeNodeComLayer> listTreeLayer = DF2DFeatureClassManager.Instance.GetAllTreeLayer();
            List <DF2DFeatureClass> listFC     = DF2DFeatureClassManager.Instance.GetAllFeatureClass();
            List <DF2DRaster>       listRaster = DF2DRasterManager.Instance.GetAllRaster();

            #region  树控件栅格节点显示控制

            foreach (DF2DRaster dfrd in listRaster)
            {
                IRasterLayer     rl        = dfrd.GetRasterLayer();
                TreeNodeComLayer treeLayer = dfrd.GetTreeLayer();
                if (treeLayer == null)
                {
                    continue;
                }
                if (rl == null)
                {
                    continue;
                }
                if (!treeLayer.CheckOn)
                {
                    continue;
                }
                if (rl.MinimumScale != 0)
                {
                    if (sMapScale >= rl.MinimumScale)
                    {
                        treeLayer.Visible = false;
                    }
                    else
                    {
                        treeLayer.Visible = true;
                    }
                }
                else if (rl.MaximumScale != 0)
                {
                    if (sMapScale <= rl.MaximumScale)
                    {
                        treeLayer.Visible = false;
                    }
                    else
                    {
                        treeLayer.Visible = true;
                    }
                }
                else
                {
                    treeLayer.Visible = true;
                }
            }
            #endregion
            foreach (DF2DFeatureClass dffc in listFC)
            {
                #region   控制树控件管线部分二级分类显示
                string faccName = dffc.GetFacilityClassName();
                if (faccName == "PipeLine")
                {
                    string         id   = dffc.GetFeatureClass().FeatureClassID.ToString();
                    DF2DMajorClass dfmc = DF2DMajorClassManager.Instance.GetDFMCByFeatureClassID(id);
                    if (dfmc != null)
                    {
                        ILayer lyr = dffc.GetLayer();
                        if (lyr != null)
                        {
                            TreeNodeMajorClass2D tnmc = dfmc.GetTNByFeatureClassID(id);
                            if (!tnmc.CheckOn)
                            {
                                continue;
                            }
                            if (tnmc != null)
                            {
                                if (lyr.MinimumScale != 0)
                                {
                                    if (sMapScale >= lyr.MinimumScale)
                                    {
                                        tnmc.Visible = false;
                                    }
                                    else
                                    {
                                        tnmc.Visible = true;
                                    }
                                }
                                else if (lyr.MaximumScale != 0)
                                {
                                    if (sMapScale <= lyr.MaximumScale)
                                    {
                                        tnmc.Visible = false;
                                    }
                                    else
                                    {
                                        tnmc.Visible = true;
                                    }
                                }
                                else
                                {
                                    tnmc.Visible = true;
                                }
                            }
                        }
                    }
                }

                #endregion

                #region  控制图层树背景图部分显示


                IFeatureLayer    fl        = dffc.GetFeatureLayer();
                TreeNodeComLayer treeLayer = dffc.GetTreeLayer();
                if (treeLayer == null)
                {
                    continue;
                }
                if (fl == null)
                {
                    continue;
                }
                if (!treeLayer.CheckOn)
                {
                    continue;
                }
                if (fl.MinimumScale != 0)
                {
                    if (sMapScale >= fl.MinimumScale)
                    {
                        treeLayer.Visible = false;
                    }
                    else
                    {
                        treeLayer.Visible = true;
                    }
                }
                else if (fl.MaximumScale != 0)
                {
                    if (sMapScale <= fl.MaximumScale)
                    {
                        treeLayer.Visible = false;
                    }
                    else
                    {
                        treeLayer.Visible = true;
                    }
                }
                else
                {
                    treeLayer.Visible = true;
                }
                #endregion
            }
        }
Ejemplo n.º 9
0
        private static void AddSymbolNode(TreeNodeComLayer tnComLayer, object renderer)
        {
            int             index;
            LogicBaseTree   logicBT    = new LogicBaseTree();
            ImageCollection treeImages = logicBT.TreeList.StateImageList as ImageCollection;

            if (renderer is SimpleRenderer)
            {
                ISimpleRenderer simpleRenderer = (ISimpleRenderer)renderer;
                ISymbol         symbol         = simpleRenderer.Symbol;
                Image           img            = ConvertSymbolToImage.Convert(symbol, 16, 16);
                index = treeImages.Images.Add(img);
                //img.Save("d:\\" + index + ".JPG");

                string         label    = simpleRenderer.Label;
                TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                {
                    Name = label, CustomValue = symbol
                };
                tnSymbol.ImageIndex = index;
                tnComLayer.Add(tnSymbol);
            }
            else if (renderer is UniqueValueRenderer)
            {
                string renderLabel = "";
                IUniqueValueRenderer uniqueValueRenderer = renderer as IUniqueValueRenderer;
                for (int i = 0; i < uniqueValueRenderer.FieldCount - 1; i++)
                {
                    renderLabel += uniqueValueRenderer.get_Field(i) + " /";
                }
                renderLabel += uniqueValueRenderer.get_Field(uniqueValueRenderer.FieldCount - 1);//FieldCount为地物分类数
                //getImage(esriGeometryType.esriGeometryPolygon, Color.White).Save("D:\\111.jpg");
                index = treeImages.Images.Add(getImage(esriGeometryType.esriGeometryPolygon, Color.White));

                TreeNodeSymbol tnChartNode = new TreeNodeSymbol()
                {
                    Name = renderLabel, CustomValue = uniqueValueRenderer
                };
                tnChartNode.ImageIndex = index;
                tnComLayer.Add(tnChartNode);

                for (int i = 0; i < uniqueValueRenderer.ValueCount; i++)//ValueCount为地物分类下的设施种类数
                {
                    ISymbol symbol = uniqueValueRenderer.get_Symbol(uniqueValueRenderer.get_Value(i));

                    Image img = ConvertSymbolToImage.Convert(symbol, 16, 16);
                    //img.Save("D:\\121121.jpg");


                    index = treeImages.Images.Add(img);

                    TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                    {
                        Name = uniqueValueRenderer.get_Label(uniqueValueRenderer.get_Value(i)), CustomValue = symbol
                    };
                    tnSymbol.ImageIndex = index;
                    tnComLayer.Add(tnSymbol);
                }
                if (uniqueValueRenderer.UseDefaultSymbol)
                {
                    ISymbol symbol = uniqueValueRenderer.DefaultSymbol;
                    Image   img    = ConvertSymbolToImage.Convert(symbol, 16, 16);
                    index = treeImages.Images.Add(img);

                    TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                    {
                        Name = uniqueValueRenderer.DefaultLabel, CustomValue = symbol
                    };
                    tnSymbol.ImageIndex = index;
                    tnComLayer.Add(tnSymbol);
                }
            }
            else if (renderer is IChartRenderer)
            {
                IChartRenderer  chartRenderer = renderer as IChartRenderer;
                IRendererFields pFields       = chartRenderer as IRendererFields;
                string          renderLabel   = "";
                for (int i = 0; i < pFields.FieldCount - 1; i++)
                {
                    renderLabel += pFields.get_FieldAlias(i) + " /";
                }
                renderLabel += pFields.get_FieldAlias(pFields.FieldCount - 1);

                index = treeImages.Images.Add(getImage(esriGeometryType.esriGeometryPolygon, Color.White));

                TreeNodeSymbol tnChartNode = new TreeNodeSymbol()
                {
                    Name = renderLabel, CustomValue = chartRenderer
                };
                tnChartNode.ImageIndex = index;
                tnComLayer.Add(tnChartNode);


                ISymbolArray symArray = chartRenderer.ChartSymbol as ISymbolArray;
                for (int i = 0; i < symArray.SymbolCount; i++)
                {
                    ISymbol symbol = symArray.get_Symbol(i);

                    Image img = ConvertSymbolToImage.Convert(symbol, 16, 16);
                    index = treeImages.Images.Add(img);

                    TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                    {
                        Name = pFields.get_FieldAlias(i), CustomValue = symbol
                    };
                    tnSymbol.ImageIndex = index;
                    tnComLayer.Add(tnSymbol);
                }
            }
            else if (renderer is IClassBreaksRenderer)
            {
                IClassBreaksRenderer classRenderer = renderer as IClassBreaksRenderer;
                index = treeImages.Images.Add(getImage(esriGeometryType.esriGeometryPolygon, Color.White));

                TreeNodeSymbol tnChartNode = new TreeNodeSymbol()
                {
                    Name = classRenderer.Field, CustomValue = classRenderer
                };
                tnChartNode.ImageIndex = index;
                tnComLayer.Add(tnChartNode);


                for (int i = 0; i < classRenderer.BreakCount; i++)
                {
                    ISymbol symbol = classRenderer.get_Symbol(i);

                    Image img = ConvertSymbolToImage.Convert(symbol, 16, 16);
                    index = treeImages.Images.Add(img);

                    TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                    {
                        Name = classRenderer.get_Label(i), CustomValue = symbol
                    };
                    tnSymbol.ImageIndex = index;
                    tnComLayer.Add(tnSymbol);
                }
            }
            else if (renderer is IRasterRenderer)
            {
                if (renderer is IRasterClassifyColorRampRenderer)
                {
                    //MessageBox.Show("IRasterClassifyColorRampRenderer");
                }
                else if (renderer is IRasterUniqueValueRenderer)
                {
                    //MessageBox.Show("IRasterUniqueValueRenderer");
                }
                else if (renderer is IRasterStretchColorRampRenderer)
                {
                    ////MessageBox.Show("IRasterStretchColorRampRenderer");
                    IRasterStretchColorRampRenderer pRSCRR = renderer as IRasterStretchColorRampRenderer;

                    index = treeImages.Images.Add(getImage(esriGeometryType.esriGeometryPolygon, Color.White));
                    TreeNodeSymbol tnChartNode = new TreeNodeSymbol()
                    {
                        Name = "<Value>", CustomValue = pRSCRR
                    };
                    tnChartNode.ImageIndex = index;
                    tnComLayer.Add(tnChartNode);

                    if (pRSCRR.ColorRamp.Size >= 3)
                    {
                        IEnumColors colors = pRSCRR.ColorRamp.Colors;
                        colors.Reset();
                        IColor  c      = colors.Next();
                        Color[] cArray = new Color[3];
                        int     count  = 0;
                        while (c != null)
                        {
                            count++;
                            if (count == 1)
                            {
                                cArray[0] = Color.FromArgb(c.RGB);
                            }
                            else if (count == pRSCRR.ColorRamp.Size / 2)
                            {
                                cArray[1] = Color.FromArgb(c.RGB);
                            }
                            else if (count == pRSCRR.ColorRamp.Size)
                            {
                                cArray[2] = Color.FromArgb(c.RGB);
                            }
                            c = colors.Next();
                        }
                        for (int i = 0; i < 3; i++)
                        {
                            Image img = getImage(esriGeometryType.esriGeometryPolygon, cArray[i]);
                            index = treeImages.Images.Add(img);

                            string label = "";
                            if (i == 0)
                            {
                                label = pRSCRR.LabelLow;
                            }
                            else if (i == 1)
                            {
                                label = pRSCRR.LabelMedium;
                            }
                            else if (i == 2)
                            {
                                label = pRSCRR.LabelHigh;
                            }

                            TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                            {
                                Name = label, CustomValue = cArray[i]
                            };
                            tnSymbol.ImageIndex = index;
                            tnComLayer.Add(tnSymbol);
                        }
                    }
                }

                else if (renderer is IRasterRGBRenderer)
                {
                    //MessageBox.Show("IRasterRGBRenderer");
                }
                else if (renderer is IRasterColormap)
                {
                    //MessageBox.Show("IRasterColormap");
                }
                else
                {
                    //MessageBox.Show("未处理的IRasterRenderer类型:  " + renderer.GetType().FullName);
                }
            }
            else if (renderer is ITinRenderer)
            {
                if (renderer is ITinColorRampRenderer)
                {
                    ////MessageBox.Show("ITinColorRampRenderer");
                    ITinColorRampRenderer pTCRR = renderer as ITinColorRampRenderer;

                    index = treeImages.Images.Add(getImage(esriGeometryType.esriGeometryPolygon, Color.White));
                    TreeNodeSymbol tnChartNode = new TreeNodeSymbol()
                    {
                        Name = "Elevation", CustomValue = pTCRR
                    };
                    tnChartNode.ImageIndex = index;
                    tnComLayer.Add(tnChartNode);



                    for (int i = 0; i < pTCRR.BreakCount; i++)
                    {
                        ISymbol symbol = pTCRR.get_Symbol(i);
                        Image   img    = ConvertSymbolToImage.Convert(symbol, 16, 16);
                        index = treeImages.Images.Add(img);
                        TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                        {
                            Name = pTCRR.get_Label(i), CustomValue = symbol
                        };
                        tnSymbol.ImageIndex = index;
                        tnComLayer.Add(tnSymbol);
                    }
                }
                else if (renderer is ITinUniqueValueRenderer)
                {
                    ////MessageBox.Show("ITinUniqueValueRenderer");
                    ITinUniqueValueRenderer pTUVR = renderer as ITinUniqueValueRenderer;

                    index = treeImages.Images.Add(getImage(esriGeometryType.esriGeometryPolygon, Color.White));

                    TreeNodeSymbol tnChartNode = new TreeNodeSymbol()
                    {
                        Name = "Elevation", CustomValue = pTUVR
                    };
                    tnChartNode.ImageIndex = index;
                    tnComLayer.Add(tnChartNode);


                    for (int i = 0; i < pTUVR.ValueCount; i++)
                    {
                        string  val    = pTUVR.get_Value(i);
                        ISymbol symbol = pTUVR.get_Symbol(val);
                        Image   img    = ConvertSymbolToImage.Convert(symbol, 16, 16);
                        index = treeImages.Images.Add(img);

                        TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                        {
                            Name = pTUVR.get_Label(val), CustomValue = symbol
                        };
                        tnSymbol.ImageIndex = index;
                        tnComLayer.Add(tnSymbol);
                    }
                    if (pTUVR.UseDefaultSymbol)
                    {
                        ISymbol symbol = pTUVR.DefaultSymbol;
                        Image   img    = ConvertSymbolToImage.Convert(symbol, 16, 16);
                        index = treeImages.Images.Add(img);

                        TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                        {
                            Name = pTUVR.DefaultLabel, CustomValue = symbol
                        };
                        tnSymbol.ImageIndex = index;
                        tnComLayer.Add(tnSymbol);
                    }
                }
                else if (renderer is ITinSingleSymbolRenderer)
                {
                    ////MessageBox.Show("ITinSingleSymbolRenderer");
                    ITinSingleSymbolRenderer pTSSR = renderer as ITinSingleSymbolRenderer;
                    ISymbol symbol = pTSSR.Symbol;
                    Image   img    = ConvertSymbolToImage.Convert(symbol, 16, 16);
                    index = treeImages.Images.Add(img);

                    TreeNodeSymbol tnSymbol = new TreeNodeSymbol()
                    {
                        Name = pTSSR.Label, CustomValue = symbol
                    };
                    tnSymbol.ImageIndex = index;
                    tnComLayer.Add(tnSymbol);
                }
                else
                {
                    //MessageBox.Show("未处理的ITinRenderer类型:  " + renderer.GetType().FullName);
                }
            }
            else
            {
                //MessageBox.Show("未处理的Renderer类型:  " + renderer.GetType().FullName);
            }
        }
Ejemplo n.º 10
0
        public static void AddComLayerNode(TreeList parentTree, TreeNodeComLayer node, ILayer layer, List <ILayer> loadlayer)
        {
            object           renderer = null;
            TreeNodeComLayer comLayerNode;

            if (layer is ICadLayer)
            {
                return;
            }
            if (node == null)//如果当前节点为空
            {
                comLayerNode = new TreeNodeComLayer()
                {
                    Name = layer.Name, CustomValue = layer
                };
                comLayerNode.OwnNode    = parentTree.AppendNode(new object[] { comLayerNode.Name }, (TreeListNode)null);//为树创建根节点
                comLayerNode.ImageIndex = 0;
                node             = comLayerNode;
                rootNode         = comLayerNode;
                rootNode.Visible = true;
            }
            else
            {
                comLayerNode = new TreeNodeComLayer()
                {
                    Name = layer.Name, CustomValue = layer
                };
                comLayerNode.Visible = true;
                if (comLayerNode.Name.Contains("注记"))
                {
                    comLayerNode.ImageIndex = 10;
                }
                else
                {
                    comLayerNode.ImageIndex = 0;
                }
                node.Add(comLayerNode);                 //为当前节点添加子节点
            }
            if (layer is ESRI.ArcGIS.Carto.IGroupLayer) //如果图层是复合图层组
            {
                ICompositeLayer comLayer = layer as ICompositeLayer;
                for (int i = 0; i < comLayer.Count; i++)
                {
                    AddComLayerNode(parentTree, comLayerNode, comLayer.get_Layer(i), loadlayer);//递归
                    comLayerNode.CollapseAll();
                }
            }
            else if (layer is IGeoFeatureLayer) //如果图层是地理要素图层
            {
                loadlayer.Add(layer);           //将该图层添加到待加载图层
                IGeoFeatureLayer geoFtLayer = layer as IGeoFeatureLayer;

                if (geoFtLayer == null)
                {
                    return;
                }
                if (geoFtLayer.FeatureClass == null)
                {
                    node.CollapseAll(); return;
                }
                esriGeometryType geoType = geoFtLayer.FeatureClass.ShapeType;
                switch (geoType)
                {
                case esriGeometryType.esriGeometryPoint:
                case esriGeometryType.esriGeometryMultipoint:
                    comLayerNode.ImageIndex = 4;
                    break;

                case esriGeometryType.esriGeometryLine:
                case esriGeometryType.esriGeometryPolyline:
                    comLayerNode.ImageIndex = 5;
                    break;

                case esriGeometryType.esriGeometryPolygon:
                    comLayerNode.ImageIndex = 6;
                    break;
                }
                renderer = geoFtLayer.Renderer;

                AddSymbolNode(comLayerNode, renderer);//对当前树节点进行符号化
                node.CollapseAll();
                comLayerNode.CollapseAll();
                if (geoFtLayer.FeatureClass == null)
                {
                    return;
                }
                DF2DFeatureClass dffc = new DF2DFeatureClass(geoFtLayer.FeatureClass, comLayerNode);//根据当前要素类创建DF2DFC,并添加到管理类
                dffc.SetLayer(layer);
                DF2DFeatureClassManager.Instance.Add(dffc);
                DF2DFeatureClassManager.Instance.Add(comLayerNode);
            }

            else if (layer is IRasterLayer) //如果图层是栅格图层
            {
                loadlayer.Add(layer);       //将该图层添加到待加载图层
                //comLayerNode.Visible = true; //当前图层为可见(显示影像图)
                IRasterLayer rasterLayer = layer as IRasterLayer;
                IRaster      raster      = rasterLayer.Raster;
                if (raster == null)
                {
                    return;
                }
                DF2DRaster dfrd = new DF2DRaster(raster, comLayerNode);
                dfrd.SetLayer(layer);
                DF2DRasterManager.Instance.Add(dfrd);
            }
            else if (layer is IAnnotationLayer)
            {
                loadlayer.Add(layer);
                IFeatureLayer featureLayer = layer as IFeatureLayer;
                if (featureLayer.FeatureClass == null)
                {
                    return;
                }
                DF2DFeatureClass dffc = new DF2DFeatureClass(featureLayer.FeatureClass, comLayerNode);
                dffc.SetLayer(layer);
                DF2DFeatureClassManager.Instance.Add(dffc);
                DF2DFeatureClassManager.Instance.Add(comLayerNode);
            }


            else
            {
                loadlayer.Add(layer);//其它图层也加入待加载图层
            }
        }