<div class="gmail_quote">On Tue, Jun 12, 2012 at 7:20 AM, David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The documentation for this class says:<br><a href="http://www.vtk.org/doc/nightly/html/classvtkFileOutputWindow.html#details" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkFileOutputWindow.html#details</a><br>
<br>"To use this class, instantiate it and then call SetInstance(this)."<br>
<br>It seems like you have to do this:<div><br></div><div><div>  vtkSmartPointer<vtkFileOutputWindow> fileOutputWindow = </div><div>      vtkSmartPointer<vtkFileOutputWindow>::New();</div><div>  fileOutputWindow->SetFileName( "output2.txt" );</div>

<div>  fileOutputWindow->SetInstance( fileOutputWindow );</div><div><br></div><div>If you are supposed to call SetInstance(this), why not just set that internally and not require a SetInstance call at all?</div><span class="HOEnZb"><font color="#888888"><div>
<br>
</div>David</font></span></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
<br></blockquote></div><br><div><br></div><div>SetInstance is a *static* method. It keeps track of a single instance of (possibly many) vtkOutputWindow objects.</div><div><br></div><div>You do not necessarily want to call SetInstance every time you create a vtkOutputWindow, therefore you have to call it manually/intentionally when you actually do want to record a specific instance as "*the* output window"...</div>
<div><br></div><div>This is a very common occurrence when following the Singleton pattern.</div><div><br></div><div><br></div><div>HTH,</div><div>David C.</div><div><br></div>