private void GetMouseMove() { int x = tomousex - frommousex; int y = tomousey - frommousey; UIManager.getInstance().navi_marginx += x; UIManager.getInstance().navi_marginy += y; clicked = false; }
private void Upload_Data_Click(object sender, RoutedEventArgs e) { for (int i = 0; i < 1; i++) { try { ((Rhino.UI.Panels.GetPanel(TuringHost.PanelId) as RhinoWindows.Controls.WpfElementHost).Child as Turing).sendDataToServer(); } catch (Exception x) { } } UIManager.getInstance().HideWindow(this, UIManager.WindowType.Menu); }
//public void SendEnterKey() //{ // System.Windows.Forms.SendKeys.SendWait("{ENTER}"); // Rhino.RhinoApp.Write("Enter"); //} //public void SendEnterKey(object sender, System.EventArgs e) //{ // System.Windows.Forms.SendKeys.SendWait("{ENTER}"); // Rhino.RhinoApp.Write("Enter"); //} public void LoDDDDd_Click(object sender, RoutedEventArgs e) { var yorn = MessageBox.Show("지적도를 다시 불러옵니다. 작업 내용은 저장되지 않습니다. 계속 하시겠습니까?", "지적도 재 설정", MessageBoxButton.YesNo); if (yorn == MessageBoxResult.No) { return; } LoadManager.getInstance(). importFileWithAdress(); //GetWindow(); UIManager.getInstance().HideWindow(this, UIManager.WindowType.Menu); }
private void Button_Close_Click(object sender, RoutedEventArgs e) { ButtonStateCheck(ButtonState.None); endWhileLoop = true; RhinoApp.SetFocusToMainWindow(); string manualPlotArea = this.manualPlotArea.Text; List <char> manualPlotAreaList = manualPlotArea.ToList(); string manualPlotAreaValue = manualPlotArea; TuringAndCorbusierPlugIn.InstanceClass.page1Settings = new Settings_Page1(this.projectName.Text, this.address.Text, this.plotType, double.Parse(manualPlotAreaValue), double.Parse(this.maxFloorAreaRatio.Text), double.Parse(this.maxBuildingCoverage.Text), int.Parse(this.maxFloors.Text)); ((Rhino.UI.Panels.GetPanel(TuringHost.PanelId) as RhinoWindows.Controls.WpfElementHost).Child as Turing).RefreshProjectInfo(); /// <summary> /// 0518 민호 close 클릭시 currnetnewprojectwindow 초기화 /// </summary> TuringAndCorbusierPlugIn.InstanceClass.currentNewProjectWindow = null; UIManager.getInstance().HideWindow(this, UIManager.WindowType.Basic); }
//public void GetWindow() //{ // IntPtr currentwindow = GetWindow(Rhino.RhinoApp.MainWindowHandle(), 0); // System.Windows.Forms.Control cwc = System.Windows.Forms.Control.FromHandle(currentwindow); // Rhino.RhinoApp.WriteLine(cwc.Name); //} private void RhinoUI_Show_Click(object sender, RoutedEventArgs e) { //if (!RhinoWindowSetUp.isvisible) // RhinoWindowSetUp.SetUIForTC(Rhino.RhinoDoc.ActiveDoc); //else // RhinoWindowSetUp.ResetUI(Rhino.RhinoDoc.ActiveDoc); Rhino.UI.OpenFileDialog ofd = new Rhino.UI.OpenFileDialog(); ofd.Filter = "RhinoFiles (*.3dm)|*.3dm"; var result = ofd.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { Rhino.RhinoApp.RunScript("_-Open n " + ofd.FileName, true); } UIManager.getInstance().HideWindow(this, UIManager.WindowType.Menu); }
public void initEvent() { if (isAdministrator()) { Rhino.RhinoApp.WriteLine("Admin"); } else { Rhino.RhinoApp.WriteLine("NotAdmin"); } try { UIManager.getInstance().init(); } catch (System.TypeInitializationException e1e) { System.Windows.Forms.MessageBox.Show(e1e.Message); } Rhino.ApplicationSettings.GeneralSettings.NewObjectIsoparmCount = -1; InstanceClass.turing.ProjectAddress.Text = CommonFunc.getAddressFromServer(InstanceClass.turing.CurrentDataIdName.ToList(), InstanceClass.turing.CurrentDataId.ToList()); Rhino.RhinoApp.Wait(); Rhino.RhinoApp.Wait(); LoadManager.getInstance().importFileWithAdress(); LoadManager.getInstance().LayerSetting(); ///6.3 RhinoWindowSetUp.SetUIForTC(Rhino.RhinoDoc.ActiveDoc); ///~6.3 Rhino.RhinoApp.WriteLine("InitComplete"); }
private void NewProject_Click(object sender, RoutedEventArgs e) { if (TuringAndCorbusierPlugIn.InstanceClass.currentNewProjectWindow != null) { return; } NewProjectWindow tempNewProject = new NewProjectWindow(); //AddChild(tempNewProject); /// <summary> /// 0518 민호 newproject 클릭시 생성된 창 정보 정적변수에 전달 /// </summary> TuringAndCorbusierPlugIn.InstanceClass.currentNewProjectWindow = tempNewProject; UIManager.getInstance().HideWindow(this, UIManager.WindowType.Menu); try { UIManager.getInstance().ShowWindow(tempNewProject, UIManager.WindowType.Basic); } catch (System.Exception) { } }
private void Window_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e) { TuringAndCorbusierPlugIn.InstanceClass.turing.Focus(); UIManager.getInstance().HideWindow(this, UIManager.WindowType.Menu); }
private void Btn_SetWidth_Click(object sender, RoutedEventArgs e) { ButtonStateCheck(ButtonState.GetWidth); RhinoApp.SendKeystrokes("Cancel", true); RhinoApp.Wait(); UIManager.getInstance().SnapSetter(UIManager.SnapMode.OffAll); if (TuringAndCorbusierPlugIn.InstanceClass.plot == null) { MessageBox.Show("먼저 커브를 선택하세요"); return; } if (TuringAndCorbusierPlugIn.InstanceClass.plot.Boundary.ClosedCurveOrientation(Plane.WorldXY) == CurveOrientation.Clockwise) { TuringAndCorbusierPlugIn.InstanceClass.plot.Boundary.Reverse(); } List <Curve> inputList = TuringAndCorbusierPlugIn.InstanceClass.plot.Boundary.DuplicateSegments().ToList(); List <ConduitLine> tempConduitLine = new List <ConduitLine>(); if (inputList.Count == TuringAndCorbusierPlugIn.InstanceClass.plot.Surroundings.Length) { foreach (Curve i in inputList) { Rhino.Geometry.Line tempLine = new Rhino.Geometry.Line(i.PointAt(i.Domain.T0), i.PointAt(i.Domain.T1)); ConduitLine tempTempConduitLine = new ConduitLine(tempLine, TuringAndCorbusierPlugIn.InstanceClass.plot.Surroundings[inputList.IndexOf(i)]); tempConduitLine.Add(tempTempConduitLine); } } else { TuringAndCorbusierPlugIn.InstanceClass.plot.Surroundings = new int[inputList.Count]; foreach (Curve i in inputList) { Rhino.Geometry.Line tempLine = new Rhino.Geometry.Line(i.PointAt(i.Domain.T0), i.PointAt(i.Domain.T1)); ConduitLine tempTempConduitLine = new ConduitLine(tempLine); TuringAndCorbusierPlugIn.InstanceClass.plot.Surroundings[inputList.IndexOf(i)] = 4; tempConduitLine.Add(tempTempConduitLine); } } Corbusier.conduitLines.Clear(); Corbusier.conduitLines = tempConduitLine; Corbusier.conduitLineDisplay = new LinesConduit(Corbusier.conduitLines); Corbusier.conduitLineDisplay.Enabled = true; RhinoDoc.ActiveDoc.Views.Redraw(); var gcl = new GetConduitLine(Corbusier.conduitLines); RhinoApp.WriteLine("늘리거나 줄일 도로 선택 ( 클릭 = 늘리기 , Ctrl + 클릭 = 줄이기 , Shift + 클릭 = 전체 늘리기 , Shift + Ctrl + 클릭 = 전체 줄이기 , ESC = 마침"); while (!endWhileLoop) { gcl.AcceptNothing(true); gcl.Get(true); RhinoDoc.ActiveDoc.Views.Redraw(); if (gcl.CommandResult() != Rhino.Commands.Result.Success) { break; } } if (TuringAndCorbusierPlugIn.InstanceClass.kdgInfoSet.boundary.ClosedCurveOrientation(Plane.WorldXY) == CurveOrientation.CounterClockwise) { TuringAndCorbusierPlugIn.InstanceClass.kdgInfoSet.boundary.Reverse(); } Curve[] boundarysegs = TuringAndCorbusierPlugIn.InstanceClass.kdgInfoSet.boundary.DuplicateSegments(); /////대지경계선후퇴적용 //for (int i = 0; i < Corbusier.RoadWidth.Count; i++) //{ // if (Corbusier.RoadWidth[i] < 4 && Corbusier.RoadWidth[i] >= 0) // { // Vector3d curvev = boundarysegs[i].PointAtEnd - boundarysegs[i].PointAtStart; // curvev.Rotate(RhinoMath.ToRadians(-90), Vector3d.ZAxis); // curvev.Unitize(); // boundarysegs[i].Translate(curvev * ((Corbusier.RoadWidth[i] - 4) * 500)); // boundarysegs[i].Extend(CurveEnd.Both, 1000, CurveExtensionStyle.Line); // LoadManager.getInstance().DrawObjectWithSpecificLayer(boundarysegs[i], LoadManager.NamedLayer.Guide); // } //} //for (int i = 0; i < boundarysegs.Length; i++) //{ // int i2 = (i + 1) % boundarysegs.Length; // var intersection = Rhino.Geometry.Intersect.Intersection.CurveCurve(boundarysegs[i], boundarysegs[i2], 0, 0); // foreach (var x in intersection) // { // if (x.ParameterA != 1) // boundarysegs[i] = boundarysegs[i].Split(x.ParameterA)[0]; // if (x.ParameterB != 1) // boundarysegs[i2] = boundarysegs[i2].Split(x.ParameterB)[1]; // } //} //List<Curve> tojoin = new List<Curve>(); //for (int i = 0; i < boundarysegs.Length; i++) //{ //} //Curve[] joined = Curve.JoinCurves(boundarysegs); //TuringAndCorbusierPlugIn.InstanceClass.kdgInfoSet.setbackBoundary = joined[0]; //대지경계선후퇴 끝 //kdginfoset 의 setbackBoundary에 저장. //LoadManager.getInstance().DrawObjectWithSpecificLayer(TuringAndCorbusierPlugIn.InstanceClass.kdgInfoSet.setbackBoundary, LoadManager.NamedLayer.Model); Corbusier.conduitLineDisplay.Enabled = false; TuringAndCorbusierPlugIn.InstanceClass.plot.Surroundings = Corbusier.conduitLines.Select(n => n.RoadWidth * 1000).ToArray(); // .RoadWidth.Select(n=>n*1000).ToArray(); TuringAndCorbusierPlugIn.InstanceClass.plot.UpdateSimplifiedSurroundings(); //TuringAndCorbusierPlugIn.InstanceClass.plot.Adjust(); UIManager.getInstance().SnapSetter(UIManager.SnapMode.Current); ButtonStateCheck(ButtonState.None); RhinoDoc.ActiveDoc.Views.Redraw(); }
/// <summary> /// 0518 민호 클릭하지 않아도 닫는 함수 생성. 종료 전 currentnewprojectwindow 변수 초기화 /// </summary> public bool CloseWithoutOkClick() { ButtonStateCheck(ButtonState.None); if (TuringAndCorbusierPlugIn.InstanceClass.kdgInfoSet == null) { return(false); } if (points.Count == 0) { var result = MessageBox.Show("대지의 경사 정보가 설정되지 않았습니다. 평평한 대지로 계속 하시겠습니까?", "경사 정보 없음", MessageBoxButton.YesNo); if (result == MessageBoxResult.No) { return(false); } } else { var result = MessageBox.Show("정보 입력을 마치고 설계를 시작합니다.", "창 닫기", MessageBoxButton.YesNo); if (result == MessageBoxResult.No) { return(false); } } RhinoDoc.SelectObjects -= SelectSlopePoint; endWhileLoop = true; TuringAndCorbusierPlugIn.InstanceClass.kdgInfoSet.Getdir(points); foreach (var gggg in spguids) { RhinoDoc.ActiveDoc.Objects.Hide(gggg, true); } if (NorthCheck.IsChecked == true) { TuringAndCorbusierPlugIn.InstanceClass.plot.ignoreNorth = true; } else { TuringAndCorbusierPlugIn.InstanceClass.plot.ignoreNorth = false; } if (SpecialCase.IsChecked == true) { TuringAndCorbusierPlugIn.InstanceClass.plot.isSpecialCase = true; } else { TuringAndCorbusierPlugIn.InstanceClass.plot.isSpecialCase = false; } if (TuringAndCorbusierPlugIn.InstanceClass.regSettings != null) { double result = double.NaN; if (double.TryParse(fromRoad.Text, out result)) { TuringAndCorbusierPlugIn.InstanceClass.regSettings.DistanceEase[0] = result; result = double.NaN; } if (double.TryParse(fromSurr.Text, out result)) { TuringAndCorbusierPlugIn.InstanceClass.regSettings.DistanceEase[1] = result; result = double.NaN; } if (double.TryParse(fromLighting.Text, out result)) { TuringAndCorbusierPlugIn.InstanceClass.regSettings.DistanceLighting = result; result = double.NaN; } if (double.TryParse(fromOtherBuilding.Text, out result)) { TuringAndCorbusierPlugIn.InstanceClass.regSettings.DistanceIndentation = result; result = double.NaN; } if (double.TryParse(easeFloor.Text, out result)) { TuringAndCorbusierPlugIn.InstanceClass.regSettings.EaseFloor = result; result = double.NaN; } } RhinoApp.SetFocusToMainWindow(); //System.Windows.Forms.SendKeys.SendWait("{ESC}"); string manualPlotArea = this.manualPlotArea.Text; List <char> manualPlotAreaList = manualPlotArea.ToList(); string manualPlotAreaValue = manualPlotArea; TuringAndCorbusierPlugIn.InstanceClass.page1Settings = new Settings_Page1(this.projectName.Text, this.address.Text, this.plotType, double.Parse(manualPlotAreaValue), double.Parse(this.maxFloorAreaRatio.Text), double.Parse(this.maxBuildingCoverage.Text), int.Parse(this.maxFloors.Text)); if (TuringAndCorbusierPlugIn.InstanceClass.plot != null) { TuringAndCorbusierPlugIn.InstanceClass.plot.PlotType = this.plotType2; } ((Rhino.UI.Panels.GetPanel(TuringHost.PanelId) as RhinoWindows.Controls.WpfElementHost).Child as Turing).RefreshProjectInfo(); TuringAndCorbusierPlugIn.InstanceClass.currentNewProjectWindow = null; TuringAndCorbusierPlugIn.InstanceClass.turing.Calculate.Content = "설계 시작"; TuringAndCorbusierPlugIn.InstanceClass.turing.Calculate.Click -= TuringAndCorbusierPlugIn.InstanceClass.turing.Btn_SetInputValues; TuringAndCorbusierPlugIn.InstanceClass.turing.Calculate.Click += TuringAndCorbusierPlugIn.InstanceClass.turing.Calculate_Click; UIManager.getInstance().HideWindow(this, UIManager.WindowType.Basic); return(true); }
private void Button_Close_Click(object sender, RoutedEventArgs e) { currentProgressFactor = 0; TuringAndCorbusierPlugIn.InstanceClass.page3.DisableConduit(); UIManager.getInstance().HideWindow(TuringAndCorbusierPlugIn.InstanceClass.navigationHost, UIManager.WindowType.Navi); }
private void NavigationWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { e.Cancel = false; UIManager.getInstance().HideWindow(this, UIManager.WindowType.Navi); }