diff --git a/Comparison/src/main/java/cz/fidentis/analyst/face/HumanFace.java b/Comparison/src/main/java/cz/fidentis/analyst/face/HumanFace.java index e30af5c6a5f36e108a803273501ebd48972dab74..c8760f4f7ae02b823bd4f7370598900727d518cc 100644 --- a/Comparison/src/main/java/cz/fidentis/analyst/face/HumanFace.java +++ b/Comparison/src/main/java/cz/fidentis/analyst/face/HumanFace.java @@ -25,6 +25,7 @@ import java.util.Collections; import java.util.List; import java.util.ArrayList; import java.util.Objects; +import java.util.Observable; //import org.nustaq.serialization.FSTConfiguration; //import org.nustaq.serialization.FSTObjectInput; //import org.nustaq.serialization.FSTObjectOutput; @@ -50,7 +51,7 @@ import java.util.Objects; * * @author Radek Oslejsek */ -public class HumanFace implements MeshListener, Serializable { +public class HumanFace extends Observable implements MeshListener, Serializable { private MeshModel meshModel; @@ -116,6 +117,8 @@ public class HumanFace implements MeshListener, Serializable { */ public void registerListener(MeshListener listener) { eventBus.register(listener); + setChanged(); + notifyObservers(this); } /** @@ -125,6 +128,8 @@ public class HumanFace implements MeshListener, Serializable { */ public void unregisterListener(MeshListener listener) { eventBus.unregister(listener); + setChanged(); + notifyObservers(this); } /** @@ -182,6 +187,8 @@ public class HumanFace implements MeshListener, Serializable { */ public void setFeaturePoints(List<FeaturePoint> points) { featurePoints = points; + setChanged(); + notifyObservers(this); } /** @@ -193,6 +200,8 @@ public class HumanFace implements MeshListener, Serializable { */ public void loadFeaturePoints(String path, String fileName) throws IOException { featurePoints = FeaturePointImportService.importFeaturePoints(path, fileName); + setChanged(); + notifyObservers(this); } /** @@ -253,6 +262,8 @@ public class HumanFace implements MeshListener, Serializable { public KdTree computeKdTree(boolean recompute) { if (kdTree == null || recompute) { kdTree = new KdTree(new ArrayList<>(meshModel.getFacets())); + setChanged(); + notifyObservers(this); } return kdTree; } @@ -264,6 +275,8 @@ public class HumanFace implements MeshListener, Serializable { public KdTree removeKdTree() { KdTree ret = this.kdTree; this.kdTree = null; + setChanged(); + notifyObservers(this); return ret; }