コード例 #1
0
        bool CheckForVisibiltyChanges()
        {
            bool chg = (updateCount == 0) ||
                       (oldFilterOnCap != filterOnCap) ||
                       (oldCapFilter != capfilter) ||
                       (oldFilterOnUse != filterOnUse) ||
                       (oldUseFilter != usefilter) ||
                       (oldLinksVisible != linksvisible) ||
                       (oldNodesVisible != nodesvisible);

            if (chg)
            {
                if (filterOnCap && !oldFilterOnCap)
                {
                    filterOnUse = false;
                }
                else if (filterOnUse && !oldFilterOnUse)
                {
                    filterOnCap = false;
                }
                oldLinksVisible = linksvisible;
                oldNodesVisible = nodesvisible;
                oldFilterOnCap  = filterOnCap;
                oldCapFilter    = capfilter;
                oldFilterOnUse  = filterOnUse;
                oldUseFilter    = usefilter;
                sman.RequestRefresh("LinkCloudMan-CheckForVisibiltyChanges");
            }
            return(chg);
        }
コード例 #2
0
        void ApdNewLinkTo(string frname, string tuname, Vector3 pt, LinkUse usetype, string comment)
        {
            var s = indent + "grc.LinkToPtxyz( " + q(frname) + "," + q(tuname) + fpt(pt) + ", LinkUse." + usetype.ToString() + ", comment:" + q(comment) + apd;

            lines.Add(s);
            nlinkto++;
        }
コード例 #3
0
        public void SetCurrentEditNode(string nodename)
        {
            var node = grc.GetNode(nodename);

            if (curEditNode != null)
            {
                if (curEditNode.name != nodename)
                {
                    lm.RemoveNodeColorOverride(curEditNode.name);
                }
            }
            curEditNode    = node;
            editNodeRegion = grc.regman.GetRegion(node.regid);
            linkUseType    = LinkUse.legacy;
            lm.SetNodeColorOverride(nodename, "green", node.go);
            foreach (var weg in node.wegtos)
            {
                var lnk = weg.link;
                if (lnk.regid == node.regid)
                {
                    linkUseType = lnk.usetype;
                    break;
                }
            }
            //sm.RequestRefresh("LinkEdit:SetCurrentEditMode");
        }
コード例 #4
0
 public LcNode(GraphCtrl grc, string name, Vector3 pt, LinkUse usetype, ref NodeRegion nodeRegion, string comment = "")
 {
     this.grc      = grc;
     this.name     = name;
     this.pt       = pt;
     this.usetype  = usetype;
     this.regid    = nodeRegion.regid;
     this.comment  = comment;
     regionStepIdx = nodeRegion.GetCurStepIdx();
     wegtos        = null;
     AstarInit();
 }
コード例 #5
0
        public static bool CanDoCapFromUse(LcCapType cap, LinkUse use)
        {
            if (cap == LcCapType.anything)
            {
                return(true);
            }
            if (!candodict.ContainsKey(cap))
            {
                return(false);
            }
            var curdict = candodict[cap];
            var rv      = curdict.ContainsKey(use);

            return(rv);
        }
コード例 #6
0
        public float Cost(LcCapType cap, LinkUse usetyp)
        {
            if (cap == LcCapType.anything)
            {
                return(1);
            }
            if (!candodict.ContainsKey(cap))
            {
                return(-1);
            }
            var curdict = candodict[cap];

            if (curdict.ContainsKey(usetyp))
            {
                return(-1);
            }
            return(curdict[usetyp]);
        }
コード例 #7
0
        void ApdNewLinkByName(LcLink link, LinkUse usetype)
        {
            var frname = link.node1.name;

            if (link.node1spec != "")
            {
                frname = link.node1spec;
            }
            var tuname = link.node2.name;

            if (link.node2spec != "")
            {
                tuname = link.node2spec;
            }
            var s = indent + "grc.AddLinkByNodeName( " + q(frname) + "," + q(tuname) + ", LinkUse." + usetype.ToString() + apd;

            lines.Add(s);
            nlinkbyname++;
        }
コード例 #8
0
        public LcLink(GraphCtrl grc, string name, LcNode node1, LcNode node2, LinkUse usetype = LinkUse.legacy, string comment = "")
        {
            this.grc       = grc;
            this.usetype   = usetype;
            this.name      = name;
            this.node1     = node1;
            this.node2     = node2;
            this.node1spec = "";
            this.node2spec = "";
            this.comment   = "";
            var regid = grc.regman.curNodeRegion.regid;

            if (node1.regid == node2.regid)
            {
                regid = node1.regid;
            }
            this.regid         = regid;
            this.regionStepIdx = grc.regman.curNodeRegion.GetCurStepIdx();
            len = Vector3.Distance(node1.pt, node2.pt);
            LinkLink();
        }