Beispiel #1
0
 public void SetLayerState(bool condition)
 {
     if (condition)
     {
         LayerShaderController.EnableLayer(Layer);
     }
     else
     {
         LayerShaderController.DisableLayer(Layer);
     }
 }
Beispiel #2
0
    public void BottomValueChanged(float value)
    {
        BottomSliderText.text = (Bottom + value * (Top - Bottom)).ToString("#######.####");

        if (value > TopSlider.value)
        {
            TopSlider.value = value;
        }

        LayerShaderController.SetBottom(value, Layer);
    }
Beispiel #3
0
    public void TopValueChanged(float value)
    {
        TopSliderText.text = (Top - (1 - value) * (Top - Bottom)).ToString("#######.####");

        if (value < BottomSlider.value)
        {
            BottomSlider.value = value;
        }

        LayerShaderController.SetTop(value, Layer);
    }
Beispiel #4
0
    public void LineChartFiler(string message)
    {
        try
        {
            FilterPOCO filterData = JsonUtility.FromJson <FilterPOCO>(message);

            if (filterData == null)
            {
                Console.Log("Invalid data");
            }

            if (filterData.LayerID == "Vshale")
            {
                filterData.LayerID = "VShale";
            }

            if (Enum.TryParse(filterData.LayerID, out Layers layer))
            {
                Console.Log("Data received: " + layer.ToString() + " : " + filterData.IsEnabled + " : " + filterData.Min + " : " + filterData.Max);

                if (filterData.IsEnabled)
                {
                    LayerShaderController.EnableLayer(layer);
                }
                else
                {
                    LayerShaderController.DisableLayer(layer);
                }

                switch (layer)
                {
                case Layers.Elevation:
                    filterData.Min = Remap(filterData.Min, ElevationMin, ElevationMax, 0, 1);
                    filterData.Max = Remap(filterData.Max, ElevationMin, ElevationMax, 0, 1);
                    break;

                case Layers.Porosity:
                    filterData.Min = Remap(filterData.Min, PorosityMin, PorosityMax, 0, 1);
                    filterData.Max = Remap(filterData.Max, PorosityMin, PorosityMax, 0, 1);
                    break;

                case Layers.Thickness:
                    filterData.Min = Remap(filterData.Min, ThicknessMin, ThicknessMax, 0, 1);
                    filterData.Max = Remap(filterData.Max, ThicknessMin, ThicknessMax, 0, 1);
                    break;

                case Layers.TOC:
                    filterData.Min = Remap(filterData.Min, TOCMin, TOCMax, 0, 1);
                    filterData.Max = Remap(filterData.Max, TOCMin, TOCMax, 0, 1);
                    break;

                case Layers.VShale:
                    filterData.Min = Remap(filterData.Min, VShaleMin, VShaleMax, 0, 1);
                    filterData.Max = Remap(filterData.Max, VShaleMin, VShaleMax, 0, 1);
                    break;
                }

                LayerShaderController.SetTop(filterData.Max, layer);
                LayerShaderController.SetBottom(filterData.Min, layer);
            }
            else
            {
                Console.Log($"NOT SUPPORTER LAYER TYPE {filterData.LayerID}");
            }
        }
        catch (Exception ex)
        {
            Console.Log(ex.Message);
        }
    }