1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-24 23:23:54 +00:00
openmw/apps/opencs/view/render/cellwater.hpp

73 lines
1.5 KiB
C++
Raw Normal View History

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>
2022-09-22 18:26:05 +00:00
#include <QObject>
2016-08-05 02:58:55 +00:00
2022-10-10 11:41:36 +00:00
class QModelIndex;
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
{
2022-09-22 18:26:05 +00:00
Q_OBJECT
2016-08-05 02:58:55 +00:00
2022-09-22 18:26:05 +00:00
public:
CellWater(CSMWorld::Data& data, osg::Group* cellNode, const std::string& id,
const CSMWorld::CellCoordinates& cellCoords);
2016-08-05 02:58:55 +00:00
2022-09-22 18:26:05 +00:00
~CellWater();
2016-08-05 02:58:55 +00:00
2022-09-22 18:26:05 +00:00
void updateCellData(const CSMWorld::Record<CSMWorld::Cell>& cellRecord);
2017-08-21 00:55:56 +00:00
2022-09-22 18:26:05 +00:00
void reloadAssets();
2016-08-05 02:58:55 +00:00
2022-09-22 18:26:05 +00:00
private slots:
2016-08-05 02:58:55 +00:00
2022-09-22 18:26:05 +00:00
void cellDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
2016-08-05 02:58:55 +00:00
2022-09-22 18:26:05 +00:00
private:
void recreate();
2016-08-05 02:58:55 +00:00
2022-09-22 18:26:05 +00:00
static const int CellSize;
2016-08-05 02:58:55 +00:00
2022-09-22 18:26:05 +00:00
CSMWorld::Data& mData;
std::string mId;
2016-08-05 02:58:55 +00:00
2022-09-22 18:26:05 +00:00
osg::Group* mParentNode;
2016-08-05 02:58:55 +00:00
2022-09-22 18:26:05 +00:00
osg::ref_ptr<osg::PositionAttitudeTransform> mWaterTransform;
osg::ref_ptr<osg::Group> mWaterGroup;
osg::ref_ptr<osg::Geometry> mWaterGeometry;
2016-08-05 02:58:55 +00:00
2022-09-22 18:26:05 +00:00
bool mDeleted;
bool mExterior;
bool mHasWater;
2016-08-05 02:58:55 +00:00
};
}
#endif