public Lut Select(SelectPoint callback, int detalization = 100, bool linearInterpolation = true) { var result = new Lut(); ForEach((x, y) => { result.Add(callback(x, y)); }, detalization, linearInterpolation); return(result); }
private void PrepareToCreateSelectionBox(Vector2 currentMousePosition) { currentMousePosition = currentMousePosition / CurrentZoom; m_selectionRect = new Rect(); //clear the previous selection rect m_startSelectPoint = new SelectPoint(currentMousePosition); //get the start position for the selection rect m_tempNodesList = new List <Node>(); //clear the previous saved start selection box selected nodes m_tempNodesList = new List <Node>(WindowSettings.SelectedNodes); //save the currently selected node (we need this in order to be able to invert the selection) m_selectedNodesWhileSelecting = new List <Node>(); //clear the nodes contained in the previous selection }
private void InsAddPointExecute() { try { // Выбор точки на чертеже и задание параметров окна var selPt = new SelectPoint(); InsPoint p = selPt.SelectNewPoint(Tree.Model); if (p != null) { // Расчет и добавление точки Tree.AddPoint(p); // Включение зон инсоляции точки p.IsVisualIllumsOn = true; // Сохранение точки p.SaveInsPoint(); // Запись статистики PluginStatisticsHelper.AddStatistic(); } } catch (Exception ex) { InsService.ShowMessage(ex, "Ошибка"); } }
// Use this for initialization IEnumerator Start() { WWW run = new WWW("......databas.../connect.php"); yield return(run); string runString = run.text; runnersNew = runString.Split(';'); //get opponents name and show currentLvl = PlayerPrefs.GetInt("level"); runnersOnMyLvl = new string[runnersNew.Length]; for (i = 0; i < runnersNew.Length; i++) { if (runnersNew[i].Contains("Level:" + currentLvl.ToString())) { //add players of the same level to the new array runnersOnMyLvl[i] = runnersNew[i]; } } //find a random challenger that is not null while (challenger == null & currentLvl <= 2) { challenger = runnersOnMyLvl [Random.Range(0, runnersOnMyLvl.Length)]; } print(challenger); //get opponents name opponentName.text = (GetDataValue(challenger, "ID:")); //get opponents selected points SelectPoint selectedpoint = GameObject.Find("GameObject").GetComponent <SelectPoint> (); //wait until value-button selected while (!selectedpoint.sp) { yield return(null); } selectedpoints = selectedpoint.value; print(selectedpoints); total = (GetDataValue(challenger, selectedpoints)); totalPoints = int.Parse(total); //get mine selected value myTotalPoints = PlayerPrefs.GetInt(selectedpoint.valueM); print(myTotalPoints); print(total); //fight fight = FightInTheArena(myTotalPoints, totalPoints); if (fight == true) { winningText.text = "WIN"; //get 1 stivos point stivos = PlayerPrefs.GetFloat("stivos"); PlayerPrefs.SetFloat("stivos", stivos + 1); wns = PlayerPrefs.GetInt("wins"); PlayerPrefs.SetInt("wins", wns + 1); } else { winningText.text = "LOOSE"; } }
this.AttriShow(); dft=new DrawFlowTable (this); DrawBackGround(); this.RefreshBackground(); } private void SerializeInit() { this.arrayData=new ArrayData(); // Stream stream = File.Open("/arrayData.xml", FileMode.Create); // BinaryFormatter formatter = new BinaryFormatter(); // formatter.Serialize(stream, this.arrayData); // stream.Close(); // this.arrayData=null; // stream = File.Open("/arrayData.xml", FileMode.Open); // formatter = new BinaryFormatter(); // this.arrayData=((ArrayData)formatter.Deserialize(stream)); // stream.Close(); /**************************** MessageForm.Show("123"); byte[] byt=new byte[1024]; MemoryStream stream=new MemoryStream (byt); BinaryFormatter formatter = new BinaryFormatter(); MessageForm.Show("123456"); formatter.Serialize(stream,this.arrayData); MessageForm.Show("123789"); this.arrayData=null; //stream = File.Open("arrayData.xml", FileMode.Open); formatter = new BinaryFormatter(); MemoryStream ms=new MemoryStream (byt); MessageForm.Show(byt.Length.ToString()); this.arrayData=((ArrayData)formatter.Deserialize(ms)); MessageForm.Show("abxcsdjfhasdkjfh"); ***************************/ this.selectPoint=new SelectPoint(); // stream = File.Open("/selectPoint.xml", FileMode.Create); // formatter = new BinaryFormatter(); // formatter.Serialize(stream, this.selectPoint); // stream.Close(); // this.selectPoint=null; // stream = File.Open("/selectPoint.xml", FileMode.Open); // formatter = new BinaryFormatter(); // this.selectPoint=((SelectPoint)formatter.Deserialize(stream)); // stream.Close(); // this.getTypeImage=new GetTypeImage(); // stream = File.Open("/getTypeImage.xml", FileMode.Create); // formatter = new BinaryFormatter(); // formatter.Serialize(stream, this.getTypeImage); // stream.Close(); // this.getTypeImage=null;
public List <PointF> getPoints() { //ISelectRegion ir; List <PointF> pts = new List <PointF>(); switch (m_type) { case selectType.Rect: //矩形框选 SelectRect ir = new SelectRect(); PointF tmpP = new PointF(); tmpP.X = rect2.Right; tmpP.Y = rect2.Bottom; ir.setPoints(mapBox.Map.ImageToWorld(p1), mapBox.Map.ImageToWorld(tmpP), rect2.Width, rect2.Height); if (isAnalyse) { pts = ir.getSelectedPts(); isAnalyse = false; } break; case selectType.Point: SelectPoint ip = new SelectPoint(); ip.setPoint(mapBox.Map.ImageToWorld(p_single)); pts = ip.getSelectedPts(); break; case selectType.Polygon: SelectShp ishp = new SelectShp(); ishp.setConfig(cfg); //高亮选中区域 VectorLayer veclayer = (VectorLayer)mapBox.Map.GetLayerByName("province"); VectorLayer v2 = ishp.getPolygonPoints(p_shp, veclayer); if (mapBox.Map.GetLayerByName("Selection") != null) { removeShpLayer("Selection"); } addSHP(v2); this.mapBox.Refresh(); //获取shp多边形内的点 if (isAnalyse) { pts = ishp.getSelectedPts(); isAnalyse = false; } break; case selectType.NotValid: break; } //if(pts.Count()>0&&m_type !=selectType.Point) //{ // for (int i = 0; i < pts.Count(); i++) // pts[i] = this.mapBox.Map.WorldToImage(new Coordinate(pts[i].Y,pts[i].X)); //} return(pts); //ir.getSelectedPts(); }