Skip to content

Commit e31a7b4

Browse files
authored
Merge pull request #497 from Kitware/concentric_cylinder_angles
fix(ConcentricCylinderSource): Add start/end angles.
2 parents f8d8e6b + 4861867 commit e31a7b4

File tree

3 files changed

+181
-79
lines changed

3 files changed

+181
-79
lines changed

Sources/Filters/Sources/ConcentricCylinderSource/example/controlPanel.html

+19-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,24 @@
2020
<hr/>
2121
</td>
2222
</tr>
23+
<tr>
24+
<td>Start Theta</td>
25+
<td colspan="3">
26+
<input class='startTheta' type="range" min="0" max="360" step="1" value="0" />
27+
</td>
28+
</tr>
29+
<tr>
30+
<td>End Theta</td>
31+
<td colspan="3">
32+
<input class='endTheta' type="range" min="0" max="360" step="1" value="360" />
33+
</td>
34+
</tr>
35+
<tr>
36+
<td>Resolution</td>
37+
<td colspan="3">
38+
<input class='resolution' type="range" min="3" max="120" step="1" value="60" />
39+
</td>
40+
</tr>
2341
<tr>
2442
<td>Hide Layer 0</td>
2543
<td>
@@ -29,7 +47,7 @@
2947
<tr>
3048
<td>Hide Layer 1</td>
3149
<td>
32-
<input class='mask' data-layer="1" type="checkbox" />
50+
<input class='mask' data-layer="1" type="checkbox"/>
3351
</td>
3452
</tr>
3553
<tr>

Sources/Filters/Sources/ConcentricCylinderSource/example/index.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const cylinder = vtkConcentricCylinderSource.newInstance({
2727
height: 0.25,
2828
radius: [0.2, 0.3, 0.4, 0.6, 0.7, 0.8, 0.9, 1],
2929
cellFields: [0, 0.2, 0.4, 0.6, 0.7, 0.8, 0.9, 1],
30-
resolution: 120,
30+
resolution: 60,
3131
skipInnerFaces: true,
3232
});
3333
const actor = vtkActor.newInstance();
@@ -66,6 +66,13 @@ while (count--) {
6666
renderWindow.render();
6767
});
6868
}
69+
['startTheta', 'endTheta', 'resolution'].forEach((propertyName) => {
70+
document.querySelector(`.${propertyName}`).addEventListener('input', (e) => {
71+
const value = Number(e.target.value);
72+
cylinder.set({ [propertyName]: value });
73+
renderWindow.render();
74+
});
75+
});
6976

7077
// -----------------------------------------------------------
7178
// Make some variables global so that you can inspect and

0 commit comments

Comments
 (0)