use of org.twak.viewTrace.SliceSolver in project chordatlas by twak.
the class BlockGen method getUI.
@Override
public JComponent getUI() {
JPanel panel = (JPanel) super.getUI();
JButton profiles = new JButton("find profiles");
profiles.addActionListener(e -> doProfile());
JButton panos = new JButton("render panoramas");
panos.addActionListener(e -> renderPanos());
JButton features = new JButton("find image features");
features.addActionListener(e -> segnetFacade());
JButton viewFeatures = new JButton("features viewer");
viewFeatures.addActionListener(e -> viewFeatures());
JButton slice = new JButton("slice");
slice.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
new Thread() {
public void run() {
File fs = getSlicedFile();
if (!fs.exists()) {
new SliceSolver(fs, new Slice(getCroppedFile(), getGISFile(), P, false), P);
}
tweed.frame.addGen(new ObjGen(tweed.makeWorkspaceRelative(fs).toString(), tweed), true);
}
}.start();
}
});
JButton tooD = new JButton("slice UI");
tooD.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
new Slice(root, ProfileGen.SLICE_SCALE);
}
});
JButton loadSln = new JButton("load last solution");
loadSln.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
File f = getSolutionFile();
if (f.exists()) {
SolverState SS = (SolverState) new XStream().fromXML(f);
SkelFootprint.postProcesss(SS);
// PaintThing.debug.clear();
// new Plot(SS.mesh).add( new ICanPaint() {
//
// @Override
// public void paint( Graphics2D g, PanMouseAdaptor ma ) {
//
// g.setColor( Color.black );
// g.setStroke( new BasicStroke( 2 ) );
//
// if (SS.footprint != null)
// for (Line l : SS.footprint) {
// g.drawLine(
// ma.toX( l.start.x ),
// ma.toY( l.start.y ),
// ma.toX( l.end.x ),
// ma.toY( l.end.y ) );
// }
//
// }
// });
tweed.frame.addGen(new SkelGen(SS.mesh, tweed, BlockGen.this), true);
} else {
JOptionPane.showMessageDialog(tweed.frame(), "Unable to find pre-computed solution.\n" + f);
}
}
});
JTextArea name = new JTextArea(nameCoords());
name.setEditable(false);
panel.add(profiles, 0);
panel.add(panos, 1);
panel.add(features, 2);
panel.add(new JLabel("other:"), 4);
panel.add(slice);
panel.add(viewFeatures);
// panel.add( tooD );
if (getSolutionFile().exists())
panel.add(loadSln);
panel.add(new JLabel("name:"));
panel.add(name);
return panel;
}
Aggregations