@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.
@@ -0,0 +1,194 @@
1
+ <template>
2
+ <el-container class="pointset-container">
3
+ <el-main class="slides-block">
4
+ <el-row>
5
+ <el-col :offset="0" :span="6">
6
+ Size:
7
+ </el-col>
8
+ <el-col :offset="0" :span="10">
9
+ <el-slider
10
+ v-model="size"
11
+ class="my-slider"
12
+ :step="1"
13
+ :min="0"
14
+ :max="100"
15
+ :show-tooltip="false"
16
+ @input="modifySize()"
17
+ />
18
+ </el-col>
19
+ <el-col :offset="0" :span="6">
20
+ <el-input-number
21
+ v-model="size"
22
+ :step="1"
23
+ :min="0"
24
+ :max="100"
25
+ :controls="false"
26
+ class="input-box number-input"
27
+ />
28
+ </el-col>
29
+ </el-row>
30
+ <el-row>
31
+ <el-col :offset="0" :span="16">
32
+ Size attenuation:
33
+ </el-col>
34
+ <el-col :offset="0" :span="5">
35
+ <el-select
36
+ :teleported="false"
37
+ :model-value="attenuation"
38
+ placeholder="Select"
39
+ class="input-box"
40
+ popper-class="viewer_dropdown"
41
+ @change="modifyAttenuation($event, slide)"
42
+ >
43
+ <el-option
44
+ v-for="item in choices"
45
+ :key="item.value"
46
+ :label="item.label"
47
+ :value="item.value"
48
+ />
49
+ </el-select>
50
+ </el-col>
51
+ </el-row>
52
+ </el-main>
53
+ </el-container>
54
+ </template>
55
+
56
+ <script>
57
+ /* eslint-disable no-alert, no-console */
58
+
59
+ import {
60
+ ElCol as Col,
61
+ ElContainer as Container,
62
+ ElInputNumber as InputNumber,
63
+ ElMain as Main,
64
+ ElSelect as Select,
65
+ ElSlider as Slider,
66
+ ElOption as Option,
67
+ } from "element-plus";
68
+
69
+ /**
70
+ * A component to control the opacity of the target object.
71
+ */
72
+ export default {
73
+ name: "PointsControls",
74
+ components: {
75
+ Col,
76
+ Container,
77
+ InputNumber,
78
+ Main,
79
+ Select,
80
+ Slider,
81
+ Option,
82
+ },
83
+ data: function () {
84
+ return {
85
+ attenuation: false,
86
+ size: 10,
87
+ choices: [
88
+ {
89
+ value: true,
90
+ label: "On",
91
+ },
92
+ {
93
+ value: false,
94
+ label: "off",
95
+ },
96
+ ],
97
+ };
98
+ },
99
+ mounted: function () {
100
+ this._zincObject = undefined;
101
+ },
102
+ methods: {
103
+ setObject: function (object) {
104
+ if (object.isPointset) {
105
+ this._zincObject = object;
106
+ this.size = this._zincObject.morph.material.size;
107
+ this.attenuation = this._zincObject.morph.material.sizeAttenuation
108
+ } else {
109
+ this._zincObject = undefined;
110
+ this.size = 10;
111
+ this.attenuation = false;
112
+ }
113
+ },
114
+ modifyAttenuation: function(flag) {
115
+ this.attenuation = flag;
116
+ this._zincObject.setSizeAttenuation(flag);
117
+ },
118
+ modifySize: function () {
119
+ this._zincObject.setSize(this.size);
120
+ },
121
+ },
122
+ };
123
+ </script>
124
+
125
+ <!-- Add "scoped" attribute to limit CSS to this component only -->
126
+ <style scoped lang="scss">
127
+
128
+ .slides-block {
129
+ pointer-events: auto;
130
+ &.el-main {
131
+ padding: 5px;
132
+ &::-webkit-scrollbar {
133
+ width: 10px;
134
+ }
135
+
136
+ &::-webkit-scrollbar-thumb {
137
+ border-radius: 10px;
138
+ box-shadow: inset 0 0 6px #c0c4cc;
139
+ }
140
+ }
141
+ }
142
+
143
+ .my-slider {
144
+ top: -6px;
145
+ position: relative;
146
+ }
147
+
148
+ .pointset-container {
149
+ width: 250px;
150
+ height: auto;
151
+ overflow-y: none;
152
+ }
153
+
154
+ .input-box {
155
+ width: 42px;
156
+ border-radius: 4px;
157
+ border: 1px solid rgb(144, 147, 153);
158
+ background-color: var(--white);
159
+ font-weight: 500;
160
+ color: rgb(48, 49, 51);
161
+ margin-left: 8px;
162
+ height: 24px;
163
+
164
+ &.number-input {
165
+ width: 42px;
166
+ :deep(.el-input__wrapper) {
167
+ padding-left: 0px;
168
+ padding-right: 0px;
169
+ }
170
+ }
171
+
172
+ :deep(.el-select__wrapper) {
173
+ height: 24px;
174
+ padding: 0;
175
+ min-height: unset;
176
+ }
177
+
178
+ :deep(.el-select__selection) {
179
+ color: $app-primary-color;
180
+ height: 22px;
181
+ padding-left: 4px;
182
+ padding-right: 8px;
183
+ border: none;
184
+ font-family: "Asap", sans-serif;
185
+ line-height: 22px;
186
+ }
187
+
188
+ :deep(.el-select__suffix),
189
+ :deep(.el-icon) {
190
+ line-height: 22px;
191
+ }
192
+ }
193
+
194
+ </style>
@@ -5,14 +5,35 @@
5
5
  :class="{ open: drawerOpen, close: !drawerOpen }"
6
6
  >
7
7
  <div class="my-drawer" :class="{ open: drawerOpen, close: !drawerOpen }">
8
- <opacity-controls
9
- :material="material"
10
- :zincObject="zincObject"
11
- ref="opacityControls" />
12
- <texture-slides-controls
13
- v-show="isTextureSlides"
14
- class="texture-controls"
15
- ref="tSlidesControls" />
8
+ <el-collapse class="collapse" v-model="activeName" accordion>
9
+ <el-collapse-item title="Opacity" name="oControls" v-show="!isTextureSlides" >
10
+ <opacity-controls
11
+ :material="material"
12
+ :zincObject="zincObject"
13
+ ref="opacityControls" />
14
+ </el-collapse-item>
15
+ <el-collapse-item title="Transformation" name="trControls">
16
+ <transformation-controls
17
+ class="transformation-controls"
18
+ ref="transformationControls" />
19
+ </el-collapse-item>
20
+ <el-collapse-item v-show="isTextureSlides" title="Texture Slides" name="tsControls">
21
+ <texture-slides-controls
22
+ class="texture-controls"
23
+ ref="tSlidesControls" />
24
+ </el-collapse-item>
25
+ <el-collapse-item v-show="isPointset" title="Points" name="pControls">
26
+ <points-controls
27
+ class="pointset-controls"
28
+ ref="pointsetControls" />
29
+ </el-collapse-item>
30
+ <el-collapse-item v-show="isLines" title="Lines" name="lControls">
31
+ <lines-controls
32
+ class="lines-controls"
33
+ ref="linesControls"
34
+ :createData="createData" />
35
+ </el-collapse-item>
36
+ </el-collapse>
16
37
  </div>
17
38
  <div
18
39
  class="drawer-button"
@@ -29,9 +50,17 @@
29
50
  import { ref, shallowRef } from 'vue';
30
51
  import {
31
52
  ArrowRight as ElIconArrowRight,
32
- } from '@element-plus/icons-vue'
53
+ } from '@element-plus/icons-vue';
54
+ import {
55
+ ElCollapse as Collapse,
56
+ ElCollapseItem as CollapseItem,
57
+ } from "element-plus";
58
+
33
59
  import OpacityControls from "./OpacityControls.vue";
60
+ import PointsControls from "./PointsControls.vue";
61
+ import LinesControls from "./LinesControls.vue";
34
62
  import TextureSlidesControls from "./TextureSlidesControls.vue";
63
+ import TransformationControls from "./TransformationControls.vue";
35
64
 
36
65
  /**
37
66
  * A component to control the opacity of the target object.
@@ -39,13 +68,27 @@ import TextureSlidesControls from "./TextureSlidesControls.vue";
39
68
  export default {
40
69
  name: "PrimitiveControls",
41
70
  components: {
71
+ Collapse,
72
+ CollapseItem,
73
+ LinesControls,
42
74
  OpacityControls,
75
+ PointsControls,
43
76
  TextureSlidesControls,
77
+ TransformationControls,
78
+ ElIconArrowRight,
79
+ },
80
+ props: {
81
+ createData: {
82
+ type: Object,
83
+ },
44
84
  },
45
85
  data: function() {
46
86
  return {
87
+ activeName: "oControls",
47
88
  material: undefined,
48
89
  isTextureSlides: false,
90
+ isPointset: false,
91
+ isLines: false,
49
92
  drawerOpen: true,
50
93
  zincObject: undefined,
51
94
  };
@@ -59,12 +102,32 @@ export default {
59
102
  this.drawerOpen = !this.drawerOpen;
60
103
  },
61
104
  setObject: function(object) {
62
- this.zincObject = shallowRef(object);
63
- if (object.isTextureSlides) {
64
- this.isTextureSlides = true;
65
- this.$refs.tSlidesControls.setObject(object);
105
+ if (object) {
106
+ this.zincObject = shallowRef(object);
66
107
  } else {
67
- this.isTextureSlides = false;
108
+ this.zincObject = undefined;
109
+ }
110
+ this.isPointset = false;
111
+ this.isTextureSlides = false;
112
+ this.isLines = false;
113
+ this.activeName = "oControls";
114
+ if (object) {
115
+ if (object.isTextureSlides) {
116
+ this.isTextureSlides = true;
117
+ this.$refs.tSlidesControls.setObject(object);
118
+ this.activeName = "tsControls";
119
+ } else if (object.isPointset) {
120
+ this.isPointset = true;
121
+ this.$refs.pointsetControls.setObject(object);
122
+ this.activeName = "pControls";
123
+ } else if (object.isLines2) {
124
+ this.isLines = true;
125
+ this.$refs.linesControls.setObject(object);
126
+ this.activeName = "lControls";
127
+ }
128
+ if (!object.isTextureSlides) {
129
+ this.$refs.transformationControls.setObject(object);
130
+ }
68
131
  }
69
132
  if (object && object.getMorph()) {
70
133
  this.material = ref(object.getMorph().material);
@@ -81,7 +144,6 @@ export default {
81
144
  .primitive-controls {
82
145
  position: absolute;
83
146
  bottom: 30%;
84
- pointer-events:none;
85
147
  transition: all 1s ease;
86
148
 
87
149
  &.open {
@@ -103,9 +165,17 @@ export default {
103
165
  float: right;
104
166
  max-height: 150px;
105
167
  text-align: left;
106
- border: 1px solid rgb(220, 223, 230);
107
168
  background: #ffffff;
108
169
  width:250px;
170
+ .collapse {
171
+ border: 1px solid rgb(220, 223, 230);
172
+ :deep(.el-collapse-item__header) {
173
+ padding-left: 8px;
174
+ }
175
+ :deep(.el-collapse-item__content) {
176
+ padding-bottom: 8px;
177
+ }
178
+ }
109
179
  }
110
180
 
111
181
  .drawer-button {
@@ -9,13 +9,20 @@
9
9
  trigger="manual"
10
10
  popper-class="tooltip-popper non-selectable"
11
11
  virtual-triggering
12
+ @hide="hideTriggered"
12
13
  >
13
14
  <template #default>
14
15
  <div class="tooltip-text">{{ label }}</div>
15
16
  <div class="tooltip-text" v-if="region">Region: {{ region }}</div>
17
+ <CreateTooltiipContent
18
+ v-show="createData.toBeConfirmed"
19
+ :createData="createData"
20
+ @confirm-create="$emit('confirm-create', $event)"
21
+ @cancel-create="$emit('cancel-create')"
22
+ />
16
23
  <Tooltip
17
24
  class="p-tooltip"
18
- v-show="annotationDisplay"
25
+ v-show="annotationDisplay && !createData.toBeConfirmed"
19
26
  ref="annotationTooltip"
20
27
  :annotationDisplay="true"
21
28
  :annotationEntry="annotationEntry"
@@ -28,6 +35,7 @@
28
35
  <script>
29
36
  /* eslint-disable no-alert, no-console */
30
37
  import { ElPopover as Popover } from "element-plus";
38
+ import CreateTooltiipContent from "./CreateTooltipContent.vue";
31
39
  import { Tooltip } from "@abi-software/flatmapvuer";
32
40
  import "@abi-software/flatmapvuer/dist/style.css";
33
41
  import { mapState } from 'pinia';
@@ -39,10 +47,21 @@ import { useMainStore } from "@/store/index";
39
47
  export default {
40
48
  name: "ScaffoldTooltip",
41
49
  components: {
50
+ CreateTooltiipContent,
42
51
  Popover,
43
52
  Tooltip,
44
53
  },
45
54
  props: {
55
+ createData: {
56
+ type: Object,
57
+ default: {
58
+ toBeConfirmed: false,
59
+ points: [],
60
+ shape: "",
61
+ x: 0,
62
+ y: 0,
63
+ }
64
+ },
46
65
  label: {
47
66
  type: String,
48
67
  default: "",
@@ -108,7 +127,12 @@ export default {
108
127
  this.display = false;
109
128
  this.annotationEntry = { };
110
129
  }
111
- }
130
+ },
131
+ hideTriggered: function() {
132
+ if (this.createData.toBeConfirmed) {
133
+ this.$emit('cancel-create');
134
+ }
135
+ },
112
136
  },
113
137
  watch: {
114
138
  label: {