private void RemnantMatInfoForm_Load(object sender, EventArgs e) { // build the remnant material from the sheet. double dMergeDis = 10; m_polyMat = NestFacadeEx.BuildRemnantMat(m_sheet, m_dConnectTol, dMergeDis); // init the tree. UpdateTree(); /************************************************************************/ // init the view port. m_matViewPort.InitEnv(matViewWnd.Handle, 0.00001, 10000); // all polygons in material. Poly2DListEx poly2DList = new Poly2DListEx(); poly2DList.AddPoly(m_polyMat.GetMatPolygon()); poly2DList.AddPolyList(m_polyMat.GetUselessHoleList()); // set the drawing area. Int32 iWidth = matViewWnd.Right - matViewWnd.Left; Int32 iHeight = matViewWnd.Bottom - matViewWnd.Top; Rect2DEx geomRect = poly2DList.GetRectBox(); Point2DEx leftBottomPt = new Point2DEx(); double dXDirRange = m_matViewPort.GetFitAllParam(iWidth, iHeight, geomRect, 1.2, leftBottomPt); m_matViewPort.SetDrawingArea(1.1 * dXDirRange, iWidth, iHeight, leftBottomPt); /************************************************************************/ mergeDisTextBox.Text = dMergeDis.ToString("0.000"); }
private void DemoForm_Load(object sender, EventArgs e) { /************************************************************************/ // init the license. // init the license which is bound to local computer. ReturnInfoEx retInfo = NestFacadeEx.InitLicense("d:\\nest.NPLic"); // init license if the license is bound to SafeNet hardware key. //ReturnInfoEx retInfo = NestFacadeEx.InitLicense(iDevelopID, softwareKey, iLicenseID, iFlag); /************************************************************************/ // init the view port. partViewPort.InitEnv(partPreviewWnd.Handle, 0.00001, 10000); matViewPort.InitEnv(matPreviewWnd.Handle, 0.00001, 10000); // display the edition of the nest kernel on the dialog title. int iLicType = NestFacadeEx.GetLicenseType(); if (iLicType == 0) { this.Text = "NestProfessor DEMO (License type of the nest kernel: Trial Edition)"; } else if (iLicType == 1) { this.Text = "NestProfessor DEMO (License type of the nest kernel: Standard Edition)"; } else if (iLicType == 2) { this.Text = "NestProfessor DEMO (License type of the nest kernel: Professional Edition)"; } SetConfig(); }
private void SheetInfoForm_Load(object sender, EventArgs e) { viewTypeComboBox.Items.Add("View By Part Name"); viewTypeComboBox.Items.Add("View By Part Topology"); viewTypeComboBox.SelectedIndex = 0; // init the tree by part name. InitTreeByPart(); // init the view port. m_shtViewPort.InitEnv(shtViewWnd.Handle, 0.00001, 10000); DrawHelper.FitWindow(m_sheet.GetMat().GetBoundaryRect(), m_shtViewPort, shtViewWnd); }
private void NestResultForm_Load(object sender, EventArgs e) { statusTextBox.Text = "Running"; // init the view port. m_shtViewPort.InitEnv(shtPreViewWnd.Handle, 0.00001, 10000); // start the watcher. NestRstWatcher nestRstWatcher = new NestRstWatcher(m_nestProcessor, m_nestResult, m_iNestingTime); Thread thread = new Thread(nestRstWatcher.Run); thread.Start(); }