public override List<LayerUITreeNode> GetTreeNodes()
        {
            var nodes = new List<LayerUITreeNode>();
            var nameColumn = layer.GetNameColumn();
            for (var i = 0; i < layer.shapefile.Shapes.Count; i++)
            {
                var type = layer.shapefile.Shapes[i].GetType();

                var node = new LayerUITreeNode();
                if (nameColumn == -1)
                {
                    node.Name = type.Name;
                }
                else
                {
                    node.Name = layer.shapefile.Shapes[i].Attributes[nameColumn].ToString();
                }

                node.Tag = layer.shapefile.Shapes[i];
                node.Checked = true;
                node.NodeSelected += node_NodeSelected;
                nodes.Add(node);
            }
            return nodes;
        }
        public override List <LayerUITreeNode> GetTreeNodes()
        {
            List <LayerUITreeNode> nodes = new List <LayerUITreeNode>();
            int nameColumn = layer.GetNameColumn();

            for (int i = 0; i < layer.shapefile.Shapes.Count; i++)
            {
                Type type = layer.shapefile.Shapes[i].GetType();

                LayerUITreeNode node = new LayerUITreeNode();
                if (nameColumn == -1)
                {
                    node.Name = type.Name;
                }
                else
                {
                    node.Name = layer.shapefile.Shapes[i].Attributes[nameColumn].ToString();
                }

                node.Tag           = layer.shapefile.Shapes[i];
                node.Checked       = true;
                node.NodeSelected += new LayerUITreeNodeSelectedDelegate(node_NodeSelected);
                nodes.Add(node);
            }
            return(nodes);
        }
Пример #3
0
        public override List <LayerUITreeNode> GetTreeNodes()
        {
            LayerUITreeNode parent = new LayerUITreeNode();

            AddRootToTree(layer.root, parent);

            return(parent.Nodes);
        }
Пример #4
0
        void node_NodeChecked(LayerUITreeNode node, bool newState)
        {
            ReferenceFrame frame = (ReferenceFrame)node.Tag;

            if (frame != null)
            {
                frame.ShowOrbitPath = newState;
            }
        }
Пример #5
0
        public LayerUITreeNode Add(string name)
        {
            LayerUITreeNode node = new LayerUITreeNode();

            node.Name   = name;
            node.Parent = this;
            node.Level  = this.Level + 1;
            Nodes.Add(node);
            return(node);
        }
Пример #6
0
 private void AddRootToTree(KmlRoot root, LayerUITreeNode node)
 {
     if (root.children != null)
     {
         foreach (KmlFeature child in root.children)
         {
             AddFeatureToTree(child, node);
         }
     }
 }
Пример #7
0
 private static void CheckAllChildren(LayerUITreeNode node)
 {
     // deep check children
     foreach (LayerUITreeNode child in node.Nodes)
     {
         child.Checked = true;
         KmlFeature childFeature = child.Tag as KmlFeature;
         if (childFeature != null)
         {
             childFeature.visibility = true;
         }
         CheckAllChildren(child);
     }
 }
Пример #8
0
        void node_NodeSelected(LayerUITreeNode node)
        {
            if (node != null)
            {
                KmlPlacemark feature = node.Tag as KmlPlacemark;

                if (feature != null)
                {
                    feature.Selected = true;
                    layer.DeselectAll();
                    layer.RetainedVisualsDirty = true;
                }
            }
        }
        void node_NodeSelected(LayerUITreeNode node)
        {
            if (callbacks != null)
            {
                Shape shape = (Shape)node.Tag;

                if (shape.Attributes != null && shape.Attributes.ItemArray.GetLength(0) > 0)
                {
                    Dictionary <String, String> rowData = new Dictionary <string, string>();
                    for (int r = 0; r < shape.Attributes.ItemArray.GetLength(0); r++)
                    {
                        rowData.Add(shape.Attributes.Table.Columns[r].ColumnName, shape.Attributes.ItemArray[r].ToString());
                    }
                    callbacks.ShowRowData(rowData);
                }
            }
        }
Пример #10
0
 void node_NodeActivated(LayerUITreeNode node)
 {
     if (node != null && node.Tag is KmlFeature)
     {
         KmlFeature feature = (KmlFeature)node.Tag;
         if (feature.LookAt != null)
         {
             if (feature.sky)
             {
                 Earth3d.MainWindow.GotoTarget(new TourPlace(feature.Name, feature.LookAt.latitude, (feature.LookAt.longitude + 180) / 15, Classification.Unidentified, "", ImageSetType.Sky, .8), false, false, true);
             }
             else
             {
                 GotoLookAt(feature);
             }
         }
         else if (node.Tag is KmlPlacemark)
         {
             KmlPlacemark placemark = (KmlPlacemark)node.Tag;
             if (placemark.geometry != null)
             {
                 KmlCoordinate point = placemark.geometry.GetCenterPoint();
                 if (placemark.sky)
                 {
                     Earth3d.MainWindow.GotoTarget(new TourPlace(placemark.Name, point.Lat, (point.Lng + 180) / 15, Classification.Unidentified, "", ImageSetType.Sky, .8), false, false, true);
                 }
                 else
                 {
                     Earth3d.MainWindow.GotoTarget(new TourPlace(placemark.Name, point.Lat, point.Lng, Classification.Unidentified, "", ImageSetType.Earth, .8), false, false, true);
                 }
             }
             //if (placemark.geometry is KmlPoint)
             //{
             //    KmlPoint point = (KmlPoint)placemark.geometry;
             //    if (placemark.sky)
             //    {
             //        Earth3d.MainWindow.GotoTarget(new TourPlace(placemark.Name, point.latitude, (point.longitude + 180) / 15, Classification.Unidentified, "", ImageSetType.Sky, .8), false, false, true);
             //    }
             //    else
             //    {
             //        Earth3d.MainWindow.GotoTarget(new TourPlace(placemark.Name, point.latitude, point.longitude, Classification.Unidentified, "", ImageSetType.Earth, .8), false, false, true);
             //    }
             //}
         }
     }
 }
Пример #11
0
        public override List <LayerUITreeNode> GetTreeNodes()
        {
            List <LayerUITreeNode> nodes = new List <LayerUITreeNode>();

            foreach (ReferenceFrame frame in layer.Frames)
            {
                LayerUITreeNode node = new LayerUITreeNode();
                node.Name = frame.Name;


                node.Tag           = frame;
                node.Checked       = frame.ShowOrbitPath;
                node.NodeSelected += new LayerUITreeNodeSelectedDelegate(node_NodeSelected);
                node.NodeChecked  += new LayerUITreeNodeCheckedDelegate(node_NodeChecked);
                nodes.Add(node);
            }
            return(nodes);
        }
        void node_NodeSelected(LayerUITreeNode node)
        {
            if (callbacks != null)
            {
                Shape shape = (Shape)node.Tag;

                if (shape.Attributes != null && shape.Attributes.ItemArray.GetLength(0) > 0)
                {

                    Dictionary<String, String> rowData = new Dictionary<string, string>();
                    for (int r = 0; r < shape.Attributes.ItemArray.GetLength(0); r++)
                    {

                        rowData.Add(shape.Attributes.Table.Columns[r].ColumnName, shape.Attributes.ItemArray[r].ToString());

                    }
                    callbacks.ShowRowData(rowData);
                }
            }
        }
Пример #13
0
        void node_NodeSelected(LayerUITreeNode node)
        {
            if (callbacks != null)
            {
                ReferenceFrame frame = (ReferenceFrame)node.Tag;

                Dictionary <String, String> rowData = new Dictionary <string, string>();

                rowData.Add("Name", frame.Name);
                rowData.Add("SemiMajor Axis", frame.SemiMajorAxis.ToString());
                rowData.Add("SMA Units", frame.SemiMajorAxisUnits.ToString());
                rowData.Add("Inclination", frame.Inclination.ToString());
                rowData.Add("Eccentricity", frame.Eccentricity.ToString());
                rowData.Add("Long of Asc. Node", frame.LongitudeOfAscendingNode.ToString());
                rowData.Add("Argument Of Periapsis", frame.ArgumentOfPeriapsis.ToString());
                rowData.Add("Epoch", frame.Epoch.ToString());
                rowData.Add("Mean Daily Motion", frame.MeanDailyMotion.ToString());
                rowData.Add("Mean Anomoly at Epoch", frame.MeanAnomolyAtEpoch.ToString());
                callbacks.ShowRowData(rowData);
            }
        }
 void node_NodeSelected(LayerUITreeNode node)
 {
 }
Пример #15
0
 void node_NodeUpdated(LayerUITreeNode node)
 {
     layer.RetainedVisualsDirty = true;
 }
 void node_NodeActivated(LayerUITreeNode node)
 {
     Earth3d.MainWindow.UiController = node.Tag as FilterGraphTool;
 }
 void node_NodeChecked(LayerUITreeNode node, bool newState)
 {
 }
Пример #18
0
 public LayerUITreeNode Add(string name)
 {
     LayerUITreeNode node = new LayerUITreeNode();
     node.Name = name;
     node.Parent = this;
     node.Level = this.Level + 1;
     Nodes.Add(node);
     return node;
 }
Пример #19
0
        void node_NodeChecked(LayerUITreeNode node, bool newState)
        {
            var child = node.Tag as SkyOverlay;

            if (child != null)
            {
                child.Enabled = newState;
            }
        }
Пример #20
0
        void node_NodeSelected(LayerUITreeNode node)
        {
            if (node != null)
            {
                KmlPlacemark feature = node.Tag as KmlPlacemark;

                if (feature != null)
                {
                    feature.Selected = true;
                    layer.DeselectAll();
                    layer.RetainedVisualsDirty = true;
                }
            }
        }
        public void UpdateNode(Layer layer, LayerUITreeNode node)
        {
            if (node == null)
            {
                if (layer != null)
                {
                    TreeNode[] results = layerTree.Nodes.Find(layer.Name, true);

                    foreach(TreeNode child in results)
                    {
                        if (child.Tag == layer)
                        {
                            child.Nodes.Clear();
                            this.LoadLayerChildren(layer, child);
                        }
                    }
                }
            }
        }
Пример #22
0
        private void AddFeatureToTree(KmlFeature feature, LayerUITreeNode parent)
        {
            feature.Dirty = false;
            string text = feature.Name;

            //if (!string.IsNullOrEmpty(feature.description))
            //{
            //    text += Environment.NewLine + feature.description;
            //}
            bool bold = false;
            if (text.Contains("<b>"))
            {
                bold = true;
                text = text.Replace("<b>", "").Replace("</b>", "");
            }

            LayerUITreeNode node = null;

            if (!(feature is KmlNetworkLink))
            {
                node = parent.Add(text);
                node.Tag = feature;
                node.Checked = feature.visibility;
                node.Opened = feature.open;
                node.NodeChecked += new LayerUITreeNodeCheckedDelegate(node_NodeChecked);
                node.NodeUpdated += new LayerUITreeNodeUpdatedDelegate(node_NodeUpdated);
                node.NodeActivated += new LayerUITreeNodeActivatedDelegate(node_NodeActivated);
                node.NodeSelected += new LayerUITreeNodeSelectedDelegate(node_NodeSelected);
                if (bold)
                {
                    node.Bold = true;
                }
            }

            if (feature is KmlContainer)
            {
                KmlContainer container = (KmlContainer)feature;
                if (container.children != null)
                {
                    //  if (feature.Style.GetStyle(false).ListStyle.ListItemType != KmlListItemTypes.CheckHideChildren)
                    {

                        foreach (KmlFeature child in container.children)
                        {
                            AddFeatureToTree(child, node);
                        }
                    }
                }
            }
            else
            {
                if (feature is KmlNetworkLink)
                {
                    KmlNetworkLink netLink = (KmlNetworkLink)feature;
                    if (netLink.LinkRoot != null)
                    {
                        AddRootToTree(netLink.LinkRoot, parent);
                    }
                }
            }
        }
Пример #23
0
 void node_NodeActivated(LayerUITreeNode node)
 {
     if (node != null && node.Tag is KmlFeature)
     {
         KmlFeature feature = (KmlFeature)node.Tag;
         if (feature.LookAt != null)
         {
             if (feature.sky)
             {
                 Earth3d.MainWindow.GotoTarget(new TourPlace(feature.Name, feature.LookAt.latitude, (feature.LookAt.longitude + 180) / 15, Classification.Unidentified, "", ImageSetType.Sky, .8), false, false, true);
             }
             else
             {
                 GotoLookAt(feature);
             }
         }
         else if (node.Tag is KmlPlacemark)
         {
             KmlPlacemark placemark = (KmlPlacemark)node.Tag;
             if (placemark.geometry != null)
             {
                 KmlCoordinate point = placemark.geometry.GetCenterPoint();
                 if (placemark.sky)
                 {
                     Earth3d.MainWindow.GotoTarget(new TourPlace(placemark.Name, point.Lat, (point.Lng + 180) / 15, Classification.Unidentified, "", ImageSetType.Sky, .8), false, false, true);
                 }
                 else
                 {
                     Earth3d.MainWindow.GotoTarget(new TourPlace(placemark.Name, point.Lat, point.Lng, Classification.Unidentified, "", ImageSetType.Earth, .8), false, false, true);
                 }
             }
             //if (placemark.geometry is KmlPoint)
             //{
             //    KmlPoint point = (KmlPoint)placemark.geometry;
             //    if (placemark.sky)
             //    {
             //        Earth3d.MainWindow.GotoTarget(new TourPlace(placemark.Name, point.latitude, (point.longitude + 180) / 15, Classification.Unidentified, "", ImageSetType.Sky, .8), false, false, true);
             //    }
             //    else
             //    {
             //        Earth3d.MainWindow.GotoTarget(new TourPlace(placemark.Name, point.latitude, point.longitude, Classification.Unidentified, "", ImageSetType.Earth, .8), false, false, true);
             //    }
             //}
         }
     }
 }
Пример #24
0
        public override List<LayerUITreeNode> GetTreeNodes()
        {
            LayerUITreeNode parent = new LayerUITreeNode();

            AddRootToTree(layer.root, parent);

            return parent.Nodes;
        }
Пример #25
0
 virtual public List <LayerUIMenuItem> GetNodeContextMenu(LayerUITreeNode node)
 {
     return(null);
 }
Пример #26
0
 void filterNode_NodeChecked(LayerUITreeNode node, bool newState)
 {
     var filter = node.Tag as ConstellationFilter;
     if (filter != null)
     {
         filter.SetAll(newState);
     }
 }
        void layerNode_NodeUpdated(LayerUITreeNode layerNode)
        {
            if (layerNode.UiUpdating)
            {
                // ignore events we started.
                return;
            }
            TreeNode node = layerNode.ReferenceTag as TreeNode;
            if (node != null)
            {
                if (node.Checked != layerNode.Checked)
                {
                    node.Checked = layerNode.Checked;
                }

                if (node.Text != layerNode.Name)
                {
                    node.Text = layerNode.Name;
                }

                if (node.IsExpanded != layerNode.Opened)
                {
                    if (layerNode.Opened)
                    {
                        node.Expand();
                    }
                    else
                    {
                        node.Collapse();
                    }
                }
            }
        }
Пример #28
0
 public override List<LayerUIMenuItem> GetNodeContextMenu(LayerUITreeNode node)
 {
     return base.GetNodeContextMenu(node);
 }
        private void LoadLayerChild(LayerUITreeNode layerNode, TreeNode parent)
        {
            TreeNode node = parent.Nodes.Add(layerNode.Name);
            node.Tag = layerNode;
            node.Checked = layerNode.Checked;
            node.Name = node.Text;
            layerNode.ReferenceTag = node;
            layerNode.NodeUpdated += new LayerUITreeNodeUpdatedDelegate(layerNode_NodeUpdated);

            foreach (LayerUITreeNode child in layerNode.Nodes)
            {
                LoadLayerChild(child, node);
            }

            if (node.IsExpanded != layerNode.Opened)
            {
                node.Expand();
            }
        }
Пример #30
0
        void node_NodeChecked(LayerUITreeNode node, bool newState)
        {
            var frame = (ReferenceFrame)node.Tag;

            if (frame != null)
            {
                frame.ShowOrbitPath = newState;
            }
        }
Пример #31
0
        private void AddFeatureToTree(KmlFeature feature, LayerUITreeNode parent)
        {
            feature.Dirty = false;
            string text = feature.Name;

            //if (!string.IsNullOrEmpty(feature.description))
            //{
            //    text += Environment.NewLine + feature.description;
            //}
            bool bold = false;

            if (text.Contains("<b>"))
            {
                bold = true;
                text = text.Replace("<b>", "").Replace("</b>", "");
            }

            LayerUITreeNode node = null;

            if (!(feature is KmlNetworkLink))
            {
                node                = parent.Add(text);
                node.Tag            = feature;
                node.Checked        = feature.visibility;
                node.Opened         = feature.open;
                node.NodeChecked   += new LayerUITreeNodeCheckedDelegate(node_NodeChecked);
                node.NodeUpdated   += new LayerUITreeNodeUpdatedDelegate(node_NodeUpdated);
                node.NodeActivated += new LayerUITreeNodeActivatedDelegate(node_NodeActivated);
                node.NodeSelected  += new LayerUITreeNodeSelectedDelegate(node_NodeSelected);
                if (bold)
                {
                    node.Bold = true;
                }
            }

            if (feature is KmlContainer)
            {
                KmlContainer container = (KmlContainer)feature;
                if (container.children != null)
                {
                    //  if (feature.Style.GetStyle(false).ListStyle.ListItemType != KmlListItemTypes.CheckHideChildren)
                    {
                        foreach (KmlFeature child in container.children)
                        {
                            AddFeatureToTree(child, node);
                        }
                    }
                }
            }
            else
            {
                if (feature is KmlNetworkLink)
                {
                    KmlNetworkLink netLink = (KmlNetworkLink)feature;
                    if (netLink.LinkRoot != null)
                    {
                        AddRootToTree(netLink.LinkRoot, parent);
                    }
                }
            }
        }
Пример #32
0
        void node_NodeChecked(LayerUITreeNode node, bool newState)
        {
            layer.RetainedVisualsDirty = true;
            KmlFeature item = node.Tag as KmlFeature;

            if (item != null)
            {
                KmlFeature feature = node.Tag as KmlFeature;
                if (node.Tag is KmlFeature)
                {
                    // todo wire up true selection
                    bool selected = false;

                    KmlFeature parent      = node.Parent.Tag as KmlFeature;
                    bool       radioFolder = false;


                    radioFolder = parent == null ? false : parent.Style.GetStyle(selected).ListStyle.ListItemType == KmlListItemTypes.RadioFolder;
                    if (radioFolder)
                    {
                        // Radio folders can't uncheck themselves
                        if (feature.visibility && !node.Checked)
                        {
                            node.Checked = true;
                        }
                        else
                        {
                            feature.visibility = node.Checked;
                        }
                    }
                    else
                    {
                        // Radio folders can't uncheck themselves
                        feature.visibility = node.Checked;
                    }


                    if (feature.visibility)
                    {
                        if (feature.Style.GetStyle(selected).ListStyle.ListItemType != KmlListItemTypes.CheckOffOnly)
                        {
                            if (feature.Style.GetStyle(selected).ListStyle.ListItemType != KmlListItemTypes.RadioFolder)
                            {
                                CheckAllChildren(node);
                            }
                        }

                        // Uncheck siblings if we are a radio button
                        if (node.Parent.Tag is KmlFeature)
                        {
                            if (radioFolder)
                            {
                                foreach (LayerUITreeNode sibling in node.Parent.Nodes)
                                {
                                    if (sibling != node)
                                    {
                                        sibling.Checked = false;
                                        KmlFeature siblingFeature = sibling.Tag as KmlFeature;
                                        if (siblingFeature != null)
                                        {
                                            siblingFeature.visibility = false;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #33
0
 public virtual List<LayerUIMenuItem> GetNodeContextMenu(LayerUITreeNode node)
 {
     return null;
 }
Пример #34
0
 void filterNode_NodeSelected(LayerUITreeNode node)
 {
 }
Пример #35
0
 private static void CheckAllChildren(LayerUITreeNode node)
 {
     // deep check children
     foreach (LayerUITreeNode child in node.Nodes)
     {
         child.Checked = true;
         KmlFeature childFeature = child.Tag as KmlFeature;
         if (childFeature != null)
         {
             childFeature.visibility = true;
         }
         CheckAllChildren(child);
     }
 }
Пример #36
0
 public override List <LayerUIMenuItem> GetNodeContextMenu(LayerUITreeNode node)
 {
     return(base.GetNodeContextMenu(node));
 }
Пример #37
0
 private void AddRootToTree(KmlRoot root, LayerUITreeNode node)
 {
     if (root.children != null)
     {
         foreach (KmlFeature child in root.children)
         {
             AddFeatureToTree(child, node);
         }
     }
 }
Пример #38
0
 void LoadTree(List<LayerUITreeNode> nodes, List<ObjectNode> children)
 {
     foreach (ObjectNode child in children)
     {
         LayerUITreeNode node = new LayerUITreeNode();
         node.Name = child.Name;
         node.Tag = child;
         node.Checked = child.Enabled;
         node.NodeSelected += new LayerUITreeNodeSelectedDelegate(node_NodeSelected);
         node.NodeChecked += new LayerUITreeNodeCheckedDelegate(node_NodeChecked);
         nodes.Add(node);
         LoadTree(node.Nodes, child.Children);
     }
 }
Пример #39
0
        void node_NodeChecked(LayerUITreeNode node, bool newState)
        {
            layer.RetainedVisualsDirty = true;
            KmlFeature item = node.Tag as KmlFeature;
            if (item != null)
            {
                KmlFeature feature = node.Tag as KmlFeature;
                if (node.Tag is KmlFeature)
                {
                    // todo wire up true selection
                    bool selected = false;

                    KmlFeature parent = node.Parent.Tag as KmlFeature;
                    bool radioFolder = false;

                    radioFolder = parent == null ? false : parent.Style.GetStyle(selected).ListStyle.ListItemType == KmlListItemTypes.RadioFolder;
                    if (radioFolder)
                    {
                        // Radio folders can't uncheck themselves
                        if (feature.visibility && !node.Checked )
                        {
                            node.Checked = true;
                        }
                        else
                        {
                            feature.visibility = node.Checked;
                        }

                    }
                    else
                    {
                        // Radio folders can't uncheck themselves
                        feature.visibility = node.Checked;

                    }

                    if (feature.visibility)
                    {
                        if (feature.Style.GetStyle(selected).ListStyle.ListItemType != KmlListItemTypes.CheckOffOnly)
                        {
                            if (feature.Style.GetStyle(selected).ListStyle.ListItemType != KmlListItemTypes.RadioFolder)
                            {
                                CheckAllChildren(node);
                            }
                        }

                        // Uncheck siblings if we are a radio button
                        if (node.Parent.Tag is KmlFeature)
                        {
                            if (radioFolder)
                            {
                                foreach (LayerUITreeNode sibling in node.Parent.Nodes)
                                {
                                    if (sibling != node)
                                    {
                                        sibling.Checked = false;
                                        KmlFeature siblingFeature = sibling.Tag as KmlFeature;
                                        if (siblingFeature != null)
                                        {
                                            siblingFeature.visibility = false;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #40
0
        void node_NodeChecked(LayerUITreeNode node, bool newState)
        {
            ObjectNode child = (ObjectNode)node.Tag;

            if (child != null)
            {
                child.Enabled = newState;
            }
        }
Пример #41
0
 void node_NodeUpdated(LayerUITreeNode node)
 {
     layer.RetainedVisualsDirty = true;
 }
Пример #42
0
        void node_NodeSelected(LayerUITreeNode node)
        {
            if (callbacks != null)
            {
                ObjectNode child = (ObjectNode)node.Tag;

                Dictionary<String, String> rowData = new Dictionary<string, string>();

                rowData.Add("Name", child.Name);
                rowData.Add("Pivot.X", child.PivotPoint.X.ToString());
                rowData.Add("Pivot.Y", child.PivotPoint.Y.ToString());
                rowData.Add("Pivot.Z", child.PivotPoint.Z.ToString());
                callbacks.ShowRowData(rowData);

                //Object3dLayer.sketch.Clear();
                //Object3dLayer.sketch.AddLine(new Vector3d(0, 0, 0), new Vector3d(child.PivotPoint.X,-child.PivotPoint.Z,child.PivotPoint.Y));
            }
        }
Пример #43
0
        public override List<LayerUITreeNode> GetTreeNodes()
        {
            var nodes = new List<LayerUITreeNode>();
            foreach (var frame in layer.Frames)
            {

                var node = new LayerUITreeNode();
                node.Name = frame.Name;

                node.Tag = frame;
                node.Checked = frame.ShowOrbitPath;
                node.NodeSelected += node_NodeSelected;
                node.NodeChecked += node_NodeChecked;
                nodes.Add(node);
            }
            return nodes;
        }
        public override List<LayerUIMenuItem> GetNodeContextMenu(LayerUITreeNode node)
        {
            var items = new List<LayerUIMenuItem>();

            //LayerUIMenuItem ColorMenu = new LayerUIMenuItem();
            //ColorMenu.Name = "Color";
            //ColorMenu.MenuItemSelected += new MenuItemSelectedDelegate(ColorMenu_MenuItemSelected);
            //ColorMenu.Tag = node.Tag;
            //items.Add(ColorMenu);

            return items;
        }
Пример #45
0
        void node_NodeSelected(LayerUITreeNode node)
        {
            if (callbacks != null)
            {
                var frame = (ReferenceFrame)node.Tag;

                var rowData = new Dictionary<string, string>();

                rowData.Add("Name", frame.Name);
                rowData.Add("SemiMajor Axis", frame.SemiMajorAxis.ToString());
                rowData.Add("SMA Units", frame.SemiMajorAxisUnits.ToString());
                rowData.Add("Inclination", frame.Inclination.ToString());
                rowData.Add("Eccentricity", frame.Eccentricity.ToString());
                rowData.Add("Long of Asc. Node", frame.LongitudeOfAscendingNode.ToString());
                rowData.Add("Argument Of Periapsis", frame.ArgumentOfPeriapsis.ToString());
                rowData.Add("Epoch", frame.Epoch.ToString());
                rowData.Add("Mean Daily Motion", frame.MeanDailyMotion.ToString());
                rowData.Add("Mean Anomoly at Epoch", frame.MeanAnomolyAtEpoch.ToString());
                callbacks.ShowRowData(rowData);
            }
        }
        public override List<LayerUITreeNode> GetTreeNodes()
        {
            var nodes = new List<LayerUITreeNode>();

                if (Layer.Filters.Count > 0)
                {
                    foreach (var fgt in Layer.Filters)
                    {
                        var node = new LayerUITreeNode();
                        node.Name = fgt.Title;
                        node.Tag = fgt;
                        node.Checked = fgt == Earth3d.MainWindow.UiController;
                        node.NodeSelected += node_NodeSelected;
                        node.NodeChecked += node_NodeChecked;
                        node.NodeActivated += node_NodeActivated;
                        nodes.Add(node);
                    }
                }

            return nodes;
        }