|
From: <de...@us...> - 2003-08-22 23:14:14
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io
In directory sc8-pr-cvs1:/tmp/cvs-serv5355/dunes/io
Modified Files:
DunesFileFormat.java DunesReader.java DunesWriter.java
Log Message:
Creation des dossiers h2d/reflux et h2d/telemac et deplacement des
fichiers concerne.
Gestion des cl et des bords ( a refaire ..)
Amelioration des gestions des versions de fichiers
Index: DunesFileFormat.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io/DunesFileFormat.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** DunesFileFormat.java 18 Aug 2003 11:05:19 -0000 1.5
--- DunesFileFormat.java 22 Aug 2003 15:51:11 -0000 1.6
***************
*** 16,20 ****
import org.fudaa.dodico.fichiers.FileFormatVersion;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
! import org.fudaa.dodico.h2d.H2dLib;
import org.fudaa.dodico.h2d.type.H2dFileFormatType;
--- 16,23 ----
import org.fudaa.dodico.fichiers.FileFormatVersion;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
! import org.fudaa.dodico.fichiers.FileReadOperationAbstract;
! import org.fudaa.dodico.fichiers.FileWriteOperationAbstract;
! import org.fudaa.dodico.h2d.H2dFileFormatMaillageVersion;
! import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.type.H2dFileFormatType;
***************
*** 53,57 ****
}
! public class DunesVersion extends FileFormatVersion {
/**
--- 56,60 ----
}
! public class DunesVersion extends FileFormatVersion implements H2dFileFormatMaillageVersion{
/**
***************
*** 91,99 ****
}
! public DunesReader createReader() {
return new DunesReader(this);
}
! public DunesWriter createWriter() {
return new DunesWriter(this);
}
--- 94,102 ----
}
! public FileReadOperationAbstract createReader() {
return new DunesReader(this);
}
! public FileWriteOperationAbstract createWriter() {
return new DunesWriter(this);
}
***************
*** 103,119 ****
DunesInterface _inter,
ProgressionInterface _prog) {
! DunesWriter w= createWriter();
! FileOperationSynthese synt= FileFormatVersion.initOperation(w, _prog, _f);
! w.write(_inter, synt);
! return synt;
}
! public DunesInterface read(
File _f,
! FileOperationSynthese _synt,
ProgressionInterface _prog) {
! DunesReader r= createReader();
! FileFormatVersion.initOperation(_synt, r, _prog, _f);
! return r.read(_synt);
}
--- 106,126 ----
DunesInterface _inter,
ProgressionInterface _prog) {
! DunesWriter w= new DunesWriter(this);
! w.setFile(_f);
! w.setProgressReceiver(_prog);
! return w.write(_inter);
}
!
! /**
! *
! */
! public FileOperationSynthese writeMaillage(
File _f,
! H2dMaillage _m,
ProgressionInterface _prog) {
! DunesAdapter inter=new DunesAdapter();
! inter.setMaillage(_m);
! return write(_f, inter, _prog);
}
Index: DunesReader.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io/DunesReader.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** DunesReader.java 18 Aug 2003 11:05:19 -0000 1.6
--- DunesReader.java 22 Aug 2003 15:51:11 -0000 1.7
***************
*** 17,22 ****
--- 17,24 ----
import org.fudaa.dodico.corba.geometrie.SPoint;
import org.fudaa.dodico.fichiers.FileFormat;
+ import org.fudaa.dodico.fichiers.FileFormatVersion;
import org.fudaa.dodico.fichiers.FileOpReadCharSimpleAbstract;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
+ import org.fudaa.dodico.fichiers.FileReadOperationAbstract;
import org.fudaa.dodico.h2d.H2dElement;
import org.fudaa.dodico.h2d.H2dLib;
***************
*** 30,35 ****
* @version $Id$
*/
! public class DunesReader extends FileOpReadCharSimpleAbstract
! {
DunesFileFormat.DunesVersion version_;
--- 32,36 ----
* @version $Id$
*/
! public class DunesReader extends FileOpReadCharSimpleAbstract {
DunesFileFormat.DunesVersion version_;
***************
*** 38,144 ****
* @param _in le flux d'entree non bufferise.
*/
! public DunesReader()
! {
this(DunesFileFormat.getInstance().getLastVersionImpl());
}
! public DunesReader(DunesFileFormat.DunesVersion _f)
! {
! version_ = _f;
}
!
! public DunesInterface read(FileOperationSynthese _operationState)
! {
! DodicoAnalyze.Editor edit=new DodicoAnalyze.Editor();
! DunesInterface r=readDunes(edit);
! FileOperationSynthese.initAndClose(_operationState,edit,this,"Lecture Fichier Dunes");
! return r;
}
-
! protected DunesInterface readDunes(DodicoAnalyze.Editor _analyze)
! {
! DunesAdapter source_=null;
! H2dPoint[] points=null;
! H2dElement[] elems=null;
! double[] adaptatifs=null;
in_.setJumpBlankLine(true);
! try
! {
//lit jusqu'a la premiere ligne non vide.
//Lecture de l'identifiant NOEUD
in_.readFields();
! if ((in_.getNumberOfFields() != 1) && (!version_.getNoeudCode().equals(in_.stringField(0))))
! {
! _analyze.addError(DodicoLib.geti18n("L'identifiant") + " " + version_.getNoeudCode() + " " + DodicoLib.geti18n("est attendu"), in_);
return null;
}
-
//Lecture du nombre de noeud et format du maillage (apaptatif ou non)
//NOMBRE_DE_NOEUD TYPE_DE_MAILLAGE
in_.readFields();
//verification que l'on a bien 2 champs
! if (in_.getNumberOfFields() != 2)
! {
! _analyze.addFatalError(DodicoLib.geti18n("Nombre de noeuds non trouve"), in_);
return null;
}
//le nombre de noeud
! int nbNoeuds = in_.intField(0);
//le type de maillage.
//Si 2, des infos sur le maillage adaptatif seront presentes
! int typeMaillage = in_.intField(1);
//Si adaptatif, on initialise le tableau stockant les valeurs.
! if (typeMaillage == version_.getAdaptatifCode())
! {
! adaptatifs = new double[nbNoeuds];
//on affecte a source le tableau.
}
//Creation du tableau de point.
! points = new H2dPoint[nbNoeuds];
! // maillage.points = points;
! int pourc = 0;
! boolean afficheAvance = (progress_ == null ? false : true);
if (afficheAvance)
progress_.setProgression(pourc);
! int step = H2dLib.getStep(nbNoeuds);
! int pourcStep = (int) (50 / step);
! int pas = (int) (nbNoeuds / step);
! int pMax = pas;
int temp;
//lecture des noeuds
! for (int i = 0; i < nbNoeuds; i++)
! {
in_.readFields();
! if (in_.getNumberOfFields() != 4)
! {
! _analyze.addInfo(DodicoLib.geti18n("Format attendu") + ": NUM_POINT X Y Z", in_);
! _analyze.addError(DodicoLib.geti18n("Définition du noeud") + " " + (i + 1) + " " + DodicoLib.geti18n("non valide"), in_);
return null;
}
! temp = in_.intField(0);
! if (temp != (i + 1))
! {
! _analyze.addInfo(DodicoLib.geti18n("Le numero du point ne correspond pas au numéro réel"), in_);
}
! points[i] = new H2dPoint(in_.doubleField(1),in_.doubleField(2),in_.doubleField(3));
! if (adaptatifs != null)
! {
in_.readFields();
! if (in_.getNumberOfFields() != 1)
! {
! _analyze.addWarning(DodicoLib.geti18n("la ligne du coefficient adaptatif ne doit contenir qu'un champ"), in_);
}
! adaptatifs[i] = in_.doubleField(0);
}
! if (afficheAvance)
! {
! if (i > pMax)
! {
pourc += pourcStep;
progress_.setProgression(pourc);
--- 39,152 ----
* @param _in le flux d'entree non bufferise.
*/
! public DunesReader() {
this(DunesFileFormat.getInstance().getLastVersionImpl());
}
! public DunesReader(DunesFileFormat.DunesVersion _f) {
! version_= _f;
}
!
! protected Object _read() {
! return readDunes();
}
! private DunesInterface readDunes() {
! DunesAdapter source_= null;
! H2dPoint[] points= null;
! H2dElement[] elems= null;
! double[] adaptatifs= null;
in_.setJumpBlankLine(true);
! try {
//lit jusqu'a la premiere ligne non vide.
//Lecture de l'identifiant NOEUD
in_.readFields();
! if ((in_.getNumberOfFields() != 1)
! && (!version_.getNoeudCode().equals(in_.stringField(0)))) {
! analyze_.addError(
! DodicoLib.geti18n("L'identifiant")
! + " "
! + version_.getNoeudCode()
! + " "
! + DodicoLib.geti18n("est attendu"),
! in_);
return null;
}
//Lecture du nombre de noeud et format du maillage (apaptatif ou non)
//NOMBRE_DE_NOEUD TYPE_DE_MAILLAGE
in_.readFields();
//verification que l'on a bien 2 champs
! if (in_.getNumberOfFields() != 2) {
! analyze_.addFatalError(
! DodicoLib.geti18n("Nombre de noeuds non trouve"),
! in_);
return null;
}
//le nombre de noeud
! int nbNoeuds= in_.intField(0);
//le type de maillage.
//Si 2, des infos sur le maillage adaptatif seront presentes
! int typeMaillage= in_.intField(1);
//Si adaptatif, on initialise le tableau stockant les valeurs.
! if (typeMaillage == version_.getAdaptatifCode()) {
! adaptatifs= new double[nbNoeuds];
//on affecte a source le tableau.
}
//Creation du tableau de point.
! points= new H2dPoint[nbNoeuds];
! // maillage.points = points;
! int pourc= 0;
! boolean afficheAvance= (progress_ == null ? false : true);
if (afficheAvance)
progress_.setProgression(pourc);
! int step= H2dLib.getStep(nbNoeuds);
! int pourcStep= (int) (50 / step);
! int pas= (int) (nbNoeuds / step);
! int pMax= pas;
int temp;
//lecture des noeuds
! for (int i= 0; i < nbNoeuds; i++) {
in_.readFields();
! if (in_.getNumberOfFields() != 4) {
! analyze_.addInfo(
! DodicoLib.geti18n("Format attendu") + ": NUM_POINT X Y Z",
! in_);
! analyze_.addError(
! DodicoLib.geti18n("Définition du noeud")
! + " "
! + (i + 1)
! + " "
! + DodicoLib.geti18n("non valide"),
! in_);
return null;
}
! temp= in_.intField(0);
! if (temp != (i + 1)) {
! analyze_.addInfo(
! DodicoLib.geti18n(
! "Le numero du point ne correspond pas au numéro réel"),
! in_);
}
! points[i]=
! new H2dPoint(
! in_.doubleField(1),
! in_.doubleField(2),
! in_.doubleField(3));
! if (adaptatifs != null) {
in_.readFields();
! if (in_.getNumberOfFields() != 1) {
! analyze_.addWarning(
! DodicoLib.geti18n(
! "la ligne du coefficient adaptatif ne doit contenir qu'un champ"),
! in_);
}
! adaptatifs[i]= in_.doubleField(0);
}
! if (afficheAvance) {
! if (i > pMax) {
pourc += pourcStep;
progress_.setProgression(pourc);
***************
*** 149,155 ****
//Lecture du mot cle ELEMENT
in_.readFields();
! if ((in_.getNumberOfFields() != 1) && (!version_.getElementCode().equals(in_.stringField(0))))
! {
! _analyze.addError(DodicoLib.geti18n("L'identifiant") + " " + version_.getElementCode() + " " + DodicoLib.geti18n("est attendu"), in_);
return null;
}
--- 157,169 ----
//Lecture du mot cle ELEMENT
in_.readFields();
! if ((in_.getNumberOfFields() != 1)
! && (!version_.getElementCode().equals(in_.stringField(0)))) {
! analyze_.addError(
! DodicoLib.geti18n("L'identifiant")
! + " "
! + version_.getElementCode()
! + " "
! + DodicoLib.geti18n("est attendu"),
! in_);
return null;
}
***************
*** 158,215 ****
in_.readFields();
//Un seul champ attendu
! if (in_.getNumberOfFields() != 1)
! {
! _analyze.addFatalError(DodicoLib.geti18n("Cette ligne ne doit contenir que le nombre d'elements"), in_);
return null;
}
! 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;
! pourcStep = (int) (50 / step);
int[] index;
! for (int i = 0; i < nbElem; i++)
! {
in_.readFields();
! if (in_.getNumberOfFields() < 2)
! {
! _analyze.addInfo(DodicoLib.geti18n("Format attendu") + "NUM_ELEMENT NB_POINT P[1] ...P[NB_POINT]", in_);
! _analyze.addError(DodicoLib.geti18n("Définition de l'element") + " " + (i + 1) + " " + DodicoLib.geti18n("non valide"), in_);
return null;
}
//le numero d'element
! temp = in_.intField(0);
! if (temp != (i + 1))
! {
! _analyze.addInfo(DodicoLib.geti18n("Le numero de l'element ne correspond pas au numéro réel"), in_);
}
! temp = in_.intField(1);
! if (temp <= 0)
! {
! _analyze.addError(DodicoLib.geti18n("Nombre de points négatifs ou nul pour l'élément") + " " + (i + 1), in_);
return null;
}
! if (in_.getNumberOfFields() != (temp + 2))
! {
! _analyze.addInfo(
! DodicoLib.geti18n("Nombre indiqué") + ": " + temp + "." + DodicoLib.geti18n("Nombre lu") + ": " + (in_.getNumberOfFields() - 2),
in_);
- _analyze.addFatalError(DodicoLib.geti18n("Le nombre d'éléments ne correspond pas"), in_);
return null;
}
index= new int[temp];
! for (int j = 0; j < temp; j++)
! {
//on stocke les indexs en commencant a 0.
! index[j] = in_.intField(2 + j) - 1;
}
! elems[i]=new H2dElement(index);
! if (afficheAvance)
! {
! if (i > pMax)
! {
pourc += pourcStep;
progress_.setProgression(pourc);
--- 172,248 ----
in_.readFields();
//Un seul champ attendu
! if (in_.getNumberOfFields() != 1) {
! analyze_.addFatalError(
! DodicoLib.geti18n(
! "Cette ligne ne doit contenir que le nombre d'elements"),
! in_);
return null;
}
! 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;
! pourcStep= (int) (50 / step);
int[] index;
! for (int i= 0; i < nbElem; i++) {
in_.readFields();
! if (in_.getNumberOfFields() < 2) {
! analyze_.addInfo(
! DodicoLib.geti18n("Format attendu")
! + "NUM_ELEMENT NB_POINT P[1] ...P[NB_POINT]",
! in_);
! analyze_.addError(
! DodicoLib.geti18n("Définition de l'element")
! + " "
! + (i + 1)
! + " "
! + DodicoLib.geti18n("non valide"),
! in_);
return null;
}
//le numero d'element
! temp= in_.intField(0);
! if (temp != (i + 1)) {
! analyze_.addInfo(
! DodicoLib.geti18n(
! "Le numero de l'element ne correspond pas au numéro réel"),
! in_);
}
! temp= in_.intField(1);
! if (temp <= 0) {
! analyze_.addError(
! DodicoLib.geti18n(
! "Nombre de points négatifs ou nul pour l'élément")
! + " "
! + (i + 1),
! in_);
return null;
}
! if (in_.getNumberOfFields() != (temp + 2)) {
! analyze_.addInfo(
! DodicoLib.geti18n("Nombre indiqué")
! + ": "
! + temp
! + "."
! + DodicoLib.geti18n("Nombre lu")
! + ": "
! + (in_.getNumberOfFields() - 2),
! in_);
! analyze_.addFatalError(
! DodicoLib.geti18n("Le nombre d'éléments ne correspond pas"),
in_);
return null;
}
index= new int[temp];
! for (int j= 0; j < temp; j++) {
//on stocke les indexs en commencant a 0.
! index[j]= in_.intField(2 + j) - 1;
}
! elems[i]= new H2dElement(index);
! if (afficheAvance) {
! if (i > pMax) {
pourc += pourcStep;
progress_.setProgression(pourc);
***************
*** 219,248 ****
}
in_.readFields();
! if (!"0 0 0 0".equals(in_.getLine().trim()))
! {
if (in_.getLine().trim() != "")
! _analyze.addWarning("Cette ligne et les suivantes sont ignorées", in_);
}
in_.readFields();
if (in_.getLine().trim() != "")
! _analyze.addWarning("Cette ligne et les suivantes sont ignorées", in_);
!
! }
! catch (EOFException e)
! {
if (DodicoLib.DEBUG)
System.out.println("Lecture terminée");
! }
! 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.
! H2dMaillage maillage = new H2dMaillage(points,elems);
! source_ = new DunesAdapter();
source_.setMaillage(maillage);
source_.setAdaptatif(adaptatifs);
--- 252,276 ----
}
in_.readFields();
! if (!"0 0 0 0".equals(in_.getLine().trim())) {
if (in_.getLine().trim() != "")
! analyze_.addWarning(
! "Cette ligne et les suivantes sont ignorées",
! in_);
}
in_.readFields();
if (in_.getLine().trim() != "")
! analyze_.addWarning("Cette ligne et les suivantes sont ignorées", in_);
!
! } catch (EOFException e) {
if (DodicoLib.DEBUG)
System.out.println("Lecture terminée");
! } 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.
! H2dMaillage maillage= new H2dMaillage(points, elems);
! source_= new DunesAdapter();
source_.setMaillage(maillage);
source_.setAdaptatif(adaptatifs);
***************
*** 251,267 ****
}
-
/**
* @return
*/
! public FileFormat getFileFormat()
! {
return getDunesFileFormat();
}
!
! public DunesFileFormat getDunesFileFormat()
! {
! return (DunesFileFormat)version_.getFileFormat();
! }
}
--- 279,299 ----
}
/**
* @return
*/
! public FileFormat getFileFormat() {
return getDunesFileFormat();
}
!
! public DunesFileFormat getDunesFileFormat() {
! return (DunesFileFormat)version_.getFileFormat();
! }
!
! /**
! *
! */
! public FileFormatVersion getVersion() {
! return version_;
! }
}
Index: DunesWriter.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io/DunesWriter.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** DunesWriter.java 18 Aug 2003 11:05:19 -0000 1.6
--- DunesWriter.java 22 Aug 2003 15:51:11 -0000 1.7
***************
*** 16,21 ****
--- 16,23 ----
import org.fudaa.dodico.corba.geometrie.SPoint;
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.fortran.FortranInterface;
import org.fudaa.dodico.h2d.H2dElement;
import org.fudaa.dodico.h2d.H2dLib;
***************
*** 28,62 ****
* @version $Id$
*/
! public class DunesWriter extends FileOpWriterCharSimpleAbstract
! {
DunesFileFormat.DunesVersion version_;
! public DunesWriter()
! {
this(DunesFileFormat.getInstance().getLastVersionImpl());
}
! public DunesWriter(DunesFileFormat.DunesVersion _f)
! {
version_= _f;
}
! public FileFormat getFileFormat()
! {
return version_.getFileFormat();
}
- public void write(DunesInterface _d, FileOperationSynthese _op)
- {
- DodicoAnalyze.Editor edit= new DodicoAnalyze.Editor();
- writeDunes(_d, edit);
- FileOperationSynthese.initAndClose(
- _op,
- edit,
- this,
- "Ecriture Fichier Dunes");
- }
-
/**
* Ecrire les donnees de l'interface <code>DunesInterface</code>
--- 30,49 ----
* @version $Id$
*/
! public class DunesWriter extends FileOpWriterCharSimpleAbstract {
DunesFileFormat.DunesVersion version_;
! public DunesWriter() {
this(DunesFileFormat.getInstance().getLastVersionImpl());
}
! public DunesWriter(DunesFileFormat.DunesVersion _f) {
version_= _f;
}
! public FileFormat getFileFormat() {
return version_.getFileFormat();
}
/**
* Ecrire les donnees de l'interface <code>DunesInterface</code>
***************
*** 65,92 ****
* La méthode se termine par un flush mais ne ferme pas le flux.
*/
! protected void writeDunes(DunesInterface _d, DodicoAnalyze.Editor analyze_)
! {
DunesInterface dunes_= _d;
//Test sur les objets a ecrire
! if (dunes_ == null)
! {
analyze_.addFatalError(
DodicoLib.geti18n("La structure à écrire est nulle !"));
return;
}
! if (out_ == null)
! {
analyze_.addFatalError("Le flux de sortie est nul !");
return;
}
H2dMaillage maillage= dunes_.getMaillage();
! if (maillage == null)
! {
analyze_.addFatalError("Le maillage est nul !");
return;
}
int nPts= maillage.getPtsNb();
! if (nPts == 0)
! {
analyze_.addFatalError(
DodicoLib.geti18n("Le maillage ne contient pas de points !"));
--- 52,74 ----
* La méthode se termine par un flush mais ne ferme pas le flux.
*/
! protected void writeDunes(DunesInterface _d) {
DunesInterface dunes_= _d;
//Test sur les objets a ecrire
! if (dunes_ == null) {
analyze_.addFatalError(
DodicoLib.geti18n("La structure à écrire est nulle !"));
return;
}
! if (out_ == null) {
analyze_.addFatalError("Le flux de sortie est nul !");
return;
}
H2dMaillage maillage= dunes_.getMaillage();
! if (maillage == null) {
analyze_.addFatalError("Le maillage est nul !");
return;
}
int nPts= maillage.getPtsNb();
! if (nPts == 0) {
analyze_.addFatalError(
DodicoLib.geti18n("Le maillage ne contient pas de points !"));
***************
*** 94,105 ****
}
//H2dElement[] elems= maillage.getElts();
! // if (elems == null)
! // {
! // analyze_.addFatalError("Le maillage ne contient pas d'éléments !");
! // return;
! // }
int nElems= maillage.getEltNb();
! if (nElems == 0)
! {
analyze_.addFatalError("Le maillage ne contient pas d'éléments !");
return;
--- 76,86 ----
}
//H2dElement[] elems= maillage.getElts();
! // if (elems == null)
! // {
! // analyze_.addFatalError("Le maillage ne contient pas d'éléments !");
! // return;
! // }
int nElems= maillage.getEltNb();
! if (nElems == 0) {
analyze_.addFatalError("Le maillage ne contient pas d'éléments !");
return;
***************
*** 113,124 ****
boolean printAdaptatifV= false;
double[] adValeur= dunes_.getAdaptatifValeur();
! if (adValeur != null)
! {
b.append(' ');
b.append(version_.getAdaptatifCode());
printAdaptatifV= true;
! }
! else
! {
b.append(version_.getNonAdaptatifCode());
}
--- 94,102 ----
boolean printAdaptatifV= false;
double[] adValeur= dunes_.getAdaptatifValeur();
! if (adValeur != null) {
b.append(' ');
b.append(version_.getAdaptatifCode());
printAdaptatifV= true;
! } else {
b.append(version_.getNonAdaptatifCode());
}
***************
*** 128,133 ****
int pourc= 0;
boolean afficheAvance= (progress_ == null ? false : true);
! if (afficheAvance)
progress_.setProgression(pourc);
int step= H2dLib.getStep(nPts);
int pas= (int) (nPts / step);
--- 106,114 ----
int pourc= 0;
boolean afficheAvance= (progress_ == null ? false : true);
! if (afficheAvance) {
progress_.setProgression(pourc);
+ progress_.setDesc(DodicoLib.geti18n("Ecriture fichier dunes"));
+ }
+
int step= H2dLib.getStep(nPts);
int pas= (int) (nPts / step);
***************
*** 135,142 ****
int pourcStep= (int) (50 / step);
H2dPoint pt;
! try
! {
! for (int i= 0; i < nPts; i++)
! {
pt= maillage.getPt(i);
b.append((i + 1));
--- 116,121 ----
int pourcStep= (int) (50 / step);
H2dPoint pt;
! try {
! for (int i= 0; i < nPts; i++) {
pt= maillage.getPt(i);
b.append((i + 1));
***************
*** 148,161 ****
b.append(pt.getZ());
b.append(lineSep_);
! if (printAdaptatifV)
! {
b.append(adValeur[i]);
b.append(lineSep_);
}
DodicoLib.writeTo(out_, b);
! if (afficheAvance)
! {
! if (i > pMax)
! {
pourc += pourcStep;
progress_.setProgression(pourc);
--- 127,137 ----
b.append(pt.getZ());
b.append(lineSep_);
! if (printAdaptatifV) {
b.append(adValeur[i]);
b.append(lineSep_);
}
DodicoLib.writeTo(out_, b);
! if (afficheAvance) {
! if (i > pMax) {
pourc += pourcStep;
progress_.setProgression(pourc);
***************
*** 182,187 ****
int nppel;
int[] index;
! for (int i= 0; i < nElems; i++)
! {
ppel= maillage.getElement(i);
nppel= ppel.getPtNb();
--- 158,162 ----
int nppel;
int[] index;
! for (int i= 0; i < nElems; i++) {
ppel= maillage.getElement(i);
nppel= ppel.getPtNb();
***************
*** 192,198 ****
b.append(nppel);
//les indices des points pour l'element i
! index=ppel.getPtIndex();
! for (int j= 0; j < nppel; j++)
! {
b.append(' ');
//Les indices sont stockés a partir de 0.
--- 167,172 ----
b.append(nppel);
//les indices des points pour l'element i
! index= ppel.getPtIndex();
! for (int j= 0; j < nppel; j++) {
b.append(' ');
//Les indices sont stockés a partir de 0.
***************
*** 201,208 ****
writeln(b);
//mis a jour de l'etat d'avancement au cas ou.
! if (afficheAvance)
! {
! if (i > pMax)
! {
pourc += pourcStep;
progress_.setProgression(pourc);
--- 175,180 ----
writeln(b);
//mis a jour de l'etat d'avancement au cas ou.
! if (afficheAvance) {
! if (i > pMax) {
pourc += pourcStep;
progress_.setProgression(pourc);
***************
*** 213,222 ****
DodicoLib.writeTo(out_, b);
out_.flush();
! }
! catch (IOException _ex)
! {
DodicoAnalyze.manageException(_ex, analyze_);
}
return;
}
}
--- 185,219 ----
DodicoLib.writeTo(out_, b);
out_.flush();
! } catch (IOException _ex) {
DodicoAnalyze.manageException(_ex, analyze_);
}
return;
}
+
+ /**
+ *
+ */
+ protected void _write(Object _o) {
+ if (_o instanceof DunesInterface) {
+ writeDunes((DunesInterface)_o);
+ } else {
+ analyze_.addFatalError(DodicoLib.geti18n("Données invalide"));
+ }
+ }
+
+ /**
+ *
+ */
+ public final FileOperationSynthese write(DunesInterface _o) {
+ writeDunes(_o);
+ return closeOperation(_o);
+ }
+
+ /**
+ *
+ */
+ public FileFormatVersion getVersion() {
+ return version_;
+ }
+
}
|