Example #1
0
 private bool checkForPointsInNodeList(NodeList <string> nodeList)
 {
     if (nodeList.Contains(center.FindGraphNode()) && (center.Position3 != centerPos))
     {
         return(true);
     }
     if (nodeList.Contains(edge.FindGraphNode()) && (edge.Position3 != edgePos))
     {
         return(true);
     }
     return(false);
 }
Example #2
0
 private bool checkForPointsInNodeList(NodeList <string> inputNodeList)
 {
     if ((inputNodeList.Contains(HW_GeoSolver.ins.geomanager.findGraphNode(edge.gameObject.name))) && (edge.Position3 != edgePosition))
     {
         return(true);
     }
     else if ((inputNodeList.Contains(HW_GeoSolver.ins.geomanager.findGraphNode(center.gameObject.name))) && (center.Position3 != centerPosition))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
        internal override void GlueToFigure(AbstractGeoObj toObj)
        {
            if ((toObj.gameObject.tag.Contains("Point") && (toObj.figIndex > this.figIndex)) && ((this.GetComponent <InteractionBehaviour>().isGrasped) || (toObj.transform.GetComponent <InteractionBehaviour>().isGrasped)))
            {
                foreach (Node <string> node in HW_GeoSolver.ins.geomanager.Nodes)
                {
                    GraphNode <string> thisGraphNode = HW_GeoSolver.ins.geomanager.findGraphNode(this.figName);
                    if (HW_GeoSolver.ins.geomanager.neighborsOfNode(node.Value).Contains(thisGraphNode))
                    {
                        NodeList <string>  newNeighborList = HW_GeoSolver.ins.geomanager.neighborsOfNode(node.Value);
                        GraphNode <string> otherGraphNode  = HW_GeoSolver.ins.geomanager.findGraphNode(toObj.figName);
                        if (newNeighborList.Contains(otherGraphNode) == false)
                        {
                            HW_GeoSolver.ins.AddDependence(GameObject.Find(node.Value).GetComponent <AbstractGeoObj>(), toObj);
                            HW_GeoSolver.ins.replaceDepentVar(GameObject.Find(node.Value).transform, this.transform, toObj.transform);
                        }
                        else
                        {
                            //deletes redundancy instances between two points
                            HW_GeoSolver.ins.removeComponentS(node.Value);
                        }
                    }
                }
                HW_GeoSolver.ins.removeComponent(this);

                //check for cycle in geoObjMan graph
                if (HW_GeoSolver.ins.checkIfPath(this.transform, toObj.transform))
                {
                    //a cycle is being created.
                    //make a polygon

                    Debug.Log("NEED TO MAKE A POLYGON");
                }
            }
        }
Example #4
0
 /// <summary>
 /// returns true if all objects in this list are also in the supplied list
 /// </summary>
 /// <param name=""></param>
 /// <returns></returns>
 public bool IsSubsetOf(NodeList <T> col)
 {
     foreach (Node <T> n in base.Items)
     {
         if (col.Contains(n) == false)
         {
             return(false);
         }
     }
     return(true);
 }
Example #5
0
 internal override bool RMotion(NodeList <string> inputNodeList)
 {
     if (inputNodeList.Contains(apex.FindGraphNode()))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
 private bool checkForPointsInNodeList(NodeList <string> inputNodeList)
 {
     if (inputNodeList.Contains(HW_GeoSolver.ins.geomanager.findGraphNode(attachedLine.gameObject.name)) &&
         (attachedLine.vertex0 != endpoint1 || attachedLine.vertex1 != endpoint2))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }