Used to display point or multipoint geoelements in a scene using a 3D model. More...
Header: | #include <ModelSceneSymbol.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | Esri::ArcGISRuntime::MarkerSceneSymbol, Esri::ArcGISRuntime::Loadable, and Esri::ArcGISRuntime::RemoteResource |
Public Functions
ModelSceneSymbol(const QUrl &url, QObject *parent = nullptr) | |
ModelSceneSymbol(const QUrl &url, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr) | |
ModelSceneSymbol(const QUrl &url, float scale, QObject *parent = nullptr) | |
ModelSceneSymbol(const QUrl &url, Esri::ArcGISRuntime::Credential *credential, float scale, QObject *parent = nullptr) | |
virtual | ~ModelSceneSymbol() override |
float | scale() const |
void | setSymbolSizeUnits(Esri::ArcGISRuntime::SymbolSizeUnits sizeUnits) |
Esri::ArcGISRuntime::SymbolSizeUnits | symbolSizeUnits() const |
Reimplemented Public Functions
virtual void | cancelLoad() override |
virtual Esri::ArcGISRuntime::Credential * | credential() const override |
virtual void | load() override |
virtual Esri::ArcGISRuntime::Error | loadError() const override |
virtual Esri::ArcGISRuntime::LoadStatus | loadStatus() const override |
virtual Esri::ArcGISRuntime::RequestConfiguration | requestConfiguration() const override |
virtual void | retryLoad() override |
virtual void | setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration) override |
virtual QUrl | url() const override |
Signals
void | doneLoading(const Esri::ArcGISRuntime::Error &loadError) |
void | loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus) |
Detailed Description
By default, the symbol will be positioned using the centroid of the model object. Note that this may not be the same as the center of its bounding extent. Model scene symbols cannot be used with a static graphics rendering mode (GraphicsRenderingMode::Static).
The supported model file types are:
- 3D Max (.3ds)
- Collada (.dae)
- Filmbox (.fbx)
- GL Transmission Format (.gltf, .glb)
- Wavefront (.obj)
Depending on the model's default orientation, you may have to change the heading, pitch, and roll of the symbol to display the model in the desired orientation.
Example:
Create a ModelSceneSymbol from a *.dae file:
constexpr float scale = 5.0f; ModelSceneSymbol* mms = new ModelSceneSymbol(QUrl(dataPath), scale, this); mms->setHeading(180);
Relevant samples:
- Animate 3D symbols: Demonstrates how to animate a graphic's position and rotation and follow it using a `OrbitGeoElementCameraController`.
- Viewshed (GeoElement): Analyze the viewshed for an object (GeoElement) in a scene.
See also MarkerSceneSymbol and Symbol.
Member Function Documentation
[explicit]
ModelSceneSymbol::ModelSceneSymbol (const QUrl &url, QObject *parent = nullptr)
Creates a model scene symbol from a URL to a 3D model file.
- url - URL of the 3D model file.
- parent - The optional parent QObject.
ModelSceneSymbol::ModelSceneSymbol (const QUrl &url, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)
Constructs a model scene symbol by providing a url, credential, and an optional parent.
ModelSceneSymbol::ModelSceneSymbol (const QUrl &url, float scale, QObject *parent = nullptr)
Creates a model scene symbol from a URL to a 3D model file along with a scale.
- url - URL of the 3D model file.
- scale - Scaling factor to apply to the model.
- parent - The optional parent QObject.
ModelSceneSymbol::ModelSceneSymbol (const QUrl &url, Esri::ArcGISRuntime::Credential *credential, float scale, QObject *parent = nullptr)
Constructs a model scene symbol by providing a url, credential, scale factor, and an optional parent.
[override virtual]
ModelSceneSymbol::~ModelSceneSymbol ()
Destructor.
[override virtual]
void ModelSceneSymbol::cancelLoad ()
Reimplements: Loadable::cancelLoad().
See Loadable.
[override virtual]
Esri::ArcGISRuntime::Credential *ModelSceneSymbol::credential() const
Reimplements: RemoteResource::credential() const.
Returns the security credentials to access the remote resource. Only applicable if the resource is secured.
[signal]
void ModelSceneSymbol::doneLoading (const Esri::ArcGISRuntime::Error &loadError )
Signal emitted when this object is done loading.
- loadError - Details about any error that may have occurred.
Note: If there is a load error it will also be emitted on the errorOccurred
signal.
[override virtual]
void ModelSceneSymbol::load()
Reimplements: Loadable::load().
Loads the metadata for the object asynchronously.
[override virtual]
Esri::ArcGISRuntime::Error ModelSceneSymbol::loadError () const
Reimplements: Loadable::loadError() const.
See Loadable.
[override virtual]
Esri::ArcGISRuntime::LoadStatus ModelSceneSymbol::loadStatus () const
Reimplements: Loadable::loadStatus() const.
Returns the load status.
See also LoadStatus.
[signal]
void ModelSceneSymbol::loadStatusChanged (Esri::ArcGISRuntime::LoadStatus loadStatus )
Signal emitted when the load status changes for this object.
- loadStatus - The LoadStatus.
See also Loadable.
[override virtual, since Esri::ArcGISRuntime 100.1]
Esri::ArcGISRuntime::RequestConfiguration ModelSceneSymbol::requestConfiguration () const
Reimplements: RemoteResource::requestConfiguration() const.
Returns the RequestConfiguration in use by this symbol.
This function was introduced in Esri::ArcGISRuntime 100.1.
See also setRequestConfiguration().
[override virtual]
void ModelSceneSymbol::retryLoad ()
Reimplements: Loadable::retryLoad().
Loads or retries loading metadata for the object asynchronously.
Will retry loading the metadata if the object is failed to load. Will load the object if it is not loaded. Will not retry to load the object if the object is loaded. Will always call the done loading if this is called.
float ModelSceneSymbol::scale() const
Returns the scale factor of the symbol.
[override virtual, since Esri::ArcGISRuntime 100.1]
void ModelSceneSymbol::setRequestConfiguration (const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration )
Reimplements: RemoteResource::setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration).
Sets configuration parameters used for network requests sent by this symbol to requestConfiguration.
This function was introduced in Esri::ArcGISRuntime 100.1.
See also requestConfiguration().
[since Esri::ArcGISRuntime 100.5]
void ModelSceneSymbol::setSymbolSizeUnits (Esri::ArcGISRuntime::SymbolSizeUnits sizeUnits )
Sets the symbol size units of the model symbol using the specified sizeUnits.
Default is SymbolSizeUnits::Meters
Renders the symbol by interpreting the size values as DIPs or Meters.
This function was introduced in Esri::ArcGISRuntime 100.5.
See also symbolSizeUnits().
[since Esri::ArcGISRuntime 100.5]
Esri::ArcGISRuntime::SymbolSizeUnits ModelSceneSymbol::symbolSizeUnits () const
Returns the symbol size units of the model symbol.
The default value is SymbolSizeUnits::Meters.
This function was introduced in Esri::ArcGISRuntime 100.5.
See also setSymbolSizeUnits().
[override virtual]
QUrl ModelSceneSymbol::url() const
Reimplements: RemoteResource::url() const.
Returns the url of the symbol.