<HTML>
<HEAD>
<TITLE>Re: [Paraview] Trouble with DeepCopy()</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>I’m not sure why you are getting the error that you are, but I would recommend using a ShallowCopy instead of a DeepCopy.<BR>
<BR>
The problem may be when you set the input of pe to outputPoly. I don’t know where that object came from, but if it is part of either the input or output of your filter, you should not set it directly as the input to an internal filter. Doing so will screw up the pipeline connections already established for your filter and then wreck havoc on the executive because it will not expect the pipeline connections to change while your filter is executing. You should create a new object to use as the input and shallow copy the data into that new object.<BR>
<BR>
-Ken<BR>
<BR>
On 2/8/10 4:43 AM, "Adriano Gagliardi" <<a href="agagliardi@ara.co.uk">agagliardi@ara.co.uk</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Ok, it appears the code I posted works if I don't call pe->Delete(). I was<BR>
hoping the DeepCopy would allow me to then free up this memory. Maybe<BR>
someone could clear this up for me?<BR>
<BR>
<BR>
===================================<BR>
<BR>
Adriano Gagliardi MEng PhD<BR>
Project Scientist<BR>
Computational Aerodynamics<BR>
Aircraft Research Association Ltd.<BR>
Manton Lane<BR>
Bedford<BR>
<BR>
Tel: 01234 32 4644<BR>
E-mail: <a href="agagliardi@ara.co.uk">agagliardi@ara.co.uk</a><BR>
Url: www.ara.co.uk<BR>
-----Original Message-----<BR>
From: <a href="paraview-bounces@paraview.org">paraview-bounces@paraview.org</a> [<a href="mailto:paraview-bounces@paraview.org">mailto:paraview-bounces@paraview.org</a>]<BR>
On Behalf Of Adriano Gagliardi<BR>
Sent: 08 February 2010 11:14<BR>
To: 'ParaView'<BR>
Subject: [Paraview] Trouble with DeepCopy()<BR>
<BR>
<BR>
Dear All,<BR>
<BR>
I'm executing the filter vtkPlotEdges. I pass in a vtkPolyData object and<BR>
receive a vtkMultiBlockDataSet object as output. My output data object is<BR>
also of type vtkMultiBlockDataSet, so I'm trying to perform a DeepCopy of<BR>
the temp object, but I'm receiving a segmentation fault. Can someone point<BR>
out what I'm missing here?<BR>
<BR>
{<BR>
<BR>
vtkMultiBlockDataSet *output = vtkMultiBlockDataSet::SafeDownCast(<BR>
outInfo->Get(vtkDataObject::DATA_OBJECT()) );<BR>
<BR>
//polydata is a pointer to a populated vtkPolyData object.<BR>
<BR>
std::cout << "Executing vtkPlotEdges..." << std::endl;<BR>
vtkPlotEdges* pe = vtkPlotEdges::New();<BR>
pe->SetInput(outputPoly);<BR>
pe->Update();<BR>
<BR>
output->DeepCopy(pe->GetOutput());<BR>
<BR>
pe->Delete();<BR>
<BR>
}<BR>
<BR>
<BR>
Cheers,<BR>
<BR>
Adriano<BR>
<BR>
===================================<BR>
<BR>
Adriano Gagliardi MEng PhD<BR>
Project Scientist<BR>
Computational Aerodynamics<BR>
Aircraft Research Association Ltd.<BR>
Manton Lane<BR>
Bedford<BR>
<BR>
Tel: 01234 32 4644<BR>
E-mail: <a href="agagliardi@ara.co.uk">agagliardi@ara.co.uk</a><BR>
Url: www.ara.co.uk<BR>
<BR>
<BR>
---------------------------<BR>
This email contains information that is private and confidential and is<BR>
intended only for the addressee. If you are not the intended recipient<BR>
please delete it and notify us immediately by e-mailing the sender.<BR>
Note: All email sent to or from this address may be accessed by someone<BR>
other than the recipient, for system management and security reasons.<BR>
Aircraft Research Association Ltd. Registered in England, Registration No<BR>
503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB<BR>
196351245<BR>
<BR>
<BR>
_______________________________________________<BR>
Powered by www.kitware.com<BR>
<BR>
Visit other Kitware open-source projects at<BR>
<a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><BR>
<BR>
Please keep messages on-topic and check the ParaView Wiki at:<BR>
<a href="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</a><BR>
<BR>
Follow this link to subscribe/unsubscribe:<BR>
<a href="http://www.paraview.org/mailman/listinfo/paraview">http://www.paraview.org/mailman/listinfo/paraview</a><BR>
<BR>
<BR>
---------------------------<BR>
This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender.<BR>
Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons.<BR>
Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245<BR>
<BR>
<BR>
_______________________________________________<BR>
Powered by www.kitware.com<BR>
<BR>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><BR>
<BR>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</a><BR>
<BR>
Follow this link to subscribe/unsubscribe:<BR>
<a href="http://www.paraview.org/mailman/listinfo/paraview">http://www.paraview.org/mailman/listinfo/paraview</a><BR>
<BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'><BR>
**** Kenneth Moreland<BR>
*** Sandia National Laboratories<BR>
*********** <BR>
*** *** *** email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
** *** ** phone: (505) 844-8919<BR>
*** web: <a href="http://www.cs.unm.edu/~kmorel">http://www.cs.unm.edu/~kmorel</a><BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT>
</BODY>
</HTML>