Commit 7723b22b authored by Luna Riegel's avatar Luna Riegel
Browse files

Add object library icons and onclick

parent 58a77157
<template> <template>
<v-sheet> <v-sheet>
<VcsFormSection heading="Objektbibliothek"> <VcsFormSection heading="Objektbibliothek" expandable>
<template #help> <template #help>
<p>Objektbibliothek:</p> <p>Objektbibliothek:</p>
<span>Die Objektbibliothek.</span> <span>Die Objektbibliothek.</span>
</template> </template>
<template #default> <template #default>
<v-expansion-panels v-for = "(subcats, categoryName) in objLib" :key="categoryName"> <v-expansion-panels v-for = "(subcats, categoryName) in objLib" :key="categoryName">
<v-expansion-panel title="categoryName"> <v-expansion-panel >
<v-expansion-panel-title>{{ categoryName }}</v-expansion-panel-title> <v-expansion-panel-title>{{ categoryName }}</v-expansion-panel-title>
<v-container class="py-1 px-1"> <v-container v-for="(entries, subCategory) in subcats" :key = "subCategory" class="py-1 px-1">
<v-list v-for="(entries, subCategory) in subcats" :key = "subCategory" title="subCategory"> <VcsLabel>{{subCategory}}</VcsLabel>
<v-list>
<v-row>
<v-list-item <v-list-item
v-for="entry in entries" v-for="entry in entries"
:key="entry.title" :key="entry.title"
class="d-flex align-center" class="d-flex align-center"
@click="fetchCatalogueModel(entry.model)"
style ="cursor: pointer;"
> >
<template #prepend> <img :src="entry.icon" :alt="entry.icon"/>
<v-avatar size="32">
<img :src="entry.icon" :alt="entry.title" />
</v-avatar>
</template>
<v-list-item-title>{{ entry.title }}</v-list-item-title>
</v-list-item> </v-list-item>
</v-row>
</v-list> </v-list>
<v-divider/>
</v-container> </v-container>
</v-expansion-panel> </v-expansion-panel>
</v-expansion-panels> </v-expansion-panels>
...@@ -101,9 +100,11 @@ ...@@ -101,9 +100,11 @@
<script> <script>
import { import {
Icons, Icons,
NotificationType, VcsExpansionPanel, NotificationType,
VcsExpansionPanel,
VcsFormButton, VcsFormButton,
VcsFormSection, VcsFormSection,
VcsLabel,
VcsList, VcsList,
VcsTextField, VcsTextField,
VcsTreeview, VcsTreeview,
...@@ -118,6 +119,7 @@ import {GLTFExporter} from 'three/addons/exporters/GLTFExporter.js'; ...@@ -118,6 +119,7 @@ import {GLTFExporter} from 'three/addons/exporters/GLTFExporter.js';
import {Cartesian2} from '@vcmap-cesium/engine'; import {Cartesian2} from '@vcmap-cesium/engine';
const objLib = ref({}); const objLib = ref({});
const preloadedModels = ref({});
const defaultItems = []; const defaultItems = [];
const items = ref(defaultItems); const items = ref(defaultItems);
...@@ -205,6 +207,15 @@ function getCatalogueEntries(json, linkPrefix) { ...@@ -205,6 +207,15 @@ function getCatalogueEntries(json, linkPrefix) {
return part; return part;
} }
function retrieveCatalogModel(modelLink){
console.log(modelLink);
if(preloadedModels.value[modelLink] != null){
} else {
}
}
function uploadModel() { function uploadModel() {
// Create an input element // Create an input element
const inputElement = document.createElement("input"); const inputElement = document.createElement("input");
...@@ -312,6 +323,7 @@ function uploadModel() { ...@@ -312,6 +323,7 @@ function uploadModel() {
export default { export default {
name: 'objectList', name: 'objectList',
components: { components: {
VcsLabel,
VcsExpansionPanel, VcsExpansionPanel,
VcsTreeview, VcsTreeview,
VcsTreeviewTitle, VcsTreeviewTitle,
...@@ -449,6 +461,9 @@ function uploadModel() { ...@@ -449,6 +461,9 @@ function uploadModel() {
loadModel() { loadModel() {
uploadModel(); uploadModel();
}, },
fetchCatalogueModel(modelLink) {
retrieveCatalogModel(modelLink);
},
loadConfiguration() { loadConfiguration() {
loadObjects(app); loadObjects(app);
}, },
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment