Inheritance: MonoBehaviour
    private void AppStart()
    {
        Visualisation.getInstance().HideCircle();
        UIManager.getInstance().HideAllUILabels();
        UIManager.getInstance().DisableAllUiParents();

        ChangeState(STATE_DATAENTRY);
    }
Example #2
0
    public void UpdateComputeBuffers(Visualisation visualisation)
    {
        buffer.SetData(visualisation.theVisualizationObject.viewList[0].BigMesh.getBigMeshVertices());
        computeShader.SetBuffer(kernelHandleBrushTexture, "dataBuffer", buffer);

        filteredIndicesBuffer.SetData(visualisation.theVisualizationObject.viewList[0].GetFilterChannel());
        computeShader.SetBuffer(kernelHandleBrushTexture, "filteredIndices", filteredIndicesBuffer);
        computeShader.SetBuffer(kernelComputeNearestDistances, "filteredIndices", filteredIndicesBuffer);
    }
        public World()
        {
            matrix = new Space[20, 10];

            visualisation = new Visualisation();

            InitializeMatrix();

            Start();
        }
 public void TearDown()
 {
     if (TestContext.CurrentContext.Result.Outcome.Equals(ResultState.Failure))
     {
         var path  = Path.Combine(Environment.CurrentDirectory, "Log", TestContext.CurrentContext.Test.Name + ".jpg");
         var image = Visualisation.GetVisualisation(layouter.Rectangles);                 // Visualization
         image.Save(path, ImageFormat.Jpeg);
         Console.WriteLine($"Tag cloud visualization saved to file {path}");
     }
 }
    private void PropagateSetText(int[] indices, int viewID)
    {
        // Get the visualisation again
        Visualisation visualisation = PhotonView.Find(viewID).GetComponentInChildren <Visualisation>();

        StringBuilder stringBuilder = new StringBuilder();

        stringBuilder.AppendFormat("<b>{0} (x):</b> {1}\n", visualisation.xDimension.Attribute, dataSource.getOriginalValue(indices[0], visualisation.xDimension.Attribute));
        stringBuilder.AppendFormat("<b>{0} (y):</b> {1}\n", visualisation.yDimension.Attribute, dataSource.getOriginalValue(indices[0], visualisation.yDimension.Attribute));
        if (visualisation.zDimension.Attribute != "Undefined")
        {
            stringBuilder.AppendFormat("<b>{0} (z):</b> {1}\n", visualisation.zDimension.Attribute, dataSource.getOriginalValue(indices[0], visualisation.zDimension.Attribute));
        }

        stringBuilder.Append("--------\n");

        if (indices.Length > 1)
        {
            stringBuilder.AppendFormat("<i>{0} stacked points</i>", indices.Length);
        }
        else
        {
            for (int i = 0; i < dataSource.DimensionCount; i++)
            {
                string dimension = dataSource[i].Identifier;
                object value     = dataSource.getOriginalValue(indices[0], dimension);
                if (dataSource[dimension].MetaData.type == DataType.Float && value.ToString().Length > 4)
                {
                    stringBuilder.AppendFormat("<b>{0}:</b> {1}\n", dimension, ((float)value).ToString("#,##0.00"));
                }
                else
                {
                    stringBuilder.AppendFormat("<b>{0}:</b> {1}\n", dimension, value);
                }
            }
        }

        frontText.text = stringBuilder.ToString();
        frontText.ForceMeshUpdate();

        // Resize the panel based on the text
        Vector2 scale = frontText.GetRenderedValues();

        scale.x = scale.x / 2 + 0.01f;
        scale.y = scale.y / 2 + 0.01f;
        panel.transform.localScale = new Vector3(scale.x, scale.y, 0.01f);

        panel.transform.localPosition     = new Vector3(scale.x / 2 + 0.01f, scale.y / 2 + 0.01f, 0);
        frontText.transform.localPosition = new Vector3(0.01f, scale.y + 0.01f, -0.008f);

        // Set the text and position the back
        backText.text = stringBuilder.ToString();
        backText.ForceMeshUpdate();
        backText.transform.localPosition = new Vector3(scale.x + 0.01f, scale.y + 0.01f, 0.008f);
    }
    public void BeginVisualisation()
    {
        currentState = STATE_VISUALISATION;
        Debug.Log("Visualisation");
        UIManager.getInstance().Toggle_DataInfo(false);
        UIManager.getInstance().Toggle_DataInfoFULLParent(false);
        UIManager.getInstance().Toggle_VisualisationUI(true);

        //Visualisation.getInstance().VisualiseMap(use3DMapAsDefault);
        Visualisation.getInstance().VisualiseMap2D();
    }
    // adding the attributes to the dropdown from the visulization
    private List <string> GetAttributesList(Visualisation viz)
    {
        List <string> dimensions = new List <string>();

        dimensions.Add("Undefined");
        for (int i = 0; i < viz.dataSource.DimensionCount; ++i)
        {
            dimensions.Add(viz.dataSource[i].Identifier);
        }
        return(dimensions);
    }
    /// <summary>
    /// Updates the computebuffers with the values specific to the currently brushed visualisation.
    /// </summary>
    /// <param name="visualisation"></param>
    public void UpdateComputeBuffers(Visualisation visualisation)
    {
        if (visualisation.visualisationType == AbstractVisualisation.VisualisationTypes.SCATTERPLOT)
        {
            dataBuffer.SetData(visualisation.theVisualizationObject.viewList[0].BigMesh.getBigMeshVertices());
            computeShader.SetBuffer(kernelComputeBrushTexture, "dataBuffer", dataBuffer);

            filteredIndicesBuffer.SetData(visualisation.theVisualizationObject.viewList[0].GetFilterChannel());
            computeShader.SetBuffer(kernelComputeBrushTexture, "filteredIndicesBuffer", filteredIndicesBuffer);
        }
    }
    void UpdateVizOffset(Visualisation visualisation)
    {
        if (visualisation == null)
        {
            return;
        }

        Vector3 offset = new Vector3((float)(visualisation.theVisualizationObject.GameObject_Axes_Holders.Count - 1) * Width, Height);

        visualisation.transform.localPosition = offset * -0.5f;

        Collider.size = offset + new Vector3(0.5f, 0.2f, 0.1f);
    }
    void UpdateVizScaling(Visualisation visualisation)
    {
        if (visualisation == null)
        {
            return;
        }

        visualisation.width  = Width;
        visualisation.height = Height;
        visualisation.theVisualizationObject?.UpdateVisualisation(AbstractVisualisation.PropertyType.Scaling);

        UpdateVizOffset(visualisation);
    }
    void InitVisualization(Visualisation visualisation)
    {
        if (visualisation == null)
        {
            return;
        }

        visualisation.colour                = Color.white * 0.3f;
        visualisation.colourDimension       = "Undefined";
        visualisation.colorPaletteDimension = "Undefined";
        visualisation.size          = 0.15f;
        visualisation.sizeDimension = "Undefined";
    }
Example #12
0
    protected void BindMinMaxAxisValues(Axis axis, DimensionFilter dim, Visualisation vis)
    {
        object minvalue = vis.dataSource.getOriginalValue(dim.minFilter, dim.Attribute);
        object maxvalue = vis.dataSource.getOriginalValue(dim.maxFilter, dim.Attribute);

        object minScaledvalue = vis.dataSource.getOriginalValue(dim.minScale, dim.Attribute);
        object maxScaledvalue = vis.dataSource.getOriginalValue(dim.maxScale, dim.Attribute);

        axis.AttributeFilter = dim;
        axis.UpdateLabelAttribute(dim.Attribute);

        axis.SetMinNormalizer(dim.minScale);
        axis.SetMaxNormalizer(dim.maxScale);
    }
Example #13
0
        void SetKeywords(Visualisation mode)
        {
            Shader.DisableKeyword("SDFr_VISUALIZE_STEPS");
            Shader.DisableKeyword("SDFr_VISUALIZE_HEATMAP");
            Shader.DisableKeyword("SDFr_VISUALIZE_DIST");

            switch (mode)
            {
            case Visualisation.IntensitySteps:      Shader.EnableKeyword("SDFr_VISUALIZE_STEPS"); break;

            case Visualisation.HeatmapSteps:        Shader.EnableKeyword("SDFr_VISUALIZE_HEATMAP"); break;

            case Visualisation.Distance:            Shader.EnableKeyword("SDFr_VISUALIZE_DIST"); break;
            }
            SceneView.RepaintAll();
        }
Example #14
0
    public void OnVisualizationCreated(Visualisation viz)
    {
        foreach (Transform child in transform)
        {
            DestroyImmediate(child.gameObject);
        }

        Filters = new List <DimensionFilter>(viz.parallelCoordinatesDimensions);

        foreach (var filter in Filters)
        {
            Instantiate(DimensionObj, transform)?.Init(this, filter);
        }

        Dropdown.ClearOptions();
        Dropdown.AddOptions(Filters.Select(x => x.Attribute).ToList());
    }
Example #15
0
    public void DisplayTrajectories()
    {
        // Assignments data parsing
        List <List <int> > assignments = ParseListOfListOfInts(assignmentsData);

        // Trajectories files data parsing
        List <String> fileNames = ParseListOfString(filesData);

        // Create Trajectories objects
        int nb_files = assignments.Count;

        int[] assignments_counter = new int[nb_files];
        Array.Clear(assignments_counter, 0, nb_files); // Fills array with 0s
        for (int i = 0; i < assignments.Count; i++)
        {
            GameObject t = Instantiate(trajectoryPrefab, new Vector3(assignments_counter[assignments[i][0]]++, assignments[i][0], 0), Quaternion.identity);
            t.transform.parent = transform;

            // upload CSV file
            CSVDataSource dataSource = t.transform.Find("[IATK] New Data Source").GetComponent <CSVDataSource>();
            dataSource.data = Resources.Load(fileNames[i]) as TextAsset;

            // set up visualisation
            Visualisation dataVisualisation = t.transform.Find("[IATK] New Visualisation").GetComponent <Visualisation>();
            dataVisualisation.dataSource = dataSource;
            dataVisualisation.CreateVisualisation(AbstractVisualisation.VisualisationTypes.SCATTERPLOT);
            dataVisualisation.colour     = randomColorFromInt(assignments[i][0]);
            dataVisualisation.xDimension = new DimensionFilter {
                Attribute = "x"
            };
            dataVisualisation.yDimension = new DimensionFilter {
                Attribute = "y"
            };
            dataVisualisation.zDimension = new DimensionFilter {
                Attribute = "z"
            };
            dataVisualisation.geometry         = AbstractVisualisation.GeometryType.Lines;
            dataVisualisation.linkingDimension = "TrajectoryID";
            dataVisualisation.theVisualizationObject.UpdateVisualisation(AbstractVisualisation.PropertyType.X);
            dataVisualisation.theVisualizationObject.UpdateVisualisation(AbstractVisualisation.PropertyType.Y);
            dataVisualisation.theVisualizationObject.UpdateVisualisation(AbstractVisualisation.PropertyType.Z);
            dataVisualisation.theVisualizationObject.UpdateVisualisation(AbstractVisualisation.PropertyType.GeometryType);
            dataVisualisation.theVisualizationObject.UpdateVisualisation(AbstractVisualisation.PropertyType.LinkingDimension);
        }
    }
Example #16
0
    void CreateVisualization(DataSource source)
    {
        if (Visualization != null)
        {
            Destroy(Visualization.gameObject);
        }

        DimensionFilter[]  filters = DimensionManager.GetDimensionFilters();
        VisualisationTypes type    = GetCurrentVizType();

        Visualization = new GameObject("Visualization").AddComponent <Visualisation>();
        Visualization.transform.SetParent(transform, false);

        Visualization.dataSource = source;

        InitVisualization(type);
        UpdateDimension(filters, type);
    }
Example #17
0
        Visualisation CreateVisFromSource()
        {
            visGo = new GameObject("myTester");
            Debug.Log("Spawned myTester");

            vis = visGo.AddComponent <Visualisation>();
            Debug.Log("Add Visualizsation");

            if (vis != null)
            {
                if (vis.theVisualizationObject == null)
                {
                    vis.CreateVisualisation(AbstractVisualisation.VisualisationTypes.SCATTERPLOT);
                }

                vis.dataSource    = rtds;
                vis.xDimension    = "DimA";
                vis.yDimension    = "DimB";
                vis.zDimension    = "DimC";
                vis.sizeDimension = "DimD";
                vis.CreateVisualisation(AbstractVisualisation.VisualisationTypes.SCATTERPLOT);


                AbstractVisualisation abstractVisualisation = vis.theVisualizationObject;

                // Axis
                abstractVisualisation.visualisationReference.xDimension.Attribute = "DimA";
                abstractVisualisation.UpdateVisualisation(AbstractVisualisation.PropertyType.X);
                abstractVisualisation.visualisationReference.yDimension.Attribute = "DimB";
                abstractVisualisation.UpdateVisualisation(AbstractVisualisation.PropertyType.Y);
                abstractVisualisation.visualisationReference.zDimension.Attribute = "DimC";
                abstractVisualisation.UpdateVisualisation(AbstractVisualisation.PropertyType.Z);
                abstractVisualisation.visualisationReference.sizeDimension = "DimD";
                abstractVisualisation.UpdateVisualisation(AbstractVisualisation.PropertyType.OriginDimension);

                vis.geometry = AbstractVisualisation.GeometryType.Bars;

                Debug.Log("Init vis 6");
                isVisReady = true;
            }
            return(vis);
        }
Example #18
0
    public void Init(DataSource srcData, AttributeFilter attributeFilter, Visualisation visualisation)
    {
        AttributeName   = attributeFilter.Attribute;
        AttributeFilter = attributeFilter;

        int idx = Array.IndexOf(srcData.Select(m => m.Identifier).ToArray(), attributeFilter.Attribute);

        SourceIndex = idx;
        axisId      = idx;
        name        = "axis " + srcData[idx].Identifier;

        AttributeRange = new Vector2(srcData[idx].MetaData.minValue, srcData[idx].MetaData.maxValue);
        label.text     = srcData[idx].Identifier;

        visualisationReference = visualisation;

        CalculateTicksScale(srcData[idx].MetaData.binCount);
        UpdateTicks();
        GenerateAxisLabels();
    }
    void CreateVisualization(DataSource source)
    {
        if (Visualization != null)
        {
            Destroy(Visualization.gameObject);
        }

        Visualization = new GameObject("Visualization").AddComponent <Visualisation>();

        Visualization.transform.SetParent(transform, false);

        InitVisualization(Visualization);

        Visualization.dataSource = source;
        Visualization.CreateVisualisation(AbstractVisualisation.VisualisationTypes.PARALLEL_COORDINATES);

        UpdateVizScaling(Visualization);
        Collider.enabled = true;

        VisualizationCreated.Invoke(Visualization);
    }
Example #20
0
    private void CreateAxisDropDown(Visualisation viz, GameObject Cube)
    {
        // creating dropdowns for each graph
        DataAttributesNames = GetAttributesList(viz);
        Dropdown X_AxisDropDown = Cube.transform.Find("Canvas/DummyXAxis/Canvas/Dropdown").GetComponent <Dropdown>();
        Dropdown Y_AxisDropDown = Cube.transform.Find("Canvas/DummyYAxis/Canvas/Dropdown").GetComponent <Dropdown>();
        Dropdown Z_AxisDropDown = Cube.transform.Find("Canvas/DummyZAxis/Canvas/Dropdown").GetComponent <Dropdown>();

        X_AxisDropDown.AddOptions(DataAttributesNames);
        Y_AxisDropDown.AddOptions(DataAttributesNames);
        Z_AxisDropDown.AddOptions(DataAttributesNames);
        X_AxisDropDown.onValueChanged.AddListener(value =>
        {
            if (viz != null)
            {
                viz.xDimension = DataAttributesNames[X_AxisDropDown.value];
                viz.updateViewProperties(AbstractVisualisation.PropertyType.X);
            }
        });

        Y_AxisDropDown.onValueChanged.AddListener(value =>
        {
            if (viz != null)
            {
                viz.yDimension = DataAttributesNames[Y_AxisDropDown.value];
                viz.updateViewProperties(AbstractVisualisation.PropertyType.Y);
            }
        });

        Z_AxisDropDown.onValueChanged.AddListener(value =>
        {
            if (viz != null)
            {
                viz.zDimension = DataAttributesNames[Z_AxisDropDown.value];
                viz.updateViewProperties(AbstractVisualisation.PropertyType.Z);
            }
        });
    }
Example #21
0
        private void UpdateInfo(Visualisation desiredRepresentation)
        {
            string[] regValues = new string[16];
            string[] pValues   = new string[2];
            byte[]   iValues   = _chip8.Cpu.Input.Keys;

            string representation = "0x{0:X}";

            if (desiredRepresentation == Visualisation.Binary)
            {
                representation = "{0:B}";
            }
            else if (desiredRepresentation == Visualisation.Decimal)
            {
                representation = "{0:D}";
            }

            for (int i = 0; i < 16; i++)
            {
                regValues[i] = String.Format(representation, _chip8.Cpu.V[i]);
            }

            pValues[0] = String.Format(representation, _chip8.Cpu.I);
            pValues[1] = String.Format(representation, _chip8.Cpu.PC);

            // Pointeurs
            textBoxI.Text  = pValues[0];
            textBoxPC.Text = pValues[1];

            // Registres
            textBoxV0.Text  = regValues[0];
            textBoxV1.Text  = regValues[1];
            textBoxV2.Text  = regValues[2];
            textBoxV3.Text  = regValues[3];
            textBoxV4.Text  = regValues[4];
            textBoxV5.Text  = regValues[5];
            textBoxV6.Text  = regValues[6];
            textBoxV7.Text  = regValues[7];
            textBoxV8.Text  = regValues[8];
            textBoxV9.Text  = regValues[9];
            textBoxV10.Text = regValues[10];
            textBoxV11.Text = regValues[11];
            textBoxV12.Text = regValues[12];
            textBoxV13.Text = regValues[13];
            textBoxV14.Text = regValues[14];
            textBoxV15.Text = regValues[15];

            // Compteur CPU et Son
            textBoxCpuCounter.Text   = String.Format(representation, _chip8.Cpu.DelayTimer);
            textBoxSoundCounter.Text = String.Format(representation, _chip8.Cpu.SoundTimer);

            // Pile
            textBoxStackCount.Text   = String.Format("{0:D}", _chip8.Cpu.CountStack);
            textBoxStackElement.Text = String.Format(representation, _chip8.Cpu.CurrentStackState);

            // Input
            bt0.BackColor = iValues[0] > 0x0 ? Color.DimGray : Color.Transparent;
            bt1.BackColor = iValues[1] > 0x0 ? Color.DimGray : Color.Transparent;
            bt2.BackColor = iValues[2] > 0x0 ? Color.DimGray : Color.Transparent;
            bt3.BackColor = iValues[3] > 0x0 ? Color.DimGray : Color.Transparent;
            bt4.BackColor = iValues[4] > 0x0 ? Color.DimGray : Color.Transparent;
            bt5.BackColor = iValues[5] > 0x0 ? Color.DimGray : Color.Transparent;
            bt6.BackColor = iValues[6] > 0x0 ? Color.DimGray : Color.Transparent;
            bt7.BackColor = iValues[7] > 0x0 ? Color.DimGray : Color.Transparent;
            bt8.BackColor = iValues[8] > 0x0 ? Color.DimGray : Color.Transparent;
            bt9.BackColor = iValues[9] > 0x0 ? Color.DimGray : Color.Transparent;
            btA.BackColor = iValues[10] > 0x0 ? Color.CadetBlue : Color.LightSkyBlue;
            btB.BackColor = iValues[11] > 0x0 ? Color.CadetBlue : Color.LightSkyBlue;
            btC.BackColor = iValues[12] > 0x0 ? Color.CadetBlue : Color.LightSkyBlue;
            btD.BackColor = iValues[13] > 0x0 ? Color.CadetBlue : Color.LightSkyBlue;
            btE.BackColor = iValues[14] > 0x0 ? Color.CadetBlue : Color.LightSkyBlue;
            btF.BackColor = iValues[15] > 0x0 ? Color.CadetBlue : Color.LightSkyBlue;

            // Opcode
            textBoxOpcode.Text = String.Format(representation, _chip8.Cpu.CurrentOpcode);
            textBoxVX.Text     = String.Format(representation, (_chip8.Cpu.CurrentOpcode & 0x0F00) >> 8);
            textBoxVY.Text     = String.Format(representation, (_chip8.Cpu.CurrentOpcode & 0x00F0) >> 4);
            textBoxNibble.Text = String.Format(representation, _chip8.Cpu.CurrentOpcode & 0x000F);
            textBoxNNN.Text    = String.Format(representation, (((_chip8.Cpu.CurrentOpcode & 0x0F00) >> 8) + ((_chip8.Cpu.CurrentOpcode & 0x00F0) >> 4) + (_chip8.Cpu.CurrentOpcode & 0x000F)));
            textBoxNN.Text     = String.Format(representation, (((_chip8.Cpu.CurrentOpcode & 0x00F0) >> 4) + (_chip8.Cpu.CurrentOpcode & 0x000F)));
        }
Example #22
0
    void Start()
    {
        Mercator mProj = new Mercator();

        // obtaining the  maximum and minimum latitiude and longitude from the graph

        if (_viz == null)
        {
            _viz         = this.gameObject.GetComponent <Visualisation>();
            mySourceData = (CSVDataSource)_viz.dataSource;
        }
        string x_data_dim = _viz.xDimension.Attribute;
        string z_data_dim = _viz.zDimension.Attribute;


        float maxlongitute = float.Parse(_viz.dataSource.getOriginalValue(mySourceData[x_data_dim].Data.Max(), x_data_dim) + "");
        float maxlatitude  = float.Parse(_viz.dataSource.getOriginalValue(mySourceData[z_data_dim].Data.Max(), z_data_dim) + "");
        float minlongitute = float.Parse(_viz.dataSource.getOriginalValue(mySourceData[x_data_dim].Data.Min(), x_data_dim) + "");
        float minlatitude  = float.Parse(_viz.dataSource.getOriginalValue(mySourceData[z_data_dim].Data.Min(), z_data_dim) + "");


        //GeoCoordinate
        float[] topLeft     = mProj.latLonToMeters(minlatitude, minlongitute);
        float[] topright    = mProj.latLonToMeters(minlatitude, maxlongitute);
        float[] bottomLeft  = mProj.latLonToMeters(maxlatitude, minlongitute);
        float[] bottomRight = mProj.latLonToMeters(maxlatitude, maxlongitute);


        Vector2d centerMap = new Vector2d(minlatitude + (maxlatitude - minlatitude) / 2.0, minlongitute + (maxlongitute - minlongitute) / 2.0);

        float leftRightDistance = this.distance(topLeft[0], topLeft[1], topright[0], topright[1]);
        float topBottomDistance = this.distance(topLeft[0], topLeft[1], bottomLeft[0], bottomLeft[1]);

        float maxdist = Mathf.Max(leftRightDistance, topBottomDistance);

        float pixelDist = 3 * 256;

        int lastgoodZoom = 0;

        for (int i = 0; i < 17; i++)
        {
            float realSize = 256 * (maxdist / 40000000) * Mathf.Pow(2, i);
            if (realSize < pixelDist)
            {
                lastgoodZoom = i;
            }
        }
        Debug.Log("Appropriate Zoom level: " + lastgoodZoom);
        //_map.ResetMap();

        GameObject mapGo = new GameObject("Map_GO");

        mapGo.transform.parent     = this.transform;
        mapGo.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
        _map = mapGo.AddComponent <AbstractMap>();

        _map.Initialize(centerMap, lastgoodZoom);

        // calculating the coordinates for the x-axis end point, z-axis end point  and the center
        xExtremeAxis = maxlatitude + "," + minlongitute;
        zExtremeAxis = minlatitude + "," + maxlongitute;
        center       = minlatitude + "," + minlongitute;

        Debug.Log("ExtremeValue: " + center + " - " + xExtremeAxis + " - " + zExtremeAxis);

        // coverting the coordinates into geolocation
        Vector3 xExtremeAxisGeo = _map.GeoToWorldPosition(Conversions.StringToLatLon(xExtremeAxis), true);
        Vector3 zExtremeAxisGeo = _map.GeoToWorldPosition(Conversions.StringToLatLon(zExtremeAxis), true);
        Vector3 centerGeo       = _map.GeoToWorldPosition(Conversions.StringToLatLon(center), true);

        // Assigning the position to the visulization by making center of the visulization fixed

        Vector3 mapPos = _map.transform.position;

        _viz.transform.position = centerGeo;
        _map.transform.position = mapPos;
        // calculating the length of x and z axis for width and depth of the graph respectively
        var width = (centerGeo - zExtremeAxisGeo).magnitude;
        var Depth = (centerGeo - xExtremeAxisGeo).magnitude;

        _viz.width = width;
        _viz.depth = Depth;
        //_map.
        //  height of the graph
        // when z-axis is not defined
        if (_viz.zDimension.Attribute == "Undefined")
        {
            _viz.height = _map.Options.locationOptions.zoom / 5;
        }
        else // when z-axis is defined
        {
            _viz.height = _viz.zDimension.maxScale;
        }


        _viz.gameObject.GetComponent <ScatterplotVisualisation>().UpdateVisualisationAxes(AbstractVisualisation.PropertyType.Scaling);

        // function for map update
        _map.OnUpdated += delegate
        {
            UpdateMap();
        };
    }
Example #23
0
    private void Update()
    {
        if (networkedTracer != null)
        {
            if (IsTracerVisible())
            {
                // Set the size of the tracer accordingly
                networkedTracer.transform.position   = actualTracer.transform.position;
                networkedTracer.transform.rotation   = actualTracer.transform.rotation;
                networkedTracer.transform.localScale = actualTracer.transform.localScale;
            }
            else
            {
                // Hide the networked tracer by scaling it to zero
                networkedTracer.transform.localScale = Vector3.zero;
            }
        }

        //Details on demand
        if (brushingAndLinking != null)
        {
            if (isTouchpadDown)
            {
                if (!isDetailsOnDemandActive)
                {
                    isDetailsOnDemandActive = true;

                    DataLogger.Instance.LogActionData(this, PhotonNetwork.LocalPlayer, PhotonNetwork.LocalPlayer, "Details-on-Demand start");
                }

                if (!IsInteractionToolActive())
                {
                    tracerVisibility = VisibilityStates.AlwaysOn;

                    selectedInteractionRenderer.Sprite = detailsOnDemandSprite;
                }

                RaycastHit hit;
                GameObject collidedObject = GetCollidedObjectClipped(out hit);

                if (collidedObject != null && collidedObject.CompareTag("ChartRaycastCollider"))
                {
                    brushingAndLinking.inspectButtonController = true;
                    Chart chart = collidedObject.GetComponentInParent <Chart>();
                    visualisationToInspect = chart.Visualisation;
                    brushingAndLinking.visualisationToInspect = visualisationToInspect;
                    brushingAndLinking.radiusInspector        = 0.2f;

                    if (chart.Is3D)
                    {
                        Set3DstickOn();
                        SetPointerOpacityZero();
                        brushingInput1.position = stickSphere.transform.position;
                        _3DDOD = true;
                    }
                    else
                    {
                        Set3DstickOff();
                        SetPointerOpacityOne();
                        brushingInput1.position = hit.point;
                        _3DDOD = false;
                    }
                }
                else
                {
                    Set3DstickOff();
                    SetPointerOpacityOne();
                    brushingInput1.position = hit.point;
                    _3DDOD = false;
                }
            }
            else if (!isTouchpadDown && isDetailsOnDemandActive)
            {
                isDetailsOnDemandActive = false;

                DataLogger.Instance.LogActionData(this, PhotonNetwork.LocalPlayer, PhotonNetwork.LocalPlayer, "Details-on-Demand end");

                if (!IsInteractionToolActive())
                {
                    tracerVisibility = VisibilityStates.AlwaysOff;
                    selectedInteractionRenderer.Sprite = null;
                }

                brushingAndLinking.visualisationToInspect  = null;
                brushingAndLinking.inspectButtonController = false;
                networkedDetailsOnDemandLabel.ToggleState(false);

                _3DDOD = false;
            }
        }
    }
Example #24
0
        private void ShowVisualisation()
        {
            Visualisation visualisation = new Visualisation(m_des, m_sol);

            visualisation.ShowDialog();
        }
Example #25
0
        private void UpdateInfo(Visualisation desiredRepresentation)
        {
            string[] regValues = new string[16];
            string[] pValues = new string[2];
            byte[] iValues = _chip8.Cpu.Input.Keys;

            string representation = "0x{0:X}";
            if (desiredRepresentation == Visualisation.Binary)
                representation = "{0:B}";
            else if (desiredRepresentation == Visualisation.Decimal)
                representation = "{0:D}";

            for (int i = 0; i < 16; i++)
            {
                regValues[i] = String.Format(representation, _chip8.Cpu.V[i]);
            }

            pValues[0] = String.Format(representation, _chip8.Cpu.I);
            pValues[1] = String.Format(representation, _chip8.Cpu.PC);

            // Pointeurs
            textBoxI.Text = pValues[0];
            textBoxPC.Text = pValues[1];

            // Registres
            textBoxV0.Text = regValues[0];
            textBoxV1.Text = regValues[1];
            textBoxV2.Text = regValues[2];
            textBoxV3.Text = regValues[3];
            textBoxV4.Text = regValues[4];
            textBoxV5.Text = regValues[5];
            textBoxV6.Text = regValues[6];
            textBoxV7.Text = regValues[7];
            textBoxV8.Text = regValues[8];
            textBoxV9.Text = regValues[9];
            textBoxV10.Text = regValues[10];
            textBoxV11.Text = regValues[11];
            textBoxV12.Text = regValues[12];
            textBoxV13.Text = regValues[13];
            textBoxV14.Text = regValues[14];
            textBoxV15.Text = regValues[15];

            // Compteur CPU et Son
            textBoxCpuCounter.Text = String.Format(representation, _chip8.Cpu.DelayTimer);
            textBoxSoundCounter.Text = String.Format(representation, _chip8.Cpu.SoundTimer);

            // Pile
            textBoxStackCount.Text = String.Format("{0:D}", _chip8.Cpu.CountStack);
            textBoxStackElement.Text = String.Format(representation, _chip8.Cpu.CurrentStackState);

            // Input
            bt0.BackColor = iValues[0] > 0x0 ? Color.DimGray : Color.Transparent;
            bt1.BackColor = iValues[1] > 0x0 ? Color.DimGray : Color.Transparent;
            bt2.BackColor = iValues[2] > 0x0 ? Color.DimGray : Color.Transparent;
            bt3.BackColor = iValues[3] > 0x0 ? Color.DimGray : Color.Transparent;
            bt4.BackColor = iValues[4] > 0x0 ? Color.DimGray : Color.Transparent;
            bt5.BackColor = iValues[5] > 0x0 ? Color.DimGray : Color.Transparent;
            bt6.BackColor = iValues[6] > 0x0 ? Color.DimGray : Color.Transparent;
            bt7.BackColor = iValues[7] > 0x0 ? Color.DimGray : Color.Transparent;
            bt8.BackColor = iValues[8] > 0x0 ? Color.DimGray : Color.Transparent;
            bt9.BackColor = iValues[9] > 0x0 ? Color.DimGray : Color.Transparent;
            btA.BackColor = iValues[10] > 0x0 ? Color.CadetBlue : Color.LightSkyBlue;
            btB.BackColor = iValues[11] > 0x0 ? Color.CadetBlue : Color.LightSkyBlue;
            btC.BackColor = iValues[12] > 0x0 ? Color.CadetBlue : Color.LightSkyBlue;
            btD.BackColor = iValues[13] > 0x0 ? Color.CadetBlue : Color.LightSkyBlue;
            btE.BackColor = iValues[14] > 0x0 ? Color.CadetBlue : Color.LightSkyBlue;
            btF.BackColor = iValues[15] > 0x0 ? Color.CadetBlue : Color.LightSkyBlue;

            // Opcode
            textBoxOpcode.Text = String.Format(representation, _chip8.Cpu.CurrentOpcode);
            textBoxVX.Text = String.Format(representation, (_chip8.Cpu.CurrentOpcode & 0x0F00) >> 8);
            textBoxVY.Text = String.Format(representation, (_chip8.Cpu.CurrentOpcode & 0x00F0) >> 4);
            textBoxNibble.Text = String.Format(representation, _chip8.Cpu.CurrentOpcode & 0x000F);
            textBoxNNN.Text = String.Format(representation, (((_chip8.Cpu.CurrentOpcode & 0x0F00) >> 8) + ((_chip8.Cpu.CurrentOpcode & 0x00F0) >> 4) + (_chip8.Cpu.CurrentOpcode & 0x000F)));
            textBoxNN.Text = String.Format(representation, (((_chip8.Cpu.CurrentOpcode & 0x00F0) >> 4) + (_chip8.Cpu.CurrentOpcode & 0x000F)));
        }
    public void SetText(List <int> indices, Visualisation visualisation)
    {
        int viewID = visualisation.GetComponentInParent <PhotonView>().ViewID;

        photonView.RPC("PropagateSetText", RpcTarget.All, indices.ToArray(), viewID);
    }
 public void Visualisation_RotateLeftButton()
 {
     Visualisation.getInstance().RotateLeft();
 }
    /*
     * public void MultiDigest_NextButton()
     * {
     *      for (int i = 0; i < multiDigestInputs.Length; i++)
     *      {
     *              if (multiDigestInputs[i].text == "")
     *              {
     *                      errorText.text = "All fragments must have a size";
     *                      return;
     *              }
     *      }
     *
     *      if(currentMultiDigestEnzymes.Count <= 1)
     *      {
     *              errorText.text = "At least 2 enzymes must be selected";
     *              return;
     *      }
     *
     *      int[] fragmentSizes = new int[multiDigestInputs.Length];
     *
     *      for (int i = 0; i < multiDigestInputs.Length; i++)
     *      {
     *              fragmentSizes[i] = int.Parse(multiDigestInputs[i].text);
     *      }
     *
     *      DataManager.getInstance().SetMultiDigestFragmentSizes(currentMultiDigestPage, fragmentSizes);
     *
     *      //Convert multidigest enzymes into array and pass to manager
     *      int[] multiDigestEnzymes = currentMultiDigestEnzymes.ToArray();
     *      currentMultiDigestEnzymes = new List<int>();
     *      Array.Sort(multiDigestEnzymes);
     *      DataManager.getInstance().SetMultiDigestEnzymes(currentMultiDigestPage, multiDigestEnzymes);
     *
     *      if(currentMultiDigestPage < numberOfMultiDigests-1)
     *      {
     *              multiDigestPages[currentMultiDigestPage].SetActive(false);
     *              currentMultiDigestPage++;
     *              multiDigestPages[currentMultiDigestPage].SetActive(true);
     *              Button button = multiDigestPages[currentMultiDigestPage].transform.Find("SetButton").GetComponent<Button>();
     *              button.onClick.AddListener(delegate { MultiDigest_SetButton(); });
     *              button = multiDigestPages[currentMultiDigestPage].transform.Find("NextButton").GetComponent<Button>();
     *              button.onClick.AddListener(delegate { MultiDigest_NextButton(); });
     *
     *              tabOrdering = new InputField[1];
     *              tabOrdering[0] = multiDigestPages[currentMultiDigestPage].transform.Find("InputField").GetComponent<InputField>();
     *              FocusNextInputField();
     *
     *      }
     *      else
     *      {
     *              //Begin Calculations
     *              Debug.Log("BEGINNING CALCULATIONS");
     *              multiDigestPages[currentMultiDigestPage].SetActive(false);
     *              gameObject.GetComponent<LogicManager>().enabled = true;
     *      }
     *
     *      errorText.text = "";
     *
     * }
     *
     * public void MultiDigest_BackButton()
     * {
     *
     * }
     */

    public void Visualisation_FlipButton()
    {
        Visualisation.getInstance().FlipMap();
    }
Example #29
0
        private void UpdateInfo()
        {
            Visualisation desiredRepresentation = Visualisation.Hexadecimal;

            UpdateInfo(desiredRepresentation);
        }
Example #30
0
    public void InstantiatePrefab()
    {
        if (CloneCount < NumberOfGraph)
        {
            //position of the cube
            float   countCloneDist = CloneCount * 1.5f; // adjusting the position as per the number of graph
            Vector3 pos            = new Vector3(-0.869097f + countCloneDist, 2.297714f, 1.17764f);



            var gameObject = new GameObject(); // creating parent GameObject

            // initializing cube(for dragging), Menu, Visualisation
            GameObject    cube = (GameObject)Instantiate(Cube, pos, Quaternion.Euler(new Vector3(0, 0, 0)));
            GameObject    Menu = (GameObject)Instantiate(MenuPrefab);
            Visualisation viz  = Instantiate(VizPrefab, pos, Quaternion.Euler(new Vector3(0, 0, 0)));

            // assigning GameObject to Follow for Visulization and Menu
            viz.GetComponent <VRTK_TransformFollow>().gameObjectToFollow            = cube.transform.Find("Cube").gameObject;
            Menu.transform.GetComponent <VRTK_TransformFollow>().gameObjectToFollow = cube.transform.Find("Canvas/Dummy").gameObject;

            // Assigning values to x,y,z parameter of Visualisation
            viz.dataSource            = Data;
            viz.xDimension.Attribute  = "Undefined";
            viz.yDimension.Attribute  = "Undefined";
            viz.zDimension.Attribute  = "Undefined";
            viz.geometry              = AbstractVisualisation.GeometryType.Bars;
            viz.colorPaletteDimension = "Undefined";

            // Assigning Visualisation to brushing and linking
            BL.brushedVisualisations.Add(viz);
            Menu.GetComponent <VRMenuInteractor>().visualisation = viz;

            // for Toggle event
            Toggle MenuToggle    = cube.transform.Find("Canvas/MenuToggle").GetComponent <Toggle>();
            Toggle DestroyToggle = cube.transform.Find("Canvas/DestroyToggle").GetComponent <Toggle>();
            DestroyToggle.name = CloneName.ToString();
            // MenuToggle.GetComponent<Toggle>().act = false;


            // adding attribute to the dropdown and attaching it to the visulization
            CreateAxisDropDown(viz, cube);

            // making Gameobject as parent to all the clone object
            gameObject.name       = CloneName.ToString();
            viz.transform.parent  = gameObject.transform;
            cube.transform.parent = gameObject.transform;
            Menu.transform.parent = gameObject.transform;

            // toggle function for menu enable and disable
            MenuToggle.onValueChanged.AddListener(value =>
            {
                Menu.SetActive(value);
            });

            // toggle function for Destroying the graph
            DestroyToggle.onValueChanged.AddListener(value =>
            {
                if (!value)
                {
                    Destroy(GameObject.Find(DestroyToggle.name));
                    CloneCount--; // when object is destroyed the count of the clone decreases
                }
            });
            // count of graph
            CloneCount++;
            //name for the graph
            CloneName++;
        }
    }
Example #31
0
 private void Awake()
 {
     instance = this;
 }