three-cad-viewer 2.2.1 → 2.2.2

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