<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";
mso-fareast-language:EN-GB;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:"Calibri","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoPlainText">Hi <o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoNormal">I used vtkSMPVRepresentationProxy::SetScalarColoring() as suggested ( which resolved the error message after I manually deleted my filter in the pipeline browser ) followed by vtkSMPVRepresentationProxy::RescaleTransferFunctionToDataRange()
what allowed me to retrieve a valid RGBPoints array from the lookup table. myView->render() and setting the lookup table also helped me resolve the other issues and it all works nicely for me.
<o:p></o:p></p>
<p class="MsoNormal">Now I am trying to wrap up my algorithm into a filter class and thought that either RequestData() or RequestUpdateExtent() may be a good place to do it. Unfortunately the pipeline representation object is not available when I create the
filter for the first time and press Apply. I also figured out that once the filter has been created, modified and the Apply button was pressed again the filter already knows that the representation is there. Is there a way around it to get this to work all
the time or do I have to register a button which would need to be used after the filter has been created in the pipeline browser in order to update its properties for the first time ?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Andrzej<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><span lang="EN-US" style="mso-fareast-language:EN-GB">-----Original Message-----<br>
From: Utkarsh Ayachit [mailto:utkarsh.ayachit@kitware.com] <br>
Sent: 28 January 2016 15:07<br>
To: Yumin Yuan<br>
Cc: Andrzej Peczak; paraview@paraview.org<br>
Subject: Re: [Paraview] Changing values of property panel</span><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoNormal">As a side note, for changing coloring on representations, I'd suggest using vtkSMPVRepresentationProxy::SetScalarColoring() [1] instead of changing "ColorArrayName" directly. That takes care of setting up lookup table etc. ParaView would.
<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">[1] <a href="http://www.paraview.org/ParaView3/Doc/Nightly/www/cxx-doc/classvtkSMPVRepresentationProxy.html#acb45bfbb4940b0a6a30852aaff0a8b35">
<span style="color:windowtext;text-decoration:none">http://www.paraview.org/ParaView3/Doc/Nightly/www/cxx-doc/classvtkSMPVRepresentationProxy.html#acb45bfbb4940b0a6a30852aaff0a8b35</span></a><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Yumin Yuan [mailto:yumin.yuan@kitware.com]
<br>
<b>Sent:</b> 28 January 2016 14:02<br>
<b>To:</b> Andrzej Peczak<br>
<b>Cc:</b> paraview@paraview.org<br>
<b>Subject:</b> Re: [Paraview] Changing values of property panel<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi Andrzej,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Thu, Jan 28, 2016 at 8:25 AM, Andrzej Peczak <<a href="mailto:apeczak@ara.co.uk" target="_blank">apeczak@ara.co.uk</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">Hi Yumin,<br>
<br>
I used your snippet and it is working fine. I also tried to change the properties of the upstream filter in addition to the active one but it put me into trouble. I am modifying the properties with the following code where I want to change the visibility, surface
representation and input array of the upstream. When I execute the code the widgets get changed but nothing happens in the view with regards to the changes I made to the upstream, that is the upstream object stays invisible. To make the object visible I have
to manually click on the active object.<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">You may be missing a render call. Try adding the following at the end<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> myView->render();<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">After that the upstream object becomes visible but then its colour mapping does not change in accordance with the input array I set to the upstream.<o:p></o:p></span></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">You have to also set the same "LookupTable" to the upstream representation.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">The other issue I have is when I delete my object from the pipeline after modifying the lookup table. Paraview displays "vtkSMPVRepresentationProxy
(0x2f6c8c0): Failed to determine the LookupTable being used." message.<o:p></o:p></span></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Which object? how did you delete it? Normally this message means you have an empty "LookupTable".<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">HTH<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Yumin<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black"> vtkSMProxy* repProxy = repr->getProxy();<br>
const char * arrayName = vtkSMPropertyHelper(repProxy, "ColorArrayName").GetInputArrayNameToProcess();<br>
int association = vtkSMPropertyHelper(repProxy, "ColorArrayName").GetInputArrayAssociation();<br>
<br>
pqDataRepresentation * uRepr = repr->getRepresentationForUpstreamSource();<br>
vtkSMProxy* uRepProxy = uRepr->getProxy();<br>
vtkSMPropertyHelper( uRepProxy, "ColorArrayName" ).SetInputArrayToProcess( association, arrayName );<br>
vtkSMPropertyHelper( uRepProxy, "ColorArrayName" ).Set( arrayName );<br>
vtkSMPropertyHelper( uRepProxy, "Visibility" ).Set( 1 );<br>
vtkSMPropertyHelper( uRepProxy, "Representation" ).Set( "Surface" );<br>
<br>
repProxy->UpdateVTKObjects();<br>
uRepProxy->UpdateVTKObjects();<br>
<br>
<br>
Andrzej<o:p></o:p></span></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="color:black">
<hr size="2" width="100%" align="center">
</span></div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black"> Yumin Yuan [<a href="mailto:yumin.yuan@kitware.com" target="_blank">yumin.yuan@kitware.com</a>]<br>
<b>Sent:</b> 27 January 2016 14:41<br>
<b>To:</b> Andrzej Peczak<br>
<b>Cc:</b> <a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a><br>
<b>Subject:</b> Re: [Paraview] Changing values of property panel</span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="color:black">Hi Andrzej, <o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black">The representation has its own SM proxy,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="color:black"> vtkSMProxy* repProxy = repr->getProxy();<o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="color:black"> vtkSMPropertyHelper(repProxy, "Representation").Set("Surface With Edges");<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="color:black"> vtkSMPropertyHelper(repProxy, "LineWidth").Set(2);<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="color:black">HTH,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black">Yumin<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="color:black">On Wed, Jan 27, 2016 at 7:36 AM, Andrzej Peczak <<a href="mailto:apeczak@ara.co.uk" target="_blank">apeczak@ara.co.uk</a>> wrote:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"><br>
Hi<br>
<br>
I am trying to find a way to modify property values of a filter. I figured out how to change values of the lookup table through its proxy after which the changes are visible in the colour map editor panel widgets.<br>
<br>
I can do it with the following snippet code, however I have not found yet the way to change properties of the filter property panel. I need to change the view representation of the filter to Surface With Edges and the line width. Where do I acquire required
proxy objects from ?<br>
<br>
pqPipelineRepresentation* repr = qobject_cast< pqPipelineRepresentation* >( pqActiveObjects::instance().activeRepresentation() );<br>
if ( repr ) {<br>
vtkSMProxy * lutProxy = repr->getLookupTable()->getProxy();<br>
if ( lutProxy ) {<br>
vtkSMPropertyHelper( lutProxy, "NumberOfTableValues" ).Set( this->scalars().count() - 1 );<br>
lutProxy->UpdateVTKObjects();<br>
}<br>
}<br>
<br>
Andrzej<br>
<br>
**********************************************************************<br>
Please consider the environment. Only print this email if absolutely necessary.<br>
<br>
This email contains information that is private and confidential and is intended only for the addressee.<br>
If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender.<br>
Note: All email sent to or from this address may be accessed by someone other than the recipient, for<br>
system management and security reasons.<br>
Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office:<br>
Manton Lane, Bedford MK41 7PF England VAT No GB 196351245<br>
<br>
**********************************************************************<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">
http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" target="_blank">
http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="color:black"><o:p> </o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<p>**********************************************************************<o:p></o:p></p>
<p>Please consider the environment. Only print this email if absolutely necessary.<o:p></o:p></p>
<p>This email contains information that is private and confidential and is intended only for the addressee.<br>
If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender.<br>
Note: All email sent to or from this address may be accessed by someone other than the recipient, for<br>
system management and security reasons.<br>
Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office:<br>
Manton Lane, Bedford MK41 7PF England VAT No GB 196351245<o:p></o:p></p>
<p>**********************************************************************<o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">
http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" target="_blank">
http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
<p>**********************************************************************</p><p>
Please consider the environment. Only print this email if absolutely necessary.</p><p>This email contains information that is private and confidential and is intended only for the addressee.<br />If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender.<br />Note: All email sent to or from this address may be accessed by someone other than the recipient, for<br />system management and security reasons.<br />Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office:<br />Manton Lane, Bedford MK41 7PF England VAT No GB 196351245</p><p>**********************************************************************</p>
</body>
</html>