I'm trying to write a simple function that draws ellipses at certain device locations as seen in my code below.
void theellipse(const mn:: Point deviceLocation,mn::SceneGraphicsView* m_sceneView,QColor lineColor,mn::GraphicsOverlay* ellipseGraphicOverlay, MapRay *thisF)
{
const mn::Point normalizedPt = mn::GeometryEngine::normalizeCentralMeridian(deviceLocation);
mn::GeodesicEllipseParameters parameters(/*angle*/90,mn::AngularUnit(mn::AngularUnitId::Degrees),normalizedPt,
/*unit*/ mn::LinearUnit(mn::LinearUnitId::Kilometers),
/*maxpointCount*/10,
/*maxSegmentLength*/10000,
/*geometryType*/mn::GeometryType::Polygon,
/*SemiAxislength*/120,
/*SemiAxisLength*/210);
ellipseGraphicOverlay->sceneProperties().setSurfacePlacement(mn::SurfacePlacement::Draped);
m_sceneView->graphicsOverlays()->append(ellipseGraphicOverlay);
mn::PolygonBuilder PolygonBuilder(m_sceneView->spatialReference());
PolygonBuilder.addPoint(deviceLocation);
mn::Polygon ellipse1= mn::GeometryEngine::ellipseGeodesic(parameters); It's not clear for me through looking at documentation how to turn geodesic ellipse parameters into scene symbols that are graphic layers. Any help would be much appreciated. Thanks. ~mike
Hi Mike,
You can use the type returned by ellipseGeodesic (in this case a Polygon) as the geometry for a Graphic and then add the graphic to the GraphicsOverlay. To symbolise the graphic in the overlay you can either set a Symbol directly or set a Renderer using a symbol for the entire overlay.
If you take a look at these two samples from our github repository you should see some examples of different approaches to displaying graphics:
this sample shows the use of symbols in a scene:
I hope that helps,
Luke
I will look into this.
Thanks Luke,
Mike