1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-20 16:53:55 +00:00
openmw/apps/opencs/view/render/unpagedworldspacewidget.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

146 lines
4.3 KiB
C++
Raw Normal View History

#ifndef OPENCS_VIEW_UNPAGEDWORLDSPACEWIDGET_H
#define OPENCS_VIEW_UNPAGEDWORLDSPACEWIDGET_H
#include <memory>
2014-03-06 12:02:21 +00:00
#include <string>
2022-10-19 17:02:00 +00:00
#include <vector>
#include <apps/opencs/model/world/universalid.hpp>
#include <apps/opencs/view/render/instancedragmodes.hpp>
#include <osg/Vec3d>
2014-03-06 12:02:21 +00:00
#include "cell.hpp"
#include "worldspacewidget.hpp"
2014-03-06 12:02:21 +00:00
class QModelIndex;
2022-10-19 17:02:00 +00:00
class QObject;
class QWidget;
namespace osg
{
class Vec3f;
template <class T>
class ref_ptr;
}
2014-03-06 12:02:21 +00:00
namespace CSMDoc
{
class Document;
}
2022-10-19 17:02:00 +00:00
namespace CSVWidget
{
class SceneToolToggle2;
}
2014-03-06 12:02:21 +00:00
namespace CSMWorld
{
class IdTable;
2019-09-11 09:59:15 +00:00
class CellCoordinates;
2014-03-06 12:02:21 +00:00
}
namespace CSVRender
{
2022-10-19 17:02:00 +00:00
class TagBase;
class UnpagedWorldspaceWidget : public WorldspaceWidget
{
Q_OBJECT
2014-03-06 12:02:21 +00:00
CSMDoc::Document& mDocument;
std::string mCellId;
CSMWorld::IdTable* mCellsModel;
2014-05-03 12:00:30 +00:00
CSMWorld::IdTable* mReferenceablesModel;
std::unique_ptr<Cell> mCell;
2014-03-06 12:02:21 +00:00
void update();
2022-09-22 18:26:05 +00:00
public:
UnpagedWorldspaceWidget(const std::string& cellId, CSMDoc::Document& document, QWidget* parent);
2014-05-01 13:09:47 +00:00
dropRequirments getDropRequirements(DropType type) const override;
2016-05-16 21:03:00 +00:00
/// \return Drop handled?
bool handleDrop(const std::vector<CSMWorld::UniversalId>& data, DropType type) override;
2016-05-16 21:03:00 +00:00
/// \param elementMask Elements to be affected by the clear operation
void clearSelection(int elementMask) override;
/// \param elementMask Elements to be affected by the select operation
void invertSelection(int elementMask) override;
/// \param elementMask Elements to be affected by the select operation
void selectAll(int elementMask) override;
// Select everything that references the same ID as at least one of the elements
// already selected
2022-09-22 18:26:05 +00:00
//
/// \param elementMask Elements to be affected by the select operation
void selectAllWithSameParentId(int elementMask) override;
void selectInsideCube(const osg::Vec3d& pointA, const osg::Vec3d& pointB, DragMode dragMode) override;
void selectWithinDistance(const osg::Vec3d& point, float distance, DragMode dragMode) override;
std::string getCellId(const osg::Vec3f& point) const override;
2019-09-11 09:59:15 +00:00
Cell* getCell(const osg::Vec3d& point) const override;
Cell* getCell(const CSMWorld::CellCoordinates& coords) const override;
2016-02-16 15:02:29 +00:00
2022-11-04 22:04:42 +00:00
osg::ref_ptr<TagBase> getSnapTarget(unsigned int elementMask) const override;
std::vector<osg::ref_ptr<TagBase>> getSelection(unsigned int elementMask) const override;
2016-03-01 14:48:34 +00:00
void selectGroup(const std::vector<std::string> group) const override;
void unhideAll() const override;
std::vector<osg::ref_ptr<TagBase>> getEdited(unsigned int elementMask) const override;
2016-03-04 14:19:26 +00:00
void setSubMode(int subMode, unsigned int elementMask) override;
/// Erase all overrides and restore the visual representation to its true state.
void reset(unsigned int elementMask) override;
private:
void referenceableDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) override;
void referenceableAboutToBeRemoved(const QModelIndex& parent, int start, int end) override;
void referenceableAdded(const QModelIndex& index, int start, int end) override;
void referenceDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) override;
void referenceAboutToBeRemoved(const QModelIndex& parent, int start, int end) override;
void referenceAdded(const QModelIndex& index, int start, int end) override;
2016-05-03 02:08:49 +00:00
void pathgridDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) override;
2016-05-03 02:08:49 +00:00
void pathgridAboutToBeRemoved(const QModelIndex& parent, int start, int end) override;
2016-05-03 02:08:49 +00:00
void pathgridAdded(const QModelIndex& parent, int start, int end) override;
std::string getStartupInstruction() override;
2022-09-22 18:26:05 +00:00
protected:
void addVisibilitySelectorButtons(CSVWidget::SceneToolToggle2* tool) override;
2014-03-06 12:02:21 +00:00
private slots:
void cellDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
void cellRowsAboutToBeRemoved(const QModelIndex& parent, int start, int end);
2014-05-01 13:09:47 +00:00
2017-08-19 23:36:45 +00:00
void assetTablesChanged();
2014-05-01 13:09:47 +00:00
signals:
2014-05-03 12:00:30 +00:00
void cellChanged(const CSMWorld::UniversalId& id);
};
}
#endif