(String filename, String imgFilename, boolean antialiasing, jv4surfex jv4sx)
| 724 | } |
| 725 | |
| 726 | public void saveSurfCode(String filename, String imgFilename, |
| 727 | boolean antialiasing, jv4surfex jv4sx) { |
| 728 | // System.out.println("save..."); |
| 729 | try { |
| 730 | FileOutputStream fo = new FileOutputStream(filename); |
| 731 | |
| 732 | PrintWriter pw = new PrintWriter(fo, true); |
| 733 | |
| 734 | pw.println("scale_x = " + scale[0] + ";"); |
| 735 | pw.println("scale_y = " + scale[1] + ";"); |
| 736 | pw.println("scale_z = " + scale[2] + ";"); |
| 737 | pw.println("radius="+project.getClipRadius()+";"); |
| 738 | |
| 739 | pw.println("illumination = ambient_light + diffuse_light + reflected_light + transmitted_light;"); |
| 740 | pw.println("ambient = 40;\ndiffuse = 80;\nreflected = 80;\ntransmitted = 20;"); |
| 741 | pw.println("smoothness = 50;\ntransparence = 0;"); |
| 742 | pw.println("thickness = 10;"); |
| 743 | if (antialiasing) { |
| 744 | pw.println("antialiasing = 6;\n"); |
| 745 | } else { |
| 746 | pw.println("antialiasing = 0;\n"); |
| 747 | } |
| 748 | pw.println("background_red=" |
| 749 | + (project.bgColorButton.getBackground().getRed()) |
| 750 | + "; " |
| 751 | + "background_green=" |
| 752 | + (project.bgColorButton.getBackground().getGreen()) |
| 753 | + "; " + "background_blue=" |
| 754 | + (project.bgColorButton.getBackground().getBlue()) |
| 755 | + ";\n"); |
| 756 | // Polynome aus der Liste uebergebn |
| 757 | ListIterator li = eqnList.listIterator(); |
| 758 | Equation thisEqn; |
| 759 | int lc = 0; |
| 760 | int ec = 1; |
| 761 | // System.out.println("saveSurfCode"); |
| 762 | while (li.hasNext()) { |
| 763 | thisEqn = (Equation) li.next(); |
| 764 | if (thisEqn.isSelected()) { |
| 765 | if (lc <= 9) { |
| 766 | thisEqn.savesurfCode(pw, |
| 767 | "f" + ec, |
| 768 | lc + 1, |
| 769 | jv4sx.getCameraRotationYXZ()); |
| 770 | lc++; |
| 771 | pw.println(""); |
| 772 | } |
| 773 | } |
| 774 | ec++; |
| 775 | } |
| 776 | |
| 777 | pw.println("draw_surface;"); |
| 778 | pw.println("filename=\"" + imgFilename + "\";"); |
| 779 | pw.println("color_file_format=" + fileFormatFromExt(imgFilename) |
| 780 | + ";"); |
| 781 | // pw.println("jpeg_quality=100;"); |
| 782 | pw.println("save_color_image;"); |
| 783 |
nothing calls this directly
no test coverage detected