|
From: <de...@us...> - 2010-11-05 23:29:00
|
Revision: 6031
http://fudaa.svn.sourceforge.net/fudaa/?rev=6031&view=rev
Author: deniger
Date: 2010-11-05 23:28:54 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/wizard/FSigDataModelSinusxAdapter.java
trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/wizard/FSigFileLoaderSinusX.java
Modified: trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/wizard/FSigDataModelSinusxAdapter.java
===================================================================
--- trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/wizard/FSigDataModelSinusxAdapter.java 2010-11-05 23:28:38 UTC (rev 6030)
+++ trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/wizard/FSigDataModelSinusxAdapter.java 2010-11-05 23:28:54 UTC (rev 6031)
@@ -33,18 +33,6 @@
public void preload(final GISAttributeInterface[] _att, final ProgressionInterface _prog) {}
- /**
- * @param _f le fichier a lire
- * @param _filterClass la classe a filtrer Point.class,LineString.class ou LinearRing
- * @param _impl l'implemenation parent
- * @param _progress la barre de progression
- * @return le model correspondant
- */
-// public static GISDataModel readSxFilePoly(final File _f, final Class _filterClass, final CtuluUI _impl,
-// final ProgressionInterface _progress) {
-// return readSxFilePoly(_f, _filterClass, _impl, _progress, null);
-// }
-
public Envelope getEnvelopeInternal() {
return GISLib.computeEnveloppe(geoms_);
}
@@ -64,19 +52,6 @@
public static GISDataModel analyseSxFile(final GISZone _zi, final boolean _isPointAccepted,
final boolean _isPolyligneAccepted, final boolean _isPolygoneAccepted, final ProgressionInterface _progress,
final FSigFileLoadResult _res) {
-// int ibloc=0;
-// final List res = new ArrayList(100);
-// // final TDoubleArrayList zAverage = new TDoubleArrayList(100);
-// final List z = new ArrayList();
-// final TIntArrayList numBloc=new TIntArrayList();
-// final GISAttributeDouble zAtt = (GISAttributeDouble) GISAttributeConstants.BATHY;
-// final GISAttributeInterface numBlocAtt=GISDataModelPointMultiPointAdapter.ATT_NUM_BLOC;
-// final GISAttribute nameAtt = GISAttributeConstants.TITRE;
-// if (_res != null) {
-// _res.allAttribute_.add(zAtt);
-// _res.allAttribute_.add(numBlocAtt);
-// _res.allAttribute_.add(nameAtt);
-// }
final GISZoneCollectionPolygone[] polygones = _zi.getPolygoneCollections();
// on parcourt les polygones
if (polygones != null && _isPolygoneAccepted) {
@@ -88,27 +63,6 @@
}
GISDataModel mdl=new GISDataModelMultiAdapter(polygones);
return mdl;
-// final int nbPolyg = polygones.length;
-// for (int j = 0; j < nbPolyg; j++) {
-// final GISZoneCollectionPolygone polyzj = polygones[j];
-// final int nbpoly = polyzj.getNumGeometries();
-// for (int k = 0; k < nbpoly; k++) {
-// final GISPolygone pk = (GISPolygone) polyzj.getGeometry(k);
-// res.add(pk);
-// if (_res != null) {
-// _res.nbPolygones_++;
-// _res.nbPointTotal_ += pk.getNumGeometries();
-// }
-// final CoordinateSequence seq = pk.getCoordinateSequence();
-// final GISAttributeModelDoubleArray zl = zAtt.createAtomicModelDouble(pk.getNumPoints());
-// for (int l = zl.getSize() - 1; l >= 0; l--) {
-// zl.set(l, seq.getOrdinate(l, 2));
-// }
-// z.add(zl);
-// numBloc.add(ibloc++);
-// }
-//
-// }
}
final GISZoneCollectionPolyligne[] polyligne = _zi.getPolyligneCollections();
// on parcourt les polygones
@@ -121,27 +75,6 @@
}
GISDataModel mdl=new GISDataModelMultiAdapter(polyligne);
return mdl;
-// final int nbLignes = polyligne.length;
-// for (int j = 0; j < nbLignes; j++) {
-// final GISZoneCollectionPolyligne lignes = polyligne[j];
-// final int nbpoly = lignes.getNumGeometries();
-// for (int k = 0; k < nbpoly; k++) {
-// final GISPolyligne pk = (GISPolyligne) lignes.getGeometry(k);
-// res.add(pk);
-// if (_res != null) {
-// _res.nbPolylignes_++;
-// _res.nbPointTotal_ += pk.getNumGeometries();
-// }
-// final CoordinateSequence seq = pk.getCoordinateSequence();
-// final double[] zl = new double[pk.getNumPoints()];
-// for (int l = zl.length - 1; l >= 0; l--) {
-// zl[l] = seq.getOrdinate(l, 2);
-// }
-// z.add(new GISAttributeModelDoubleArray(zl, zAtt));
-// numBloc.add(ibloc++);
-// }
-//
-// }
}
final GISZoneCollectionPoint[] pts = _zi.getPointCollections();
if (pts != null && _isPointAccepted) {
@@ -153,77 +86,12 @@
}
GISDataModel mdl=new GISDataModelMultiAdapter(pts);
return mdl;
-// final int nbPts = pts.length;
-// for (int j = 0; j < nbPts; j++) {
-// final GISZoneCollectionPoint lignes = pts[j];
-// final int nbpoly = lignes.getNumGeometries();
-// if (_res != null) {
-// _res.nbPoint_ += lignes.getNumPoints();
-// _res.nbPointTotal_ += lignes.getNumPoints();
-// }
-// for (int k = 0; k < nbpoly; k++) {
-// final Point pk = (Point) lignes.getGeometry(k);
-// res.add(pk);
-// z.add(CtuluLib.getDouble(pk.getCoordinateSequence().getOrdinate(0, 2)));
-// numBloc.add(ibloc);
-// }
-// ibloc++;
-// }
}
-// final FSigDataModelSinusxAdapter r = new FSigDataModelSinusxAdapter();
-// r.geoms_ = new Geometry[res.size()];
-// res.toArray(r.geoms_);
-// r.model_ = new GISAttributeModel[2];
-// r.model_[0] = new GISAttributeModelObjectList(z, zAtt);
-// r.model_[1] = new GISAttributeModelIntegerList(numBloc.toNativeArray(),numBlocAtt);
-// r.model_[2] = new GISAttributeModelObjectList(nameAtt);
-// return r;
return null;
}
-// public static GISDataModel analyseSinusxRes(final GISZone _zones, final Class _filterClass,
-// final ProgressionInterface _progress, final FSigFileLoadResult _res) {
-// // on part sur 100 objets
-// boolean isPolygoneAccepted = true;
-// boolean isPolyligneAccepted = true;
-// boolean isPointAccepted = true;
-// if (_filterClass != null) {
-// if (LineString.class.equals(_filterClass)) {
-// isPointAccepted = false;
-// } else if (LinearRing.class.equals(_filterClass)) {
-// isPointAccepted = false;
-// isPolyligneAccepted = false;
-// } else if (Point.class.equals(_filterClass)) {
-// isPolyligneAccepted = false;
-// isPolygoneAccepted = false;
-// }
-// }
-// return analyseSxFile(_zones, isPointAccepted, isPolyligneAccepted, isPolygoneAccepted, _progress, _res);
-//
-// }
- /**
- * @param _f
- * @param _impl
- * @param _progress
- * @return la source correspondante
- */
-// public static GISDataModel readSxFilePoly(final File _f, final Class _filterClass, final CtuluUI _impl,
-// final ProgressionInterface _progress, final FSigFileLoadResult _res) {
-// final CtuluIOOperationSynthese result = SinusxFileFormat.getInstance().read(_f, _progress);
-// // si erreur fatale on renvoie null
-// if (_impl.manageErrorOperationAndIsFatal(result)) {
-// return null;
-// }
-// final GISZone zones = (GISZone) result.getSource();
-// if (zones == null || zones.getNumGeometries() == 0) {
-// return null;
-// }
-// return analyseSinusxRes(zones, _filterClass, _progress, _res);
-//
-// }
-
public GISAttributeInterface getAttribute(final int _idxAtt) {
return model_ == null ? null : model_[_idxAtt].getAttribute();
}
Modified: trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/wizard/FSigFileLoaderSinusX.java
===================================================================
--- trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/wizard/FSigFileLoaderSinusX.java 2010-11-05 23:28:38 UTC (rev 6030)
+++ trunk/business/fudaa-sig/src/main/java/org/fudaa/fudaa/sig/wizard/FSigFileLoaderSinusX.java 2010-11-05 23:28:54 UTC (rev 6031)
@@ -53,9 +53,15 @@
public void setInResult(final FSigFileLoadResult _r, final File _f, final ProgressionInterface _prog,
final CtuluAnalyze _analyze) {
if (zones_ == null) {
- final CtuluIOOperationSynthese op = SinusxFileFormat.getInstance().read(_f, _prog);
+ CtuluIOOperationSynthese op=null;
+ try {
+ op = SinusxFileFormat.getInstance().read(_f, _prog);
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
_analyze.merge(op.getAnalyze());
- if (op.containsMessages() && op.getAnalyze().containsErrors()) {
+ if (op.containsFatalError()) {
return;
}
zones_ = (GISZone) op.getSource();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|