@kitware/vtk.js 28.8.3 → 28.9.0
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type vtkPolyData from './../../Common/DataModel/PolyData';
|
|
2
2
|
import type vtkPlane from './../../Common/DataModel/Plane';
|
|
3
3
|
import vtkAbstractRepresentationProxy from './../Core/AbstractRepresentationProxy';
|
|
4
|
+
import { RGBColor } from './../../types';
|
|
4
5
|
|
|
5
6
|
export interface vtkResliceRepresentationProxy
|
|
6
7
|
extends vtkAbstractRepresentationProxy {
|
|
@@ -15,6 +16,12 @@ export interface vtkResliceRepresentationProxy
|
|
|
15
16
|
getWindowLevel(): number;
|
|
16
17
|
setInterpolationType(type: number): boolean;
|
|
17
18
|
getInterpolationType(): number;
|
|
19
|
+
setOutlineLineWidth(lineWidth: number): boolean;
|
|
20
|
+
getOutlineLineWidth(): number;
|
|
21
|
+
setOutlineColor(color: RGBColor): boolean;
|
|
22
|
+
getOutlineColor(): RGBColor;
|
|
23
|
+
setOutlineVisibility(visibility: boolean): boolean;
|
|
24
|
+
getOutlineVisibility(): boolean;
|
|
18
25
|
setSlabType(type: number): boolean;
|
|
19
26
|
getSlabtype(): number;
|
|
20
27
|
setSlicePlane(plane: vtkPlane): boolean;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
|
+
import vtkActor from '../../Rendering/Core/Actor.js';
|
|
3
|
+
import vtkCutter from '../../Filters/Core/Cutter.js';
|
|
4
|
+
import vtkImageDataOutlineFilter from '../../Filters/General/ImageDataOutlineFilter.js';
|
|
2
5
|
import vtkImageSlice from '../../Rendering/Core/ImageSlice.js';
|
|
3
6
|
import vtkImageResliceMapper from '../../Rendering/Core/ImageResliceMapper.js';
|
|
7
|
+
import vtkMapper from '../../Rendering/Core/Mapper.js';
|
|
4
8
|
import { SlabTypes } from '../../Rendering/Core/ImageResliceMapper/Constants.js';
|
|
5
9
|
import vtkPlane from '../../Common/DataModel/Plane.js';
|
|
6
10
|
import vtkAbstractRepresentationProxy from '../Core/AbstractRepresentationProxy.js';
|
|
@@ -58,10 +62,25 @@ function vtkResliceRepresentationProxy(publicAPI, model) {
|
|
|
58
62
|
model.slicePlane = vtkPlane.newInstance();
|
|
59
63
|
model.slicePlane.setNormal(0, 1, 0);
|
|
60
64
|
model.mapper.setSlicePlane(model.slicePlane);
|
|
61
|
-
model.mapper.setSlabType(SlabTypes.MAX); //
|
|
65
|
+
model.mapper.setSlabType(SlabTypes.MAX); // for the slice polygon outline
|
|
66
|
+
|
|
67
|
+
model.outline = {
|
|
68
|
+
iof: vtkImageDataOutlineFilter.newInstance(),
|
|
69
|
+
sof: vtkCutter.newInstance({
|
|
70
|
+
cutFunction: model.slicePlane
|
|
71
|
+
}),
|
|
72
|
+
mapper: vtkMapper.newInstance(),
|
|
73
|
+
actor: vtkActor.newInstance({
|
|
74
|
+
visibility: false
|
|
75
|
+
})
|
|
76
|
+
};
|
|
77
|
+
model.outline.sof.setInputConnection(model.outline.iof.getOutputPort());
|
|
78
|
+
model.outline.mapper.setInputConnection(model.outline.sof.getOutputPort()); // connect rendering pipeline
|
|
62
79
|
|
|
63
80
|
model.actor.setMapper(model.mapper);
|
|
64
81
|
model.actors.push(model.actor);
|
|
82
|
+
model.outline.actor.setMapper(model.outline.mapper);
|
|
83
|
+
model.actors.push(model.outline.actor);
|
|
65
84
|
|
|
66
85
|
function setInputData(inputDataset) {
|
|
67
86
|
var state = updateDomains(inputDataset, publicAPI.getDataArray(), model, publicAPI.updateProxyProperty);
|
|
@@ -73,7 +92,8 @@ function vtkResliceRepresentationProxy(publicAPI, model) {
|
|
|
73
92
|
model.sourceDependencies.push(model.mapper);
|
|
74
93
|
model.sourceDependencies.push({
|
|
75
94
|
setInputData: setInputData
|
|
76
|
-
});
|
|
95
|
+
});
|
|
96
|
+
model.sourceDependencies.push(model.outline.iof); // API ----------------------------------------------------------------------
|
|
77
97
|
|
|
78
98
|
var parentSetColorBy = publicAPI.setColorBy;
|
|
79
99
|
|
|
@@ -107,6 +127,8 @@ function extend(publicAPI, model) {
|
|
|
107
127
|
|
|
108
128
|
vtkResliceRepresentationProxy(publicAPI, model); // Proxyfy
|
|
109
129
|
|
|
130
|
+
model.outlineActor = model.outline.actor;
|
|
131
|
+
model.outlineProperty = model.outline.actor.getProperty();
|
|
110
132
|
macro.proxyPropertyMapping(publicAPI, model, {
|
|
111
133
|
visibility: {
|
|
112
134
|
modelKey: 'actor',
|
|
@@ -143,6 +165,18 @@ function extend(publicAPI, model) {
|
|
|
143
165
|
slabTrapezoidIntegration: {
|
|
144
166
|
modelKey: 'mapper',
|
|
145
167
|
property: 'slabTrapezoidIntegration'
|
|
168
|
+
},
|
|
169
|
+
outlineVisibility: {
|
|
170
|
+
modelKey: 'outlineActor',
|
|
171
|
+
property: 'visibility'
|
|
172
|
+
},
|
|
173
|
+
outlineColor: {
|
|
174
|
+
modelKey: 'outlineProperty',
|
|
175
|
+
property: 'color'
|
|
176
|
+
},
|
|
177
|
+
outlineLineWidth: {
|
|
178
|
+
modelKey: 'outlineProperty',
|
|
179
|
+
property: 'lineWidth'
|
|
146
180
|
}
|
|
147
181
|
});
|
|
148
182
|
} // ----------------------------------------------------------------------------
|