All files / Sources/Rendering/Core/SurfaceLICInterface index.js

28.57% Statements 2/7
0% Branches 0/1
0% Functions 0/2
28.57% Lines 2/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105                        1x                                                                                                                                                                             1x          
import macro from 'vtk.js/Sources/macros';
 
import {
  ColorMode,
  ContrastEnhanceMode,
  NoiseType,
} from 'vtk.js/Sources/Rendering/Core/SurfaceLICInterface/Constants';
 
function vtkSurfaceLICInterface(publicAPI, model) {
  model.classHierarchy.push('vtkSurfaceLICInterface');
}
 
const DEFAULT_VALUES = {
  enableLIC: false,
  nuberOfSteps: 40,
  stepSize: 0.25,
  transformVectors: true,
  normalizeVectors: true,
  maskOnSurface: false,
  maskThreshold: 0.0,
  maskColor: [0.0, 0.0, 0.0],
  maskIntensity: 0.0,
  enhancedLIC: true,
 
  enhanceContrast: ContrastEnhanceMode.NONE,
 
  lowLICContrastEnhancementFactor: 0.0,
  highLICContrastEnhancementFactor: 0.0,
  lowColorContrastEnhancementFactor: 0.0,
  highColorContrastEnhancementFactor: 0.0,
 
  antiAlias: 0,
  colorMode: ColorMode.BLEND,
  LICIntensity: 1.0,
  mapModeBias: 0.0,
 
  noiseTextureSize: 200,
  noiseTextureType: NoiseType.GAUSSIAN,
  noiseGrainSize: 8,
  noiseImpulseProbability: 0.1,
  noiseImpulseBackgroundValue: 0.0,
  noiseGeneratorSeed: 0,
 
  minNoiseValue: 0.0,
  maxNoiseValue: 1.0,
  numberOfNoiseLevels: 2,
 
  shadersNeedBuilding: true,
  reallocateTextures: true,
  rebuildNoiseTexture: false,
 
  viewPortScale: 1.0,
};
 
export function extend(publicAPI, model, initialValues = {}) {
  Object.assign(model, DEFAULT_VALUES, initialValues);
 
  macro.obj(publicAPI, model);
 
  macro.setGet(publicAPI, model, [
    'enableLIC',
    'numberOfSteps',
    'stepSize',
    'normalizeVectors',
    'transformVectors',
    'maskOnSurface',
    'maskThreshold',
    'maskColor',
    'maskIntensity',
    'enhancedLIC',
    'enhanceContrast',
    'lowLICContrastEnhancementFactor',
    'highLICContrastEnhancementFactor',
    'lowColorContrastEnhancementFactor',
    'highColorContrastEnhancementFactor',
    'antiAlias',
    'colorMode',
    'LICIntensity',
    'mapModeBias',
 
    'noiseTextureSize',
    'noiseTextureType',
    'noiseGrainSize',
    'minNoiseValue',
    'maxNoiseValue',
    'numberOfNoiseLevels',
    'noiseImpulseProbability',
    'noiseImpulseBackgroundValue',
    'noiseGeneratorSeed',
    'viewPortScale',
    'rebuildNoiseTexture',
  ]);
 
  // Object methods
  vtkSurfaceLICInterface(publicAPI, model);
}
 
// ----------------------------------------------------------------------------
 
export const newInstance = macro.newInstance(extend, 'vtkSurfaceLICInterface');
 
// ----------------------------------------------------------------------------
 
export default { newInstance, extend };