00001 package commandline.JUnitTest;
00002
00003 import java.io.File;
00004 import java.io.FileInputStream;
00005 import java.io.FileNotFoundException;
00006 import java.io.PrintStream;
00007
00008 import junit.framework.TestCase;
00009
00010 import commandline.CodingUtils.CommitDataStructure;
00011 import commandline.Decoder.BreathFirstDecoder;
00012 import commandline.Encoder.NormalMeshEncoder;
00013 import commandline.Encoder.Iterators.MeshIteratorSelector;
00014 import commandline.ImageStuff.GeometricObjects.factories.EdgeConstructorTriangleMakerFactory;
00015 import commandline.ImageStuff.GeometricObjects.factories.GenericEdgeConstructorTriangleMakerFactory;
00016 import commandline.binToFilePackage.BinaryFeed;
00017 import commandline.binToFilePackage.MyTestDataInputStream;
00018 import commandline.debuggingCode.Debug;
00019
00020 public class TestLogDecayNormalIndexFlatToBin extends TestCase {
00021
00022
00023 public void testWriteToReadableFile(){
00024
00025 String s=File.separator;
00026 String path_original="C:"+s+"hor_3.jpg";
00027 String path_output_dir="C:"+s+ "TEST";
00028 Debug.print(path_original);
00029 Debug.print(path_output_dir);
00030
00031 String[] args=new String[]{
00032 "-i", ""+path_original,
00033 "-o" ,""+ path_output_dir,
00034 "-n", ""+"test",
00035 "-IT",""+MeshIteratorSelector.UNTIL_NUMBER_OF_TRIANGLES_REACHED,
00036 "-e",""+ 300,
00037
00038 "-K", "280",
00039 "-N", "80",
00040 "-L", "75",
00041 "-D", "12",
00042 "-Wnr","2"
00043 };
00044
00045 for (String str:args){
00046 Debug.print(str);}
00047
00048 NormalMeshEncoder normalMeshEncoder=null;
00049 try {
00050 normalMeshEncoder = NormalMeshEncoder.commandline(args);
00051 } catch (FileNotFoundException e) {
00052
00053 e.printStackTrace();
00054 }
00055
00056
00057
00058 MyTestDataInputStream testDataInputStream=null;
00059 try{
00060 testDataInputStream=
00061 new MyTestDataInputStream(new FileInputStream(path_output_dir+s+"test.nob" ),
00062 new PrintStream(path_output_dir+s+"test.nobDECREAD"));
00063 }catch(FileNotFoundException fileNotFoundException){
00064 fileNotFoundException.printStackTrace(System.out);
00065 }
00066 EdgeConstructorTriangleMakerFactory edgeConstructorTriangleMakerFactory=new GenericEdgeConstructorTriangleMakerFactory();
00067 BinaryFeed binaryFeed=new BinaryFeed(edgeConstructorTriangleMakerFactory,testDataInputStream,normalMeshEncoder.getConfiguration());
00068 binaryFeed.read();
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 CommitDataStructure commitDataStructure=new CommitDataStructure();
00080 BreathFirstDecoder breathFirstDecoder=new BreathFirstDecoder(edgeConstructorTriangleMakerFactory,binaryFeed,binaryFeed.getDecoderMesh(),commitDataStructure,normalMeshEncoder.getConfiguration());
00081 breathFirstDecoder.decode();
00082
00083 }
00084
00085 public static void main(String args[]){
00086 TestLogDecayNormalIndexFlatToBin bin=new TestLogDecayNormalIndexFlatToBin();
00087 bin.testWriteToReadableFile();
00088
00089 }
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 }