Re: [Paraview] Paraview 5.0.1 - Registering new view
Thank you so much Utkarsh, this is the function I was looking for. Andrzej -Original Message- From: Utkarsh Ayachit [mailto:utkarsh.ayac...@kitware.com] Sent: 22 June 2016 21:39 To: Andrzej Peczak Cc: paraview@paraview.org Subject: Re: [Paraview] Paraview 5.0.1 - Registering new view You just need to tell ParaView which pqView subclass to create for your view proxy e.g. if pqContextView class would work for your case, then you'd add something like the following in your CMakeList.txt add_pqproxy(OUTIFACES OUTSRCS TYPE pqContextView XML_GROUP views XML_NAME ARAXYChartView) Utkarsh On Wed, Jun 22, 2016 at 1:25 PM, Andrzej Peczak <apec...@ara.co.uk> wrote: > Hi > > I am trying to figure out how can I register a new view under a name > different than the default "YXYChartView" which replaces the default > representation in Paraview, but I am either getting the assertion > failure "ASSERT: "pqPreferredView" in file > /spare/Andrzej/packages/ParaView-5.0-source/Qt/ApplicationComponents/p > qApplyBehavior.cxx, line 277" when do things like this > > > base_proxyname="ARAXYChartViewBase4Axes" > class="ARAPVXYChartViewClass" > name="ARAXYChartView" label=" My Line Chart View" > processes="client|renderserver|dataserver" > representation_name="ARAXYChartRepresentation" > post_creation="SetChartTypeToLine"> > > > > or more specifically like this > > > base_proxyname="XYChartViewBase4Axes" > class="vtkPVXYChartViewClass" > name="ARAXYChartView" label=" My Line Chart View" > processes="client|renderserver|dataserver" > representation_name="XYChartRepresentation" > post_creation="SetChartTypeToLine"> > > > > and then > > > name="ARAPlotAttributes"> > name="Input"> > > > > > > > > The input. > > > show_in_toolbar="0" /> > > > > > > > Is there a way to register a new view at all ? > > Thank you, > > Andrzej > > > ** > Please consider the environment. Only print this email if absolutely > necessary. > > This email contains information that is private and confidential and is > intended only for the addressee. > If you are not the intended recipient please delete it and notify us > immediately by e-mailing the sender. > Note: All email sent to or from this address may be accessed by > someone other than the recipient, for system management and security reasons. > Aircraft Research Association Ltd. Registered in England, Registration No > 503668 Registered Office: > Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 > > ** > ___ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the ParaView Wiki at: > http://paraview.org/Wiki/ParaView > > Search the list archives at: http://markmail.org/search/?q=ParaView > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/paraview ** Please consider the environment. Only print this email if absolutely necessary. This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office:
[Paraview] Paraview 5.0.1 - Registering new view
Hi I am trying to figure out how can I register a new view under a name different than the default "YXYChartView" which replaces the default representation in Paraview, but I am either getting the assertion failure "ASSERT: "pqPreferredView" in file /spare/Andrzej/packages/ParaView-5.0-source/Qt/ApplicationComponents/pqApplyBehavior.cxx, line 277" when do things like this or more specifically like this and then The input. Is there a way to register a new view at all ? Thank you, Andrzej ** Please consider the environment. Only print this email if absolutely necessary. This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ** ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
Re: [Paraview] Forcing update on view
Thanks Utkarsh, this was exactly what I was looking for! Andrzej -Original Message- From: Utkarsh Ayachit [mailto:utkarsh.ayac...@kitware.com] Sent: 14 June 2016 20:22 To: Andrzej Peczak Cc: paraview@paraview.org Subject: Re: [Paraview] Forcing update on view I am not sure I follow what you're doing, but here are a few things to note. 1. vtkSMProxy::UpdateVTKObjects() is called to push changes done to a property. Thus, only needs to be called on the proxy whose properties you're changing. Thus, if you are chaning "CompositeDataSetIIndex" property on the chartRepresentationProxy, you only need to call UpdateVTKObjects() on it. 2. pqView::forceRender() cancels pending renders, so you don't have to do that explicitly. 3. When CompositeDataSetIndex property is changed and successfully pushed, vtkChartRepresentation::AddCompositeDataSetIndex() should be called. Try putting a breakpoint there to ensure it's getting called when you're expecting it to happen. Hope that helps, Utkarsh On Tue, Jun 14, 2016 at 5:35 AM, Andrzej Peczak <apec...@ara.co.uk> wrote: > I missed the question regarding the problem I describe. Is there a way to > programmatically display the content of CompositeDataSetIndex property > depending on status of the checkbox widgets I change through vector > properties? > > Andrzej > > Hi, > > I have a snippet code which I wrote to allow me to save multiple plot images > to files. I do it by changing property checkboxes of Composite Data Set Index > property. I can change their status programmatically but the view is not > being updated. When I change them manually in the UI the view knows about > their status change and plots only the content I select. I tried to force the > update with UpdateVTkObjects() of available properties plus explicitly > calling render()/forceRender() of the view but with no success. Every file I > create has multiple plot curves in it instead of one. > > Andrzej > > pqDataRepresentation *repr = source->getRepresentation( view ); > auto chartRepresentationProxy = repr->getProxy(); > > vtkSMProperty *property = chartRepresentationProxy->GetProperty( > "CompositeDataSetIndex" ); > if ( property ) { > > auto VectorProperty = vtkSMIntVectorProperty::SafeDownCast( > property ); > if ( VectorProperty ) { > > const auto numElements = > VectorProperty->GetNumberOfElements(); > int elements[ numElements ]; > std::copy( VectorProperty->GetElements(), > VectorProperty->GetElements() + numElements, elements ); > for ( auto i = 0 ; i != numElements ; ++i ) { > VectorProperty->SetElement( elements[ i ], 0 > ); > } > > for ( auto i = 0 ; i != numElements ; ++i ) { > VectorProperty->SetElement( elements[ > i ], 1 ); > > source->getSourceProxy()->UpdateVTKObjects(); > view->getViewProxy()->UpdateVTKObjects(); > view->getViewProxy()->Update(); > repr = source->getRepresentation( view ); > repr->getProxy()->UpdateVTKObjects(); > repr->renderView( true ); > property->GetParent()->UpdateVTKObjects(); > view->cancelPendingRenders(); > view->forceRender(); > > std::stringstream ssFileName; > std::string ext , newName2; > std::string::size_type dot_pos = > newName.rfind( '.' ); > if ( dot_pos != std::string::npos ) { > ext = newName.substr( dot_pos ); > newName2 = newName.substr( 0, dot_pos > ); > } > ssFileName << newName2 << "_" << i + 1 << ext; > view->writeImage( ssFileName.str().c_str(), > size, quality ); > VectorProperty->SetElement( elements[ i ], 0 > ); > } > > VectorProperty->SetElements( elements ); > } > } > > ** > Please consider the environment. Only pri
Re: [Paraview] Forcing update on view
I missed the question regarding the problem I describe. Is there a way to programmatically display the content of CompositeDataSetIndex property depending on status of the checkbox widgets I change through vector properties? Andrzej Hi, I have a snippet code which I wrote to allow me to save multiple plot images to files. I do it by changing property checkboxes of Composite Data Set Index property. I can change their status programmatically but the view is not being updated. When I change them manually in the UI the view knows about their status change and plots only the content I select. I tried to force the update with UpdateVTkObjects() of available properties plus explicitly calling render()/forceRender() of the view but with no success. Every file I create has multiple plot curves in it instead of one. Andrzej pqDataRepresentation *repr = source->getRepresentation( view ); auto chartRepresentationProxy = repr->getProxy(); vtkSMProperty *property = chartRepresentationProxy->GetProperty( "CompositeDataSetIndex" ); if ( property ) { auto VectorProperty = vtkSMIntVectorProperty::SafeDownCast( property ); if ( VectorProperty ) { const auto numElements = VectorProperty->GetNumberOfElements(); int elements[ numElements ]; std::copy( VectorProperty->GetElements(), VectorProperty->GetElements() + numElements, elements ); for ( auto i = 0 ; i != numElements ; ++i ) { VectorProperty->SetElement( elements[ i ], 0 ); } for ( auto i = 0 ; i != numElements ; ++i ) { VectorProperty->SetElement( elements[ i ], 1 ); source->getSourceProxy()->UpdateVTKObjects(); view->getViewProxy()->UpdateVTKObjects(); view->getViewProxy()->Update(); repr = source->getRepresentation( view ); repr->getProxy()->UpdateVTKObjects(); repr->renderView( true ); property->GetParent()->UpdateVTKObjects(); view->cancelPendingRenders(); view->forceRender(); std::stringstream ssFileName; std::string ext , newName2; std::string::size_type dot_pos = newName.rfind( '.' ); if ( dot_pos != std::string::npos ) { ext = newName.substr( dot_pos ); newName2 = newName.substr( 0, dot_pos ); } ssFileName << newName2 << "_" << i + 1 << ext; view->writeImage( ssFileName.str().c_str(), size, quality ); VectorProperty->SetElement( elements[ i ], 0 ); } VectorProperty->SetElements( elements ); } } ** Please consider the environment. Only print this email if absolutely necessary. This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ** ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
[Paraview] Forcing update on view
Hi, I have a snippet code which I wrote to allow me to save multiple plot images to files. I do it by changing property checkboxes of Composite Data Set Index property. I can change their status programmatically but the view is not being updated. When I change them manually in the UI the view knows about their status change and plots only the content I select. I tried to force the update with UpdateVTkObjects() of available properties plus explicitly calling render()/forceRender() of the view but with no success. Every file I create has multiple plot curves in it instead of one. Andrzej pqDataRepresentation *repr = source->getRepresentation( view ); auto chartRepresentationProxy = repr->getProxy(); vtkSMPropertyHelper helper( repr->getProxy(), "CompositeDataSetIndex" ); vtkSMProperty *property = chartRepresentationProxy->GetProperty( "CompositeDataSetIndex" ); if ( property ) { auto VectorProperty = vtkSMIntVectorProperty::SafeDownCast( property ); if ( VectorProperty ) { const auto numElements = VectorProperty->GetNumberOfElements(); int elements[ numElements ]; std::copy( VectorProperty->GetElements(), VectorProperty->GetElements() + numElements, elements ); for ( auto i = 0 ; i != numElements ; ++i ) { VectorProperty->SetElement( elements[ i ], 0 ); } for ( auto i = 0 ; i != numElements ; ++i ) { VectorProperty->SetElement( elements[ i ], 1 ); source->getSourceProxy()->UpdateVTKObjects(); view->getViewProxy()->UpdateVTKObjects(); view->getViewProxy()->Update(); repr = source->getRepresentation( view ); repr->getProxy()->UpdateVTKObjects(); repr->renderView( true ); property->GetParent()->UpdateVTKObjects(); view->cancelPendingRenders(); view->forceRender(); std::stringstream ssFileName; std::string ext , newName2; std::string::size_type dot_pos = newName.rfind( '.' ); if ( dot_pos != std::string::npos ) { ext = newName.substr( dot_pos ); newName2 = newName.substr( 0, dot_pos ); } ssFileName << newName2 << "_" << i + 1 << ext; view->writeImage( ssFileName.str().c_str(), size, quality ); VectorProperty->SetElement( elements[ i ], 0 ); } VectorProperty->SetElements( elements ); } } ** Please consider the environment. Only print this email if absolutely necessary. This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ** ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
Re: [Paraview] Custom panel widget
Yes, this is what I want Utkarsh. The filter does not necessary has to output the distances on the output port (which I presumably would do by assigning a field array to the output geometry) but I definitely would like them to display and modify in the panel widget to affect the execution logic of the filter. Andrzej -Original Message- From: Utkarsh Ayachit [mailto:utkarsh.ayac...@kitware.com] Sent: 27 May 2016 13:51 To: Andrzej Peczak Cc: ParaView Subject: Re: [Paraview] Custom panel widget Andrzej, Just to make sure I understand: vtkCpCutter calculates slices aka contours on surface and also outputs an array of "max-distance"s. You want the user to be able to see these values on the panel for this filter and then change them which in turn affects some execution logic in vtkCpCutter. Is that correct? Utkarsh On Thu, May 26, 2016 at 7:30 AM, Andrzej Peczak <apec...@ara.co.uk> wrote: > Hi Utkarsh > > Our use-case scenario is that we have our own filter based on vtkCpCutter > (both vtkPolyData on the input and output port) . We use this filter to > generate a set of slices on surface geometry. We then process the obtained > contours with vtkPlotEdges. For each contour (slice) we would like to compute > a scalar value, say max distance between two points in the contour and output > the values to the scalar list widget. Of course we also would like to modify > the distances and send it back to the filters. These values will be used to > update the output of the filter. > > Andrzej > > > -Original Message- > From: Utkarsh Ayachit [mailto:utkarsh.ayac...@kitware.com] > Sent: 23 May 2016 14:58 > To: Andrzej Peczak > Cc: ParaView > Subject: Re: [Paraview] Custom panel widget > >> Is it possible to create a custom widget for a filter which would allow me >> to retrieve the results of its computation? I would like to reproduce the >> functionality of the pqDoubleVectorPropertyWidget and populate it with >> values computed by the filter. I know how to create and register the widget >> but I do not know how do I send values to it from the filter. In paraview >> code base I found vtkEventQtSlotConnect but I do not know if it is of any >> use to my problem. > > There are several ways of skinning this cat. Can you elaborate of what > exactly is your use-case? Do you want the default values for this > double-vector-property (DVP) set using some values provided by the VTK > filter, but allow user to override using UI? > > ** > Please consider the environment. Only print this email if absolutely > necessary. > > This email contains information that is private and confidential and is > intended only for the addressee. > If you are not the intended recipient please delete it and notify us > immediately by e-mailing the sender. > Note: All email sent to or from this address may be accessed by > someone other than the recipient, for system management and security reasons. > Aircraft Research Association Ltd. Registered in England, Registration No > 503668 Registered Office: > Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 > > ** ** Please consider the environment. Only print this email if absolutely necessary. This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ** ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
Re: [Paraview] Custom panel widget
Hi Utkarsh Our use-case scenario is that we have our own filter based on vtkCpCutter (both vtkPolyData on the input and output port) . We use this filter to generate a set of slices on surface geometry. We then process the obtained contours with vtkPlotEdges. For each contour (slice) we would like to compute a scalar value, say max distance between two points in the contour and output the values to the scalar list widget. Of course we also would like to modify the distances and send it back to the filters. These values will be used to update the output of the filter. Andrzej -Original Message- From: Utkarsh Ayachit [mailto:utkarsh.ayac...@kitware.com] Sent: 23 May 2016 14:58 To: Andrzej Peczak Cc: ParaView Subject: Re: [Paraview] Custom panel widget > Is it possible to create a custom widget for a filter which would allow me to > retrieve the results of its computation? I would like to reproduce the > functionality of the pqDoubleVectorPropertyWidget and populate it with values > computed by the filter. I know how to create and register the widget but I do > not know how do I send values to it from the filter. In paraview code base I > found vtkEventQtSlotConnect but I do not know if it is of any use to my > problem. There are several ways of skinning this cat. Can you elaborate of what exactly is your use-case? Do you want the default values for this double-vector-property (DVP) set using some values provided by the VTK filter, but allow user to override using UI? ** Please consider the environment. Only print this email if absolutely necessary. This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ** ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
[Paraview] Custom panel widget
Hello, Is it possible to create a custom widget for a filter which would allow me to retrieve the results of its computation? I would like to reproduce the functionality of the pqDoubleVectorPropertyWidget and populate it with values computed by the filter. I know how to create and register the widget but I do not know how do I send values to it from the filter. In paraview code base I found vtkEventQtSlotConnect but I do not know if it is of any use to my problem. Andrzej ** Please consider the environment. Only print this email if absolutely necessary. This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ** ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
Re: [Paraview] DoubleVectorProperty widget
Thanks Cory, I did not realise that I can do it this way. I have another question regarding representation of properties. Is there a way to substitute a default property widget with my own widget if I was to create one, say in the plugin xml configuration file ? Andrzej From: Cory Quammen [mailto:cory.quam...@kitware.com] Sent: 29 January 2016 20:03 To: Andrzej Peczak Cc: paraview@paraview.org Subject: Re: [Paraview] DoubleVectorProperty widget Andrzej, Once you have the property, can't you call vtkSMDoubleVectorProperty::SetNumberOfElements(0); ? Thanks, Cory On Fri, Jan 29, 2016 at 11:35 AM, Andrzej Peczak <apec...@ara.co.uk<mailto:apec...@ara.co.uk>> wrote: Hi I want to modify a state of the DoubleVectorProperty object or its widget representation. I know that I can modify its content through vtkSMDoubleVectorProperty object retrieved with pqActiveObjects::instance().activeSource()->getSourceProxy()->GetProperty(...) method but I cannot find a method which would allow me to clear the entire content of it. I figured out that an alternative way to do that would be to retrieve the widget representation of that property which would be pqScalarValueListPropertyWidget and then call setScalars() but I do not know where I can get the object from. Andrzej ** Please consider the environment. Only print this email if absolutely necessary. This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ** ___ Powered by www.kitware.com<http://www.kitware.com> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview -- Cory Quammen R Engineer Kitware, Inc. ** Please consider the environment. Only print this email if absolutely necessary. This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ** ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
[Paraview] DoubleVectorProperty widget
Hi I want to modify a state of the DoubleVectorProperty object or its widget representation. I know that I can modify its content through vtkSMDoubleVectorProperty object retrieved with pqActiveObjects::instance().activeSource()->getSourceProxy()->GetProperty(...) method but I cannot find a method which would allow me to clear the entire content of it. I figured out that an alternative way to do that would be to retrieve the widget representation of that property which would be pqScalarValueListPropertyWidget and then call setScalars() but I do not know where I can get the object from. Andrzej ** Please consider the environment. Only print this email if absolutely necessary. This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ** ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
Re: [Paraview] Changing values of property panel
Hi 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. 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 ? Andrzej -Original Message- From: Utkarsh Ayachit [mailto:utkarsh.ayac...@kitware.com] Sent: 28 January 2016 15:07 To: Yumin Yuan Cc: Andrzej Peczak; paraview@paraview.org Subject: Re: [Paraview] Changing values of property panel 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. [1] http://www.paraview.org/ParaView3/Doc/Nightly/www/cxx-doc/classvtkSMPVRepresentationProxy.html#acb45bfbb4940b0a6a30852aaff0a8b35 From: Yumin Yuan [mailto:yumin.y...@kitware.com] Sent: 28 January 2016 14:02 To: Andrzej Peczak Cc: paraview@paraview.org Subject: Re: [Paraview] Changing values of property panel Hi Andrzej, On Thu, Jan 28, 2016 at 8:25 AM, Andrzej Peczak <apec...@ara.co.uk<mailto:apec...@ara.co.uk>> wrote: Hi Yumin, 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. You may be missing a render call. Try adding the following at the end myView->render(); 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. You have to also set the same "LookupTable" to the upstream representation. 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. Which object? how did you delete it? Normally this message means you have an empty "LookupTable". HTH Yumin vtkSMProxy* repProxy = repr->getProxy(); const char * arrayName = vtkSMPropertyHelper(repProxy, "ColorArrayName").GetInputArrayNameToProcess(); int association = vtkSMPropertyHelper(repProxy, "ColorArrayName").GetInputArrayAssociation(); pqDataRepresentation * uRepr = repr->getRepresentationForUpstreamSource(); vtkSMProxy* uRepProxy = uRepr->getProxy(); vtkSMPropertyHelper( uRepProxy, "ColorArrayName" ).SetInputArrayToProcess( association, arrayName ); vtkSMPropertyHelper( uRepProxy, "ColorArrayName" ).Set( arrayName ); vtkSMPropertyHelper( uRepProxy, "Visibility" ).Set( 1 ); vtkSMPropertyHelper( uRepProxy, "Representation" ).Set( "Surface" ); repProxy->UpdateVTKObjects(); uRepProxy->UpdateVTKObjects(); Andrzej ________ From: Yumin Yuan [yumin.y...@kitware.com<mailto:yumin.y...@kitware.com>] Sent: 27 January 2016 14:41 To: Andrzej Peczak Cc: paraview@paraview.org<mailto:paraview@paraview.org> Subject: Re: [Paraview] Changing values of property panel Hi Andrzej, The representation has its own SM proxy, vtkSMProxy* repProxy = repr->getProxy(); vtkSMPropertyHelper(repProxy, "Representation").Set("Surface With Edges"); vtkSMPropertyHelper(repProxy, "LineWidth").Set(2); HTH, Yumin On Wed, Jan 27, 2016 at 7:36 AM, Andrzej Peczak <apec...@ara.co.uk<mailto:apec...@ara.co.uk>> wrote: Hi I am trying to find a way to modify property values of a fil
Re: [Paraview] Changing values of property panel
Hi Yumin, 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. 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. 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. vtkSMProxy* repProxy = repr->getProxy(); const char * arrayName = vtkSMPropertyHelper(repProxy, "ColorArrayName").GetInputArrayNameToProcess(); int association = vtkSMPropertyHelper(repProxy, "ColorArrayName").GetInputArrayAssociation(); pqDataRepresentation * uRepr = repr->getRepresentationForUpstreamSource(); vtkSMProxy* uRepProxy = uRepr->getProxy(); vtkSMPropertyHelper( uRepProxy, "ColorArrayName" ).SetInputArrayToProcess( association, arrayName ); vtkSMPropertyHelper( uRepProxy, "ColorArrayName" ).Set( arrayName ); vtkSMPropertyHelper( uRepProxy, "Visibility" ).Set( 1 ); vtkSMPropertyHelper( uRepProxy, "Representation" ).Set( "Surface" ); repProxy->UpdateVTKObjects(); uRepProxy->UpdateVTKObjects(); Andrzej ________ From: Yumin Yuan [yumin.y...@kitware.com] Sent: 27 January 2016 14:41 To: Andrzej Peczak Cc: paraview@paraview.org Subject: Re: [Paraview] Changing values of property panel Hi Andrzej, The representation has its own SM proxy, vtkSMProxy* repProxy = repr->getProxy(); vtkSMPropertyHelper(repProxy, "Representation").Set("Surface With Edges"); vtkSMPropertyHelper(repProxy, "LineWidth").Set(2); HTH, Yumin On Wed, Jan 27, 2016 at 7:36 AM, Andrzej Peczak <apec...@ara.co.uk<mailto:apec...@ara.co.uk>> wrote: Hi 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. 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 ? pqPipelineRepresentation* repr = qobject_cast< pqPipelineRepresentation* >( pqActiveObjects::instance().activeRepresentation() ); if ( repr ) { vtkSMProxy * lutProxy = repr->getLookupTable()->getProxy(); if ( lutProxy ) { vtkSMPropertyHelper( lutProxy, "NumberOfTableValues" ).Set( this->scalars().count() - 1 ); lutProxy->UpdateVTKObjects(); } } Andrzej ** Please consider the environment. Only print this email if absolutely necessary. This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ** ___ Powered by www.kitware.com<http://www.kitware.com> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview ** Please consider the environment. Only print this email if absolutely necessary. This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient plea
[Paraview] Changing values of property panel
Hi 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. 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 ? pqPipelineRepresentation* repr = qobject_cast< pqPipelineRepresentation* >( pqActiveObjects::instance().activeRepresentation() ); if ( repr ) { vtkSMProxy * lutProxy = repr->getLookupTable()->getProxy(); if ( lutProxy ) { vtkSMPropertyHelper( lutProxy, "NumberOfTableValues" ).Set( this->scalars().count() - 1 ); lutProxy->UpdateVTKObjects(); } } Andrzej ** Please consider the environment. Only print this email if absolutely necessary. This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ** ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
Re: [Paraview] Paraview 4.4.0 - Plugin with a custom 3d widget
Cory I had tried to place the widget in utilities.xml under earlier without the success. The filter sees the standard Box but not MyBox. Andrzej From: Cory Quammen [mailto:cory.quam...@kitware.com] Sent: 03 December 2015 14:18 To: Andrzej Peczak Cc: paraview@paraview.org Subject: Re: [Paraview] Paraview 4.4.0 - Plugin with a custom 3d widget Andrzej, I believe the ProxyGroup name for the widget should be set with instead of HTH, Cory On Thu, Dec 3, 2015 at 6:42 AM, Andrzej Peczak <apec...@ara.co.uk> wrote: Hi I am trying to customise a plugin with an implicit function widget. As an example I choose vtkPVBox class to check if I can register it under a different name. To do it I created a SM file as following, but the plugin seems not seeing the object I am registering. Can anybody explain how do I register my own widget ? Thanks Andrzej ** Please consider the environment. Only print this email if absolutely necessary. This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ** ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview -- Cory Quammen R Engineer Kitware, Inc. ** Please consider the environment. Only print this email if absolutely necessary. This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ** ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
[Paraview] Paraview plugin with drop down list with values from input arrays
Hi Is it possible to create multiple drop down list with values based on arbitrary number of attribute arrays in a dataset ? Andrzej ** Please consider the environment. Only print this email if absolutely necessary. This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ** ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview