public PasteAllToExcel() { if (!PacientData.hasPins) { teethNumber = PacientData.getToothEntitiesNumber() - 1; } else { teethNumber = PacientData.getToothEntitiesNumber(); } currentExcelBreakIndex = 0; currentHeightSum = 0; pinNumber = PacientData.getPinNumber() - 1; pinGroups = (pinNumber + 2) / 3; images = AllPatientImages.getAllImages(); toothDetails = PacientData.toothDetails; excelRowBreak = new List <int>(); pasteInitialData(); pasteTeeth(); if (PacientData.hasPins) { pastePins(); } pasteAllPhotos(); addBreaksToExcel(); }
public static int getPinNumber() { if (!hasPins) { return(-1000); } return(PacientData.getIndexImage() - 1 - 3 * PacientData.getToothEntitiesNumber()); }
public static int getToothEntitiesNumber() { if (PacientData.hasPins) { return(toothEntitiesNumber); } toothEntitiesNumber = PacientData.getGroupIndex(); return(toothEntitiesNumber); }
private void updateToothAndImplantVisibility() { if (PacientData.getIndexImage() == 0 || PacientData.getIndexImage() == 1 || PacientData.hasPins) { this.setVisibilityToothEntities(false); return; } this.setVisibilityToothEntities(true); }
public PacientDataForm() { InitializeComponent(); pacientData = new PacientData(); allPatientImages = new AllPatientImages(); guideForm = new GuideForm(); drawRectangle = new DrawRectangle(); excelReport = new ExcelReport(); }
private void updateShowHideOptions() { if (PacientData.getIndexImage() == 0 || PacientData.getIndexImage() == 1) { showHideSettings.Visible = false; } else { showHideSettings.Visible = true; } }
private void updatePinButton() { if (PacientData.hasPins || PacientData.getIndexImage() < 4 || PacientData.getGroupComponentIndex() != 1) { this.pin.Visible = false; return; } this.pin.Visible = true; }
private void pin_Click(object sender, EventArgs e) { gf2.Hide(); showHideSettings.BackgroundImage = optionsButtonDown; isDownButton = true; DrawRectangle.graphics.Clear(Color.White); AllPatientImages.setGroupMaximImages(15); PacientData.hasPins = true; PacientData.toothEntitiesNumber = PacientData.getGroupIndex() - 1; this.updateAllFields(); }
private void updateUndoButton() { if (PacientData.hasPins && PacientData.getPinNumber() == 1) { this.undo.Enabled = false; this.save.Visible = false; } else { this.undo.Enabled = true; } }
private void finalizeOnScreenRectangle() { if (Math.Abs(X_begin - X_current) > 35 && Math.Abs(Y_begin - Y_current) > 35) { // 35px must be the minimum dimension of an Image. this.drawOnScreenRectangle(PacientData.getRatio()); this.drawOkButton(); // draw OK/ACCEPT BUTTON IN BOTTOM-RIGHT OF BIG-RECTANGLE: } else { MessageBox.Show("Please make a larger selection!"); } }
public GuideForm() { InitializeComponent(); saveFile = new SaveFileDialog(); gf2 = new GuideForm2(); gf3 = new GuideForm3(); smallRectangleDialog = new SmallRectangleDialog(); isDownButton = true; optionsButtonDown = Image.FromFile(@"In App - Images\DOWN.jpg"); optionsButtonUp = Image.FromFile(@"In App - Images\UP.jpg"); PacientData.setMaximImages(2); this.updateAllFields(); }
private void updateMaximImages() { if (PacientData.hasPins) { PacientData.setMaximImages(1); return; } if (PacientData.getGroupIndex() == 0) { PacientData.setMaximImages(2); return; } PacientData.setMaximImages(3); }
private void Draw_Tick(object sender, EventArgs e) { this.X_current = System.Windows.Forms.Cursor.Position.X; this.Y_current = System.Windows.Forms.Cursor.Position.Y; // this TimerTick simulate drawing an onScreen-Rectangle in real time // to draw on screen use Key ALT + MouseMove, and realease ALT when you're done if (Control.ModifierKeys == Keys.Alt) // Key ALT is pressed (ALT-move & ALT-down) { // (you drawing in real time) if (isDrawingRectangle) { this.drawOnScreenRectangle(PacientData.getRatio()); #region wait time before Clear screen Image img = Image.FromFile(@"In App - Images\Transparent Background - DrawRectagle.png"); //img = Image.FromFile(@"In App - Images\Transparent Background - DrawRectagle.png"); #endregion graphics.Clear(Color.White); this.TopMost = true; } else { smallRectangleDialog.Close(); this.isDrawingRectangle = true; this.X_begin = this.X_current; this.Y_begin = this.Y_current; } } else if (Control.ModifierKeys != Keys.Alt && isDrawingRectangle) { // Key ALT is UP (you finish drawing rectangle) this.isDrawingRectangle = false; this.finalizeOnScreenRectangle(); } else if (Control.MouseButtons == MouseButtons.Right) { X_begin = MousePosition.X - this.widthRectangle + 7; Y_begin = MousePosition.Y - this.heightRectangle + 7; TopLeftCorner_X = X_begin; TopLeftCorner_Y = Y_begin; if (okButtonRightPressed) { this.moveOnScreenRectangle(); } } }
private void updateEntityGuide() { if (PacientData.getIndexImage() == 0 || PacientData.getIndexImage() == 1 || PacientData.hasPins) { entityGuide.Text = ""; } else if (PacientData.getGroupComponentIndex() == 1) { entityGuide.Text = "3D view"; } else if (PacientData.getGroupComponentIndex() == 2) { entityGuide.Text = "Transsection view"; } else if (PacientData.getGroupComponentIndex() == 3) { entityGuide.Text = "Digital eye"; } }
private void updateSaveButton() { if (PacientData.hasPins && PacientData.getPinNumber() != 0) { this.save.Visible = true; return; } if (PacientData.getIndexImage() < 4) { this.save.Visible = false; return; } if (PacientData.getGroupComponentIndex() != 1) { this.save.Visible = false; return; } this.save.Visible = true; }
private void updateTitle() { if (PacientData.getIndexImage() == 0) { indexEntityOrTooth.Text = "Over view 1"; return; } if (PacientData.getIndexImage() == 1) { indexEntityOrTooth.Text = "Over view 2"; return; } if (!PacientData.hasPins) { indexEntityOrTooth.Text = "Implant #" + PacientData.getGroupIndex(); return; } int diference = 1 + 3 * PacientData.getToothEntitiesNumber(); indexEntityOrTooth.Text = "Anchor " + PacientData.getPinNumber(); }
public static double getRatio() { if (PacientData.getIndexImage() == 0 || PacientData.getIndexImage() == 1) { return(1.7660377); } if (!hasPins) { if (PacientData.getGroupComponentIndex() == 1) { return(1.5705128); } if (PacientData.getGroupComponentIndex() == 2) { return(1.525641); } if (PacientData.getGroupComponentIndex() == 3) { return(1.4807692); } } else { if (PacientData.getPinNumber() % 3 == 1) { return(1.5217391); } if (PacientData.getPinNumber() % 3 == 2) { return(1.4782608); } if (PacientData.getPinNumber() % 3 == 0) { return(1.4347826); } } return(-1); }
private static Image resizeImageCorrectly(Image img) { double ratio = PacientData.getRatio(); if (Math.Abs(ratio - 1.7660377) < 0.000001) { return(resizeByParameter(img, 468)); } else if (Math.Abs(ratio - 1.5705128) < 0.000001) { return(resizeByParameter(img, 245)); } else if (Math.Abs(ratio - 1.525641) < 0.000001) { return(resizeByParameter(img, 238)); } else if (Math.Abs(ratio - 1.4807692) < 0.000001) { return(resizeByParameter(img, 231)); } else if (Math.Abs(ratio - 1.5217391) < 0.000001) { return(resizeByParameter(img, 245)); } else if (Math.Abs(ratio - 1.4782608) < 0.000001) { return(resizeByParameter(img, 238)); } else if (Math.Abs(ratio - 1.4347826) < 0.000001) { return(resizeByParameter(img, 231)); } return(img); }
public void addImage(Image img) { PacientData.addImage(img); this.updateAllFields(); }
private void undo_Click(object sender, EventArgs e) { PacientData.removeImage(); DrawRectangle.graphics.Clear(Color.White); updateAllFields(); }
private void updateCurrentTooth() { PacientData.currentTooth = PacientData.toothDetails[PacientData.getGroupIndex()]; }