<div dir="ltr"><div><div><div><div><div><div>Dear Cory, dear all,<br></div>sorry for not getting back to this topic earlier. Your solution works perfectly for the described problem. When I create e.g. a SphereSource and attach the TestProperty filter with its NPoints property, this property is initialized with the correct number of points in the sphere.<br><br></div>However, I have another requirement which is that the property should also be updated, when the input changes. I thought the same mechanism for initializing the property would also take care of updating the property upon modified input.<br><br></div>If I modify the SphereSource from above by changing the ThetaResolution or PhiResolution, then vtkTestProperty::RequestInformation is called as expected, and the included print statements show the new number of points, but the NPoints property won't reflect this new value. Do you know of another short trick, how to fix this? You mentioned that you found the need for a domain element in the ParaView source code. Where exactly? If I understand what prevented the property initialization, I might be able to find out what prevents the update.<br><br></div>The complete filter sources, updated to include your corrections, are attached.<br><br></div>Thank you<br></div>Corinna<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 15, 2016 at 6:02 PM, Cory Quammen <span dir="ltr"><<a href="mailto:cory.quammen@kitware.com" target="_blank">cory.quammen@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Corinna,<br>
<br>
Looking at the ParaView source code, I believe that vector properties<br>
with information properties must have a domain associated with them.<br>
In your case, you can add an IntRangeDomain with only a minimum<br>
defined:<br>
<span class=""><br>
<IntVectorProperty name="NPoints"<br>
                        command="SetNPoints"<br>
                        information_property="NPointsInfo"<br>
                        number_of_elements="1"<br>
                        default_values="42"><br>
</span>    <IntRangeDomain name="range" min="0" /><br>
</IntVectorProperty><br>
<br>
0 seems like a reasonable minimum in your case.<br>
<br>
Keep your information_only property as it is. You'll need to change<br>
where your NPoints is set, though - moving this to the<br>
RequestInformation() member function should work.<br>
<span class="HOEnZb"><font color="#888888"><br>
Cory<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On Fri, Jul 15, 2016 at 3:46 AM, corinna reuter<br>
<<a href="mailto:corinnareuter75@gmail.com">corinnareuter75@gmail.com</a>> wrote:<br>
> Cory, thanks for mentioning the TIFFReader proxy. I tried to modify my<br>
> previously attached code such that the NPoints property links to a<br>
> NPointsInfo property. Plus, I have removed the call<br>
> "this->SetNPoints(nset);" inside vtkTestProperty::RequestData as suggested<br>
> by Utkarsh. The NPoints property is still showing the default "42", though,<br>
> and not initialized or updated from the number of points of the input<br>
> dataset. I am obviously missing another important step in addition to<br>
> changing the xml definitions, but which one?<br>
><br>
> Here is the detailed modification of TestProperty.xml compared to the<br>
> earlier attachment:<br>
> replace<br>
> "<IntVectorProperty name="NPoints"<br>
>                         command="SetNPoints"<br>
>                         number_of_elements="1"<br>
>                         default_values="42"><br>
>   </IntVectorProperty>"<br>
> with:<br>
> "<IntVectorProperty name="NPoints"<br>
>                         command="SetNPoints"<br>
>                         information_property="NPointsInfo"<br>
>                         number_of_elements="1"<br>
>                         default_values="42"><br>
>   </IntVectorProperty><br>
>   <IntVectorProperty name="NPointsInfo"<br>
>                         command="GetNPoints"<br>
>                         information_only="1"><br>
>     <SimpleIntInformationHelper /><br>
>   </IntVectorProperty>"<br>
><br>
> Thank you<br>
> Corinna<br>
><br>
><br>
> On Thu, Jul 14, 2016 at 5:24 PM, Cory Quammen <<a href="mailto:cory.quammen@kitware.com">cory.quammen@kitware.com</a>><br>
> wrote:<br>
>><br>
>> Corinna,<br>
>><br>
>> Take a look at the TIFFReader SourceProxy in<br>
>> ParaViewCore/ServerManager/SMApplication/Resources/readers.xml. It has<br>
>> a CustomDataSpacing property that enables you to set voxel spacing,<br>
>> and has an associated information property CustomDataSpacingInfo that<br>
>> should initially populate the spacing property when the reader is<br>
>> created.<br>
>><br>
>> HTH,<br>
>> Cory<br>
>><br>
>> On Thu, Jul 14, 2016 at 11:17 AM, Utkarsh Ayachit<br>
>> <<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>> wrote:<br>
>> >> I'll check the meaning of MTime.<br>
>> ><br>
>> > See the implementation of vtkSetMacro() in vtkSetGet.h. Every time the<br>
>> > value changes, it call this->Modified() which updates the MTime. Since<br>
>> > VTK is a demand-driven pipeline, changes to MTime is what tells the<br>
>> > pipeline that the algorithm has been modified and needs reexecution.<br>
>> > If one modifies the MTime in RequestData() (the method called by the<br>
>> > pipeline to process the input to produce output), the pipeline thinks<br>
>> > the filter is always dirty and that can cause unexpected side effects.<br>
>> ><br>
>> ><br>
>> >> I'd need something similar to an image resize filter. The output size<br>
>> >> should<br>
>> >> be identical to the input size, when the filter is first attached to<br>
>> >> the<br>
>> >> input. The output size should be shown in the UI and the user should be<br>
>> >> able<br>
>> >> to enter a different output size.<br>
>> ><br>
>> > This is possible. Let me see if I can find you a simple example for<br>
>> > the same. I'll get back to you.<br>
>> > _______________________________________________<br>
>> > Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
>> ><br>
>> > Visit other Kitware open-source projects at<br>
>> > <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>> ><br>
>> > Please keep messages on-topic and check the ParaView Wiki at:<br>
>> > <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
>> ><br>
>> > Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
>><br>
>><br>
>><br>
>> --<br>
>> Cory Quammen<br>
>> R&D Engineer<br>
>> Kitware, Inc.<br>
><br>
><br>
<br>
<br>
<br>
--<br>
Cory Quammen<br>
R&D Engineer<br>
Kitware, Inc.<br>
</div></div></blockquote></div><br></div>