The QGLSceneFormatHandler class defines the common format I/O interface for loading 3D scene formats. More...
#include <QGLSceneFormatHandler>This class was introduced in Qt3D 4.8.
| QGLSceneFormatHandler () | |
| virtual | ~QGLSceneFormatHandler () |
| virtual void | decodeOptions ( const QString & options ) |
| QIODevice * | device () const |
| virtual QGLAbstractScene * | download () = 0 |
| void | downloadScene () |
| void | finalize () |
| QString | format () const |
| virtual QGLAbstractScene * | read () = 0 |
| void | setDevice ( QIODevice * device ) |
| void | setFormat ( const QString & format ) |
| void | setUrl ( const QUrl & url ) |
| QUrl | url () const |
| virtual void | downloadComplete ( QByteArray sceneData ) |
| QGLAbstractScene * | getScene () const |
| void | setScene ( QGLAbstractScene * theScene ) |
The QGLSceneFormatHandler class defines the common format I/O interface for loading 3D scene formats.
See also QGLSceneFormatPlugin.
Constructs a 3D scene format handler.
Destroys this 3D scene format handler.
Decodes and applies options to this handler. Generally this will be called by the QGLAbstractScene::loadScene() method prior to reading the model data with read() or download(). Exactly what the string value may contain and the meaning of the encoded options depends on each individual plugin.
This default implementation simply does nothing.
Returns the device currently assigned to the 3D scene format handler. Returns null if no device has been assigned.
See also setDevice().
Reads a 3D scene from a url and returns a stub to it which can be used the application, and will be updated with the full scene later.
Returns NULL if the scene could not be created.
This function should be called when the download of a remotely hosted scene is complete. The sceneData will contain the relevant data for the scene.
The user is required to reimplement this if they intend to support network loading of scenes in their plugin.
Initiates download of the specified scene. The scene must have been previously specified with URL, options, format, and so on. This function will then create a QGLAbstractDownloadManager instance and submit the network request for the scene.
The resultant data will be handled by the downloadComplete() slot.
Called at the end of the read() and download() functions, this function completes any extra cleanup required, and sets the QGLSceneFormatHandler it belongs to as being ready for deletion when the main event loop is next processed.
Returns the format that is currently assigned to this 3D scene format handler. Returns an empty string if no format has been assigned.
See also setFormat().
Get the pointer for the scene currently being processed. This is specifically used during network loading.
Reads a 3D scene from device() and returns it. Returns null if the format of device() is invalid and a scene could not be read.
Sets the device for this 3D scene format handler to device. The handler will use this device when reading 3D scenes.
The device can only be set once and must be set before calling read(). If you need to read multiple files, construct multiple instances of the appropriate QGLSceneFormatHandler subclass.
See also device().
Sets the format of this 3D scene format handler to format.
See also format().
Set the pointer for the scene theScene currently being processed. This is specifically used during network loading.
Sets the url of the data provided by device().
See also url().
Returns the url of the data provided by device(). This is typically used when the data in device() refers to additional files that need to be located relative to the original directory.
See also setUrl().