Re: [Paraview] Scaling cylinder glyph's radius and height individually
Thanks Cory, that's the function I was looking for. Got it working now 😊 I attached a working version for anyone interested; README inside with some instructions Cheers! Van: Cory Quammen Verzonden: vrijdag 2 februari 2018 21:35 Aan: Ahmad . CC: ParaView Onderwerp: Re: [Paraview] Scaling cylinder glyph's radius and height individually Ahmad, First, I recommend that you try loading your plugin in the ParaView UI, using the ParaView that you built your plugin against. Then, in Tools -> Manage Plugins. Click on Load New... and select the file libvtkPVGlyphFilterP.so. You should now be able to find your filter GlyphP in the Filters menu. Second, to instantiate the filter the way you are trying is correct, but first you need to load the plugin. I believe you can do it this way: vtkSMPluginManager::LoadLocalPlugin("//libvtkPVGlyphFilterP.so"); HTH, Cory On Thu, Feb 1, 2018 at 1:12 PM, Ahmad . wrote: > Sorry about that Cory; will keep this in the mailing list. > > > I have tried to implement your suggestion, and now I have generated a plugin > file "libvtkPVGlyphFilterP.so". > > Please find the files I used to create this plugin in the attachment. > > > What I did after compiling the plugin: > > > Try to use the new class I made, like such: > `session_manager_->NewProxy("filters", "GlyphP")));` > where GlyphP is what I called my custom glyph filter (see the xml file in > the attachment). > Compile my application against "libvtkPVGlyphFilterP.so". > Run my application and get the following error: > > > ERROR: In > /home/ahmad/paraview/ParaViewCore/ServerImplementation/Core/vtkSIProxyDefinitionManager.cxx, > line 526 > vtkSIProxyDefinitionManager (0x294d320): No proxy that matches: > group=filters and proxy=GlyphP were found. > > I feel like I am missing an important step, which has to do with the XML > file, but I don't know how. > > In the Plugin Wiki of ParaView the instructions I find after compiling are: > Then using cmake and a build system, one can build a plugin for this new > filter. Once this plugin is loaded the filter will appear under the > "Alphabetical" list in the Filters menu. > There are no instructions on how to use the new class in a C++ pipeline... > > Any pointers on this? > > Best, > Ahmad > > ____ > Van: Cory Quammen > Verzonden: vrijdag 19 januari 2018 16:59 > Aan: Ahmad .; ParaView > > Onderwerp: Re: [Paraview] Scaling cylinder glyph's radius and height > individually > > Ahmad, > > Please keep replies on the mailing list. Responses are inlined. > > On Tue, Jan 16, 2018 at 9:25 AM, Ahmad . wrote: > > Hi Cory, > > > Thanks for your reply. > > > I am trying to implement your suggestion of extending the vtkGlyph3D with > this additional "scaling by normals". > > The idea seems quite straightforward. I was just wondering how to > incorporate this new class in my C++ pipeline. > > Currently I create the glyph, and set its properties, like this: > > > vtkSmartPointer glyph; > glyph.TakeReference(vtkSMSourceProxy::SafeDownCast( > session_manager_->NewProxy("filters", "Glyph"))); > controller_->PreInitializeProxy(glyph); > > vtkSMPropertyHelper(glyph, "Input").Set(producer); > vtkSMPropertyHelper(glyph, "Source").Set(GetCylinderSource(glyph)); > vtkSMPropertyHelper(glyph, "ScaleMode", true).Set(0); > vtkSMPropertyHelper(glyph, "ScaleFactor", true).Set(1.0); > vtkSMPropertyHelper(glyph, "GlyphMode", true).Set(0); > > As you can see I am not directly working with vtkGlyph3D or vtkPVGlyphFilter > classes, but I am using the vtkSMPropertyHelper to take care of the > boilerplate code. > > > Right. Unfortunately, implementing my suggestion would require creating a > subclass of vtkPVGlyphFilter and importing that with a ParaView plugin. See > the ParaView Howto on how to add a filter to ParaView. > > After I created a new class that has this extra scaling option, how would I > go about using this in such a pipeline? Do I need to 'register' my > "ModifiedGlyph" to the filter proxies to be able to do something like > `NewProxy("filters", "ModifiedGlyph")`? > > > Yes, that should do it. Your modified glyph class will be available once > you've imported the ParaView plugin mentioned above. > > A quick question about setting the active normals. Is there an existing way > to do this, or would I need to do this myself? I would like to do this the >
Re: [Paraview] Scaling cylinder glyph's radius and height individually
Sorry about that Cory; will keep this in the mailing list. I have tried to implement your suggestion, and now I have generated a plugin file "libvtkPVGlyphFilterP.so". Please find the files I used to create this plugin in the attachment. What I did after compiling the plugin: 1. Try to use the new class I made, like such: `session_manager_->NewProxy("filters", "GlyphP")));` where GlyphP is what I called my custom glyph filter (see the xml file in the attachment). 2. Compile my application against "libvtkPVGlyphFilterP.so". 3. Run my application and get the following error: ERROR: In /home/ahmad/paraview/ParaViewCore/ServerImplementation/Core/vtkSIProxyDefinitionManager.cxx, line 526 vtkSIProxyDefinitionManager (0x294d320): No proxy that matches: group=filters and proxy=GlyphP were found. I feel like I am missing an important step, which has to do with the XML file, but I don't know how. In the Plugin Wiki of ParaView the instructions I find after compiling are: Then using cmake and a build system, one can build a plugin for this new filter. Once this plugin is loaded the filter will appear under the "Alphabetical" list in the Filters menu. There are no instructions on how to use the new class in a C++ pipeline... Any pointers on this? Best, Ahmad Van: Cory Quammen Verzonden: vrijdag 19 januari 2018 16:59 Aan: Ahmad .; ParaView Onderwerp: Re: [Paraview] Scaling cylinder glyph's radius and height individually Ahmad, Please keep replies on the mailing list. Responses are inlined. On Tue, Jan 16, 2018 at 9:25 AM, Ahmad . mailto:super_ac...@hotmail.com>> wrote: Hi Cory, Thanks for your reply. I am trying to implement your suggestion of extending the vtkGlyph3D with this additional "scaling by normals". The idea seems quite straightforward. I was just wondering how to incorporate this new class in my C++ pipeline. Currently I create the glyph, and set its properties, like this: vtkSmartPointer glyph; glyph.TakeReference(vtkSMSourceProxy::SafeDownCast( session_manager_->NewProxy("filters", "Glyph"))); controller_->PreInitializeProxy(glyph); vtkSMPropertyHelper(glyph, "Input").Set(producer); vtkSMPropertyHelper(glyph, "Source").Set(GetCylinderSource(glyph)); vtkSMPropertyHelper(glyph, "ScaleMode", true).Set(0); vtkSMPropertyHelper(glyph, "ScaleFactor", true).Set(1.0); vtkSMPropertyHelper(glyph, "GlyphMode", true).Set(0); As you can see I am not directly working with vtkGlyph3D or vtkPVGlyphFilter classes, but I am using the vtkSMPropertyHelper to take care of the boilerplate code. Right. Unfortunately, implementing my suggestion would require creating a subclass of vtkPVGlyphFilter and importing that with a ParaView plugin. See the ParaView Howto on how to add a filter to ParaView. After I created a new class that has this extra scaling option, how would I go about using this in such a pipeline? Do I need to 'register' my "ModifiedGlyph" to the filter proxies to be able to do something like `NewProxy("filters", "ModifiedGlyph")`? Yes, that should do it. Your modified glyph class will be available once you've imported the ParaView plugin mentioned above. A quick question about setting the active normals. Is there an existing way to do this, or would I need to do this myself? I would like to do this the same way one would set the "Scalars": vtkSMPropertyHelper(glyph, "Normals") .SetInputArrayToProcess(vtkDataObject::POINT, "ScalingArray"); I think that should work. Best, Cory Looking forward to your reply. Best, Ahmad Van: Cory Quammen mailto:cory.quam...@kitware.com>> Verzonden: dinsdag 9 januari 2018 15:30 Aan: Ahmad . CC: paraview@paraview.org<mailto:paraview@paraview.org> Onderwerp: Re: [Paraview] Scaling cylinder glyph's radius and height individually Hi Ahmad, Alas, reading the code of vtkGlyph3D, you cannot orient by a vector array different from the vector array used to do the scaling using the functionality in ParaView. You would have to modify either vtkPVGlyphFilter or its parent class vtkGlyph3D, to do this, and expose the new VTK class through a ParaView plugin [1]. A simple modification would be to add a ScaleMode, say VTK_SCALE_BY_NORMAL, to vtkGlyph3D, and then set the active normals in your data set to the vector by which you wish to scale. Then the "vectors" property could control the orientation and the active normals would control the scale. That's kind of kludgey, but it would be a fairly fast modification to make. HTH, Cory [1] https://www.paraview.org/Wiki/ParaView/Plugin_HowTo ParaView/Plugin HowTo - KitwareP
Re: [Paraview] Reading group of pvti files: vtkImageData is static over time
Hello again, Could someone please confirm this to be a bug, or otherwise tell me how it could be resolved? The problem is that my vtkImageData object changes in size over time, but visually it stays the same when I import it in ParaView as a group and play it as an animation. Please see https://gitlab.kitware.com/paraview/paraview/issues/17732 for a reproducer and a screenshot of the problem. Best, Ahmad Van: Ahmad . Verzonden: dinsdag 9 januari 2018 14:30 Aan: paraview@paraview.org Onderwerp: Re: Reading group of pvti files: vtkImageData is static over time Sorry wrong link in my last e-mail. This is the correct one: https://gitlab.kitware.com/paraview/paraview/issues/17732 Van: Ahmad . Verzonden: dinsdag 9 januari 2018 14:27 Aan: paraview@paraview.org Onderwerp: Re: Reading group of pvti files: vtkImageData is static over time Was about to create a new question about this, but I remembered I had asked it already a few months back ;-) However I didn't receive a reply unfortunately. Does anyone have a clue? I also opened an issue about this on gitlab: https://gitlab.kitware.com/paraview/paraview/issues/17698 There are also the files that demonstrate the issue. Cheers! Van: A . Verzonden: donderdag 14 september 2017 17:41 Aan: paraview@paraview.org Onderwerp: Reading group of pvti files: vtkImageData is static over time Hello, I have a vtkImageData object that I write (with a XMLPImageDataWriter) every time step to a pvti file. When I open the group of output_*.pvti files, properties like X, Y, Z extent and range do not change as I animate over time. But when I open the actual files I can see that these values in fact are different. And if I open the files individually (for example output_99.pvti) these properties are displayed correctly in ParaView. The problem appears when I open them as a group; it then keeps the properties of the first file. Does anyone else has this issue, and is there a way to solve this? Best, Ahmad ___ 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: https://paraview.org/mailman/listinfo/paraview
Re: [Paraview] Reading group of pvti files: vtkImageData is static over time
Sorry wrong link in my last e-mail. This is the correct one: https://gitlab.kitware.com/paraview/paraview/issues/17732 Van: Ahmad . Verzonden: dinsdag 9 januari 2018 14:27 Aan: paraview@paraview.org Onderwerp: Re: Reading group of pvti files: vtkImageData is static over time Was about to create a new question about this, but I remembered I had asked it already a few months back ;-) However I didn't receive a reply unfortunately. Does anyone have a clue? I also opened an issue about this on gitlab: https://gitlab.kitware.com/paraview/paraview/issues/17698 There are also the files that demonstrate the issue. Cheers! Van: A . Verzonden: donderdag 14 september 2017 17:41 Aan: paraview@paraview.org Onderwerp: Reading group of pvti files: vtkImageData is static over time Hello, I have a vtkImageData object that I write (with a XMLPImageDataWriter) every time step to a pvti file. When I open the group of output_*.pvti files, properties like X, Y, Z extent and range do not change as I animate over time. But when I open the actual files I can see that these values in fact are different. And if I open the files individually (for example output_99.pvti) these properties are displayed correctly in ParaView. The problem appears when I open them as a group; it then keeps the properties of the first file. Does anyone else has this issue, and is there a way to solve this? Best, Ahmad ___ 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: https://paraview.org/mailman/listinfo/paraview
Re: [Paraview] Reading group of pvti files: vtkImageData is static over time
Was about to create a new question about this, but I remembered I had asked it already a few months back ;-) However I didn't receive a reply unfortunately. Does anyone have a clue? I also opened an issue about this on gitlab: https://gitlab.kitware.com/paraview/paraview/issues/17698 There are also the files that demonstrate the issue. Cheers! Van: A . Verzonden: donderdag 14 september 2017 17:41 Aan: paraview@paraview.org Onderwerp: Reading group of pvti files: vtkImageData is static over time Hello, I have a vtkImageData object that I write (with a XMLPImageDataWriter) every time step to a pvti file. When I open the group of output_*.pvti files, properties like X, Y, Z extent and range do not change as I animate over time. But when I open the actual files I can see that these values in fact are different. And if I open the files individually (for example output_99.pvti) these properties are displayed correctly in ParaView. The problem appears when I open them as a group; it then keeps the properties of the first file. Does anyone else has this issue, and is there a way to solve this? Best, Ahmad ___ 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: https://paraview.org/mailman/listinfo/paraview
Re: [Paraview] Scaling cylinder glyph's radius and height individually
Just want to add that a programmatic (C++) solution is preferred rather than using the GUI I have a C++ pipeline where I can set the properties of the cylinder glyph with vtkSMPropertyHelper. I have looked in filters.xml under vtkPVGlyphFilter source proxy (file located in /ParaViewCore/ServerManager/SMApplication/Resources) to see what my options are, but there is only one "SetInputArrayToProcess" that takes a vector attribute as input; nothing about a vector specifically for orientation.. Suggestions on how to handle this issue, are very welcome; other approaches than mine as well! Van: Ahmad . Verzonden: maandag 8 januari 2018 20:52 Aan: paraview@paraview.org Onderwerp: Re: Scaling cylinder glyph's radius and height individually Following up on my own question, I found out that if I scale by "Vector Components" it is possible to change the length of the cylinders with the second vector index, and the radius with the first and third. I need to rearrange my attribute data as such: [radius_x, length, radius_z]. If I keep radius_x == radius_z, then the cylinder will not deform, and the cross section stays a perfect circle. See the image in the attachment please. BUT the problem here is that "vector components" also affects the orientation of my cylindrical glyphs. I can turn this off in the properties menu, but I need to orient my cylinders based on another vector attribute data... I feel I'm getting somewhere, but if someone could give me an idea on how to now orient my glyphs with another vector data than the one I use now for scaling, that would be much appreciated! Best, Ahmad ____ Van: Ahmad . Verzonden: maandag 8 januari 2018 18:01 Aan: paraview@paraview.org Onderwerp: Scaling cylinder glyph's radius and height individually Dear community, When I try to scale cylindrical glyph objects by a 'Scalar', it scales both the radius and height of the glyphs. Is there a way to scale the radius by a Scalar1, and the height be a Scalar2? I have an unstructured grid, and for each point I want to create a cylinder that can have an arbitrary radius and height. I thought Glyphs would be the way to go, but I'm kind of stuck with this issue. Any help is much appreciated; or if you can recommend a different way to achieve the above-mentioned please let me know! Best, Ahmad ___ 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: https://paraview.org/mailman/listinfo/paraview
[Paraview] Scaling cylinder glyph's radius and height individually
Dear community, When I try to scale cylindrical glyph objects by a 'Scalar', it scales both the radius and height of the glyphs. Is there a way to scale the radius by a Scalar1, and the height be a Scalar2? I have an unstructured grid, and for each point I want to create a cylinder that can have an arbitrary radius and height. I thought Glyphs would be the way to go, but I'm kind of stuck with this issue. Any help is much appreciated; or if you can recommend a different way to achieve the above-mentioned please let me know! Best, Ahmad ___ 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: https://paraview.org/mailman/listinfo/paraview