<html>
<head>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I am wondering if the "<font face="Courier New, Courier, monospace">Set</font>"
method in <font face="Courier New, Courier, monospace">vtkInformation</font>
class performs a deep-copy or shallow-copy when I set a <font
face="Courier New, Courier, monospace">DATA_OBJECT</font> into it?<br>
<br>
Suppose I have some <font face="Courier New, Courier, monospace">vtkDataSet</font>
and I want to append them into <font face="Courier New, Courier,
monospace">outputInfo</font> of a filter inside its <font
face="Courier New, Courier, monospace">RequestData</font> method.
<br>
<br>
<font face="Courier New, Courier, monospace">int
Filter1::RequestData(...)<br>
{<br>
vtkSmartPointer<vtkSomeReader> myreader =
vtkSmartPointer<vtkSomeReader>::New();<br>
...<br>
vtkDataSet *MyDataSet = Reader->GetOutput();<br>
outputInfo->Set(vtkDataObject::DATA_OBJECT(),MyDataSet);<br>
...<br>
}</font><br>
<br>
at the end of <font face="Courier New, Courier, monospace">RequestData</font>,
both the pointer <font face="Courier New, Courier, monospace">myreader</font>
and its data on the heap would be out of scope. Since I made them
smart pointers, both pointer "myreader" and the data on the heap
will be deleted (right?).<br>
<br>
But in the next filter of the pipeline (say Filter2 is connected to
Filter1), I can receive the data in <font face="Courier New,
Courier, monospace">inputInfo</font><br>
<br>
<font face="Courier New, Courier, monospace">int
Filter2::RequestData(...)<br>
{<br>
...<br>
... inputInfo->Get(vtkDataObject::DATA_OBJECT());<br>
}</font><br>
<br>
I am wondering why still I can get the data, since data deferenced
by <font face="Courier New, Courier, monospace">MyDataSet</font> in
previous filter no longer exists?<br>
<br>
Does <font face="Courier New, Courier, monospace">vtkInformation::Set</font>
perform a deep copy?<br>
<br>
Thank you.<br>
</body>
</html>