This commit is contained in:
NEDJIMAbelgacem 2022-01-02 19:58:45 +01:00 committed by Nyall Dawson
parent 89c661b35d
commit fb9084f93f
3 changed files with 135 additions and 2 deletions

View File

@ -0,0 +1,111 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/./3d/qgs3dviewsmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class Qgs3DViewsManager : QObject
{
%Docstring(signature="appended")
Manages storage of a set of 3D views.
:py:class:`QgsLayoutManager` handles the storage, serializing and deserializing
of 3D views. Usually this class is not constructed directly, but
rather accessed through a :py:class:`QgsProject` via :py:func:`QgsProject.viewsManager3D()`.
.. versionadded:: 3.24
%End
%TypeHeaderCode
#include "qgs3dviewsmanager.h"
%End
public:
explicit Qgs3DViewsManager( QgsProject *project );
%Docstring
Constructor for Qgs3DViewsManager. The project will become the parent object for this
manager.
%End
bool readXml( const QDomElement &element, const QDomDocument &doc );
%Docstring
Reads the manager's state from a DOM element, restoring all 3D views
present in the XML document
.. seealso:: :py:func:`writeXml`
%End
QDomElement writeXml( QDomDocument &doc ) const;
%Docstring
Returns a DOM element representing the state of the manager.
.. seealso:: :py:func:`readXml`
%End
void clear();
%Docstring
Removes and deletes all 3D views from the manager.
%End
QDomElement get3DViewSettings( const QString &name );
%Docstring
Returns the DOM element representing the settings of the 3D view named ``name``
%End
void register3DViewSettings( const QString &name, const QDomElement &dom );
%Docstring
Adds a new 3D view named ``name`` to the manager with the configuration DOM ``dom``
%End
QStringList get3DViewsNames();
%Docstring
Returns the names of all 3D views added to the manager
%End
QList<QDomElement> get3DViews();
%Docstring
Returns the list of configurations of 3D views added to the manager
%End
void remove3DView( const QString &name );
%Docstring
Removes the configuration of the 3D view named ``name``
%End
void rename3DView( const QString &oldTitle, const QString &newTitle );
%Docstring
Renames the 3D view named ``oldTitle`` to ``newTitle``
%End
void viewOpened( const QString &name );
%Docstring
Sets the configuration of the 3D view named ``name`` to being opened
%End
void viewClosed( const QString &name );
%Docstring
Sets the configuration of the 3D view named ``name`` to being closed
%End
signals:
void viewsListChanged();
%Docstring
Emitted when the views list has changed (whenever a 3D view was removed, added, renamed..)
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/./3d/qgs3dviewsmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -208,6 +208,7 @@
%Include auto_generated/./3d/qgs3dsymbolregistry.sip
%Include auto_generated/./3d/qgsabstract3dsymbol.sip
%Include auto_generated/./3d/qgsabstract3drenderer.sip
%Include auto_generated/./3d/qgs3dviewsmanager.sip
%Include auto_generated/annotations/qgsannotation.sip
%Include auto_generated/annotations/qgsannotationitem.sip
%Include auto_generated/annotations/qgsannotationitemeditoperation.sip

View File

@ -35,8 +35,6 @@ class QgsProject;
* of 3D views. Usually this class is not constructed directly, but
* rather accessed through a QgsProject via QgsProject::viewsManager3D().
*
* Qgs3DViewsManager retains ownership of all the 3d views contained
* in the manager.
* \since QGIS 3.24
*/
class CORE_EXPORT Qgs3DViewsManager : public QObject
@ -51,25 +49,48 @@ class CORE_EXPORT Qgs3DViewsManager : public QObject
*/
explicit Qgs3DViewsManager( QgsProject *project );
/**
* Reads the manager's state from a DOM element, restoring all 3D views
* present in the XML document
* \see writeXml()
*/
bool readXml( const QDomElement &element, const QDomDocument &doc );
/**
* Returns a DOM element representing the state of the manager.
* \see readXml()
*/
QDomElement writeXml( QDomDocument &doc ) const;
//! Removes and deletes all 3D views from the manager.
void clear();
//! Returns the DOM element representing the settings of the 3D view named \a name
QDomElement get3DViewSettings( const QString &name );
//! Adds a new 3D view named \a name to the manager with the configuration DOM \a dom
void register3DViewSettings( const QString &name, const QDomElement &dom );
//! Returns the names of all 3D views added to the manager
QStringList get3DViewsNames();
//! Returns the list of configurations of 3D views added to the manager
QList<QDomElement> get3DViews();
//! Removes the configuration of the 3D view named \a name
void remove3DView( const QString &name );
//! Renames the 3D view named \a oldTitle to \a newTitle
void rename3DView( const QString &oldTitle, const QString &newTitle );
//! Sets the configuration of the 3D view named \a name to being opened
void viewOpened( const QString &name );
//! Sets the configuration of the 3D view named \a name to being closed
void viewClosed( const QString &name );
signals:
//! Emitted when the views list has changed (whenever a 3D view was removed, added, renamed..)
void viewsListChanged();
private: