We have a 3D SceneGraphicsView and several GraphicOverlays on that view. We want to give priority to some certain type of Graphics when user clicks on it. When another Graphic overlaps with that certain type, we want that certain type of Graphic to be selected. How can we achieve this? If we could give Z value to a GraphicOverlay instead of a single Graphic that would be OK too.
Solved! Go to Solution.
Hi @FatmaAkdemir. Identify and Selection are two different operations. First you identify and you'll get a list of identified graphics. After that, you can decide which graphic(s) you want to select based on some criteria.
This is where the previous recommendation comes into play. If you organize your graphics into different overlays and only identify the ones from a specific overlay, you can select any/all graphics identified. This is a good strategy to organize "graphics to select" vs "other graphics". If your identified graphics could be in any overlay, then this becomes more difficult. When in 3D the distance to the camera plays a factor in which graphics will appear on top of each other, so that can be inconsistent in determining which graphic to select based on which graphic appeared on top at the moment of the identify operation.
https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-graphic.html#setZIndex
Hi @FatmaAkdemir. Unfortunately a z value will not help to prioritize which graphics are identified. The z values don't impact identify operations.
What you can do is organize the graphics you want to prioritize into a single graphics overlay and then use
GeoView::identifyGraphicsOverlay
and pass that specific overlay to make sure you only get results from that one. It will be trickier if you want to intersperse graphics in multiple graphics overlays and prioritize identifying certain graphics over others.
or
Thanks @JamesBallard1 , for the reply. What I wanted to ask is : When 2 or more Graphics overlap and user clicks on them, which one would be selected with mouse click? All of them or only the topmost one? And how can I assure that the one I want to be clicked is at the top?
Hi @FatmaAkdemir. Identify and Selection are two different operations. First you identify and you'll get a list of identified graphics. After that, you can decide which graphic(s) you want to select based on some criteria.
This is where the previous recommendation comes into play. If you organize your graphics into different overlays and only identify the ones from a specific overlay, you can select any/all graphics identified. This is a good strategy to organize "graphics to select" vs "other graphics". If your identified graphics could be in any overlay, then this becomes more difficult. When in 3D the distance to the camera plays a factor in which graphics will appear on top of each other, so that can be inconsistent in determining which graphic to select based on which graphic appeared on top at the moment of the identify operation.
https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-graphic.html#setZIndex