vizualization updates
This commit is contained in:
62
src/shared/model/builder/assets/asset-Model.ts
Normal file
62
src/shared/model/builder/assets/asset-Model.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
import mongoose, { Document, Schema } from "mongoose";
|
||||
import MainModel from "../../../connect/mongoose.ts";
|
||||
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface assetData extends Document {
|
||||
modeluuid: string;
|
||||
modelfileID: string;
|
||||
modelname: string;
|
||||
isLocked: boolean;
|
||||
isVisible: boolean;
|
||||
position: [];
|
||||
rotation: {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
};
|
||||
points: [
|
||||
{
|
||||
uuid: string;
|
||||
position: [];
|
||||
rotation: [];
|
||||
actions: [mongoose.Types.ObjectId];
|
||||
triggers: [mongoose.Types.ObjectId];
|
||||
// connections:{
|
||||
// source:{
|
||||
// pathuuid:string,pointuuid:string
|
||||
// },
|
||||
// target:[]
|
||||
// }
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
// Define the Mongoose Schema
|
||||
const assetDataSchema: Schema = new Schema({
|
||||
modeluuid: { type: String },
|
||||
modelfileID: { type: String },
|
||||
modelname: { type: String },
|
||||
position: { type: Array },
|
||||
points: [
|
||||
{
|
||||
uuid: { type: String },
|
||||
position: { type: Array },
|
||||
rotation: { type: Array },
|
||||
actions: [{ type: mongoose.Schema.Types.ObjectId, ref: "Widget" }],
|
||||
triggers: [{ type: mongoose.Schema.Types.ObjectId, ref: "Widget" }],
|
||||
},
|
||||
],
|
||||
isLocked: { type: Boolean },
|
||||
isVisible: { type: Boolean },
|
||||
rotation: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true },
|
||||
},
|
||||
});
|
||||
|
||||
// export default floorItemsModel;
|
||||
const assetModel = (db: string) => {
|
||||
return MainModel(db, "Assets", assetDataSchema, "Assets");
|
||||
};
|
||||
export default assetModel;
|
||||
59
src/shared/model/builder/assets/pointSchema.ts
Normal file
59
src/shared/model/builder/assets/pointSchema.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import mongoose, { Document, Schema } from "mongoose";
|
||||
import MainModel from "../../../connect/mongoose.ts";
|
||||
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface Points extends Document {
|
||||
modelfileID: string;
|
||||
points: {
|
||||
uuid: string;
|
||||
position: number[];
|
||||
rotation: number[];
|
||||
actions: string[];
|
||||
triggers: string[];
|
||||
}[];
|
||||
}
|
||||
const defaultPoints = [
|
||||
{
|
||||
uuid: "",
|
||||
position: [0, 1.25, 3.3],
|
||||
rotation: [0, 0, 0],
|
||||
actions: [],
|
||||
triggers: [],
|
||||
},
|
||||
{
|
||||
uuid: "",
|
||||
position: [0, 1.25, 3.3],
|
||||
rotation: [0, 0, 0],
|
||||
actions: [],
|
||||
triggers: [],
|
||||
},
|
||||
{
|
||||
uuid: "",
|
||||
position: [0, 1.25, 3.3],
|
||||
rotation: [0, 0, 0],
|
||||
actions: [],
|
||||
triggers: [],
|
||||
},
|
||||
];
|
||||
// Define the Mongoose Schema
|
||||
const pointSchema: Schema = new Schema({
|
||||
modelfileID: { type: String, required: true },
|
||||
points: {
|
||||
type: [
|
||||
{
|
||||
uuid: { type: String },
|
||||
position: { type: [Number], default: [0, 1.25, 3.3] },
|
||||
rotation: { type: [Number], default: [0, 0, 0] },
|
||||
actions: { type: [String], default: [] },
|
||||
triggers: { type: [String], default: [] },
|
||||
},
|
||||
],
|
||||
default: defaultPoints,
|
||||
},
|
||||
});
|
||||
|
||||
const pointModel = (db: string) => {
|
||||
return MainModel(db, "Points", pointSchema, "Points");
|
||||
};
|
||||
|
||||
export default pointModel;
|
||||
31
src/shared/model/builder/assets/wallitems-Model.ts
Normal file
31
src/shared/model/builder/assets/wallitems-Model.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import mongoose, { Document, Schema } from "mongoose";
|
||||
import MainModel from "../../../connect/mongoose.ts";
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface wallitems extends Document {
|
||||
modeluuid: string;
|
||||
modelname: string;
|
||||
type: string;
|
||||
csgposition: [];
|
||||
csgscale: [];
|
||||
position: [];
|
||||
quaternion: [];
|
||||
scale: [];
|
||||
}
|
||||
|
||||
// Define the Mongoose Schema
|
||||
const wallItemsSchema: Schema = new Schema({
|
||||
modeluuid: { type: String, unique: true },
|
||||
modelname: { type: String },
|
||||
type: { type: String },
|
||||
csgposition: { type: Array },
|
||||
csgscale: { type: Array },
|
||||
position: { type: Array },
|
||||
quaternion: { type: Array },
|
||||
scale: { type: Array },
|
||||
});
|
||||
|
||||
// export default wallItenmModel;
|
||||
const wallItenmModel = (db: string) => {
|
||||
return MainModel(db, "wallitems", wallItemsSchema, "wallitems");
|
||||
};
|
||||
export default wallItenmModel;
|
||||
48
src/shared/model/builder/camera/camera-Model.ts
Normal file
48
src/shared/model/builder/camera/camera-Model.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import mongoose, { Document, Schema } from "mongoose";
|
||||
import MainModel from "../../../connect/mongoose.ts";
|
||||
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface Camera extends Document {
|
||||
userId: string;
|
||||
position: {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
};
|
||||
target: {
|
||||
x: { type: Number; required: true };
|
||||
y: { type: Number; required: true };
|
||||
z: { type: Number; required: true };
|
||||
};
|
||||
rotation: {
|
||||
x: { type: Number; required: true };
|
||||
y: { type: Number; required: true };
|
||||
z: { type: Number; required: true };
|
||||
};
|
||||
}
|
||||
|
||||
// Define the Mongoose Schema
|
||||
const cameraSchema: Schema = new Schema({
|
||||
userId: { type: String },
|
||||
position: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true },
|
||||
},
|
||||
target: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true },
|
||||
},
|
||||
rotation: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true },
|
||||
},
|
||||
});
|
||||
|
||||
// export default cameraModel
|
||||
const cameraModel = (db: string) => {
|
||||
return MainModel(db, "Camera", cameraSchema, "Camera");
|
||||
};
|
||||
export default cameraModel;
|
||||
24
src/shared/model/builder/environments/environments-Model.ts
Normal file
24
src/shared/model/builder/environments/environments-Model.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import mongoose, { Document, Schema } from 'mongoose';
|
||||
import MainModel from '../../../connect/mongoose.ts';
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface environment extends Document {
|
||||
userId: string;
|
||||
roofVisibility: boolean
|
||||
wallVisibility: boolean
|
||||
}
|
||||
|
||||
// Define the Mongoose Schema
|
||||
const environmentSchema: Schema = new Schema({
|
||||
userId: { type: String, unique: true },
|
||||
roofVisibility: { type: Boolean, default: false },
|
||||
wallVisibility: { type: Boolean, default: false },
|
||||
shadowVisibility: { type: Boolean, default: false },
|
||||
});
|
||||
|
||||
|
||||
|
||||
// export default environmentModel;
|
||||
const environmentModel = (db: string) => {
|
||||
return MainModel(db, "environments", environmentSchema, "environments")
|
||||
};
|
||||
export default environmentModel;
|
||||
26
src/shared/model/builder/lines/lines-Model.ts
Normal file
26
src/shared/model/builder/lines/lines-Model.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import mongoose, { Document, Schema } from "mongoose";
|
||||
import MainModel from "../../../connect/mongoose.ts";
|
||||
const positionSchema = new mongoose.Schema({
|
||||
x: { type: Number }, // Optional position fields
|
||||
y: { type: Number },
|
||||
z: { type: Number },
|
||||
});
|
||||
|
||||
// Define a schema for the individual line
|
||||
const Vector3 = new mongoose.Schema({
|
||||
position: { type: positionSchema, required: false }, // Optional position
|
||||
uuid: { type: String, required: false }, // Optional uuid
|
||||
});
|
||||
|
||||
// Define the main schema
|
||||
const LineSchema = new mongoose.Schema({
|
||||
layer: { type: Number, required: true }, // Layer is mandatory
|
||||
line: { type: [Vector3], required: true }, // Array of line objects
|
||||
type: { type: String, required: false }, // Optional type
|
||||
});
|
||||
|
||||
// export default lineModel;
|
||||
const lineModel = (db: string) => {
|
||||
return MainModel(db, "lines", LineSchema, "lines");
|
||||
};
|
||||
export default lineModel;
|
||||
84
src/shared/model/builder/lines/zone-Model.ts
Normal file
84
src/shared/model/builder/lines/zone-Model.ts
Normal file
@@ -0,0 +1,84 @@
|
||||
// import mongoose, { Schema, Document, model } from "mongoose";
|
||||
// import MainModel from "../../../connect/mongoose.ts";
|
||||
|
||||
// export interface Zone extends Document {
|
||||
// zoneName: string;
|
||||
// // zoneUUID: string;
|
||||
// zonePoints: [];
|
||||
// centerPoints: [];
|
||||
// isArchive: boolean;
|
||||
// createdBy: string;
|
||||
// sceneID: string;
|
||||
// // createdBy: mongoose.Types.ObjectId;
|
||||
// // sceneID: mongoose.Types.ObjectId;
|
||||
// layer: number;
|
||||
// }
|
||||
// const zoneSchema: Schema = new Schema(
|
||||
// {
|
||||
// zoneName: { type: String },
|
||||
// // zoneUUID: { type: String },
|
||||
// createdBy: { type: String },
|
||||
// sceneID: { type: String },
|
||||
// layer: { type: Number },
|
||||
// centerPoints: { type: Array },
|
||||
// zonePoints: { type: Array },
|
||||
// isArchive: { type: Boolean, default: false },
|
||||
// // createdBy: { type: mongoose.Schema.Types.ObjectId, ref: "User" },
|
||||
// // sceneID: { type: mongoose.Schema.Types.ObjectId, ref: "Scene" },
|
||||
// },
|
||||
// { timestamps: true }
|
||||
// );
|
||||
|
||||
// const dataModel = (db: any) => {
|
||||
// return MainModel(db, "Zones", zoneSchema, "Zones");
|
||||
// };
|
||||
// export default dataModel;
|
||||
|
||||
import mongoose, { Schema, Document, model } from "mongoose";
|
||||
import MainModel from "../../../connect/mongoose.ts";
|
||||
|
||||
export interface Zone extends Document {
|
||||
zoneName: string;
|
||||
zoneId: string;
|
||||
zonePoints: [];
|
||||
viewPortCenter: [];
|
||||
viewPortposition: [];
|
||||
isArchive: boolean;
|
||||
createdBy: string;
|
||||
sceneID: string;
|
||||
panelOrder: string[];
|
||||
lockedPanel: string[];
|
||||
// createdBy: mongoose.Types.ObjectId;
|
||||
// sceneID: mongoose.Types.ObjectId;
|
||||
layer: number;
|
||||
}
|
||||
const zoneSchema: Schema = new Schema(
|
||||
{
|
||||
zoneName: { type: String },
|
||||
zoneId: { type: String },
|
||||
createdBy: { type: String },
|
||||
sceneID: { type: String },
|
||||
layer: { type: Number },
|
||||
points: { type: Array },
|
||||
isArchive: { type: Boolean, default: false },
|
||||
panelOrder: {
|
||||
type: [String],
|
||||
enum: ["left", "right", "up", "down"],
|
||||
},
|
||||
viewPortCenter: { type: Array, required: true },
|
||||
viewPortposition: { type: Array, required: true },
|
||||
lockedPanel: {
|
||||
type: [String],
|
||||
default: [],
|
||||
enum: ["left", "right", "up", "down"],
|
||||
},
|
||||
// createdBy: { type: mongoose.Schema.Types.ObjectId, ref: "User" },
|
||||
// sceneID: { type: mongoose.Schema.Types.ObjectId, ref: "Scene" },
|
||||
},
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
const zoneModel = (db: any) => {
|
||||
return MainModel(db, "zones", zoneSchema, "zones");
|
||||
};
|
||||
export default zoneModel;
|
||||
Reference in New Issue
Block a user