[vtkusers] [vtk] reading vtkMultiBlockDataSet

Tanaka Simon tanakas at gmx.ch
Wed Oct 29 08:25:25 EDT 2014


Hello,

i have one more question: why does the following line work (see below 
for the context)?

multiBDS_read->ShallowCopy(reader->GetOutput());

why does ShallowCopy copies all the content to multiBDS_read (as 
compared to DeepCopy)?


thanks
simon

On 27.10.2014 15:17, Tanaka Simon wrote
> 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 bywww.kitware.com
>>
>> Visit other Kitware open-source projects athttp://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
>
>
>
> _______________________________________________
> 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/20141029/328c0016/attachment-0001.html>


More information about the vtkusers mailing list