[Paraview-developers] pqPropertyWidget with paraview 4.1
Felipe Bordeu
felipe.bordeu at ec-nantes.fr
Tue Jan 28 04:52:17 EST 2014
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Thanks,
I modified the code. Now I cache all the changes inside the qt objects
and "push" the values to the SMProperty inside the overloaded apply()
method (using SetElement(...) ...). The only thing is that I have to
call pqPropertyWidget::apply();" at the beginning of my overloaded
pqMyPropertyWidget::apply() to make it work.
I'm going to clean all my other sources now...
Thanks again.
Le 27/01/2014 16:16, Utkarsh Ayachit a écrit :
> Felipe,
>
> Where is the code to SetElement(...) called? In general if you call
> SetElement(..), there's no reason why you cannot simply call
> proxy->UpdateVTKObjects() to push the changes immediately after. You're
> already veering away from how the apply/reset mechanism operates.
>
> For apply/reset to work correctly, pqPropertyWidget subclass shouldn't
> change any SMProperty except in overloaded pqPropertyWidget::apply()
> method. Anytime the pqPropertyWidget is "modified", it should instead
> fire the pPropertyWidget::changeAvailable() and/or
> pqPropertyWidget::changeFinished() signals. Then, on "Apply" (or
> "Reset"), the appropriate apply()/reset() method will be called to
> update the property.
>
> Hopefully that's clarifies things a little. I am sure this could be
> explained better, alas. Maybe if you send me the code I may be able to
> explain better.
>
> Utkarsh
>
> On Mon, Jan 27, 2014 at 9:54 AM, Felipe Bordeu
> <felipe.bordeu at ec-nantes.fr <mailto:felipe.bordeu at ec-nantes.fr>> wrote:
>
> Hi,
>
> I have my plugin (reader) with a custom panel (using the new
> architecture for panels). Everything was working perfectly in the 4.0.1
> version.
>
> But now (in v4.1 linux from web) all the changes BEFORE the first time I
> hit apply are ignored.
>
> I have a custom panel with a QTreeWidgetItem that is populated with the
> meta data of the file and I can check some items to be loaded. I use
> some logic to determine if the user can check a item or not. All the
> code reduce to:
>
> vtkSMStringVectorProperty *VisualizationSpaceStatus =
> vtkSMStringVectorProperty::SafeDownCast(proxy()->GetProperty("VisualizationSpaceStatus"));
> VisualizationSpaceStatus->SetElement(itemindex*2+1,state.c_str());
> VisualizationSpaceStatus->Modified ();
>
> to set the check state.
>
> Does anyone know why the first time I hit Apply the data is not
> transmitted to the server?????
>
> this is the xml part of this property:
>
> <!--
> ================================================================== -->
> <StringVectorProperty name="VisualizationSpaceInfo"
> information_only="1" immediate_update="1">
> <ArraySelectionInformationHelper
> attribute_name="VisualizationSpace"/>
> </StringVectorProperty>
>
> <StringVectorProperty
> name="VisualizationSpaceStatus"
> command="SetVisualizationSpaceStatus"
> number_of_elements="0"
> repeat_command="1"
> number_of_elements_per_command="2"
> element_types="2 0"
> information_property="VisualizationSpaceInfo"
> animateable="0"
> label="Visualization Space"
> panel_widget="SpaceTimeSelector"
> >
>
> <ArraySelectionDomain name="array_list" >
> <RequiredProperties>
> <Property name="VisualizationSpaceInfo"
> function="ArrayList"/>
> </RequiredProperties>
> </ArraySelectionDomain>
> </StringVectorProperty>
>
>
> Thanks to all
>
> --
> Felipe Bordeu Weldt
> Ingénieur de Recherche
> -------------------------------------
> Tél. : 33 (0)2 40 37 16 57
> Fax. : 33 (0)2 40 74 74 06
> Felipe.Bordeu at ec-nantes.fr <mailto:Felipe.Bordeu at ec-nantes.fr>
> Institut GeM - UMR CNRS 6183
> École Centrale Nantes
> 1 Rue de La Noë, 44321 Nantes, FRANCE
> -------------------------------------
> _______________________________________________
> Paraview-developers mailing list
> Paraview-developers at paraview.org
> <mailto:Paraview-developers at paraview.org>
> http://public.kitware.com/mailman/listinfo/paraview-developers
>
>
- --
Felipe Bordeu Weldt
Ingénieur de Recherche
- -------------------------------------
Tél. : 33 (0)2 40 37 16 57
Fax. : 33 (0)2 40 74 74 06
Felipe.Bordeu at ec-nantes.fr
Institut GeM - UMR CNRS 6183
École Centrale Nantes
1 Rue de La Noë, 44321 Nantes, FRANCE
- -------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQEcBAEBAgAGBQJS533LAAoJEE/fMfNgU9/D9oIH/37ndSqYZa74OC07R4guz6Sc
FQdehF3nxvA3pm3S1Am1tG38zqqQL206O8dxx7gOJ8YqaCRsOnoh3VSVQ+VXuIw8
NmUuK89lzCdhc0QhH2jqtf6uSnx5E/TlUUNdLC5K2xDKlrmEziWtoJVSbnad7Ro+
eOAh96EP4LmiDMZF3g6tJJXc5k1/9hsgufk28g4KmdC5m6hevmfw7gr59OCoZiTB
hkHItSWa6fcEzkOqNw8B2Ft38mNR+2aRAq+TX+aV6IqXncSoteyt/JdZ5ui/qp0N
O+OHo511KeusM0bXA706vumGjMLMRKdixGG1E116pIoqd6Qyk8q0gy5/22V68io=
=E8v8
-----END PGP SIGNATURE-----
More information about the Paraview-developers
mailing list