@abi-software/scaffoldvuer 1.0.1 → 1.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/scaffoldvuer",
3
- "version": "1.0.1",
3
+ "version": "1.1.0-beta.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -41,7 +41,8 @@
41
41
  "*.js"
42
42
  ],
43
43
  "dependencies": {
44
- "@abi-software/flatmapvuer": "^1.0.1",
44
+ "@abi-software/flatmapvuer": "^1.1.0-beta.2",
45
+ "@abi-software/sparc-annotation": "^0.3.1",
45
46
  "@abi-software/svg-sprite": "^1.0.0",
46
47
  "@element-plus/icons-vue": "^2.3.1",
47
48
  "@vue/compat": "^3.4.15",
@@ -54,7 +55,7 @@
54
55
  "vue": "^3.4.15",
55
56
  "vue-router": "^4.2.5",
56
57
  "vue3-component-svg-sprite": "^0.0.1",
57
- "zincjs": "^1.5.1-beta.1"
58
+ "zincjs": "^1.5.1-beta.6"
58
59
  },
59
60
  "devDependencies": {
60
61
  "@vitejs/plugin-vue": "^4.6.2",
package/src/App.vue CHANGED
@@ -242,7 +242,8 @@ export default {
242
242
  route: useRoute(),
243
243
  router: useRouter(),
244
244
  ElIconSetting: shallowRef(ElIconSetting),
245
- ElIconFolderOpened: shallowRef(ElIconFolderOpened)
245
+ ElIconFolderOpened: shallowRef(ElIconFolderOpened),
246
+ coordinatesClicked: [],
246
247
  };
247
248
  },
248
249
  watch: {
@@ -297,6 +298,8 @@ export default {
297
298
  });
298
299
  },
299
300
  objectAdded: function (zincObject) {
301
+ console.log(zincObject)
302
+ console.log(this.$refs.scaffold.$module.scene.getBoundingBox())
300
303
  if (this._objects.length === 0) {
301
304
  zincObject.setMarkerMode("on");
302
305
  }
@@ -427,6 +430,7 @@ export default {
427
430
  });
428
431
  },
429
432
  onReady: function () {
433
+ console.log(this.$refs.scaffold)
430
434
  if (this.readyCallback) {
431
435
  this.readyCallback(this.$refs.scaffold, texture_prefix);
432
436
  this.readyCallback = undefined;
@@ -438,10 +442,41 @@ export default {
438
442
  }
439
443
  }
440
444
  },
445
+ addLines: function (coord) {
446
+ if (this.coordinatesClicked.length === 1) {
447
+ const returned = this.$refs.scaffold.$module.scene.createLines(
448
+ "test",
449
+ "lines",
450
+ [this.coordinatesClicked[0], coord],
451
+ 0x00ee22,
452
+ );
453
+ this.coordinatesClicked.length = 0;
454
+ console.log(returned);
455
+ } else {
456
+ this.coordinatesClicked.push(coord);
457
+ }
458
+ },
441
459
  onSelected: function (data) {
460
+
442
461
  if (data && data.length > 0 && data[0].data.group) {
462
+ console.log(data[0].data.group)
463
+ /*
464
+ if (data[0].worldCoords) {
465
+ console.log(data[0].data);
466
+ const returned = this.$refs.scaffold.$module.scene.createPoints(
467
+ "test",
468
+ "points",
469
+ [data[0].worldCoords],
470
+ undefined,
471
+ 0x0022ee,
472
+ );
473
+
474
+ console.log(data[0].worldCoords)
475
+ this.addLines(data[0].worldCoords);
476
+ }
477
+ */
443
478
  delete this.route.query["viewURL"];
444
- this.$refs.scaffold.showRegionTooltipWithAnnotations(data, true, true);
479
+ this.$refs.scaffold.showRegionTooltipWithAnnotations(data, false, true);
445
480
  if (this.onClickMarkers) this.$refs.scaffold.setMarkerModeForObjectsWithName(data[0].data.group, "on");
446
481
  }
447
482
  },
@@ -0,0 +1,201 @@
1
+ <template>
2
+ <el-container class="create-container">
3
+ <el-header height="30px" class="header">
4
+ <div>Create {{ createData.shape }}</div>
5
+ </el-header>
6
+ <el-main class="slides-block">
7
+ <span class="create-text">
8
+ Primitives will be created in the
9
+ <br>
10
+ __annotation region
11
+ </span>
12
+ <el-row class="row" v-show="showPoint">
13
+ <el-col :offset="0" :span="8">
14
+ Position:
15
+ </el-col>
16
+ <el-col :offset="0" :span="16">
17
+ <el-row v-for="{ value, i } in createData.points" :key="i" class="value">
18
+ {{ i }}
19
+ </el-row>
20
+ </el-col>
21
+ </el-row>
22
+ <el-row class="row">
23
+ <el-col :offset="0" :span="8">
24
+ Region:
25
+ </el-col>
26
+ <el-col :offset="0" :span="16">
27
+ <el-input
28
+ v-model="region"
29
+ placeholder="__annotation"
30
+ size="small"
31
+ />
32
+ </el-col>
33
+ </el-row>
34
+ <el-row class="row">
35
+ <el-col :offset="0" :span="8">
36
+ Group:
37
+ </el-col>
38
+ <el-col :offset="0" :span="16">
39
+ <el-input
40
+ v-model="group"
41
+ :placeholder="createData.shape"
42
+ size="small"
43
+ />
44
+ </el-col>
45
+ </el-row>
46
+ <el-row>
47
+ <el-col :offset="0" :span="12">
48
+ <el-button
49
+ type="primary"
50
+ plain
51
+ @click="confirm"
52
+ >
53
+ {{ confirmText }}
54
+ </el-button>
55
+ </el-col>
56
+ <el-col :offset="0" :span="12">
57
+ <el-button
58
+ type="primary"
59
+ plain
60
+ @click="cancel"
61
+ >
62
+ Cancel
63
+ </el-button>
64
+ </el-col>
65
+ </el-row>
66
+ </el-main>
67
+ </el-container>
68
+ </template>
69
+
70
+ <script>
71
+ /* eslint-disable no-alert, no-console */
72
+
73
+ import {
74
+ ElButton as Button,
75
+ ElCol as Col,
76
+ ElContainer as Container,
77
+ ElHeader as Header,
78
+ ElInput as Input,
79
+ ElMain as Main,
80
+
81
+ } from "element-plus";
82
+
83
+ /**
84
+ * A component to control the opacity of the target object.
85
+ */
86
+ export default {
87
+ name: "CreateTooltipContent",
88
+ components: {
89
+ Button,
90
+ Col,
91
+ Container,
92
+ Header,
93
+ Input,
94
+ Main,
95
+ },
96
+ props: {
97
+ createData: {
98
+ type: Object,
99
+ },
100
+ },
101
+ watch: {
102
+ "createData.shape": {
103
+ handler: function (value) {
104
+ this.group = value;
105
+ this.$emit("cancel-create");
106
+ },
107
+ immediate: true,
108
+ },
109
+ },
110
+ computed: {
111
+ confirmText: function () {
112
+ if (this.createData.editingIndex > -1) {
113
+ return "Edit";
114
+ }
115
+ return "Confirm";
116
+ },
117
+ },
118
+ data: function () {
119
+ return {
120
+ group: "default",
121
+ region: "",
122
+ showPoint: false,
123
+ }
124
+ },
125
+ methods: {
126
+ confirm: function () {
127
+ this.$emit(
128
+ "confirm-create",
129
+ {
130
+ region: "__annotation/" + this.region,
131
+ group: this.group,
132
+ shape: this.createData.shape,
133
+ editingIndex: this.createData.editingIndex,
134
+ }
135
+ );
136
+ this.group = this.createData.shape;
137
+ },
138
+ cancel: function () {
139
+ this.$emit("cancel-create");
140
+ },
141
+ },
142
+ };
143
+ </script>
144
+
145
+ <!-- Add "scoped" attribute to limit CSS to this component only -->
146
+ <style scoped lang="scss">
147
+ .header {
148
+ color: #606266;
149
+ line-height: 1;
150
+ padding: 8px 17px 1px 15px;
151
+ border-bottom: 1px solid #ebeef5;
152
+ font-size: 14px;
153
+ }
154
+
155
+ .row {
156
+ margin: 4px;
157
+ text-align: left;
158
+ }
159
+
160
+ :deep(.create-text) {
161
+ max-width: 220px;
162
+ height:35px;
163
+ font-size: 12px;
164
+ }
165
+
166
+
167
+ .create-container {
168
+ width: 250px;
169
+ height: auto;
170
+ border-radius: 4px;
171
+ border: solid 1px #d8dce6;
172
+ background-color: #fff;
173
+ overflow-y: none;
174
+ user-select: auto;
175
+ pointer-events: auto;
176
+ }
177
+
178
+ .value {
179
+ font-size: 12px;
180
+ }
181
+
182
+ .input-box {
183
+ width: 42px;
184
+ border-radius: 4px;
185
+ border: 1px solid rgb(144, 147, 153);
186
+ background-color: var(--white);
187
+ font-weight: 500;
188
+ color: rgb(48, 49, 51);
189
+ margin-left: 8px;
190
+ height: 24px;
191
+
192
+ &.number-input {
193
+ width: 42px;
194
+ :deep(.el-input__wrapper) {
195
+ padding-left: 0px;
196
+ padding-right: 0px;
197
+ }
198
+ }
199
+ }
200
+
201
+ </style>
@@ -0,0 +1,196 @@
1
+ <template>
2
+ <el-container class="lines-container">
3
+ <el-main class="slides-block">
4
+ <el-row>
5
+ <el-col :offset="0" :span="6">
6
+ Width:
7
+ </el-col>
8
+ <el-col :offset="0" :span="10">
9
+ <el-slider
10
+ v-model="width"
11
+ class="my-slider"
12
+ :step="1"
13
+ :min="1"
14
+ :max="100"
15
+ :show-tooltip="false"
16
+ @input="modifyWidth"
17
+ />
18
+ </el-col>
19
+ <el-col :offset="0" :span="6">
20
+ <el-input-number
21
+ v-model="width"
22
+ :step="1"
23
+ :min="1"
24
+ :max="100"
25
+ :controls="false"
26
+ class="input-box number-input"
27
+ />
28
+ </el-col>
29
+ </el-row>
30
+ <el-row v-if="createData.faceIndex > -1">
31
+ <el-col :offset="0" :span="4">
32
+ <el-button :icon="ElIconArrowLeft" @click="onMoveClick(-unit)"/>
33
+ </el-col>
34
+ <el-col :offset="3" :span="3">
35
+ Move
36
+ </el-col>
37
+ <el-col :offset="0" :span="7">
38
+ <el-input-number
39
+ v-model="unit"
40
+ :controls="false"
41
+ class="input-box number-input"
42
+ />
43
+ </el-col>
44
+ <el-col :offset="2" :span="2">
45
+ <el-button :icon="ElIconArrowRight" @click="onMoveClick(unit)"/>
46
+ </el-col>
47
+ </el-row>
48
+ </el-main>
49
+ </el-container>
50
+ </template>
51
+
52
+ <script>
53
+ /* eslint-disable no-alert, no-console */
54
+ // This is not in use at this moment, due to
55
+ // limited support to line width
56
+ import { shallowRef } from 'vue';
57
+ import {
58
+ moveLine,
59
+ } from "../scripts/Utilities.js";
60
+ import {
61
+ ElButton as Button,
62
+ ElCol as Col,
63
+ ElContainer as Container,
64
+ ElInputNumber as InputNumber,
65
+ ElMain as Main,
66
+ ElSelect as Select,
67
+ ElSlider as Slider,
68
+ ElOption as Option,
69
+ } from "element-plus";
70
+ import {
71
+ ArrowLeft as ElIconArrowLeft,
72
+ ArrowRight as ElIconArrowRight,
73
+ } from '@element-plus/icons-vue';
74
+
75
+ /**
76
+ * A component to control the opacity of the target object.
77
+ */
78
+ export default {
79
+ name: "LinesControls",
80
+ components: {
81
+ Button,
82
+ Col,
83
+ Container,
84
+ InputNumber,
85
+ Main,
86
+ Select,
87
+ Slider,
88
+ Option,
89
+ ElIconArrowLeft,
90
+ ElIconArrowRight,
91
+ },
92
+ props: {
93
+ createData: {
94
+ type: Object,
95
+ },
96
+ },
97
+ data: function () {
98
+ return {
99
+ width: 1,
100
+ unit: 0.1,
101
+ ElIconArrowLeft: shallowRef(ElIconArrowLeft),
102
+ ElIconArrowRight: shallowRef(ElIconArrowRight),
103
+ };
104
+ },
105
+ mounted: function () {
106
+ this._zincObject = undefined;
107
+ },
108
+ methods: {
109
+ onMoveClick: function(unit) {
110
+ moveLine(this._zincObject, this.createData.faceIndex, unit);
111
+ },
112
+ setObject: function (object) {
113
+ if (object.isLines) {
114
+ this._zincObject = object;
115
+ this.width = this._zincObject.getMorph().material.linewidth;
116
+ } else {
117
+ this._zincObject = undefined;
118
+ this.linewidth = 10;
119
+ }
120
+ },
121
+ modifyWidth: function () {
122
+ this._zincObject.setWidth(this.width);
123
+ },
124
+ },
125
+ };
126
+ </script>
127
+
128
+ <!-- Add "scoped" attribute to limit CSS to this component only -->
129
+ <style scoped lang="scss">
130
+
131
+ .slides-block {
132
+ pointer-events: auto;
133
+ &.el-main {
134
+ padding: 5px;
135
+ &::-webkit-scrollbar {
136
+ width: 10px;
137
+ }
138
+
139
+ &::-webkit-scrollbar-thumb {
140
+ border-radius: 10px;
141
+ box-shadow: inset 0 0 6px #c0c4cc;
142
+ }
143
+ }
144
+ }
145
+
146
+ .my-slider {
147
+ top: -6px;
148
+ position: relative;
149
+ }
150
+
151
+ .lines-container {
152
+ width: 250px;
153
+ overflow-y: none;
154
+ }
155
+
156
+ .input-box {
157
+ width: 42px;
158
+ border-radius: 4px;
159
+ border: 1px solid rgb(144, 147, 153);
160
+ background-color: var(--white);
161
+ font-weight: 500;
162
+ color: rgb(48, 49, 51);
163
+ margin-left: 8px;
164
+ height: 24px;
165
+
166
+ &.number-input {
167
+ width: 42px;
168
+ :deep(.el-input__wrapper) {
169
+ padding-left: 0px;
170
+ padding-right: 0px;
171
+ }
172
+ }
173
+
174
+ :deep(.el-select__wrapper) {
175
+ height: 24px;
176
+ padding: 0;
177
+ min-height: unset;
178
+ }
179
+
180
+ :deep(.el-select__selection) {
181
+ color: $app-primary-color;
182
+ height: 22px;
183
+ padding-left: 4px;
184
+ padding-right: 8px;
185
+ border: none;
186
+ font-family: "Asap", sans-serif;
187
+ line-height: 22px;
188
+ }
189
+
190
+ :deep(.el-select__suffix),
191
+ :deep(.el-icon) {
192
+ line-height: 22px;
193
+ }
194
+ }
195
+
196
+ </style>
@@ -1,25 +1,17 @@
1
1
  <template>
2
2
  <el-container v-if="material" class="opacity-container">
3
- <el-header
4
- height="37px"
5
- class="header"
6
- >
7
- <div>Opacity</div>
8
- </el-header>
9
- <el-main class="main">
10
- <div class="block">
11
- <span class="display">{{ displayString }}</span>
12
- <el-slider
13
- v-model="material.opacity"
14
- class="my-slider"
15
- :step="0.01"
16
- :min="0"
17
- :max="1"
18
- :format-tooltip="formatTooltip"
19
- :show-tooltip="false"
20
- />
21
- </div>
22
- </el-main>
3
+ <div class="block">
4
+ <span class="display">{{ displayString }}</span>
5
+ <el-slider
6
+ v-model="material.opacity"
7
+ class="my-slider"
8
+ :step="0.01"
9
+ :min="0"
10
+ :max="1"
11
+ :format-tooltip="formatTooltip"
12
+ :show-tooltip="false"
13
+ />
14
+ </div>
23
15
  </el-container>
24
16
  </template>
25
17
 
@@ -70,13 +62,6 @@ export default {
70
62
 
71
63
  <!-- Add "scoped" attribute to limit CSS to this component only -->
72
64
  <style scoped lang="scss">
73
- .header {
74
- color: #606266;
75
- line-height: 1;
76
- padding: 9px 17px 0 15px;
77
- border-bottom: 1px solid #ebeef5;
78
- font-size: 14px;
79
- }
80
65
 
81
66
  .display {
82
67
  width: 44px;
@@ -97,17 +82,14 @@ export default {
97
82
  .my-slider {
98
83
  position: absolute;
99
84
  width: 135px;
100
- top: -12px;
101
85
  left: 50px;
86
+ top: -8px;
102
87
  pointer-events: auto;
103
88
  }
104
89
 
105
90
  .opacity-container {
106
91
  width: 250px;
107
- height: 93px;
108
- border-radius: 4px;
109
- border: solid 1px #d8dce6;
110
- background-color: #fff;
92
+ height: 30px;
111
93
  }
112
94
 
113
95
  :deep(.el-slider__bar) {