00001 package NormalMeshAlgorithm; 00002 import java.awt.Dimension; 00003 import java.io.File; 00004 import java.io.PrintStream; 00005 import java.io.Serializable; 00006 import java.io.StringReader; 00007 00008 import javax.swing.JFileChooser; 00009 00010 import factories.SnijPixelStrategyBuilder; 00011 00012 import Encoder.SnijPixelPiercingWaardeStrategy; 00013 import ImageStuff.Topology.*; 00014 import Norm.*; 00015 import TxTPackage.FileSchrijver; 00025 public class Configuration implements Serializable{ 00026 00027 public static final String kernel_version="0.1"; 00028 00029 public static final int NO_FILE=0; 00030 public static final int IMAGE_FILE=1; 00031 private int snijPixelStrategyType; 00032 00033 private int iteratorType; 00034 00035 private int K,N,L,DEGREE; 00036 private float max_rico; 00037 private String image_name,outputname; 00038 private int aantal_iteraties; 00039 private int whichNormToUseForTesselation,whichNormToUseForRefinement; 00040 private ConnectieCriterium connectieCriterium; 00041 private boolean makeBaseMesh; 00042 private float error; // the maximal error for a pixel 00043 00044 // Image data 00045 private String path,outdir; 00046 private Dimension imageDimension; 00047 private long filesize; 00048 00049 00050 00051 public Configuration(){ 00052 this.max_rico=3; 00053 whichNormToUseForTesselation=NormPakket.L_2; 00054 whichNormToUseForRefinement=NormPakket.L_1; 00055 error=120; 00056 snijPixelStrategyType=SnijPixelStrategyBuilder.PIERCING_WAARDE_TYPE; 00057 connectieCriterium=ImageDependent_ConnectionCriterium.getInstance(); 00058 // connectieCriterium=Default_ConnectionCriterium.getInstance(); 00059 makeBaseMesh=false; 00060 setOutputDir(FileSchrijver.getCurrentDirectory()+"/"+"output"); 00061 setPath(FileSchrijver.getCurrentDirectory()+"/"+"output"); 00062 imageDimension=new Dimension(0,0); 00063 image_name=""; 00064 outputname=""; 00065 iteratorType=-1; 00066 K=500;N=100;L=75;DEGREE=6; 00067 } 00068 00069 00070 public void setPath(String path){ 00071 this.path=path; 00072 } 00073 00074 public String getPath(){ 00075 return path; 00076 } 00077 00078 public void setOutputDir(String dir){ 00079 this.outdir=dir; 00080 } 00081 00082 public String getOutputDir(){ 00083 return outdir; 00084 } 00085 00086 public String getOutputName(){ 00087 return outputname; 00088 } 00089 00090 public void setOutputName(String outputname){ 00091 this.outputname=outputname; 00092 } 00093 public float getError(){ 00094 return error; 00095 } 00096 00097 public void setError(float error){ 00098 this.error=error; 00099 } 00100 00101 public void setMakeBaseMesh(boolean makeBaseMesh) { 00102 this.makeBaseMesh=makeBaseMesh; 00103 } 00104 00105 public boolean getMakeBaseMesh(){ 00106 return this.makeBaseMesh; 00107 } 00108 00109 public void setWhichNormToUseForTesselation(int WHICHNORM){ 00110 this.whichNormToUseForTesselation=WHICHNORM; 00111 } 00112 00113 00114 public int getWhichNormToUseForTesselation(){ 00115 return this.whichNormToUseForTesselation; 00116 } 00117 00118 public int getFileType(){ 00119 if(getImageName().endsWith("."+Extensions.decodeExtension)) return NO_FILE; 00120 else return IMAGE_FILE; 00121 } 00122 00123 00124 00125 00126 00127 public void setImageName(String image_name){ 00128 this.image_name=image_name; 00129 } 00130 00131 public String getImageName(){ 00132 return this.image_name; 00133 } 00134 00135 public String getImageName_WithoutExtension(){ 00136 int pos = getImageName().lastIndexOf('.'); 00137 String naam = getImageName().substring(0,pos); 00138 return naam; 00139 } 00140 00141 public void setConnectionCriterium(ConnectieCriterium connectieCriterium){ 00142 this.connectieCriterium=connectieCriterium; 00143 } 00144 00145 public ConnectieCriterium getConnectionCriterium(){ 00146 return this.connectieCriterium; 00147 } 00148 00149 00150 00151 public void setSnijPixelStrategyTYPE(int TYPE){ 00152 this.snijPixelStrategyType=TYPE; 00153 } 00154 00155 00156 public int getSnijPixelStrategyTYPE(){ 00157 return snijPixelStrategyType; 00158 } 00159 00160 00161 00162 public void setMaxRico(float max_rico){ 00163 this.max_rico=max_rico; 00164 } 00165 00166 public float getMaxRico(){ 00167 return this.max_rico; 00168 } 00169 00170 00171 public void setImageDimensions(Dimension d){ 00172 this.imageDimension=d; 00173 } 00174 00175 public Dimension getImageDimension(){ 00176 return imageDimension; 00177 } 00178 00179 00180 public void setFileSize(Long size){ 00181 this.filesize=size; 00182 } 00183 public long getFileSize(){ 00184 return filesize; 00185 } 00186 00187 00188 public int getWhichNormToUseForRefinement() { 00189 return whichNormToUseForRefinement; 00190 } 00191 00192 00193 public void setWhichNormToUseForRefinement(int whichNormToUseForRefinement) { 00194 this.whichNormToUseForRefinement = whichNormToUseForRefinement; 00195 } 00196 00197 00198 public int getIteratorType() { 00199 return iteratorType; 00200 } 00201 00202 00203 public void setIteratorType(int iteratorType) { 00204 this.iteratorType = iteratorType; 00205 } 00206 00207 00208 public void print(PrintStream out){ 00209 out.println("this.getConnectionCriterium()= "+this.getConnectionCriterium()); 00210 out.println("this.getDEGREE()= "+this.getDEGREE()); 00211 out.println("this.getError()= "+this.getError()); 00212 out.println("this.getFileSize()= "+this.getFileSize()); 00213 out.println("this.getFileType()= "+this.getFileType()); 00214 out.println("this.getImageDimension()= "+this.getImageDimension()); 00215 out.println("this.image_name= "+this.image_name); 00216 out.println("this.getImageName_WithoutExtension()= "+this.getImageName_WithoutExtension()); 00217 out.println("this.getIteratorType()= "+this.getIteratorType()); 00218 out.println("this.getK()= "+this.getK()); 00219 out.println("this.getL()= "+this.getL()); 00220 out.println("this.getMakeBaseMesh()= "+this.getMakeBaseMesh()); 00221 out.println("this.getMaxRico()= "+this.getMaxRico()); 00222 out.println("this.getN()= "+this.getN()); 00223 out.println("this.getOutputDir()= "+this.getOutputDir()); 00224 out.println("this.getOutputName()= "+this.getOutputName()); 00225 out.println("this.getPath()= "+this.getPath()); 00226 out.println("this.getSnijPixelStrategyTYPE()= "+this.getSnijPixelStrategyTYPE()); 00227 out.println("this.getWhichNormToUseForRefinement()= "+this.getWhichNormToUseForRefinement()); 00228 out.println("this.getWhichNormToUseForTesselation()= "+this.getWhichNormToUseForTesselation()); 00229 } 00230 00231 00232 public int getK() { 00233 return K; 00234 } 00235 00236 00237 public void setK(int k) { 00238 K = k; 00239 } 00240 00241 00242 public int getN() { 00243 return N; 00244 } 00245 00246 00247 public void setN(int n) { 00248 N = n; 00249 } 00250 00251 00252 public int getDEGREE() { 00253 return DEGREE; 00254 } 00255 00256 00257 public void setDEGREE(int degree) { 00258 DEGREE = degree; 00259 } 00260 00261 00262 public int getL() { 00263 return L; 00264 } 00265 00266 00267 public void setL(int l) { 00268 L = l; 00269 } 00270 00271 00272 00273 }
1.5.5