Example #1
0
        public frmMScatterplot()
        {
            try
            {
                InitializeComponent();
                m_pForm       = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
                m_pActiveView = m_pForm.axMapControl1.ActiveView;

                for (int i = 0; i < m_pForm.axMapControl1.LayerCount; i++)
                {
                    cboTargetLayer.Items.Add(m_pForm.axMapControl1.get_Layer(i).Name);

                    //IFeatureLayer pFeatureLayer = (IFeatureLayer)m_pActiveView.FocusMap.get_Layer(i);

                    //if (pFeatureLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon)
                    //    cboTargetLayer.Items.Add(m_pForm.axMapControl1.get_Layer(i).Name);
                }

                m_pSnippet = new clsSnippet();
                m_pEngine  = m_pForm.pEngine;
                try
                {
                    m_pEngine.Evaluate("library(spdep); library(maptools)");
                }
                catch
                {
                    MessageBox.Show("Please checked R packages installed in your local computer.");
                }
            }
            catch (Exception ex)
            {
                frmErrorLog pfrmErrorLog = new frmErrorLog(); pfrmErrorLog.ex = ex; pfrmErrorLog.ShowDialog();
                return;
            }
        }
Example #2
0
 public frmMScatterResults()
 {
     InitializeComponent();
     //pSnippet = new clsSnippet();
     m_pBL      = new clsBrusingLinking();
     m_pSnippet = new clsSnippet();
 }
Example #3
0
 public frmAdvSWM()
 {
     InitializeComponent();
     m_pSnippet = new clsSnippet();
     m_pForm    = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
     m_pEngine  = m_pForm.pEngine;
 }
Example #4
0
        public frmLocalSAM()
        {
            try
            {
                InitializeComponent();
                m_pForm       = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
                m_pActiveView = m_pForm.axMapControl1.ActiveView;
                m_pEngine     = m_pForm.pEngine;

                for (int i = 0; i < m_pForm.axMapControl1.LayerCount; i++)
                {
                    //IFeatureLayer pFeatureLayer = (IFeatureLayer)m_pActiveView.FocusMap.get_Layer(i);

                    //if (pFeatureLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon) //Only polygon to make spatial weight matrix 10/9/15 HK
                    //    cboTargetLayer.Items.Add(m_pForm.axMapControl1.get_Layer(i).Name);
                    cboTargetLayer.Items.Add(m_pForm.axMapControl1.get_Layer(i).Name); //It supports all types, but visualizaiton for point data is under developing. 080317 HK
                }

                m_pSnippet = new clsSnippet();
                m_pEngine.Evaluate("rm(list=ls(all=TRUE))");
                m_pEngine.Evaluate("library(spdep); library(maptools)");
            }
            catch (Exception ex)
            {
                frmErrorLog pfrmErrorLog = new frmErrorLog(); pfrmErrorLog.ex = ex; pfrmErrorLog.ShowDialog();
                return;
            }
        }
Example #5
0
        public frmChoroplethwithOverlay()
        {
            try
            {
                InitializeComponent();
                mForm       = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
                pActiveView = mForm.axMapControl1.ActiveView;
                pSnippet    = new clsSnippet();

                for (int i = 0; i < mForm.axMapControl1.LayerCount; i++)
                {
                    IFeatureLayer pFeatureLayer = (IFeatureLayer)pActiveView.FocusMap.get_Layer(i);

                    if (pFeatureLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon)
                    {
                        cboSourceLayer.Items.Add(mForm.axMapControl1.get_Layer(i).Name);
                    }
                }
            }
            catch (Exception ex)
            {
                frmErrorLog pfrmErrorLog = new frmErrorLog(); pfrmErrorLog.ex = ex; pfrmErrorLog.ShowDialog();
                return;
            }
        }
Example #6
0
        private void btnApply_Click(object sender, EventArgs e)
        {
            clsSnippet     pSnippet        = new clsSnippet();
            FormCollection pFormCollection = System.Windows.Forms.Application.OpenForms;
            frmSymbology   pfrmSymbology   = null;

            for (int j = 0; j < pFormCollection.Count; j++)
            {
                if (pFormCollection[j].Name == "frmSymbology")//Brushing to Histogram
                {
                    pfrmSymbology = pFormCollection[j] as frmSymbology;
                }
            }

            ISimpleFillSymbol pBackFillSymbol = null;

            if (pfrmSymbology != null)
            {
                pBackFillSymbol = new SimpleFillSymbolClass();
                IRgbColor pBackRGB = new RgbColorClass();
                pBackRGB = pSnippet.getRGB(picSymColor.BackColor.R, picSymColor.BackColor.G, picSymColor.BackColor.B);
                pBackFillSymbol.Color = (IColor)pBackRGB;
                ICartographicLineSymbol pBackOut = new CartographicLineSymbolClass();
                IRgbColor pBackOutRGB            = new RgbColorClass();
                pBackOutRGB                = pSnippet.getRGB(picOutColor.BackColor.R, picOutColor.BackColor.G, picOutColor.BackColor.B);
                pBackOut.Color             = (IColor)pBackOutRGB;
                pBackOut.Width             = Convert.ToDouble(nudOutWidth.Value);
                pBackFillSymbol.Outline    = pBackOut;
                pfrmSymbology.m_BackSymbol = pBackFillSymbol;
            }
            this.Close();
        }
Example #7
0
        public frmVariogramCloud()
        {
            try
            {
                InitializeComponent();
                m_pSnippet    = new clsSnippet();
                m_pForm       = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
                m_pActiveView = m_pForm.axMapControl1.ActiveView;

                for (int i = 0; i < m_pForm.axMapControl1.LayerCount; i++)
                {
                    IFeatureLayer pFeatureLayer = (IFeatureLayer)m_pActiveView.FocusMap.get_Layer(i);

                    if (pFeatureLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPoint)
                    {
                        cboTargetLayer.Items.Add(m_pForm.axMapControl1.get_Layer(i).Name);
                    }
                }
            }
            catch (Exception ex)
            {
                frmErrorLog pfrmErrorLog = new frmErrorLog(); pfrmErrorLog.ex = ex; pfrmErrorLog.ShowDialog();
                return;
            }
        }
Example #8
0
        public frmBiOutlier()
        {
            try
            {
                InitializeComponent();
                m_pForm       = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
                m_pActiveView = m_pForm.axMapControl1.ActiveView;

                for (int i = 0; i < m_pForm.axMapControl1.LayerCount; i++)
                {
                    IFeatureLayer pFeatureLayer = (IFeatureLayer)m_pActiveView.FocusMap.get_Layer(i);

                    if (pFeatureLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon) //Only polygon to make spatial weight matrix 10/9/15 HK
                    {
                        cboTargetLayer.Items.Add(m_pForm.axMapControl1.get_Layer(i).Name);
                    }
                }

                m_pSnippet = new clsSnippet();
                MakingSymbols();
            }
            catch (Exception ex)
            {
                frmErrorLog pfrmErrorLog = new frmErrorLog(); pfrmErrorLog.ex = ex; pfrmErrorLog.ShowDialog();
                return;
            }
        }
Example #9
0
        public frmSAutoCorr()
        {
            try
            {
                InitializeComponent();
                m_pForm       = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
                m_pActiveView = m_pForm.axMapControl1.ActiveView;

                for (int i = 0; i < m_pForm.axMapControl1.LayerCount; i++)
                {
                    //IFeatureLayer pFeatureLayer = (IFeatureLayer)m_pActiveView.FocusMap.get_Layer(i);
                    //if (pFeatureLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon)
                    //Deprecated: Updated to accept point and polygon dataset.

                    cboTargetLayer.Items.Add(m_pForm.axMapControl1.get_Layer(i).Name);
                }

                m_pSnippet = new clsSnippet();
                m_pEngine  = m_pForm.pEngine;
                m_pEngine.Evaluate("rm(list=ls(all=TRUE))");
                m_pEngine.Evaluate("library(spdep); library(maptools)");
            }
            catch (Exception ex)
            {
                frmErrorLog pfrmErrorLog = new frmErrorLog(); pfrmErrorLog.ex = ex; pfrmErrorLog.ShowDialog();
                return;
            }
        }
Example #10
0
        private void cboSourceLayer_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                clsSnippet pSnippet     = new clsSnippet();
                string     strLayerName = cboSourceLayer.Text;

                int    intLIndex = pSnippet.GetIndexNumberFromLayerName(pActiveView, strLayerName);
                ILayer pLayer    = mForm.axMapControl1.get_Layer(intLIndex);

                pFLayer = pLayer as IFeatureLayer;
                ESRI.ArcGIS.Geodatabase.IFeatureClass pFClass = pFLayer.FeatureClass;

                IFields fields = pFClass.Fields;

                cboValueField.Items.Clear();
                cboUField.Items.Clear();

                for (int i = 0; i < fields.FieldCount; i++)
                {
                    cboValueField.Items.Add(fields.get_Field(i).Name);
                    cboUField.Items.Add(fields.get_Field(i).Name);
                }

                DrawLegend();
            }
            catch (Exception ex)
            {
                frmErrorLog pfrmErrorLog = new frmErrorLog(); pfrmErrorLog.ex = ex; pfrmErrorLog.ShowDialog();
                return;
            }
        }
Example #11
0
        public frmClassSeparability()
        {
            try
            {
                InitializeComponent();
                mForm       = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
                pEngine     = mForm.pEngine;
                pActiveView = mForm.axMapControl1.ActiveView;
                pSnippet    = new clsSnippet();

                for (int i = 0; i < mForm.axMapControl1.LayerCount; i++)
                {
                    IFeatureLayer pFeatureLayer = (IFeatureLayer)pActiveView.FocusMap.get_Layer(i);

                    if (pFeatureLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon)
                    {
                        cboSourceLayer.Items.Add(mForm.axMapControl1.get_Layer(i).Name);
                    }
                }

                intRounding = 2; //Default
            }
            catch (Exception ex)
            {
                MessageBox.Show(this.Handle.ToString() + " Error:" + ex.Message);
                return;
            }
        }
        void IFeatureRenderer.Draw(ESRI.ArcGIS.Geodatabase.IFeatureCursor Cursor, ESRI.ArcGIS.esriSystem.esriDrawPhase DrawPhase, IDisplay Display, ESRI.ArcGIS.esriSystem.ITrackCancel TrackCancel)
        {
            // do not draw features if no display
            if (Display == null)
            {
                return;
            }
            else
            {
                clsSnippet pSnippet = new clsSnippet();
                IFeature   pFeat    = null;

                intBrksCount = pCSMembers.ClassBrks.Length - 1;
                ISimpleFillSymbol pSFillSym = new SimpleFillSymbolClass();

                ICartographicLineSymbol pOutLines = new CartographicLineSymbol();
                pOutLines.Width = dblLineWidth;
                pOutLines.Color = (IColor)pLineRgb;

                pFeat = Cursor.NextFeature();
                IRgbColor pRGBColor = null;
                int       i         = 0;
                double    dblValue  = 0;

                //Start Loop
                while (pFeat != null)
                {
                    dblValue = Convert.ToDouble(pFeat.get_Value(intEstIdx));
                    IFeatureDraw pFeatDraw = (IFeatureDraw)pFeat;
                    pSFillSym         = new SimpleFillSymbolClass();
                    pSFillSym.Outline = pOutLines;
                    pRGBColor         = null;

                    for (int j = 0; j < intBrksCount; j++)
                    {
                        if (j == 0)
                        {
                            if (dblValue >= pCSMembers.ClassBrks[0] && dblValue <= pCSMembers.ClassBrks[1])
                            {
                                pRGBColor = pSnippet.getRGB(pCSMembers.Colors[0, 0], pCSMembers.Colors[0, 1], pCSMembers.Colors[0, 2]);
                            }
                        }
                        else
                        {
                            if (dblValue > pCSMembers.ClassBrks[j] && dblValue <= pCSMembers.ClassBrks[j + 1])
                            {
                                pRGBColor = pSnippet.getRGB(pCSMembers.Colors[j, 0], pCSMembers.Colors[j, 1], pCSMembers.Colors[j, 2]);
                            }
                        }
                    }
                    pSFillSym.Color = (IColor)pRGBColor;
                    Display.SetSymbol((ISymbol)pSFillSym);
                    pFeatDraw.Draw(esriDrawPhase.esriDPGeography, Display, (ISymbol)pSFillSym, true,
                                   null, esriDrawStyle.esriDSNormal);
                    i++;
                    pFeat = Cursor.NextFeature();
                }
            }
        }
Example #13
0
        public frmConnectivityMap()
        {
            InitializeComponent();
            m_pBL = new clsBrusingLinking();

            m_pSnippet    = new clsSnippet();
            m_pActiveView = ConMapControl.ActiveView;
        }
Example #14
0
        //Create Legend
        public void CreateLegend()
        {
            clsSnippet pSnippet = new clsSnippet();

            //Create Legend Group
            m_pLegendGroup = new LegendGroup();

            m_pLegendGroup.Heading  = "Robustness";
            m_pLegendGroup.Editable = true;
            m_pLegendGroup.Visible  = true;

            //For Values
            ILegendClass legendClass = new LegendClass();

            ILineFillSymbol pLineFillSym = new LineFillSymbolClass();



            double dblInstantSep = (dblFromSep - dblToSep) / Convert.ToDouble(intUncernBreakCount - 2);

            for (int i = 0; i < intUncernBreakCount; i++)
            {
                legendClass = new LegendClass();
                if (i == intUncernBreakCount - 1)
                {
                    legendClass.Label = "1";
                }
                else if (i == intUncernBreakCount - 2)
                {
                    legendClass.Label = arrRobustBrks[i].ToString() + " - " + (1 - (1 * Math.Pow(0.1, intRoundingDigits))).ToString();
                }
                else
                {
                    legendClass.Label = arrRobustBrks[i].ToString() + " - " + (arrRobustBrks[i + 1] - (1 * Math.Pow(0.1, intRoundingDigits))).ToString();
                }

                pLineFillSym = new LineFillSymbolClass();

                pLineFillSym.Angle            = dblAngle;
                pLineFillSym.Color            = pLineColor;
                pLineFillSym.LineSymbol.Width = dblLinewidth;
                if (i == (intUncernBreakCount - 1))
                {
                    pLineFillSym.Separation = double.MaxValue;
                }
                else
                {
                    pLineFillSym.Separation = dblToSep + (dblInstantSep * Convert.ToDouble(i));
                }
                legendClass.Symbol = pLineFillSym as ISymbol;
                m_pLegendGroup.AddClass(legendClass);
            }
        }
Example #15
0
        private void frmCreatingEVMaps_Load(object sender, EventArgs e)
        {
            mForm       = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
            pActiveView = mForm.axMapControl1.ActiveView;

            for (int k = 1; k <= intNSelectedEVs; k++)
            {
                lstSelEVs.Items.Add((object)vecNames[k + nIDepen]);
            }

            pSnippet = new clsSnippet();
        }
Example #16
0
        //private REngine m_pEngine;

        public frmCreateFlowLines()
        {
            try
            {
                InitializeComponent();
                m_pForm       = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
                m_pActiveView = m_pForm.axMapControl1.ActiveView;
                m_pSnippet    = new clsSnippet();
            }
            catch (Exception ex)
            {
                frmErrorLog pfrmErrorLog = new frmErrorLog(); pfrmErrorLog.ex = ex; pfrmErrorLog.ShowDialog();
                return;
            }
        }
Example #17
0
        public frmCreateSWM_inR()
        {
            InitializeComponent();
            m_pForm       = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
            m_pActiveView = m_pForm.axMapControl1.ActiveView;

            for (int i = 0; i < m_pForm.axMapControl1.LayerCount; i++)
            {
                cboTargetLayer.Items.Add(m_pForm.axMapControl1.get_Layer(i).Name);
            }

            m_pSnippet = new clsSnippet();
            m_pEngine  = m_pForm.pEngine;
            m_pEngine.Evaluate("library(spdep); library(maptools); library(MASS)");
        }
Example #18
0
 public frmAttributeTable()
 {
     try
     {
         InitializeComponent();
         m_pSnippet    = new clsSnippet();
         m_pBL         = new clsBrusingLinking();
         m_pForm       = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
         m_pActiveView = m_pForm.axMapControl1.ActiveView;
     }
     catch (Exception ex)
     {
         frmErrorLog pfrmErrorLog = new frmErrorLog(); pfrmErrorLog.ex = ex; pfrmErrorLog.ShowDialog();
         return;
     }
 }
Example #19
0
        public override void OnMouseDown(int Button, int Shift, int X, int Y)
        {
            m_pForm = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
            FormCollection pFormCollection = System.Windows.Forms.Application.OpenForms;
            IActiveView    pActiveView     = m_pForm.axMapControl1.ActiveView;

            clsSnippet pSnippet = new clsSnippet();

            //Using IRubberband
            IEnvelope pEnvelop = pSnippet.DrawRectangle(pActiveView);

            if (pEnvelop.IsEmpty)
            {
                int    x      = X;
                int    y      = Y;
                IPoint pPoint = pActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(x, y);


                double Tol_x = x / int.MaxValue;
                double Tol_y = y / int.MaxValue;
                pEnvelop = pPoint.Envelope;
                pEnvelop.Expand(Tol_x, Tol_y, false);
            }

            ISpatialFilter pSpatialFilter = new SpatialFilterClass();

            pSpatialFilter.Geometry   = pEnvelop;
            pSpatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;

            for (int i = 0; i < pActiveView.FocusMap.LayerCount; i++)
            {
                ILayer pLayer = m_pForm.axMapControl1.get_Layer(i);

                IFeatureLayer pFLayer = (IFeatureLayer)pLayer;

                if (pFLayer.Visible)
                {
                    //Brushing to Mapcontrol
                    string ShapeFieldName = pFLayer.FeatureClass.ShapeFieldName;
                    pSpatialFilter.GeometryField = pFLayer.FeatureClass.ShapeFieldName;
                    BrushingOnMapControl(pSpatialFilter, pActiveView, pFLayer);
                    m_pBL.BrushingToOthers(pFLayer, m_pForm.Handle);
                }
            }
            pActiveView.GraphicsContainer.DeleteAllElements();
            pActiveView.Refresh();
        }
Example #20
0
        public frmRobustness()
        {
            InitializeComponent();
            mForm       = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
            pActiveView = mForm.axMapControl1.ActiveView;
            pSnippet    = new clsSnippet();

            for (int i = 0; i < mForm.axMapControl1.LayerCount; i++)
            {
                IFeatureLayer pFeatureLayer = (IFeatureLayer)pActiveView.FocusMap.get_Layer(i);

                if (pFeatureLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon)
                {
                    cboSourceLayer.Items.Add(mForm.axMapControl1.get_Layer(i).Name);
                }
            }
        }
Example #21
0
        public frmParallPlotforRS()
        {
            InitializeComponent();
            m_pForm = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;

            m_pActiveView = m_pForm.axMapControl1.ActiveView;
            m_pSnippet    = new clsSnippet();

            for (int i = 0; i < m_pForm.axMapControl1.LayerCount; i++)
            {
                ILayer pLayer = m_pActiveView.FocusMap.get_Layer(i);

                if (pLayer is IRasterLayer)
                {
                    cboOriImage.Items.Add(pLayer.Name);
                    cboClsImage.Items.Add(pLayer.Name);
                    cboProbImage.Items.Add(pLayer.Name);
                }
            }
        }
Example #22
0
        public frmBoxplot()
        {
            try
            {
                InitializeComponent();
                m_pForm       = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
                m_pActiveView = m_pForm.axMapControl1.ActiveView;

                for (int i = 0; i < m_pForm.axMapControl1.LayerCount; i++)
                {
                    cboTargetLayer.Items.Add(m_pForm.axMapControl1.get_Layer(i).Name);
                }
                m_pSnippet = new clsSnippet();
            }
            catch
            {
                MessageBox.Show("Error 221");
                return;
            }
        }
Example #23
0
        public int intLoadingPlaces; //(1 from Properties, 2 from ClassSeparability, 3 from Sample Optimization, 4 from CCMaps, 08/03/16 HK)

        public frmColorRamps()
        {
            //Close previous color Ramp form


            InitializeComponent();
            intRampsCounts = 0;
            arrTotalColors = new int[intMaximumRamps, 6];
            pSnippet       = new clsSnippet();

            IntPtr ThisHandle        = this.Handle;
            int    intOpenedFormsCnt = System.Windows.Forms.Application.OpenForms.Count;

            for (int i = 0; i < intOpenedFormsCnt; i++)
            {
                if (System.Windows.Forms.Application.OpenForms[i].Name == this.Name && System.Windows.Forms.Application.OpenForms[i].Handle != ThisHandle)
                {
                    System.Windows.Forms.Application.OpenForms[i].Close();
                }
            }
        }
Example #24
0
        public frmAddField()
        {
            try
            {
                InitializeComponent();
                mForm       = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
                pActiveView = mForm.axMapControl1.ActiveView;

                for (int i = 0; i < mForm.axMapControl1.LayerCount; i++)
                {
                    cboLayer.Items.Add(mForm.axMapControl1.get_Layer(i).Name);
                }

                pSnippet = new clsSnippet();
            }
            catch (Exception ex)
            {
                frmErrorLog pfrmErrorLog = new frmErrorLog(); pfrmErrorLog.ex = ex; pfrmErrorLog.ShowDialog();
                return;
            }
        }
Example #25
0
        public frmHistogram()
        {
            try
            {
                InitializeComponent();
                m_pForm       = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
                m_pActiveView = m_pForm.axMapControl1.ActiveView;
                m_pEngine     = m_pForm.pEngine;

                for (int i = 0; i < m_pForm.axMapControl1.LayerCount; i++)
                {
                    cboTargetLayer.Items.Add(m_pForm.axMapControl1.get_Layer(i).Name);
                }

                m_pSnippet = new clsSnippet();
            }
            catch (Exception ex)
            {
                frmErrorLog pfrmErrorLog = new frmErrorLog(); pfrmErrorLog.ex = ex; pfrmErrorLog.ShowDialog();
                return;
            }
        }
Example #26
0
        private void cboTargetLayer_SelectedIndexChanged(object sender, EventArgs e)
        {
            clsSnippet pSnippet     = new clsSnippet();
            string     strLayerName = cboTargetLayer.Text;

            int    intLIndex = pSnippet.GetIndexNumberFromLayerName(pActiveView, strLayerName);
            ILayer pLayer    = mForm.axMapControl1.get_Layer(intLIndex);

            IFeatureLayer pFLayer = pLayer as IFeatureLayer;

            ESRI.ArcGIS.Geodatabase.IFeatureClass pFClass = pFLayer.FeatureClass;

            IFields fields = pFClass.Fields;

            cboXField.Items.Clear();
            cboYField.Items.Clear();

            for (int i = 0; i < fields.FieldCount; i++)
            {
                cboXField.Items.Add(fields.get_Field(i).Name);
                cboYField.Items.Add(fields.get_Field(i).Name);
            }
        }
        public frmAttUncernwithLocation()
        {
            try
            {
                InitializeComponent();

                mForm       = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
                pActiveView = mForm.axMapControl1.ActiveView;

                for (int i = 0; i < mForm.axMapControl1.LayerCount; i++)
                {
                    cboTargetLayer.Items.Add(mForm.axMapControl1.get_Layer(i).Name);
                    cboSourceLayer.Items.Add(mForm.axMapControl1.get_Layer(i).Name);
                }

                pSnippet = new clsSnippet();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this.Handle.ToString() + " Error:" + ex.Message);
                return;
            }
        }
Example #28
0
        public frmCCMapsResults()
        {
            try
            {
                InitializeComponent();

                m_pSnippet    = new clsSnippet();
                m_pBL         = new clsBrusingLinking();
                m_pForm       = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;
                m_pActiveView = m_pForm.axMapControl1.ActiveView;

                //Create Color ramps for drawing event in combobox;
                cboColorRamp.DrawMode = DrawMode.OwnerDrawVariable;
                clsColorRamps pColorRamps = new clsColorRamps();
                m_colorRampNames = pColorRamps.colorRampNames;
                m_colorLists     = pColorRamps.CreateColorList();
            }
            catch (Exception ex)
            {
                frmErrorLog pfrmErrorLog = new frmErrorLog(); pfrmErrorLog.ex = ex; pfrmErrorLog.ShowDialog();
                return;
            }
        }
Example #29
0
        public frmEvalRobustness()
        {
            try
            {
                InitializeComponent();
                mForm = System.Windows.Forms.Application.OpenForms["MainForm"] as MainForm;

                m_pActiveView = mForm.axMapControl1.ActiveView;
                m_pSnippet    = new clsSnippet();

                for (int i = 0; i < mForm.lstRenderedLayers.Count; i++)
                {
                    cboSourceLayer.Items.Add(mForm.lstRenderedLayers[i].strLayerName);
                }

                intRounding = 2; //Default
            }
            catch (Exception ex)
            {
                frmErrorLog pfrmErrorLog = new frmErrorLog(); pfrmErrorLog.ex = ex; pfrmErrorLog.ShowDialog();
                return;
            }
        }
Example #30
0
        //Create Legend
        public void CreateLegend()
        {
            clsSnippet pSnippet = new clsSnippet();

            //Create Legend Group
            m_pLegendGroup          = new LegendGroup();
            m_pLegendGroup.Heading  = m_strOriRenderField;
            m_pLegendGroup.Editable = true;
            m_pLegendGroup.Visible  = true;

            ILegendClass legendClass = new LegendClass();

            legendClass.Label = Math.Round(dblMaxValue, 0).ToString();

            IStackedChartSymbol stackedChartSymbol = new StackedChartSymbolClass();

            //IBarChartSymbol barChartSymbol = new BarChartSymbolClass();
            stackedChartSymbol.Width = 10;
            if (bln3Dfeature)
            {
                I3DChartSymbol p3DChartSymbol = stackedChartSymbol as I3DChartSymbol;
                p3DChartSymbol.Display3D = true;
                p3DChartSymbol.Thickness = 3;
            }
            //IMarkerSymbol markerSymbol = stackedChartSymbol as IMarkerSymbol;
            //markerSymbol.Size = 50;
            IChartSymbol chartSymbol = stackedChartSymbol as IChartSymbol;

            chartSymbol.MaxValue = dblMaxValue;

            ISymbolArray symbolArray = stackedChartSymbol as ISymbolArray;
            //Stacked Symbol
            IFillSymbol fillSymbol = new SimpleFillSymbolClass();

            fillSymbol.Color         = pSnippet.getRGB(255, 0, 0);
            fillSymbol.Outline.Color = pSnippet.getRGB(0, 0, 0);
            symbolArray.AddSymbol(fillSymbol as ISymbol);
            chartSymbol.set_Value(0, dblMaxUncern);

            //fillSymbol = new SimpleFillSymbolClass();
            //fillSymbol.Color = pSnippet.getRGB(255, 0, 0);
            //fillSymbol.Outline.Color = pSnippet.getRGB(0, 0, 0);
            //symbolArray.AddSymbol(fillSymbol as ISymbol);
            //chartSymbol.set_Value(1, dblMaxUncern);

            fillSymbol               = new SimpleFillSymbolClass();
            fillSymbol.Color         = pSnippet.getRGB(255, 255, 255);
            fillSymbol.Outline.Color = pSnippet.getRGB(0, 0, 0);
            symbolArray.AddSymbol(fillSymbol as ISymbol);
            chartSymbol.set_Value(1, dblMaxEstimate - dblMaxUncern);

            legendClass.Symbol = (ISymbol)chartSymbol;
            m_pLegendGroup.AddClass(legendClass);

            //Bounds
            legendClass       = new LegendClass();
            legendClass.Label = "Upper Bound";
            ISimpleFillSymbol pLegendUncerSymbol = new SimpleFillSymbol();

            pLegendUncerSymbol.Color         = pSnippet.getRGB(0, 0, 255);
            pLegendUncerSymbol.Outline.Color = pSnippet.getRGB(0, 0, 0);

            legendClass.Symbol = (ISymbol)pLegendUncerSymbol;
            m_pLegendGroup.AddClass(legendClass);

            legendClass                      = new LegendClass();
            legendClass.Label                = "Lower Bound";
            pLegendUncerSymbol               = new SimpleFillSymbol();
            pLegendUncerSymbol.Color         = pSnippet.getRGB(255, 0, 0);
            pLegendUncerSymbol.Outline.Color = pSnippet.getRGB(0, 0, 0);

            legendClass.Symbol = (ISymbol)pLegendUncerSymbol;
            m_pLegendGroup.AddClass(legendClass);
        }