AnsweredAssumed Answered

graphics with height / extruded graphics

Question asked by norbert.thoden on Jun 2, 2017
Latest reply on Aug 23, 2017 by LSmallwood-esristaff

I like to create a cube on a graphicsOverlay in a sceneView (3D) - but without success.
I just can see the plane area drapped on the surface.

 

I don´t use QML but widget based approach.

 

What i did:

 

Create a scene, sceneView connect them and so...

 

    d->m_graphicsLayer->setSceneProperties(Esri::ArcGISRuntime::LayerSceneProperties(Esri::ArcGISRuntime::SurfacePlacement::Draped));


      const Esri::ArcGISRuntime::SpatialReference &sr = d->m_mapImpl->getEsriSpatialReference();


      // create 4 point for rectangle
      const Esri::ArcGISRuntime::Viewpoint &vp =
        d->m_mapGeoView->currentViewpoint(Esri::ArcGISRuntime::ViewpointType::CenterAndScale);
      const Esri::ArcGISRuntime::Point &mapCenter = static_cast<Esri::ArcGISRuntime::Point>(vp.targetGeometry());


      ...


      SituationMap::PositionCont posContTrans = ...;



      Esri::ArcGISRuntime::PolygonBuilder builder(sr, this);
      int z = 1000;
      builder.addPoint(Esri::ArcGISRuntime::Point(posContTrans[0].x(), posContTrans[0].y(), z, sr));
      builder.addPoint(Esri::ArcGISRuntime::Point(posContTrans[1].x(), posContTrans[1].y(), z, sr));
      builder.addPoint(Esri::ArcGISRuntime::Point(posContTrans[2].x(), posContTrans[2].y(), z, sr));
      builder.addPoint(Esri::ArcGISRuntime::Point(posContTrans[3].x(), posContTrans[3].y(), z, sr));


      qCritical() << " posContTrans=" << posContTrans[0];
      qCritical() << " posContTrans=" << posContTrans[1];
      qCritical() << " posContTrans=" << posContTrans[2];
      qCritical() << " posContTrans=" << posContTrans[3];


      Esri::ArcGISRuntime::SimpleFillSymbol* sls =
          new Esri::ArcGISRuntime::SimpleFillSymbol(Esri::ArcGISRuntime::SimpleFillSymbolStyle::Solid, Qt::red, this);


      Esri::ArcGISRuntime::SimpleRenderer *renderer = new Esri::ArcGISRuntime::SimpleRenderer(sls, this);
      Esri::ArcGISRuntime::RendererSceneProperties props = renderer->sceneProperties();
      props.setExtrusionMode(Esri::ArcGISRuntime::ExtrusionMode::BaseHeight);
      props.setExtrusionExpression(QLatin1String("height"));
      renderer->setSceneProperties(props);
      d->m_graphicsLayer->setRenderer(renderer);


      Esri::ArcGISRuntime::Graphic *graphic = new Esri::ArcGISRuntime::Graphic( Esri::ArcGISRuntime::Polygon(builder.toGeometry())Create , this);
      QVariantMap att = graphic->attributes()->attributesMap();
      att[QLatin1String("height")] = 1000000;


      d->m_graphicsLayer->graphics()->append(graphic);

 

I tried the RenderingMode::Static and also Dynamic.. No height is visible.

 

What is missing?

Can someone help me?

 

Thx

Norbert

Outcomes