Example #1
0
        public override void AppendAdditionalMenuItems(ToolStripDropDown menu)
        {
            //IL_01f1: Unknown result type (might be due to invalid IL or missing references)
            //IL_01f8: Expected O, but got Unknown
            //IL_02c4: Unknown result type (might be due to invalid IL or missing references)
            //IL_02cb: Expected O, but got Unknown
            base.AppendAdditionalMenuItems(menu);
            bool flag = false;

            if (Container != null)
            {
                flag = Container.LockGrips;
            }
            GH_DocumentObject.Menu_AppendItem((ToolStrip)menu, "Locked", (EventHandler)Menu_LockClicked, Graph != null, flag);
            GH_DocumentObject.Menu_AppendItem((ToolStrip)menu, "Default", (EventHandler)Menu_DefaultClicked, Graph != null, false);
            GH_DocumentObject.Menu_AppendItem((ToolStrip)menu, "Remap", (EventHandler)Menu_RemapClicked, true, RemapToTarget).ToolTipText = "Remap output values to target domain";
            GH_DocumentObject.Menu_AppendItem((ToolStrip)menu, "Draw domains", (EventHandler)Menu_DrawDomainsClicked, Graph != null, ((RichGraphMapperAttributes)(object)((GH_DocumentObject)this).Attributes).DrawDomainsTags);
            IList <GH_GraphProxy> graphProxies      = Instances.ComponentServer.GraphProxies;
            ToolStripMenuItem     toolStripMenuItem = GH_DocumentObject.Menu_AppendItem((ToolStrip)menu, "Graph types");

            GH_DocumentObject.Menu_AppendItem((ToolStrip)toolStripMenuItem.DropDown, "None", (EventHandler)Menu_NoGraphItemClicked, true, Graph == null);
            Guid a = Guid.Empty;
            InterpolatedGraph interpolatedGraph = new InterpolatedGraph();
            PolylineGraph     polylineGraph     = new PolylineGraph();

            if (Graph != null)
            {
                a = Graph.GraphTypeID;
            }
            foreach (GH_GraphProxy item in graphProxies)
            {
                if (!(item.GUID == ((GH_AbstractGraph)interpolatedGraph).GraphTypeID) && !(item.GUID == ((GH_AbstractGraph)polylineGraph).GraphTypeID))
                {
                    ToolStripMenuItem toolStripMenuItem2 = GH_DocumentObject.Menu_AppendItem((ToolStrip)toolStripMenuItem.DropDown, item.Name, (EventHandler)Menu_GraphTypeItemClicked, item.Icon, true, a == item.GUID);
                    toolStripMenuItem2.Tag = item.GUID;
                }
            }
            GH_GraphProxy     val = (GH_GraphProxy)(object)new GH_GraphProxy((IGH_Graph)(object)interpolatedGraph, typeof(InterpolatedGraph));
            ToolStripMenuItem toolStripMenuItem3 = GH_DocumentObject.Menu_AppendItem((ToolStrip)toolStripMenuItem.DropDown, val.Name, (EventHandler)Menu_FreeFormGraphClicked, val.Icon, true, a == val.GUID);

            toolStripMenuItem3.Tag = 5;
            for (int i = 3; i <= 10; i++)
            {
                ToolStripMenuItem toolStripMenuItem4 = GH_DocumentObject.Menu_AppendItem((ToolStrip)toolStripMenuItem3.DropDown, val.Name + " " + i + " points", (EventHandler)Menu_FreeFormGraphClicked, val.Icon, true, false);
                toolStripMenuItem4.Tag = i;
            }
            val = (GH_GraphProxy)(object)new GH_GraphProxy((IGH_Graph)(object)polylineGraph, typeof(PolylineGraph));
            ToolStripMenuItem toolStripMenuItem5 = GH_DocumentObject.Menu_AppendItem((ToolStrip)toolStripMenuItem.DropDown, val.Name, (EventHandler)Menu_PolylineGraphClicked, val.Icon, true, a == val.GUID);

            toolStripMenuItem5.Tag = 5;
            for (int j = 3; j <= 10; j++)
            {
                ToolStripMenuItem toolStripMenuItem6 = GH_DocumentObject.Menu_AppendItem((ToolStrip)toolStripMenuItem5.DropDown, val.Name + " " + j + " points", (EventHandler)Menu_PolylineGraphClicked, val.Icon, true, false);
                toolStripMenuItem6.Tag = j;
            }
        }
Example #2
0
        protected override GH_AbstractGraph CreateDerivedDuplicate()
        {
            InterpolatedGraph interpolatedGraph = new InterpolatedGraph();

            interpolatedGraph.pts = new Point3d[count];
            for (int i = 0; i < count; i++)
            {
                interpolatedGraph.pts[i] = pts[i];
            }
            return(interpolatedGraph);
        }