|
From: <de...@us...> - 2010-01-18 17:36:59
|
Revision: 5621
http://fudaa.svn.sourceforge.net/fudaa/?rev=5621&view=rev
Author: deniger
Date: 2010-01-18 17:36:44 +0000 (Mon, 18 Jan 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/export/TrExportOperationRefineInClosedLine.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/export/TrExportPanelFilterFactory.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostTimeModelSaver.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostUserVariableSaver.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/persist/TrPostSourceReplayPersist.java
trunk/soft/fudaa-prepro/ui/src/main/resources/org/fudaa/fudaa/tr/common/tr_en.fr_txt
Added Paths:
-----------
trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/export/TrExportOperationMeshesInClosedLine.java
Added: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/export/TrExportOperationMeshesInClosedLine.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/export/TrExportOperationMeshesInClosedLine.java (rev 0)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/export/TrExportOperationMeshesInClosedLine.java 2010-01-18 17:36:44 UTC (rev 5621)
@@ -0,0 +1,57 @@
+package org.fudaa.fudaa.tr.export;
+
+import com.vividsolutions.jts.geom.LinearRing;
+
+import org.fudaa.ctulu.CtuluListSelectionInterface;
+import org.fudaa.ctulu.ProgressionInterface;
+import org.fudaa.dodico.ef.EfGridData;
+import org.fudaa.dodico.ef.operation.EfIndexVisitorEltInRing;
+import org.fudaa.dodico.ef.operation.EfOperation;
+import org.fudaa.fudaa.meshviewer.export.MvExportOperationBuilderInterface;
+import org.fudaa.fudaa.meshviewer.export.MvExportSourceFilterActivity;
+import org.fudaa.fudaa.meshviewer.filter.MvFilterSelectedElement;
+import org.fudaa.fudaa.tr.data.TrVisuPanel;
+
+/**
+ *
+ * Permet d'exporter uniquement les elements appartenant a un polygone
+ * @author deniger
+ */
+public class TrExportOperationMeshesInClosedLine extends TrExportOperationOnClosedLineAbstract {
+ protected class Builder implements MvExportOperationBuilderInterface {
+
+ LinearRing line;
+ final EfGridData grid;
+ CtuluListSelectionInterface meshSelected;
+
+ private Builder(final LinearRing line, final EfGridData grid) {
+ super();
+ this.line = line;
+ this.grid = grid;
+ }
+
+ public void buildOperation(final ProgressionInterface progression) {
+ meshSelected = EfIndexVisitorEltInRing.findContainedElt(grid.getGrid(), line, true);
+
+ }
+
+ public EfOperation getOperation(final int tidx) {
+ return new MvExportSourceFilterActivity(grid, new MvFilterSelectedElement(meshSelected, grid.getGrid()));
+ }
+
+ public void stop() {
+
+ }
+
+ }
+
+ public TrExportOperationMeshesInClosedLine(final String title, final TrVisuPanel panel) {
+ super(title, panel);
+ }
+
+ @Override
+ public MvExportOperationBuilderInterface getBuilder(final EfGridData src) {
+ return new Builder((LinearRing) mvLineChooser.getSelectedLine(), src);
+ }
+
+}
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/export/TrExportOperationRefineInClosedLine.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/export/TrExportOperationRefineInClosedLine.java 2010-01-18 17:36:15 UTC (rev 5620)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/export/TrExportOperationRefineInClosedLine.java 2010-01-18 17:36:44 UTC (rev 5621)
@@ -1,22 +1,12 @@
package org.fudaa.fudaa.tr.export;
-import com.vividsolutions.jts.algorithm.CGAlgorithms;
-import com.vividsolutions.jts.algorithm.ConvexHull;
-import com.vividsolutions.jts.geom.Coordinate;
-import com.vividsolutions.jts.geom.Geometry;
-import com.vividsolutions.jts.geom.LineString;
import com.vividsolutions.jts.geom.LinearRing;
-import com.vividsolutions.jts.geom.Polygon;
-import org.fudaa.ctulu.CtuluLibArray;
import org.fudaa.ctulu.CtuluListSelectionInterface;
import org.fudaa.ctulu.ProgressionInterface;
-import org.fudaa.ctulu.gis.GISGeometryFactory;
-import org.fudaa.ctulu.gis.GISPolygone;
import org.fudaa.dodico.ef.EfGridData;
import org.fudaa.dodico.ef.operation.EfIndexVisitorEltInRing;
import org.fudaa.dodico.ef.operation.EfOperation;
-import org.fudaa.dodico.ef.operation.projection.EfOperationProjectionOrtho;
import org.fudaa.dodico.ef.operation.refine.EfOperationRefineEdge;
import org.fudaa.fudaa.meshviewer.export.MvExportOperationBuilderInterface;
import org.fudaa.fudaa.tr.data.TrVisuPanel;
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/export/TrExportPanelFilterFactory.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/export/TrExportPanelFilterFactory.java 2010-01-18 17:36:15 UTC (rev 5620)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/export/TrExportPanelFilterFactory.java 2010-01-18 17:36:44 UTC (rev 5621)
@@ -43,9 +43,11 @@
if (_hauteurFilter) {
item.add(new TrExportFilterItemHauteurTime(_timeSelection));
}
+ item.add(new TrExportOperationMeshesInClosedLine(TrResource
+ .getS("Exporter uniquement les \xE9l\xE9ments appartenant \xE0 un polygone"), visu));
item.add(new TrExportOperationRefineItem(TrResource.getS("Rafiner tout le maillage et exporter tout le maillage")));
item.add(new TrExportOperationRefineInClosedLine(TrResource
- .getS("Rafiner les \xE9l\xE9ments appartenant \xE0 une zone et exporter tout le maillage"), visu));
+ .getS("Rafiner les \xE9l\xE9ments appartenant\xE0 un polygone et exporter tout le maillage"), visu));
if (isSelection) {
item.add(new TrExportOperationRefineItem(TrResource
.getS("Rafiner uniquement les \xE9l\xE9ments s\xE9lectionn\xE9s et exporter tout le maillage"),
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostTimeModelSaver.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostTimeModelSaver.java 2010-01-18 17:36:15 UTC (rev 5620)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostTimeModelSaver.java 2010-01-18 17:36:44 UTC (rev 5621)
@@ -21,12 +21,17 @@
String expr_;
String fmtPattern_;
+ String fmtPattern__;
double[] savedTimeSteps_;
public TrPostTimeModelSaver() {
}
-
+ public void restoreFmtPattern(){
+ if(fmtPattern_==null && fmtPattern__!=null){
+ fmtPattern_=fmtPattern__;
+ }
+ }
public TrPostTimeModelSaver(final TrPostSource _src) {
final TrPostTimeModel model = _src.getTime();
expr_ = model.getUsedFormule();
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostUserVariableSaver.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostUserVariableSaver.java 2010-01-18 17:36:15 UTC (rev 5620)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/TrPostUserVariableSaver.java 2010-01-18 17:36:44 UTC (rev 5621)
@@ -41,10 +41,19 @@
TrPostDataCreatedSaver[] saver_;
Object g_;
+ //pour compatibilit\xE9 ascendante: certaine version dispose
+ Object g__;
public TrPostUserVariableSaver() {
}
+
+
+ public void restoreG(){
+ if(g_==null && g__!=null){
+ g_=g__;
+ }
+ }
public boolean isExprEmpty() {
return CtuluLibArray.isEmpty(varCreated_) || CtuluLibArray.isEmpty(expr_) || expr_.length != varCreated_.length;
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2010-01-18 17:36:15 UTC (rev 5620)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2010-01-18 17:36:44 UTC (rev 5621)
@@ -3,13 +3,16 @@
import java.awt.Dimension;
import java.awt.Point;
import java.io.File;
+import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
+import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
+import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -462,7 +465,7 @@
try {
- in = getParser().createObjectInputStream(new FileReader(file));
+ in = createObjectInputStream(file);
int nbFichiersToGenrate;
// -- lecture readme --//
@@ -653,8 +656,10 @@
for (int i = 0; i < listeVar.size(); i++) {
final TrPostUserVariableSaver var = listeVar.get(i);
final TrPostTimeModelSaver ptd = listePdt.get(i);
- out = getParser().createObjectOutputStream(
- new FileWriter(new File(dirForVar, "variables_" + listeCouplesIdSources.get(i).IdSource)));
+ XStream parser = getParser();
+ parser.omitField(TrPostUserVariableSaver.class, "g__");
+ out = parser.createObjectOutputStream(new FileWriter(new File(dirForVar, "variables_"
+ + listeCouplesIdSources.get(i).IdSource)));
out.writeObject(var);
out.writeObject(ptd);
out.close();
@@ -664,8 +669,10 @@
for (int i = 0; i < listeVarSuites.size(); i++) {
final TrPostUserVariableSaver var = listeVarSuites.get(i);
final TrPostTimeModelSaver ptd = listePdtSuites.get(i);
- out = getParser().createObjectOutputStream(
- new FileWriter(pathVariables + File.separator + "variables_" + listeSuiteCalcul.get(i).Id));
+ XStream parser = getParser();
+ parser.omitField(TrPostTimeModelSaver.class, "fmtPattern__");
+ out = parser.createObjectOutputStream(new FileWriter(pathVariables + File.separator + "variables_"
+ + listeSuiteCalcul.get(i).Id));
out.writeObject(var);
out.writeObject(ptd);
out.close();
@@ -692,7 +699,7 @@
// -- outputstream du xstream --//
ObjectInputStream in = null;
try {
- in = getParser().createObjectInputStream(new FileReader(file));
+ in = createObjectInputStream(file);
// -- recuperation du multiSourceActivator--//
final TrPostMultiSourceActivator2 multiProjectActivator = new TrPostMultiSourceActivator2(trprojet_);
@@ -763,21 +770,26 @@
}
}
- final List<TrPostSourceReplayPersist> lstReplay = (List<TrPostSourceReplayPersist>) in.readObject();
- CtuluAnalyze log = new CtuluAnalyze();
- if (lstReplay != null) {
- for (TrPostSourceReplayPersist srcReplay : lstReplay) {
- TrPostSource replay = srcReplay.replay(trprojet_, log);
- trprojet_.getSources().addSourceBuilt((TrPostSourceBuilt) replay);
+ Object readObject = in.readObject();
+ int nbSuitesCalcul = 0;
+ if (readObject instanceof List) {
+ final List<TrPostSourceReplayPersist> lstReplay = (List<TrPostSourceReplayPersist>) readObject;
+ CtuluAnalyze log = new CtuluAnalyze();
+ if (lstReplay != null) {
+ for (TrPostSourceReplayPersist srcReplay : lstReplay) {
+ TrPostSource replay = srcReplay.replay(trprojet_, log);
+ trprojet_.getSources().addSourceBuilt((TrPostSourceBuilt) replay);
+ }
}
+ if (!log.isEmpty()) {
+ trprojet_.getImpl().manageAnalyzeAndIsFatal(log);
+ }
+ nbSuitesCalcul = in.readInt();
+ } else {
+ // -- lecture nb suites de calcul pour les sources --//
+ nbSuitesCalcul = ((Integer) readObject).intValue();
}
- if (!log.isEmpty()) {
- trprojet_.getImpl().manageAnalyzeAndIsFatal(log);
- }
- // -- lecture nb suites de calcul pour les sources --//
- final int nbSuitesCalcul = in.readInt();
-
// -- lecture de la liste des objets source perssitant --//
if (nbSuitesCalcul > 0) {
final List<TrPostSourcePersistComposite> listeSuitesCalculs = (List<TrPostSourcePersistComposite>) in
@@ -816,10 +828,11 @@
if (fileVariables.canRead()) {
ObjectInputStream in = null;
try {
- in = getParser().createObjectInputStream(new FileReader(fileVariables));
+ in = createObjectInputStream(fileVariables);
Object var = in.readObject();
if (var instanceof TrPostUserVariableSaver) {
final TrPostUserVariableSaver varUser = (TrPostUserVariableSaver) var;
+ varUser.restoreG();
final CtuluAnalyze restore = varUser.restore(src, new CtuluAnalyze(), prog, ui_, trprojet_.getSources());
if (restore != null && restore.containsErrors()) {
ui_.manageAnalyzeAndIsFatal(restore);
@@ -829,6 +842,7 @@
var = in.readObject();
if (var instanceof TrPostTimeModelSaver) {
final TrPostTimeModelSaver varUser = (TrPostTimeModelSaver) var;
+ varUser.restoreFmtPattern();
varUser.restore(src, ui_.createProgressionForMainPanel(), true);
}
@@ -1002,7 +1016,7 @@
// -- outputstream du xstream --//
ObjectInputStream in = null;
try {
- in = getParser().createObjectInputStream(new FileReader(file));
+ in = createObjectInputStream(file);
// --readme --//
final Object debuTfichier = in.readObject();
if (debuTfichier instanceof XmlCommentaire) {
@@ -1010,23 +1024,30 @@
} else {
liste = (List<CoupleNomId>) debuTfichier;
}
- } catch (final IOException e) {
- e.printStackTrace();
- } catch (final ClassNotFoundException e) {
- e.printStackTrace();
+ } catch (final Exception e) {
+ FuLog.error(e);
} finally {
try {
in.close();
- return liste;
} catch (final IOException e) {
e.printStackTrace();
messageError(false);
}
}
- return null;
+ return liste;
}
+ private ObjectInputStream createObjectInputStream(final File file) throws IOException, FileNotFoundException {
+ XStream parser = getParser();
+ return createObjectInpuStream(file, parser);
+ }
+
+ private ObjectInputStream createObjectInpuStream(final File file, XStream parser) throws IOException,
+ FileNotFoundException {
+ return parser.createObjectInputStream(new InputStreamReader(new FileInputStream(file),Charset.forName("UTF-8")));
+ }
+
/**
* Methode qui charge le projet,l'ensemble des sources et toutes les widgets dans les layouts.
*
@@ -1314,7 +1335,7 @@
// -- inputstream du xstream --//
ObjectInputStream in = null;
try {
- in = getParser().createObjectInputStream(new FileReader(file));
+ in = createObjectInputStream(file);
// -- r\xE9cup\xE9ration de la scene xml --//
final EbliSceneSerializeXml sceneXml = (EbliSceneSerializeXml) in.readObject();
Modified: trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/persist/TrPostSourceReplayPersist.java
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/persist/TrPostSourceReplayPersist.java 2010-01-18 17:36:15 UTC (rev 5620)
+++ trunk/soft/fudaa-prepro/ui/src/main/java/org/fudaa/fudaa/tr/post/persist/TrPostSourceReplayPersist.java 2010-01-18 17:36:44 UTC (rev 5621)
@@ -4,6 +4,10 @@
import org.fudaa.fudaa.tr.post.TrPostProjet;
import org.fudaa.fudaa.tr.post.TrPostSource;
+/**
+ * @author deniger
+ *
+ */
public interface TrPostSourceReplayPersist {
public abstract TrPostSource replay(TrPostProjet projet, CtuluAnalyze log);
Modified: trunk/soft/fudaa-prepro/ui/src/main/resources/org/fudaa/fudaa/tr/common/tr_en.fr_txt
===================================================================
--- trunk/soft/fudaa-prepro/ui/src/main/resources/org/fudaa/fudaa/tr/common/tr_en.fr_txt 2010-01-18 17:36:15 UTC (rev 5620)
+++ trunk/soft/fudaa-prepro/ui/src/main/resources/org/fudaa/fudaa/tr/common/tr_en.fr_txt 2010-01-18 17:36:44 UTC (rev 5621)
@@ -1,11 +1,12 @@
Afficher les \xE9volutions temporelles dans une nouvelle fen\xEAtre=Display time evolutions in a new frame
+Exporter uniquement les \xE9l\xE9ments appartenant \xE0 un polygone=Export meshes contained by a linear ring
Extraire le maillage et projeter sur le polygone=Filter Grid and project on a polygon
Raffiner uniquement les \xE9l\xE9ments compl\xE8tement mouill\xE9s=Ignore partially dry meshes
Exporter uniquement les \xE9l\xE9ments compl\xE8tement mouill\xE9s=Export only complete wet meshes
Exporter uniquement les \xE9l\xE9ments mouill\xE9s=Export only wet meshes
Rafiner tout le maillage et exporter tout le maillage=Refine the complete grid and export it
Rafiner uniquement les \xE9l\xE9ments s\xE9lectionn\xE9s et exporter tout le maillage=Refine only selected meshes and export the complete grid
-Rafiner les \xE9l\xE9ments appartenant \xE0 une zone et exporter tout le maillage=Refine only meshes contained by a linear ring and export the complete grid
+Rafiner les \xE9l\xE9ments appartenant\xE0 un polygone et exporter tout le maillage=Refine only meshes contained by a linear ring and export the complete grid
Rafiner uniquement les \xE9l\xE9ments mouill\xE9s et exporter tout le maillage=Refine only wet meshes and export the complete grid
La valeur utilis\xE9e pour la hauteur n'est pas valide=The value used the depth is not valid
Choisir une ligne ferm\xE9e=Choose a linear ring
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|