Skip to content

Commit

Permalink
refactor(shiftOpacityAlpha): Rename opacityAlphaShift -> shiftOpacity…
Browse files Browse the repository at this point in the history
…Alpha
  • Loading branch information
bnmajor committed Nov 8, 2023
1 parent 4155bca commit 9c8bc0d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/VolumeRendering.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default defineComponent({
{
mode,
shift: pwfWidget.getOpacityPointShift(),
shiftAlpha: pwfWidget.getOpacityAlphaShift(),
shiftAlpha: pwfWidget.getShiftOpacityAlpha(),
}
);
}
Expand Down
18 changes: 9 additions & 9 deletions src/vtk/PiecewiseWidget/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function vtkPiecewiseWidget(publicAPI, model) {
model.pwMode = Mode.Gaussians;
model.opacityPoints = [];
model.opacityPointShift = 0;
model.opacityAlphaShift = 0;
model.shiftOpacityAlpha = 0;

publicAPI.setGaussiansMode = () => {
model.pwMode = Mode.Gaussians;
Expand All @@ -93,8 +93,8 @@ function vtkPiecewiseWidget(publicAPI, model) {

publicAPI.shiftPosition = (coords, meta) => {
if (model.ctrlKeyIsDown) {
model.opacityAlphaShift =
meta.originalOpacityAlphaShift + coords[1] - meta.originalXY[1];
model.shiftOpacityAlpha =
meta.originalShiftOpacityAlpha + coords[1] - meta.originalXY[1];
} else {
model.opacityPointShift =
meta.originalOpacityPointShift + coords[0] - meta.originalXY[0];
Expand Down Expand Up @@ -137,7 +137,7 @@ function vtkPiecewiseWidget(publicAPI, model) {
model.dragAction = {
originalXY: mouseCoords,
originalOpacityPointShift: model.opacityPointShift,
originalOpacityAlphaShift: model.opacityAlphaShift,
originalShiftOpacityAlpha: model.shiftOpacityAlpha,
};

return true;
Expand All @@ -157,7 +157,7 @@ function vtkPiecewiseWidget(publicAPI, model) {
model.opacities = samplePiecewiseLinear(
model.opacityPoints,
model.opacityPointShift,
model.opacityAlphaShift
model.shiftOpacityAlpha
);
publicAPI.invokeOpacityChange(publicAPI, true);
}
Expand All @@ -171,12 +171,12 @@ function vtkPiecewiseWidget(publicAPI, model) {
// deep copy
model.opacityPoints = points.map((p) => [p[0], p[1]]);
model.opacityPointShift = shift;
model.opacityAlphaShift = shiftAlpha;
model.shiftOpacityAlpha = shiftAlpha;

model.opacities = samplePiecewiseLinear(
model.opacityPoints,
model.opacityPointShift,
model.opacityAlphaShift
model.shiftOpacityAlpha
);
publicAPI.modified();
}
Expand All @@ -185,7 +185,7 @@ function vtkPiecewiseWidget(publicAPI, model) {
publicAPI.getEffectiveOpacityPoints = () =>
model.opacityPoints.map((p) => [
p[0] + model.opacityPointShift,
p[1] + model.opacityAlphaShift,
p[1] + model.shiftOpacityAlpha,
]);

publicAPI.render = () => {
Expand Down Expand Up @@ -213,7 +213,7 @@ export function extend(publicAPI, model, initialValues = {}) {
macro.setGet(publicAPI, model, [
'opacityPoints',
'opacityPointShift',
'opacityAlphaShift',
'shiftOpacityAlpha',
'ctrlKeyIsDown',
]);

Expand Down

0 comments on commit 9c8bc0d

Please sign in to comment.