Thank you Jochen,

Update() does not do the trick, there is still nothing displayed in the 
multiwidget..

It seems to be a vtk issue rather than a problem with the Surface. I 
copied the implementation of the iso surface functionality (which also 
uses a Surface, but aquired from a filter via GetOutput() ) for testing 
and it works without any problems.

Anyone have other suggestions?


Thanks in advance,
Simon



On 04/27/2010 05:46 PM, Neuhaus Jochen wrote:
> Hi Simon,
>
> Try
>    sphere->Update();
> before
>    sphere->Getoutput();
>
> Regards,
>   Jochen
>
>> -----Ursprüngliche Nachricht-----
>> Von: Simon Eck [mailto:[email protected]]
>> Gesendet: Dienstag, 27. April 2010 16:53
>> An: [email protected]
>> Betreff: Re: [mitk-users] Add VTK Mesh Objects to DataStorage
>>
>> Hi Alex,
>>
>> thank you for the fast answer! Using a surface seems to work fine in
>> general. When calling my method a new surface is created in the data
>> manager. However i there is nothing displayed inside the multiwidget. I
>> experimented with some parameters of the vtkSphereSource object, but no
>> success.
>>
>>
>> This is how it looks right now:
>>
>> void Experimental::createVtkObjects() {
>>      mitk::DataTreeNode::Pointer node = getSelectedNode();
>>      if( node.IsNull() ) {
>>              return;
>>      }
>>
>>      vtkSphereSource* sphere = vtkSphereSource::New();
>>      sphere->SetCenter(0.0, 0.0, 0.0);
>>      sphere->SetRadius(200);
>>      sphere->SetThetaResolution(18);
>>      sphere->SetPhiResolution(18);
>>      vtkPolyData* sphereData = sphere->GetOutput();
>>
>>      mitk::Surface::Pointer sphereSurface = mitk::Surface::New();
>>      sphereSurface->SetVtkPolyData(sphereData);
>>
>>      mitk::DataTreeNode::Pointer sphereNode =
>> mitk::DataTreeNode::New();
>>      sphereNode->SetData(sphereSurface);
>>      int layer = 0;
>>      node->GetIntProperty("layer", layer);
>>      sphereNode->SetIntProperty("layer", layer+1);
>>      sphereNode->SetProperty("Surface",
>> mitk::BoolProperty::New(true));
>>      sphereNode->SetName("my VTK Mesh");
>>      sphereNode->SetVisibility(true);
>>
>>      DataStorage->Add(sphereNode, node);
>>
>>      mitk::RenderingManager::GetInstance()->RequestUpdateAll();
>> }
>>
>>
>> Maybe i am missing something...any ideas are appreciated.
>>
>>
>> Regards,
>> Simon
>>

------------------------------------------------------------------------------
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to