Hi,<br>thanks for your interest. Attached is a diff file between my rendering.xml and CVS&#39;s one.<br>An idea to complete this would be to add a combo-box in the display panel (such as the slider for slice representation,...). However, this is less important, since when the BlendMode property is exposed through the UniformGridRepresentation, the Comp. / MIP / MinIP rendering mode is &#39;toggleable&#39;. Here is a code snippet that can be use in C++ from inside a plugin to toggle BlendMode (Note, this could be more elegant by using properly QList... ):<br>
<br>///////// Code-snippet: Toggle BlendMode<br>   pqViewManager * viewManager = qobject_cast&lt;pqViewManager*&gt;<br>         (pqApplicationCore::instance()-&gt;manager(&quot;MULTIVIEW_MANAGER&quot;));<br><br>   // Get the representations present in the active view<br>
   for( int repId = 0; repId &lt; viewManager-&gt;getActiveView( )-&gt;getNumberOfRepresentations( ); repId++)<br>   {<br><br>      pqRepresentation* rep = viewManager-&gt;getActiveView( )-&gt;getRepresentation( repId );<br>
      vtkSMUniformGridVolumeRepresentationProxy* proxy = 0;<br>      proxy = static_cast&lt;vtkSMUniformGridVolumeRepresentationProxy*&gt;(rep-&gt;getProxy());<br>      <br>      // Check if the representation proxy is a UniformGridVolumeRepresentationProxy<br>
      if( proxy &amp;&amp; rep-&gt;isVisible( ))<br>      {<br>         <br>         // Get the BlendMode property<br>         vtkSMIntVectorProperty* blendModeProp = 0;<br>         blendModeProp  = vtkSMIntVectorProperty::SafeDownCast( proxy-&gt;GetProperty(&quot;BlendMode&quot;));<br>
<br>         // If the Property is not exposed, it cannot be used!!<br>         if( blendModeProp )<br>         {<br>            // Increment the current BlendMode (Comp -&gt; MIP -&gt;MinIP -&gt;Comp -&gt;...<br>
            int blendMode = blendModeProp-&gt;GetElement( 0 );<br>            blendMode++;<br>            blendModeProp-&gt;SetElement( 0, blendMode%3 );<br><br>            // Render<br>            proxy-&gt;UpdateSelfAndAllInputs( );<br>
            rep-&gt;renderView( true );<br>         }<br>      }<br>   }<br><br>/////////////////// End Code-snippet: Toggle BlendMode<br><br>Thanks again,<br>Jerome<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;">I don&#39;t have any problems with committing the changes you described.<br>
Would you mind adding a document element to the property XML though?<br>
<font color="#888888"><br>
-berk<br>
</font><div><div></div><div class="h5"><br>
On Mon, Oct 19, 2009 at 10:50 AM, Jérôme &lt;<a href="mailto:jerome.velut@gmail.com">jerome.velut@gmail.com</a>&gt; wrote:<br>
&gt; Thanks for your precisions.<br>
&gt;<br>
&gt; Well you are right! ParaView&#39;s proxy mechanism is robust and giving too much<br>
&gt; freedom to developers could be really dangerous!<br>
&gt; And effectively, my first try to have access to VolumeMapper BlendMode<br>
&gt; property was to change the rendering.xml resource in order to expose it.<br>
&gt;<br>
&gt; What I did was:<br>
&gt;<br>
&gt; - adding a IntVectorProperty in FixedPointVolumeRayCastMapper SourceProxy<br>
&gt;       &lt;IntVectorProperty<br>
&gt;         name=&quot;BlendMode&quot;<br>
&gt;         command=&quot;SetBlendMode&quot;<br>
&gt;         default_values=&quot;0&quot;<br>
&gt;         number_of_elements=&quot;1&quot;<br>
&gt;         animateable=&quot;0&quot;&gt;<br>
&gt;         &lt;EnumerationDomain name=&quot;enum&quot;&gt;<br>
&gt;           &lt;Entry value=&quot;0&quot; text=&quot;Composite&quot;/&gt;<br>
&gt;           &lt;Entry value=&quot;1&quot; text=&quot;MaximumIntensity&quot;/&gt;<br>
&gt;           &lt;Entry value=&quot;2&quot; text=&quot;MinimumIntensity&quot;/&gt;<br>
&gt;         &lt;/EnumerationDomain&gt;<br>
&gt;       &lt;/IntVectorProperty&gt;<br>
&gt;<br>
&gt; - adding BlendMode as exposed property to<br>
&gt; UniformGridVolumeRepresentationProxy in FixedPoint(...) SubProxy<br>
&gt;           &lt;Property name=&quot;BlendMode&quot;/&gt;<br>
&gt;<br>
&gt; - adding BlendMode as exposed property to UniformGridRepresentation<br>
&gt; PVRepresentationProxy in UniformGrid(...) SubProxy.<br>
&gt;<br>
&gt; I changed blend mode by using GetProperty(&quot;BlendMode&quot;) on the representation<br>
&gt; proxy, and it works as well. But in both case (bad unprotected way and<br>
&gt; exposing propoerty way), I have to change something in ParaView&#39;s tree and<br>
&gt; recompile it. It makes my plugin working on my computer only...<br>
&gt;<br>
&gt; Is this BlendMode exposure interesting you and do you want me to send a diff<br>
&gt; file of my local &#39;rendering.xml&#39;?<br>
&gt;<br>
&gt; Thanks again!<br>
&gt;<br>
&gt; Best regards,<br>
&gt; Jerome<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; 2009/10/19 Berk Geveci &lt;<a href="mailto:berk.geveci@kitware.com">berk.geveci@kitware.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; &gt; - Is there a reason (software design, maybe?) to protect the functions<br>
&gt;&gt; &gt; that<br>
&gt;&gt; &gt; give access to subproxies, whereas the access to properties are<br>
&gt;&gt; &gt; -fortunately- public?<br>
&gt;&gt; &gt; - Is there another way to access SubProxy without modifying ParaView&#39;s<br>
&gt;&gt; &gt; sources?<br>
&gt;&gt;<br>
&gt;&gt; Yes, there is a reason for not exposing the sub-proxies. We wanted the<br>
&gt;&gt; access to the sub-proxies to be only through exposed properties<br>
&gt;&gt; because we want all proxies (whether they have sub-proxies or not) to<br>
&gt;&gt; behave exactly the same way. Allowing access to the sub-proxies makes<br>
&gt;&gt; it almost impossible to make sure that developers don&#39;t shoot<br>
&gt;&gt; themselves in the foot by changing properties of the sub-proxies that<br>
&gt;&gt; are supposed to be controlled by the super-proxy. For example, a<br>
&gt;&gt; property in the super-proxy may end up setting multiple properties in<br>
&gt;&gt; the sub-proxy.<br>
&gt;&gt;<br>
&gt;&gt; Isn&#39;t there another way of doing this? Maybe expose the property you<br>
&gt;&gt; are setting? Something like VolumeMapperBlendMode?<br>
&gt;&gt;<br>
&gt;&gt; -berk<br>
&gt;&gt;<br>
&gt;&gt; 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;&gt; &gt; Hi,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I wrote a plugin that enable a toggle between different BlendMode of the<br>
&gt;&gt; &gt; FixedPointVolumeRayCastMapper that is used by ParaView for volume<br>
&gt;&gt; &gt; rendering.<br>
&gt;&gt; &gt; It catches a key event on a render window (&#39;B&#39; pressed) and toggle<br>
&gt;&gt; &gt; BlendMode: Composite -&gt; MaximumIntensity -&gt; MinimumIntensity -&gt;<br>
&gt;&gt; &gt; Composite-&gt;...<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Here is my way:<br>
&gt;&gt; &gt; - When button &#39;B&#39; pressed:<br>
&gt;&gt; &gt;    - get view manager from core instance<br>
&gt;&gt; &gt;    - get active view from view manager<br>
&gt;&gt; &gt;    - for each representation &#39;rep&#39; of active view:<br>
&gt;&gt; &gt;       - check if &#39;rep&#39; has a VolumeRepresentation SubProxy<br>
&gt;&gt; &gt;       - if yes:<br>
&gt;&gt; &gt;          - check if VolumeRepresentation has a<br>
&gt;&gt; &gt; VolumeFixedPointRayCastMapper<br>
&gt;&gt; &gt; SubProxy<br>
&gt;&gt; &gt;          - if yes:<br>
&gt;&gt; &gt;             - get the vtkFixedPointVolumeRayCastMapper (&#39;mapper&#39;) from<br>
&gt;&gt; &gt; this<br>
&gt;&gt; &gt; latter SubProxy<br>
&gt;&gt; &gt;             - mapper-&gt;SetBlendMode( (++mapper-&gt;GetBlendMode(  ))%3 );<br>
&gt;&gt; &gt;             - Update and render.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; For this to work, I need to call vtkSMProxy::GetSubProxy( char* ) from<br>
&gt;&gt; &gt; my<br>
&gt;&gt; &gt; plugin class. But unfortunately, these functions are protected member. I<br>
&gt;&gt; &gt; modified the ParaView sources to make it public, and it work just...<br>
&gt;&gt; &gt; fine.<br>
&gt;&gt; &gt; My questions are:<br>
&gt;&gt; &gt; - Is there a reason (software design, maybe?) to protect the functions<br>
&gt;&gt; &gt; that<br>
&gt;&gt; &gt; give access to subproxies, whereas the access to properties are<br>
&gt;&gt; &gt; -fortunately- public?<br>
&gt;&gt; &gt; - Is there another way to access SubProxy without modifying ParaView&#39;s<br>
&gt;&gt; &gt; sources?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thanks!<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Jerome<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Visit other Kitware open-source projects at<br>
&gt;&gt; &gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Please keep messages on-topic and check the ParaView Wiki at:<br>
&gt;&gt; &gt; <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; &gt; <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>