POST
|
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
... View more
04-18-2017
03:10 PM
|
0
|
2
|
941
|
POST
|
I was able to figure out my problem thanks to Lucas Danzinger's advice on graphics. A unique value renderer was not needed for our purposes (a simple renderer was used). Adding an attribute to the graphic with QVariantMap attr; was able to solve the issue. Thanks for the help Lucas Danzinger &norbert.thoden
... View more
03-16-2017
01:25 PM
|
0
|
1
|
950
|
POST
|
Thanks for this! I'm still having trouble understanding what I need to do to use the UniqueValueRenderer properly. My code now looks like this: void addLineOfSightToMapFunc(Point deviceLocation, Point satLocation,Esri::ArcGISRuntime::SceneGraphicsView* m_sceneView, QColor lineColor,QString uniqueString,mn::GraphicsOverlay* lineGraphicOverlay, MapRay *thisF ) { lineGraphicOverlay->sceneProperties().setSurfacePlacement(mn::SurfacePlacement::Absolute); lineGraphicOverlay->setSceneProperties(mn::LayerSceneProperties(mn::SurfacePlacement::Absolute)); m_sceneView->graphicsOverlays()->append(lineGraphicOverlay); // create line geometry mn::PolygonBuilder polylineBuilder(m_sceneView->spatialReference()); // build the polyline polylineBuilder.addPoint(deviceLocation.x,deviceLocation.y,deviceLocation.z); polylineBuilder.addPoint(satLocation.x,satLocation.y,satLocation.z); // tells renderer what type of symbol to use. mn::SimpleLineSymbol* SLS = new mn::SimpleLineSymbol(mn::SimpleLineSymbolStyle::Solid, lineColor, 5, thisF); // creates graphic from the polylineBuilder mn::Graphic* lineGraphic = new mn::Graphic(polylineBuilder.toGeometry(), thisF); // set the renderer of the graphic overlay to be the line symbol lineGraphicOverlay->setRenderer(new mn:: UniqueValueRenderer(SLS)); // add the graphic to the overlay lineGraphicOverlay->graphics()->append(lineGraphic);
}
I've been reading about how to use the UniqueValueRenderer and am having trouble understanding the "uniquevalue" aspect of the implementation. I'm trying to add Polylines that extend from the deviceLocation to the satLocation.
I'd like the lines to be different colors based on the variable lineColor within the code.
... View more
03-15-2017
12:07 PM
|
0
|
1
|
950
|
POST
|
Thanks! i'm still plugging away at it. Using different types of renderers is new to me.
... View more
03-09-2017
11:55 AM
|
0
|
0
|
950
|
POST
|
Hi QT SDK community, I'm looking to use a Unique Value Renderer in order to display different colored lines connecting from the ground to points in the sky. I have read ESRI's webpage about different rendering processes, and I think the Unique Value Renderer is what I need to be using. I've created a unique value denoted as "QString uniqueString", which I think I need as a unique ID in order to render properly. uniqueString contains unique values to the objects in the sky that I am trying to project lines from. "Qcolor lineColor" contain the unique colors that I want the lines to be. Below is the code I am using that does not compile. void addLineOfSightToMapFunc(Point deviceLocation, Point satLocation,Esri::ArcGISRuntime::SceneGraphicsView* m_sceneView, QColor lineColor,QString uniqueString,mn::GraphicsOverlay* lineGraphicOverlay, MapRay *thisF ) { mn::UniqueValueRenderer* LOS= new mn:: UniqueValueRenderer(thisF); // create a graphics overlay for the lines lineGraphicOverlay->sceneProperties().setSurfacePlacement(mn::SurfacePlacement::Absolute); lineGraphicOverlay->setSceneProperties(mn::LayerSceneProperties(mn::SurfacePlacement::Absolute)); // add the overlay to the mapview m_sceneView->graphicsOverlays()->append(LOS); // create line geometry mn::PolygonBuilder polylineBuilder(m_sceneView->spatialReference()); // build the polyline polylineBuilder.addPoint(deviceLocation.x,deviceLocation.y,deviceLocation.z); polylineBuilder.addPoint(satLocation.x,satLocation.y,satLocation.z); // tells renderer what type of symbol to use. mn::SimpleLineSymbol* sls = new mn::SimpleLineSymbol(mn::SimpleLineSymbolStyle::Solid, lineColor, 5, thisF); // creates graphic from the polylineBuilder mn::Graphic* lineGraphic = new mn::Graphic(polylineBuilder.toGeometry(), thisF); // set the renderer of the graphic overlay to be the line symbol lineGraphicOverlay->setRenderer(UniqueValueRenderer); // add the graphic to the overlay lineGraphicOverlay->graphics()->append(lineGraphic); } Any help would be greatly appreciated.
... View more
03-09-2017
10:35 AM
|
0
|
7
|
2082
|
POST
|
This is a general question about the best methods to draw features that update within a graphics layer. For instance, I am interested in drawing a line of sight line that changes direction through time as I move a Q-slider. Should I have a pointer to a graphics overlay that I create a new instance of each time I want to redraw the line? Or is there a more elegant method for redrawing on a map?
... View more
02-22-2017
10:01 AM
|
0
|
1
|
1350
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|