three-cad-viewer 2.2.1 → 2.2.3

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.
@@ -58565,7 +58565,9 @@ void main() {
58565
58565
  }
58566
58566
 
58567
58567
  setShapeVisible(flag) {
58568
- this.types.front.material.visible = flag;
58568
+ if (this.types.front) {
58569
+ this.types.front.material.visible = flag;
58570
+ }
58569
58571
  for (var t of ["clipping-0", "clipping-1", "clipping-2"]) {
58570
58572
  if (this.types[t]) {
58571
58573
  this.types[t].children[0].material.visible = flag;
@@ -62866,7 +62868,7 @@ void main() {
62866
62868
  }
62867
62869
  }
62868
62870
 
62869
- const version = "2.2.1";
62871
+ const version = "2.2.3";
62870
62872
 
62871
62873
  class Viewer {
62872
62874
  /**
@@ -63971,6 +63973,9 @@ void main() {
63971
63973
 
63972
63974
  this.display.autoCollapse();
63973
63975
 
63976
+ // ensure all for all deselected objects the stencil planes are invisible
63977
+ this.setObjects(this.states, true, true);
63978
+
63974
63979
  //
63975
63980
  // show the rendering
63976
63981
  //
@@ -64135,12 +64140,12 @@ void main() {
64135
64140
  * @param {States} states
64136
64141
  * @param {boolean} [notify=true] - whether to send notification or not.
64137
64142
  */
64138
- setObjects = (states, notify = true) => {
64143
+ setObjects = (states, force = false, notify = true) => {
64139
64144
  for (var key in this.states) {
64140
64145
  var oldState = this.states[key];
64141
64146
  var newState = states[key];
64142
64147
  var objectGroup = this.nestedGroup.groups[key];
64143
- if (oldState[0] != newState[0]) {
64148
+ if (force || oldState[0] != newState[0]) {
64144
64149
  objectGroup.setShapeVisible(newState[0] === 1);
64145
64150
  this.states[key][0] = newState[0];
64146
64151
  }
@@ -64896,6 +64901,17 @@ void main() {
64896
64901
  return this.states;
64897
64902
  }
64898
64903
 
64904
+ /**
64905
+ * Get state of a treeview leafs for a path.
64906
+ * separator can be / or |
64907
+ * @param {string} path - path of the object
64908
+ * @returns {number[]} state value in the form of [mesh, edges] = [0/1, 0/1]
64909
+ **/
64910
+ getState(path) {
64911
+ var p = path.replaceAll("|", "/");
64912
+ return this.getStates()[p];
64913
+ }
64914
+
64899
64915
  /**
64900
64916
  * Set states of a treeview leafs
64901
64917
  * @function