Exemple #1
0
    private void Start()
    {
        // grab button component
        DiagButton      = DiagButtonContainer.GetComponent <HoloToolkit.Unity.Buttons.CompoundButton>();
        VertButton      = VertButtonContainer.GetComponent <HoloToolkit.Unity.Buttons.CompoundButton>();
        BoundsButton    = BoundsButtonContainer.GetComponent <HoloToolkit.Unity.Buttons.CompoundButton>();
        WireframeButton = WireframeButtonContainer.GetComponent <HoloToolkit.Unity.Buttons.CompoundButton>();

        // declare event handlers
        DiagButton.OnButtonPressed      += new System.Action <GameObject>(ToggleDiag);
        VertButton.OnButtonPressed      += new System.Action <GameObject>(ToggleVerts);
        BoundsButton.OnButtonPressed    += new System.Action <GameObject>(ToggleBounds);
        WireframeButton.OnButtonPressed += new System.Action <GameObject>(ToggleWireframe);

        // set original button labels
        UpdateDiagLabel();
        UpdateVertLabel();
        UpdateBoundsLabel();
        UpdateWireframeLabel();

        // add sliders as listeners
        OcSliderGC = OcclusionSlider.GetComponent <HoloToolkit.Examples.InteractiveElements.SliderGestureControl>();
        OcSliderGC.OnUpdateEvent.AddListener(UpdateOc);
        MeshFOVSliderGC = MeshFOVSlider.GetComponent <HoloToolkit.Examples.InteractiveElements.SliderGestureControl>();
        MeshFOVSliderGC.OnUpdateEvent.AddListener(UpdateMeshFOV);
    }
Exemple #2
0
    private void Start()
    {
        // grab button component
        DiagButton     = DiagButtonContainer.GetComponent <HoloToolkit.Unity.Buttons.CompoundButton>();
        VertButton     = VertButtonContainer.GetComponent <HoloToolkit.Unity.Buttons.CompoundButton>();
        BoundsButton   = BoundsButtonContainer.GetComponent <HoloToolkit.Unity.Buttons.CompoundButton>();
        MaterialButton = MaterialButtonContainer.GetComponent <HoloToolkit.Unity.Buttons.CompoundButton>();
        FilterButton   = FilterButtonContainer.GetComponent <HoloToolkit.Unity.Buttons.CompoundButton>();
        ConfigButton   = ConfigButtonContainer.GetComponent <HoloToolkit.Unity.Buttons.CompoundButton>();

        // declare event handlers
        DiagButton.OnButtonPressed     += new System.Action <GameObject>(ToggleDiag);
        VertButton.OnButtonPressed     += new System.Action <GameObject>(ToggleVerts);
        BoundsButton.OnButtonPressed   += new System.Action <GameObject>(ToggleBounds);
        MaterialButton.OnButtonPressed += new System.Action <GameObject>(ToggleMaterial);
        FilterButton.OnButtonPressed   += new System.Action <GameObject>(ToggleFilter);
        ConfigButton.OnButtonPressed   += new System.Action <GameObject>(ToggleConfig);

        // add sliders as listeners
        OcSliderGC = OcclusionSlider.GetComponent <HoloToolkit.Examples.InteractiveElements.SliderGestureControl>();
        OcSliderGC.OnUpdateEvent.AddListener(UpdateOc);
        MeshDensitySliderGC = MeshDensitySlider.GetComponent <HoloToolkit.Examples.InteractiveElements.SliderGestureControl>();
        MeshDensitySliderGC.OnUpdateEvent.AddListener(UpdateMeshDensity);
        VoxGridMinSizeSliderGC = VoxGridMinSizeSlider.GetComponent <HoloToolkit.Examples.InteractiveElements.SliderGestureControl>();
        VoxGridMinSizeSliderGC.OnUpdateEvent.AddListener(UpdateVoxGrid);
        MeshUpdateTimeSliderGC = MeshUpdateTimeSlider.GetComponent <HoloToolkit.Examples.InteractiveElements.SliderGestureControl>();
        MeshUpdateTimeSliderGC.OnUpdateEvent.AddListener(UpdateMeshUpdateTime);
        MinValSliderGC = MinValSlider.GetComponent <HoloToolkit.Examples.InteractiveElements.SliderGestureControl>();
        MinValSliderGC.OnUpdateEvent.AddListener(UpdateMinVal);
        MaxValSliderGC = MaxValSlider.GetComponent <HoloToolkit.Examples.InteractiveElements.SliderGestureControl>();
        MaxValSliderGC.OnUpdateEvent.AddListener(UpdateMaxVal);
        ShowFracSliderGC = ShowFracSlider.GetComponent <HoloToolkit.Examples.InteractiveElements.SliderGestureControl>();
        ShowFracSliderGC.OnUpdateEvent.AddListener(UpdateShowFrac);
        MeshAlphaSliderGC = MeshAlphaSlider.GetComponent <HoloToolkit.Examples.InteractiveElements.SliderGestureControl>();
        MeshAlphaSliderGC.OnUpdateEvent.AddListener(UpdateMeshAlpha);

        // set original button labels
        UpdateDiagLabel();
        UpdateVertLabel();
        UpdateBoundsLabel();
        UpdateMaterialLabel();
        UpdateFilterLabel();
        UpdateConfigLabel();

        // finish syncing state
        UpdateMeshDensity(MeshDensitySliderGC.SliderValue); // also updates oc, voxel res
        UpdateMeshUpdateTime(MeshUpdateTimeSliderGC.SliderValue);
        UpdateMinVal(MinValSliderGC.SliderValue);
        UpdateMaxVal(MaxValSliderGC.SliderValue);
        UpdateShowFrac(ShowFracSliderGC.SliderValue);
        UpdateMeshAlpha(MeshAlphaSliderGC.SliderValue);
    }