Select to view content in your preferred language

Polyline with altitude over scene and scnesymbols.

375
1
09-21-2020 02:23 AM
GirishchandraY
Emerging Contributor

Hello Team,

Is it possible to draw a line with set of points having certain z value over scene?

I tried but line 

Thank you,

Girish

0 Kudos
1 Reply
LucasDanzinger
Esri Frequent Contributor

Yes, you can use a Tube symbol in Dynamic mode. Here is some code to get you on the right track:

GraphicsOverlay* overlay = new GraphicsOverlay(this);
overlay->setRenderingMode(GraphicsRenderingMode::Dynamic);
auto sceneProps = overlay->sceneProperties();
sceneProps.setSurfacePlacement(SurfacePlacement::Absolute);
overlay->setSceneProperties(sceneProps);
m_sceneView->graphicsOverlays()->append(overlay);

PolylineBuilder* pb = new PolylineBuilder(SpatialReference::wgs84(), this);
pb->addPoint(0,0,0);
pb->addPoint(1,1,20000);
pb->addPoint(1.5,1.5,10000);
pb->addPoint(1.75,1.75,0);

SolidStrokeSymbolLayer* strokeSymbolLayer = new SolidStrokeSymbolLayer(5000, QColor("red"), {}, StrokeSymbolLayerLineStyle3D::Tube);
MultilayerPolylineSymbol* tubeSymbol = new MultilayerPolylineSymbol({strokeSymbolLayer}, this);

Graphic* graphic = new Graphic(this);
graphic->setGeometry(pb->toGeometry());
graphic->setSymbol(tubeSymbol);
overlay->graphics()->append(graphic);

0 Kudos