Browse Source

started moving the modules to a different structure

Raanan Weber 7 năm trước cách đây
mục cha
commit
cdefcc8f05

+ 0 - 52
Viewer/src/configuration/configuration.ts

@@ -110,58 +110,6 @@ export interface ViewerConfiguration {
     }
 }
 
-/**
- * Defines an animation to be applied to a model (translation, scale or rotation).
- */
-export interface IModelAnimationConfiguration {
-    /**
-     * Time of animation, in seconds
-     */
-    time?: number;
-
-    /**
-     * Scale to apply
-     */
-    scaling?: {
-        x: number;
-        y: number;
-        z: number;
-    };
-
-    /**
-     * Easing function to apply
-     * See SPECTRE.EasingFunction
-     */
-    easingFunction?: number;
-
-    /**
-     * An Easing mode to apply to the easing function
-     * See BABYLON.EasingFunction
-     */
-    easingMode?: number;
-}
-
-
-export interface IDefaultRenderingPipelineConfiguration {
-    sharpenEnabled?: boolean;
-    bloomEnabled?: boolean;
-    bloomThreshold?: number;
-    depthOfFieldEnabled?: boolean;
-    depthOfFieldBlurLevel?: DepthOfFieldEffectBlurLevel;
-    fxaaEnabled?: boolean;
-    imageProcessingEnabled?: boolean;
-    defaultPipelineTextureType?: number;
-    bloomScale?: number;
-    chromaticAberrationEnabled?: boolean;
-    grainEnabled?: boolean;
-    bloomKernel?: number;
-    hardwareScaleLevel?: number;
-    bloomWeight?: number;
-    hdr?: boolean;
-    samples?: number;
-    glowLayerEnabled?: boolean;
-}
-
 export interface IModelConfiguration {
     id?: string;
     url?: string;

+ 21 - 0
Viewer/src/configuration/interfaces/defaultRenderingPipelineConfiguration.ts

@@ -0,0 +1,21 @@
+import { DepthOfFieldEffectBlurLevel } from 'babylonjs';
+
+export interface IDefaultRenderingPipelineConfiguration {
+    sharpenEnabled?: boolean;
+    bloomEnabled?: boolean;
+    bloomThreshold?: number;
+    depthOfFieldEnabled?: boolean;
+    depthOfFieldBlurLevel?: DepthOfFieldEffectBlurLevel;
+    fxaaEnabled?: boolean;
+    imageProcessingEnabled?: boolean;
+    defaultPipelineTextureType?: number;
+    bloomScale?: number;
+    chromaticAberrationEnabled?: boolean;
+    grainEnabled?: boolean;
+    bloomKernel?: number;
+    hardwareScaleLevel?: number;
+    bloomWeight?: number;
+    hdr?: boolean;
+    samples?: number;
+    glowLayerEnabled?: boolean;
+}

+ 29 - 0
Viewer/src/configuration/interfaces/modelAnimationConfiguration.ts

@@ -0,0 +1,29 @@
+/**
+ * Defines an animation to be applied to a model (translation, scale or rotation).
+ */
+export interface IModelAnimationConfiguration {
+    /**
+     * Time of animation, in seconds
+     */
+    time?: number;
+
+    /**
+     * Scale to apply
+     */
+    scaling?: {
+        x: number;
+        y: number;
+        z: number;
+    };
+
+    /**
+     * Easing function to apply
+     */
+    easingFunction?: number;
+
+    /**
+     * An Easing mode to apply to the easing function
+     * See BABYLON.EasingFunction
+     */
+    easingMode?: number;
+}

+ 0 - 0
Viewer/src/configuration/interfaces/modelConfiguration.ts


+ 46 - 0
Viewer/src/configuration/interfaces/templateConfiguration.ts

@@ -0,0 +1,46 @@
+/**
+ * A single template configuration object
+ */
+export interface ITemplateConfiguration {
+    /**
+     * can be either the id of the template's html element or a URL.
+     * See - http://doc.babylonjs.com/extensions/the_templating_system#location-vs-html
+     */
+    location?: string; // #template-id OR http://example.com/loading.html
+    /**
+     * If no location is provided you can provide here the raw html of this template.
+     * See http://doc.babylonjs.com/extensions/the_templating_system#location-vs-html
+     */
+    html?: string; // raw html string
+    id?: string;
+    /**
+     * Parameters that will be delivered to the template and will render it accordingly.
+     */
+    params?: { [key: string]: string | number | boolean | object };
+    /**
+     * Events to attach to this template.
+     * event name is the key. the value can either be a boolean (attach to the parent element)
+     * or a map of html id elements.
+     * 
+     * See - http://doc.babylonjs.com/extensions/the_templating_system#event-binding
+     */
+    events?: {
+        // pointer events
+        pointerdown?: boolean | { [id: string]: boolean; };
+        pointerup?: boolean | { [id: string]: boolean; };
+        pointermove?: boolean | { [id: string]: boolean; };
+        pointerover?: boolean | { [id: string]: boolean; };
+        pointerout?: boolean | { [id: string]: boolean; };
+        pointerenter?: boolean | { [id: string]: boolean; };
+        pointerleave?: boolean | { [id: string]: boolean; };
+        pointercancel?: boolean | { [id: string]: boolean; };
+        //click, just in case
+        click?: boolean | { [id: string]: boolean; };
+        // drag and drop
+        dragstart?: boolean | { [id: string]: boolean; };
+        drop?: boolean | { [id: string]: boolean; };
+
+
+        [key: string]: boolean | { [id: string]: boolean; } | undefined;
+    }
+}

Viewer/src/helper.ts → Viewer/src/helper/index.ts


Viewer/src/eventManager.ts → Viewer/src/templating/eventManager.ts


+ 4 - 51
Viewer/src/templateManager.ts

@@ -1,54 +1,10 @@
 
 import { Observable, IFileRequest, Tools } from 'babylonjs';
-import { isUrl, camelToKebab, kebabToCamel } from './helper';
-import * as deepmerge from '../assets/deepmerge.min.js';
+import { isUrl, camelToKebab, kebabToCamel } from '../helper';
+import * as deepmerge from 'deepmerge';
 
-/**
- * A single template configuration object
- */
-export interface ITemplateConfiguration {
-    /**
-     * can be either the id of the template's html element or a URL.
-     * See - http://doc.babylonjs.com/extensions/the_templating_system#location-vs-html
-     */
-    location?: string; // #template-id OR http://example.com/loading.html
-    /**
-     * If no location is provided you can provide here the raw html of this template.
-     * See http://doc.babylonjs.com/extensions/the_templating_system#location-vs-html
-     */
-    html?: string; // raw html string
-    id?: string;
-    /**
-     * Parameters that will be delivered to the template and will render it accordingly.
-     */
-    params?: { [key: string]: string | number | boolean | object };
-    /**
-     * Events to attach to this template.
-     * event name is the key. the value can either be a boolean (attach to the parent element)
-     * or a map of html id elements.
-     * 
-     * See - http://doc.babylonjs.com/extensions/the_templating_system#event-binding
-     */
-    events?: {
-        // pointer events
-        pointerdown?: boolean | { [id: string]: boolean; };
-        pointerup?: boolean | { [id: string]: boolean; };
-        pointermove?: boolean | { [id: string]: boolean; };
-        pointerover?: boolean | { [id: string]: boolean; };
-        pointerout?: boolean | { [id: string]: boolean; };
-        pointerenter?: boolean | { [id: string]: boolean; };
-        pointerleave?: boolean | { [id: string]: boolean; };
-        pointercancel?: boolean | { [id: string]: boolean; };
-        //click, just in case
-        click?: boolean | { [id: string]: boolean; };
-        // drag and drop
-        dragstart?: boolean | { [id: string]: boolean; };
-        drop?: boolean | { [id: string]: boolean; };
-
-
-        [key: string]: boolean | { [id: string]: boolean; } | undefined;
-    }
-}
+import * as Handlebars from 'handlebars';
+import { EventManager } from './eventManager';
 
 /**
  * The object sent when an event is triggered
@@ -242,9 +198,6 @@ export class TemplateManager {
 
 }
 
-
-import * as Handlebars from '../assets/handlebars.min.js';
-import { EventManager } from './eventManager';
 // register a new helper. modified https://stackoverflow.com/questions/9838925/is-there-any-method-to-iterate-a-map-with-handlebars-js
 Handlebars.registerHelper('eachInMap', function (map, block) {
     var out = '';