|
@@ -2,10 +2,11 @@ import { diffArrayChange, mount, shallowWatchArray } from "@/utils";
|
|
import TaggingComponent from "@/components/path/list.vue";
|
|
import TaggingComponent from "@/components/path/list.vue";
|
|
import { Path as PathData, paths } from "@/store/path";
|
|
import { Path as PathData, paths } from "@/store/path";
|
|
import { sdk, Path, SDK } from "../sdk";
|
|
import { sdk, Path, SDK } from "../sdk";
|
|
-import { reactive, watch } from "vue";
|
|
|
|
|
|
+import { reactive, ref, watch, watchEffect } from "vue";
|
|
import { groupProxy } from "@/store/group";
|
|
import { groupProxy } from "@/store/group";
|
|
import { isScenePlayRun, pauseScene, playScene } from "@/utils/full";
|
|
import { isScenePlayRun, pauseScene, playScene } from "@/utils/full";
|
|
import { analysisPose, setPose } from ".";
|
|
import { analysisPose, setPose } from ".";
|
|
|
|
+import { custom, showPathsStack, showPathStack } from "@/env";
|
|
|
|
|
|
// -----------------导览线关联--------------------
|
|
// -----------------导览线关联--------------------
|
|
export type PathNode = Path;
|
|
export type PathNode = Path;
|
|
@@ -23,7 +24,7 @@ export const getPathNode = (
|
|
return pathNodes.get(path);
|
|
return pathNodes.get(path);
|
|
};
|
|
};
|
|
|
|
|
|
-export const taggingsGroup = groupProxy(() => {
|
|
|
|
|
|
+export const pathsGroup = groupProxy(() => {
|
|
const nodes = [] as PathNode[];
|
|
const nodes = [] as PathNode[];
|
|
for (const path of paths.value) {
|
|
for (const path of paths.value) {
|
|
const node = getPathNode(path);
|
|
const node = getPathNode(path);
|
|
@@ -34,16 +35,29 @@ export const taggingsGroup = groupProxy(() => {
|
|
return nodes;
|
|
return nodes;
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+watchEffect(() => {
|
|
|
|
+ pathsGroup.visibility(custom.showPaths);
|
|
|
|
+ if (custom.showPath) {
|
|
|
|
+ const node = getPathNode(custom.showPath);
|
|
|
|
+ node?.visibility(true);
|
|
|
|
+ node?.fly()
|
|
|
|
+ console.log('a1', node, custom.showPath)
|
|
|
|
+ }
|
|
|
|
+})
|
|
|
|
|
|
-export const playScenePath = (
|
|
|
|
|
|
+export const playScenePath = async (
|
|
path: PathData,
|
|
path: PathData,
|
|
forceFull = false,
|
|
forceFull = false,
|
|
) => {
|
|
) => {
|
|
const node = getPathNode(path)
|
|
const node = getPathNode(path)
|
|
if (!node) return null;
|
|
if (!node) return null;
|
|
|
|
|
|
|
|
+ showPathsStack.push(ref(false))
|
|
|
|
+ showPathStack.push(ref(path.id))
|
|
|
|
+
|
|
|
|
+
|
|
let initPose: any;
|
|
let initPose: any;
|
|
- playScene({
|
|
|
|
|
|
+ await playScene({
|
|
play: () => {
|
|
play: () => {
|
|
return new Promise(resolve => {
|
|
return new Promise(resolve => {
|
|
initPose = analysisPose(sdk.getPose());
|
|
initPose = analysisPose(sdk.getPose());
|
|
@@ -55,6 +69,9 @@ export const playScenePath = (
|
|
node.pause();
|
|
node.pause();
|
|
}
|
|
}
|
|
}, forceFull)
|
|
}, forceFull)
|
|
|
|
+
|
|
|
|
+ showPathsStack.pop()
|
|
|
|
+ showPathStack.pop()
|
|
}
|
|
}
|
|
|
|
|
|
export const pauseScenePath = pauseScene
|
|
export const pauseScenePath = pauseScene
|