Hi,

I wrote a plugin that enable a toggle between different BlendMode of the
FixedPointVolumeRayCastMapper that is used by ParaView for volume rendering.
It catches a key event on a render window ('B' pressed) and toggle
BlendMode: Composite -> MaximumIntensity -> MinimumIntensity ->
Composite->...

Here is my way:
- When button 'B' pressed:
   - get view manager from core instance
   - get active view from view manager
   - for each representation 'rep' of active view:
      - check if 'rep' has a VolumeRepresentation SubProxy
      - if yes:
         - check if VolumeRepresentation has a VolumeFixedPointRayCastMapper
SubProxy
         - if yes:
            - get the vtkFixedPointVolumeRayCastMapper ('mapper') from this
latter SubProxy
            - mapper->SetBlendMode( (++mapper->GetBlendMode(  ))%3 );
            - Update and render.


For this to work, I need to call vtkSMProxy::GetSubProxy( char* ) from my
plugin class. But unfortunately, these functions are protected member. I
modified the ParaView sources to make it public, and it work just... fine.
My questions are:
- Is there a reason (software design, maybe?) to protect the functions that
give access to subproxies, whereas the access to properties are
-fortunately- public?
- Is there another way to access SubProxy without modifying ParaView's
sources?

Thanks!

Jerome
_______________________________________________
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to