Hi,

please make sure that the mitk-users list is in the recipients list so we keep the discussion on the list.

It looks like you actually want to add some "default rendering properties" for the surface objects your reader creates, correct?

Default properties are actually added by the corresponding mapper, see for example the SetDefaultProperties() implementation of the mitk::SurfaceVtkMapper3D class [1]. If you do not register your own mapper, I am afraid you currently cannot add default rendering properties.

Usually people customize the visualization of their specific mitk::Surface instance when the add it to the data storage, which is where the also need to create the corresponding mitk::DataNode instance.

Best,
Sascha


[1] https://github.com/MITK/MITK/blob/master/Core/Code/Rendering/mitkSurfaceVtkMapper3D.cpp#L487

On 06/06/2014 08:48 AM, Franziskus Neuhoff wrote:
HI,

Thanks for the reply.

" Instead, set the properties on the mitk::DataNode instance containing your mitk::Surface output object."

But how do I get the DataNode?

Or do I have to change my reader such that it returns a datanode? Because now its:
classMITK_CORE_EXPORT UcdFileReader : publicSurfaceSource
and the factory is:
classMITK_CORE_EXPORT UcdFileIOFactory : publicitk::ObjectFactoryBase

And just create a new DataNode and do SetData(output) doesn't work, too.

Regards,
Franziskus


------------------------------------------------------------------------
Date: Thu, 5 Jun 2014 23:19:29 +0200
From: [email protected]
To: [email protected]; [email protected]
Subject: Re: [mitk-users] Polydata Set Visualization Property - Workbench

On 06/05/2014 10:01 AM, Franziskus Neuhoff wrote:

     Hi,
    I want to set some visualization properties for a polydata
    (LineWidth,Color,Depth-Sorting). I load it with a vtkAVSucdReader
    and add it to workbench like this:

    if ( reader->GetOutput() != NULL )
    {
    mitk::Surface::Pointer output = this->GetOutput();
    output->SetVtkPolyData( filter->GetOutput() );
    output->SetProperty("material.wireframeLineWidth",
    mitk::FloatProperty::New(4.0));
    output->Update();
    success = true;
    }
    Unfortunatly the properties doesn't affect the visualization. Can
    anybody say me how to do this correct?

    Regards,
    Franziskus


Hi Franziskus,

you are setting properties of the mitk::Surface object. Instead, set the properties on the mitk::DataNode instance containing your mitk::Surface output object.

Best,
Sascha

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to