<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello everyone,<br>
<div class="moz-forward-container"> <br>
I'm trying to use the class <i>vtkGraphReader</i> to import a
undirected graph. I thought the member function <i>SetOutput</i>
of the class <i>vtkGraphReader</i> was provided for users to
specify the resulting object, but I found that the return value of
<i>GetOutput</i> after <i>Update</i> was called was different
from the pointer I specified. Is it a bug? Or did I use the class
inappropriately?<span style="color: rgb(51, 51, 51); font-family:
arial, sans-serif, "microsoft yahei", simhei;
font-size: 16px; font-style: normal; font-variant-ligatures:
normal; font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; orphans: 2; text-align: start;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); display: inline
!important; float: none;"></span><br>
<br>
Regards<br>
Juncheng<br>
<br>
Enclosed is the .vtk file of the graph. And here is the code.<br>
vtkSmartPointer<vtkUndirectedGraph> graph =
vtkSmartPointer<vtkUndirectedGraph>::New();<br>
vtkGraphReader *reader = vtkGraphReader::New();<br>
reader->SetFileName(Filename);<br>
reader->SetOutput(graph);<br>
reader->Update();<br>
if(graph !=
vtkUndirectedGraph::SafeDownCast(reader->GetOutput()))<br>
cout << "Output is different." << endl;<br>
if(graph->GetNumberOfVertices()==0 &&
reader->GetOutput()->GetNumberOfVertices()>0)<br>
cout << "Output specified is not updated." <<
endl;<br>
reader->Delete();<br>
<br>
</div>
</body>
</html>