/*! * \brief Constructor * \param graphHeight Max Y value * \param graphWidth Max number of values on the X axis (cannot be modified) * \param panelinfos contains the panel Transform values \sa PanelInfos */ public TestRandomLine(int graphWidth, float graphHeight, PanelInfos panelInfos, string name = "") { this.name = name; //Logger.Log("created TestRandomLine "+name, Logger.Level.ERROR); this._panelInfos = panelInfos; this._graphWidth = graphWidth; this.graphHeight = graphHeight; this._pointsList = new List <Vector2>(); //resize(); this.color = generateAppropriateColor(); //this._vectorline = new VectorLine("Graph", _pointsArray, this.color, null, 1.0f, LineType.Continuous, Joins.Weld); //this._vectorline = new VectorLine("Graph_"+name, _pointsList, 1.0f, LineType.Continuous, Joins.Weld); GameObject point1 = new GameObject(); point1.name = "point1-global"; Vector2 position1 = generateRandomPoint(); point1.transform.position = position1; GameObject point2 = new GameObject(); point2.name = "point2-global"; Vector2 position2 = generateRandomPoint(); point2.transform.position = position2; GameObject point3 = new GameObject(); point3.name = "point3-local"; point3.transform.localPosition = point1.transform.position; GameObject point4 = new GameObject(); point4.name = "point4-local"; point4.transform.localPosition = point2.transform.position; List <Vector2> linePoints = new List <Vector2>() { position1, position2 }; this._vectorline = new VectorLine("Graph_" + name, linePoints, 1.0f, LineType.Continuous, Joins.Weld); this._vectorline.color = this.color; this._vectorline.layer = _panelInfos.layer; this._vectorline.Draw(); //VectorLine.SetCamera3D(GUICam); //VectorLine.SetCanvasCamera (GUICam); //VectorLine.SetLine (Color.red, new Vector2(0, 0), new Vector2(Screen.width-1, Screen.height-1)); //TODO //redraw(); }
/*! * \brief Constructor * \param graphHeight Max Y value * \param graphWidth Max number of values on the X axis (cannot be modified) * \param panelinfos contains the panel Transform values \sa PanelInfos */ public TestPanelPerimeter(int graphWidth, float graphHeight, PanelInfos panelInfos, string name = ""){ Debug.LogError(string.Format("TestPanelPerimeter({0}, {1}, {2}, {3})", graphWidth, graphHeight, panelInfos, name)); //TODO: graphHeight = max(maxYValue, minGraphHeight) to avoid huge zooms this.name = name; //Debug.LogError("created TestPanelPerimeter "+name); this._panelInfos = panelInfos; this._graphWidth = 1; this.graphHeight = 1f; computeRatios(); this._pointsList = new List<Vector2>(); //resize(); this.color = generateAppropriateColor(); //this._vectorline = new VectorLine("Graph", _pointsArray, this.color, null, 1.0f, LineType.Continuous, Joins.Weld); //this._vectorline = new VectorLine("Graph_"+name, _pointsList, 1.0f, LineType.Continuous, Joins.Weld); Vector2 vec00 = newPoint(0, 0); Vector2 vec01 = newPoint(0, 1); Vector2 vec11 = newPoint(1, 1); Vector2 vec10 = newPoint(1, 0); linePointsPerimeter = new List<Vector2>(){vec00, vec01, vec11, vec10}; generatePointsAndDraw(); //VectorLine.SetCamera3D(GUICam); //VectorLine.SetCanvasCamera (GUICam); //VectorLine.SetLine (Color.red, new Vector2(0, 0), new Vector2(Screen.width-1, Screen.height-1)); //TODO //redraw(); }
// Use this for initialization void Start() { infos = new PanelInfos(); //refreshInfos(); setInfos(); safeLazyInit(); _lines = new List <VectrosityPanelLine>(); setMedium(_mediumId); }
/*! * \brief Constructor * \param graphHeight Max Y value * \param graphWidth Max number of values on the X axis (cannot be modified) * \param panelinfos contains the panel Transform values \sa PanelInfos */ public TestRandomLine(int graphWidth, float graphHeight, PanelInfos panelInfos, string name = ""){ this.name = name; //Logger.Log("created TestRandomLine "+name, Logger.Level.ERROR); this._panelInfos = panelInfos; this._graphWidth = graphWidth; this.graphHeight = graphHeight; this._pointsList = new List<Vector2>(); //resize(); this.color = generateAppropriateColor(); //this._vectorline = new VectorLine("Graph", _pointsArray, this.color, null, 1.0f, LineType.Continuous, Joins.Weld); //this._vectorline = new VectorLine("Graph_"+name, _pointsList, 1.0f, LineType.Continuous, Joins.Weld); GameObject point1 = new GameObject(); point1.name = "point1-global"; Vector2 position1 = generateRandomPoint(); point1.transform.position = position1; GameObject point2 = new GameObject(); point2.name = "point2-global"; Vector2 position2 = generateRandomPoint(); point2.transform.position = position2; GameObject point3 = new GameObject(); point3.name = "point3-local"; point3.transform.localPosition = point1.transform.position; GameObject point4 = new GameObject(); point4.name = "point4-local"; point4.transform.localPosition = point2.transform.position; List<Vector2> linePoints = new List<Vector2>(){position1, position2}; this._vectorline = new VectorLine("Graph_"+name, linePoints, 1.0f, LineType.Continuous, Joins.Weld); this._vectorline.color = this.color; this._vectorline.layer = _panelInfos.layer; this._vectorline.Draw(); //VectorLine.SetCamera3D(GUICam); //VectorLine.SetCanvasCamera (GUICam); //VectorLine.SetLine (Color.red, new Vector2(0, 0), new Vector2(Screen.width-1, Screen.height-1)); //TODO //redraw(); }
/*! * \brief Constructor * \param graphHeight Max Y value * \param graphWidth Max number of values on the X axis (cannot be modified) * \param panelinfos contains the panel Transform values \sa PanelInfos */ public TestNewLine(int graphWidth, float graphHeight, PanelInfos panelInfos, string name = ""){ this.name = name; this._panelInfos = panelInfos; this._graphWidth = graphWidth; this.graphHeight = graphHeight; computeRatios(); this.color = generateAppropriateColor(); this._floatList = new List<float>(); this._pointsLinkedList = new LinkedList<Vector2>(); this._pointsList = new List<Vector2>(); initializeVectorLine(); resize(); redraw(); }
/*! * \brief Constructor * \param graphHeight Max Y value * \param graphWidth Max number of values on the X axis (cannot be modified) * \param panelinfos contains the panel Transform values \sa PanelInfos */ public Line(int graphWidth, float _graphHeight, PanelInfos panelInfos, int _mediumId, string _moleculeName){ this.name = generateLineName(_mediumId, _moleculeName); this.moleculeName = _moleculeName; this._panelInfos = panelInfos; this._graphWidth = graphWidth; this.lastNonZeroValueIndex = graphWidth; this.graphHeight = _graphHeight; computeRatios(); this.color = generateAppropriateColor(); this._floatList = new List<float>(); this._pointsList = new List<Vector2>(); initializeVectorLine(); resize(); redraw(); }
/*! * \brief Constructor * \param graphHeight Max Y value * \param graphWidth Max number of values on the X axis (cannot be modified) * \param panelinfos contains the panel Transform values \sa PanelInfos */ public TestNewLine(int graphWidth, float graphHeight, PanelInfos panelInfos, string name = "") { this.name = name; this._panelInfos = panelInfos; this._graphWidth = graphWidth; this.graphHeight = graphHeight; computeRatios(); this.color = generateAppropriateColor(); this._floatList = new List <float>(); this._pointsLinkedList = new LinkedList <Vector2>(); this._pointsList = new List <Vector2>(); initializeVectorLine(); resize(); redraw(); }
/*! * \brief Constructor * \param graphHeight Max Y value * \param graphWidth Max number of values on the X axis (cannot be modified) * \param panelinfos contains the panel Transform values \sa PanelInfos */ public Line(int graphWidth, float graphHeight, PanelInfos panelInfos) { this._panelInfos = panelInfos; this._graphWidth = graphWidth; this.graphHeight = graphHeight; this._pointsList = new List<float>(); this._pointsArray = new Vector3[_graphWidth]; this.color = new Color(Random.Range(0.2f, 1f), Random.Range(0.2f, 1f), Random.Range(0.2f, 1f)); this._vectorline = new VectorLine("Graph", _pointsArray, this.color, null, 1.0f, LineType.Continuous, Joins.Weld); this._vectorline.layer = _panelInfos.layer; for(int i = 0; i < _graphWidth; i++) _pointsList.Add(0); resize(); redraw(); }
/*! * \brief Constructor * \param graphHeight Max Y value * \param graphWidth Max number of values on the X axis (cannot be modified) * \param panelinfos contains the panel Transform values \sa PanelInfos */ public Line(int graphWidth, float _graphHeight, PanelInfos panelInfos, int _mediumId, string _moleculeName) { this.name = generateLineName(_mediumId, _moleculeName); this.moleculeName = _moleculeName; this._panelInfos = panelInfos; this._graphWidth = graphWidth; this.lastNonZeroValueIndex = graphWidth; this.graphHeight = _graphHeight; computeRatios(); this.color = generateAppropriateColor(); this._floatList = new List <float>(); this._pointsList = new List <Vector2>(); initializeVectorLine(); resize(); redraw(); }
/*! * \brief Constructor * \param graphHeight Max Y value * \param graphWidth Max number of values on the X axis (cannot be modified) * \param panelinfos contains the panel Transform values \sa PanelInfos */ public TestFlatLine(int graphWidth, float graphHeight, PanelInfos panelInfos, string name = ""){ this.name = name; this._panelInfos = panelInfos; this._graphWidth = graphWidth; this.graphHeight = graphHeight; computeRatios(); this.color = generateAppropriateColor(); this._floatList = new List<float>(); this._pointsLinkedList = new LinkedList<Vector2>(); this._pointsList = new List<Vector2>(); this._vectorline = new VectorLine("GraphNL_"+name, _pointsList, 1.0f, LineType.Continuous, Joins.Weld); this._vectorline.color = this.color; this._vectorline.layer = _panelInfos.layer; resize(); redraw(); }
/*! * \brief Constructor * \param graphHeight Max Y value * \param graphWidth Max number of values on the X axis (cannot be modified) * \param panelinfos contains the panel Transform values \sa PanelInfos */ public TestFlatLine(int graphWidth, float graphHeight, PanelInfos panelInfos, string name = "") { this.name = name; this._panelInfos = panelInfos; this._graphWidth = graphWidth; this.graphHeight = graphHeight; computeRatios(); this.color = generateAppropriateColor(); this._floatList = new List <float>(); this._pointsLinkedList = new LinkedList <Vector2>(); this._pointsList = new List <Vector2>(); this._vectorline = new VectorLine("GraphNL_" + name, _pointsList, 1.0f, LineType.Continuous, Joins.Weld); this._vectorline.color = this.color; this._vectorline.layer = _panelInfos.layer; resize(); redraw(); }
/*! * \brief Constructor * \param graphHeight Max Y value * \param graphWidth Max number of values on the X axis (cannot be modified) * \param panelinfos contains the panel Transform values \sa PanelInfos */ public TestPanelPerimeter(int graphWidth, float graphHeight, PanelInfos panelInfos, string name = "") { Debug.LogError(string.Format("TestPanelPerimeter({0}, {1}, {2}, {3})", graphWidth, graphHeight, panelInfos, name)); //TODO: graphHeight = max(maxYValue, minGraphHeight) to avoid huge zooms this.name = name; //Debug.LogError("created TestPanelPerimeter "+name); this._panelInfos = panelInfos; this._graphWidth = 1; this.graphHeight = 1f; computeRatios(); this._pointsList = new List <Vector2>(); //resize(); this.color = generateAppropriateColor(); //this._vectorline = new VectorLine("Graph", _pointsArray, this.color, null, 1.0f, LineType.Continuous, Joins.Weld); //this._vectorline = new VectorLine("Graph_"+name, _pointsList, 1.0f, LineType.Continuous, Joins.Weld); Vector2 vec00 = newPoint(0, 0); Vector2 vec01 = newPoint(0, 1); Vector2 vec11 = newPoint(1, 1); Vector2 vec10 = newPoint(1, 0); linePointsPerimeter = new List <Vector2>() { vec00, vec01, vec11, vec10 }; generatePointsAndDraw(); //VectorLine.SetCamera3D(GUICam); //VectorLine.SetCanvasCamera (GUICam); //VectorLine.SetLine (Color.red, new Vector2(0, 0), new Vector2(Screen.width-1, Screen.height-1)); //TODO //redraw(); }
// Use this for initialization void Start() { infos = new PanelInfos(); refreshInfos(); VectorLine.SetCamera3D(GUICam); _lines = new List<Line>(); if (_reactionEngine == null) return ; LinkedList<Medium> mediums = _reactionEngine.getMediumList(); if (mediums == null) return ; Medium medium = ReactionEngine.getMediumFromId(_mediumId, mediums); if (medium == null) { Debug.Log("Can't find the given medium (" + _mediumId + ")"); return ; } _molecules = medium.getMolecules(); if (_molecules == null) return ; foreach (Molecule m in _molecules) _lines.Add(new Line(200, 800, infos, m.getName())); drawLines(true); }
// Use this for initialization void Start() { infos = new PanelInfos(); refreshInfos(); VectorLine.SetCamera3D(GUICam); _lines = new List<Line>(); _values = new List<float>(); for(int i = 0; i < 20; i++){ _lines.Add(new Line(200, 800, infos)); _values.Add(0f); } drawLines(true); }
// Use this for initialization void Start () { infos = new PanelInfos(); //refreshInfos(); setInfos(); safeLazyInit(); _lines = new List<VectrosityPanelLine>(); setMedium(_mediumId); }