Skip to content

Commit

Permalink
fix(Proxy): Allow dataset to be removed
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Jan 24, 2018
1 parent 3a71297 commit 5632d4a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/Proxy/Core/AbstractRepresentationProxy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function vtkAbstractRepresentationProxy(publicAPI, model) {
publicAPI.updateColorByDomain();
};

publicAPI.getInputDataSet = () => model.input.getDataset();
publicAPI.getInputDataSet = () => model.input ? model.input.getDataset() : null;

publicAPI.getDataArray = (arrayName, arrayLocation) => {
const [selectedArray, selectedLocation] = publicAPI.getColorBy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function vtkSliceRepresentationProxy(publicAPI, model) {
model.mapper[`set${model.slicingMode}Slice`](index);

publicAPI.getSliceIndex = () =>
model.mapper[`get${model.slicingMode}Slice`]();
model.slicingMode ? model.mapper[`get${model.slicingMode}Slice`]() : 0;

publicAPI.setSlicingMode = (mode) => {
if (!mode) {
Expand All @@ -148,8 +148,12 @@ function vtkSliceRepresentationProxy(publicAPI, model) {

// Used for UI
publicAPI.getSliceIndexValues = () => {
const ds = publicAPI.getInputDataSet();
if (!ds) {
return [];
}
const values = [];
const extent = publicAPI.getInputDataSet().getExtent();
const extent = ds.getExtent();
const axisIndex = 'XYZ'.indexOf(model.slicingMode);
const endValue = extent[axisIndex * 2 + 1];
let currentValue = extent[axisIndex * 2];
Expand Down

0 comments on commit 5632d4a

Please sign in to comment.