[Paraview] vtkSMProxy: GetSubProxy is protected, but I need it outside the class

Jérôme jerome.velut at gmail.com
Mon Oct 19 02:50:13 EDT 2009


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20091019/6546273a/attachment.htm>


More information about the ParaView mailing list