Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20934/dunes/io Modified Files: DunesAdapter.java DunesFileFormat.java DunesInterface.java DunesReader.java DunesWriter.java Log Message: Maj version 0.05 prepro Index: DunesAdapter.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io/DunesAdapter.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DunesAdapter.java 25 Nov 2003 10:11:31 -0000 1.5 --- DunesAdapter.java 12 Feb 2004 15:32:44 -0000 1.6 *************** *** 9,13 **** package org.fudaa.dodico.dunes.io; import org.fudaa.dodico.corba.geometrie.SMaillageIndex; ! import org.fudaa.dodico.h2d.H2dGrid; /** * --- 9,16 ---- package org.fudaa.dodico.dunes.io; import org.fudaa.dodico.corba.geometrie.SMaillageIndex; ! ! import org.fudaa.dodico.ef.EfGrid; ! import org.fudaa.dodico.ef.EfGridSourcesAbstract; ! import org.fudaa.dodico.fichiers.FileFormat; /** * *************** *** 15,25 **** * @version $Id$ */ ! public class DunesAdapter implements DunesInterface { ! H2dGrid maillage_; double[] adaptatif_; /** * @see org.fudaa.dodico.tr.reflux.DunesInterface#getMaillage() */ ! public H2dGrid getMaillage() { return maillage_; } --- 18,28 ---- * @version $Id$ */ ! public class DunesAdapter extends EfGridSourcesAbstract implements DunesInterface { ! EfGrid maillage_; double[] adaptatif_; /** * @see org.fudaa.dodico.tr.reflux.DunesInterface#getMaillage() */ ! public EfGrid getGrid() { return maillage_; } *************** *** 41,46 **** * @param maillage The maillage to set */ ! public void setMaillage(H2dGrid maillage) { maillage_= maillage; } } --- 44,56 ---- * @param maillage The maillage to set */ ! public void setMaillage(EfGrid maillage) { maillage_= maillage; } + /** + * + */ + public FileFormat getFileFormat() { + return DunesFileFormat.getInstance(); + } + } Index: DunesFileFormat.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io/DunesFileFormat.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** DunesFileFormat.java 19 Dec 2003 12:10:36 -0000 1.11 --- DunesFileFormat.java 12 Feb 2004 15:32:44 -0000 1.12 *************** *** 11,14 **** --- 11,18 ---- import org.fudaa.dodico.commun.ProgressionInterface; + import org.fudaa.dodico.ef.EfGrid; + import org.fudaa.dodico.ef.EfGridSource; + import org.fudaa.dodico.ef.EfLib; + import org.fudaa.dodico.ef.FileFormatGridVersion; import org.fudaa.dodico.fichiers.FileFormat; import org.fudaa.dodico.fichiers.FileFormatSoftware; *************** *** 17,22 **** import org.fudaa.dodico.fichiers.FileReadOperationAbstract; import org.fudaa.dodico.fichiers.FileWriteOperationAbstract; - import org.fudaa.dodico.h2d.H2dFileFormatMaillageVersion; - import org.fudaa.dodico.h2d.H2dGrid; import org.fudaa.dodico.h2d.H2dResource; import org.fudaa.dodico.h2d.type.H2dFileFormatType; --- 21,24 ---- *************** *** 35,39 **** private DunesFileFormat() { super(NB_FILE); ! extensions_= new String[] { "mail","geo" }; ID_= "DUNES"; nom_= "Dunes"; --- 37,41 ---- private DunesFileFormat() { super(NB_FILE); ! extensions_= new String[] { "mail", "geo" }; ID_= "DUNES"; nom_= "Dunes"; *************** *** 51,56 **** return LAST_VERSION; } ! ! public FileFormatVersion getLastVersionInstance(){ return getLastVersionImpl(); } --- 53,58 ---- return LAST_VERSION; } ! ! public FileFormatVersion getLastVersionInstance() { return getLastVersionImpl(); } *************** *** 61,65 **** public class DunesVersion extends FileFormatVersion ! implements H2dFileFormatMaillageVersion { /** * Returns the aDAPTATIF. --- 63,67 ---- public class DunesVersion extends FileFormatVersion ! implements FileFormatGridVersion { /** * Returns the aDAPTATIF. *************** *** 113,117 **** public FileOperationSynthese writeGrid( File _f, ! H2dGrid _m, ProgressionInterface _prog) { DunesAdapter inter= new DunesAdapter(); --- 115,119 ---- public FileOperationSynthese writeGrid( File _f, ! EfGrid _m, ProgressionInterface _prog) { DunesAdapter inter= new DunesAdapter(); *************** *** 119,122 **** --- 121,132 ---- return write(_f, inter, _prog); } + + public FileOperationSynthese writeGrid( + File _f, + EfGridSource _m, + ProgressionInterface _prog) { + return writeGrid(_f, _m.getGrid(), _prog); + } + /** * *************** *** 125,133 **** File _f, ProgressionInterface _prog) { ! FileOperationSynthese f= read(_f, _prog); ! DunesInterface interf= (DunesInterface)f.getSource(); ! if (interf != null) ! f.setSource(interf.getMaillage()); ! return f; } --- 135,139 ---- File _f, ProgressionInterface _prog) { ! return read(_f, _prog); } *************** *** 139,142 **** --- 145,159 ---- } + /** + * + */ + public FileOperationSynthese readListPoint( + File _f, + ProgressionInterface _prog) { + FileOperationSynthese s= readGrid(_f, _prog); + s.setSource(((EfGridSource)s.getSource()).getGrid()); + return s; + } + } } Index: DunesInterface.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io/DunesInterface.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DunesInterface.java 25 Nov 2003 10:11:32 -0000 1.5 --- DunesInterface.java 12 Feb 2004 15:32:44 -0000 1.6 *************** *** 9,13 **** package org.fudaa.dodico.dunes.io; import org.fudaa.dodico.corba.geometrie.SMaillageIndex; ! import org.fudaa.dodico.h2d.H2dGrid; /** * --- 9,15 ---- package org.fudaa.dodico.dunes.io; import org.fudaa.dodico.corba.geometrie.SMaillageIndex; ! ! import org.fudaa.dodico.ef.EfGrid; ! import org.fudaa.dodico.ef.EfGridSource; /** * *************** *** 15,23 **** * @version $Id$ */ ! public interface DunesInterface { /** * Renvoie le maillage. */ ! H2dGrid getMaillage(); /** * Des valeurs sont ajoutes a chaque noeud pour un maillage adaptatif. --- 17,25 ---- * @version $Id$ */ ! public interface DunesInterface extends EfGridSource{ /** * Renvoie le maillage. */ ! EfGrid getGrid(); /** * Des valeurs sont ajoutes a chaque noeud pour un maillage adaptatif. Index: DunesReader.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io/DunesReader.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** DunesReader.java 12 Dec 2003 10:30:53 -0000 1.12 --- DunesReader.java 12 Feb 2004 15:32:44 -0000 1.13 *************** *** 14,24 **** import org.fudaa.dodico.commun.DodicoAnalyze; import org.fudaa.dodico.fichiers.FileFormat; import org.fudaa.dodico.fichiers.FileFormatVersion; import org.fudaa.dodico.fichiers.FileOpReadCharSimpleAbstract; - import org.fudaa.dodico.h2d.H2dElement; - import org.fudaa.dodico.h2d.H2dGrid; - import org.fudaa.dodico.h2d.H2dLib; - import org.fudaa.dodico.h2d.H2dPoint; import org.fudaa.dodico.h2d.H2dResource; /** --- 14,25 ---- import org.fudaa.dodico.commun.DodicoAnalyze; + import org.fudaa.dodico.commun.DodicoLib; + import org.fudaa.dodico.ef.EfElement; + import org.fudaa.dodico.ef.EfGrid; + import org.fudaa.dodico.ef.EfLib; + import org.fudaa.dodico.ef.EfNode; import org.fudaa.dodico.fichiers.FileFormat; import org.fudaa.dodico.fichiers.FileFormatVersion; import org.fudaa.dodico.fichiers.FileOpReadCharSimpleAbstract; import org.fudaa.dodico.h2d.H2dResource; /** *************** *** 44,49 **** private DunesInterface readDunes() { DunesAdapter source_= null; ! H2dPoint[] points= null; ! H2dElement[] elems= null; double[] adaptatifs= null; in_.setJumpBlankLine(true); --- 45,50 ---- private DunesInterface readDunes() { DunesAdapter source_= null; ! EfNode[] points= null; ! EfElement[] elems= null; double[] adaptatifs= null; in_.setJumpBlankLine(true); *************** *** 82,86 **** } //Creation du tableau de point. ! points= new H2dPoint[nbNoeuds]; // maillage.points = points; int pourc= 0; --- 83,87 ---- } //Creation du tableau de point. ! points= new EfNode[nbNoeuds]; // maillage.points = points; int pourc= 0; *************** *** 88,92 **** if (afficheAvance) progress_.setProgression(pourc); ! int step= H2dLib.getStep(nbNoeuds); int pourcStep= (int) (50 / step); int pas= (int) (nbNoeuds / step); --- 89,93 ---- if (afficheAvance) progress_.setProgression(pourc); ! int step= DodicoLib.getStep(nbNoeuds); int pourcStep= (int) (50 / step); int pas= (int) (nbNoeuds / step); *************** *** 115,119 **** } points[i]= ! new H2dPoint( in_.doubleField(1), in_.doubleField(2), --- 116,120 ---- } points[i]= ! new EfNode( in_.doubleField(1), in_.doubleField(2), *************** *** 122,126 **** in_.readFields(); if (in_.getNumberOfFields() != 1) { ! analyze_.addWarning( H2dResource.getS( "La ligne du coefficient adaptatif ne doit contenir qu'un champ"), --- 123,127 ---- in_.readFields(); if (in_.getNumberOfFields() != 1) { ! analyze_.addWarn( H2dResource.getS( "La ligne du coefficient adaptatif ne doit contenir qu'un champ"), *************** *** 158,164 **** } int nbElem= in_.intField(0); ! elems= new H2dElement[nbElem]; //Les donnees utiles pour l'etat d'avancement ! step= H2dLib.getStep(nbElem); pas= (int) (nbElem / step); pMax= pas; --- 159,165 ---- } int nbElem= in_.intField(0); ! elems= new EfElement[nbElem]; //Les donnees utiles pour l'etat d'avancement ! step= DodicoLib.getStep(nbElem); pas= (int) (nbElem / step); pMax= pas; *************** *** 214,218 **** index[j]= in_.intField(2 + j) - 1; } ! elems[i]= new H2dElement(index); if (afficheAvance) { if (i > pMax) { --- 215,219 ---- index[j]= in_.intField(2 + j) - 1; } ! elems[i]= new EfElement(index); if (afficheAvance) { if (i > pMax) { *************** *** 226,230 **** if (!"0 0 0 0".equals(in_.getLine().trim())) { if (in_.getLine().trim() != "") ! analyze_.addWarning( H2dResource.getS("Cette ligne et les suivantes sont ignorées"), in_); --- 227,231 ---- if (!"0 0 0 0".equals(in_.getLine().trim())) { if (in_.getLine().trim() != "") ! analyze_.addWarn( H2dResource.getS("Cette ligne et les suivantes sont ignorées"), in_); *************** *** 232,236 **** in_.readFields(); if (in_.getLine().trim() != "") ! analyze_.addWarning( H2dResource.getS("Cette ligne et les suivantes sont ignorées"), in_); --- 233,237 ---- in_.readFields(); if (in_.getLine().trim() != "") ! analyze_.addWarn( H2dResource.getS("Cette ligne et les suivantes sont ignorées"), in_); *************** *** 239,248 **** CtuluLib.debug("Dunes Read end"); } catch (NumberFormatException fe) { ! DodicoAnalyze.manageException(fe, analyze_, in_); } catch (IOException _e) { ! DodicoAnalyze.manageException(_e, analyze_); } //Le mot clef noeud est trouve, on peut creer le maillage. ! H2dGrid maillage= new H2dGrid(points, elems); source_= new DunesAdapter(); source_.setMaillage(maillage); --- 240,250 ---- CtuluLib.debug("Dunes Read end"); } catch (NumberFormatException fe) { ! analyze_.manageException(fe, in_); } catch (IOException _e) { ! analyze_.manageException(_e); } //Le mot clef noeud est trouve, on peut creer le maillage. ! EfGrid maillage= new EfGrid(points, elems); ! EfLib.orienteGrid(maillage, progress_, true, analyze_); source_= new DunesAdapter(); source_.setMaillage(maillage); Index: DunesWriter.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io/DunesWriter.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** DunesWriter.java 11 Dec 2003 12:41:27 -0000 1.11 --- DunesWriter.java 12 Feb 2004 15:32:44 -0000 1.12 *************** *** 9,23 **** package org.fudaa.dodico.dunes.io; import java.io.IOException; import org.fudaa.dodico.commun.DodicoAnalyze; import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.commun.DodicoResource; import org.fudaa.dodico.fichiers.FileFormat; import org.fudaa.dodico.fichiers.FileFormatVersion; import org.fudaa.dodico.fichiers.FileOpWriterCharSimpleAbstract; import org.fudaa.dodico.fichiers.FileOperationSynthese; - import org.fudaa.dodico.h2d.H2dElement; - import org.fudaa.dodico.h2d.H2dLib; - import org.fudaa.dodico.h2d.H2dGrid; - import org.fudaa.dodico.h2d.H2dPoint; import org.fudaa.dodico.h2d.H2dResource; /** --- 9,23 ---- package org.fudaa.dodico.dunes.io; import java.io.IOException; + import org.fudaa.dodico.commun.DodicoAnalyze; import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.commun.DodicoResource; + import org.fudaa.dodico.ef.EfElement; + import org.fudaa.dodico.ef.EfGrid; + import org.fudaa.dodico.ef.EfNode; import org.fudaa.dodico.fichiers.FileFormat; import org.fudaa.dodico.fichiers.FileFormatVersion; import org.fudaa.dodico.fichiers.FileOpWriterCharSimpleAbstract; import org.fudaa.dodico.fichiers.FileOperationSynthese; import org.fudaa.dodico.h2d.H2dResource; /** *************** *** 54,58 **** return; } ! H2dGrid maillage= dunes_.getMaillage(); if (maillage == null) { analyze_.addFatalError("Le maillage est nul"); --- 54,58 ---- return; } ! EfGrid maillage= dunes_.getGrid(); if (maillage == null) { analyze_.addFatalError("Le maillage est nul"); *************** *** 100,108 **** progress_.setDesc(H2dResource.getS("Ecriture fichier") + " dunes"); } ! int step= H2dLib.getStep(nPts); int pas= (int) (nPts / step); int pMax= pas; int pourcStep= (int) (50 / step); ! H2dPoint pt; try { for (int i= 0; i < nPts; i++) { --- 100,108 ---- progress_.setDesc(H2dResource.getS("Ecriture fichier") + " dunes"); } ! int step= DodicoLib.getStep(nPts); int pas= (int) (nPts / step); int pMax= pas; int pourcStep= (int) (50 / step); ! EfNode pt; try { for (int i= 0; i < nPts; i++) { *************** *** 138,147 **** b.append(lineSep_); //pour afficher l'etat d'avancement ! step= H2dLib.getStep(nElems); pas= (int) (nElems / step); pMax= pas; pourcStep= (int) (50 / step); //les points par elements ! H2dElement ppel; //le nombre de points par elements. int nppel; --- 138,147 ---- b.append(lineSep_); //pour afficher l'etat d'avancement ! step= DodicoLib.getStep(nElems); pas= (int) (nElems / step); pMax= pas; pourcStep= (int) (50 / step); //les points par elements ! EfElement ppel; //le nombre de points par elements. int nppel; *************** *** 173,177 **** out_.flush(); } catch (IOException _ex) { ! DodicoAnalyze.manageException(_ex, analyze_); } return; --- 173,177 ---- out_.flush(); } catch (IOException _ex) { ! analyze_.manageException(_ex); } return; |