Beispiel #1
0
        public PlanarGraphEdge(GeometryTutorLib.ConcreteAST.Point targ, EdgeType type, double c, int initDegree)
        {
            this.target = targ;
            edgeType    = type;

            cost    = c;
            degree  = initDegree;
            isCycle = false;
        }
Beispiel #2
0
        public bool IsCyclicEdge(GeometryTutorLib.ConcreteAST.Point targetNode)
        {
            PlanarGraphEdge edge = GetEdge(targetNode);

            if (edge == null)
            {
                return(false);
            }

            return(edge.isCycle);
        }
Beispiel #3
0
        public void MarkEdge(GeometryTutorLib.ConcreteAST.Point targetNode)
        {
            PlanarGraphEdge edge = GetEdge(targetNode);

            if (edge == null)
            {
                return;
            }

            edge.isCycle = true;
        }
Beispiel #4
0
        //
        // Shallow copy constructor
        //
        public PlanarGraphNode(PlanarGraphNode thatNode)
        {
            thePoint = thatNode.thePoint;
            // type = thatNode.type;
            edges = new List <PlanarGraphEdge>();

            foreach (PlanarGraphEdge e in thatNode.edges)
            {
                edges.Add(new PlanarGraphEdge(e));
            }
        }
Beispiel #5
0
 public void RemoveEdge(GeometryTutorLib.ConcreteAST.Point targetNode)
 {
     edges.Remove(new PlanarGraphEdge(targetNode));
 }
Beispiel #6
0
        public PlanarGraphEdge GetEdge(GeometryTutorLib.ConcreteAST.Point targ)
        {
            int index = edges.IndexOf(new PlanarGraphEdge(targ));

            return(index == -1 ? null : edges[index]);
        }
Beispiel #7
0
 public void AddEdge(GeometryTutorLib.ConcreteAST.Point targ, EdgeType type, double c, int initDegree)
 {
     edges.Add(new PlanarGraphEdge(targ, type, c, initDegree));
 }
Beispiel #8
0
        // public NodePointType type { get; private set; }


        public PlanarGraphNode(GeometryTutorLib.ConcreteAST.Point value) // , NodePointType t)
        {
            thePoint = value;
            //type = t;
            edges = new List <PlanarGraphEdge>();
        }
Beispiel #9
0
 // For quick construction only
 public PlanarGraphEdge(GeometryTutorLib.ConcreteAST.Point targ)
 {
     this.target = targ;
 }