<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1419001563922_11106" dir="ltr"><span id="yui_3_16_0_1_1419001563922_11107">In the debugger, I followed the call</span><br><span></span></div><div id="yui_3_16_0_1_1419001563922_11465" dir="ltr">m_pChart->GetPlot(0)->SetInputData(0);</div><div id="yui_3_16_0_1_1419001563922_11114" dir="ltr"><br></div><div id="yui_3_16_0_1_1419001563922_11113" dir="ltr">all the way into vtkContextMapper2D::SetInputConnection()  and it seems to invoke the calls inputs->SetNumberOfInformationObjects(0); and this->Modified().</div><div id="yui_3_16_0_1_1419001563922_12434" dir="ltr"><br></div><div id="yui_3_16_0_1_1419001563922_13046" dir="ltr">So although Modified() is called when the input is removed, I think the scene is not re-rendered (I don't get a warning re. a mapper w/o input either (what other mappers do)).</div><div id="yui_3_16_0_1_1419001563922_16832" dir="ltr"><br></div><div id="yui_3_16_0_1_1419001563922_16834" dir="ltr">Turning the visibility on/off using SetVisible() works fine. But I find it weird that the data is still dangling.</div><div id="yui_3_16_0_1_1419001563922_17693" dir="ltr">(I don't want to remove the plot, because that would mean I'll have to keep track of all the plot ids.)</div><div id="yui_3_16_0_1_1419001563922_17699" dir="ltr"><br></div><div id="yui_3_16_0_1_1419001563922_17700" dir="ltr">So I think my problem is gone, as long as I don't try to understand what is going on. ;-)</div><div id="yui_3_16_0_1_1419001563922_17702" dir="ltr"><br></div><div id="yui_3_16_0_1_1419001563922_17701" dir="ltr">Maarten<br></div><div id="yui_3_16_0_1_1419001563922_13047" dir="ltr"><br></div> <div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"> <font size="2" face="Arial"> On Friday, December 19, 2014 10:48 AM, Marcus D. Hanwell <marcus.hanwell@kitware.com> wrote:<br> </font> </div>  <br><br> <div class="y_msg_container">On Fri, Dec 19, 2014 at 10:12 AM, Maarten Beek via vtkusers<br clear="none"><<a shape="rect" ymailto="mailto:vtkusers@vtk.org" href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>> wrote:<br clear="none">> Hi all,<br clear="none">><br clear="none">> Yesterday I started exploring the options to draw 2d graphs in VTK.<br clear="none">><br clear="none">> Why does<br clear="none">><br clear="none">> m_pChart->GetPlot(0)->SetInputData(0);<br clear="none">><br clear="none">> not remove the graph from my chart?<br clear="none">><br clear="none">That isn't how the API was designed, you can call remove for a plot,<br clear="none">or clear all plots.<div class="yqt3468474166" id="yqtfd32086"><br clear="none">><br clear="none">> I am currently using<br clear="none">> vtkTable* table = m_pChart->GetPlot(0)->GetInput();<br clear="none">> if( 0 != table )<br clear="none">> {<br clear="none">>     while( 0  < table->GetNumberOfRows() )<br clear="none">>     {<br clear="none">>         table->RemoveRow(0);<br clear="none">>     }<br clear="none">> }<br clear="none">><br clear="none">> m_pChart->GetPlot(0)->GetData()->Modified(); // <- required!</div><br clear="none">><br clear="none">Unless the data is marked as modified then the plot is cached, and it<br clear="none">would be slow to rebuild on every render. This is pretty common in the<br clear="none">VTK API, if an object is not marked as modified it is not surprising.<br clear="none">I guess you might expect SetInputData on the plot to mark that as<br clear="none">modified, which could be a bug in that method.<br clear="none"><br clear="none">Hope that makes it clearer, it has been a while since I went through<br clear="none">all of this logic, and it is possible we still have one or two bugs<br clear="none">lurking in there.<br clear="none"><br clear="none">Marcus<div class="yqt3468474166" id="yqtfd87421"><br clear="none"></div><br><br></div>  </div> </div>  </div> </div></body></html>