[vtkusers] [vtk] reading vtkMultiBlockDataSet

Tanaka Simon tanakas at gmx.ch
Mon Oct 27 09:57:44 EDT 2014


Hello, I want to read a vtkMultiBlockDataSet and append some more blocks 
(vtkPolyData). How do I have to extract the blocks from the reader and 
how can I add new blocks?



the (pseudo) code looks like this. Please have a look at the line with 
the red comment, the rest should be fine:


     vtkSmartPointer<vtkXMLMultiBlockDataReader> reader = 
vtkSmartPointer<vtkXMLMultiBlockDataReader>::New();
reader->SetFileName("vtkMultiBlockDataSetWriter_output.vtm");{
     reader->Update();

     vtkSmartPointer<vtkPolyData> linePolyData =
     vtkSmartPointer<vtkPolyData>::New();
     /* add some vtkLine to linePolyData */

     vtkSmartPointer<vtkMultiBlockDataSet> multiBDS_read = 
vtkSmartPointer<vtkMultiBlockDataSet>::New ();
     multiBDS_read->SETBLOCKS(reader->GETBLOCKS()); // HOW CAN I 
TRANSFER THE BLOCKS FROM READER TO MULTIBDS_READER?
multiBDS_read->(multiBDS->GetNumberOfBlocks(),linePolyData); // append 
one more block

     vtkSmartPointer<vtkXMLMultiBlockDataWriter> writer = 
vtkSmartPointer<vtkXMLMultiBlockDataWriter>::New();
     writer->SetFileName("vtkMultiBlockDataSetWriter_output.vtm");
     writer->SetInput(multiBDS_read);
     writer->Write();


thanks
s





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20141027/bbfc5834/attachment.html>


More information about the vtkusers mailing list