Do you access VTK objects from one single executable or from an exe and one or more dlls...?<br><br>If you access VTK objects from multiple binaries, and pass them between binary components, you *must* use dlls for VTK. Otherwise, there will be multiple values for vtkTimeStamp's counter and modified time comparisons will not work from dll to dll (because they have each linked in a static copy of the data for the vtkTimeStamp counter.)
<br><br>(And there are probably other things are likely to be set up incorrectly as well, as evidenced by the output in your original question...)<br><br><br>HTH,<br>David<br><br><br><div><span class="gmail_quote">On 11/12/07,
<b class="gmail_sendername">Xavi Planes</b> <<a href="mailto:Xavier.Planes@upf.edu">Xavier.Planes@upf.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Hi,</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">I'm using VTK libraries, for compiling and linking my
own code. I use a DLL library and an application program to test it. The application
program does this:</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">1. Loads a vtkPolyData using vtkPolyDataReader.</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">2. Calls the function SetData(vtkPolyData *pData ) on an
object inside the DLL. The pData pointer is copied into an internal pointer
m_pData and calls Register( ) function of the pData.</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">3. Destroy the vtkPolyDataReader: ptrVtkReader->Delete();</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">4. Call function Initialize() of the object inside the DLL.
This function uses the vtkPolyData stored into the internal pointer m_pData,
creates a vtkThreshold filter, calls SetInput() and calls Update().</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">If I use VTK libraries compiled in dynamic mode, there's
no problem and everything is working fine. </span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">However, if I use VTK libraries compiled in static mode, the
vtkThreshold raises this error:</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">"vtkStreamDemandDrivenPipeline: Input for connection
index 0 on input port index 0 for algorithm vtkThreshold is NULL, but a
vtkDataSet is required. "</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">If I debug the program, I can see that the input passed to
the vtkThreshold is right and different from NULL.</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">So, my question is: Could somebody give me a clue about what
is going wrong and how to solve it, please? For example, is there an object
that takes care of memory management and is given me problems (a singleton
class managing memory and there is an instance in the executable and another in
the DLL when VTK is static)? </span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Thanks,</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> Xavi</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
</div>
</div>
<br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers
</a><br><br></blockquote></div><br>