web3dlink 2.1.4 → 2.1.6

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/web3dlink.js CHANGED
@@ -2720,7 +2720,7 @@ function outline(e) {
2720
2720
  min: 0
2721
2721
  })), t.push(...validateOptionalNumber({
2722
2722
  normalized: n.config,
2723
- field: "meshBrightness",
2723
+ field: "meshOpacity",
2724
2724
  value: n.config.meshOpacity,
2725
2725
  defaultValue: .02,
2726
2726
  min: 0,
@@ -2743,6 +2743,102 @@ function removeAllOutline(e) {
2743
2743
  normalized: { ...e }
2744
2744
  };
2745
2745
  }
2746
+ var SLICE_MODE_LIST = [
2747
+ "None",
2748
+ "Color",
2749
+ "Texture",
2750
+ "Material"
2751
+ ];
2752
+ function validateBooleanField(e, t, n, r, i) {
2753
+ if (r == null) {
2754
+ t[n] = i;
2755
+ return;
2756
+ }
2757
+ if (typeof r != "boolean") {
2758
+ e.push(`[${n}]必须是布尔类型`);
2759
+ return;
2760
+ }
2761
+ t[n] = r;
2762
+ }
2763
+ function openSlice(e = {}) {
2764
+ let t = [], n = { ...e };
2765
+ return t.push(...validateRequiredString({
2766
+ normalized: n,
2767
+ field: "id",
2768
+ value: e.id
2769
+ })), t.push(...verifyEnumerationValue({
2770
+ normalized: n,
2771
+ field: "mode",
2772
+ value: e.mode,
2773
+ defaultValue: "None",
2774
+ type: "string",
2775
+ list: SLICE_MODE_LIST
2776
+ })), t.push(...validateOptionalColor({
2777
+ normalized: n,
2778
+ field: "color",
2779
+ value: e.color,
2780
+ defaultValue: "#FFFFFF00"
2781
+ })), t.push(...validateOptionalString({
2782
+ normalized: n,
2783
+ field: "texturePath",
2784
+ value: e.texturePath,
2785
+ defaultValue: ""
2786
+ })), t.push(...validateOptionalString({
2787
+ normalized: n,
2788
+ field: "materialName",
2789
+ value: e.materialName,
2790
+ defaultValue: ""
2791
+ })), t.push(...validateOptionalArray({
2792
+ normalized: n,
2793
+ field: "uvOffset",
2794
+ value: e.uvOffset,
2795
+ length: 2,
2796
+ defaultValue: [0, 0]
2797
+ })), t.push(...validateOptionalArray({
2798
+ normalized: n,
2799
+ field: "uvScale",
2800
+ value: e.uvScale,
2801
+ length: 2,
2802
+ defaultValue: [1, 1]
2803
+ })), validateBooleanField(t, n, "isWorldUV", e.isWorldUV, !1), t.push(...validateOptionalArray({
2804
+ normalized: n,
2805
+ field: "direction",
2806
+ value: e.direction,
2807
+ length: 3,
2808
+ defaultValue: [
2809
+ 0,
2810
+ 0,
2811
+ -1
2812
+ ]
2813
+ })), validateBooleanField(t, n, "isWorldDirection", e.isWorldDirection, !1), t.push(...validateOptionalNumber({
2814
+ normalized: n,
2815
+ field: "ratio",
2816
+ value: e.ratio,
2817
+ defaultValue: .5,
2818
+ min: 0,
2819
+ max: 1
2820
+ })), {
2821
+ errors: t,
2822
+ normalized: n
2823
+ };
2824
+ }
2825
+ function closeSlice(e = {}) {
2826
+ let t = [], n = { ...e };
2827
+ return t.push(...validateRequiredString({
2828
+ normalized: n,
2829
+ field: "id",
2830
+ value: e.id
2831
+ })), {
2832
+ errors: t,
2833
+ normalized: n
2834
+ };
2835
+ }
2836
+ function closeAllSlice(e = {}) {
2837
+ return {
2838
+ errors: [],
2839
+ normalized: { ...e }
2840
+ };
2841
+ }
2746
2842
  //#endregion
2747
2843
  //#region ../api/sceneModel/sceneModelApi.js
2748
2844
  var validator$5 = {
@@ -2760,7 +2856,10 @@ var validator$5 = {
2760
2856
  setOpacity,
2761
2857
  outline,
2762
2858
  removeOutline,
2763
- removeAllOutline
2859
+ removeAllOutline,
2860
+ openSlice,
2861
+ closeSlice,
2862
+ closeAllSlice
2764
2863
  }, SceneModelAPI = class {
2765
2864
  constructor(e) {
2766
2865
  this.commandManager = e;
@@ -3041,6 +3140,28 @@ function getInfo(e = {}) {
3041
3140
  normalized: n
3042
3141
  };
3043
3142
  }
3143
+ function getFieldRange(e = {}) {
3144
+ let t = [], n = { ...e };
3145
+ return t.push(...validateRequiredString({
3146
+ normalized: n,
3147
+ field: "id",
3148
+ value: e.id
3149
+ })), t.push(...validateRequiredString({
3150
+ normalized: n,
3151
+ field: "fieldName",
3152
+ value: e.fieldName
3153
+ })), t.push(...validateOptionalArray({
3154
+ normalized: n,
3155
+ field: "indexList",
3156
+ value: e.indexList,
3157
+ defaultValue: []
3158
+ })), Array.isArray(n.indexList) && (n.indexList.forEach((e, n) => {
3159
+ Number.isFinite(Number(e)) || t.push(`[indexList[${n}]]必须是数字`);
3160
+ }), n.indexList = n.indexList.map(Number)), {
3161
+ errors: t,
3162
+ normalized: n
3163
+ };
3164
+ }
3044
3165
  function create(e = {}) {
3045
3166
  let t = [], n = { ...e };
3046
3167
  return t.push(...validateRequiredString({
@@ -3251,6 +3372,7 @@ function offMouseClick(e = {}) {
3251
3372
  //#region ../api/vtk/vtkApi.js
3252
3373
  var validator = {
3253
3374
  getInfo,
3375
+ getFieldRange,
3254
3376
  create,
3255
3377
  close,
3256
3378
  allClose,