<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qsceneloader.cpp --> <title>QSceneLoader Class | Qt 3D 5.9</title> <link rel="stylesheet" type="text/css" href="style/offline-simple.css" /> <script type="text/javascript"> document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css"); // loading style sheet breaks anchors that were jumped to before // so force jumping to anchor again setTimeout(function() { var anchor = location.hash; // need to jump to different anchor first (e.g. none) location.hash = "#"; setTimeout(function() { location.hash = anchor; }, 0); }, 0); </script> </head> <body> <div class="header" id="qtdocheader"> <div class="main"> <div class="main-rounded"> <div class="navigationbar"> <table><tr> <td >Qt 5.9</td><td ><a href="qt3d-index.html">Qt 3D</a></td><td ><a href="qt3d-cpp.html">C++ Classes</a></td><td >QSceneLoader</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td> </tr></table> </div> </div> <div class="content"> <div class="line"> <div class="content mainContent"> <div class="sidebar"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#public-types">Public Types</a></li> <li class="level1"><a href="#properties">Properties</a></li> <li class="level1"><a href="#public-functions">Public Functions</a></li> <li class="level1"><a href="#public-slots">Public Slots</a></li> <li class="level1"><a href="#signals">Signals</a></li> <li class="level1"><a href="#protected-functions">Protected Functions</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">QSceneLoader Class</h1> <span class="small-subtitle">(<a href="qt3drender-qsceneloader.html">Qt3DRender::QSceneLoader</a>)<br/></span> <!-- $$$QSceneLoader-brief --> <p>Provides the facility to load an existing Scene <a href="#details">More...</a></p> <!-- @@@QSceneLoader --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QSceneLoader></span> </td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += 3drender</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> Qt 5.7</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Instantiated By:</td><td class="memItemRight bottomAlign"> <a href="qml-qt3d-render-sceneloader.html">SceneLoader</a></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qt3dcore-qcomponent.html">Qt3DCore::QComponent</a></td></tr></table></div><ul> <li><a href="qt3drender-qsceneloader-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-types"></a> <h2 id="public-types">Public Types</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qt3drender-qsceneloader.html#ComponentType-enum">ComponentType</a></b> { UnknownComponent, GeometryRendererComponent, TransformComponent, MaterialComponent, LightComponent, CameraLensComponent }</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qt3drender-qsceneloader.html#Status-enum">Status</a></b> { None, Loading, Ready, Error }</td></tr> </table></div> <a name="properties"></a> <h2 id="properties">Properties</h2> <ul> <li class="fn"><b><a href="qt3drender-qsceneloader.html#source-prop">source</a></b> : QUrl</li> <li class="fn"><b><a href="qt3drender-qsceneloader.html#status-prop">status</a></b> : const Status</li> </ul> <ul> <li class="fn">1 property inherited from <a href="qt3dcore-qcomponent.html#properties">Qt3DCore::QComponent</a></li> <li class="fn">3 properties inherited from <a href="qt3dcore-qnode.html#properties">Qt3DCore::QNode</a></li> </ul> <a name="public-functions"></a> <h2 id="public-functions">Public Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qt3drender-qsceneloader.html#QSceneLoader">QSceneLoader</a></b>(Qt3DCore::QNode *<i>parent</i> = nullptr)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Qt3DCore::QComponent *</td><td class="memItemRight bottomAlign"><b><a href="qt3drender-qsceneloader.html#component">component</a></b>(const QString &<i>entityName</i>, ComponentType <i>componentType</i>) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Qt3DCore::QEntity *</td><td class="memItemRight bottomAlign"><b><a href="qt3drender-qsceneloader.html#entity">entity</a></b>(const QString &<i>entityName</i>) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qt3drender-qsceneloader.html#entityNames">entityNames</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qt3drender-qsceneloader.html#source-prop">source</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Status </td><td class="memItemRight bottomAlign"><b><a href="qt3drender-qsceneloader.html#status-prop">status</a></b>() const</td></tr> </table></div> <ul> <li class="fn">2 public functions inherited from <a href="qt3dcore-qcomponent.html#public-functions">Qt3DCore::QComponent</a></li> <li class="fn">11 public functions inherited from <a href="qt3dcore-qnode.html#public-functions">Qt3DCore::QNode</a></li> </ul> <a name="public-slots"></a> <h2 id="public-slots">Public Slots</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qt3drender-qsceneloader.html#source-prop">setSource</a></b>(const QUrl &<i>arg</i>)</td></tr> </table></div> <ul> <li class="fn">1 public slot inherited from <a href="qt3dcore-qcomponent.html#public-slots">Qt3DCore::QComponent</a></li> <li class="fn">3 public slots inherited from <a href="qt3dcore-qnode.html#public-slots">Qt3DCore::QNode</a></li> </ul> <a name="signals"></a> <h2 id="signals">Signals</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qt3drender-qsceneloader.html#source-prop">sourceChanged</a></b>(const QUrl &<i>source</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qt3drender-qsceneloader.html#status-prop">statusChanged</a></b>(Status <i>status</i>)</td></tr> </table></div> <ul> <li class="fn">3 signals inherited from <a href="qt3dcore-qcomponent.html#signals">Qt3DCore::QComponent</a></li> <li class="fn">4 signals inherited from <a href="qt3dcore-qnode.html#signals">Qt3DCore::QNode</a></li> </ul> <a name="protected-functions"></a> <h2 id="protected-functions">Protected Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qt3drender-qsceneloader.html#QSceneLoader-1">QSceneLoader</a></b>(QSceneLoaderPrivate &<i>dd</i>, Qt3DCore::QNode *<i>parent</i> = nullptr)</td></tr> </table></div> <ul> <li class="fn">2 protected functions inherited from <a href="qt3dcore-qnode.html#protected-functions">Qt3DCore::QNode</a></li> </ul> <a name="details"></a> <!-- $$$QSceneLoader-description --> <div class="descr"> <h2 id="details">Detailed Description</h2> <p>Provides the facility to load an existing Scene</p> <p>Given a 3D source file, the <a href="qt3drender-qsceneloader.html">Qt3DRender::QSceneLoader</a> will try to parse it and build a tree of <a href="qt3dcore-qentity.html">Qt3DCore::QEntity</a> objects with proper <a href="qt3drender-qgeometryrenderer.html">Qt3DRender::QGeometryRenderer</a>, <a href="qt3dcore-qtransform.html">Qt3DCore::QTransform</a> and <a href="qt3drender-qmaterial.html">Qt3DRender::QMaterial</a> components.</p> <p>The loader will try to determine the best material to be used based on the properties of the model file. If you wish to use a custom material, you will have to traverse the tree and replace the default associated materials with yours.</p> <p>As the name implies, <a href="qt3drender-qsceneloader.html">Qt3DRender::QSceneLoader</a> loads a complete scene subtree. If you wish to load a single piece of geometry, you should rather use the <a href="qt3drender-qmesh.html">Qt3DRender::QMesh</a> instead.</p> <p><a href="qt3drender-qsceneloader.html">Qt3DRender::QSceneLoader</a> internally relies on the use of plugins to support a wide variety of 3D file formats. <a href="http://www.assimp.org/main_features_formats.html">Here</a> is a list of formats that are supported by Qt3D.</p> <p><b>Note: </b>this component shouldn't be shared among several <a href="qt3dcore-qentity.html">Qt3DCore::QEntity</a> instances. Undefined behavior will result.</p></div> <p><b>See also </b><a href="qt3drender-qmesh.html">Qt3DRender::QMesh</a> and <a href="qt3drender-qgeometryrenderer.html">Qt3DRender::QGeometryRenderer</a>.</p> <!-- @@@QSceneLoader --> <div class="types"> <h2>Member Type Documentation</h2> <!-- $$$ComponentType$$$UnknownComponent$$$GeometryRendererComponent$$$TransformComponent$$$MaterialComponent$$$LightComponent$$$CameraLensComponent --> <h3 class="fn" id="ComponentType-enum"><a name="ComponentType-enum"></a>enum QSceneLoader::<span class="name">ComponentType</span></h3> <p>This enum specifies a component type.</p> <div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr> <tr><td class="topAlign"><code>Qt3DRender::QSceneLoader::UnknownComponent</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">Unknown component type</td></tr> <tr><td class="topAlign"><code>Qt3DRender::QSceneLoader::GeometryRendererComponent</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign"><a href="qt3drender-qgeometryrenderer.html">Qt3DRender::QGeometryRenderer</a> component</td></tr> <tr><td class="topAlign"><code>Qt3DRender::QSceneLoader::TransformComponent</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign"><a href="qt3dcore-qtransform.html">Qt3DCore::QTransform</a> component</td></tr> <tr><td class="topAlign"><code>Qt3DRender::QSceneLoader::MaterialComponent</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign"><a href="qt3drender-qmaterial.html">Qt3DRender::QMaterial</a> component</td></tr> <tr><td class="topAlign"><code>Qt3DRender::QSceneLoader::LightComponent</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign"><a href="qt3drender-qabstractlight.html">Qt3DRender::QAbstractLight</a> component</td></tr> <tr><td class="topAlign"><code>Qt3DRender::QSceneLoader::CameraLensComponent</code></td><td class="topAlign tblval"><code>5</code></td><td class="topAlign"><a href="qt3drender-qcameralens.html">Qt3DRender::QCameraLens</a> component</td></tr> </table></div> <!-- @@@ComponentType --> <!-- $$$Status$$$None$$$Loading$$$Ready$$$Error --> <h3 class="fn" id="Status-enum"><a name="Status-enum"></a>enum QSceneLoader::<span class="name">Status</span></h3> <p>This enum identifies the state of loading</p> <div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr> <tr><td class="topAlign"><code>Qt3DRender::QSceneLoader::None</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The <a href="qt3drender-qsceneloader.html">Qt3DRender::QSceneLoader</a> hasn't been used yet.</td></tr> <tr><td class="topAlign"><code>Qt3DRender::QSceneLoader::Loading</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The <a href="qt3drender-qsceneloader.html">Qt3DRender::QSceneLoader</a> is currently loading the scene file.</td></tr> <tr><td class="topAlign"><code>Qt3DRender::QSceneLoader::Ready</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The <a href="qt3drender-qsceneloader.html">Qt3DRender::QSceneLoader</a> successfully loaded the scene file.</td></tr> <tr><td class="topAlign"><code>Qt3DRender::QSceneLoader::Error</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">The <a href="qt3drender-qsceneloader.html">Qt3DRender::QSceneLoader</a> encountered an error while loading the scene file.</td></tr> </table></div> <!-- @@@Status --> </div> <div class="prop"> <h2>Property Documentation</h2> <!-- $$$source-prop$$$source$$$setSourceconstQUrl&$$$sourceChangedconstQUrl& --> <h3 class="fn" id="source-prop"><a name="source-prop"></a><span class="name">source</span> : <span class="type">QUrl</span></h3> <p>Holds the url to the source to be loaded.</p> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> QUrl </td><td class="memItemRight bottomAlign"><span class="name"><b>source</b></span>() const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setSource</b></span>(const QUrl &<i>arg</i>)</td></tr> </table></div> <p><b>Notifier signal:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>sourceChanged</b></span>(const QUrl &<i>source</i>)</td></tr> </table></div> <!-- @@@source --> <!-- $$$status-prop$$$status$$$statusChangedStatus --> <h3 class="fn" id="status-prop"><a name="status-prop"></a><span class="name">status</span> : const <span class="type"><a href="qt3drender-qsceneloader.html#Status-enum">Status</a></span></h3> <p>Holds the status of scene loading.</p> <ul> <li><a href="qml-qt3d-render-sceneloader.html">SceneLoader</a>.None</li> <li><a href="qml-qt3d-render-sceneloader.html">SceneLoader</a>.Loading</li> <li><a href="qml-qt3d-render-sceneloader.html">SceneLoader</a>.Ready</li> <li><a href="qml-qt3d-render-sceneloader.html">SceneLoader</a>.Error</li> </ul> <p><b>Access functions:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> Status </td><td class="memItemRight bottomAlign"><span class="name"><b>status</b></span>() const</td></tr> </table></div> <p><b>Notifier signal:</b></p> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>statusChanged</b></span>(Status <i>status</i>)</td></tr> </table></div> <p><b>See also </b><a href="qt3drender-qsceneloader.html#Status-enum">Qt3DRender::QSceneLoader::Status</a>.</p> <!-- @@@status --> </div> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QSceneLoader[overload1]$$$QSceneLoaderQt3DCore::QNode* --> <h3 class="fn" id="QSceneLoader"><a name="QSceneLoader"></a>QSceneLoader::<span class="name">QSceneLoader</span>(<span class="type">Qt3DCore::QNode</span> *<i>parent</i> = nullptr)</h3> <p>Default constructs an instance of QSceneLoader.</p><!-- @@@QSceneLoader --> <!-- $$$QSceneLoader$$$QSceneLoaderQSceneLoaderPrivate&Qt3DCore::QNode* --> <h3 class="fn" id="QSceneLoader-1"><a name="QSceneLoader-1"></a><code>[protected] </code>QSceneLoader::<span class="name">QSceneLoader</span>(<span class="type">QSceneLoaderPrivate</span> &<i>dd</i>, <span class="type">Qt3DCore::QNode</span> *<i>parent</i> = nullptr)</h3> <p>Copy constructor.</p><!-- @@@QSceneLoader --> <!-- $$$component[overload1]$$$componentconstQString&ComponentType --> <h3 class="fn" id="component"><a name="component"></a><span class="type">Qt3DCore::QComponent</span> *QSceneLoader::<span class="name">component</span>(const <span class="type">QString</span> &<i>entityName</i>, <span class="type"><a href="qt3drender-qsceneloader.html#ComponentType-enum">ComponentType</a></span> <i>componentType</i>) const</h3> <p>Returns a component matching <i>componentType</i> of a loaded entity with an objectName matching the <i>entityName</i>. If the entity has multiple matching components, the first match in the component list of the entity is returned. If there is no match, a null pointer is returned.</p> <!-- @@@component --> <!-- $$$entity[overload1]$$$entityconstQString& --> <h3 class="fn" id="entity"><a name="entity"></a><span class="type">Qt3DCore::QEntity</span> *QSceneLoader::<span class="name">entity</span>(const <span class="type">QString</span> &<i>entityName</i>) const</h3> <p>Returns a loaded entity with an <code>objectName</code> matching the <i>entityName</i> parameter. If multiple entities have the same name, it is undefined which one of them is returned, but it will always be the same one.</p> <!-- @@@entity --> <!-- $$$entityNames[overload1]$$$entityNames --> <h3 class="fn" id="entityNames"><a name="entityNames"></a><span class="type">QStringList</span> QSceneLoader::<span class="name">entityNames</span>() const</h3> <p>Returns a list of the <code>objectNames</code> of the loaded entities.</p> <!-- @@@entityNames --> </div> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.<br> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. </p> </div> </body> </html>