Skip to content

Commit

Permalink
Disable validateProps
Browse files Browse the repository at this point in the history
  • Loading branch information
1chandu committed Nov 5, 2019
1 parent 5700195 commit 105d0af
Showing 1 changed file with 28 additions and 28 deletions.
Expand Up @@ -300,7 +300,7 @@ export default class GPUGridAggregator {
this.setState({cellSize});
}

this.validateProps(aggregationParams, opts);
// validateProps(aggregationParams, opts);

this.setState({useGPU});
aggregationParams.gridTransformMatrix =
Expand Down Expand Up @@ -331,33 +331,6 @@ export default class GPUGridAggregator {
this.setState({numCol, numRow, windowSize: [width, height]});
}

/* eslint-disable complexity */
// validate and log.assert
validateProps(aggregationParams, opts) {
const {changeFlags, projectPoints, gridTransformMatrix} = aggregationParams;
log.assert(
changeFlags.dataChanged || changeFlags.viewportChanged || changeFlags.cellSizeChanged
);

// log.assert for required options
log.assert(
!changeFlags.dataChanged ||
(opts.attributes &&
opts.weights &&
(!opts.projectPositions || opts.moduleSettings.viewport) &&
opts.cellSize)
);
log.assert(!changeFlags.cellSizeChanged || opts.cellSize);

// viewport is needed only when performing screen space aggregation (projectPoints is true)
log.assert(!(changeFlags.viewportChanged && projectPoints) || opts.moduleSettings.viewport);

if (projectPoints && gridTransformMatrix) {
log.warn('projectPoints is true, gridTransformMatrix is ignored')();
}
}
/* eslint-enable complexity */

// CPU Aggregation methods

// aggregated weight value to a cell
Expand Down Expand Up @@ -1076,3 +1049,30 @@ function getMeanTransform(gl, opts) {
)
);
}

/* eslint-disable complexity */
// DEBUG ONLY
// validateProps(aggregationParams, opts) {
// const {changeFlags, projectPoints, gridTransformMatrix} = aggregationParams;
// log.assert(
// changeFlags.dataChanged || changeFlags.viewportChanged || changeFlags.cellSizeChanged
// );
//
// // log.assert for required options
// log.assert(
// !changeFlags.dataChanged ||
// (opts.attributes &&
// opts.weights &&
// (!opts.projectPositions || opts.moduleSettings.viewport) &&
// opts.cellSize)
// );
// log.assert(!changeFlags.cellSizeChanged || opts.cellSize);
//
// // viewport is needed only when performing screen space aggregation (projectPoints is true)
// log.assert(!(changeFlags.viewportChanged && projectPoints) || opts.moduleSettings.viewport);
//
// if (projectPoints && gridTransformMatrix) {
// log.warn('projectPoints is true, gridTransformMatrix is ignored')();
// }
// }
/* eslint-enable complexity */

0 comments on commit 105d0af

Please sign in to comment.