2014-03-06 09:13:39 +00:00
|
|
|
#ifndef OPENCS_VIEW_UNPAGEDWORLDSPACEWIDGET_H
|
|
|
|
#define OPENCS_VIEW_UNPAGEDWORLDSPACEWIDGET_H
|
|
|
|
|
2014-03-06 12:02:21 +00:00
|
|
|
#include <string>
|
2014-06-29 12:19:10 +00:00
|
|
|
#include <memory>
|
2014-03-06 12:02:21 +00:00
|
|
|
|
2014-03-06 09:13:39 +00:00
|
|
|
#include "worldspacewidget.hpp"
|
2014-06-29 12:19:10 +00:00
|
|
|
#include "cell.hpp"
|
2014-03-06 09:13:39 +00:00
|
|
|
|
2014-03-06 12:02:21 +00:00
|
|
|
class QModelIndex;
|
|
|
|
|
|
|
|
namespace CSMDoc
|
|
|
|
{
|
|
|
|
class Document;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace CSMWorld
|
|
|
|
{
|
|
|
|
class IdTable;
|
|
|
|
}
|
|
|
|
|
2014-03-06 09:13:39 +00:00
|
|
|
namespace CSVRender
|
|
|
|
{
|
|
|
|
class UnpagedWorldspaceWidget : public WorldspaceWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2016-05-03 02:08:49 +00:00
|
|
|
CSMDoc::Document& mDocument;
|
2014-03-06 12:02:21 +00:00
|
|
|
std::string mCellId;
|
|
|
|
CSMWorld::IdTable *mCellsModel;
|
2014-06-29 12:19:10 +00:00
|
|
|
CSMWorld::IdTable *mReferenceablesModel;
|
2017-04-28 15:30:26 +00:00
|
|
|
std::unique_ptr<Cell> mCell;
|
2014-03-06 12:02:21 +00:00
|
|
|
|
|
|
|
void update();
|
|
|
|
|
2014-03-06 09:13:39 +00:00
|
|
|
public:
|
|
|
|
|
2014-03-06 12:02:21 +00:00
|
|
|
UnpagedWorldspaceWidget (const std::string& cellId, CSMDoc::Document& document,
|
2014-05-03 12:00:30 +00:00
|
|
|
QWidget *parent);
|
2014-03-06 12:02:21 +00:00
|
|
|
|
2014-09-11 09:27:56 +00:00
|
|
|
virtual dropRequirments getDropRequirements(DropType type) const;
|
2014-05-01 16:25:28 +00:00
|
|
|
|
2014-09-11 11:04:20 +00:00
|
|
|
/// \return Drop handled?
|
|
|
|
virtual bool handleDrop (const std::vector<CSMWorld::UniversalId>& data,
|
|
|
|
DropType type);
|
2014-05-01 13:09:47 +00:00
|
|
|
|
2015-09-29 11:48:04 +00:00
|
|
|
/// \param elementMask Elements to be affected by the clear operation
|
|
|
|
virtual void clearSelection (int elementMask);
|
|
|
|
|
2016-05-16 21:03:00 +00:00
|
|
|
/// \param elementMask Elements to be affected by the select operation
|
|
|
|
virtual void invertSelection (int elementMask);
|
|
|
|
|
2016-01-19 13:25:20 +00:00
|
|
|
/// \param elementMask Elements to be affected by the select operation
|
|
|
|
virtual void selectAll (int elementMask);
|
|
|
|
|
2016-01-26 10:31:37 +00:00
|
|
|
// Select everything that references the same ID as at least one of the elements
|
|
|
|
// already selected
|
|
|
|
//
|
|
|
|
/// \param elementMask Elements to be affected by the select operation
|
|
|
|
virtual void selectAllWithSameParentId (int elementMask);
|
|
|
|
|
2016-01-10 07:56:15 +00:00
|
|
|
virtual std::string getCellId (const osg::Vec3f& point) const;
|
|
|
|
|
2016-05-16 21:20:07 +00:00
|
|
|
virtual Cell* getCell(const osg::Vec3d& point) const;
|
|
|
|
|
2016-01-25 13:55:02 +00:00
|
|
|
virtual std::vector<osg::ref_ptr<TagBase> > getSelection (unsigned int elementMask)
|
|
|
|
const;
|
|
|
|
|
2016-02-16 15:02:29 +00:00
|
|
|
virtual std::vector<osg::ref_ptr<TagBase> > getEdited (unsigned int elementMask)
|
|
|
|
const;
|
|
|
|
|
2016-03-01 14:48:34 +00:00
|
|
|
virtual void setSubMode (int subMode, unsigned int elementMask);
|
|
|
|
|
2016-03-04 14:19:26 +00:00
|
|
|
/// Erase all overrides and restore the visual representation to its true state.
|
|
|
|
virtual void reset (unsigned int elementMask);
|
|
|
|
|
2014-06-29 12:19:10 +00:00
|
|
|
private:
|
|
|
|
|
|
|
|
virtual void referenceableDataChanged (const QModelIndex& topLeft,
|
|
|
|
const QModelIndex& bottomRight);
|
|
|
|
|
|
|
|
virtual void referenceableAboutToBeRemoved (const QModelIndex& parent, int start, int end);
|
|
|
|
|
|
|
|
virtual void referenceableAdded (const QModelIndex& index, int start, int end);
|
|
|
|
|
|
|
|
virtual void referenceDataChanged (const QModelIndex& topLeft, const QModelIndex& bottomRight);
|
|
|
|
|
|
|
|
virtual void referenceAboutToBeRemoved (const QModelIndex& parent, int start, int end);
|
|
|
|
|
|
|
|
virtual void referenceAdded (const QModelIndex& index, int start, int end);
|
|
|
|
|
2016-05-03 02:08:49 +00:00
|
|
|
virtual void pathgridDataChanged (const QModelIndex& topLeft, const QModelIndex& bottomRight);
|
|
|
|
|
|
|
|
virtual void pathgridAboutToBeRemoved (const QModelIndex& parent, int start, int end);
|
|
|
|
|
|
|
|
virtual void pathgridAdded (const QModelIndex& parent, int start, int end);
|
|
|
|
|
|
|
|
|
2014-09-06 14:11:06 +00:00
|
|
|
virtual std::string getStartupInstruction();
|
|
|
|
|
2014-12-02 10:17:39 +00:00
|
|
|
protected:
|
|
|
|
|
|
|
|
virtual void addVisibilitySelectorButtons (CSVWidget::SceneToolToggle2 *tool);
|
|
|
|
|
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);
|
2014-03-06 09:13:39 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|