|
@@ -50,6 +50,7 @@ export default class Player {
|
|
|
setMode(mode) {
|
|
|
this.mode = mode;
|
|
|
if (mode === 1 || mode === 2) {
|
|
|
+ this.reset();
|
|
|
this.setEditMode();
|
|
|
}
|
|
|
if (mode === 0) {
|
|
@@ -58,12 +59,12 @@ export default class Player {
|
|
|
this.scene.emit("mode", this.mode);
|
|
|
}
|
|
|
|
|
|
- removeMarker() {
|
|
|
- if (this.marker) {
|
|
|
- this.scene.scene.remove(this.marker);
|
|
|
- this.marker = null;
|
|
|
- }
|
|
|
- }
|
|
|
+ // removeMarker() {
|
|
|
+ // if (this.marker) {
|
|
|
+ // this.scene.scene.remove(this.marker);
|
|
|
+ // this.marker = null;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
setFreeMode() {
|
|
|
this.floorplanControls.enablePan = true;
|
|
|
this.floorplanControls.mouseButtons = {
|
|
@@ -71,6 +72,7 @@ export default class Player {
|
|
|
MIDDLE: THREE.MOUSE.DOLLY,
|
|
|
RIGHT: THREE.MOUSE.PAN,
|
|
|
};
|
|
|
+ this.reset();
|
|
|
}
|
|
|
|
|
|
setEditMode() {
|
|
@@ -82,6 +84,7 @@ export default class Player {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
+ load() {}
|
|
|
init = () => {
|
|
|
// //floorplanControls
|
|
|
// this.floorplanControls = new FloorplanControls(
|
|
@@ -379,9 +382,54 @@ export default class Player {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+ getDrawData() {
|
|
|
+ let data;
|
|
|
+ if (this.scene.sceneType === 1) {
|
|
|
+ data = {
|
|
|
+ hor_lines: this.renderLines,
|
|
|
+ activeEdges: this.activeEdges,
|
|
|
+ vir_lines: [],
|
|
|
+ hor_markers: this.renderMarkers,
|
|
|
+ vir_markers: [],
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ data = {
|
|
|
+ hor_lines: [],
|
|
|
+ vir_lines: this.renderLines,
|
|
|
+ activeEdges: this.activeEdges,
|
|
|
+ vir_markers: this.renderMarkers,
|
|
|
+ hor_markers: [],
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log("sceneType", this.scene.sceneType);
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+ // syncDrawData() {
|
|
|
+ // const data = {
|
|
|
+ // line: this.renderLines,
|
|
|
+ // activeEdges: this.activeEdges,
|
|
|
+ // markers: this.renderMarkers,
|
|
|
+ // };
|
|
|
+ // this.scene.emit("sync", data);
|
|
|
+ // }
|
|
|
|
|
|
reset() {
|
|
|
- this.activeEdges = [];
|
|
|
+ if (this.marker) {
|
|
|
+ this.scene.scene.remove(this.marker);
|
|
|
+ this.marker = null;
|
|
|
+ }
|
|
|
+ if (this.drawLine) {
|
|
|
+ this.scene.scene.remove(this.drawLine);
|
|
|
+ this.drawLine = null;
|
|
|
+ }
|
|
|
+ if (this.touchImg) {
|
|
|
+ this.touchImg = null;
|
|
|
+ }
|
|
|
+ if (this.activeEdge) {
|
|
|
+ this.activeEdge = null;
|
|
|
+ }
|
|
|
+ this.drawing = false;
|
|
|
}
|
|
|
|
|
|
update = () => {
|