@kitware/vtk.js 22.0.1 → 22.0.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.
- package/Rendering/Core/RenderWindowInteractor.js +11 -2
- package/macros.js +14 -30
- package/package.json +1 -1
|
@@ -660,10 +660,14 @@ function vtkRenderWindowInteractor(publicAPI, model) {
|
|
|
660
660
|
};
|
|
661
661
|
|
|
662
662
|
publicAPI.getFirstRenderer = function () {
|
|
663
|
-
|
|
663
|
+
var _model$view, _model$view$getRender, _model$view$getRender2;
|
|
664
|
+
|
|
665
|
+
return (_model$view = model.view) === null || _model$view === void 0 ? void 0 : (_model$view$getRender = _model$view.getRenderable()) === null || _model$view$getRender === void 0 ? void 0 : (_model$view$getRender2 = _model$view$getRender.getRenderersByReference()) === null || _model$view$getRender2 === void 0 ? void 0 : _model$view$getRender2[0];
|
|
664
666
|
};
|
|
665
667
|
|
|
666
668
|
publicAPI.findPokedRenderer = function () {
|
|
669
|
+
var _model$view2, _model$view2$getRende;
|
|
670
|
+
|
|
667
671
|
var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
668
672
|
var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
669
673
|
|
|
@@ -673,7 +677,12 @@ function vtkRenderWindowInteractor(publicAPI, model) {
|
|
|
673
677
|
// the first one is the one we want to manipulate the camera on.
|
|
674
678
|
|
|
675
679
|
|
|
676
|
-
var rc = model.view.getRenderable().getRenderers();
|
|
680
|
+
var rc = (_model$view2 = model.view) === null || _model$view2 === void 0 ? void 0 : (_model$view2$getRende = _model$view2.getRenderable()) === null || _model$view2$getRende === void 0 ? void 0 : _model$view2$getRende.getRenderers();
|
|
681
|
+
|
|
682
|
+
if (!rc) {
|
|
683
|
+
return null;
|
|
684
|
+
}
|
|
685
|
+
|
|
677
686
|
rc.sort(function (a, b) {
|
|
678
687
|
return a.getLayer() - b.getLayer();
|
|
679
688
|
});
|
package/macros.js
CHANGED
|
@@ -702,12 +702,7 @@ function algo(publicAPI, model, numberOfInputs, numberOfOutputs) {
|
|
|
702
702
|
return model.inputConnection[port];
|
|
703
703
|
}
|
|
704
704
|
|
|
705
|
-
function
|
|
706
|
-
if (model.deleted) {
|
|
707
|
-
vtkErrorMacro('instance deleted - cannot call any method');
|
|
708
|
-
return;
|
|
709
|
-
}
|
|
710
|
-
|
|
705
|
+
function getPortToFill() {
|
|
711
706
|
var portToFill = model.numberOfInputs;
|
|
712
707
|
|
|
713
708
|
while (portToFill && !model.inputData[portToFill - 1] && !model.inputConnection[portToFill - 1]) {
|
|
@@ -718,26 +713,25 @@ function algo(publicAPI, model, numberOfInputs, numberOfOutputs) {
|
|
|
718
713
|
model.numberOfInputs++;
|
|
719
714
|
}
|
|
720
715
|
|
|
721
|
-
|
|
716
|
+
return portToFill;
|
|
722
717
|
}
|
|
723
718
|
|
|
724
|
-
function
|
|
719
|
+
function addInputConnection(outputPort) {
|
|
725
720
|
if (model.deleted) {
|
|
726
721
|
vtkErrorMacro('instance deleted - cannot call any method');
|
|
727
722
|
return;
|
|
728
723
|
}
|
|
729
724
|
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
while (portToFill && !model.inputData[portToFill - 1] && !model.inputConnection[portToFill - 1]) {
|
|
733
|
-
portToFill--;
|
|
734
|
-
}
|
|
725
|
+
setInputConnection(outputPort, getPortToFill());
|
|
726
|
+
}
|
|
735
727
|
|
|
736
|
-
|
|
737
|
-
|
|
728
|
+
function addInputData(dataset) {
|
|
729
|
+
if (model.deleted) {
|
|
730
|
+
vtkErrorMacro('instance deleted - cannot call any method');
|
|
731
|
+
return;
|
|
738
732
|
}
|
|
739
733
|
|
|
740
|
-
setInputData(dataset,
|
|
734
|
+
setInputData(dataset, getPortToFill());
|
|
741
735
|
}
|
|
742
736
|
|
|
743
737
|
function getOutputData() {
|
|
@@ -757,15 +751,11 @@ function algo(publicAPI, model, numberOfInputs, numberOfOutputs) {
|
|
|
757
751
|
|
|
758
752
|
publicAPI.shouldUpdate = function () {
|
|
759
753
|
var localMTime = publicAPI.getMTime();
|
|
760
|
-
var count = numberOfOutputs;
|
|
761
754
|
var minOutputMTime = Infinity;
|
|
755
|
+
var count = numberOfOutputs;
|
|
762
756
|
|
|
763
757
|
while (count--) {
|
|
764
|
-
if (!model.output[count]) {
|
|
765
|
-
return true;
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
if (model.output[count].isDeleted()) {
|
|
758
|
+
if (!model.output[count] || model.output[count].isDeleted()) {
|
|
769
759
|
return true;
|
|
770
760
|
}
|
|
771
761
|
|
|
@@ -783,15 +773,9 @@ function algo(publicAPI, model, numberOfInputs, numberOfOutputs) {
|
|
|
783
773
|
count = model.numberOfInputs;
|
|
784
774
|
|
|
785
775
|
while (count--) {
|
|
786
|
-
|
|
787
|
-
return true;
|
|
788
|
-
}
|
|
789
|
-
}
|
|
776
|
+
var _model$inputConnectio, _publicAPI$getInputDa;
|
|
790
777
|
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
while (count--) {
|
|
794
|
-
if (publicAPI.getInputData(count) && publicAPI.getInputData(count).getMTime() > minOutputMTime) {
|
|
778
|
+
if ((_model$inputConnectio = model.inputConnection[count]) !== null && _model$inputConnectio !== void 0 && _model$inputConnectio.filter.shouldUpdate() || ((_publicAPI$getInputDa = publicAPI.getInputData(count)) === null || _publicAPI$getInputDa === void 0 ? void 0 : _publicAPI$getInputDa.getMTime()) > minOutputMTime) {
|
|
795
779
|
return true;
|
|
796
780
|
}
|
|
797
781
|
}
|