[vtkusers] How to extract datas from vtkLSdynaReader

c_dinco at sina.com c_dinco at sina.com
Fri Jun 11 21:37:40 EDT 2010

 I used vtkLSdynaReader to read a ls-dyna d3plot file which just contain a solid object, but program crashed when run to: 
cout<<"number of Solid cell:"<<&nbsp; rdr->OutputSolid->GetNumberOfCells()<<endl;
In fact, all variables Output*****&nbsp; are defined as vtkUnstructuredGrid*,&nbsp;
I checked the variable "OutputSolid" using function "getNameclass", and find&nbsp;it is not&nbsp;&nbsp;"vtkUnstructuredGrid" type after program running.So I have no idea how to extract data from "OutputSolid".
Could you do me a favor that how to extract all datas&nbsp;from "OutputSolid"?
By the way, all variables are changed from "protected" to "public" for debugging.
Thanks very much!
Following are my code:
vtkLSDynaReader* rdr = vtkLSDynaReader::New();
&nbsp;rdr->SetDatabaseDirectory( "C:\\Users\\sample" );

&nbsp;cout<<"number of Particles cell:"<<&nbsp; rdr->OutputParticles->GetNumberOfCells()<<endl;
&nbsp;cout<<"number of Beam cell:"<<&nbsp; rdr->OutputBeams->GetNumberOfCells()<<endl;
&nbsp;cout<<"number of RigidBody cell:"<<&nbsp; rdr->OutputRigidBody->GetNumberOfCells()<<endl;
&nbsp;cout<<"number of RoadSurface cell:"<<&nbsp; rdr->OutputRoadSurface->GetNumberOfCells()<<endl;
&nbsp;cout<<"number of Shell cell:"<<&nbsp; rdr->OutputShell->GetNumberOfCells()<<endl;
&nbsp;cout<<"number of Solid cell:"<<&nbsp; rdr->OutputSolid->GetNumberOfCells()<<endl;
&nbsp;cout<<"number of ThickShell cell:"<<&nbsp; rdr->OutputThickShell->GetNumberOfCells()<<endl;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100612/b37a3909/attachment.htm>

More information about the vtkusers mailing list