Ejemplo n.º 1
0
        public frmDEMSymbology(byte[] rendererValue, string rendererType, ESRI.ArcGIS.Controls.esriSymbologyStyleClass pStyleClass, List <ESRI.ArcGIS.Geodatabase.IField> pFields)
        {
            _Layer           = null;
            m_StyleClass     = pStyleClass;
            m_RendererObject = new Dictionary <string, IRasterRendererUI>();
            _RasterRenderer  = GetRasterRenderer(rendererValue, rendererType);
            m_FieldInfo      = new List <FieldInfo>();
            FieldInfo noneField = new FieldInfo();

            noneField.FieldName = "<NONE>";
            noneField.FieldDesc = "<NONE>";
            noneField.FieldType = ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeDate;
            m_FieldInfo.Add(noneField);

            if (pFields != null && pFields.Count != 0)
            {
                for (int i = 0; i < pFields.Count; i++)
                {
                    FieldInfo field = new FieldInfo();
                    //if ((pFields[i].VarType > 1 && pFields[i].VarType < 6 && pFields[i].Type != ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeOID)
                    //                || pFields[i].Type == ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeString)
                    if ((int)pFields[i].Type < 5)
                    {
                        field.FieldName = pFields[i].Name;
                        field.FieldDesc = pFields[i].AliasName;
                        field.FieldType = pFields[i].Type;
                        m_FieldInfo.Add(field);
                    }
                }
            }

            InitializeUI();
            InitRendererUI();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 从二进制获取符号方案
 /// </summary>
 /// <param name="renderValue"></param>
 /// <returns></returns>
 private ESRI.ArcGIS.Carto.IRasterRenderer  GetRasterRenderer(byte[] renderValue, string rendererType)
 {
     ESRI.ArcGIS.Carto.IRasterRenderer pRenderer = ModuleCommon.LoadRasterRendererFromByte(renderValue, rendererType);
     if (pRenderer == null)
     {
         pRenderer = ModuleCommon.CreateStretchColorRampRenderer();
     }
     return(pRenderer);
 }
Ejemplo n.º 3
0
        private void CreateRendererObject(string typeString)
        {
            if (m_RendererObject.ContainsKey(typeString))
            {
                return;
            }
            try
            {
                Type type = Type.GetType(typeString);
                if (type == null)
                {
                    return;
                }
                IRasterRendererUI rendererObject = Activator.CreateInstance(type) as IRasterRendererUI;

                ESRI.ArcGIS.Carto.IRasterRenderer pRasterRenderer = null;
                switch (rendererObject.RasterRendererType)
                {
                case enumRasterRendererType.StretchColorRampRenderer:
                    pRasterRenderer = ModuleCommon.CreateStretchColorRampRenderer();
                    break;

                case enumRasterRendererType.ClassifyColorRampRenderer:
                    pRasterRenderer = ModuleCommon.CreateClassifyColorRampRenderer();
                    break;

                case enumRasterRendererType.UniqueValueRenderer:
                    pRasterRenderer = ModuleCommon.CreateUniqueValueRasterRenderer();
                    break;

                case enumRasterRendererType.RGBRenderer:
                    pRasterRenderer = ModuleCommon.CreateRGBRenderer();
                    break;
                }

                if (_Layer == null)
                {
                    rendererObject.InitRasterRendererObject(m_FieldInfo, pRasterRenderer);
                }
                else
                {
                    rendererObject.InitRasterRendererObject(_Layer, pRasterRenderer);
                }
                m_RendererObject.Add(typeString, rendererObject);
            }
            catch (Exception ex)
            {
            }
        }
Ejemplo n.º 4
0
        public frmDEMSymbology(ILayer pLayer)
        {
            InitializeComponent();
            _Layer = pLayer;
            if (_Layer == null)
            {
                return;
            }
            m_RendererObject = new Dictionary <string, IRasterRendererUI>();
            _RasterRenderer  = GetRasterRenderer(pLayer);
            m_FieldInfo      = null;

            InitializeUI();
            InitRendererUI();
        }