How to use the paraview-glance/src/utils.makeSubManager function in paraview-glance

To help you get started, we’ve selected a few paraview-glance examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Kitware / paraview-glance / src / components / tools / MeasurementTools / script.js View on Github external
mounted() {
    this.threeDViewActive =
      this.proxyManager.getActiveView().getClassName() === 'vtkViewProxy';

    this.paletteCycler = createPaletteCycler(this.palette);
    // used during the duration of widget placement
    this.viewSubs = [];
    // used to show/hide widgets per slice
    this.repSubs = [];
    this.widgetStateSub = makeSubManager();
  },
  beforeDestroy() {
github Kitware / paraview-glance / src / vtk / LabelMapVolumeRepProxy / index.js View on Github external
function vtkLabelMapVolumeRepProxy(publicAPI, model) {
  // Set our className
  model.classHierarchy.push('vtkLabelMapVolumeRepProxy');

  const labelMapSub = makeSubManager();

  // Volume
  model.mapper = vtkVolumeMapper.newInstance();
  model.volume = vtkVolume.newInstance();
  model.property = model.volume.getProperty();

  model.property.setInterpolationTypeToNearest();

  function updateTransferFunctions(labelmap) {
    const colorMap = labelmap.getColorMap();

    const cfun = vtkColorTransferFunction.newInstance();
    const ofun = vtkPiecewiseFunction.newInstance();

    Object.keys(colorMap).forEach((label) => {
      const l = Number(label);
github Kitware / paraview-glance / src / vtk / LabelMapSliceRepProxy / index.js View on Github external
function vtkLabelMapSliceRepProxy(publicAPI, model) {
  // Set our className
  model.classHierarchy.push('vtkLabelMapSliceRepProxy');

  const labelMapSub = makeSubManager();

  model.property.setInterpolationType(InterpolationType.NEAREST);

  function updateTransferFunctions(labelmap) {
    const colorMap = labelmap.getColorMap();

    const cfun = vtkColorTransferFunction.newInstance();
    const ofun = vtkPiecewiseFunction.newInstance();

    Object.keys(colorMap).forEach((label) => {
      const l = Number(label);
      cfun.addRGBPoint(l, ...colorMap[label].slice(0, 3).map((c) => c / 255));
      ofun.addPoint(l, colorMap[label][3] / 255);
    });

    model.property.setRGBTransferFunction(cfun);
github Kitware / paraview-glance / src / components / tools / CropTool / script.js View on Github external
mounted() {
    this.stateSub = makeSubManager();
  },
  beforeDestroy() {
github Kitware / paraview-glance / src / components / tools / PaintTool / script.js View on Github external
mounted() {
    this.widget = vtkPaintWidget.newInstance();
    this.widget.setRadius(this.radius);
    this.filter = null;
    this.view3D = null;

    this.paletteCycler = createPaletteCycler(this.palette);

    this.subs = [];
    this.labelmapSub = makeSubManager();
  },
  beforeDestroy() {
github Kitware / paraview-glance / src / components / tools / MeasurementTools / script.js View on Github external
function emptyTool() {
  return {
    toolInfo: null,
    widget: null,
    viewWidget: null,
    repId: -1,
    slice: -1,
    axis: '',
    stateSub: makeSubManager(),
    name: '',
    extraInfo: '',
    size: 16,
    color: PALETTE[0],
  };
}