Skip to content

Commit a85aea0

Browse files
sankheshfloryst
authored andcommitted
style(mapper2d): removed unused imports, const fixes, lonely-if
Fixed newly introduced formatting errors like unused import, const declaration, only if in an else statement.
1 parent 6c9b986 commit a85aea0

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

Sources/Rendering/Core/Mapper2D/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ import Constants from 'vtk.js/Sources/Rendering/Core/Mapper/Constants';
1010

1111
const { ColorMode, ScalarMode, GetArray } = Constants;
1212
const { VectorMode } = vtkScalarsToColors;
13+
const { VtkDataTypes } = vtkDataArray;
1314

1415
/**
1516
* Increase by one the 3D coordinates
1617
* It will follow a zigzag pattern so that each coordinate is the neighbor of the next coordinate
1718
* This enables interpolation between two texels without issues
1819
* Note: texture coordinates can't be interpolated using this pattern
19-
* @param {vec3} coordinates The 3D coordinates using integers for each coorinate
20+
* @param {vec3} coordinates The 3D coordinates using integers for each coordinate
2021
* @param {vec3} dimensions The 3D dimensions of the volume
2122
*/
2223
function updateZigzaggingCoordinates(coordinates, dimensions) {
@@ -438,7 +439,7 @@ function vtkMapper2D(publicAPI, model) {
438439
scalars.getDataType() === VtkDataTypes.UNSIGNED_CHAR) ||
439440
model.colorMode === ColorMode.DIRECT_SCALARS
440441
) {
441-
// Don't use texture is direct coloring using RGB unsigned chars is
442+
// Don't use texture if direct coloring using RGB unsigned chars is
442443
// requested.
443444
return false;
444445
}

Sources/Rendering/OpenGL/PolyDataMapper2D/index.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { mat4 } from 'gl-matrix';
33

44
import * as macro from 'vtk.js/Sources/macros';
55
import vtkHelper from 'vtk.js/Sources/Rendering/OpenGL/Helper';
6-
import vtkMapper2D from 'vtk.js/Sources/Rendering/Core/Mapper2D';
76
import vtkPoints from 'vtk.js/Sources/Common/Core/Points';
87
import vtkPolyData2DFS from 'vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyData2DFS.glsl';
98
import vtkPolyData2DVS from 'vtk.js/Sources/Rendering/OpenGL/glsl/vtkPolyData2DVS.glsl';
@@ -18,8 +17,6 @@ import { DisplayLocation } from 'vtk.js/Sources/Rendering/Core/Property2D/Consta
1817

1918
import { registerOverride } from 'vtk.js/Sources/Rendering/OpenGL/ViewNodeFactory';
2019

21-
import { ScalarMode } from 'vtk.js/Sources/Rendering/Core/Mapper/Constants';
22-
2320
const { primTypes } = vtkHelper;
2421
const { Filter, Wrap } = vtkOpenGLTexture;
2522
const { vtkErrorMacro } = macro;
@@ -353,14 +350,12 @@ function vtkOpenGLPolyDataMapper2D(publicAPI, model) {
353350
' opacity = opacity*vertexColorVSOutput.a;',
354351
])
355352
).result;
356-
} else {
357-
if (model.renderable.getAreScalarsMappedFromCells()) {
358-
colorImpl = colorImpl.concat([
359-
' vec4 texColor = texture2D(texture1, tcoordVCVSOutput.st);',
360-
' diffuseColor = texColor.rgb;',
361-
' opacity = opacity*texColor.a;',
362-
]);
363-
}
353+
} else if (model.renderable.getAreScalarsMappedFromCells()) {
354+
colorImpl = colorImpl.concat([
355+
' vec4 texColor = texture2D(texture1, tcoordVCVSOutput.st);',
356+
' diffuseColor = texColor.rgb;',
357+
' opacity = opacity*texColor.a;',
358+
]);
364359
}
365360

366361
colorImpl = colorImpl.concat([
@@ -597,7 +592,7 @@ function vtkOpenGLPolyDataMapper2D(publicAPI, model) {
597592
model.internalColorTexture &&
598593
cellBO.getProgram().isUniformUsed('texture1')
599594
) {
600-
let texUnit = model.internalColorTexture.getTextureUnit();
595+
const texUnit = model.internalColorTexture.getTextureUnit();
601596
if (texUnit > -1) {
602597
cellBO
603598
.getProgram()

0 commit comments

Comments
 (0)