/// <summary> /// Obtiene la informacion de una imagen en formato base64 /// </summary> /// <returns></returns> public string GetAsImage64() { String sdot = GetASDOT(); DOT dot = new DOT(); BinaryImage img = dot.ToPNG(sdot); img.Save(Path.Combine(folder, fname)); return(img.ToBase64String()); }
public override void ActivateItem(Player player) { base.ActivateItem(player); if (player.photonView.isMine) { GameObject go = PhotonNetwork.Instantiate("Items/Meshes/" + m_Name.Replace("TheNegative.Items.", ""), player.ActiveItemLocation.position, player.ActiveItemLocation.rotation, 0); m_EyeNetworkBehaviour = go.GetComponentInChildren <DOT>(); m_EyeNetworkBehaviour.OwnersID = player.PlayerNumber; m_EyeNetworkBehaviour.SetActive(false); go.transform.parent = player.ActiveItemLocation; go.transform.rotation = Quaternion.Euler(new Vector3(-90, 0, 0)); } }
public static void generarOtraImagen(ParseTreeNode raiz) { try { String grafo_en_DOT = ControlDOT.ControlDOT.getDOT2(raiz); DOT dot = new DOT(); BinaryImage img = dot.ToPNG(grafo_en_DOT); img.Save("C:/Users/pablo/Desktop/Compi Junio/[Compi1]Practica1/[Compi1]Practica1/imagenes/ASA.png"); MessageBox.Show("Se creó el ASA."); } catch (Exception) { MessageBox.Show("No se creó el ASA."); } }
public void ResolveDOT() // obrazenia z efektow trucizny/krawienia-czasowych obrazen { int obrazenia = 0; foreach (DOTEffect DOT in DOTEffects.Reverse <DOTEffect>()) // oblicza sume wszystkich obrazen czasowych oraz usuwa te ktorych czas dzialania sie skonczyl { obrazenia = obrazenia + DOT.GetDamage(); DOT.DecrementTurnsLeft(); if (DOT.GetTurnsLeft() <= 0) { DOTEffects.Remove(DOT); } } SetHP(GetHP() - obrazenia); }
public static void generarImagenEXP(ParseTreeNode raiz, int numero) { try { String grafo_en_DOT = Programa.DibujarEXP(raiz); DOT dot = new DOT(); BinaryImage img = dot.ToPNG(grafo_en_DOT); img.Save("C:/Users/pablo/Desktop/CompiJunio/[Compi1]Proyecto2/[Compi1]Proyecto2/imagenes/EXP" + numero + ".png"); MessageBox.Show("Se creó el EXP" + numero + "."); Programa.sw.WriteLine("<tr>"); Programa.sw.WriteLine("<th>DibujarEXP: AST de una expresion en particular</th>"); Programa.sw.WriteLine("<th>EXP_" + numero + "</th>"); Programa.sw.WriteLine("<th><img src=" + "\"" + "[Compi1]Proyecto2/imagenes/EXP" + numero + ".png" + "\"" + "></th>"); Programa.sw.WriteLine("</tr>"); } catch (Exception) { MessageBox.Show("No se creó el EXP" + numero + "."); } }
public static void generarImagenAST(ParseTreeNode raiz, String nombre) { try { String grafo_en_DOT = Programa.DibujarAST(raiz); DOT dot = new DOT(); BinaryImage img = dot.ToPNG(grafo_en_DOT); img.Save("C:/Users/pablo/Desktop/CompiJunio/[Compi1]Proyecto2/[Compi1]Proyecto2/imagenes/AST" + nombre + ".png"); MessageBox.Show("Se creó el AST del " + nombre + "."); Programa.sw.WriteLine("<tr>"); Programa.sw.WriteLine("<th>DibujarAST: AST de una funcion en particular</th>"); Programa.sw.WriteLine("<th>AST_" + nombre + "</th>"); Programa.sw.WriteLine("<th><img src=" + "\"" + "[Compi1]Proyecto2/imagenes/AST" + nombre + ".png" + "\"" + "></th>"); Programa.sw.WriteLine("</tr>"); } catch (Exception) { MessageBox.Show("No se creó el AST del " + nombre + "."); } }
void AddEffect(GameObject target) { if (target.GetComponent <DOT>() != null) { if (target.GetComponent <DOT>().dotType == DOT.DOTType.Fire) { target.GetComponent <DOT>().Refresh(); } else { DOT dot = target.AddComponent <DOT>(); dot.maxTicks = maxTicks; dot.ticksPerSecond = ticksPerSec; dot.damage = (int)baseDamage; } } else { DOT dot = target.AddComponent <DOT>(); dot.maxTicks = maxTicks; dot.ticksPerSecond = ticksPerSec; dot.damage = (int)baseDamage; } }
/// <summary> /// Parses the stream containing a Boost Test DOT representation of a Test Framework. Notifies the /// provided visitor (during parsing) of any identified test units. /// </summary> /// <param name="stream">The stream consisting of a DOT representation</param> /// <param name="visitor">The visitor which will be notified during parsing</param> /// <returns>The deserialised Test Framework</returns> /// <remarks> /// The visitor will not necessarily be notified in a top-down fashion. To ensure top-down /// visitation, wait for the result and visit the master test suite. /// </remarks> public TestFramework Deserialise(Stream stream, ITestVisitor visitor) { BoostTestFrameworkVisitor dotVisitor = new BoostTestFrameworkVisitor(this, visitor); return(DOT.Parse(stream, dotVisitor)); }
//------------------------------------------applyDOT() public void applyDOT(int _damage, int _duration, float _statMod, STATUS_EFFECT _status, bool _isCompounding, float _multiplier) { DOT d = new DOT(_damage, _duration, _duration, _statMod, _status, _isCompounding, _multiplier); Dots.Add(d); }
private void GenerateSVG() { string DotFilePath = String.Format("{0}\\DOTFILE.dot", Application.UserAppDataPath); graph.ToDotFile(DotFilePath); DOT dotfile = new DOT(); DotFile = File.ReadAllText(DotFilePath); string svg = dotfile.ToSvg(DotFile); File.WriteAllText(SVGFilePath, svg); XDocument doc = XDocument.Parse(svg); SVGFile = (XElement)doc.LastNode; FormatSVG(); ZoomFactor = -2; SVGFile.Attribute("currentScale").SetValue(Math.Pow(1.25, ZoomFactor)); SVGFile.Attribute("width").SetValue(((int)(SVGWidth * Math.Pow(1.25, ZoomFactor))) + "px"); SVGFile.Attribute("height").SetValue(((int)(SVGHeight * Math.Pow(1.25, ZoomFactor))) + "px"); SVGFile.Save(SVGFilePath); webBrowser1.Refresh(); }
public Form2() { InitializeComponent(); /* string DotFilePath = String.Format(@"C:\Users\Zenith\AppData\Roaming\HNClusterUI\HNClusterUI\1.0.0.0\DOTFILE - Copy - Copy.dot"); //graph.ToDotFile(DotFilePath); DOT dotfile2 = new DOT(); string DotFile1 = File.ReadAllText(DotFilePath); string svg2 = dotfile2.ToSvg(DotFile1); return;*/ this.MouseWheel += new System.Windows.Forms.MouseEventHandler(Form2_MouseWheel); this.KeyDown += Form2_KeyDown_KeyUp; this.KeyUp += Form2_KeyDown_KeyUp; this.KeyPreview = true; webBrowser1.WebBrowserShortcutsEnabled = false; webBrowser1.IsWebBrowserContextMenuEnabled = false; webBrowser1.PreviewKeyDown += webBrowser1_PreviewKeyDown; Control c = webBrowser1; c.KeyDown += Form2_KeyDown_KeyUp; c.KeyUp += Form2_KeyDown_KeyUp; //c.Enabled = false; /* foreach (Control control in this.Controls) { control.KeyDown += new KeyEventHandler(Form2_KeyDown_KeyUp); control.KeyUp += new KeyEventHandler(Form2_KeyDown_KeyUp); //control.KeyPress += new KeyEventHandler(Form2_KeyDown_KeyUp); }*/ graph = new Xglore.Plugin.Graphviz.RootGraph("Clusters", false, false); string MainNode = " _3D.P–r,i:nt–ing'L13_01111111101-- 010Noro–Frenkel_law_of_corresponding___stat&es+ "; AddNode(MainNode); AddNode("0"); AddNode("00"); AddNode("000"); AddNode("001"); AddNode("01"); AddNode("010"); AddNode("011"); AddNode("1"); AddNode("10"); AddNode("100"); AddNode("101"); AddNode("11"); AddNode("110"); AddNode("111"); AddEdge(MainNode, "0"); AddEdge(MainNode, "1"); AddEdge("0", "00"); AddEdge("00", "000"); AddEdge("00", "001"); AddEdge("0", "01"); AddEdge("01", "010"); AddEdge("01", "011"); AddEdge("1", "10"); AddEdge("10", "100"); AddEdge("10", "101"); AddEdge("1", "11"); AddEdge("11", "110"); AddEdge("11", "111"); for (int i = 0; i < 10; ++i) { AddNode(i.ToString()); } for (int x = 0; x < 10; ++x) { for (int y = x; y < 10; ++y) { if (x != y) AddEdge(x.ToString(), y.ToString()); } } string dotPath = String.Format("{0}\\DOTFILE.dot", Application.UserAppDataPath); graph.ToDotFile(dotPath); DOT dotfile = new DOT(); string strBlah3 = System.IO.File.ReadAllText(dotPath); string svg = dotfile.ToSvg(strBlah3); System.IO.File.WriteAllText(String.Format("{0}\\SVG.svg", Application.UserAppDataPath), svg); //webBrowser1.Url = new Uri(@"C:\Users\Zenith\Documents\GitHub\Wikipedia-Clustering\HNCluster\HNCluster\bin\Debug\" + "SVG.svg"); Uri url = new Uri(String.Format("{0}\\SVG.svg", Application.UserAppDataPath)); webBrowser1.Url = url; XDocument doc = XDocument.Parse(svg); SVGFile = (XElement)doc.LastNode; //SVGFile = XDocument.Parse(svg).Element("svg"); this.Focus(); }
/// <summary> /// Parses the stream containing a Boost Test DOT representation of a Test Framework /// </summary> /// <param name="stream">The text reader consisting of a DOT representation</param> /// <returns>The deserialised Test Framework</returns> public TestFramework Deserialise(TextReader stream) { BoostTestFrameworkVisitor dotVisitor = new BoostTestFrameworkVisitor(this); return(DOT.Parse(stream, dotVisitor)); }