[Paraview] vtk renderer question

Sgouros, Thomas thomas_sgouros at brown.edu
Tue Jun 26 10:15:31 EDT 2018


Hi All:

I have a vtk renderer in a ParaViewWeb application. I create it and then
attach it to a container for display using the setContainer() method.

                this.renderers.push(VtkRenderer.newInstance({
                  client: this.model.pvwClient,
                  viewId: result,
                }) );
                this.renderers[this.renderers.length - 1].setContainer(
                  document.getElementById(container));

This renders fine, and I can see the <div> I created and the <canvas>
inside it that appears to be the vtkRenderer.

When I render the container invisible (through the click of a user button)
in the render function of its container, it disappears obediently, but when
I make it visible again, the canvas inside my container is missing. Not
zero size, just not present. I tried explicitly calling the render() method
of the vtkRenderer object, but that doesn't seem to do anything.

Here's what I'm doing:

        <button onClick={()=>{
          this.rendererTwoVisible = !this.rendererTwoVisible;
          if (this.rendererTwoVisible) this.renderers[1].render(); //
Doesn't do anything.
        }}>
   ...
        { this.rendererTwoVisible ? (
          <div style={{display: 'table-cell',
                       width: '50%',
                      }}>
            <MyControlPanel model={this.model}

 view={this.renderers[1]?this.renderers[1].getViewId():""}
            />
            <div id="renderContainerTwo"
                 style={{position: 'relative',
                             height: '80vh',
                             resize: 'both',
                             overflow: 'hidden',
                             zIndex: '10',
                        }}
            />
          </div>
        ) : null }

I feel like there is a render method I should be calling directly
somewhere, but can't figure out what or where that should be. Any
suggestions welcome,

Thank you,

 -Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/paraview/attachments/20180626/d6de8105/attachment.html>


More information about the ParaView mailing list