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

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

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

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

            if (edge == null)
            {
                return;
            }

            edge.isCycle = true;
        }
Exemple #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));
            }
        }
Exemple #5
0
 public void RemoveEdge(GeometryTutorLib.ConcreteAST.Point targetNode)
 {
     edges.Remove(new PlanarGraphEdge(targetNode));
 }
Exemple #6
0
        public PlanarGraphEdge GetEdge(GeometryTutorLib.ConcreteAST.Point targ)
        {
            int index = edges.IndexOf(new PlanarGraphEdge(targ));

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


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