Ruler line stays under Basemap when we set SurfacePlacement::Absolute

1272
5
Jump to solution
08-24-2021 06:53 AM
FatmaAkdemir
Occasional Contributor II

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.

1 Solution

Accepted Solutions
FatmaAkdemir
Occasional Contributor II

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.

View solution in original post

0 Kudos
5 Replies
LucasDanzinger
Esri Frequent Contributor

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

0 Kudos
FatmaAkdemir
Occasional Contributor II

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?

0 Kudos
LucasDanzinger
Esri Frequent Contributor

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 

0 Kudos
FatmaAkdemir
Occasional Contributor II

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.

0 Kudos
LucasDanzinger
Esri Frequent Contributor

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...