Esempio n. 1
0
 public ToolState(string id, IControllerTool component, List <string> incompatibleToolsList, bool isactivated)
 {
     this.id                    = id;
     this.component             = component;
     this.incompatibleToolsList = incompatibleToolsList;
     this.isactivated           = isactivated;
 }
Esempio n. 2
0
        public void Awake()
        {
            _controller = GetComponent <VRTK_ControllerEvents>();
            _controller.ButtonTwoPressed += OnMenuClicked; // toggle state using the MenuButton
            //_controller.GripClicked += ActivateMatrix;

            if (!selectionSphere)
            {
                //selectionSphere = this.gameObject.AddComponent<SphereSelectionCreator>();
            }
            if (!selectionConvexHull)
            {
                //selectionConvexHull = this.gameObject.AddComponent<ConvexHullCreator>();
            }
            if (!counter)
            {
                //counter = this.gameObject.AddComponent<CounterCreator>();
            }
            if (!measureDistance)
            {
                //measureDistance = this.gameObject.AddComponent<MeasureDistance>();
            }
            if (!clippingPlane)
            {
                clippingPlane = this.gameObject.AddComponent <ClippingPlane>();
            }


            toolsDict = new Dictionary <string, ToolState>();
            toolsDict.Add("Pointer", new ToolState("Pointer",
                                                   selectionPointer,
                                                   new List <string>(),
                                                   true));

            toolsDict.Add("Selection Sphere", new ToolState("Selection Sphere",
                                                            selectionSphere,
                                                            new List <string>()
            {
                "Selection Convex Hull", "Counter", "Measure Distance", "Angle Measure", "Histogram", "MultiClipping Plane", "Free Selection"
            },
                                                            false));
            toolsDict.Add("Selection Convex Hull", new ToolState("Selection Convex Hull",
                                                                 selectionConvexHull,
                                                                 new List <string>()
            {
                "Selection Sphere", "Counter", "Measure Distance", "Angle Measure", "Histogram", "MultiClipping Plane", "Free Selection"
            },
                                                                 false));

            toolsDict.Add("Free Selection", new ToolState("Free Selection",
                                                          freeselection,
                                                          new List <string>()
            {
                "Selection Convex Hull", "Selection Sphere", "Counter", "Measure Distance", "Angle Measure", "Histogram", "MultiClipping Plane"
            },
                                                          false));

            toolsDict.Add("Counter", new ToolState("Counter",
                                                   counter,
                                                   new List <string>()
            {
                "Selection Convex Hull", "Selection Sphere", "Measure Distance", "Angle Measure", "Histogram", "MultiClipping Plane", "Free Selection"
            },
                                                   false));

            toolsDict.Add("Measure Distance", new ToolState("Measure Distance",
                                                            measureDistance,
                                                            new List <string>()
            {
                "Selection Convex Hull", "Counter", "Selection Sphere", "Angle Measure", "Histogram", "MultiClipping Plane", "Free Selection"
            },
                                                            false));

            toolsDict.Add("Angle Measure", new ToolState("Angle Measure",
                                                         anglemeasure,
                                                         new List <string>()
            {
                "Selection Convex Hull", "Counter", "Selection Sphere", "Measure Distance", "Histogram", "MultiClipping Plane", "Free Selection"
            },
                                                         false));

            toolsDict.Add("Histogram", new ToolState("Histogram",
                                                     histogram,
                                                     new List <string>()
            {
                "Selection Convex Hull", "Counter", "Selection Sphere", "Measure Distance", "Angle Measure", "MultiClipping Plane", "Free Selection"
            },
                                                     false));



            toolsDict.Add("Clipping Plane", new ToolState("Clipping Plane",
                                                          clippingPlane,
                                                          new List <string>()
            {
                "MultiClipping Plane"
            },
                                                          false));

            toolsDict.Add("MultiClipping Plane", new ToolState("MultiClipping Plane",
                                                               multiclippingPlane,
                                                               new List <string>()
            {
                "Clipping Plane", "Selection Convex Hull", "Counter", "Selection Sphere", "Measure Distance", "Angle Measure", "Histogram", "Free Selection"
            },
                                                               false));



            VRTK_EventSystem.current.sendNavigationEvents = false;
        }