@shapediver/viewer.shared.types
Advanced tools
Comparing version 1.7.1 to 1.8.0
@@ -20,2 +20,4 @@ import { AbstractTreeNodeData, ITransformation, ITreeNodeData, TreeNode } from '@shapediver/viewer.shared.node-tree'; | ||
set repeat(value: boolean); | ||
get reset(): boolean; | ||
set reset(value: boolean); | ||
get start(): number; | ||
@@ -22,0 +24,0 @@ get tracks(): AnimationTrack[]; |
@@ -13,3 +13,3 @@ "use strict"; | ||
}; | ||
var _AnimationData_animate, _AnimationData_animationTime, _AnimationData_duration, _AnimationData_name, _AnimationData_repeat, _AnimationData_start, _AnimationData_started, _AnimationData_tracks; | ||
var _AnimationData_animate, _AnimationData_animationTime, _AnimationData_duration, _AnimationData_name, _AnimationData_repeat, _AnimationData_start, _AnimationData_started, _AnimationData_tracks, _AnimationData_reset; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -29,2 +29,3 @@ exports.AnimationData = void 0; | ||
_AnimationData_tracks.set(this, void 0); | ||
_AnimationData_reset.set(this, true); | ||
__classPrivateFieldSet(this, _AnimationData_name, name, "f"); | ||
@@ -56,2 +57,8 @@ __classPrivateFieldSet(this, _AnimationData_tracks, tracks, "f"); | ||
} | ||
get reset() { | ||
return __classPrivateFieldGet(this, _AnimationData_reset, "f"); | ||
} | ||
set reset(value) { | ||
__classPrivateFieldSet(this, _AnimationData_reset, value, "f"); | ||
} | ||
get start() { | ||
@@ -90,11 +97,13 @@ return __classPrivateFieldGet(this, _AnimationData_start, "f"); | ||
stopAnimation() { | ||
for (let i = 0; i < __classPrivateFieldGet(this, _AnimationData_tracks, "f").length; i++) { | ||
const track = __classPrivateFieldGet(this, _AnimationData_tracks, "f")[i]; | ||
const id = this.id + '_' + i; | ||
const prevAnimation = track.node.transformations.filter(t => t.id === id); | ||
track.node.transformations = track.node.transformations.filter((el) => { | ||
return !prevAnimation.includes(el); | ||
}); | ||
if (track.previousMatrix) | ||
track.node.transformations.push(track.previousMatrix); | ||
if (this.reset) { | ||
for (let i = 0; i < __classPrivateFieldGet(this, _AnimationData_tracks, "f").length; i++) { | ||
const track = __classPrivateFieldGet(this, _AnimationData_tracks, "f")[i]; | ||
const id = this.id + '_' + i; | ||
const prevAnimation = track.node.transformations.filter(t => t.id === id); | ||
track.node.transformations = track.node.transformations.filter((el) => { | ||
return !prevAnimation.includes(el); | ||
}); | ||
if (track.previousMatrix) | ||
track.node.transformations.push(track.previousMatrix); | ||
} | ||
} | ||
@@ -107,3 +116,3 @@ __classPrivateFieldSet(this, _AnimationData_animationTime, -1, "f"); | ||
exports.AnimationData = AnimationData; | ||
_AnimationData_animate = new WeakMap(), _AnimationData_animationTime = new WeakMap(), _AnimationData_duration = new WeakMap(), _AnimationData_name = new WeakMap(), _AnimationData_repeat = new WeakMap(), _AnimationData_start = new WeakMap(), _AnimationData_started = new WeakMap(), _AnimationData_tracks = new WeakMap(); | ||
_AnimationData_animate = new WeakMap(), _AnimationData_animationTime = new WeakMap(), _AnimationData_duration = new WeakMap(), _AnimationData_name = new WeakMap(), _AnimationData_repeat = new WeakMap(), _AnimationData_start = new WeakMap(), _AnimationData_started = new WeakMap(), _AnimationData_tracks = new WeakMap(), _AnimationData_reset = new WeakMap(); | ||
//# sourceMappingURL=AnimationData.js.map |
import { mat4 } from "gl-matrix"; | ||
import { MaterialData } from "../MaterialData"; | ||
export declare type SDTFAttributeVisualizationData = { | ||
color: string; | ||
opacity: number; | ||
material: MaterialData; | ||
matrix: mat4; | ||
@@ -6,0 +6,0 @@ }; |
@@ -5,2 +5,3 @@ "use strict"; | ||
const gl_matrix_1 = require("gl-matrix"); | ||
const MaterialData_1 = require("../MaterialData"); | ||
var ATTRIBUTEVISUALIZATION; | ||
@@ -21,4 +22,3 @@ (function (ATTRIBUTEVISUALIZATION) { | ||
return { | ||
color: 'rgb(' + color + ', ' + color + ', ' + color + ')', | ||
opacity: 1, | ||
material: new MaterialData_1.MaterialData({ color: 'rgb(' + color + ', ' + color + ', ' + color + ')', opacity: 1 }), | ||
matrix: gl_matrix_1.mat4.create() | ||
@@ -29,4 +29,3 @@ }; | ||
return { | ||
color: '#00fff7', | ||
opacity: factor, | ||
material: new MaterialData_1.MaterialData({ color: '#00fff7', opacity: factor }), | ||
matrix: gl_matrix_1.mat4.create() | ||
@@ -39,4 +38,3 @@ }; | ||
return { | ||
color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(0) + ', ' + Math.floor(blue) + ')', | ||
opacity: 1, | ||
material: new MaterialData_1.MaterialData({ color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(0) + ', ' + Math.floor(blue) + ')', opacity: 1 }), | ||
matrix: gl_matrix_1.mat4.create() | ||
@@ -60,4 +58,3 @@ }; | ||
return { | ||
color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(blue) + ')', | ||
opacity: 1, | ||
material: new MaterialData_1.MaterialData({ color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(blue) + ')', opacity: 1 }), | ||
matrix: gl_matrix_1.mat4.create() | ||
@@ -70,4 +67,3 @@ }; | ||
return { | ||
color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(0) + ')', | ||
opacity: 1, | ||
material: new MaterialData_1.MaterialData({ color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(0) + ')', opacity: 1 }), | ||
matrix: gl_matrix_1.mat4.create() | ||
@@ -91,4 +87,3 @@ }; | ||
return { | ||
color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(blue) + ')', | ||
opacity: 1, | ||
material: new MaterialData_1.MaterialData({ color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(blue) + ')', opacity: 1 }), | ||
matrix: gl_matrix_1.mat4.create() | ||
@@ -112,4 +107,3 @@ }; | ||
return { | ||
color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(blue) + ')', | ||
opacity: 1, | ||
material: new MaterialData_1.MaterialData({ color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(blue) + ')', opacity: 1 }), | ||
matrix: gl_matrix_1.mat4.create() | ||
@@ -151,4 +145,3 @@ }; | ||
return { | ||
color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(blue) + ')', | ||
opacity: 1, | ||
material: new MaterialData_1.MaterialData({ color: 'rgb(' + Math.floor(red) + ', ' + Math.floor(green) + ', ' + Math.floor(blue) + ')', opacity: 1 }), | ||
matrix: gl_matrix_1.mat4.create() | ||
@@ -160,4 +153,3 @@ }; | ||
return { | ||
color: 'hsl(' + Math.floor(hue) + ', 100%, 50%)', | ||
opacity: 1, | ||
material: new MaterialData_1.MaterialData({ color: 'hsl(' + Math.floor(hue) + ', 100%, 50%)', opacity: 1 }), | ||
matrix: gl_matrix_1.mat4.create() | ||
@@ -188,7 +180,2 @@ }; | ||
} | ||
return { | ||
color: '#00fff7', | ||
opacity: 0, | ||
matrix: gl_matrix_1.mat4.create() | ||
}; | ||
}; | ||
@@ -198,9 +185,7 @@ const stringOpacityVisualization = (value, opacities) => { | ||
return { | ||
color: '#00fff7', | ||
opacity: 0, | ||
material: new MaterialData_1.MaterialData({ color: '#00fff7', opacity: 0 }), | ||
matrix: gl_matrix_1.mat4.create() | ||
}; | ||
return { | ||
color: '#00fff7', | ||
opacity: opacities[value], | ||
material: new MaterialData_1.MaterialData({ color: '#00fff7', opacity: opacities[value] }), | ||
matrix: gl_matrix_1.mat4.create() | ||
@@ -231,7 +216,2 @@ }; | ||
} | ||
return { | ||
color: '#00fff7', | ||
opacity: 0, | ||
matrix: gl_matrix_1.mat4.create() | ||
}; | ||
}; | ||
@@ -238,0 +218,0 @@ exports.SDTFAttributeVisualization = { |
{ | ||
"name": "@shapediver/viewer.shared.types", | ||
"version": "1.7.1", | ||
"version": "1.8.0", | ||
"description": "", | ||
@@ -39,9 +39,9 @@ "keywords": [], | ||
"dependencies": { | ||
"@shapediver/viewer.shared.math": "^1.7.1", | ||
"@shapediver/viewer.shared.node-tree": "^1.7.1", | ||
"@shapediver/viewer.shared.services": "^1.7.1", | ||
"@shapediver/viewer.shared.math": "^1.8.0", | ||
"@shapediver/viewer.shared.node-tree": "^1.8.0", | ||
"@shapediver/viewer.shared.services": "^1.8.0", | ||
"gl-matrix": "3.3.0", | ||
"tsyringe": "^4.5.0" | ||
}, | ||
"gitHead": "744908d67c03367e75a2f9403238e49823a60c04" | ||
"gitHead": "cfd80ea3fc4ac50667b79b290c7b5aa81e9ac16f" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
158579
1858