use of org.twak.utils.WeakListener.Changed in project chordatlas by twak.
the class SkelGen method editFacade.
public void editFacade(PlanSkeleton skel, SuperFace sf, SuperEdge se, boolean texture) {
closeSitePlan();
if (se.toEdit == null) {
ensureMF(sf, se);
if (!texture)
se.toEdit.groundFloorHeight = 2;
}
if (texture) {
patchWallTag(skel, se, se.toEdit);
se.toEdit.width = se.length();
} else
se.toEdit.texture = se.toEdit.spec = se.toEdit.normal = null;
Plot p = new Plot(se.toEdit);
Changed c = new Changed() {
@Override
public void changed() {
PaintThing.debug.clear();
if (texture)
new Thread(new Runnable() {
@Override
public void run() {
Pix2Pix.pix2pix(se.toEdit, skel, skel.output, sf, new Runnable() {
public void run() {
tweed.enqueue(new Runnable() {
@Override
public void run() {
setSkel(skel, skel.output, sf);
tweed.getRootNode().updateGeometricState();
}
});
}
});
}
}).start();
else
tweed.enqueue(new Runnable() {
@Override
public void run() {
setSkel(skel, skel.output, sf);
}
});
}
};
c.changed();
p.addEditListener(c);
}