vis-core 0.12.29 → 0.12.30

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.
@@ -40885,14 +40885,6 @@ const BM = {
40885
40885
  Point: RM,
40886
40886
  Arc: CM
40887
40887
  }, EM = {
40888
- Box: SM,
40889
- Capsule: YM,
40890
- Circle: NM,
40891
- Cylinder: IM,
40892
- Dodecahedron: MM,
40893
- Icosahedron: FM,
40894
- Lathe: TM,
40895
- Octahedron: vM,
40896
40888
  Plane: wM,
40897
40889
  Ring: HM,
40898
40890
  Sphere: q2,
@@ -40900,7 +40892,15 @@ const BM = {
40900
40892
  Tetrahedron: kM,
40901
40893
  Torus: JM,
40902
40894
  TorusKnot: KM,
40903
- Tube: UM
40895
+ Tube: UM,
40896
+ Box: SM,
40897
+ Capsule: YM,
40898
+ Circle: NM,
40899
+ Cylinder: IM,
40900
+ Dodecahedron: MM,
40901
+ Icosahedron: FM,
40902
+ Lathe: TM,
40903
+ Octahedron: vM
40904
40904
  }, cn = new Ca(Bt(Bt({}, BM), EM));
40905
40905
  cn.pluginName += "_all";
40906
40906
  class PM {
@@ -40910,6 +40910,7 @@ class PM {
40910
40910
  P(this, "materialList", /* @__PURE__ */ new Map());
40911
40911
  //兼容旧版本
40912
40912
  P(this, "showMaterialList", /* @__PURE__ */ new Map());
40913
+ P(this, "showMaterialListTitle", /* @__PURE__ */ new Map());
40913
40914
  P(this, "objectList", /* @__PURE__ */ new Map());
40914
40915
  }
40915
40916
  install(t) {
@@ -40979,7 +40980,7 @@ class PM {
40979
40980
  t.material && Mh({
40980
40981
  material: t.material
40981
40982
  });
40982
- }), this.materialList.clear(), this.objectList.clear(), this.showMaterialList.clear(), this.pencil.event.emit("materialListChange");
40983
+ }), this.materialList.clear(), this.objectList.clear(), this.showMaterialList.clear(), this.showMaterialListTitle.clear(), this.pencil.event.emit("materialListChange");
40983
40984
  }
40984
40985
  }
40985
40986
  class QM extends $s {
@@ -41032,7 +41033,7 @@ function Ql(n) {
41032
41033
  const t = new t0();
41033
41034
  return t.color.setScalar(n), t;
41034
41035
  }
41035
- const GX = "0.12.29", a1 = !1;
41036
+ const GX = "0.12.30", a1 = !1;
41036
41037
  class pl {
41037
41038
  constructor(t, e = {}) {
41038
41039
  P(this, "container");
@@ -41740,6 +41741,18 @@ class yX extends X0 {
41740
41741
  }
41741
41742
  }
41742
41743
  }
41744
+ render() {
41745
+ const e = this.pencil.installPlugins.get("materialList");
41746
+ e.setObject3d(this.object3d, "continents-group", {
41747
+ baseObject: this,
41748
+ remove: !1
41749
+ }), this.mapArr.forEach((i) => {
41750
+ e.setObject3d(i.object3d, "continents-" + i.userData.name, {
41751
+ baseObject: i,
41752
+ remove: !1
41753
+ });
41754
+ });
41755
+ }
41743
41756
  dispose() {
41744
41757
  this.mapArr.forEach((e) => {
41745
41758
  e.dispose();
@@ -41750,7 +41763,7 @@ class VX extends X0 {
41750
41763
  create() {
41751
41764
  return Gt(this, null, function* () {
41752
41765
  const t = new Oi(100, 100, 1, 1), e = new h2();
41753
- e.opacity = 0.5, this.createMesh(t, e), this.object3d.receiveShadow = !0, this.position.z = 1e-3;
41766
+ e.opacity = 0.5, this.createMesh(t, e), this.object3d.receiveShadow = !0, this.position.z = 1e-3, this.object3d.name = "阴影接受";
41754
41767
  });
41755
41768
  }
41756
41769
  }
@@ -41907,7 +41920,7 @@ const jM = {
41907
41920
  this.mList.showMaterialList.set(h + "area", [
41908
41921
  "parentPlane#topMat",
41909
41922
  "parentPlane#sideMat"
41910
- ]), this.mList.showMaterialList.set(h + "line", "parentPlane#lineMat");
41923
+ ]), this.mList.showMaterialList.set(h + "line", "parentPlane#lineMat"), this.mList.showMaterialListTitle.set(h + "area", "背景板块"), this.mList.showMaterialListTitle.set(h + "line", "背景线");
41911
41924
  const r = yield this.drawController.draw("PlaneMap", {
41912
41925
  geojson: o,
41913
41926
  projection: {
@@ -41927,19 +41940,7 @@ const jM = {
41927
41940
  depth: this.options.continentsBgDepth,
41928
41941
  equirectangular: this.options.equirectangular,
41929
41942
  scale: this.pscale
41930
- }), this.continentsBg.position.z = 0.1, this.mList.setObject3d(this.continentsBg.object3d, "continents-group", {
41931
- baseObject: this.continentsBg,
41932
- remove: !1
41933
- }), this.continentsBg.mapArr.forEach((a) => {
41934
- this.mList.setObject3d(
41935
- a.object3d,
41936
- "continents-" + a.userData.name,
41937
- {
41938
- baseObject: a,
41939
- remove: !1
41940
- }
41941
- );
41942
- })), yield this.setAdcode({
41943
+ }), this.continentsBg.position.z = 0.1), yield this.setAdcode({
41943
41944
  adcodes: [e],
41944
41945
  duration: 0
41945
41946
  });
@@ -42026,7 +42027,7 @@ const jM = {
42026
42027
  this.mList.setMaterialObj("continents", l), this.mList.showMaterialList.set("continentsArea", [
42027
42028
  "continents#topMat",
42028
42029
  "continents#sideMat"
42029
- ]), this.mList.showMaterialList.set("continentsLine", "continents#lineMat");
42030
+ ]), this.mList.showMaterialList.set("continentsLine", "continents#lineMat"), this.mList.showMaterialListTitle.set("continentsArea", "大洲"), this.mList.showMaterialListTitle.set("continentsLine", "大洲线");
42030
42031
  }
42031
42032
  const s = (() => {
42032
42033
  const l = e === 1e5 ? new le({
@@ -42055,7 +42056,7 @@ const jM = {
42055
42056
  extrudeLineMat: c
42056
42057
  };
42057
42058
  })();
42058
- this.mList.setMaterialObj("plane", s), this.mList.showMaterialList.set("area", ["plane#topMat", "plane#sideMat"]), this.mList.showMaterialList.set("line", "plane#lineMat"), this.mList.showMaterialList.set("extrudeline", "plane#extrudeLineMat");
42059
+ this.mList.setMaterialObj("plane", s), this.mList.showMaterialList.set("area", ["plane#topMat", "plane#sideMat"]), this.mList.showMaterialList.set("line", "plane#lineMat"), this.mList.showMaterialList.set("extrudeline", "plane#extrudeLineMat"), this.mList.showMaterialListTitle.set("area", "板块"), this.mList.showMaterialListTitle.set("line", "板块线"), this.mList.showMaterialListTitle.set("extrudeline", "板块边线");
42059
42060
  });
42060
42061
  }
42061
42062
  setAreaColor(e, i) {
@@ -42113,7 +42114,10 @@ const jM = {
42113
42114
  }), i = e.object3d;
42114
42115
  this.mList.changeObject3dName(i, "Shadow$1"), this.mList.changeObject3dName(i.target, "Shadow$1"), this.shadowMapLight = e, e.object3d.position.set(0.281, 32.487, 43.077), e.object3d.castShadow = !0;
42115
42116
  const s = yield this.drawController.draw("PlaneShadow");
42116
- this.mList.setObject3d(s.object3d, "PlaneShadow"), this.map && this.map.areaArr.forEach((l) => {
42117
+ this.mList.setObject3d(s.object3d, "PlaneShadow", {
42118
+ baseObject: s,
42119
+ remove: !1
42120
+ }), this.map && this.map.areaArr.forEach((l) => {
42117
42121
  l.object3d.castShadow = !0;
42118
42122
  });
42119
42123
  });
@@ -42639,7 +42643,7 @@ const Go = class Go extends pl {
42639
42643
  lineMat: o
42640
42644
  };
42641
42645
  })();
42642
- i.setMaterialObj("plane", s), i.showMaterialList.set("area", ["plane#topMat", "plane#sideMat"]), i.showMaterialList.set("line", "plane#lineMat");
42646
+ i.setMaterialObj("plane", s), i.showMaterialList.set("area", ["plane#topMat", "plane#sideMat"]), i.showMaterialList.set("line", "plane#lineMat"), this.mList.showMaterialListTitle.set("area", "板块"), this.mList.showMaterialListTitle.set("line", "板块线");
42643
42647
  });
42644
42648
  }
42645
42649
  eraseLabels() {
@@ -43698,11 +43702,11 @@ const nF = {
43698
43702
  const a = this.loader.getAsset(`/image/city/${l}-1.jpg`), o = this.loader.getAsset(`/image/city/${l}.webp`);
43699
43703
  return s[l] = [
43700
43704
  new t0({
43701
- name: "顶面",
43705
+ name: "建筑顶面-板块内" + l + "高",
43702
43706
  color: "#00a3bc"
43703
43707
  }),
43704
43708
  new le({
43705
- name: "侧面",
43709
+ name: "建筑侧面-板块内" + l + "高",
43706
43710
  map: a,
43707
43711
  normalMap: o,
43708
43712
  envMap: this.getRoomEnvMap()
@@ -43727,11 +43731,11 @@ const nF = {
43727
43731
  const a = this.loader.getAsset(`/image/city/${l}-1.jpg`), o = this.loader.getAsset(`/image/city/${l}.webp`);
43728
43732
  return s[l] = [
43729
43733
  new t0({
43730
- name: "顶面",
43734
+ name: "建筑顶面-板块外" + l + "高",
43731
43735
  color: "#133144"
43732
43736
  }),
43733
43737
  new le({
43734
- name: "侧面",
43738
+ name: "建筑侧面-块外" + l + "高",
43735
43739
  map: a,
43736
43740
  normalMap: o,
43737
43741
  envMap: this.getRoomEnvMap()
@@ -43754,10 +43758,14 @@ const nF = {
43754
43758
  }
43755
43759
  if (!this.mList.getMaterialObj("road")) {
43756
43760
  const e = new z0({
43761
+ //@ts-ignore
43762
+ name: "道路-板块内",
43757
43763
  color: "#ffc457",
43758
43764
  sizeAttenuation: 0,
43759
43765
  lineWidth: 40
43760
43766
  }), i = new z0({
43767
+ //@ts-ignore
43768
+ name: "道路-板块外",
43761
43769
  color: "#4a3f15",
43762
43770
  sizeAttenuation: 0,
43763
43771
  lineWidth: 40
@@ -43770,16 +43778,20 @@ const nF = {
43770
43778
  }
43771
43779
  if (this.mList.getMaterialObj("area") || (this.mList.setMaterialObj("area", {
43772
43780
  river: new t0({
43781
+ name: "河流-板块内",
43773
43782
  color: "#115d8a"
43774
43783
  }),
43775
43784
  grassland: new t0({
43785
+ name: "绿地-板块内",
43776
43786
  color: "#043141"
43777
43787
  })
43778
43788
  }), this.mList.setMaterialObj("area-grey", {
43779
43789
  river: new t0({
43790
+ name: "河流-板块外",
43780
43791
  color: "#19354f"
43781
43792
  }),
43782
43793
  grassland: new t0({
43794
+ name: "绿地-板块外",
43783
43795
  color: "#133341"
43784
43796
  })
43785
43797
  })), !this.mList.getMaterial("city-plane")) {
@@ -44744,15 +44756,17 @@ class yF extends Ao {
44744
44756
  if (this.options.adcode !== 1e5) {
44745
44757
  const l = (() => {
44746
44758
  const a = new le({
44747
- name: "顶面",
44759
+ name: "父级板块顶面",
44748
44760
  color: "#031529",
44749
44761
  emissive: "#010f1f",
44750
44762
  envMap: e
44751
44763
  }), o = new t0({
44752
- name: "侧面",
44764
+ name: "父级板块侧面",
44753
44765
  color: "#064d73",
44754
44766
  side: K0
44755
44767
  }), c = new z0({
44768
+ //@ts-ignore
44769
+ name: "父级板块线",
44756
44770
  color: new rt("#3f648c"),
44757
44771
  lineWidth: 4,
44758
44772
  sizeAttenuation: 0
@@ -44767,15 +44781,17 @@ class yF extends Ao {
44767
44781
  }
44768
44782
  const s = (() => {
44769
44783
  const l = new le({
44770
- name: "顶面",
44784
+ name: "世界板块顶面",
44771
44785
  color: "#031529",
44772
44786
  emissive: "#010f1f",
44773
44787
  envMap: e
44774
44788
  }), a = new t0({
44775
- name: "侧面",
44789
+ name: "世界板块侧面",
44776
44790
  color: "#064d73",
44777
44791
  side: K0
44778
44792
  }), o = new z0({
44793
+ //@ts-ignore
44794
+ name: "世界板块线",
44779
44795
  color: new rt("#3f648c"),
44780
44796
  lineWidth: 4,
44781
44797
  sizeAttenuation: 0
@@ -44791,13 +44807,15 @@ class yF extends Ao {
44791
44807
  if (this.options.continentsBg) {
44792
44808
  const s = (() => {
44793
44809
  const l = new le({
44794
- name: "顶面",
44810
+ name: "大洲板块顶面",
44795
44811
  emissive: "#235278"
44796
44812
  }), a = new t0({
44797
- name: "侧面",
44813
+ name: "大洲板块侧面",
44798
44814
  color: "#0c1528"
44799
44815
  }), o = new z0({
44800
44816
  // color: new THREE.Color('#0a88e5'),
44817
+ //@ts-ignore
44818
+ name: "大洲板块线",
44801
44819
  color: new rt("#1488e0"),
44802
44820
  sizeAttenuation: 0,
44803
44821
  lineWidth: this.options.lineWidth
@@ -44812,25 +44830,37 @@ class yF extends Ao {
44812
44830
  }
44813
44831
  const i = (() => {
44814
44832
  const s = new t0({
44815
- name: "顶面",
44833
+ name: "板块顶面",
44816
44834
  color: new rt("#064773")
44817
44835
  }), l = new t0({
44818
- name: "侧面",
44836
+ name: "板块侧面",
44819
44837
  color: new rt("#064d73"),
44820
44838
  side: K0
44821
44839
  }), a = new z0({
44840
+ //@ts-ignore
44841
+ name: "板块线",
44822
44842
  color: new rt("#02BAF7"),
44823
44843
  lineWidth: 3,
44824
44844
  sizeAttenuation: 0
44825
44845
  }), o = new z0({
44846
+ //@ts-ignore
44847
+ name: "板块边框线",
44826
44848
  color: new rt("#02BAF7"),
44827
44849
  lineWidth: 3,
44828
44850
  sizeAttenuation: 0
44829
- }), c = s.clone(), d = l.clone(), h = new z0({
44851
+ }), c = s.clone();
44852
+ c.name = "板块下钻背景顶面";
44853
+ const d = l.clone();
44854
+ d.name = "板块下钻背景侧面";
44855
+ const h = new z0({
44856
+ //@ts-ignore
44857
+ name: "板块下钻背景线",
44830
44858
  color: new rt("#3773b0"),
44831
44859
  lineWidth: 2,
44832
44860
  sizeAttenuation: 0
44833
44861
  }), r = new z0({
44862
+ //@ts-ignore
44863
+ name: "板块下钻背景边框线",
44834
44864
  color: new rt("#3773b0"),
44835
44865
  lineWidth: 4,
44836
44866
  sizeAttenuation: 0
@@ -44903,19 +44933,7 @@ class yF extends Ao {
44903
44933
  scale: this.pscale
44904
44934
  },
44905
44935
  this.group
44906
- ), this.continentsBg.position.z = 0.1, this.mList.setObject3d(this.continentsBg.object3d, "continents-group", {
44907
- baseObject: this.continentsBg,
44908
- remove: !1
44909
- }), this.continentsBg.mapArr.forEach((a) => {
44910
- this.mList.setObject3d(
44911
- a.object3d,
44912
- "continents-" + a.userData.name,
44913
- {
44914
- baseObject: a,
44915
- remove: !1
44916
- }
44917
- );
44918
- })), yield this.setAdcode({
44936
+ ), this.continentsBg.position.z = 0.1), yield this.setAdcode({
44919
44937
  adcodes: [e],
44920
44938
  duration: 0
44921
44939
  }), this.options.bottomPlane) {
@@ -45205,12 +45223,15 @@ const VF = (n) => {
45205
45223
  return Gt(this, null, function* () {
45206
45224
  const t = n.loader, e = (() => {
45207
45225
  const i = new t0({
45226
+ name: "板块顶面",
45208
45227
  color: "#094253"
45209
45228
  }), s = new t0({
45210
- name: "侧面",
45229
+ name: "板块侧面",
45211
45230
  map: t.getAsset("/image/map2/side.png"),
45212
45231
  side: K0
45213
45232
  }), l = new z0({
45233
+ // @ts-ignore
45234
+ name: "板块边框",
45214
45235
  color: new rt("#02f7eb"),
45215
45236
  lineWidth: 6,
45216
45237
  sizeAttenuation: 0,
@@ -45815,11 +45836,11 @@ class vF extends ke {
45815
45836
  }
45816
45837
  execute() {
45817
45838
  const t = this.properties ? this.object[this.properties] : this.object;
45818
- t && (t[this.attributeName] = this.newValue, this.editor.emit("objectChanged", this.object));
45839
+ t && (t[this.attributeName] = this.newValue, this.editor.emit("objectChanged", this.object), this.attributeName === "name" && this.editor.pencil.event.emit("object3dListChange"));
45819
45840
  }
45820
45841
  undo() {
45821
45842
  const t = this.properties ? this.object[this.properties] : this.object;
45822
- t[this.attributeName] = this.oldValue, this.editor.emit("objectChanged", this.object);
45843
+ t[this.attributeName] = this.oldValue, this.editor.emit("objectChanged", this.object), this.attributeName === "name" && this.editor.pencil.event.emit("object3dListChange");
45823
45844
  }
45824
45845
  update(t) {
45825
45846
  this.newValue = t.newValue;
@@ -46604,8 +46625,12 @@ class gT {
46604
46625
  changeSelectOption() {
46605
46626
  const t = this.viewport.vis, { pencil: e, mList: i } = t, s = i == null ? void 0 : i.showMaterialList.size, l = (s ? [...i.showMaterialList.keys()] : [...i.materialList.keys()]).map((c) => {
46606
46627
  const d = s ? i.getShowMaterial(c) : i.getMaterial(c), h = new yt(this.fixBufferGeometry, d);
46607
- return h.userData.fixBufferGeometry = !0, {
46608
- uuid: c.replace(c[0], c[0].toLowerCase()),
46628
+ h.userData.fixBufferGeometry = !0;
46629
+ const r = c.replace(c[0], c[0].toLowerCase());
46630
+ let u;
46631
+ return s && i.showMaterialListTitle.has(c) ? u = i.showMaterialListTitle.get(c) : !s && (d != null && d.name) && (u = d == null ? void 0 : d.name), {
46632
+ uuid: r,
46633
+ name: u,
46609
46634
  object: h
46610
46635
  };
46611
46636
  }), a = [...i.objectList.keys()].map(
@@ -46614,14 +46639,15 @@ class gT {
46614
46639
  let r = !1;
46615
46640
  return h != null && h.baseObject && h.remove !== !1 && (r = !0), We(Bt({
46616
46641
  uuid: d.replace(d[0], d[0].toLowerCase()),
46617
- object: c
46642
+ object: c,
46643
+ name: c.name
46618
46644
  }, h), {
46619
46645
  remove: r
46620
46646
  });
46621
46647
  }
46622
46648
  ), o = [...l, ...a];
46623
46649
  if (o.unshift({
46624
- name: "camera",
46650
+ name: "相机",
46625
46651
  object: e.camera,
46626
46652
  uuid: "camera"
46627
46653
  }), !this.jsonVersion) {
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "0.12.29";
1
+ declare const _default: "0.12.30";
2
2
  export default _default;
@@ -7,6 +7,7 @@ export default class MaterialList {
7
7
  material: THREE.Material;
8
8
  }>;
9
9
  showMaterialList: Map<string, string | string[]>;
10
+ showMaterialListTitle: Map<string, string>;
10
11
  objectList: Map<THREE.Object3D<THREE.Object3DEventMap>, {
11
12
  name: string;
12
13
  meta?: any;
@@ -20,14 +20,6 @@ import Torus from './Torus';
20
20
  import TorusKnot from './TorusKnot';
21
21
  import Tube from './Tube';
22
22
  export declare const objs2: {
23
- Box: typeof Box;
24
- Capsule: typeof Capsule;
25
- Circle: typeof Circle;
26
- Cylinder: typeof Cylinder;
27
- Dodecahedron: typeof Dodecahedron;
28
- Icosahedron: typeof Icosahedron;
29
- Lathe: typeof Lathe;
30
- Octahedron: typeof Octahedron;
31
23
  Plane: typeof Plane;
32
24
  Ring: typeof Ring;
33
25
  Sphere: typeof Sphere;
@@ -36,8 +28,6 @@ export declare const objs2: {
36
28
  Torus: typeof Torus;
37
29
  TorusKnot: typeof TorusKnot;
38
30
  Tube: typeof Tube;
39
- };
40
- declare const d: DrawController<{
41
31
  Box: typeof Box;
42
32
  Capsule: typeof Capsule;
43
33
  Circle: typeof Circle;
@@ -46,6 +36,8 @@ declare const d: DrawController<{
46
36
  Icosahedron: typeof Icosahedron;
47
37
  Lathe: typeof Lathe;
48
38
  Octahedron: typeof Octahedron;
39
+ };
40
+ declare const d: DrawController<{
49
41
  Plane: typeof Plane;
50
42
  Ring: typeof Ring;
51
43
  Sphere: typeof Sphere;
@@ -54,6 +46,14 @@ declare const d: DrawController<{
54
46
  Torus: typeof Torus;
55
47
  TorusKnot: typeof TorusKnot;
56
48
  Tube: typeof Tube;
49
+ Box: typeof Box;
50
+ Capsule: typeof Capsule;
51
+ Circle: typeof Circle;
52
+ Cylinder: typeof Cylinder;
53
+ Dodecahedron: typeof Dodecahedron;
54
+ Icosahedron: typeof Icosahedron;
55
+ Lathe: typeof Lathe;
56
+ Octahedron: typeof Octahedron;
57
57
  Node: typeof Node;
58
58
  Image: typeof Image;
59
59
  Line: typeof Line;
@@ -22,6 +22,7 @@ export default class extends BaseObject {
22
22
  } | undefined;
23
23
  getPointInContinent(location: [number, number]): boolean;
24
24
  getLocationPosition(location: [number, number]): number[] | undefined;
25
+ render(): void;
25
26
  dispose(): void;
26
27
  }
27
28
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vis-core",
3
- "version": "0.12.29",
3
+ "version": "0.12.30",
4
4
  "scripts": {
5
5
  "start": "npm run version && PORT=5173 bundler-dev",
6
6
  "build:site": "npm run version &&PUBLIC_EXCLUDE=public/city bundler",