|
From: <de...@us...> - 2013-01-21 09:38:47
|
Revision: 8229
http://fudaa.svn.sourceforge.net/fudaa/?rev=8229&view=rev
Author: deniger
Date: 2013-01-21 09:38:40 +0000 (Mon, 21 Jan 2013)
Log Message:
-----------
Modified Paths:
--------------
trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/MdlVisuPanel.java
trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/action/CalqueCreateGridAction.java
trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/grid/AbstractCalqueCreateGridProcessor.java
trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/grid/CalqueCreateGridPoly2TriProcessor.java
trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/grid/CalqueCreateGridTriangleProcessor.java
trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/grid/GridChooseToolAndContourConvexHullPanel.java
Modified: trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/MdlVisuPanel.java
===================================================================
--- trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/MdlVisuPanel.java 2013-01-21 09:38:14 UTC (rev 8228)
+++ trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/MdlVisuPanel.java 2013-01-21 09:38:40 UTC (rev 8229)
@@ -141,11 +141,20 @@
return cqAlti_;
}
+ public BGroupeCalque getGroupSing() {
+ return cqSing_;
+ }
+
public List<BCalque> getCalquesContours() {
BCalque[] calques = cqSing_.getCalques();
return findCalques(calques, MdlLayer2dContour.EXT_NAME);
}
+ public List<BCalque> getCalquesContraintes() {
+ BCalque[] calques = cqSing_.getCalques();
+ return findCalques(calques, MdlLayer2dConstraintLine.EXT_NAME);
+ }
+
public List<BCalque> findCalques(BCalque[] in, String extName) {
List<BCalque> res = new ArrayList<BCalque>();
if (in != null) {
Modified: trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/action/CalqueCreateGridAction.java
===================================================================
--- trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/action/CalqueCreateGridAction.java 2013-01-21 09:38:14 UTC (rev 8228)
+++ trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/action/CalqueCreateGridAction.java 2013-01-21 09:38:40 UTC (rev 8229)
@@ -83,7 +83,7 @@
//le panneau permet de choisir le triangulateur et le calque contour.
final GridChooseToolAndContourConvexHullPanel panel = new GridChooseToolAndContourConvexHullPanel(visuPanel);
boolean ok = panel.afficheModaleOk(editor.getUi().getParentComponent(), MdlResource.getS("Selectionner le calque de contour"));
- final MdlLayer2dContour finalContourLayer = (MdlLayer2dContour) panel.getSelectedLayer();
+ final MdlLayer2dContour finalContourLayer = (MdlLayer2dContour) panel.getSelectedContourLayer();
if (ok) {
layer.getLayerGridDelegate().clearGrid();
ok = checkParameters(finalContourLayer, editor, panel);
@@ -203,13 +203,16 @@
public void run() {
eps = panel.getEps();
final LinearRing finalConvexHull = panel.getSelectedConvexHull();
- final MdlLayer2dContour finalContourLayer = (MdlLayer2dContour) panel.getSelectedLayer();
+ final MdlLayer2dContour finalContourLayer = (MdlLayer2dContour) panel.getSelectedContourLayer();
if (panel.isTriangleSelected()) {
processor = new CalqueCreateGridTriangleProcessor(layer.modeleDonnees(), getUI(), finalContourLayer, finalConvexHull);
} else {
processor = new CalqueCreateGridPoly2TriProcessor(layer.modeleDonnees(), getUI(), finalContourLayer, finalConvexHull);
}
processor.setEps(eps);
+ processor.setContraintLines(panel.getSelectedContrainteLayer());
+ processor.setUseHole(panel.isUseHoleIsSelected());
+ processor.setAddPointOnFrontier(panel.isAddPointOnFrontierSelected());
//TODO boolean
//on execute la triangulation et on lit le maillage
final EfGridInterface grid = processor.process(progression);
Modified: trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/grid/AbstractCalqueCreateGridProcessor.java
===================================================================
--- trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/grid/AbstractCalqueCreateGridProcessor.java 2013-01-21 09:38:14 UTC (rev 8228)
+++ trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/grid/AbstractCalqueCreateGridProcessor.java 2013-01-21 09:38:40 UTC (rev 8229)
@@ -6,13 +6,16 @@
import com.vividsolutions.jts.algorithm.SIRtreePointInRing;
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 java.util.Arrays;
+import java.util.ArrayList;
import java.util.List;
+import org.apache.commons.lang.ArrayUtils;
import org.fudaa.ctulu.CtuluUI;
import org.fudaa.ctulu.ProgressionInterface;
import org.fudaa.ctulu.gis.GISLib;
import org.fudaa.ctulu.gis.GISVisitorGeometryCollector;
+import org.fudaa.ctulu.gis.GISZoneCollectionLigneBrisee;
import org.fudaa.ctulu.gis.GisZoneCollectionAsListPointAdapter;
import org.fudaa.ctulu.gis.process.GisZoneCollectionPointDoublonRemover;
import org.fudaa.ctulu.gis.process.PointsMapping;
@@ -30,10 +33,13 @@
protected final CtuluUI ui;
protected final ZCalqueLigneBrisee contour;
+ protected ZCalqueLigneBrisee contraintLayer;
protected final LinearRing convexHull;
protected double eps = 1e-3;
private final GisZoneCollectionAsListPointAdapter pointsAdapter;
private PointsMapping pointsMapping;
+ private boolean useHole;
+ protected boolean addPointOnFrontier;
public AbstractCalqueCreateGridProcessor(ZModeleMultiPoint points, CtuluUI ui, ZCalqueLigneBrisee contour, LinearRing convexHull) {
this.ui = ui;
@@ -42,6 +48,14 @@
this.pointsAdapter = new GisZoneCollectionAsListPointAdapter(points.getGeomData());
}
+ public void setUseHole(boolean useHole) {
+ this.useHole = useHole;
+ }
+
+ public void setAddPointOnFrontier(boolean addPointOnFrontier) {
+ this.addPointOnFrontier = addPointOnFrontier;
+ }
+
public PointsMapping getPointsMapping() {
return pointsMapping;
}
@@ -54,7 +68,6 @@
this.eps = epsForDoublon;
}
-
@Override
public final void setProcess(Process _p) {
this.p = _p;
@@ -95,29 +108,64 @@
return pointsMapping;
}
+ private boolean isNoPolygoneSelected() {
+ return contour == null || (contour.modeleDonnees().getNbPolygone() == 0) || (convexHull == null && !useHole);
+ }
+
+ private boolean isNoConstraintLineSelected() {
+ return contraintLayer == null || (contraintLayer.modeleDonnees().getNombre() == 0);
+ }
+
+ protected boolean isNoLinesSelected() {
+ return isNoPolygoneSelected() && isNoConstraintLineSelected();
+ }
+
+ public boolean isPolygoneSelected() {
+ return !isNoPolygoneSelected();
+ }
+
public final TriangulationPolyDataNodeDefault createPolyData(ProgressionInterface prog) {
TriangulationPolyDataNodeDefault data = new TriangulationPolyDataNodeDefault();
+ List<LineString> lines = new ArrayList<LineString>();
+ List<Boolean> holes = new ArrayList<Boolean>();
if (contour != null) {
- GISVisitorGeometryCollector collector = new GISVisitorGeometryCollector(GISLib.MASK_POLYGONE);
- contour.modeleDonnees().getGeomData().accept(collector);
- List<Geometry> geometries = collector.getGeometries();
- LinearRing[] linearRings = (LinearRing[]) geometries.toArray(new LinearRing[geometries.size()]);
- boolean[] holes = new boolean[linearRings.length];
- Arrays.fill(holes, true);
if (convexHull != null) {
- for (int i = 0; i < holes.length; i++) {
- if (linearRings[i] == convexHull) {//test voulu.
- holes[i] = false;
+ lines.add(convexHull);
+ holes.add(Boolean.FALSE);
+ }
+ if (useHole) {
+ GISVisitorGeometryCollector collector = new GISVisitorGeometryCollector(GISLib.MASK_POLYGONE);
+ contour.modeleDonnees().getGeomData().accept(collector);
+ List<Geometry> geometries = collector.getGeometries();
+ LinearRing[] linearRings = (LinearRing[]) geometries.toArray(new LinearRing[geometries.size()]);
+ for (int i = 0; i < linearRings.length; i++) {
+ LinearRing linearRing = linearRings[i];
+ if (linearRing != convexHull) {
+ lines.add(linearRing);
+ holes.add(Boolean.TRUE);
}
}
}
- data.setHoles(holes);
- data.setRings(linearRings);
}
+ if (contraintLayer != null) {
+ GISZoneCollectionLigneBrisee linesCollection = contraintLayer.modeleDonnees().getGeomData();
+ for (int i = 0; i < linesCollection.getNumGeometries(); i++) {
+ lines.add((LineString) linesCollection.getGeometry(i));
+ holes.add(Boolean.FALSE);
+ }
+ }
+ LineString[] lineStrings = (LineString[]) lines.toArray(new LineString[lines.size()]);
+ Boolean[] holesInBoolean = (Boolean[]) holes.toArray(new Boolean[holes.size()]);
+ data.setLineString(lineStrings);
+ data.setHoles(ArrayUtils.toPrimitive(holesInBoolean));
PointsMapping filteredPoints = createMapping(prog);
data.setNodeData(filteredPoints);
data.setUseZAsAttribute(false);
return data;
}
+
+ public void setContraintLines(ZCalqueLigneBrisee selectedContrainteLayer) {
+ this.contraintLayer = selectedContrainteLayer;
+ }
}
Modified: trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/grid/CalqueCreateGridPoly2TriProcessor.java
===================================================================
--- trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/grid/CalqueCreateGridPoly2TriProcessor.java 2013-01-21 09:38:14 UTC (rev 8228)
+++ trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/grid/CalqueCreateGridPoly2TriProcessor.java 2013-01-21 09:38:40 UTC (rev 8229)
@@ -58,7 +58,7 @@
ProgressionUpdater updater = new ProgressionUpdater(prog);
updater.majProgessionStateOnly(MdlResource.getS("Construction des donn\xE9es d'entr\xE9e"));
- if (data.getNbPoly() > 0) {
+ if (data.getNbLines() > 0) {
TriangulationConvexHullBuilder builder = new TriangulationConvexHullBuilder();
int nbExtern = builder.getNbExternPolygon(data);
if (nbExtern > 1) {
@@ -70,16 +70,16 @@
int idxExternPoly = builder.getExternPolygonIdx(data);
updater.majProgessionStateOnly(MdlResource.getS("Construction des points"));
TreeSet<Coordinate> addedCoordinate = new TreeSet<Coordinate>(new CoordinateComparator(eps));
- LinearRing externRing = data.getPoly(idxExternPoly);
+ LinearRing externRing = (LinearRing) data.getLine(idxExternPoly);
SIRtreePointInRing isInMainRing = new SIRtreePointInRing(externRing);
List<SIRtreePointInRing> isInHoles = new ArrayList<SIRtreePointInRing>();
List<PolygonPoint> polygonPoints = createPolygonPoints(externRing, addedCoordinate);
Polygon polygon = new Polygon(polygonPoints);
- if (data.getNbPoly() > 1) {
- for (int idxPoly = 0; idxPoly < data.getNbPoly(); idxPoly++) {
- if (idxPoly != idxExternPoly) {
- isInHoles.add(new SIRtreePointInRing(data.getPoly(idxPoly)));
- polygon.addHole(new Polygon(createPolygonPoints(data.getPoly(idxPoly), addedCoordinate)));
+ if (data.getNbLines() > 1) {
+ for (int idxPoly = 0; idxPoly < data.getNbLines(); idxPoly++) {
+ if (idxPoly != idxExternPoly && data.isClosed(idxPoly)) {
+ isInHoles.add(new SIRtreePointInRing((LinearRing) data.getLine(idxPoly)));
+ polygon.addHole(new Polygon(createPolygonPoints((LinearRing) data.getLine(idxPoly), addedCoordinate)));
}
}
}
Modified: trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/grid/CalqueCreateGridTriangleProcessor.java
===================================================================
--- trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/grid/CalqueCreateGridTriangleProcessor.java 2013-01-21 09:38:14 UTC (rev 8228)
+++ trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/grid/CalqueCreateGridTriangleProcessor.java 2013-01-21 09:38:40 UTC (rev 8229)
@@ -32,19 +32,19 @@
* @author Frederic Deniger
*/
public class CalqueCreateGridTriangleProcessor extends AbstractCalqueCreateGridProcessor {
-
+
public static String getTriangleExe() {
return MdlPreferences.MDL.getStringProperty("grid.triangle.path");
}
-
+
public static boolean isTriangleExeConfigured() {
return getTriangleExe() != null && new File(getTriangleExe()).exists();
}
-
+
public CalqueCreateGridTriangleProcessor(ZModeleMultiPoint points, CtuluUI ui, ZCalqueLigneBrisee contour, LinearRing convexHull) {
super(points, ui, contour, convexHull);
}
-
+
@Override
public EfGridInterface process(ProgressionInterface prog) {
if (!isTriangleExeConfigured()) {
@@ -56,7 +56,7 @@
String fileName = null;
CExec exe = new CExec();
exe.setExecDirectory(tmpDir);
- if (contour == null || contour.modeleDonnees().getNbPolygone() == 0) {
+ if (isNoLinesSelected()) {
fileName = "in.node";
File nodeFile = new File(tmpDir, fileName);
TriangleNodeWriter writer = new TriangleNodeWriter();
@@ -80,18 +80,18 @@
return null;
}
//https://www.cs.cmu.edu/~quake/triangle.switch.html
- String options = "-DYY";
+ String options = addPointOnFrontier ? "-D" : "-DYY";
if (convexHull == null) {
- options = "-cDYY";
+ options = addPointOnFrontier ? "-cD" : "-cDYY";
}
exe.setCommand(new String[]{getTriangleExe(), options, fileName});
}
if (prog != null) {
prog.setDesc(MdlResource.getS("Ex\xE9cution du mailleur"));
}
-
-
-
+
+
+
exe.setListener(this);
exe.exec();
if (stop) {
Modified: trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/grid/GridChooseToolAndContourConvexHullPanel.java
===================================================================
--- trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/grid/GridChooseToolAndContourConvexHullPanel.java 2013-01-21 09:38:14 UTC (rev 8228)
+++ trunk/soft/fudaa-modeleur/src/main/java/org/fudaa/fudaa/modeleur/grid/GridChooseToolAndContourConvexHullPanel.java 2013-01-21 09:38:40 UTC (rev 8229)
@@ -13,6 +13,7 @@
import java.io.File;
import java.util.List;
import javax.swing.DefaultComboBoxModel;
+import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JList;
import org.apache.commons.lang.StringUtils;
@@ -33,13 +34,16 @@
* @author Frederic Deniger
*/
public class GridChooseToolAndContourConvexHullPanel extends CtuluDialogPanel {
-
+
JComboBox cbTriangulateur;
- JComboBox cbLayer;
+ JComboBox cbLayerContour;
+ JComboBox cbLayerInteriorLine;
JComboBox cbConvexHull;
+ JCheckBox cbUseHole;
+ JCheckBox cbAddPointOnFrontier;
BuTextField tfEps;
CtuluFileChooserPanel chooseExe;
-
+
public GridChooseToolAndContourConvexHullPanel(MdlVisuPanel visuPanel) {
super(false);
setHelpText(MdlResource.getS("Choisir le calque qui d\xE9terminera le contour et les trous du maillage"));
@@ -54,11 +58,12 @@
cbTriangulateur = new JComboBox(TriangulateurEnum.values());
add(cbTriangulateur);
chooseExe = addFileChooserPanel(this, MdlResource.getS("Chemin pour Triangle") + ": ", false, false);
-
+ cbAddPointOnFrontier = new JCheckBox();
cbTriangulateur.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
updateChooseExecState();
+ updateCbAddPointOnFrontierAndContraint();
}
});
String triangleExe = CalqueCreateGridTriangleProcessor.getTriangleExe();
@@ -68,38 +73,67 @@
if (isTriangleLastUsed()) {
cbTriangulateur.setSelectedItem(TriangulateurEnum.TRIANGLE);
}
+ BuLabel lbAddPoint = addLabel(MdlResource.getS("Ajouter des points sur la fronti\xE8re externe"));
+ lbAddPoint.setToolTipText(MdlResource.getS("Si activ\xE9, le triangulateur peut ajouter des points sur la fronti\xE8re"));
+
+ add(cbAddPointOnFrontier);
+ updateCbAddPointOnFrontierAndContraint();
List<BCalque> calquesContours = visuPanel.getCalquesContours();
+ final FSigWizardImportHelper.CalqueCellRender calqueCellRender = new FSigWizardImportHelper.CalqueCellRender();
+ calqueCellRender.setNullValue(MdlResource.getS("Aucun"));
if (!calquesContours.isEmpty()) {
- addLabel("");
- addLabel("");
+ addLabel(" ");
+ addLabel(" ");
BuLabel addLabel = addLabel(MdlResource.getS("Calque contour"));
addLabel.setToolTipText(MdlResource.getS("Les polygones du calque formeront l'enveloppe et les trous du maillage"));
calquesContours.add(0, null);
BCalque[] bCalques = (BCalque[]) calquesContours.toArray(new BCalque[calquesContours.size()]);
- cbLayer = new JComboBox(bCalques);
- final FSigWizardImportHelper.CalqueCellRender calqueCellRender = new FSigWizardImportHelper.CalqueCellRender();
- calqueCellRender.setNullValue(MdlResource.getS("Aucun"));
- cbLayer.setRenderer(calqueCellRender);
- add(cbLayer);
+ cbLayerContour = new JComboBox(bCalques);
+
+ cbLayerContour.setRenderer(calqueCellRender);
+ add(cbLayerContour);
BuLabel labelEnveloppe = addLabel(MdlResource.getS("L'enveloppe externe"));
labelEnveloppe.setToolTipText("<html>" + MdlResource.getS("Choisir le polygone formant l'enveloppe du maillage") + "<br>" + MdlResource.getS("Si aucun, l'enveloppe convexe du semis de point sera utilis\xE9"));
cbConvexHull = new JComboBox();
cbConvexHull.setRenderer(new LinearRingCellRenderer());
add(cbConvexHull);
- cbLayer.addItemListener(new ItemListener() {
+ BuLabel labelUseHole = addLabel(MdlResource.getS("Utiliser Les autres lignes ferm\xE9es comme des \xEEles"));
+ labelUseHole.setToolTipText("<html>" + MdlResource.getS("Si activ\xE9, les lignes ferm\xE9es, hormis l'enveloppe externe, seront consid\xE9r\xE9es comme \xE9tant des \xECles"));
+ cbUseHole = new JCheckBox();
+ add(cbUseHole);
+ cbUseHole.setSelected(true);
+ cbLayerContour.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
updateConvexHullCb();
}
});
}
+ List<BCalque> calqueLine2d = visuPanel.getCalquesContraintes();
+ addLabel(" ");
+ addLabel(" ");
+ BuLabel addLabel = addLabel(MdlResource.getS("Lignes de contraintes"));
+ addLabel.setToolTipText(MdlResource.getS("Lignes sur lesquelles le maillage devra s'appuyer. Non support\xE9 par le mailleur interne."));
+ calqueLine2d.add(0, null);
+ BCalque[] bCalques = (BCalque[]) calqueLine2d.toArray(new BCalque[calqueLine2d.size()]);
+ cbLayerInteriorLine = new JComboBox(bCalques);
+ cbLayerInteriorLine.setRenderer(calqueCellRender);
+ add(cbLayerInteriorLine);
+ updateCbAddPointOnFrontierAndContraint();
updateChooseExecState();
}
-
+
protected final void updateChooseExecState() {
chooseExe.setEnabled(isTriangleSelected());
}
-
+
+ protected final void updateCbAddPointOnFrontierAndContraint() {
+ cbAddPointOnFrontier.setEnabled(isTriangleSelected());
+ if (cbLayerInteriorLine != null) {
+ cbLayerInteriorLine.setEnabled(isTriangleSelected());
+ }
+ }
+
@Override
public boolean isDataValid() {
if (!isTriangleSelected()) {
@@ -120,11 +154,11 @@
}
return super.isDataValid();
}
-
+
public Double getEps() {
return (Double) tfEps.getValue();
}
-
+
@Override
public void apply() {
super.apply();
@@ -132,30 +166,36 @@
File choosenFile = chooseExe.getFile();
if (choosenFile != null) {
MdlPreferences.MDL.putStringProperty("grid.triangle.path", choosenFile.getAbsolutePath());
-
+
}
}
MdlPreferences.MDL.putStringProperty("grid.triangulateur.used", isTriangleSelected() ? "triangle" : "interne");
MdlPreferences.MDL.writeIniFile();
}
-
+
private boolean isTriangleLastUsed() {
return "triangle".equals(MdlPreferences.MDL.getStringProperty("grid.triangulateur.used"));
}
-
+
public boolean isTriangleSelected() {
return TriangulateurEnum.TRIANGLE.equals(cbTriangulateur.getSelectedItem());
-
-
}
-
+
+ public boolean isUseHoleIsSelected() {
+ return cbUseHole.isSelected();
+ }
+
+ public boolean isAddPointOnFrontierSelected() {
+ return cbAddPointOnFrontier.isSelected();
+ }
+
private class LinearRingCellRenderer extends CtuluCellTextRenderer {
-
+
@Override
public Component getListCellRendererComponent(JList _list, Object _value, int _index, boolean _isSelected, boolean _cellHasFocus) {
return super.getListCellRendererComponent(_list, getValue(_value, _index), _index, _isSelected, _cellHasFocus);
}
-
+
protected String getValue(Object _value, int selectedIdx) {
if (_value == null) {
return MdlResource.getS("Aucun");
@@ -165,8 +205,8 @@
idx = cbConvexHull.getSelectedIndex() - 1;
}
if (idx >= 0) {
- int att = getSelectedLayer().modeleDonnees().getGeomData().getIndiceOf(GISAttributeConstants.TITRE);
- GISAttributeModel dataModel = getSelectedLayer().modeleDonnees().getGeomData().getDataModel(att);
+ int att = getSelectedContourLayer().modeleDonnees().getGeomData().getIndiceOf(GISAttributeConstants.TITRE);
+ GISAttributeModel dataModel = getSelectedContourLayer().modeleDonnees().getGeomData().getDataModel(att);
String title = (String) dataModel.getObjectValueAt(idx);
if (StringUtils.isEmpty(title)) {
title = MdlResource.getS("Ligne ferm\xE9e {0}", Integer.toString(idx + 1));
@@ -177,22 +217,27 @@
return _value.toString();
}
}
-
+
protected void updateConvexHullCb() {
- ZCalqueLigneBrisee selectedLayer = getSelectedLayer();
+ ZCalqueLigneBrisee selectedLayer = getSelectedContourLayer();
+ cbUseHole.setEnabled(selectedLayer != null);
if (selectedLayer == null) {
cbConvexHull.setModel(new DefaultComboBoxModel());
} else {
cbConvexHull.setModel(new LinearRingComboBoxModel(selectedLayer));
cbConvexHull.setSelectedIndex(0);
}
-
+
}
-
- public ZCalqueLigneBrisee getSelectedLayer() {
- return cbLayer == null ? null : (ZCalqueLigneBrisee) cbLayer.getSelectedItem();
+
+ public ZCalqueLigneBrisee getSelectedContourLayer() {
+ return cbLayerContour == null ? null : (ZCalqueLigneBrisee) cbLayerContour.getSelectedItem();
}
-
+
+ public ZCalqueLigneBrisee getSelectedContrainteLayer() {
+ return cbLayerInteriorLine == null ? null : (ZCalqueLigneBrisee) cbLayerInteriorLine.getSelectedItem();
+ }
+
public LinearRing getSelectedConvexHull() {
return cbConvexHull == null ? null : (LinearRing) cbConvexHull.getSelectedItem();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|