public async Task <IActionResult> Edit(string id, [Bind("DrawID,DrawName,draw_dt")] draw _draw) { if (id != _draw.DrawID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(_draw); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ItemExists(_draw.DrawID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(_draw )); }
public void Draw() { draw myDraws = new draw() { DrawID = "123", DrawName = "DailyJackpot", date_dt = DateTime.Now }; }
private void TriggerPressed(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource) { Debug.Log("click"); temp = Instantiate(Line); activeLine = temp.GetComponent <draw>(); key = true; //UpdateLine(transform.position); }
public DelegateDAC(uint ascanNum, string dacMode, float[] tof, float[] ampPercent, uint dacPoint) { this.dacMode = dacMode; this.tof = tof; this.ampPercent = ampPercent; this.dacPoint = dacPoint; drawEvent += new draw(FormList.MDIChild.drawDACLine); }
public IActionResult Create(draw _draw) { if (ModelState.IsValid) { _repository.InsertDraw(_draw); _repository.Save(); return(RedirectToAction("Index")); } return(View(_draw)); }
public async Task <IActionResult> Create([Bind("DrawID,DrawName,draw_dt")] draw _draw) { if (ModelState.IsValid) { _context.Add(_draw); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(_draw)); }
public MainForm() { this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(640, 480); this.Name = "MainForm"; this.Text = "MyGame"; this.drawobjectandmove = new draw(); this.drawobjectandmove.Parent = this; this.drawobjectandmove.Dock = DockStyle.Fill; this.Show(); }
// Use this for initialization void Start() { drawScript = (draw)GameObject.Find("Main Camera").GetComponent(typeof(draw)); menuButtonTexture = (Texture)Resources.Load("MenuButton"); menuBackgroundTexture = (Texture)Resources.Load("MenuBG"); hostServerTexture = (Texture)Resources.Load("CreateServerUnpressed"); joinServerTexture = (Texture)Resources.Load("JoinServerUnpressed"); rubberButtonTexture = (Texture)Resources.Load("RubberButton"); buttonStyle = new GUIStyle(); buttonStyle.fontSize = 20; }
public async Task <draw> Create(draw _draw) { var data = new draw { DrawID = _draw.DrawID, DrawName = _draw.DrawName, draw_dt = _draw.draw_dt, }; await _context.draw.AddAsync(data); await _context.SaveChangesAsync(); return(data); }
public void DrawTest() { //arrange draw d = new draw() { DrawID = "123", DrawName = "DailyJackpot", date_dt = DateTime.Now }; //act //assert //Assert.IsInstanceOfType(d, typeof(draw)); //Assert.AreEqual(d.DrawID, "123"); //Assert.AreEqual(d.DrawName, "DailyJackpot"); //Assert.AreEqual(d.date_dt, DateTime.Now); }
public async Task <bool> Delete(string id) { Task <draw> dwTask = _context.draw.FirstOrDefaultAsync(p => p.DrawID == id); draw dw = dwTask.Result; if (dw == null) { return(false); } _context.Remove(dw); await _context.SaveChangesAsync(); return(true); }
public async Task <bool> Update(draw _draw) { Task <draw> dwTask = _context.draw.FirstOrDefaultAsync(p => p.DrawID == _draw.DrawID); draw dw = dwTask.Result; if (dw == null) { return(false); } dw.DrawID = _draw.DrawID; dw.DrawName = _draw.DrawName; dw.draw_dt = _draw.draw_dt; await _context.SaveChangesAsync(); return(true); }
static int R_AliasClip(draw.finalvert_t[] @in, draw.finalvert_t[] @out, int flag, int count, clip delegate_clip) { int i,j,k; int flags, oldflags; j = count-1; k = 0; for (i=0 ; i<count ; j = i, i++) { oldflags = @in[j].flags & flag; flags = @in[i].flags & flag; if (flags != 0 && oldflags != 0) continue; if ((oldflags ^ flags) != 0) { av0 = j; av1 = i; delegate_clip (@in[j], @in[i], ref @out[k]); @out[k].flags = 0; if (@out[k].v[0] < r_refdef.aliasvrect.x) @out[k].flags |= ALIAS_LEFT_CLIP; if (@out[k].v[1] < r_refdef.aliasvrect.y) @out[k].flags |= ALIAS_TOP_CLIP; if (@out[k].v[0] > r_refdef.aliasvrectright) @out[k].flags |= ALIAS_RIGHT_CLIP; if (@out[k].v[1] > r_refdef.aliasvrectbottom) @out[k].flags |= ALIAS_BOTTOM_CLIP; k++; } if (flags == 0) { draw.finalvert_t.Copy(@in[i], @out[k]); // @out[k] = @in[i]; k++; } } return k; }
//this may not work public void removeFromDrawList(draw model) { models.Remove(model); }
/* ================ R_AliasProjectFinalVert ================ */ static void R_AliasProjectFinalVert(draw.finalvert_t fv, auxvert_t av) { double zi; // project points zi = 1.0 / av.fv[2]; fv.v[5] = (int)(zi * ziscale); fv.v[0] = (int)((av.fv[0] * aliasxscale * zi) + aliasxcenter); fv.v[1] = (int)((av.fv[1] * aliasyscale * zi) + aliasycenter); }
private void TriggerUp(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource) { Debug.Log("up"); activeLine = null; key = false; }
public void addModelToDrawList(draw model) { models.Add(model); }
public void InsertDraw(draw _draw) { _context.draw.Add(_draw); }
private void getHigherPixel(Image <Gray, Byte> image) { Bitmap c = new Bitmap(image.Bitmap); int px = 0, py = 0; double[] maxValues; Point[] maxLocations; image.MinMax(out _, out maxValues, out _, out maxLocations); px = maxLocations[0].X; py = maxLocations[0].Y; float v = c.GetPixel(px, py).GetBrightness(); if (v >= 0.933f && v <= 0.936f) { float radius = 10; float x1 = px - radius; float y1 = py - radius; float width = 2 * radius; float height = 2 * radius; if (!startedDrawing) { startedDrawing = true; // MessageBox.Show("starting"); dlist.Clear(); this.Text = "starting"; } if (startedDrawing) { draw pnn = new draw(); pnn.x = px; pnn.y = py; dlist.Add(pnn); } using (Graphics g = Graphics.FromImage(c)) { Pen p = new Pen(Color.Red, 2); if (startedDrawing) { for (int i = 1; i < dlist.Count; i++) { g.DrawLine(p, dlist[i - 1].x, dlist[i - 1].y, dlist[i].x, dlist[i].y); } } g.DrawEllipse(p, x1, y1, width, height); } Image <Bgr, Byte> myImage2 = new Image <Bgr, Byte>(c); imageBox1.Image = myImage2; } else { if (startedDrawing) { startedDrawing = false; this.Text = "stoped"; // MessageBox.Show("stoped"); } } this.Text = v.ToString(); }
public void removeSprite(draw drawSprite) { drawCalls.Remove(drawSprite); }
public void addSprite(draw drawSprite) { drawCalls.Add(drawSprite); }
/* ================ R_Alias_clip_z pfv0 is the unclipped vertex, pfv1 is the z-clipped vertex ================ */ static void R_Alias_clip_z(draw.finalvert_t pfv0, draw.finalvert_t pfv1, ref draw.finalvert_t @out) { double scale; auxvert_t pav0, pav1, avout = new auxvert_t(); pav0 = av[av0]; pav1 = av[av1]; if (pfv0.v[1] >= pfv1.v[1]) { scale = (ALIAS_Z_CLIP_PLANE - pav0.fv[2]) / (pav1.fv[2] - pav0.fv[2]); avout.fv[0] = pav0.fv[0] + (pav1.fv[0] - pav0.fv[0]) * scale; avout.fv[1] = pav0.fv[1] + (pav1.fv[1] - pav0.fv[1]) * scale; avout.fv[2] = ALIAS_Z_CLIP_PLANE; @out.v[2] = (int)(pfv0.v[2] + (pfv1.v[2] - pfv0.v[2]) * scale); @out.v[3] = (int)(pfv0.v[3] + (pfv1.v[3] - pfv0.v[3]) * scale); @out.v[4] = (int)(pfv0.v[4] + (pfv1.v[4] - pfv0.v[4]) * scale); } else { scale = (ALIAS_Z_CLIP_PLANE - pav1.fv[2]) / (pav0.fv[2] - pav1.fv[2]); avout.fv[0] = pav1.fv[0] + (pav0.fv[0] - pav1.fv[0]) * scale; avout.fv[1] = pav1.fv[1] + (pav0.fv[1] - pav1.fv[1]) * scale; avout.fv[2] = ALIAS_Z_CLIP_PLANE; @out.v[2] = (int)(pfv1.v[2] + (pfv0.v[2] - pfv1.v[2]) * scale); @out.v[3] = (int)(pfv1.v[3] + (pfv0.v[3] - pfv1.v[3]) * scale); @out.v[4] = (int)(pfv1.v[4] + (pfv0.v[4] - pfv1.v[4]) * scale); } R_AliasProjectFinalVert (@out, avout); if (@out.v[0] < r_refdef.aliasvrect.x) @out.flags |= ALIAS_LEFT_CLIP; if (@out.v[1] < r_refdef.aliasvrect.y) @out.flags |= ALIAS_TOP_CLIP; if (@out.v[0] > r_refdef.aliasvrectright) @out.flags |= ALIAS_RIGHT_CLIP; if (@out.v[1] > r_refdef.aliasvrectbottom) @out.flags |= ALIAS_BOTTOM_CLIP; }
static void R_Alias_clip_top(draw.finalvert_t pfv0, draw.finalvert_t pfv1, ref draw.finalvert_t @out) { double scale; int i; if (pfv0.v[1] >= pfv1.v[1]) { scale = (double)(r_refdef.aliasvrect.y - pfv0.v[1]) / (pfv1.v[1] - pfv0.v[1]); for (i=0 ; i<6 ; i++) @out.v[i] = (int)(pfv0.v[i] + (pfv1.v[i] - pfv0.v[i]) * scale + 0.5); } else { scale = (double)(r_refdef.aliasvrect.y - pfv1.v[1]) / (pfv0.v[1] - pfv1.v[1]); for (i=0 ; i<6 ; i++) @out.v[i] = (int)(pfv1.v[i] + (pfv0.v[i] - pfv1.v[i])*scale + 0.5); } }
/* ================ R_AliasTransformAndProjectFinalVerts ================ */ static void R_AliasTransformAndProjectFinalVerts(draw.finalvert_t[] pfv, model.stvert_t[] pstverts) { int i, temp; double lightcos; double[] plightnormal; double zi; model.trivertx_t pverts; for (i=0 ; i<r_anumverts ; i++) { draw.finalvert_t fv = pfv[i]; model.stvert_t stverts = pstverts[i]; pverts = r_apverts[i]; // transform and project zi = 1.0 / (mathlib.DotProduct(pverts.v, aliastransform[2]) + aliastransform[2][3]); // x, y, and z are scaled down by 1/2**31 in the transform, so 1/z is // scaled up by 1/2**31, and the scaling cancels out for x and y in the // projection fv.v[5] = (int)zi; fv.v[0] = (int)(((mathlib.DotProduct(pverts.v, aliastransform[0]) + aliastransform[0][3]) * zi) + aliasxcenter); fv.v[1] = (int)(((mathlib.DotProduct(pverts.v, aliastransform[1]) + aliastransform[1][3]) * zi) + aliasycenter); fv.v[2] = stverts.s; fv.v[3] = stverts.t; fv.flags = stverts.onseam; // lighting plightnormal = r_avertexnormals[pverts.lightnormalindex]; lightcos = mathlib.DotProduct(plightnormal, r_plightvec); temp = r_ambientlight; if (lightcos < 0) { temp += (int)(r_shadelight * lightcos); // clamp; because we limited the minimum ambient and shading light, we // don't have to clamp low light, just bright if (temp < 0) temp = 0; } fv.v[4] = temp; } }
/* ================ R_AliasTransformFinalVert ================ */ static void R_AliasTransformFinalVert(draw.finalvert_t fv, auxvert_t av, model.trivertx_t pverts, model.stvert_t pstverts) { int temp; double lightcos; double[] plightnormal; av.fv[0] = mathlib.DotProduct(pverts.v, aliastransform[0]) + aliastransform[0][3]; av.fv[1] = mathlib.DotProduct(pverts.v, aliastransform[1]) + aliastransform[1][3]; av.fv[2] = mathlib.DotProduct(pverts.v, aliastransform[2]) + aliastransform[2][3]; fv.v[2] = pstverts.s; fv.v[3] = pstverts.t; fv.flags = pstverts.onseam; // lighting plightnormal = r_avertexnormals[pverts.lightnormalindex]; lightcos = mathlib.DotProduct(plightnormal, r_plightvec); temp = r_ambientlight; if (lightcos < 0) { temp += (int)(r_shadelight * lightcos); // clamp; because we limited the minimum ambient and shading light, we // don't have to clamp low light, just bright if (temp < 0) temp = 0; } fv.v[4] = temp; }
public void IniGenerate() { try { IsEndlessMode = false; textureData.ApplyToMaterial(terrainMateial, meshSettings.uniformScale); textureData.UpdateMeshH(terrainMateial, hightMapSettings.minH, hightMapSettings.maxH, meshSettings.uniformScale); HightMap heightMap = hightMapGenerator.GenHightMap(meshSettings, hightMapSettings, Vector2.zero); draw draw = FindObjectOfType <draw>() as draw; if (draweMode == DraweMode.NoiseMap) { Mesh.SetActive(false); Plane.SetActive(true); draw.Draw(generator.HeightMapToTexture(heightMap.value, meshSettings.numberVerticisPerLine, meshSettings.numberVerticisPerLine)); panelProcess.setActive(false); } else if (draweMode == DraweMode.FallMap) { Mesh.SetActive(false); Plane.SetActive(true); draw.Draw(generator.HeightMapToTexture(fallofGenerator.GenerateFalloff(meshSettings.numberVerticisPerLine, hightMapSettings.FalloffBlur, hightMapSettings.FalloffSize), meshSettings.numberVerticisPerLine, meshSettings.numberVerticisPerLine)); panelProcess.setActive(false); } else if (draweMode == DraweMode.Mesh) { Mesh.SetActive(true); Plane.SetActive(false); draw.DrawMesh(mechDraw.GenerateMech(heightMap.value, meshSettings, levelOfDetail), meshColider); panelProcess.setActive(false); } else if (draweMode == DraweMode.MeshAndEnvironment) { panelProcess.setLabel("Terrain"); panelProcess.setValue(0); Mesh.SetActive(true); Plane.SetActive(false); MechData newMesh = mechDraw.GenerateMech(heightMap.value, meshSettings, levelOfDetail); draw.DrawMesh(newMesh, meshColider); if (!Application.isPlaying) { //draweMode = DraweMode.Mesh; Debug.LogWarning("Generate Environment don't work in Editor!"); panelProcess.setActive(false); } else { StartCoroutine(eGen.GenerateEnvironment(heightMap, newMesh, meshSettings, hightMapSettings, environmentData, meshSettings.numberVerticisPerLine, meshSettings.uniformScale, hightMapSettings.minH, hightMapSettings.maxH)); } } else if (draweMode == DraweMode.EndlesTerrain) { IsEndlessMode = true; Mesh.SetActive(false); Plane.SetActive(false); if (!Application.isPlaying) { //draweMode = DraweMode.Mesh; Debug.LogWarning("Generate endles terrain don't work in Editor!"); } panelProcess.setActive(false); } } catch (System.Exception e) { Debug.LogWarning("Exeption: " + e.GetType().ToString()); } }