From: <bma...@us...> - 2009-06-03 09:32:47
|
Revision: 4833 http://fudaa.svn.sourceforge.net/fudaa/?rev=4833&view=rev Author: bmarchan Date: 2009-06-03 09:32:41 +0000 (Wed, 03 Jun 2009) Log Message: ----------- 1. Lecture fichiers Rubar .cn : Les g?\195?\169om?\195?\169tries sont affect?\195?\169es directement ?\195?\160 un calque courbe de niveau + Suppression comm hydro 2. Lecture fichier Rubar .st/.cn : Le nom des profils/courbes niveau est intiialis?\195?\169 par ordre d'apparition dans le fichier a partir de 1 si inexistant dans le fichier lu. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/fortran/FortranDoubleReader.java branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarSEMFileFormat.java branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStReader.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardImportHelper.java Property Changed: ---------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/fortran/FortranDoubleReader.java branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarSEMFileFormat.java branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStReader.java branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardImportHelper.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/fortran/FortranDoubleReader.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/fortran/FortranDoubleReader.java 2009-06-03 06:45:44 UTC (rev 4832) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/fortran/FortranDoubleReader.java 2009-06-03 09:32:41 UTC (rev 4833) @@ -22,7 +22,7 @@ /** * @author Fred Deniger - * @version $Id: FortranDoubleReader.java,v 1.15 2007-06-13 12:57:16 deniger Exp $ + * @version $Id$ */ public class FortranDoubleReader extends FileOpReadCharSimpleAbstract implements FortranInterface { final int[] fmt_; @@ -45,14 +45,14 @@ } /** - * La lecture supporte les lignes de commentaires. Elle sont introduites par l'un des caract\xE8re contenus + * La lecture accepte les lignes de commentaires. Elle sont introduites par l'un des caract\xE8re contenus * dans _charComments.<p> * <b>Attention</b><br> * la casse du caract\xE8re qui introduit un commentaire est importante. Par exemple, si on * souhaite des lignes commentaires commencant par 'C' ou 'c', il faudra donner _charComments="Cc" * @param _charComments Les diff\xE9rents caract\xE8res autoris\xE9s pour introduire une ligne commentaire. */ - public void supportCommentLines(String _charComments) { + public void acceptCommentLines(String _charComments) { charComments_=_charComments; } Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/fortran/FortranDoubleReader.java ___________________________________________________________________ Added: svn:keywords + Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarSEMFileFormat.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarSEMFileFormat.java 2009-06-03 06:45:44 UTC (rev 4832) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarSEMFileFormat.java 2009-06-03 09:32:41 UTC (rev 4833) @@ -17,7 +17,7 @@ /** * @author fred deniger - * @version $Id: RubarSEMFileFormat.java,v 1.1 2006-12-05 10:13:17 deniger Exp $ + * @version $Id$ */ public class RubarSEMFileFormat extends FileFormatUnique { @@ -31,7 +31,7 @@ public FileReadOperationAbstract createReader() { FortranDoubleReader w=new FortranDoubleReader(getFmt()); - w.supportCommentLines("#"); + w.acceptCommentLines("#"); return w; } Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarSEMFileFormat.java ___________________________________________________________________ Added: svn:keywords + Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStReader.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStReader.java 2009-06-03 06:45:44 UTC (rev 4832) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStReader.java 2009-06-03 09:32:41 UTC (rev 4833) @@ -1,6 +1,5 @@ /* * @creation 4 d\xE9c. 06 - * @modification $Date: 2007-06-11 13:07:05 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail de...@fu... @@ -11,9 +10,7 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.LineString; @@ -30,12 +27,15 @@ import org.fudaa.dodico.fortran.FileOpReadCharSimpleAbstract; /** - * Un reader pour un fichier Rubar (ST, ou CN). + * Un reader pour un fichier Rubar (.st qui contient des profils, ou .cn qui contient des courbes de niveau). Un fichier .m + * est identique en lecture \xE0 un fichier .st. + * * @author fred deniger, Bertrand Marchand - * @version $Id: RubarStReader.java,v 1.5 2007-06-11 13:07:05 deniger Exp $ + * @version $Id$ */ public class RubarStReader extends FileOpReadCharSimpleAbstract { + /** Le fichier est de type .st. */ boolean isSt_; public RubarStReader() { @@ -132,8 +132,9 @@ if (str != null) { lignes.add(str); pks.add(pk); + // Le nom par d\xE9faut correspond \xE0 la position de la g\xE9om\xE9trie dans le fichier. if ("".equals(name)) { - names.add(CtuluLib.getS(isSt_?"P":"N")+((GISGeometry)str).getId()); + names.add(CtuluLib.getS(isSt_?"P":"N")+(names.size()+1)); } else { names.add(name); @@ -141,16 +142,19 @@ } coordinatesEnCours.clear(); } - } catch (final EOFException _io) {} catch (final IOException _io) { + } + catch (final EOFException _io) {} + catch (final IOException _io) { analyze_.manageException(_io); - } catch (final NumberFormatException _if) { + } + catch (final NumberFormatException _if) { analyze_.manageException(_if, in_.getLineNumber()); } final LineString str = GISLib.createLineOrLinearFromList(coordinatesEnCours); if (str != null) { lignes.add(str); if ("".equals(name)) { - names.add(CtuluLib.getS("P")+((GISGeometry)str).getId()); + names.add(CtuluLib.getS(isSt_?"P":"N")+(names.size()+1)); } else { names.add(name); @@ -158,13 +162,23 @@ } GISZoneCollectionLigneBrisee[] ret=new GISZoneCollectionLigneBrisee[2]; - // Profils + + // Profils / Lignes de niveaux if (lignes.size() > 0) { final GISZoneCollectionLigneBrisee zligs = new GISZoneCollectionLigneBrisee(null); zligs.addAllLineStringClosedOrNode((LineString[]) lignes.toArray(new LineString[lignes.size()]), null); - zligs.setAttributes(new GISAttributeInterface[] { + + GISAttributeInterface[] attrs; + if (isSt_) + attrs=new GISAttributeInterface[] { + GISAttributeConstants.BATHY, GISAttributeConstants.TITRE, + GISAttributeConstants.NATURE, GISAttributeConstants.COMMENTAIRE_HYDRO}; + else + attrs=new GISAttributeInterface[] { GISAttributeConstants.BATHY, GISAttributeConstants.TITRE, - GISAttributeConstants.NATURE, GISAttributeConstants.COMMENTAIRE_HYDRO}, null); + GISAttributeConstants.NATURE}; + + zligs.setAttributes(attrs, null); if(zligs.getAttributeIsZ()==null) zligs.setAttributeIsZ(GISAttributeConstants.BATHY); zligs.postImport(0); @@ -175,16 +189,24 @@ attmod.setObject(i,attmod.getAttribute().createDataForGeom(names.get(i),1),null); } - // Affectation de l'attribut commentaire hydro. - attmod=zligs.getModel(GISAttributeConstants.COMMENTAIRE_HYDRO); - for (int i=0; i<pks.size(); i++) { - attmod.setObject(i,attmod.getAttribute().createDataForGeom(pks.get(i),1),null); + // Affectation de l'attribut commentaire hydro (uniquement ST) + if (isSt_) { + attmod=zligs.getModel(GISAttributeConstants.COMMENTAIRE_HYDRO); + for (int i=0; i<pks.size(); i++) { + attmod.setObject(i,attmod.getAttribute().createDataForGeom(pks.get(i),1),null); + } } // Affectation de l'attribut nature attmod=zligs.getModel(GISAttributeConstants.NATURE); + String nature; + if (isSt_) + nature=GISAttributeConstants.ATT_NATURE_PF; + else + nature=GISAttributeConstants.ATT_NATURE_CN; + for (int i=0; i<attmod.getSize(); i++) { - attmod.setObject(i,attmod.getAttribute().createDataForGeom(GISAttributeConstants.ATT_NATURE_PF,1),null); + attmod.setObject(i,attmod.getAttribute().createDataForGeom(nature,1),null); } ret[0]=zligs; } Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStReader.java ___________________________________________________________________ Added: svn:keywords + Id Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardImportHelper.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardImportHelper.java 2009-06-03 06:45:44 UTC (rev 4832) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardImportHelper.java 2009-06-03 09:32:41 UTC (rev 4833) @@ -35,7 +35,7 @@ /** * @author fred deniger - * @version $Id: FSigWizardImportHelper.java,v 1.1 2007-01-19 13:14:09 deniger Exp $ + * @version $Id$ */ public final class FSigWizardImportHelper { @@ -54,7 +54,7 @@ lay.setColumnXAlign(new float[] { 0f, 0f }); BuPanel line = new BuPanel(); line.setLayout(lay); - line.add(FSigGeomSrcDataUtils.buildLabeli18n("Nombre de lignes:")); + line.add(FSigGeomSrcDataUtils.buildLabeli18n("Nombre de lignes ouvertes:")); lbNbLines_=FSigGeomSrcDataUtils.buildLabel(""); line.add(lbNbLines_); line.add(FSigGeomSrcDataUtils.buildLabeli18n("Nombre de lignes ferm\xE9es:")); Property changes on: branches/FudaaModeleur_TC1Bis/fudaa_devel/fudaa/src/org/fudaa/fudaa/sig/wizard/FSigWizardImportHelper.java ___________________________________________________________________ Added: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |