void OnPostRender() { SelectedNodeMaterial.SetPass(0); int selectednode = SelectedNode; if (selectednode == -1) { return; } MaxNode node = maxnodes[selectednode]; GL.Begin(GL.LINES); for (int x = 2; node.triangles.Length > x; x += 3) { int i1 = node.triangles[x - 2]; int i2 = node.triangles[x - 1]; int i3 = node.triangles[x - 0]; Vector3 pos1 = node.vertices[i1] + node.position; Vector3 pos2 = node.vertices[i2] + node.position; Vector3 pos3 = node.vertices[i3] + node.position; GL.Vertex3(pos1.x, pos1.y, pos1.z); GL.Vertex3(pos2.x, pos2.y, pos2.z); GL.Vertex3(pos2.x, pos2.y, pos2.z); GL.Vertex3(pos3.x, pos3.y, pos3.z); GL.Vertex3(pos1.x, pos1.y, pos1.z); GL.Vertex3(pos3.x, pos3.y, pos3.z); } GL.End(); }
public override NodeViewModel CreateModel() { CombinerNode result = null; switch (combineType) { case CombinerType.Add: result = new AddNode(); break; case CombinerType.Max: result = new MaxNode(); break; case CombinerType.Min: result = new MinNode(); break; case CombinerType.Multiply: result = new MultiplyNode(); break; case CombinerType.Power: result = new PowerNode(); break; } result.Name = name; result.Position = pos; return(result); }
protected virtual QueryNode VisitMax(MaxNode node, AzureQueryOptimizerState state) { QueryNode queryNode1 = this.Visit(node.SourceNode, state); QueryNode queryNode2 = this.Visit(node.PredicateNode, state); if (queryNode2.NodeType == QueryNodeType.MatchAll) { return((QueryNode) new MaxNode(queryNode1, queryNode2, node.AllowDefaultValue)); } return((QueryNode) new MaxNode(this.VisitAnd(new AndNode(queryNode1, queryNode2), state), (QueryNode) new MatchAllNode(), node.AllowDefaultValue)); }
protected virtual QueryNode VisitMax(MaxNode node, ElasticSearchQueryOptimizerState state) { var node2 = Visit(node.SourceNode, state); var node3 = Visit(node.PredicateNode, state); if (node3.NodeType == QueryNodeType.MatchAll) { return(new MaxNode(node2, node3, node.AllowDefaultValue)); } return(new MaxNode(VisitAnd(new AndNode(node2, node3), state), new MatchAllNode(), node.AllowDefaultValue)); }
internal VacPackNode(string json) : base(json) { Amount = new AmountNode(_ParsedData["amount"]?.ToString() ?? ""); Max = new MaxNode(_ParsedData["max"]?.ToString() ?? ""); Color = new ColorNode(_ParsedData["color"]?.ToString() ?? ""); SellectedSlot = GetInt("sellected_slot"); UseableSlots = GetInt("useable_slots"); EmtyItemSlots = GetInt("emty_Item_slots"); InGadgetMode = GetBool("in_gadget_mode"); InNimbleValleyMode = GetBool("in_nimble_valley_mode"); }
private void UpdateScore(MaxNode node, int score) { if (!node.m_children.IsEmpty) { var minNode = (GameNode)node.m_children.Peek(); if (minNode.m_score > score) { node.m_score = minNode.m_score; return; } } node.m_score = score; }
static HtmlNode NodeWithBiggestParent(HtmlNodeCollection nodes) { if (nodes == null) { return(null); } var max = new MaxNode(); foreach (var n in nodes) { var s = n.ParentNode.InnerHtml.Length; if (s > max.Value) { max.Node = n; max.Value = s; } } return(max.Node); }
// Message functions from 3dsmax void NODEDATA(string[] data) { if (data.Length != 2) { return; } string[] nodedata = data[1].Split('%'); for (int x = 1; nodedata.Length > x; x++) { string[] splitnodedata = nodedata[x].Split(';'); string name = splitnodedata[0]; string[] verts = splitnodedata[1].Split('|'); string[] faces = splitnodedata[2].Split('|'); string[] uv = splitnodedata[3].Split('|'); string[] normals = splitnodedata[4].Split('|'); string[] trans = splitnodedata[5].Split('|'); verts = StringArrayClean(verts); faces = StringArrayClean(faces); uv = StringArrayClean(uv); normals = StringArrayClean(normals); trans = StringArrayClean(trans); List <Vector3> vertexs = new List <Vector3>(); List <int> indices = new List <int>(); List <Vector3> normalval = new List <Vector3>(); // verts for (int i = 2; verts.Length > i; i += 3) { Vector3 vert = new Vector3(Convert.ToSingle(verts[i - 2]), Convert.ToSingle(verts[i - 1]), Convert.ToSingle(verts[i - 0])); vertexs.Add(vert); } // faces for (int i = 0; faces.Length > i; i++) { indices.Add(Convert.ToInt32(faces[i])); } // uv List <Vector2> uvw = new List <Vector2>(); for (int i = 1; uv.Length > i; i += 2) { Vector2 vw = new Vector2(Convert.ToSingle(uv[i - 1]), Convert.ToSingle(uv[i - 0])); uvw.Add(vw); } // normals for (int i = 2; normals.Length > i; i += 3) { Vector3 norm = new Vector3(Convert.ToSingle(normals[i - 2]), Convert.ToSingle(normals[i - 1]), Convert.ToSingle(normals[i - 0])); normalval.Add(norm); } MaxNode mn = new MaxNode(); mn.vertices = vertexs.ToArray(); mn.triangles = indices.ToArray(); mn.uv = uvw.ToArray(); mn.normals = normalval.ToArray(); mn.position = new Vector3(Convert.ToSingle(trans[0]), Convert.ToSingle(trans[1]), Convert.ToSingle(trans[2])); mn.name = name; scene.maxnodes.Add(mn); } }
protected virtual void StripMax(MaxNode node, HashSet <QueryMethod> additionalQueryMethods) { additionalQueryMethods.Add(new MaxMethod(node.AllowDefaultValue)); }
static HtmlNode NodeWithBiggestParent(HtmlNodeCollection nodes) { if (nodes == null) return null; var max = new MaxNode(); foreach (var n in nodes) { var s = n.ParentNode.InnerHtml.Length; if (s > max.Value) { max.Node = n; max.Value = s; } } return max.Node; }