|
Aeon Engine c550894
AeonGames Open Source Game Engine
|
Item model representing a scene's node tree for Qt views. More...
#include <C:/Code/AeonEngine/tools/worldeditor/models/SceneModel.h>


Public Member Functions | |
| SceneModel (QObject *parent=nullptr) | |
| Construct the scene model. | |
| virtual | ~SceneModel () |
| Destructor. | |
Qt QAbstractItemModel overrides | |
| QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
| Return the index of the item at the given row and column under parent. | |
| QModelIndex | parent (const QModelIndex &index) const override |
| Return the parent of the given model index. | |
| int | rowCount (const QModelIndex &index=QModelIndex()) const override |
| Return the number of rows under the given parent. | |
| int | columnCount (const QModelIndex &index=QModelIndex()) const override |
| Return the number of columns for children of the given parent. | |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| Return the data for the given index and role. | |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
| Return the header data for the given section, orientation, and role. | |
| bool | hasChildren (const QModelIndex &index=QModelIndex()) const override |
| Return whether the given parent index has any children. | |
| Qt::ItemFlags | flags (const QModelIndex &index) const override |
| Return the item flags for the given model index. | |
| bool | setData (const QModelIndex &index, const QVariant &value, int role) override |
| Set the data for the given index and role. | |
| bool | moveRows (const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationRow) override |
| Move rows from one parent to another. | |
| Qt::DropActions | supportedDropActions () const override |
| Return the drop actions supported by this model. | |
| bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override |
| Handle data supplied by a drag-and-drop operation. | |
| QMimeData * | mimeData (const QModelIndexList &indexes) const override |
| Return serialized MIME data for the given model indexes. | |
| QStringList | mimeTypes () const override |
| Return the list of MIME types that can be used to describe model indexes. | |
| void | InsertNode (int row, const QModelIndex &parent=QModelIndex(), std::unique_ptr< Node > aNode={}) |
| Insert a node into the scene tree. | |
| void | RemoveNode (int row, const QModelIndex &parent=QModelIndex()) |
| Remove a node from the scene tree. | |
| void | SetCameraNode (const QModelIndex &index=QModelIndex()) |
| Set the camera to the node at the given index. | |
| std::string | Serialize (bool aAsBinary=true) const |
| Serialize the scene to a string. | |
| void | Deserialize (const std::string &aSerializedScene) |
| Deserialize a scene from a string. | |
| const Scene & | GetScene () const |
| Get a const reference to the underlying scene. | |
Item model representing a scene's node tree for Qt views.
Definition at line 27 of file SceneModel.h.
| AeonGames::SceneModel::SceneModel | ( | QObject * | parent = nullptr | ) |
Construct the scene model.
| parent | Parent QObject. |
Definition at line 30 of file SceneModel.cpp.
|
override |
Return the number of columns for children of the given parent.
| index | Parent model index. |
Definition at line 93 of file SceneModel.cpp.
|
override |
Return the data for the given index and role.
Definition at line 107 of file SceneModel.cpp.
| void AeonGames::SceneModel::Deserialize | ( | const std::string & | aSerializedScene | ) |
Deserialize a scene from a string.
| aSerializedScene | Serialized scene data. |
Definition at line 341 of file SceneModel.cpp.
|
override |
Handle data supplied by a drag-and-drop operation.
| data | MIME data from the drop. |
| action | The drop action performed. |
| row | Target row. |
| column | Target column. |
| parent | Parent model index. |
Definition at line 235 of file SceneModel.cpp.
|
override |
Return the item flags for the given model index.
Definition at line 136 of file SceneModel.cpp.
| const Scene & AeonGames::SceneModel::GetScene | ( | ) | const |
Get a const reference to the underlying scene.
Definition at line 348 of file SceneModel.cpp.
|
override |
Return whether the given parent index has any children.
| index | Parent model index. |
Definition at line 98 of file SceneModel.cpp.
|
override |
Return the header data for the given section, orientation, and role.
| section | Header section index. |
| orientation | Horizontal or vertical header. |
| role | Data role. |
Definition at line 35 of file SceneModel.cpp.
|
override |
Return the index of the item at the given row and column under parent.
| row | Row number. |
| column | Column number. |
| parent | Parent model index. |
Definition at line 50 of file SceneModel.cpp.
| void AeonGames::SceneModel::InsertNode | ( | int | row, |
| const QModelIndex & | parent = QModelIndex(), | ||
| std::unique_ptr< Node > | aNode = {} ) |
Insert a node into the scene tree.
| row | Row position for the new node. |
| parent | Parent model index. |
| aNode | Optional node to insert; a default node is created if empty. |
Definition at line 294 of file SceneModel.cpp.
|
override |
Return serialized MIME data for the given model indexes.
| indexes | List of model indexes to serialize. |
Definition at line 266 of file SceneModel.cpp.
|
override |
Return the list of MIME types that can be used to describe model indexes.
Definition at line 287 of file SceneModel.cpp.
|
override |
Move rows from one parent to another.
| sourceParent | Parent index of the source rows. |
| sourceRow | Starting row to move. |
| count | Number of rows to move. |
| destinationParent | Parent index of the destination. |
| destinationRow | Destination row position. |
Definition at line 157 of file SceneModel.cpp.
|
override |
Return the parent of the given model index.
| index | The child model index. |
Definition at line 70 of file SceneModel.cpp.
| void AeonGames::SceneModel::RemoveNode | ( | int | row, |
| const QModelIndex & | parent = QModelIndex() ) |
Remove a node from the scene tree.
| row | Row position of the node to remove. |
| parent | Parent model index. |
Definition at line 308 of file SceneModel.cpp.
|
override |
Return the number of rows under the given parent.
| index | Parent model index. |
Definition at line 84 of file SceneModel.cpp.
| std::string AeonGames::SceneModel::Serialize | ( | bool | aAsBinary = true | ) | const |
Serialize the scene to a string.
| aAsBinary | If true, serialize as binary; otherwise as text. |
Definition at line 336 of file SceneModel.cpp.
| void AeonGames::SceneModel::SetCameraNode | ( | const QModelIndex & | index = QModelIndex() | ) |
Set the camera to the node at the given index.
Definition at line 322 of file SceneModel.cpp.
|
override |
Set the data for the given index and role.
Definition at line 145 of file SceneModel.cpp.
|
override |
Return the drop actions supported by this model.
Definition at line 230 of file SceneModel.cpp.