@shapediver/viewer.shared.types 1.15.7 → 2.0.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/dist/implementation/data/AnimationData.d.ts +32 -0
- package/dist/implementation/data/AnimationData.d.ts.map +1 -0
- package/dist/{data → implementation/data}/AnimationData.js +8 -3
- package/dist/implementation/data/AnimationData.js.map +1 -0
- package/dist/implementation/data/BoneData.d.ts +15 -0
- package/dist/implementation/data/BoneData.d.ts.map +1 -0
- package/dist/implementation/data/BoneData.js +25 -0
- package/dist/implementation/data/BoneData.js.map +1 -0
- package/dist/{data → implementation/data}/CustomData.d.ts +4 -3
- package/dist/implementation/data/CustomData.d.ts.map +1 -0
- package/dist/{data → implementation/data}/CustomData.js +0 -0
- package/dist/implementation/data/CustomData.js.map +1 -0
- package/dist/{data → implementation/data}/GeometryData.d.ts +31 -39
- package/dist/implementation/data/GeometryData.d.ts.map +1 -0
- package/dist/{data → implementation/data}/GeometryData.js +9 -16
- package/dist/implementation/data/GeometryData.js.map +1 -0
- package/dist/{data → implementation/data}/HTMLElementAnchorData.d.ts +20 -40
- package/dist/implementation/data/HTMLElementAnchorData.d.ts.map +1 -0
- package/dist/{data → implementation/data}/HTMLElementAnchorData.js +15 -15
- package/dist/implementation/data/HTMLElementAnchorData.js.map +1 -0
- package/dist/implementation/material/AbstractMaterialData.d.ts +64 -0
- package/dist/implementation/material/AbstractMaterialData.d.ts.map +1 -0
- package/dist/{data → implementation}/material/AbstractMaterialData.js +6 -22
- package/dist/implementation/material/AbstractMaterialData.js.map +1 -0
- package/dist/{data → implementation}/material/MapData.d.ts +4 -16
- package/dist/implementation/material/MapData.d.ts.map +1 -0
- package/dist/{data → implementation}/material/MapData.js +10 -23
- package/dist/implementation/material/MapData.js.map +1 -0
- package/dist/implementation/material/MaterialSpecularGlossinessData.d.ts +27 -0
- package/dist/implementation/material/MaterialSpecularGlossinessData.d.ts.map +1 -0
- package/dist/{data → implementation}/material/MaterialSpecularGlossinessData.js +26 -25
- package/dist/implementation/material/MaterialSpecularGlossinessData.js.map +1 -0
- package/dist/implementation/material/MaterialStandardData.d.ts +75 -0
- package/dist/implementation/material/MaterialStandardData.d.ts.map +1 -0
- package/dist/{data → implementation}/material/MaterialStandardData.js +5 -4
- package/dist/implementation/material/MaterialStandardData.js.map +1 -0
- package/dist/implementation/material/MaterialUnlitData.d.ts +15 -0
- package/dist/implementation/material/MaterialUnlitData.d.ts.map +1 -0
- package/dist/{data → implementation}/material/MaterialUnlitData.js +5 -5
- package/dist/implementation/material/MaterialUnlitData.js.map +1 -0
- package/dist/implementation/material/MaterialVariantsData.d.ts +16 -0
- package/dist/implementation/material/MaterialVariantsData.d.ts.map +1 -0
- package/dist/{data → implementation}/material/MaterialVariantsData.js +0 -0
- package/dist/implementation/material/MaterialVariantsData.js.map +1 -0
- package/dist/implementation/sdtf/SDTFAttributesData.d.ts +23 -0
- package/dist/implementation/sdtf/SDTFAttributesData.d.ts.map +1 -0
- package/dist/{data → implementation}/sdtf/SDTFAttributesData.js +0 -0
- package/dist/implementation/sdtf/SDTFAttributesData.js.map +1 -0
- package/dist/implementation/sdtf/SDTFItemData.d.ts +20 -0
- package/dist/implementation/sdtf/SDTFItemData.d.ts.map +1 -0
- package/dist/{data → implementation}/sdtf/SDTFItemData.js +0 -0
- package/dist/implementation/sdtf/SDTFItemData.js.map +1 -0
- package/dist/implementation/sdtf/SDTFOverviewData.d.ts +13 -0
- package/dist/implementation/sdtf/SDTFOverviewData.d.ts.map +1 -0
- package/dist/{data/sdtf/SDTFAttributeOverview.js → implementation/sdtf/SDTFOverviewData.js} +10 -10
- package/dist/{data/sdtf/SDTFAttributeOverview.js.map → implementation/sdtf/SDTFOverviewData.js.map} +1 -1
- package/dist/index.d.ts +45 -27
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -30
- package/dist/index.js.map +1 -1
- package/dist/interfaces/data/IAnimationData.d.ts +27 -0
- package/dist/interfaces/data/IAnimationData.d.ts.map +1 -0
- package/dist/{events/ISettingsEvent.js → interfaces/data/IAnimationData.js} +1 -1
- package/dist/interfaces/data/IAnimationData.js.map +1 -0
- package/dist/interfaces/data/IBoneData.d.ts +5 -0
- package/dist/interfaces/data/IBoneData.d.ts.map +1 -0
- package/dist/{events/IViewerEvent.js → interfaces/data/IBoneData.js} +1 -1
- package/dist/interfaces/data/IBoneData.js.map +1 -0
- package/dist/interfaces/data/ICustomData.d.ts +8 -0
- package/dist/interfaces/data/ICustomData.d.ts.map +1 -0
- package/dist/interfaces/data/ICustomData.js +3 -0
- package/dist/interfaces/data/ICustomData.js.map +1 -0
- package/dist/interfaces/data/IGeometryData.d.ts +61 -0
- package/dist/interfaces/data/IGeometryData.d.ts.map +1 -0
- package/dist/interfaces/data/IGeometryData.js +14 -0
- package/dist/interfaces/data/IGeometryData.js.map +1 -0
- package/dist/interfaces/data/IHTMLElementAnchorData.d.ts +49 -0
- package/dist/interfaces/data/IHTMLElementAnchorData.d.ts.map +1 -0
- package/dist/interfaces/data/IHTMLElementAnchorData.js +3 -0
- package/dist/interfaces/data/IHTMLElementAnchorData.js.map +1 -0
- package/dist/interfaces/data/material/IMapData.d.ts +31 -0
- package/dist/interfaces/data/material/IMapData.d.ts.map +1 -0
- package/dist/interfaces/data/material/IMapData.js +20 -0
- package/dist/interfaces/data/material/IMapData.js.map +1 -0
- package/dist/interfaces/data/material/IMaterialAbstractData.d.ts +59 -0
- package/dist/interfaces/data/material/IMaterialAbstractData.d.ts.map +1 -0
- package/dist/interfaces/data/material/IMaterialAbstractData.js +21 -0
- package/dist/interfaces/data/material/IMaterialAbstractData.js.map +1 -0
- package/dist/interfaces/data/material/IMaterialSpecularGlossinessDataProperties.d.ts +19 -0
- package/dist/interfaces/data/material/IMaterialSpecularGlossinessDataProperties.d.ts.map +1 -0
- package/dist/interfaces/data/material/IMaterialSpecularGlossinessDataProperties.js +4 -0
- package/dist/interfaces/data/material/IMaterialSpecularGlossinessDataProperties.js.map +1 -0
- package/dist/interfaces/data/material/IMaterialStandardData.d.ts +67 -0
- package/dist/interfaces/data/material/IMaterialStandardData.d.ts.map +1 -0
- package/dist/interfaces/data/material/IMaterialStandardData.js +4 -0
- package/dist/interfaces/data/material/IMaterialStandardData.js.map +1 -0
- package/dist/interfaces/data/material/IMaterialUnlitData.d.ts +8 -0
- package/dist/interfaces/data/material/IMaterialUnlitData.d.ts.map +1 -0
- package/dist/interfaces/data/material/IMaterialUnlitData.js +4 -0
- package/dist/interfaces/data/material/IMaterialUnlitData.js.map +1 -0
- package/dist/interfaces/data/material/IMaterialVariantsData.d.ts +9 -0
- package/dist/interfaces/data/material/IMaterialVariantsData.d.ts.map +1 -0
- package/dist/interfaces/data/material/IMaterialVariantsData.js +3 -0
- package/dist/interfaces/data/material/IMaterialVariantsData.js.map +1 -0
- package/dist/interfaces/events/EventResponseMapping.d.ts +37 -0
- package/dist/interfaces/events/EventResponseMapping.d.ts.map +1 -0
- package/dist/interfaces/events/EventResponseMapping.js +4 -0
- package/dist/interfaces/events/EventResponseMapping.js.map +1 -0
- package/dist/interfaces/events/ICameraEvent.d.ts +5 -0
- package/dist/interfaces/events/ICameraEvent.d.ts.map +1 -0
- package/dist/{events → interfaces/events}/ICameraEvent.js +0 -0
- package/dist/interfaces/events/ICameraEvent.js.map +1 -0
- package/dist/interfaces/events/IDragEvent.d.ts +8 -0
- package/dist/interfaces/events/IDragEvent.d.ts.map +1 -0
- package/dist/interfaces/events/IDragEvent.js +3 -0
- package/dist/interfaces/events/IDragEvent.js.map +1 -0
- package/dist/interfaces/events/IHoverEvent.d.ts +6 -0
- package/dist/interfaces/events/IHoverEvent.d.ts.map +1 -0
- package/dist/interfaces/events/IHoverEvent.js +3 -0
- package/dist/interfaces/events/IHoverEvent.js.map +1 -0
- package/dist/interfaces/events/IMultiSelectEvent.d.ts +7 -0
- package/dist/interfaces/events/IMultiSelectEvent.d.ts.map +1 -0
- package/dist/{events/IEnvironmentEvent.js → interfaces/events/IMultiSelectEvent.js} +1 -1
- package/dist/interfaces/events/IMultiSelectEvent.js.map +1 -0
- package/dist/interfaces/events/ISceneEvent.d.ts +9 -0
- package/dist/interfaces/events/ISceneEvent.d.ts.map +1 -0
- package/dist/{events → interfaces/events}/ISceneEvent.js +0 -0
- package/dist/interfaces/events/ISceneEvent.js.map +1 -0
- package/dist/interfaces/events/ISelectEvent.d.ts +6 -0
- package/dist/interfaces/events/ISelectEvent.d.ts.map +1 -0
- package/dist/interfaces/events/ISelectEvent.js +3 -0
- package/dist/interfaces/events/ISelectEvent.js.map +1 -0
- package/dist/{events → interfaces/events}/ISessionEvent.d.ts +0 -0
- package/dist/interfaces/events/ISessionEvent.d.ts.map +1 -0
- package/dist/{events → interfaces/events}/ISessionEvent.js +0 -0
- package/dist/interfaces/events/ISessionEvent.js.map +1 -0
- package/dist/{events → interfaces/events}/ITaskEvent.d.ts +3 -3
- package/dist/interfaces/events/ITaskEvent.d.ts.map +1 -0
- package/dist/interfaces/events/ITaskEvent.js +15 -0
- package/dist/interfaces/events/ITaskEvent.js.map +1 -0
- package/dist/interfaces/events/IViewportEvent.d.ts +5 -0
- package/dist/interfaces/events/IViewportEvent.d.ts.map +1 -0
- package/dist/interfaces/events/IViewportEvent.js +3 -0
- package/dist/interfaces/events/IViewportEvent.js.map +1 -0
- package/dist/interfaces/sdtf/ISDTFAttributeVisualizationData.d.ts +7 -0
- package/dist/interfaces/sdtf/ISDTFAttributeVisualizationData.d.ts.map +1 -0
- package/dist/interfaces/sdtf/ISDTFAttributeVisualizationData.js +3 -0
- package/dist/interfaces/sdtf/ISDTFAttributeVisualizationData.js.map +1 -0
- package/dist/interfaces/sdtf/ISDTFAttributesData.d.ts +13 -0
- package/dist/interfaces/sdtf/ISDTFAttributesData.d.ts.map +1 -0
- package/dist/interfaces/sdtf/ISDTFAttributesData.js +3 -0
- package/dist/interfaces/sdtf/ISDTFAttributesData.js.map +1 -0
- package/dist/interfaces/sdtf/ISDTFItemData.d.ts +12 -0
- package/dist/interfaces/sdtf/ISDTFItemData.d.ts.map +1 -0
- package/dist/interfaces/sdtf/ISDTFItemData.js +3 -0
- package/dist/interfaces/sdtf/ISDTFItemData.js.map +1 -0
- package/dist/interfaces/sdtf/ISDTFOverviewData.d.ts +17 -0
- package/dist/interfaces/sdtf/ISDTFOverviewData.d.ts.map +1 -0
- package/dist/interfaces/sdtf/ISDTFOverviewData.js +4 -0
- package/dist/interfaces/sdtf/ISDTFOverviewData.js.map +1 -0
- package/package.json +13 -10
- package/src/implementation/data/AnimationData.ts +286 -0
- package/src/implementation/data/BoneData.ts +31 -0
- package/src/implementation/data/CustomData.ts +51 -0
- package/src/implementation/data/GeometryData.ts +399 -0
- package/src/implementation/data/HTMLElementAnchorData.ts +365 -0
- package/src/implementation/material/AbstractMaterialData.ts +233 -0
- package/src/implementation/material/MapData.ts +108 -0
- package/src/implementation/material/MaterialSpecularGlossinessData.ts +166 -0
- package/src/implementation/material/MaterialStandardData.ts +478 -0
- package/src/implementation/material/MaterialUnlitData.ts +91 -0
- package/src/implementation/material/MaterialVariantsData.ts +60 -0
- package/src/implementation/sdtf/SDTFAttributesData.ts +118 -0
- package/src/implementation/sdtf/SDTFItemData.ts +64 -0
- package/src/implementation/sdtf/SDTFOverviewData.ts +79 -0
- package/src/index.ts +72 -0
- package/src/interfaces/data/IAnimationData.ts +42 -0
- package/src/interfaces/data/IBoneData.ts +9 -0
- package/src/interfaces/data/ICustomData.ts +15 -0
- package/src/interfaces/data/IGeometryData.ts +87 -0
- package/src/interfaces/data/IHTMLElementAnchorData.ts +66 -0
- package/src/interfaces/data/material/IMapData.ts +42 -0
- package/src/interfaces/data/material/IMaterialAbstractData.ts +76 -0
- package/src/interfaces/data/material/IMaterialSpecularGlossinessDataProperties.ts +29 -0
- package/src/interfaces/data/material/IMaterialStandardData.ts +77 -0
- package/src/interfaces/data/material/IMaterialUnlitData.ts +12 -0
- package/src/interfaces/data/material/IMaterialVariantsData.ts +19 -0
- package/src/interfaces/events/EventResponseMapping.ts +37 -0
- package/src/interfaces/events/ICameraEvent.ts +5 -0
- package/src/interfaces/events/IDragEvent.ts +10 -0
- package/src/interfaces/events/IHoverEvent.ts +7 -0
- package/src/interfaces/events/IMultiSelectEvent.ts +8 -0
- package/src/interfaces/events/ISceneEvent.ts +6 -0
- package/src/interfaces/events/ISelectEvent.ts +7 -0
- package/src/interfaces/events/ISessionEvent.ts +5 -0
- package/src/interfaces/events/ITaskEvent.ts +20 -0
- package/src/interfaces/events/IViewportEvent.ts +5 -0
- package/src/interfaces/sdtf/ISDTFAttributeVisualizationData.ts +7 -0
- package/src/interfaces/sdtf/ISDTFAttributesData.ts +27 -0
- package/src/interfaces/sdtf/ISDTFItemData.ts +23 -0
- package/src/interfaces/sdtf/ISDTFOverviewData.ts +31 -0
- package/tsconfig.json +17 -0
- package/dist/data/AnimationData.d.ts +0 -41
- package/dist/data/AnimationData.d.ts.map +0 -1
- package/dist/data/AnimationData.js.map +0 -1
- package/dist/data/CustomData.d.ts.map +0 -1
- package/dist/data/CustomData.js.map +0 -1
- package/dist/data/GeometryData.d.ts.map +0 -1
- package/dist/data/GeometryData.js.map +0 -1
- package/dist/data/HTMLElementAnchorData.d.ts.map +0 -1
- package/dist/data/HTMLElementAnchorData.js.map +0 -1
- package/dist/data/material/AbstractMaterialData.d.ts +0 -96
- package/dist/data/material/AbstractMaterialData.d.ts.map +0 -1
- package/dist/data/material/AbstractMaterialData.js.map +0 -1
- package/dist/data/material/MapData.d.ts.map +0 -1
- package/dist/data/material/MapData.js.map +0 -1
- package/dist/data/material/MaterialSpecularGlossinessData.d.ts +0 -33
- package/dist/data/material/MaterialSpecularGlossinessData.d.ts.map +0 -1
- package/dist/data/material/MaterialSpecularGlossinessData.js.map +0 -1
- package/dist/data/material/MaterialStandardData.d.ts +0 -105
- package/dist/data/material/MaterialStandardData.d.ts.map +0 -1
- package/dist/data/material/MaterialStandardData.js.map +0 -1
- package/dist/data/material/MaterialUnlitData.d.ts +0 -16
- package/dist/data/material/MaterialUnlitData.d.ts.map +0 -1
- package/dist/data/material/MaterialUnlitData.js.map +0 -1
- package/dist/data/material/MaterialVariantsData.d.ts +0 -15
- package/dist/data/material/MaterialVariantsData.d.ts.map +0 -1
- package/dist/data/material/MaterialVariantsData.js.map +0 -1
- package/dist/data/sdtf/SDTFAttributeOverview.d.ts +0 -22
- package/dist/data/sdtf/SDTFAttributeOverview.d.ts.map +0 -1
- package/dist/data/sdtf/SDTFAttributeVisualization.d.ts +0 -22
- package/dist/data/sdtf/SDTFAttributeVisualization.d.ts.map +0 -1
- package/dist/data/sdtf/SDTFAttributeVisualization.js +0 -200
- package/dist/data/sdtf/SDTFAttributeVisualization.js.map +0 -1
- package/dist/data/sdtf/SDTFAttributesData.d.ts +0 -21
- package/dist/data/sdtf/SDTFAttributesData.d.ts.map +0 -1
- package/dist/data/sdtf/SDTFAttributesData.js.map +0 -1
- package/dist/data/sdtf/SDTFItemData.d.ts +0 -19
- package/dist/data/sdtf/SDTFItemData.d.ts.map +0 -1
- package/dist/data/sdtf/SDTFItemData.js.map +0 -1
- package/dist/events/ICameraEvent.d.ts +0 -5
- package/dist/events/ICameraEvent.d.ts.map +0 -1
- package/dist/events/ICameraEvent.js.map +0 -1
- package/dist/events/IEnvironmentEvent.d.ts +0 -5
- package/dist/events/IEnvironmentEvent.d.ts.map +0 -1
- package/dist/events/IEnvironmentEvent.js.map +0 -1
- package/dist/events/ISceneEvent.d.ts +0 -9
- package/dist/events/ISceneEvent.d.ts.map +0 -1
- package/dist/events/ISceneEvent.js.map +0 -1
- package/dist/events/ISessionEvent.d.ts.map +0 -1
- package/dist/events/ISessionEvent.js.map +0 -1
- package/dist/events/ISettingsEvent.d.ts +0 -24
- package/dist/events/ISettingsEvent.d.ts.map +0 -1
- package/dist/events/ISettingsEvent.js.map +0 -1
- package/dist/events/ITaskEvent.d.ts.map +0 -1
- package/dist/events/ITaskEvent.js +0 -15
- package/dist/events/ITaskEvent.js.map +0 -1
- package/dist/events/IViewerEvent.d.ts +0 -5
- package/dist/events/IViewerEvent.d.ts.map +0 -1
- package/dist/events/IViewerEvent.js.map +0 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ITreeNodeData } from "@shapediver/viewer.shared.node-tree";
|
|
2
|
+
import { MATERIAL_ALPHA, MATERIAL_SHADING, MATERIAL_SIDE } from "../../interfaces/data/material/IMaterialAbstractData";
|
|
3
|
+
import { IMaterialUnlitData, IMaterialUnlitDataProperties } from "../../interfaces/data/material/IMaterialUnlitData";
|
|
4
|
+
import { AbstractMaterialData } from "./AbstractMaterialData";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export class MaterialUnlitData extends AbstractMaterialData implements IMaterialUnlitData {
|
|
8
|
+
// #region Constructors (1)
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Creates a material data object.
|
|
12
|
+
*
|
|
13
|
+
* @param _attributes the attributes of the material
|
|
14
|
+
* @param id the id
|
|
15
|
+
*/
|
|
16
|
+
constructor(
|
|
17
|
+
properties?: IMaterialUnlitDataProperties,
|
|
18
|
+
id?: string
|
|
19
|
+
) {
|
|
20
|
+
super(properties, id);
|
|
21
|
+
if (!properties) return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// #endregion Constructors (1)
|
|
25
|
+
|
|
26
|
+
// #region Public Methods (1)
|
|
27
|
+
|
|
28
|
+
public reset(): void {
|
|
29
|
+
this.alphaCutoff = 0;
|
|
30
|
+
this.alphaMap = undefined;
|
|
31
|
+
this.alphaMode = MATERIAL_ALPHA.OPAQUE;
|
|
32
|
+
this.aoMap = undefined;
|
|
33
|
+
this.aoMapIntensity = 1.0;
|
|
34
|
+
this.bumpMap = undefined;
|
|
35
|
+
this.bumpScale = 1.0;
|
|
36
|
+
this.color = '#ffffff';
|
|
37
|
+
this.emissiveMap = undefined;
|
|
38
|
+
this.emissiveness = '#000000';
|
|
39
|
+
this.materialOutput = false;
|
|
40
|
+
this.map = undefined;
|
|
41
|
+
this.normalMap = undefined;
|
|
42
|
+
this.normalScale = 1.0;
|
|
43
|
+
this.opacity = 1.0;
|
|
44
|
+
this.shading = MATERIAL_SHADING.SMOOTH;
|
|
45
|
+
this.side = MATERIAL_SIDE.DOUBLE;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public clone(): IMaterialUnlitData {
|
|
49
|
+
return new MaterialUnlitData({
|
|
50
|
+
alphaMap: this.alphaMap,
|
|
51
|
+
alphaCutoff: this.alphaCutoff,
|
|
52
|
+
alphaMode: this.alphaMode,
|
|
53
|
+
aoMap: this.aoMap,
|
|
54
|
+
aoMapIntensity: this.aoMapIntensity,
|
|
55
|
+
bumpMap: this.bumpMap,
|
|
56
|
+
bumpScale: this.bumpScale,
|
|
57
|
+
color: this.color,
|
|
58
|
+
emissiveMap: this.emissiveMap,
|
|
59
|
+
emissiveness: this.emissiveness,
|
|
60
|
+
shading: this.shading,
|
|
61
|
+
map: this.map,
|
|
62
|
+
name: this.name,
|
|
63
|
+
normalMap: this.normalMap,
|
|
64
|
+
normalScale: this.normalScale,
|
|
65
|
+
opacity: this.opacity,
|
|
66
|
+
side: this.side,
|
|
67
|
+
}, this.id);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public copy(source: MaterialUnlitData): void {
|
|
71
|
+
this.alphaCutoff = source.alphaCutoff;
|
|
72
|
+
this.alphaMap = source.alphaMap;
|
|
73
|
+
this.alphaMode = source.alphaMode;
|
|
74
|
+
this.aoMap = source.aoMap;
|
|
75
|
+
this.aoMapIntensity = source.aoMapIntensity;
|
|
76
|
+
this.bumpMap = source.bumpMap;
|
|
77
|
+
this.bumpScale = source.bumpScale;
|
|
78
|
+
this.color = source.color;
|
|
79
|
+
this.emissiveMap = source.emissiveMap;
|
|
80
|
+
this.emissiveness = source.emissiveness;
|
|
81
|
+
this.materialOutput = source.materialOutput;
|
|
82
|
+
this.map = source.map;
|
|
83
|
+
this.normalMap = source.normalMap;
|
|
84
|
+
this.normalScale = source.normalScale;
|
|
85
|
+
this.opacity = source.opacity;
|
|
86
|
+
this.shading = source.shading;
|
|
87
|
+
this.side = source.side;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// #endregion Public Methods (1)
|
|
91
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { AbstractTreeNodeData, ITreeNodeData } from '@shapediver/viewer.shared.node-tree'
|
|
2
|
+
import { IMaterialVariantsData } from '../../interfaces/data/material/IMaterialVariantsData';
|
|
3
|
+
import { PrimitiveData } from '../data/GeometryData';
|
|
4
|
+
|
|
5
|
+
export class MaterialVariantsData extends AbstractTreeNodeData implements IMaterialVariantsData {
|
|
6
|
+
// #region Properties (1)
|
|
7
|
+
|
|
8
|
+
readonly #variants: string[] = [];
|
|
9
|
+
readonly #primitiveData: PrimitiveData[] = [];
|
|
10
|
+
#variantIndex?: number;
|
|
11
|
+
|
|
12
|
+
// #endregion Properties (1)
|
|
13
|
+
|
|
14
|
+
// #region Constructors (1)
|
|
15
|
+
|
|
16
|
+
constructor(id?: string) {
|
|
17
|
+
super(id);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// #endregion Constructors (1)
|
|
21
|
+
|
|
22
|
+
// #region Public Accessors (2)
|
|
23
|
+
|
|
24
|
+
public get primitiveData(): PrimitiveData[] {
|
|
25
|
+
return this.#primitiveData;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public get variants(): string[] {
|
|
29
|
+
return this.#variants;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public get variantIndex(): number | undefined {
|
|
33
|
+
return this.#variantIndex;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public set variantIndex(value: number | undefined) {
|
|
37
|
+
this.#variantIndex = value;
|
|
38
|
+
for(let i = 0; i < this.primitiveData.length; i++) {
|
|
39
|
+
const variant = this.primitiveData[i].materialVariants.find(v => v.variant === this.#variantIndex);
|
|
40
|
+
if(variant) {
|
|
41
|
+
this.primitiveData[i].material = variant.material;
|
|
42
|
+
} else {
|
|
43
|
+
this.primitiveData[i].material = this.primitiveData[i].standardMaterial;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// #endregion Public Accessors (2)
|
|
49
|
+
|
|
50
|
+
// #region Public Methods (1)
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Clones the scene graph data.
|
|
54
|
+
*/
|
|
55
|
+
public clone(): IMaterialVariantsData {
|
|
56
|
+
return new MaterialVariantsData(this.id);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// #endregion Public Methods (1)
|
|
60
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { AbstractTreeNodeData, ITreeNodeData } from '@shapediver/viewer.shared.node-tree'
|
|
2
|
+
import { ISDTFAttributeData, ISDTFAttributesData } from '../../interfaces/sdtf/ISDTFAttributesData';
|
|
3
|
+
import { SdtfTypeHintName } from '@shapediver/sdk.sdtf-v1'
|
|
4
|
+
|
|
5
|
+
export class SDTFAttributeData implements ISDTFAttributeData {
|
|
6
|
+
// #region Properties (2)
|
|
7
|
+
|
|
8
|
+
readonly #typeHint;
|
|
9
|
+
readonly #value;
|
|
10
|
+
|
|
11
|
+
// #endregion Properties (2)
|
|
12
|
+
|
|
13
|
+
// #region Constructors (1)
|
|
14
|
+
|
|
15
|
+
constructor(
|
|
16
|
+
typeHint: SdtfTypeHintName | string,
|
|
17
|
+
value: any
|
|
18
|
+
) {
|
|
19
|
+
this.#typeHint = typeHint;
|
|
20
|
+
this.#value = value;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// #endregion Constructors (1)
|
|
24
|
+
|
|
25
|
+
// #region Public Accessors (2)
|
|
26
|
+
|
|
27
|
+
public get typeHint(): SdtfTypeHintName | string {
|
|
28
|
+
return this.#typeHint;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public get value(): any {
|
|
32
|
+
return this.#value;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// #endregion Public Accessors (2)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// export class SDTFAttributeAsyncData {
|
|
39
|
+
// // #region Properties (2)
|
|
40
|
+
|
|
41
|
+
// readonly #typeHint;
|
|
42
|
+
// readonly #accessor;
|
|
43
|
+
// private _value: Promise<any> | undefined;
|
|
44
|
+
// private readonly _loadAccessor: (accessorID: number) => Promise<any>
|
|
45
|
+
|
|
46
|
+
// // #endregion Properties (2)
|
|
47
|
+
|
|
48
|
+
// // #region Constructors (1)
|
|
49
|
+
|
|
50
|
+
// constructor(
|
|
51
|
+
// typeHint: string,
|
|
52
|
+
// accessor: number,
|
|
53
|
+
// private readonly _loadAccessor: (accessorID: number) => Promise<any>
|
|
54
|
+
// ) {
|
|
55
|
+
// this._typeHint = typeHint;
|
|
56
|
+
// this._accessor = accessor;
|
|
57
|
+
// }
|
|
58
|
+
|
|
59
|
+
// public get value(): Promise<any> {
|
|
60
|
+
// if (this.value !== undefined) {
|
|
61
|
+
// return this._value!;
|
|
62
|
+
// } else {
|
|
63
|
+
// this._value = this._loadAccessor!(this._accessor!);
|
|
64
|
+
// return this._value;
|
|
65
|
+
// }
|
|
66
|
+
// }
|
|
67
|
+
|
|
68
|
+
// public get typeHint(): string {
|
|
69
|
+
// return this._typeHint;
|
|
70
|
+
// }
|
|
71
|
+
|
|
72
|
+
// // #endregion Constructors (1)
|
|
73
|
+
// }
|
|
74
|
+
|
|
75
|
+
export class SDTFAttributesData extends AbstractTreeNodeData implements ISDTFAttributesData {
|
|
76
|
+
// #region Properties (1)
|
|
77
|
+
|
|
78
|
+
readonly #attributes: {
|
|
79
|
+
[key: string]: SDTFAttributeData
|
|
80
|
+
} = {};
|
|
81
|
+
|
|
82
|
+
// #endregion Properties (1)
|
|
83
|
+
|
|
84
|
+
// #region Constructors (1)
|
|
85
|
+
|
|
86
|
+
constructor(
|
|
87
|
+
attributes: {
|
|
88
|
+
[key: string]: SDTFAttributeData
|
|
89
|
+
} = {},
|
|
90
|
+
id?: string
|
|
91
|
+
) {
|
|
92
|
+
super(id);
|
|
93
|
+
this.#attributes = attributes;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// #endregion Constructors (1)
|
|
97
|
+
|
|
98
|
+
// #region Public Accessors (1)
|
|
99
|
+
|
|
100
|
+
public get attributes(): {
|
|
101
|
+
[key: string]: SDTFAttributeData
|
|
102
|
+
} {
|
|
103
|
+
return this.#attributes;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// #endregion Public Accessors (1)
|
|
107
|
+
|
|
108
|
+
// #region Public Methods (1)
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Clones the scene graph data.
|
|
112
|
+
*/
|
|
113
|
+
public clone(): ISDTFAttributesData {
|
|
114
|
+
return new SDTFAttributesData(this.attributes, this.id);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// #endregion Public Methods (1)
|
|
118
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { AbstractTreeNodeData, ITreeNodeData } from '@shapediver/viewer.shared.node-tree'
|
|
2
|
+
import { ISDTFAttributeData } from '../../interfaces/sdtf/ISDTFAttributesData';
|
|
3
|
+
import { ISDTFItemData } from '../../interfaces/sdtf/ISDTFItemData';
|
|
4
|
+
import { SdtfTypeHintName } from '@shapediver/sdk.sdtf-v1'
|
|
5
|
+
|
|
6
|
+
export class SDTFItemData extends AbstractTreeNodeData implements ISDTFItemData {
|
|
7
|
+
// #region Properties (3)
|
|
8
|
+
|
|
9
|
+
readonly #typeHint;
|
|
10
|
+
readonly #value;
|
|
11
|
+
|
|
12
|
+
#attributes: {
|
|
13
|
+
[key: string]: ISDTFAttributeData
|
|
14
|
+
} = {};
|
|
15
|
+
|
|
16
|
+
// #endregion Properties (3)
|
|
17
|
+
|
|
18
|
+
// #region Constructors (1)
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
typeHint: SdtfTypeHintName | string,
|
|
22
|
+
value: any,
|
|
23
|
+
attributes: {
|
|
24
|
+
[key: string]: ISDTFAttributeData
|
|
25
|
+
},
|
|
26
|
+
id?: string
|
|
27
|
+
) {
|
|
28
|
+
super(id);
|
|
29
|
+
this.#attributes = attributes;
|
|
30
|
+
this.#typeHint = typeHint;
|
|
31
|
+
this.#value = value;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// #endregion Constructors (1)
|
|
35
|
+
|
|
36
|
+
// #region Public Accessors (3)
|
|
37
|
+
|
|
38
|
+
public get attributes(): {
|
|
39
|
+
[key: string]: ISDTFAttributeData
|
|
40
|
+
} {
|
|
41
|
+
return this.#attributes;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public get typeHint(): SdtfTypeHintName | string {
|
|
45
|
+
return this.#typeHint;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public get value(): any {
|
|
49
|
+
return this.#value;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// #endregion Public Accessors (3)
|
|
53
|
+
|
|
54
|
+
// #region Public Methods (1)
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Clones the scene graph data.
|
|
58
|
+
*/
|
|
59
|
+
public clone(): ISDTFItemData {
|
|
60
|
+
return new SDTFItemData(this.typeHint, this.value, this.attributes, this.id);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// #endregion Public Methods (1)
|
|
64
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { AbstractTreeNodeData, ITreeNodeData } from '@shapediver/viewer.shared.node-tree'
|
|
2
|
+
import { ISDTFOverview, ISDTFOverviewData } from '../../interfaces/sdtf/ISDTFOverviewData';
|
|
3
|
+
import { SdtfPrimitiveTypeGuard } from '@shapediver/sdk.sdtf-primitives'
|
|
4
|
+
|
|
5
|
+
export class SDTFOverviewData extends AbstractTreeNodeData implements ISDTFOverviewData {
|
|
6
|
+
// #region Properties (1)
|
|
7
|
+
|
|
8
|
+
#overview: ISDTFOverview = {};
|
|
9
|
+
|
|
10
|
+
// #endregion Properties (1)
|
|
11
|
+
|
|
12
|
+
// #region Constructors (1)
|
|
13
|
+
|
|
14
|
+
constructor(
|
|
15
|
+
overview: ISDTFOverview,
|
|
16
|
+
id?: string
|
|
17
|
+
) {
|
|
18
|
+
super(id);
|
|
19
|
+
this.#overview = overview;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// #endregion Constructors (1)
|
|
23
|
+
|
|
24
|
+
// #region Public Accessors (1)
|
|
25
|
+
|
|
26
|
+
public get overview(): ISDTFOverview {
|
|
27
|
+
return this.#overview;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// #endregion Public Accessors (1)
|
|
31
|
+
|
|
32
|
+
// #region Public Methods (1)
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Clones the scene graph data.
|
|
36
|
+
*/
|
|
37
|
+
public clone(): ISDTFOverviewData {
|
|
38
|
+
return new SDTFOverviewData(this.#overview, this.id);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public merge(data: ISDTFOverviewData) {
|
|
42
|
+
for (let overviewKey in data.overview) {
|
|
43
|
+
for(let i = 0; i < data.overview[overviewKey].length; i++){
|
|
44
|
+
const dataToCopy = data.overview[overviewKey][i];
|
|
45
|
+
const existingEntries = this.overview[overviewKey] ? this.overview[overviewKey].filter(o => o.typeHint === dataToCopy.typeHint) : [];
|
|
46
|
+
if(this.overview[overviewKey] && existingEntries.length > 0) {
|
|
47
|
+
const entry = existingEntries[0];
|
|
48
|
+
entry.count++;
|
|
49
|
+
if (SdtfPrimitiveTypeGuard.isStringType(dataToCopy.typeHint)) {
|
|
50
|
+
entry.values = entry.values?.concat(dataToCopy.values!.filter((item) => entry.values!.indexOf(item) < 0))
|
|
51
|
+
}
|
|
52
|
+
if (SdtfPrimitiveTypeGuard.isNumberType(dataToCopy.typeHint)) {
|
|
53
|
+
entry.min = Math.min(dataToCopy.min!, entry.min!);
|
|
54
|
+
entry.max = Math.max(dataToCopy.max!, entry.max!);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
} else if(this.overview[overviewKey]) {
|
|
58
|
+
this.overview[overviewKey].push({
|
|
59
|
+
typeHint: dataToCopy.typeHint,
|
|
60
|
+
count: dataToCopy.count,
|
|
61
|
+
values: dataToCopy.values,
|
|
62
|
+
min: dataToCopy.min,
|
|
63
|
+
max: dataToCopy.max,
|
|
64
|
+
})
|
|
65
|
+
} else {
|
|
66
|
+
this.overview[overviewKey] = [{
|
|
67
|
+
typeHint: dataToCopy.typeHint,
|
|
68
|
+
count: dataToCopy.count,
|
|
69
|
+
values: dataToCopy.values,
|
|
70
|
+
min: dataToCopy.min,
|
|
71
|
+
max: dataToCopy.max,
|
|
72
|
+
}]
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// #endregion Public Methods (1)
|
|
79
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { CustomData } from './implementation/data/CustomData'
|
|
2
|
+
import { AttributeData, GeometryData, PrimitiveData } from './implementation/data/GeometryData'
|
|
3
|
+
import {
|
|
4
|
+
MaterialStandardData,
|
|
5
|
+
} from './implementation/material/MaterialStandardData'
|
|
6
|
+
import { HTMLElementAnchorCustomData, HTMLElementAnchorData, HTMLElementAnchorImageData, HTMLElementAnchorTextData } from './implementation/data/HTMLElementAnchorData'
|
|
7
|
+
import { SDTFItemData } from './implementation/sdtf/SDTFItemData'
|
|
8
|
+
import { AnimationData } from './implementation/data/AnimationData'
|
|
9
|
+
import { IViewportEvent } from './interfaces/events/IViewportEvent'
|
|
10
|
+
import { ISessionEvent } from './interfaces/events/ISessionEvent'
|
|
11
|
+
import { ICameraEvent } from './interfaces/events/ICameraEvent'
|
|
12
|
+
import { ISceneEvent } from './interfaces/events/ISceneEvent'
|
|
13
|
+
import { ITaskEvent, TASK_TYPE } from './interfaces/events/ITaskEvent'
|
|
14
|
+
import { MaterialVariantsData } from './implementation/material/MaterialVariantsData'
|
|
15
|
+
import { MapData } from './implementation/material/MapData'
|
|
16
|
+
import { MaterialSpecularGlossinessData } from './implementation/material/MaterialSpecularGlossinessData'
|
|
17
|
+
import { MaterialUnlitData } from './implementation/material/MaterialUnlitData'
|
|
18
|
+
import { IAnchorDataImage, IAnchorDataText, IHTMLElementAnchorData } from './interfaces/data/IHTMLElementAnchorData'
|
|
19
|
+
import { IMaterialAbstractData, IMaterialAbstractDataProperties, MATERIAL_ALPHA, MATERIAL_SHADING, MATERIAL_SIDE } from './interfaces/data/material/IMaterialAbstractData'
|
|
20
|
+
import { IAttributeData, IGeometryData, IPrimitiveData, PRIMITIVE_MODE } from './interfaces/data/IGeometryData'
|
|
21
|
+
import { TEXTURE_WRAPPING, TEXTURE_FILTERING, IMapData } from './interfaces/data/material/IMapData'
|
|
22
|
+
import { IMaterialSpecularGlossinessData, IMaterialSpecularGlossinessDataProperties } from './interfaces/data/material/IMaterialSpecularGlossinessDataProperties'
|
|
23
|
+
import { IMaterialStandardData, IMaterialStandardDataProperties } from './interfaces/data/material/IMaterialStandardData'
|
|
24
|
+
import { IMaterialUnlitData, IMaterialUnlitDataProperties } from './interfaces/data/material/IMaterialUnlitData'
|
|
25
|
+
import { IMaterialVariantsData } from './interfaces/data/material/IMaterialVariantsData'
|
|
26
|
+
import { IAnimationData, IAnimationTrack } from './interfaces/data/IAnimationData'
|
|
27
|
+
import { ICustomData } from './interfaces/data/ICustomData'
|
|
28
|
+
import { AbstractMaterialData } from './implementation/material/AbstractMaterialData'
|
|
29
|
+
import { ISDTFOverview, ISDTFOverviewData } from './interfaces/sdtf/ISDTFOverviewData'
|
|
30
|
+
import { SDTFAttributeData, SDTFAttributesData } from './implementation/sdtf/SDTFAttributesData'
|
|
31
|
+
import { SDTFOverviewData } from './implementation/sdtf/SDTFOverviewData'
|
|
32
|
+
import { ISDTFAttributesData, ISDTFAttributeData } from './interfaces/sdtf/ISDTFAttributesData'
|
|
33
|
+
import { ISDTFItemData } from './interfaces/sdtf/ISDTFItemData'
|
|
34
|
+
import { ISDTFAttributeVisualizationData } from './interfaces/sdtf/ISDTFAttributeVisualizationData'
|
|
35
|
+
import { EventResponseMapping } from './interfaces/events/EventResponseMapping'
|
|
36
|
+
import { IDragEvent } from './interfaces/events/IDragEvent'
|
|
37
|
+
import { IHoverEvent } from './interfaces/events/IHoverEvent'
|
|
38
|
+
import { ISelectEvent } from './interfaces/events/ISelectEvent'
|
|
39
|
+
import { IMultiSelectEvent } from './interfaces/events/IMultiSelectEvent'
|
|
40
|
+
import { IBoneData } from './interfaces/data/IBoneData'
|
|
41
|
+
import { BoneData } from './implementation/data/BoneData'
|
|
42
|
+
import { SdtfTypeHintName } from '@shapediver/sdk.sdtf-v1'
|
|
43
|
+
import { SdtfPrimitiveTypeGuard } from '@shapediver/sdk.sdtf-primitives'
|
|
44
|
+
|
|
45
|
+
export {
|
|
46
|
+
IMaterialStandardData, MaterialStandardData, IMaterialStandardDataProperties,
|
|
47
|
+
IMaterialAbstractData, IMaterialAbstractDataProperties, AbstractMaterialData,
|
|
48
|
+
IMaterialUnlitData, MaterialUnlitData, IMaterialUnlitDataProperties,
|
|
49
|
+
IMaterialSpecularGlossinessData, MaterialSpecularGlossinessData, IMaterialSpecularGlossinessDataProperties,
|
|
50
|
+
IMapData, MapData, MATERIAL_SIDE, MATERIAL_ALPHA, MATERIAL_SHADING, TEXTURE_WRAPPING, TEXTURE_FILTERING
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
IAnimationData, AnimationData, IAnimationTrack, IGeometryData, IAttributeData, IPrimitiveData, IMaterialVariantsData, GeometryData, AttributeData, PrimitiveData, MaterialVariantsData, PRIMITIVE_MODE
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
IAnchorDataImage, IAnchorDataText, IHTMLElementAnchorData, HTMLElementAnchorCustomData, HTMLElementAnchorTextData, HTMLElementAnchorImageData, HTMLElementAnchorData
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export {
|
|
62
|
+
ICustomData, CustomData, IBoneData, BoneData
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export {
|
|
66
|
+
EventResponseMapping, IViewportEvent, ISessionEvent, ICameraEvent, IDragEvent, IHoverEvent, ISelectEvent, IMultiSelectEvent, ISceneEvent, ITaskEvent, TASK_TYPE
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export {
|
|
70
|
+
ISDTFOverviewData, SDTFOverviewData, ISDTFOverview, SDTFAttributesData, ISDTFAttributesData, ISDTFAttributeData, SDTFAttributeData, SDTFItemData, ISDTFItemData, ISDTFAttributeVisualizationData,
|
|
71
|
+
SdtfTypeHintName as SDTF_TYPEHINT, SdtfPrimitiveTypeGuard
|
|
72
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ITransformation, ITreeNode, ITreeNodeData } from "@shapediver/viewer.shared.node-tree";
|
|
2
|
+
import { vec3 } from "gl-matrix";
|
|
3
|
+
|
|
4
|
+
export interface IAnimationTrack {
|
|
5
|
+
// #region Properties (6)
|
|
6
|
+
|
|
7
|
+
interpolation: 'linear' | 'step';
|
|
8
|
+
node: ITreeNode,
|
|
9
|
+
path: 'scale' | 'translation' | 'rotation';
|
|
10
|
+
previousMatrix?: ITransformation;
|
|
11
|
+
pivot?: vec3;
|
|
12
|
+
times: Float32Array | Uint8Array | Uint16Array | Int8Array | Int16Array | Uint32Array | number[];
|
|
13
|
+
values: Float32Array | Uint8Array | Uint16Array | Int8Array | Int16Array | Uint32Array | number[];
|
|
14
|
+
|
|
15
|
+
// #endregion Properties (6)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface IAnimationData extends ITreeNodeData {
|
|
19
|
+
// #region Properties (8)
|
|
20
|
+
|
|
21
|
+
readonly animate: boolean;
|
|
22
|
+
readonly duration: number;
|
|
23
|
+
readonly name: string;
|
|
24
|
+
readonly start: number;
|
|
25
|
+
readonly tracks: IAnimationTrack[];
|
|
26
|
+
|
|
27
|
+
animationTime: number;
|
|
28
|
+
repeat: boolean;
|
|
29
|
+
reset: boolean;
|
|
30
|
+
|
|
31
|
+
// #endregion Properties (8)
|
|
32
|
+
|
|
33
|
+
// #region Public Methods (5)
|
|
34
|
+
|
|
35
|
+
clone(): IAnimationData;
|
|
36
|
+
continueAnimation(): void;
|
|
37
|
+
pauseAnimation(): void;
|
|
38
|
+
startAnimation(): void;
|
|
39
|
+
stopAnimation(): void;
|
|
40
|
+
|
|
41
|
+
// #endregion Public Methods (5)
|
|
42
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ITreeNodeData } from "@shapediver/viewer.shared.node-tree";
|
|
2
|
+
|
|
3
|
+
export interface ICustomData extends ITreeNodeData {
|
|
4
|
+
// #region Properties (1)
|
|
5
|
+
|
|
6
|
+
data: { [key: string]: any };
|
|
7
|
+
|
|
8
|
+
// #endregion Properties (1)
|
|
9
|
+
|
|
10
|
+
// #region Public Methods (1)
|
|
11
|
+
|
|
12
|
+
clone(): ICustomData;
|
|
13
|
+
|
|
14
|
+
// #endregion Public Methods (1)
|
|
15
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ITreeNode, ITreeNodeData } from "@shapediver/viewer.shared.node-tree";
|
|
2
|
+
import { IBox } from "@shapediver/viewer.shared.math";
|
|
3
|
+
import { IMaterialAbstractData } from "./material/IMaterialAbstractData";
|
|
4
|
+
import { mat4 } from "gl-matrix";
|
|
5
|
+
|
|
6
|
+
export enum PRIMITIVE_MODE {
|
|
7
|
+
POINTS = 0,
|
|
8
|
+
LINES = 1,
|
|
9
|
+
LINE_LOOP = 2,
|
|
10
|
+
LINE_STRIP = 3,
|
|
11
|
+
TRIANGLES = 4,
|
|
12
|
+
TRIANGLE_STRIP = 5,
|
|
13
|
+
TRIANGLE_FAN = 6
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface IAttributeData extends ITreeNodeData {
|
|
17
|
+
// #region Properties (14)
|
|
18
|
+
|
|
19
|
+
readonly array: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array;
|
|
20
|
+
readonly byteOffset: number;
|
|
21
|
+
readonly byteStride?: number;
|
|
22
|
+
readonly count: number;
|
|
23
|
+
readonly elementBytes: number;
|
|
24
|
+
readonly itemBytes: number;
|
|
25
|
+
readonly itemSize: number;
|
|
26
|
+
readonly max: number[];
|
|
27
|
+
readonly min: number[];
|
|
28
|
+
readonly morphAttributeData: IAttributeData[];
|
|
29
|
+
readonly normalized: boolean;
|
|
30
|
+
readonly sparse?: boolean;
|
|
31
|
+
readonly sparseIndices?: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array;
|
|
32
|
+
readonly sparseValues?: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array;
|
|
33
|
+
|
|
34
|
+
// #endregion Properties (14)
|
|
35
|
+
|
|
36
|
+
// #region Public Methods (1)
|
|
37
|
+
|
|
38
|
+
clone(): IAttributeData;
|
|
39
|
+
|
|
40
|
+
// #endregion Public Methods (1)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface IPrimitiveData extends ITreeNodeData {
|
|
44
|
+
// #region Properties (9)
|
|
45
|
+
|
|
46
|
+
readonly attributes: {
|
|
47
|
+
[key: string]: IAttributeData
|
|
48
|
+
};
|
|
49
|
+
readonly mode: PRIMITIVE_MODE;
|
|
50
|
+
|
|
51
|
+
attributeMaterial: IMaterialAbstractData | null;
|
|
52
|
+
boundingBox: IBox;
|
|
53
|
+
effectMaterials: { material: IMaterialAbstractData, token: string }[];
|
|
54
|
+
indices: IAttributeData | null;
|
|
55
|
+
material: IMaterialAbstractData | null;
|
|
56
|
+
materialVariants: { material: IMaterialAbstractData, variant: number }[];
|
|
57
|
+
standardMaterial: IMaterialAbstractData | null;
|
|
58
|
+
|
|
59
|
+
// #endregion Properties (9)
|
|
60
|
+
|
|
61
|
+
// #region Public Methods (1)
|
|
62
|
+
|
|
63
|
+
clone(): IPrimitiveData;
|
|
64
|
+
|
|
65
|
+
// #endregion Public Methods (1)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface IGeometryData extends ITreeNodeData {
|
|
69
|
+
// #region Properties (7)
|
|
70
|
+
|
|
71
|
+
readonly matrix: mat4;
|
|
72
|
+
readonly primitive: IPrimitiveData;
|
|
73
|
+
|
|
74
|
+
boneInverses: mat4[];
|
|
75
|
+
bones: ITreeNode[];
|
|
76
|
+
boundingBox: IBox;
|
|
77
|
+
morphWeights: number[];
|
|
78
|
+
renderOrder: number;
|
|
79
|
+
|
|
80
|
+
// #endregion Properties (7)
|
|
81
|
+
|
|
82
|
+
// #region Public Methods (1)
|
|
83
|
+
|
|
84
|
+
clone(): IGeometryData;
|
|
85
|
+
|
|
86
|
+
// #endregion Public Methods (1)
|
|
87
|
+
}
|