[Paraview] vtk renderer question

Sgouros, Thomas thomas_sgouros at brown.edu
Tue Jun 26 10:46:56 EDT 2018


Brilliant. I knew I was doing something dumb. Thank you.

 -Tom

On Tue, Jun 26, 2018 at 10:37 AM, Sebastien Jourdain <
sebastien.jourdain at kitware.com> wrote:

> The reason why it is not working is because you removed the container of
> the renderer from the DOM.
> Therefore, you will have to set its container again... Basically it is
> rendering somewhere in a detached DOM element.
>
> You can do that, or simply use CSS to hide that DOM element.
>
> On Tue, Jun 26, 2018 at 8:15 AM Sgouros, Thomas <thomas_sgouros at brown.edu>
> wrote:
>
>> 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
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> ParaView discussion is moving! Please visit https://discourse.paraview.
>> org/ for future posts.
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/
>> opensource/opensource.html
>>
>> Please keep messages on-topic and check the ParaView Wiki at:
>> http://paraview.org/Wiki/ParaView
>>
>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> https://public.kitware.com/mailman/listinfo/paraview
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/paraview/attachments/20180626/2f48d51f/attachment.html>


More information about the ParaView mailing list