[vtkusers] [vtk] reading vtkMultiBlockDataSet

Tanaka Simon tanakas at gmx.ch
Mon Oct 27 10:17:41 EDT 2014


i think found the solution:


     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->ShallowCopy(reader->GetOutput());
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();




On 27.10.2014 14:57, Tanaka Simon wrote:
> 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
>
>
>
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers

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


More information about the vtkusers mailing list