From: <bma...@us...> - 2008-10-24 16:16:07
|
Revision: 4094 http://fudaa.svn.sourceforge.net/fudaa/?rev=4094&view=rev Author: bmarchan Date: 2008-10-24 16:15:52 +0000 (Fri, 24 Oct 2008) Log Message: ----------- Correction position nom des lignes directrices. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java 2008-10-24 15:53:49 UTC (rev 4093) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java 2008-10-24 16:15:52 UTC (rev 4094) @@ -102,7 +102,9 @@ for (int il=0; il<idxline.size(); il++) { if (attNameLines==-1 || (name=(String)lines.getValue(attNameLines,idxline.get(il)))==null || name.length()>3) name="D"+idxline.get(il); + writer.setSpaceBefore(false); writer.stringField(4, name); + writer.setSpaceBefore(true); writer.stringField(3, ""); writer.stringField(2, numbFmt.format(str.getOrdinate(k, 2))); writer.stringField(1, numbFmt.format(str.getOrdinate(k, 1))); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <emm...@us...> - 2009-01-27 16:39:02
|
Revision: 4411 http://fudaa.svn.sourceforge.net/fudaa/?rev=4411&view=rev Author: emmanuel_martin Date: 2009-01-27 16:38:58 +0000 (Tue, 27 Jan 2009) Log Message: ----------- Tache #159 : "Export d'un fichier .st : Ajouter le nombre de points dans l'entete de chaque profil" Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java 2009-01-27 15:46:01 UTC (rev 4410) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java 2009-01-27 16:38:58 UTC (rev 4411) @@ -81,20 +81,20 @@ for (int i = 0; i < profs_.getNumGeometries(); i++) { HashMap<Integer,ArrayList<Integer>> pts2ld=bldirs?pts2lds_[i]:null; String name; + final CoordinateSequence str = ((LineString) profs_.getGeometry(i)).getCoordinateSequence(); if (isSt_) { if (attName==-1||(name=(String)profs_.getValue(attName, i))==null) name=""; writer.setSpaceBefore(false); writer.stringField(6, name); writer.stringField(5, ""); writer.doubleField(4, 0); - writer.intField(3, 0); + writer.intField(3, str.size()); writer.intField(2, 0); writer.intField(1, 0); writer.intField(0, i+1); writer.writeFields(fmtEntete); writer.setSpaceBefore(true); } - final CoordinateSequence str = ((LineString) profs_.getGeometry(i)).getCoordinateSequence(); for (int k = 0; k < str.size(); k++) { // Un m\xEAme point de profil peut \xEAtre partag\xE9 par plusieurs lignes directrices => On duplique ce point. ArrayList<Integer> idxline=bldirs?pts2ld.get(k):null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2009-03-16 09:36:57
|
Revision: 4546 http://fudaa.svn.sourceforge.net/fudaa/?rev=4546&view=rev Author: bmarchan Date: 2009-03-16 09:36:48 +0000 (Mon, 16 Mar 2009) Log Message: ----------- Correction pour limiter la taille des noms de profils Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java 2009-03-13 20:15:10 UTC (rev 4545) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java 2009-03-16 09:36:48 UTC (rev 4546) @@ -87,6 +87,7 @@ final CoordinateSequence str = ((LineString) profs_.getGeometry(i)).getCoordinateSequence(); if (isSt_) { if (attName==-1||(name=(String)profs_.getValue(attName, i))==null) name=""; + name=name.substring(0,Math.min(name.length(),42)); // PK, issu du commentaire hydrualique. if (attPk!=-1) { pk=GISLib.getHydroCommentDouble((String)profs_.getValue(attPk, i),RubarStCnFileFormat.COMM_HYDRO_PK); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2009-05-06 07:55:58
|
Revision: 4728 http://fudaa.svn.sourceforge.net/fudaa/?rev=4728&view=rev Author: bmarchan Date: 2009-05-06 07:55:48 +0000 (Wed, 06 May 2009) Log Message: ----------- Correction message d'export de fichier Rubar ST. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java 2009-05-05 20:58:16 UTC (rev 4727) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java 2009-05-06 07:55:48 UTC (rev 4728) @@ -168,6 +168,8 @@ analyze_.addError(CtuluLib.getS("Le nombre de points sur les lignes directrices doit \xEAtre \xE9gal au nombre de profils"), 0); } if (analyze_.containsErrors()) return false; + + int attNameLines=ldirs.getIndiceOf(GISAttributeConstants.TITRE); List<Integer> ordProfs=new ArrayList<Integer>(profs_.getNumGeometries()); CoordinateSequence firstLine=((LineString)ldirs.getGeometry(0)).getCoordinateSequence(); @@ -190,7 +192,11 @@ } } } - analyze_.addError(CtuluLib.getS("Les lignes directrices ne sont probablement pas connect\xE9es aux profils"), 0); + String name; + if (attNameLines==-1) name=""+0; + else name=(String)ldirs.getValue(attNameLines,0); + analyze_.addError( + CtuluLib.getS("La ligne directrice {0} n'est pas connect\xE9e \xE0 un profil au sommet {1}",name,""+(i+1)), 0); return false; } @@ -225,7 +231,6 @@ continue NEXT_LD; } } - int attNameLines=ldirs.getIndiceOf(GISAttributeConstants.TITRE); String name; if (attNameLines==-1) name=""+j; else name=(String)ldirs.getValue(attNameLines,j); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2009-06-08 13:07:51
|
Revision: 4855 http://fudaa.svn.sourceforge.net/fudaa/?rev=4855&view=rev Author: bmarchan Date: 2009-06-08 13:07:43 +0000 (Mon, 08 Jun 2009) Log Message: ----------- BugFix : Le nom des lignes directrices est cod?\195?\169 de Axx ?\195?\160 Zxx a l'export d'un fichier ST. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java 2009-06-08 09:52:41 UTC (rev 4854) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java 2009-06-08 13:07:43 UTC (rev 4855) @@ -18,6 +18,8 @@ import org.fudaa.ctulu.CtuluNumberFormatI; import org.fudaa.ctulu.fileformat.FortranLib; import org.fudaa.ctulu.gis.GISAttributeConstants; +import org.fudaa.ctulu.gis.GISAttributeInterface; +import org.fudaa.ctulu.gis.GISAttributeString; import org.fudaa.ctulu.gis.GISDataModel; import org.fudaa.ctulu.gis.GISDataModelFilterAdapter; import org.fudaa.ctulu.gis.GISLib; @@ -41,6 +43,8 @@ HashMap<Integer,ArrayList<Integer>>[] pts2lds_=null; /** Le mod\xE8le de profils, une fois r\xE9ordonn\xE9, ou identique si non r\xE9ordonn\xE9. */ GISDataModel profs_=null; + /** Le nom des lignes directrices, une fois control\xE9es et modifi\xE9es. */ + List<String> ldirnames_=new ArrayList<String>(); /** Le fichier est de type ST */ boolean isSt_; @@ -86,7 +90,7 @@ final int attName=profs_.getIndiceOf(GISAttributeConstants.TITRE); final int attPk=profs_.getIndiceOf(GISAttributeConstants.COMMENTAIRE_HYDRO); - final int attNameLines=bldirs?lines.getIndiceOf(GISAttributeConstants.TITRE):-1; +// final int attNameLines=bldirs?lines.getIndiceOf(GISAttributeConstants.TITRE):-1; final int[] fmtEntete = new int[] { 6, 6, 6, 6, 13, 1, 42 }; final int[] fmt = new int[] { 13, 13, 13, 1, 3 }; @@ -124,8 +128,9 @@ ArrayList<Integer> idxline=bldirs?pts2ld.get(k):null; if (idxline!=null) { for (int il=0; il<idxline.size(); il++) { - if (attNameLines==-1 || (name=(String)lines.getValue(attNameLines,idxline.get(il)))==null || - name.length()>3) name="D"+idxline.get(il); +// if (attNameLines==-1 || (name=(String)lines.getValue(attNameLines,idxline.get(il)))==null || +// name.length()>3) name="D"+idxline.get(il); + name=ldirnames_.get(idxline.get(il)); writer.setSpaceBefore(false); writer.stringField(4, name); writer.setSpaceBefore(true); @@ -267,6 +272,39 @@ return false; } } + + // Suppression des noms de lignes directrices dont le nom est sup\xE9rieur \xE0 3 caract\xE8res ou redondant. + String name; + for (int j=0; j<ldirs.getNumGeometries(); j++) { + if (attNameLines==-1 || + (name=(String)ldirs.getValue(attNameLines,j))==null || + name.length()>3 || + ldirnames_.indexOf(name)!=-1) { + ldirnames_.add(null); + } + else { + ldirnames_.add(name); + } + } + + // Ajout de noms de lignes conformes. + int idir=0; + char init='A'; + init--; + + for (int j=0; j<ldirs.getNumGeometries(); j++) { + if (ldirnames_.get(j)==null) { + do { + if (idir%100==0) + init++; + name=""+init+(idir%100); + idir++; + } + while (ldirnames_.indexOf(name)!=-1); + ldirnames_.set(j,name); + } + } + if (analyze_.containsErrors()) return false; return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2009-06-10 20:53:42
|
Revision: 4867 http://fudaa.svn.sourceforge.net/fudaa/?rev=4867&view=rev Author: bmarchan Date: 2009-06-10 20:53:17 +0000 (Wed, 10 Jun 2009) Log Message: ----------- Progressbar sur ecriture rubar st Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java 2009-06-10 16:29:47 UTC (rev 4866) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java 2009-06-10 20:53:17 UTC (rev 4867) @@ -16,6 +16,7 @@ import org.fudaa.ctulu.CtuluLib; import org.fudaa.ctulu.CtuluLibGeometrie; import org.fudaa.ctulu.CtuluNumberFormatI; +import org.fudaa.ctulu.ProgressionUpdater; import org.fudaa.ctulu.fileformat.FortranLib; import org.fudaa.ctulu.gis.GISAttributeConstants; import org.fudaa.ctulu.gis.GISAttributeInterface; @@ -60,6 +61,8 @@ * [1] : le modele de lignes directrices (ou null ou de longeur 0 si aucune ligne directrice). */ protected void internalWrite(final Object _o) { + ProgressionUpdater up=new ProgressionUpdater(progress_); + if (!(_o instanceof GISDataModel[]) || ((GISDataModel[])_o).length!=2) { donneesInvalides(_o); return; @@ -84,7 +87,7 @@ } // Si pb avec les lignes directrices => Pas d'\xE9criture de fichier. - if (!prepareWrite((GISDataModel[])_o)) return; + if (!prepareWrite((GISDataModel[])_o,up)) return; // profs_ = ((GISDataModel[])_o)[0]; @@ -100,7 +103,10 @@ final String sep = "999.999"; try { - for (int i = 0; i < profs_.getNumGeometries(); i++) { + int nb=profs_.getNumGeometries(); + up.setValue(50, nb, 50, 50); + + for (int i = 0; i <nb ; i++) { HashMap<Integer,ArrayList<Integer>> pts2ld=bldirs?pts2lds_[i]:null; String name; double pk=0; @@ -152,7 +158,8 @@ writer.stringField(1, sep); writer.stringField(0, sep); writer.writeFields(fmt); - + + up.majAvancement(); } int nbprofs=profs_.getNumGeometries(); @@ -177,9 +184,10 @@ * lignes directrices. D\xE9finit les liens entre les points des profils et des lignes directrices eventuelles.<p> * * @param _mdls Les mod\xE8les de lignes directrices et profils. + * @param _up L'updater pour la progression * @return true si ok. */ - private boolean prepareWrite(GISDataModel[] _mdls) { + private boolean prepareWrite(GISDataModel[] _mdls, ProgressionUpdater _up) { GISDataModel ldirs=_mdls[1]; pts2lds_=null; @@ -206,6 +214,8 @@ List<Integer> ordProfs=new ArrayList<Integer>(profs_.getNumGeometries()); CoordinateSequence firstLine=((LineString)ldirs.getGeometry(0)).getCoordinateSequence(); + _up.setValue(50, firstLine.size(), 0, 30); + // On r\xE9ordonne les profils suivant la 1ere ligne directrice. NEXT_LD_COORD: for (int i=0; i<firstLine.size(); i++) { @@ -221,6 +231,7 @@ double z2=seq.getOrdinate(k,CoordinateSequence.Z); if (CtuluLibGeometrie.getDistance3D(x1,y1,z1,x2,y2,z2)<1.E-6) { ordProfs.add(j); + _up.majAvancement(); continue NEXT_LD_COORD; } } @@ -237,6 +248,8 @@ for (int i=0; i<iprofs.length; i++) iprofs[i]=ordProfs.get(i).intValue(); profs_=GISDataModelFilterAdapter.buildAdapter(profs_, null, iprofs); + _up.setValue(50, profs_.getNumGeometries(), 30, 20); + // Les profils sont r\xE9ordonn\xE9s => On associe un index de ligne directrice aux points qui en contiennent. pts2lds_=new HashMap[profs_.getNumGeometries()]; for (int i=0; i<profs_.getNumGeometries(); i++) { @@ -261,6 +274,7 @@ pts2lds_[i].put(k,idxlines); } idxlines.add(j); + _up.majAvancement(); continue NEXT_LD; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bma...@us...> - 2009-09-03 11:02:31
|
Revision: 5071 http://fudaa.svn.sourceforge.net/fudaa/?rev=5071&view=rev Author: bmarchan Date: 2009-09-03 11:02:12 +0000 (Thu, 03 Sep 2009) Log Message: ----------- Fix MODELEUR-2 : Pb d'export rubar ST nombre de points incorrect. Modified Paths: -------------- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java Modified: branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java =================================================================== --- branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java 2009-09-02 11:40:01 UTC (rev 5070) +++ branches/FudaaModeleur_TC1Bis/fudaa_devel/dodico/src/org/fudaa/dodico/rubar/io/RubarStWriter.java 2009-09-03 11:02:12 UTC (rev 5071) @@ -58,7 +58,7 @@ * Ecrit les profils et les lignes directrices. * param _o Un tableau GISDataModel[2]. * [0] : le modele des profils (ou null si aucun profil), - * [1] : le modele de lignes directrices (ou null ou de longeur 0 si aucune ligne directrice). + * [1] : le modele de lignes directrices (ou null ou de longueur 0 si aucune ligne directrice). */ protected void internalWrite(final Object _o) { ProgressionUpdater up=new ProgressionUpdater(progress_); @@ -88,12 +88,9 @@ // Si pb avec les lignes directrices => Pas d'\xE9criture de fichier. if (!prepareWrite((GISDataModel[])_o,up)) return; - -// profs_ = ((GISDataModel[])_o)[0]; - + final int attName=profs_.getIndiceOf(GISAttributeConstants.TITRE); final int attPk=profs_.getIndiceOf(GISAttributeConstants.COMMENTAIRE_HYDRO); -// final int attNameLines=bldirs?lines.getIndiceOf(GISAttributeConstants.TITRE):-1; final int[] fmtEntete = new int[] { 6, 6, 6, 6, 13, 1, 42 }; final int[] fmt = new int[] { 13, 13, 13, 1, 3 }; @@ -112,17 +109,28 @@ double pk=0; final CoordinateSequence str = ((LineString) profs_.getGeometry(i)).getCoordinateSequence(); if (isSt_) { + if (attName==-1||(name=(String)profs_.getValue(attName, i))==null) name=""; name=name.substring(0,Math.min(name.length(),42)); // PK, issu du commentaire hydrualique. if (attPk!=-1) { pk=GISLib.getHydroCommentDouble((String)profs_.getValue(attPk, i),RubarStCnFileFormat.COMM_HYDRO_PK); } + // Nombre de points => On tient compte des points dupliqu\xE9s car partag\xE9s par plusieurs lignes directrices. + int nbpt=0; + for (int k=0; k<str.size(); k++) { + ArrayList<Integer> idxline=bldirs ? pts2ld.get(k):null; + if (idxline!=null) + nbpt+=idxline.size(); + else + nbpt+=1; + } + writer.setSpaceBefore(false); writer.stringField(6, name); writer.stringField(5, ""); writer.doubleField(4, pk); - writer.intField(3, str.size()); + writer.intField(3, nbpt); writer.intField(2, 0); writer.intField(1, 0); writer.intField(0, i+1); @@ -134,8 +142,6 @@ ArrayList<Integer> idxline=bldirs?pts2ld.get(k):null; if (idxline!=null) { for (int il=0; il<idxline.size(); il++) { -// if (attNameLines==-1 || (name=(String)lines.getValue(attNameLines,idxline.get(il)))==null || -// name.length()>3) name="D"+idxline.get(il); name=ldirnames_.get(idxline.get(il)); writer.setSpaceBefore(false); writer.stringField(4, name); @@ -269,10 +275,21 @@ double z2=seqprof.getOrdinate(k,CoordinateSequence.Z); if (CtuluLibGeometrie.getDistance3D(x1,y1,z1,x2,y2,z2)<1.E-6) { ArrayList<Integer> idxlines=pts2lds_[i].get(k); + // Pas encore de ligne directrice associ\xE9. if (idxlines==null) { idxlines=new ArrayList<Integer>(); pts2lds_[i].put(k,idxlines); } + // Si une ligne directrice au moins est d\xE9j\xE0 associ\xE9e au pt courant et que le pt d'apr\xE8s a m\xEAmes + // coordonn\xE9es, on passe le pt courant. Ceci dans le but d'eviter la duplication de points. + else if (k<seqprof.size()-1) { + x2=seqprof.getOrdinate(k+1,CoordinateSequence.X); + y2=seqprof.getOrdinate(k+1,CoordinateSequence.Y); + z2=seqprof.getOrdinate(k+1,CoordinateSequence.Z); + if (CtuluLibGeometrie.getDistance3D(x1,y1,z1,x2,y2,z2)<1.E-6) { + continue; + } + } idxlines.add(j); _up.majAvancement(); continue NEXT_LD; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |