[Paraview-developers] vtkSMSessionProxyManager::getProxies bug

Cory Quammen cory.quammen at kitware.com
Thu Jul 24 10:25:30 EDT 2014


Mathieu,

Thanks again for tracking this down.

I pushed a fix and test for this on stage:

commit 645ac1ea167ecf7aec942fa13f0bb945f43a46f9
Author: Cory Quammen <cory.quammen at kitware.com>
Date:   Thu Jul 24 09:27:55 2014 -0400

    != was being used instead of == in conditional

    With this operator, this conditional was checking for whether the
    global proxy ID existed in a std::set that used to ensure uniqueness
    of the proxy in the collection. Instead, it should check whether that
    ID wasn't in the std::set.

    Added test for this fix

    Change-Id: I0a2b5bb614acff6bdc557ba9da7c1ef85c501691

It should be available in master after the next gatekeeper review

Best,
Cory

On Thu, Jul 24, 2014 at 9:29 AM, Cory Quammen <cory.quammen at kitware.com> wrote:
> Mathieu,
>
> It looks like line 488 should be
>
> if(ids.find(it3->GetPointer()->Proxy->GetGlobalID()) == ids.end())
>
> otherwise nothing ever gets added to the set or collection. Does that
> sound right to you? If so, I'll push a patch.
>
> Thanks,
> Cory
>
>
> On Thu, Jul 24, 2014 at 3:36 AM, Mathieu Westphal
> <mathieu.westphal at gmail.com> wrote:
>> Hello
>>
>> It seems to me there is a bug in
>>  vtkSMSessionProxyManager::getProxies
>>
>> I try to recover scalar_bar representation so , i create one in the gui, then :
>>
>> vtkSMSessionProxyManager* pxm = vtkSMProxyManager::GetProxyManager()->GetActiveSessionProxyManager();
>> vtkSmartPointer<vtkCollection> legends = vtkSmartPointer<vtkCollection>::New();
>> pxm->GetProxies( LEGEND_REGISTERED_GROUP_NAME.toAscii().data(), legends );
>> printf("Nb: %i %i\n", legends->GetNumberOfItems(), pxm->GetNumberOfProxies( "scalar_bars" ) );
>>
>>
>>
>> Give me :
>> Nb: 0 1
>>
>> THe proxy is not recovered in the vtkCollection because of this line  ( vtkSMSessionProxyManager.cxx ):
>> 488          if(ids.find(it3->GetPointer()->Proxy->GetGlobalID()) != ids.end())
>>
>> I'm using a work around, wich works well :
>>      unsigned int nbLegend =  pxm->GetNumberOfProxies( "scalar_bars" );
>>      for(unsigned int i = 0; i < nbLegend; i++ )
>>      {
>>          QString tmp ( pxm->GetProxyName("scalar_bars", i ) );
>>          vtkSMProxy* proxy = pxm->GetProxy( "scalar_bars", tmp.toAscii().data() );
>>          printf("%s %i\n", tmp.toAscii().data(), proxy );
>>      }
>>
>>
>> Mathieu
>> _______________________________________________
>> Paraview-developers mailing list
>> Paraview-developers at paraview.org
>> http://public.kitware.com/mailman/listinfo/paraview-developers


More information about the Paraview-developers mailing list