<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Thanks Cory, that's the function I was looking for.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Got it working now <span>😊</span></p>
<p style="margin-top:0;margin-bottom:0"><span><br>
</span></p>
I attached a working version for anyone interested; README inside with some instructions
<div>
<div><br>
</div>
<div>Cheers!<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Van:</b> Cory Quammen <cory.quammen@kitware.com><br>
<b>Verzonden:</b> vrijdag 2 februari 2018 21:35<br>
<b>Aan:</b> Ahmad .<br>
<b>CC:</b> ParaView<br>
<b>Onderwerp:</b> Re: [Paraview] Scaling cylinder glyph's radius and height individually</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Ahmad,<br>
<br>
First, I recommend that you try loading your plugin in the ParaView<br>
UI, using the ParaView that you built your plugin against. Then, in<br>
Tools -> Manage Plugins. Click on Load New... and select the file<br>
libvtkPVGlyphFilterP.so. You should now be able to find your filter<br>
GlyphP in the Filters menu.<br>
<br>
Second, to instantiate the filter the way you are trying is correct,<br>
but first you need to load the plugin. I believe you can do it this<br>
way:<br>
<br>
vtkSMPluginManager::LoadLocalPlugin("<path>/<to>/libvtkPVGlyphFilterP.so");<br>
<br>
HTH,<br>
Cory<br>
<br>
<br>
<br>
On Thu, Feb 1, 2018 at 1:12 PM, Ahmad . <super_achie@hotmail.com> wrote:<br>
> Sorry about that Cory; will keep this in the mailing list.<br>
><br>
><br>
> I have tried to implement your suggestion, and now I have generated a plugin<br>
> file "libvtkPVGlyphFilterP.so".<br>
><br>
> Please find the files I used to create this plugin in the attachment.<br>
><br>
><br>
> What I did after compiling the plugin:<br>
><br>
><br>
> Try to use the new class I made, like such:<br>
> `session_manager_->NewProxy("filters", "GlyphP")));`<br>
> where GlyphP is what I called my custom glyph filter (see the xml file in<br>
> the attachment).<br>
> Compile my application against "libvtkPVGlyphFilterP.so".<br>
> Run my application and get the following error:<br>
><br>
><br>
> ERROR: In<br>
> /home/ahmad/paraview/ParaViewCore/ServerImplementation/Core/vtkSIProxyDefinitionManager.cxx,<br>
> line 526<br>
> vtkSIProxyDefinitionManager (0x294d320): No proxy that matches:<br>
> group=filters and proxy=GlyphP were found.<br>
><br>
> I feel like I am missing an important step, which has to do with the XML<br>
> file, but I don't know how.<br>
><br>
> In the Plugin Wiki of ParaView the instructions I find after compiling are:<br>
> Then using cmake and a build system, one can build a plugin for this new<br>
> filter. Once this plugin is loaded the filter will appear under the<br>
> "Alphabetical" list in the Filters menu.<br>
> There are no instructions on how to use the new class in a C++ pipeline...<br>
><br>
> Any pointers on this?<br>
><br>
> Best,<br>
> Ahmad<br>
><br>
> ________________________________<br>
> Van: Cory Quammen <cory.quammen@kitware.com><br>
> Verzonden: vrijdag 19 januari 2018 16:59<br>
> Aan: Ahmad .; ParaView<br>
><br>
> Onderwerp: Re: [Paraview] Scaling cylinder glyph's radius and height<br>
> individually<br>
><br>
> Ahmad,<br>
><br>
> Please keep replies on the mailing list. Responses are inlined.<br>
><br>
> On Tue, Jan 16, 2018 at 9:25 AM, Ahmad . <super_achie@hotmail.com> wrote:<br>
><br>
> Hi Cory,<br>
><br>
><br>
> Thanks for your reply.<br>
><br>
><br>
> I am trying to implement your suggestion of extending the vtkGlyph3D with<br>
> this additional "scaling by normals".<br>
><br>
> The idea seems quite straightforward. I was just wondering how to<br>
> incorporate this new class in my C++ pipeline.<br>
><br>
> Currently I create the glyph, and set its properties, like this:<br>
><br>
><br>
> vtkSmartPointer<vtkSMSourceProxy> glyph;<br>
> glyph.TakeReference(vtkSMSourceProxy::SafeDownCast(<br>
> session_manager_->NewProxy("filters", "Glyph")));<br>
> controller_->PreInitializeProxy(glyph);<br>
><br>
> vtkSMPropertyHelper(glyph, "Input").Set(producer);<br>
> vtkSMPropertyHelper(glyph, "Source").Set(GetCylinderSource(glyph));<br>
> vtkSMPropertyHelper(glyph, "ScaleMode", true).Set(0);<br>
> vtkSMPropertyHelper(glyph, "ScaleFactor", true).Set(1.0);<br>
> vtkSMPropertyHelper(glyph, "GlyphMode", true).Set(0);<br>
><br>
> As you can see I am not directly working with vtkGlyph3D or vtkPVGlyphFilter<br>
> classes, but I am using the vtkSMPropertyHelper to take care of the<br>
> boilerplate code.<br>
><br>
><br>
> Right. Unfortunately, implementing my suggestion would require creating a<br>
> subclass of vtkPVGlyphFilter and importing that with a ParaView plugin. See<br>
> the ParaView Howto on how to add a filter to ParaView.<br>
><br>
> After I created a new class that has this extra scaling option, how would I<br>
> go about using this in such a pipeline? Do I need to 'register' my<br>
> "ModifiedGlyph" to the filter proxies to be able to do something like<br>
> `NewProxy("filters", "ModifiedGlyph")`?<br>
><br>
><br>
> Yes, that should do it. Your modified glyph class will be available once<br>
> you've imported the ParaView plugin mentioned above.<br>
><br>
> A quick question about setting the active normals. Is there an existing way<br>
> to do this, or would I need to do this myself? I would like to do this the<br>
> same way one would set the "Scalars":<br>
><br>
><br>
> vtkSMPropertyHelper(glyph, "Normals")<br>
> .SetInputArrayToProcess(vtkDataObject::POINT, "ScalingArray");<br>
><br>
><br>
> I think that should work.<br>
><br>
> Best,<br>
> Cory<br>
><br>
><br>
> Looking forward to your reply.<br>
><br>
> Best,<br>
> Ahmad<br>
><br>
><br>
><br>
> ________________________________<br>
> Van: Cory Quammen <cory.quammen@kitware.com><br>
> Verzonden: dinsdag 9 januari 2018 15:30<br>
> Aan: Ahmad .<br>
> CC: paraview@paraview.org<br>
> Onderwerp: Re: [Paraview] Scaling cylinder glyph's radius and height<br>
> individually<br>
><br>
> Hi Ahmad,<br>
><br>
> Alas, reading the code of vtkGlyph3D, you cannot orient by a vector<br>
> array different from the vector array used to do the scaling using the<br>
> functionality in ParaView. You would have to modify either<br>
> vtkPVGlyphFilter or its parent class vtkGlyph3D, to do this, and<br>
> expose the new VTK class through a ParaView plugin [1]. A simple<br>
> modification would be to add a ScaleMode, say VTK_SCALE_BY_NORMAL, to<br>
> vtkGlyph3D, and then set the active normals in your data set to the<br>
> vector by which you wish to scale. Then the "vectors" property could<br>
> control the orientation and the active normals would control the<br>
> scale. That's kind of kludgey, but it would be a fairly fast<br>
> modification to make.<br>
><br>
> HTH,<br>
> Cory<br>
><br>
> [1] <a href="https://www.paraview.org/Wiki/ParaView/Plugin_HowTo" id="LPlnk275064" previewremoved="true">
https://www.paraview.org/Wiki/ParaView/Plugin_HowTo</a>
<div id="LPBorder_GT_15176869534200.4673250750865636" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15176869534120.3637098828407832" role="presentation" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_15176869534150.4778265803656132" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_15176869534150.7311709361831504"></div>
<div id="LPTitle_15176869534160.26792919495958545" style="top: 0px; color: rgb(0, 120, 215); font-weight: 400; font-size: 21px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15176869534170.07331805928708857" href="https://www.paraview.org/Wiki/ParaView/Plugin_HowTo" target="_blank" style="text-decoration: none;">ParaView/Plugin HowTo - KitwarePublic</a></div>
<div id="LPMetadata_15176869534180.8385668810806322" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
www.paraview.org</div>
<div id="LPDescription_15176869534190.6800563807421713" style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
Introduction. ParaView comes with plethora of functionality bundled in: several readers, multitude of filters, quite a few different types of views etc.</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
> ParaView/Plugin HowTo - KitwarePublic<br>
> <a href="http://www.paraview.org" id="LPlnk289807" previewremoved="true">www.paraview.org</a>
<div id="LPBorder_GT_15176869823000.9180023348398569" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15176869822880.7060911620257553" role="presentation" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="ImageCell_15176869822910.7058458712406539" colspan="1" style="width: 250px; position: relative; display: table-cell; padding-right: 20px;">
<div id="LPImageContainer_15176869822910.398217663534403" style="background-color: rgb(255, 255, 255); height: 65px; position: relative; margin: auto; display: table; width: 250px;">
<a id="LPImageAnchor_15176869822920.6835169803250771" href="http://www.paraview.org/" target="_blank" style="display: table-cell; text-align: center;"><img id="LPThumbnailImageID_15176869822930.960364040080925" style="display: inline-block; max-width: 250px; max-height: 250px; height: 65px; width: 250px; border-width: 0px; vertical-align: bottom;" width="250" height="65" src="https://www.paraview.org/wp-content/uploads/2016/01/paraview_logo.png"></a></div>
</td>
<td id="TextCell_15176869822940.6657212505616124" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_15176869822940.5536368922388044"></div>
<div id="LPTitle_15176869822940.011879786511441726" style="top: 0px; color: rgb(0, 120, 215); font-weight: 400; font-size: 21px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15176869822970.9147911737926118" href="http://www.paraview.org/" target="_blank" style="text-decoration: none;">ParaView</a></div>
<div id="LPMetadata_15176869822970.31182829320902505" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
www.paraview.org</div>
<div id="LPDescription_15176869822990.9751475186110696" style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
Welcome to ParaView. ParaView is an open-source, multi-platform data analysis and visualization application. ParaView users can quickly build visualizations to ...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
> Introduction. ParaView comes with plethora of functionality bundled in:<br>
> several readers, multitude of filters, quite a few different types of views<br>
> etc.<br>
><br>
><br>
><br>
><br>
> On Tue, Jan 9, 2018 at 7:43 AM, Ahmad . <super_achie@hotmail.com> wrote:<br>
>> Just want to add that a programmatic (C++) solution is preferred rather<br>
>> than<br>
>> using the GUI<br>
>><br>
>><br>
>> I have a C++ pipeline where I can set the properties of the cylinder glyph<br>
>> with vtkSMPropertyHelper.<br>
>><br>
>> I have looked in filters.xml under vtkPVGlyphFilter source proxy (file<br>
>> located in<br>
>> <paraview_home>/ParaViewCore/ServerManager/SMApplication/Resources) to see<br>
>> what my options are, but there is only one "SetInputArrayToProcess" that<br>
>> takes a vector attribute as input; nothing about a vector specifically for<br>
>> orientation..<br>
>><br>
>> Suggestions on how to handle this issue, are very welcome; other<br>
>> approaches<br>
>> than mine as well!<br>
>><br>
>> ________________________________<br>
>> Van: Ahmad . <super_achie@hotmail.com><br>
>> Verzonden: maandag 8 januari 2018 20:52<br>
>> Aan: paraview@paraview.org<br>
>> Onderwerp: Re: Scaling cylinder glyph's radius and height individually<br>
>><br>
>><br>
>> Following up on my own question, I found out that if I scale by "Vector<br>
>> Components" it is possible to change the length of the cylinders with the<br>
>> second vector index, and the radius with the first and third. I need to<br>
>> rearrange my attribute data as such: [radius_x, length, radius_z]. If I<br>
>> keep<br>
>> radius_x == radius_z, then the cylinder will not deform, and the cross<br>
>> section stays a perfect circle. See the image in the attachment please.<br>
>><br>
>><br>
>> BUT the problem here is that "vector components" also affects the<br>
>> orientation of my cylindrical glyphs. I can turn this off in the<br>
>> properties<br>
>> menu, but I need to orient my cylinders based on another vector attribute<br>
>> data...<br>
>><br>
>><br>
>> I feel I'm getting somewhere, but if someone could give me an idea on how<br>
>> to<br>
>> now orient my glyphs with another vector data than the one I use now for<br>
>> scaling, that would be much appreciated!<br>
>><br>
>><br>
>> Best,<br>
>> Ahmad<br>
>><br>
>> ________________________________<br>
>> Van: Ahmad . <super_achie@hotmail.com><br>
>> Verzonden: maandag 8 januari 2018 18:01<br>
>> Aan: paraview@paraview.org<br>
>> Onderwerp: Scaling cylinder glyph's radius and height individually<br>
>><br>
>><br>
>> Dear community,<br>
>><br>
>><br>
>> When I try to scale cylindrical glyph objects by a 'Scalar', it scales<br>
>> both<br>
>> the radius and height of the glyphs.<br>
>><br>
>> Is there a way to scale the radius by a Scalar1, and the height be a<br>
>> Scalar2?<br>
>><br>
>><br>
>> I have an unstructured grid, and for each point I want to create a<br>
>> cylinder<br>
>> that can have an arbitrary radius and height.<br>
>><br>
>> I thought Glyphs would be the way to go, but I'm kind of stuck with this<br>
>> issue.<br>
>><br>
>><br>
>> Any help is much appreciated; or if you can recommend a different way to<br>
>> achieve the above-mentioned please let me know!<br>
>><br>
>><br>
>> Best,<br>
>><br>
>> Ahmad<br>
>><br>
>><br>
>> _______________________________________________<br>
>> Powered by <a href="http://www.kitware.com" id="LPlnk990605" previewremoved="true">
www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" id="LPlnk816680" previewremoved="true">
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" id="LPlnk431603" previewremoved="true">
http://paraview.org/Wiki/ParaView</a>
<div id="LPBorder_GT_15176870125940.9819189439317542" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15176870125860.3693408162857241" role="presentation" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_15176870125890.05731466303229271" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_15176870125890.9750340296384927"></div>
<div id="LPTitle_15176870125890.5086397334152597" style="top: 0px; color: rgb(0, 120, 215); font-weight: 400; font-size: 21px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15176870125910.8418286491078266" href="http://paraview.org/Wiki/ParaView" target="_blank" style="text-decoration: none;">ParaView - KitwarePublic</a></div>
<div id="LPMetadata_15176870125910.5184650503432775" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
paraview.org</div>
<div id="LPDescription_15176870125930.3704086859735962" style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
ParaView is an open-source, multi-platform application designed to visualize data sets of varying sizes from small to very large. The goals of the ParaView project ...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
> ParaView - KitwarePublic<br>
> paraview.org<br>
> ParaView is an open-source, multi-platform application designed to visualize<br>
> data sets of varying sizes from small to very large. The goals of the<br>
> ParaView project ...<br>
><br>
><br>
>><br>
>> Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" id="LPlnk265200" previewremoved="true">
http://markmail.org/search/?q=ParaView</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="https://paraview.org/mailman/listinfo/paraview" id="LPlnk67132" previewremoved="true">
https://paraview.org/mailman/listinfo/paraview</a>
<div id="LPBorder_GT_15176870126280.22342641639597582" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15176870126240.6431710670104678" role="presentation" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_15176870126250.4302658920642277" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_15176870126250.32294743784970925"></div>
<div id="LPTitle_15176870126250.7957975649673827" style="top: 0px; color: rgb(0, 120, 215); font-weight: 400; font-size: 21px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15176870126260.06439487061850357" href="https://paraview.org/mailman/listinfo/paraview" target="_blank" style="text-decoration: none;">ParaView Info Page</a></div>
<div id="LPMetadata_15176870126260.9327063966927416" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
paraview.org</div>
<div id="LPDescription_15176870126270.28055839100656543" style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
To see the collection of prior postings to the list, visit the ParaView Archives. Using ParaView: To post a message to all the list members, send ...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
> ParaView Info Page<br>
> paraview.org<br>
> To see the collection of prior postings to the list, visit the ParaView<br>
> Archives. Using ParaView: To post a message to all the list members, send<br>
> ...<br>
><br>
><br>
>><br>
><br>
><br>
><br>
> --<br>
> Cory Quammen<br>
> Staff R&D Engineer<br>
> Kitware, Inc.<br>
><br>
><br>
><br>
><br>
> --<br>
> Cory Quammen<br>
> Staff R&D Engineer<br>
> Kitware, Inc.<br>
<br>
<br>
<br>
-- <br>
Cory Quammen<br>
Staff R&D Engineer<br>
Kitware, Inc.<br>
</div>
</span></font></div>
</div>
</div>
</div>
</div>
</body>
</html>