We have a ruler Graphic Item on SceneGraphicView consisting of 2 points and a line between these points. When one of these points has a significant altitude value, the line is drawn. Otherwise line stays behind the map at some sections.(See attachment) How can I force the ruler to be drawn at very top regardless of the altitude values of the endpoints? By the way I don't want the ruler line to be Draped because it's a 3D line.
Solved! Go to Solution.
Thanks @LucasDanzinger . I solved the issue by adding an offset to the altitude of the vertices of the ruler. After all rulers are raised by some amount, the lines did not disappear. The point I don't understand is why the vertices didn't disappear i.e. stay behind the map just like the lines? The problem does not concern single Graphics, it concerns only lines as far as I see.
Absolute mode will draw the graphic at whatever the z value of the feature is. I understand you don't want draped mode - could you instead use relative mode, which will display at a relative value above the surface? This sample demonstrates the different options - https://github.com/Esri/arcgis-runtime-samples-qt/tree/main/ArcGISRuntimeSDKQt_CppSamples/Scenes/Sur...
Also, here is the surface placement documentation - https://developers.arcgis.com/qt/cpp/api-reference/sceneviewtypes-h.html#SurfacePlacement-enum
The main difference is that your polyline's vertices need to have a z value defined
Thanks @LucasDanzinger, I will try the Relative mode. By the way, when saying z value should I interpret it as the altitude of a Geometry or the drawing order?
I meant altitude of the Geometry. The actual zIndex of the Graphic has differing behavior depending on whether it is 2D or 3D and whether it is static or dynamic rendering mode. More details on that are found here https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-graphic.html#setZIndex
Thanks @LucasDanzinger . I solved the issue by adding an offset to the altitude of the vertices of the ruler. After all rulers are raised by some amount, the lines did not disappear. The point I don't understand is why the vertices didn't disappear i.e. stay behind the map just like the lines? The problem does not concern single Graphics, it concerns only lines as far as I see.
My only thought would be that if you have a line segment with a start and end point, if they are far enough from each other, the line could cross through the surface near the center. If this is the issue, one possible solution would be to densify the line to add more vertices on the line https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-geometryengine.html#densifyGeo...