Пример #1
0
        public override void LoadChildNodes()
        {
            Nodes.Clear();

            foreach (Surface surf in ProjectManager.Project.ReferenceSurfaces)
            {
                TreeNodeItem nodSurface = new TreeNodeItem(surf, 5, ContextMenuStrip.Container);
                Nodes.Add(nodSurface);
                nodSurface.ContextMenuStrip.Items.Insert(1, new ToolStripMenuItem("Calculate Linear Extraction From Profile Route", Properties.Resources.Add, OnLinear));


                TreeNodeGroup nodError = new ErrorSurfaceGroup(nodSurface.Nodes, ContextMenuStrip.Container, surf);

                if (surf.LinearExtractions.Count > 0)
                {
                    TreeNodeGroup nodLinea = new LinearExtractionGrp(nodSurface.Nodes, surf, surf.Raster.GISFileInfo.Directory, ContextMenuStrip.Container);
                    nodLinea.Expand();
                }
            }

            if (Nodes.Count > 0)
            {
                Expand();
            }
        }
Пример #2
0
        private void OnLinear(object sender, EventArgs e)
        {
            ToolStripDropDownItem ctrl = sender as ToolStripDropDownItem;
            ContextMenuStrip      cms  = ctrl.Owner as ContextMenuStrip;
            TreeView     tre           = cms.SourceControl as TreeView;
            TreeNodeItem nodDEM        = tre.SelectedNode as TreeNodeItem;

            LinearExtraction.frmLinearExtractionProperties frm = new LinearExtraction.frmLinearExtractionProperties(nodDEM.Item as GCDProjectItem);
            EditTreeItem(frm);
        }
Пример #3
0
        public void OnViewResults(object sender, EventArgs e)
        {
            ToolStripMenuItem tsmi        = sender as ToolStripMenuItem;
            ContextMenuStrip  cms         = tsmi.Owner as ContextMenuStrip;
            TreeView          projectTree = cms.SourceControl as TreeView;
            TreeNodeItem      nodIC       = projectTree.SelectedNode as TreeNodeItem;
            InterComparison   ic          = nodIC.Item as InterComparison;

            if (ic._SummaryXML.Directory.Exists)
            {
                System.Diagnostics.Process.Start(ic._SummaryXML.Directory.FullName);
            }
        }
Пример #4
0
        public void OnViewResults(object sender, EventArgs e)
        {
            ToolStripMenuItem tsmi        = sender as ToolStripMenuItem;
            ContextMenuStrip  cms         = tsmi.Owner as ContextMenuStrip;
            TreeView          projectTree = cms.SourceControl as TreeView;
            TreeNodeItem      nodIC       = projectTree.SelectedNode as TreeNodeItem;

            GCDCore.Project.LinearExtraction.LinearExtraction le = nodIC.Item as GCDCore.Project.LinearExtraction.LinearExtraction;
            if (le.Database.Directory.Exists)
            {
                System.Diagnostics.Process.Start(le.Database.Directory.FullName);
            }
        }
Пример #5
0
        public override void LoadChildNodes()
        {
            Nodes.Clear();

            foreach (ProfileRoute route in ProjectManager.Project.ProfileRoutes)
            {
                TreeNodeItem nodMask = new TreeNodeItem(route, route.ProfileRouteType == ProfileRoute.ProfileRouteTypes.Transect ? 15 : 18, ContextMenuStrip.Container);
                Nodes.Add(nodMask);
            }

            if (Nodes.Count > 0)
            {
                Expand();
            }
        }
Пример #6
0
 public void OnAddToMap(object sender, EventArgs e)
 {
     foreach (TreeNode childNode in Nodes)
     {
         if (childNode is TreeNodeItem)
         {
             TreeNodeItem nodItem = childNode as TreeNodeItem;
             if (nodItem.Item is GCDProjectRasterItem)
             {
                 ProjectManager.OnAddRasterToMap(nodItem.Item as GCDProjectRasterItem);
             }
             else if (nodItem.Item is GCDCore.Project.Masks.Mask)
             {
                 ProjectManager.OnAddVectorToMap(nodItem.Item as GCDCore.Project.Masks.Mask);
             }
         }
     }
 }
Пример #7
0
        public override void LoadChildNodes()
        {
            Nodes.Clear();

            // Add all the project inter-comparisons

            foreach (InterComparison ic in ProjectManager.Project.InterComparisons)
            {
                TreeNodeItem nodIC = new TreeNodeItem(ic, 10, ContextMenuStrip.Container);
                nodIC.ContextMenuStrip.Items.RemoveAt(0);
                nodIC.ContextMenuStrip.Items.Insert(0, new ToolStripMenuItem("View Inter-Comparison folder", Properties.Resources.GCD, OnViewResults));
                Nodes.Add(nodIC);
            }

            if (Nodes.Count > 0)
            {
                Expand();
            }
        }
Пример #8
0
        public override void LoadChildNodes()
        {
            Nodes.Clear();

            List <GCDCore.Project.LinearExtraction.LinearExtraction> LEs = null;

            if (Surface is Surface)
            {
                LEs = ((Surface)Surface).LinearExtractions;
            }
            else if (Surface is DoDBase)
            {
                LEs = ((DoDBase)Surface).LinearExtractions;
            }

            foreach (GCDCore.Project.LinearExtraction.LinearExtraction le in LEs)
            {
                TreeNodeItem nod = new TreeNodeItem(le, 16, ContextMenuStrip.Container);
                nod.ContextMenuStrip.Items.Insert(0, new ToolStripMenuItem("View Linear Extraction Folder", Properties.Resources.GCD, OnViewResults));
                Nodes.Add(nod);
            }
        }
Пример #9
0
        public void OnEdit(object sender, EventArgs e)
        {
            TreeNodeItem node = sender as TreeNodeItem;
            Form         frm  = null;

            if (Item is AssocSurface)
            {
                AssocSurface assoc = Item as AssocSurface;
                frm = new SurveyLibrary.frmAssociatedSurface(assoc.DEM, assoc);
            }
            else if (Item is ErrorSurface && ((ErrorSurface)Item).Surf is DEMSurvey)
            {
                ErrorSurface err = Item as ErrorSurface;
                if (err.ErrorProperties.Count < 1)
                {
                    frm = new SurveyLibrary.frmSurfaceProperties(Item as GCDProjectRasterItem, true);
                }
                else
                {
                    if (err.Mask == null)
                    {
                        frm = new SurveyLibrary.ErrorSurfaces.frmSingleMethodError(err);
                    }
                    else
                    {
                        frm = new SurveyLibrary.ErrorSurfaces.frmMultiMethodError(err);
                    }
                }
            }
            else if (Item is GCDCore.Project.ProfileRoutes.ProfileRoute)
            {
                GCDCore.Project.ProfileRoutes.ProfileRoute route = Item as GCDCore.Project.ProfileRoutes.ProfileRoute;
                frm = new UserInterface.ProfileRoutes.frmProfileRouteProperties(route.ProfileRouteType, route);
            }
            else if (Item is GCDCore.Project.Masks.DirectionalMask)
            {
                frm = new Masks.frmDirectionalMaskProps(Item as GCDCore.Project.Masks.DirectionalMask);
            }
            else if (Item is GCDCore.Project.Masks.AOIMask)
            {
                frm = new Masks.frmAOIProperties(Item as GCDCore.Project.Masks.AOIMask);
            }
            else if (Item is GCDCore.Project.Masks.RegularMask)
            {
                frm = new Masks.frmMaskProperties(Item as GCDCore.Project.Masks.RegularMask);
            }
            else if (Item is GCDCore.Project.LinearExtraction.LinearExtraction)
            {
                frm = new LinearExtraction.frmLinearExtractionProperties(Item as GCDCore.Project.LinearExtraction.LinearExtraction);
            }
            else
            {
                // Generic raster properties form
                if (Item is GCDProjectRasterItem)
                {
                    frm = new SurveyLibrary.frmSurfaceProperties(Item as GCDProjectRasterItem, true);
                }
                else
                {
                    throw new NotImplementedException("Unhandled editing of project type");
                }
            }

            if (frm is Form)
            {
                EditTreeItem(frm);
            }
        }