My plugin would act like the display tab and affect the active view. For the case when the source is created I guess it could just be saved. In general, the representation options just affect how the data actually looks (size, color, and things like toggles for labels and bar scales).<br>
<br>However in this case would I not just be storing it in the vtkMultiBlockSet and reading it out when I load the Representation? In that case I can just have all the widgets on the panel be part of the reader. The reason I was trying to avoid this is that I am making a time based plugin which will be calling the readers Request Data very often, thus I was hoping to avoid copying the data as often.<br>
<br>An example would be great if there is another way.<br><br>Thanks,<br>Brian <br><br><div class="gmail_quote">On Mon, Aug 8, 2011 at 5:29 PM, Utkarsh Ayachit <span dir="ltr"><<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Brian,<br>
<br>
There are a few things to remember about ParaView:<br>
* the source/filter and it's representation proxy are created<br>
separately. The representation is generally not created until after<br>
the first accept.<br>
* a source can have multiple representation proxies (one for each<br>
view). As view are split/closed/visibility changed, these<br>
representation can get created/deleted dynamically. pqPipelineSource<br>
fires signals (representationAdded / representationRemoved) when that<br>
happens.<br>
* there is at most one active view at one time. Sicne there's one<br>
representation proxy per source per view, you'll see that the display<br>
tab is refreshed as one changes the active view.<br>
<br>
Now based on this, you need to decide how your panel is going to behave:<br>
* Does it affect all representations in all views, or does it behave<br>
like the display-tab and affect only the active view.<br>
* When the source if first created, it's not going to have any<br>
representations, how do you want the panel to behave in that case. One<br>
possibility is that the checkbox-value is saved and then when<br>
represenation is added, you change the property based on the value of<br>
the checkbox.<br>
<br>
If you don't mind elaborating on the use-case that you're trying to<br>
solve, I can hack the plugin you sent me to behave accordingly.<br>
<br>
Utkarsh<br>
<br>
<br>
<br>
<br>
<br>
On Mon, Aug 8, 2011 at 1:20 PM, Utkarsh Ayachit<br>
<<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>> wrote:<br>
> Can you package your code a plugin that you can share and I can try it<br>
> out? It will be easier to figure out the problems when I look at the<br>
> code.<br>
><br>
> Utkarsh<br>
><br>
> On Mon, Aug 8, 2011 at 12:57 PM, Panneton, Brian C USA CTR (US)<br>
<div class="im">> <<a href="mailto:brian.c.panneton.ctr@mail.mil">brian.c.panneton.ctr@mail.mil</a>> wrote:<br>
</div>>> I'm still somewhat unsure on how to do this since I now have two ProxyGroups (sources and representations) within one Custom Panel. When I do, vtkSMIntVectorProperty* prop = dynamic_cast<vtkSMIntVectorProperty*>(this->proxy()->GetProperty("GlyphLegend"));, prop is null. When I do this for widgets that are within the ProxyGroup 'source' they work and can be updated as you would expect.<br>
>><br>
>> My guess is because I should be using a different proxy. I tried to do this by using this->proxy()->GetProxyManager()->GetProxy("representations", "MyRepresentation") however this just segfaults.<br>
>><br>
>> Any ideas?<br>
<div class="im">>> ________________________________________<br>
>> From: Utkarsh Ayachit [<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>]<br>
</div>>> Sent: Friday, August 05, 2011 4:15 PM<br>
<div class="im">>> To: Panneton, Brian C USA CTR (US)<br>
</div><div class="im">>> Subject: Re: [Paraview] Object Inspector Tabs<br>
>><br>
</div>>> Is yours a custom panel? In that case you have to manually update the<br>
>> property using the value from the widget (use can use<br>
>> this->propertyManager() to help you with linking widgets to<br>
>> properties).<br>
>><br>
>> On Fri, Aug 5, 2011 at 12:03 PM, Panneton, Brian C USA CTR (US)<br>
<div class="im">>> <<a href="mailto:brian.c.panneton.ctr@mail.mil">brian.c.panneton.ctr@mail.mil</a>> wrote:<br>
</div>>>> Ah, I had the functions in protected. Once I moved them to public it worked.<br>
>>><br>
>>> However, it only called the Set on initial load. It does not call it after I modify it and press the accept button. In my panel I have created a QObject::connect for the widget and the signal stateChanged(int). I catch the signal and do this->SetModified(), allowing me to hit accept. Once I hit accept, the SetSomeBoolVar(int) never gets called.<br>
>>><br>
>>> Do I have to manually update the Property throught the proxy? I had thought it would be taken care of for me.<br>
<div class="im">>>><br>
>>> Thanks,<br>
>>> Brian<br>
>>><br>
>>> ________________________________________<br>
>>> From: Utkarsh Ayachit [<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>]<br>
</div>>>> Sent: Friday, August 05, 2011 11:07 AM<br>
<div><div></div><div class="h5">>>> To: Panneton, Brian C USA CTR (US)<br>
>>> Cc: ParaView<br>
>>> Subject: Re: [Paraview] Object Inspector Tabs<br>
>>><br>
>>> The fact that "SetSomeBoolVar" is not in the *CLientServer.cxx file is<br>
>>> the problem. It has nothing to do with the XML, but for some reason<br>
>>> the parser that generates the CLientServer.cxx file decided that the<br>
>>> method is not "wrappable". If you can attach the header file, I may be<br>
>>> able to tell what the issue may be.<br>
>>><br>
>>> Utkarsh<br>
>>><br>
>>> On Fri, Aug 5, 2011 at 10:50 AM, Panneton, Brian C USA CTR (US)<br>
>>> <<a href="mailto:brian.c.panneton.ctr@mail.mil">brian.c.panneton.ctr@mail.mil</a>> wrote:<br>
>>>> The file was created, however it does not contain "SetSomeBoolVar". Does it matter that I have two ProxyGroups in my ServerManagerConfiguration: sources and representations?<br>
>>>> ________________________________________<br>
>>>> From: Utkarsh Ayachit [<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>]<br>
>>>> Sent: Friday, August 05, 2011 10:19 AM<br>
>>>> To: Panneton, Brian C USA CTR (US)<br>
>>>> Cc: ParaView<br>
>>>> Subject: Re: [Paraview] Object Inspector Tabs<br>
>>>><br>
>>>> Try to locate vtkMyRepresentationClientServer.cxx file in the binary<br>
>>>> directory. Was that generated? Open and see if it include a condition<br>
>>>> for "SetSomeBoolVar" in it.<br>
>>>><br>
>>>> Utkarsh<br>
>>>><br>
>>>> On Fri, Aug 5, 2011 at 10:07 AM, Panneton, Brian C USA CTR (US)<br>
>>>> <<a href="mailto:brian.c.panneton.ctr@mail.mil">brian.c.panneton.ctr@mail.mil</a>> wrote:<br>
>>>>> Yes, this is what I have for ADD_PARAVIEW_PLUGIN<br>
>>>>><br>
>>>>> [code]<br>
>>>>> ADD_PARAVIEW_PLUGIN(MyPlugin "1.0"<br>
>>>>> SERVER_MANAGER_XML plugin/MyPlugin.xml<br>
>>>>> SERVER_MANAGER_SOURCES<br>
>>>>> vtkReader/vtkMyReader.cxx<br>
>>>>> representations/vtkMyRepresentation.cxx<br>
>>>>> GUI_RESOURCE_FILES plugin/MyPluginGUI.xml<br>
>>>>> GUI_INTERFACES ${IFACES}<br>
>>>>> SOURCES panel/MyReaderPanel.cxx<br>
>>>>> ${MOC_SRCS} ${IFACE_SRCS}<br>
>>>>> ${RCS_SOURCES} ${UI_BUILT_SOURCES}<br>
>>>>> )<br>
>>>>> [/code]<br>
>>>>><br>
>>>>> For my ProxyGroup representations XML I have this:<br>
>>>>><br>
>>>>> [code]<br>
>>>>> <ProxyGroup name="representations"><br>
>>>>> <RepresentationProxy name="MyRepresentation"<br>
>>>>> class="vtkMyRepresentation"<br>
>>>>> processes="client|renderserver|dataserver"<br>
>>>>> base_proxygroup="representations"<br>
>>>>> base_proxyname="SurfaceRepresentation"><br>
>>>>><br>
>>>>> <IntVectorProperty<br>
>>>>> name="GlyphLegend"<br>
>>>>> command="SetSomeBoolVar"<br>
>>>>> number_of_elements="1"<br>
>>>>> default_values="1"><br>
>>>>> <BooleanDomain name="bool"/><br>
>>>>> </IntVectorProperty><br>
>>>>> </RepresentationProxy><br>
>>>>><br>
>>>>> <Extension name="GeometryRepresentation"><br>
>>>>> <RepresentationType subproxy="MyRepresentation"<br>
>>>>> text="My Mapper" subtype="Surface" /><br>
>>>>><br>
>>>>> <SubProxy><br>
>>>>> <Proxy name="MyRepresentation"<br>
>>>>> proxygroup="representations"<br>
>>>>> proxyname="MyRepresentation"><br>
>>>>> </Proxy><br>
>>>>> <ShareProperties subproxy="SurfaceRepresentation"><br>
>>>>> <Exception name="Input" /><br>
>>>>> <Exception name="Visibility" /><br>
>>>>> <Exception name="Representation" /><br>
>>>>> </ShareProperties><br>
>>>>> </SubProxy><br>
>>>>> </Extension><br>
>>>>> </ProxyGroup><br>
>>>>> [/code]<br>
>>>>><br>
>>>>><br>
>>>>> Then in vtkMyRepresentation I have a setter and getter for SetSomeBoolVar(int) and GetSomeBoolVar().<br>
>>>>><br>
>>>>> I also have a ProxyGroup for sources but I didn't think that would conflict.<br>
>>>>><br>
>>>>> Thanks,<br>
>>>>> Brian<br>
>>>>><br>
>>>>><br>
>>>>> ________________________________________<br>
>>>>> From: Utkarsh Ayachit [<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>]<br>
>>>>> Sent: Friday, August 05, 2011 9:54 AM<br>
>>>>> To: Panneton, Brian C USA CTR (US)<br>
>>>>> Cc: ParaView<br>
>>>>> Subject: Re: [Paraview] Object Inspector Tabs<br>
>>>>><br>
>>>>> What's your CMakeLists. txt file? Was vtkMyRepresentation specified as<br>
>>>>> SERVER_MANAGER_SOURCES in the ADD_PARAVIEW_PLUGIN call?<br>
>>>>><br>
>>>>> Utkarsh<br>
>>>>><br>
>>>>><br>
>>>>> On Thu, Aug 4, 2011 at 5:00 PM, Panneton, Brian C USA CTR (US)<br>
>>>>> <<a href="mailto:brian.c.panneton.ctr@mail.mil">brian.c.panneton.ctr@mail.mil</a>> wrote:<br>
>>>>>> Okay, so instead of adding tabs like Properties, Display and Information, I created a Qt TabWidget which possibly does what I want but I am not sure.<br>
>>>>>><br>
>>>>>> Right now, on my custom panel, I have options that modify the input to my reader. I am looking to also add options to modify part of my custom representation. Am I able to do this from my current custom panel? How would the XML look?<br>
>>>>>><br>
>>>>>> I tried setting up my SMC as such without luck:<br>
>>>>>> [code]<br>
>>>>>> <ServerManagerConfiguration><br>
>>>>>> <ProxyGroup name="representations"><br>
>>>>>> <RepresentationProxy name ... class="vtkMyRepresentation" ..><br>
>>>>>> ... < { properties defined here such as intvectorproperty} > ...<br>
>>>>>> </RepresentationProxy><br>
>>>>>> </ProxyGroup><br>
>>>>>> <ProxyGroup name="sources"><br>
>>>>>> <SourceProxy name ... class="vtkMyReader" ..><br>
>>>>>> ... < { properties defined here } > ...<br>
>>>>>> </SourceProxy><br>
>>>>>> </ProxyGroup><br>
>>>>>> </ServerManagerConfiguration><br>
>>>>>> [/code]<br>
>>>>>><br>
>>>>>> But this will end up giving me the error even though I have a vtkMyRepresentation::SetMyProperty(int) in the source:<br>
>>>>>> [code]<br>
>>>>>> vtkPVSessionCore (0x16e71130): Object type: vtkMyRepresentation, could not find requested method: "SetMyProperty"<br>
>>>>>> or the method was called with incorrect arguments.<br>
>>>>>><br>
>>>>>> while processing<br>
>>>>>> Message 0 = Invoke<br>
>>>>>> Argument 0 = vtk_object_pointer {vtkMyRepresentation (0x1829dfb0)}<br>
>>>>>> Argument 1 = string_value {SetMyProperty}<br>
>>>>>> Argument 2 = int32_value {1}<br>
>>>>>> [/code]<br>
>>>>>><br>
>>>>>> Any ideas?<br>
>>>>>><br>
>>>>>> Thanks,<br>
>>>>>> Brian<br>
>>>>>> ________________________________________<br>
>>>>>> From: Utkarsh Ayachit [<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>]<br>
>>>>>> Sent: Thursday, August 04, 2011 12:09 PM<br>
>>>>>> To: Brian C. Panneton (CONTR)<br>
>>>>>> Cc: <a href="mailto:paraview@paraview.org">paraview@paraview.org</a><br>
>>>>>> Subject: Re: [Paraview] Object Inspector Tabs<br>
>>>>>><br>
>>>>>> Nope, this is not possible through plugins yet. You can add a<br>
>>>>>> brand-new dock widget through plugins but not add a new tab to the<br>
>>>>>> Object Inspector widget.<br>
>>>>>><br>
>>>>>> Utkarsh<br>
>>>>>><br>
>>>>>> On Thu, Aug 4, 2011 at 11:56 AM, Brian C. Panneton (CONTR)<br>
>>>>>> <<a href="mailto:brian.c.panneton.ctr@us.army.mil">brian.c.panneton.ctr@us.army.mil</a>> wrote:<br>
>>>>>>> I was wondering if there was an example of how to add a new tab to the<br>
>>>>>>> Object Inspector for a plugin. I remember being told that it is possible,<br>
>>>>>>> but I can't seem to find any examples.<br>
>>>>>>><br>
>>>>>>> Thanks,<br>
>>>>>>> Brian Panneton<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<br>
>>>>>>> <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:<br>
>>>>>>> <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
>>>>>>><br>
>>>>>>> Follow this link to subscribe/unsubscribe:<br>
>>>>>>> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
>>>>>>><br>
>>>>>><br>
>>>>><br>
>>>><br>
>>><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>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
</div></div></blockquote></div><br>