2016-08-05 02:58:55 +00:00
|
|
|
#ifndef CSV_RENDER_CELLWATER_H
|
|
|
|
#define CSV_RENDER_CELLWATER_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <osg/ref_ptr>
|
|
|
|
|
2022-10-19 17:02:00 +00:00
|
|
|
#include <QModelIndex>
|
2016-08-05 02:58:55 +00:00
|
|
|
#include <QObject>
|
|
|
|
|
2022-10-10 11:41:36 +00:00
|
|
|
class QModelIndex;
|
2016-08-05 17:49:44 +00:00
|
|
|
|
2016-08-05 02:58:55 +00:00
|
|
|
namespace osg
|
|
|
|
{
|
|
|
|
class Geometry;
|
|
|
|
class Group;
|
|
|
|
class PositionAttitudeTransform;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace CSMWorld
|
|
|
|
{
|
2016-08-05 19:39:08 +00:00
|
|
|
struct Cell;
|
2016-08-05 02:58:55 +00:00
|
|
|
class CellCoordinates;
|
|
|
|
class Data;
|
2022-10-10 11:41:36 +00:00
|
|
|
|
|
|
|
template <typename ESXRecordT>
|
|
|
|
struct Record;
|
2016-08-05 02:58:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace CSVRender
|
|
|
|
{
|
|
|
|
/// For exterior cells, this adds a patch of water to fit the size of the cell. For interior cells with water, this
|
|
|
|
/// adds a large patch of water much larger than the typical size of a cell.
|
|
|
|
class CellWater : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
public:
|
2016-08-05 02:58:55 +00:00
|
|
|
CellWater(CSMWorld::Data& data, osg::Group* cellNode, const std::string& id,
|
|
|
|
const CSMWorld::CellCoordinates& cellCoords);
|
|
|
|
|
2016-08-05 17:49:44 +00:00
|
|
|
~CellWater();
|
2016-08-05 02:58:55 +00:00
|
|
|
|
2017-08-21 00:55:56 +00:00
|
|
|
void updateCellData(const CSMWorld::Record<CSMWorld::Cell>& cellRecord);
|
|
|
|
|
2016-08-05 02:58:55 +00:00
|
|
|
void reloadAssets();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
void cellDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
|
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
private:
|
2016-08-05 17:49:44 +00:00
|
|
|
void recreate();
|
2016-08-05 02:58:55 +00:00
|
|
|
|
|
|
|
static const int CellSize;
|
|
|
|
|
|
|
|
CSMWorld::Data& mData;
|
|
|
|
std::string mId;
|
|
|
|
|
|
|
|
osg::Group* mParentNode;
|
|
|
|
|
|
|
|
osg::ref_ptr<osg::PositionAttitudeTransform> mWaterTransform;
|
2022-07-20 11:25:37 +00:00
|
|
|
osg::ref_ptr<osg::Group> mWaterGroup;
|
2016-08-05 02:58:55 +00:00
|
|
|
osg::ref_ptr<osg::Geometry> mWaterGeometry;
|
|
|
|
|
|
|
|
bool mDeleted;
|
|
|
|
bool mExterior;
|
|
|
|
bool mHasWater;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|