Dear Rooters,
As suggested in “How to embed ROOT in a GUI” I tried out the new web-based widgets. The example given works as expected. I created my own application based on the example as well.
I have a question concerning the RGeomViewer widget. I want to draw primitives (lines, polygons) together with the 3D volumes on the same RGeomViewer. I was able to do this - not using the web based widgets- but TCanvas TGLViewer and TPolyLine3D. In this case, however the Viewer widget was not embedded in the application. Someone suggested to use TEveLine instead of TPolyLine3D. I have no knowledge about Tracks and I could not get this working. I also suspect that using the Tracks is a little over the top for my purpose. Could please someone help e with this?
best regards Karl
Web-based geometry viewer dedicated only to geometry - no other components are displayed.
Also tracks will not work. Main motivation for geometry viewer - enable display of large geometries in web browsers with limited resources.
But if geometry is not very big, one could try to use web-based TCanvas display.
In that case web browser with JSROOT doing full geometry analysis and rendering.
And it also able to overlay other objects (like TPolyMarker3D or TEveTrack). TPolyLine3D is not yet supported, but can be implemented very fast.
Could you try to compose TCanvas with objects you want to display and post it here?
I will see how much effort it will be to support it with web-based TCanvas.
Hi Sergey, thank you for replying. Something like like in the tutorials/graphics/basic3D.C would be sufficient for my purpose. I tried this out with the web TCanvasWidget but as one should expect, only the Pad ande the PaveTextx are drawn.
It’s only a quirk of mine, “nice to have” the Drawings embedded in my application I understand that complicated things are going on under the hood here, but with the GLviewer NOT embedded, I can achieve what I want to do.
Thanks
Karl
Hi Sergey Ichecked out the remotes/origin/v6-26-00-patches branch with the modified qt5web example it compiles normally but did not work for me. running TGeo in TCanvas I get an empty frame and “Error: Fail to draw poly markers without 3D mode”
best regards karl
I just checked out v6-26-00-patches branch and tested on my system (64 bit Linux).
It is working without problem.
Which platform you are using?
Do you have by chance some older JSROOT installed on your system?
Please try to compile 6-26 from scratch - seems to be not all JSROOT files were copied correctly to build directory. Error message you have was there before.
Hi Sergey, as you suggested I downloaded and compiled root from scratch, checking root7,webgui,qt5web in cmake-gui. This did the trick !! I modified the layout of your example prog and kept the names. I noted one curious behavor which I cannot explain. When I call “DrawGeometryInCanvas()” directly from the ExampleWidget constructor the drawing takes only a small portion of the TCanvasWidget and I get the message:
… rootscheme://root.server1/jsrootsys/scripts/JSRoot.gpad.js:2624: Hide canvas while geometry too small w=0 h=0
it seems that the widget dimensions are not known at that instance and in this case the program sets (small) default dimensions at JSRoot.gpad.js:2624.
I do not have this behaviour when I activate “DrawGeometryInCanvas()” with a pushbutton as you do in your example. This does however not disturb me and I’ very happy with the TCanvasWidget! Thank you !
Karl
Hi Sergey, as you mention,resize(parentWidget()->width(), parentWidget()->height()); does not help. also with the 6.26 branch I have no change. I don’t want to bother you forever with this issue. I’m sure you have more important things to do. I’m happy with the pushbutton activation, which works fine for me.
Cheers
Karl