Example #1
0
 //Initialisation function
 void Start()
 {
     currentSelectedDataPoints = new List <DataPoint>();
     OperationData             = new List <List <DataPoint> >();
     test  = 3;
     cMenu = GameObject.Find("Palm UI L").GetComponent <CurrentMenu>();
 }
Example #2
0
 // Start is called before the first frame update
 void Start()
 {
     // Gets all the information about the points
     StatisticsCanvas = GetComponent <Canvas>();
     cMenu            = GameObject.Find("Palm UI L").GetComponent <CurrentMenu>();
     pointCloud       = GameObject.Find("ScatterPlot").GetComponent <ScatterPlot>();
     boolOperation    = GameObject.Find("BooleanOperation").GetComponent <BoolOperation>();
     GeneralStats     = GameObject.Find("GeneralStats").GetComponent <Text>();
     DynamicStats     = GameObject.Find("DynamicStats").GetComponent <Text>();
     BoolStats        = GameObject.Find("BoolStats").GetComponent <Text>();
 }
Example #3
0
        // Start is called before the first frame update
        void Start()
        {
            //Initialisation of the different menu buttons
            cMenu              = GameObject.Find("Palm UI L").GetComponent <CurrentMenu>();
            ButtonCreation     = GameObject.Find("Button Creation").GetComponent <InteractionButton>();     // Button for Creation/Modification/Intersection
            ButtonSelection    = GameObject.Find("Button Selection").GetComponent <InteractionButton>();    // Button for Selection/Erase/Union
            ButtonStatistics   = GameObject.Find("Button Statistics").GetComponent <InteractionButton>();   // Button for Statsistics/Operation/Relative Complement
            ButtonHide_Show    = GameObject.Find("Button Hide/Show").GetComponent <InteractionButton>();    // Button for Hide_Show/Return/Return
            ButtonHelp_Options = GameObject.Find("Button Help/Options").GetComponent <InteractionButton>(); // Button for Help_Options
            ButtonQuit         = GameObject.Find("Button Quit").GetComponent <InteractionButton>();         // Button for Quit

            FrameCounter = 0;
        }
Example #4
0
        // Update is called once per frame
        void Update()
        {
            if (!initializedMenu)
            {
                //Connects to the menu
                cMenu = GameObject.Find("Palm UI L").GetComponent <CurrentMenu>();
                if (cMenu != null)
                {
                    //Debug.Log("IL EST INITIALISEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE");
                    initializedMenu = true;
                }
            }

            if (!initializedLeft)
            {
                Left = GameObject.Find("Capsule Hand Left");
                if (Left != null)
                {
                    //Debug.Log("ALLO");
                    scriptPDL  = Left.GetComponent <PinchDetector>();
                    scriptEFDL = Left.GetComponent <ExtendedFingerDetector>();
                    //Debug.Log(scriptEFDL, scriptPDL);
                    scriptPDL.OnActivate.AddListener(PinchLeftDetected);
                    scriptPDL.OnDeactivate.AddListener(PinchLeftEnded);
                    scriptEFDL.OnActivate.AddListener(ExtendedFingerDetected);
                    scriptEFDL.OnDeactivate.AddListener(ExtendedFingerEnded);
                    initializedLeft = true;
                }
            }
            if (!initializedRight)
            {
                Right = GameObject.Find("Capsule Hand Right");
                if (Right != null)
                {
                    //Debug.Log("ALLO");
                    scriptPDR  = Right.GetComponent <PinchDetector>();
                    scriptEFDR = Right.GetComponent <ExtendedFingerDetector>();
                    //Debug.Log(scriptEFDR, scriptPDR);
                    scriptPDR.OnActivate.AddListener(PinchRightDetected);
                    scriptPDR.OnDeactivate.AddListener(PinchRightEnded);
                    scriptEFDR.OnActivate.AddListener(ExtendedFingerDetected);
                    scriptEFDR.OnDeactivate.AddListener(ExtendedFingerEnded);
                    initializedRight = true;
                }
            }


            if (initializedLeft && initializedRight && initializedMenu)
            {
                switch (cMenu.GetCurrentMenu())
                {
                case CurrentMenu.Menu.NoMenuSelected:
                    break;

                case CurrentMenu.Menu.Creation:     //CREATION
                    LeapCreation.creationMain(ref nb_pinch, ref creating, scriptPDL, scriptPDR, ref currentSelection, cam,
                                              ref lastPosition, ref lastPositionR, ref lastPositionL, referenceWait, ref wait);
                    break;

                case CurrentMenu.Menu.Selection:     //SELECTION (!!! ptet avec un modulo pour gérer les différents sous-cas de la sélection)
                    switch (cMenu.GetCurrentMenuSelection())
                    {
                    case CurrentMenu.Selection.SetOperation:

                        break;

                    case CurrentMenu.Selection.Modification:
                        LeapDeformation.Update();
                        break;

                    default:
                        break;
                    }
                    Vector3 PointingDirection = new Vector3(0, 0, 0);
                    Vector3 Fingertip         = new Vector3(0, 0, 0);
                    //if (currentSelection != null)
                    //Debug.Log("CURRENT OBJECT:", currentSelection);
                    Finger f  = null;
                    Hand   hl = Left.GetComponent <HandModelBase>().GetLeapHand();
                    Hand   hr = Right.GetComponent <HandModelBase>().GetLeapHand();
                    if (Pointing > 0)
                    {
                        if (hl.Fingers[1].IsExtended)
                        {
                            f = hl.GetIndex();
                        }
                        else
                        {
                            f = hr.GetIndex();
                        }
                        PointingDirection = f.Direction.ToVector3();
                        Fingertip         = f.TipPosition.ToVector3();
                    }
                    Collider tempo = LeapSelection.selectionMain((Pointing > 0), PointingDirection, Fingertip, ref nb_pinch, ref creating, scriptPDL, scriptPDR, ref currentSelection, cam,
                                                                 ref lastPosition, ref lastPositionR, ref lastPositionL);
                    if (tempo != null)
                    {
                        if (currentSelection != null)
                        {
                            currentSelection.GetComponent <Renderer>().material.color = Color.white;
                        }
                        currentSelection = tempo.gameObject;
                        currentSelection.GetComponent <Renderer>().material.color = Color.red;
                    }
                    else
                    {
                        if (currentSelection != null)
                        {
                            currentSelection.GetComponent <Renderer>().material.color = Color.white;
                        }
                        currentSelection = null;
                    }

                    break;
                }
                lastPositionL = scriptPDL.Position;
                lastPositionR = scriptPDR.Position;
            }
        }
Example #5
0
 // Start is called before the first frame update
 void Start()
 {
     helpOptionsCanvas = GetComponent <Canvas>();
     cMenu             = GameObject.Find("Palm UI L").GetComponent <CurrentMenu>();
 }
Example #6
0
 // Start is called before the first frame update
 void Start()
 {
     cMenu = GameObject.Find("Palm UI L").GetComponent <CurrentMenu>();
     i     = 0;
 }
Example #7
0
 //Initialisation function
 void Start()
 {
     HS             = false;
     selectedpoints = false;
     cMenu          = GameObject.Find("Palm UI L").GetComponent <CurrentMenu>();
 }