private void btnCreate_Click(object sender, EventArgs e) { try { if (m_pFLayer == null) { return; } if (cboVariable.Text == "" || cboHorCon.Text == "" || cboVerCon.Text == "") { return; } frmCCMapsResults pfrmCCMapResults = new frmCCMapsResults(); pfrmCCMapResults.strHorConFldName = cboHorCon.Text; pfrmCCMapResults.strVerConFldName = cboVerCon.Text; pfrmCCMapResults.strVarFldName = cboVariable.Text; pfrmCCMapResults.Text = "C-C maps of " + m_pFLayer.Name; pfrmCCMapResults.intHorCnt = Convert.ToInt32(nudHor.Value); pfrmCCMapResults.intVerCnt = Convert.ToInt32(nudVer.Value); pfrmCCMapResults.pFLayer = m_pFLayer; pfrmCCMapResults.Show(); } catch (Exception ex) { frmErrorLog pfrmErrorLog = new frmErrorLog(); pfrmErrorLog.ex = ex; pfrmErrorLog.ShowDialog(); return; } }
private void BrushingToCCMaps(frmCCMapsResults pfrmCCMapResults, IFeatureLayer pFLayer, IFeatureSelection featureSelection) { if (pfrmCCMapResults.pFLayer == pFLayer) { pfrmCCMapResults.blnBrushingFromMapControl = true; IFeatureClass pFeatureClass = pFLayer.FeatureClass; string strFIDName = pFeatureClass.OIDFieldName; int intFIDIdx = pFeatureClass.FindField(strFIDName); ICursor pCursor = null; featureSelection.SelectionSet.Search(null, false, out pCursor); IRow pRow = pCursor.NextRow(); StringBuilder plotCommmand = new StringBuilder(); string whereClause = null; while (pRow != null) { plotCommmand.Append("(" + strFIDName + " = " + pRow.get_Value(intFIDIdx).ToString() + ") Or "); pRow = pCursor.NextRow(); } //Brushing on ArcView if (plotCommmand.Length > 3) { plotCommmand.Remove(plotCommmand.Length - 3, 3); whereClause = plotCommmand.ToString(); } else { return; } int intMapCtrlCnts = pfrmCCMapResults.intHorCnt * pfrmCCMapResults.intVerCnt; for (int i = 0; i < intMapCtrlCnts; i++) { string strName = "axMapControl" + i.ToString(); //AxMapControl MapCntrl = this.m_axMapControls[i].Object; IMapControl3 pMapCntrl = (IMapControl3)((AxMapControl)pfrmCCMapResults.pnMapCntrls.Controls[strName]).Object; IFeatureLayer pSelLayer = pMapCntrl.get_Layer(0) as IFeatureLayer; FeatureSelectionOnActiveView(whereClause, pMapCntrl.ActiveView, pSelLayer); } } pfrmCCMapResults.blnBrushingFromMapControl = false; }
public void BrushingToOthers(IFeatureLayer pFLayer, IntPtr intPtrParent) { try { FormCollection pFormCollection = System.Windows.Forms.Application.OpenForms; //IActiveView pActiveView = mForm.axMapControl1.ActiveView; if (pFLayer.Visible) { //Brushing to Mapcontrol string ShapeFieldName = pFLayer.FeatureClass.ShapeFieldName; IFeatureSelection featureSelection = (IFeatureSelection)pFLayer; for (int j = 0; j < pFormCollection.Count; j++) { if (pFormCollection[j].Handle != intPtrParent) // Brushing to Others { if (pFormCollection[j].Name == "frmHistResults") //Brushing to Histogram { frmHistResults pfrmHistResults = pFormCollection[j] as frmHistResults; BrushingToHistogram(pfrmHistResults, pFLayer, featureSelection); } if (pFormCollection[j].Name == "frmScatterPlotResults") //Brushing to Scatterplot { frmScatterPlotResults pfrmPointsPlot = pFormCollection[j] as frmScatterPlotResults; BrushingToScatterPlot(pfrmPointsPlot, pFLayer, featureSelection); } if (pFormCollection[j].Name == "frmQQPlotResults") //Brushing to QQPlot { frmQQPlotResults pfrmQQPlotResult = pFormCollection[j] as frmQQPlotResults; BrushingToQQPlot(pfrmQQPlotResult, pFLayer, featureSelection); } if (pFormCollection[j].Name == "frmAttributeTable")//Brushing to AttributeTable { frmAttributeTable pfrmAttTable = pFormCollection[j] as frmAttributeTable; BrushingToAttTable(pfrmAttTable, pFLayer, featureSelection); } if (pFormCollection[j].Name == "frmBoxPlotResults")//Brushing to AttributeTable { frmBoxPlotResults pfrmBoxPlotResult = pFormCollection[j] as frmBoxPlotResults; BrushingToBoxPlot(pfrmBoxPlotResult, pFLayer, featureSelection); } //if (pFormCollection[j].Name == "frmClassificationGraph")//Brushing to Optiize Graph //{ // frmClassificationGraph pfrmClassGraph = pFormCollection[j] as frmClassificationGraph; // BrushingToOptimizeGraph(pfrmClassGraph, pFLayer, featureSelection); //} //if (pFormCollection[j].Name == "frmCSDesign")//Brushing to CS Graph //{ // frmCSDesign pfrmCSDesign = pFormCollection[j] as frmCSDesign; // BrushingToClassSepGraph(pfrmCSDesign, pFLayer, featureSelection); //} if (pFormCollection[j].Name == "frmMScatterResults")//Brushing to Moran ScatterPlot { frmMScatterResults pfrmMScatterPlot = pFormCollection[j] as frmMScatterResults; BrushingToMScatterPlot(pfrmMScatterPlot, pFLayer, featureSelection); } if (pFormCollection[j].Name == "frmCCMapsResults")//Brushing to Moran ScatterPlot { frmCCMapsResults pfrmCCMApsResults = pFormCollection[j] as frmCCMapsResults; BrushingToCCMaps(pfrmCCMApsResults, pFLayer, featureSelection); } if (pFormCollection[j].Name == "frmBoxCox")//Brushing to Box-Cox transformation tool { frmBoxCox pfrmBoxCox = pFormCollection[j] as frmBoxCox; BrushingToBoxCox(pfrmBoxCox, pFLayer, featureSelection); } if (pFormCollection[j].Name == "frmCorrelogram_local")//Brushing to Correlogram { frmCorrelogram_local pfrmCorrelogram = pFormCollection[j] as frmCorrelogram_local; BrushingToCorrelogram(pfrmCorrelogram, pFLayer, featureSelection); } } } } } catch (Exception ex) { MessageBox.Show("Exception:" + ex.Message); return; } }