Thanks for your precisions.<br><br>Well you are right! ParaView&#39;s proxy mechanism is robust and giving too much freedom to developers could be really dangerous! <br>And effectively, my first try to have access to VolumeMapper BlendMode property was to change the rendering.xml resource in order to expose it.<br>
<br>What I did was: <br><br>- adding a IntVectorProperty in FixedPointVolumeRayCastMapper SourceProxy<br>      &lt;IntVectorProperty<br>        name=&quot;BlendMode&quot;<br>        command=&quot;SetBlendMode&quot;<br>        default_values=&quot;0&quot;<br>
        number_of_elements=&quot;1&quot;<br>        animateable=&quot;0&quot;&gt;<br>        &lt;EnumerationDomain name=&quot;enum&quot;&gt;<br>          &lt;Entry value=&quot;0&quot; text=&quot;Composite&quot;/&gt;<br>          &lt;Entry value=&quot;1&quot; text=&quot;MaximumIntensity&quot;/&gt;<br>
          &lt;Entry value=&quot;2&quot; text=&quot;MinimumIntensity&quot;/&gt;<br>        &lt;/EnumerationDomain&gt;<br>      &lt;/IntVectorProperty&gt;<br><br>- adding BlendMode as exposed property to UniformGridVolumeRepresentationProxy in FixedPoint(...) SubProxy<br>
          &lt;Property name=&quot;BlendMode&quot;/&gt;<br><br>- adding BlendMode as exposed property to UniformGridRepresentation PVRepresentationProxy in UniformGrid(...) SubProxy.<br><br>I changed blend mode by using GetProperty(&quot;BlendMode&quot;) on the representation proxy, and it works as well. But in both case (bad unprotected way and exposing propoerty way), I have to change something in ParaView&#39;s tree and recompile it. It makes my plugin working on my computer only...<br>
<br>Is this BlendMode exposure interesting you and do you want me to send a diff file of my local &#39;rendering.xml&#39;? <br><br>Thanks again!<br><br>Best regards,<br>Jerome<br><br><br><br><div class="gmail_quote">2009/10/19 Berk Geveci <span dir="ltr">&lt;<a href="mailto:berk.geveci@kitware.com">berk.geveci@kitware.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">&gt; - Is there a reason (software design, maybe?) to protect the functions that<br>

&gt; give access to subproxies, whereas the access to properties are<br>
&gt; -fortunately- public?<br>
&gt; - Is there another way to access SubProxy without modifying ParaView&#39;s<br>
&gt; sources?<br>
<br>
</div>Yes, there is a reason for not exposing the sub-proxies. We wanted the<br>
access to the sub-proxies to be only through exposed properties<br>
because we want all proxies (whether they have sub-proxies or not) to<br>
behave exactly the same way. Allowing access to the sub-proxies makes<br>
it almost impossible to make sure that developers don&#39;t shoot<br>
themselves in the foot by changing properties of the sub-proxies that<br>
are supposed to be controlled by the super-proxy. For example, a<br>
property in the super-proxy may end up setting multiple properties in<br>
the sub-proxy.<br>
<br>
Isn&#39;t there another way of doing this? Maybe expose the property you<br>
are setting? Something like VolumeMapperBlendMode?<br>
<br>
-berk<br>
<div><div></div><div class="h5"><br>
On Mon, Oct 19, 2009 at 2:50 AM, Jérôme &lt;<a href="mailto:jerome.velut@gmail.com">jerome.velut@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I wrote a plugin that enable a toggle between different BlendMode of the<br>
&gt; FixedPointVolumeRayCastMapper that is used by ParaView for volume rendering.<br>
&gt; It catches a key event on a render window (&#39;B&#39; pressed) and toggle<br>
&gt; BlendMode: Composite -&gt; MaximumIntensity -&gt; MinimumIntensity -&gt;<br>
&gt; Composite-&gt;...<br>
&gt;<br>
&gt; Here is my way:<br>
&gt; - When button &#39;B&#39; pressed:<br>
&gt;    - get view manager from core instance<br>
&gt;    - get active view from view manager<br>
&gt;    - for each representation &#39;rep&#39; of active view:<br>
&gt;       - check if &#39;rep&#39; has a VolumeRepresentation SubProxy<br>
&gt;       - if yes:<br>
&gt;          - check if VolumeRepresentation has a VolumeFixedPointRayCastMapper<br>
&gt; SubProxy<br>
&gt;          - if yes:<br>
&gt;             - get the vtkFixedPointVolumeRayCastMapper (&#39;mapper&#39;) from this<br>
&gt; latter SubProxy<br>
&gt;             - mapper-&gt;SetBlendMode( (++mapper-&gt;GetBlendMode(  ))%3 );<br>
&gt;             - Update and render.<br>
&gt;<br>
&gt;<br>
&gt; For this to work, I need to call vtkSMProxy::GetSubProxy( char* ) from my<br>
&gt; plugin class. But unfortunately, these functions are protected member. I<br>
&gt; modified the ParaView sources to make it public, and it work just... fine.<br>
&gt; My questions are:<br>
&gt; - Is there a reason (software design, maybe?) to protect the functions that<br>
&gt; give access to subproxies, whereas the access to properties are<br>
&gt; -fortunately- public?<br>
&gt; - Is there another way to access SubProxy without modifying ParaView&#39;s<br>
&gt; sources?<br>
&gt;<br>
&gt; Thanks!<br>
&gt;<br>
&gt; Jerome<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ParaView Wiki at:<br>
&gt; <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
&gt;<br>
&gt;<br>
</blockquote></div><br>