private void GenerateButton_Click(object sender, EventArgs e)
        {
            var profilesSets = new List <ProfileSession>();

            foreach (var profileSetModel in profilesModels)
            {
                var profilesSet = profileSetModel.NodeProfileSession;
                profilesSet.ConvertLinesToEsriPolypile(ArcMap.Document.FocusMap.SpatialReference);

                profilesSets.Add(profilesSet);
            }

            try
            {
                if (SurfaceComboBox.SelectedItem != null)
                {
                    var arcSceneArguments = Feature3DManager.Get3DFeatures(SurfaceComboBox.SelectedItem.ToString(), profilesSets);
                    Visualization3DHandler.OpenProfilesSetIn3D(arcSceneArguments);
                }
                else
                {
                    //TODO: Exception message
                }
            }
            catch (Exception ex) {
                //TODO: Log Error
            }
        }
Exemple #2
0
            protected override void Dispose(bool disposing)
            {
                Visualization3DHandler.ClosingHandler();

                if (m_windowUI != null)
                {
                    m_windowUI.Dispose(disposing);
                }

                ////////////base.Dispose(disposing);
            }
Exemple #3
0
        private void GenerateButton_Click(object sender, EventArgs e)
        {
            var profilesSets = new List <ProfileSession>();

            foreach (var profileSetModel in profilesModels)
            {
                var profilesSet = profileSetModel.NodeProfileSession;
                profilesSet.ConvertLinesToEsriPolypile(ArcMap.Document.FocusMap.SpatialReference);

                profilesSets.Add(profilesSet);
            }

            try
            {
                if (SurfaceComboBox.SelectedItem != null)
                {
                    var arcSceneArguments = Feature3DManager.Get3DFeatures(SurfaceComboBox.SelectedItem.ToString(), profilesSets);

                    var selectedLayers = new object[4];
                    selectedLayers[0] = TransportLayerComboBox.SelectedItem;
                    selectedLayers[1] = BuildingsLayerComboBox.SelectedItem;
                    selectedLayers[2] = PlantsLayerComboBox.SelectedItem;
                    selectedLayers[3] = HydroLayerComboBox.SelectedItem;

                    var additionalLayers = new List <ILayer>();

                    foreach (var selectedLayer in selectedLayers)
                    {
                        if (selectedLayer != null)
                        {
                            additionalLayers.Add(ProfileLayers.PolygonLayers.First(layer => layer.Name == selectedLayer.ToString()));
                        }
                    }

                    arcSceneArguments.AdditionalLayers = additionalLayers;

                    Visualization3DHandler.OpenProfilesSetIn3D(arcSceneArguments);
                }
                else
                {
                    //TODO: Exception message
                }
            }
            catch (Exception ex)
            {
                //TODO: Log Error
            }
        }
Exemple #4
0
        private void GenerateButton_Click(object sender, EventArgs e)
        {
            try
            {
                var profilesSets = new List <ProfileSession>();

                foreach (var profileSetModel in profilesModels)
                {
                    var profilesSet = profileSetModel.NodeProfileSession;
                    profilesSet.ConvertLinesToEsriPolypile(ArcMap.Document.FocusMap.SpatialReference);

                    profilesSets.Add(profilesSet);
                }

                if (SurfaceComboBox.SelectedItem != null && (profilesSets.Count > 0 || visibilitySessionsModel.Count > 0))
                {
                    var arcSceneArguments = Feature3DManager.Get3DFeatures(SurfaceComboBox.SelectedItem.ToString(), profilesSets);

                    if (!String.IsNullOrEmpty(tbZFactor.Text))
                    {
                        arcSceneArguments.ZFactor = Convert.ToDouble(tbZFactor.Text);
                    }

                    if (DraperyLayerComboBox.SelectedItem != null)
                    {
                        var draperyLayer = EsriTools.GetLayer(DraperyLayerComboBox.SelectedItem.ToString(),
                                                              ArcMap.Document.FocusMap) as IRasterLayer;

                        arcSceneArguments.DraperyLayer = draperyLayer.FilePath;
                    }

                    arcSceneArguments.AdditionalLayers      = GetAdditionalLayers();
                    arcSceneArguments.VisibilityResultsInfo = GetVisibilityResultsInfo();

                    Visualization3DHandler.OpenProfilesSetIn3D(arcSceneArguments, ArcMap.Document.ActiveView);
                }
                else
                {
                    MessageBox.Show(context.LackOfParametersMessage, context.MessageBoxTitle);
                }
            }
            catch (Exception ex)
            {
                log.ErrorEx($"> GenerateButton_Click. Exception: {ex.Message}");
            }
        }
 private void ProfilesVisualizationForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     Visualization3DHandler.ClosingHandler();
 }