OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
cellwater.hpp
Go to the documentation of this file.
1 #ifndef CSV_RENDER_CELLWATER_H
2 #define CSV_RENDER_CELLWATER_H
3 
4 #include <string>
5 
6 #include <osg/ref_ptr>
7 
8 #include <QObject>
9 #include <QModelIndex>
10 
11 #include "../../model/world/record.hpp"
12 
13 namespace osg
14 {
15  class Geode;
16  class Geometry;
17  class Group;
18  class PositionAttitudeTransform;
19 }
20 
21 namespace CSMWorld
22 {
23  struct Cell;
24  class CellCoordinates;
25  class Data;
26 }
27 
28 namespace CSVRender
29 {
32  class CellWater : public QObject
33  {
34  Q_OBJECT
35 
36  public:
37 
38  CellWater(CSMWorld::Data& data, osg::Group* cellNode, const std::string& id,
39  const CSMWorld::CellCoordinates& cellCoords);
40 
41  ~CellWater();
42 
43  void updateCellData(const CSMWorld::Record<CSMWorld::Cell>& cellRecord);
44 
45  void reloadAssets();
46 
47  private slots:
48 
49  void cellDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
50 
51  private:
52 
53  void recreate();
54 
55  static const int CellSize;
56 
58  std::string mId;
59 
60  osg::Group* mParentNode;
61 
62  osg::ref_ptr<osg::PositionAttitudeTransform> mWaterTransform;
63  osg::ref_ptr<osg::Geode> mWaterNode;
64  osg::ref_ptr<osg::Geometry> mWaterGeometry;
65 
66  bool mDeleted;
67  bool mExterior;
68  bool mHasWater;
69  };
70 }
71 
72 #endif
~CellWater()
Definition: cellwater.cpp:59
osg::ref_ptr< osg::Geode > mWaterNode
Definition: cellwater.hpp:63
osg::ref_ptr< osg::PositionAttitudeTransform > mWaterTransform
Definition: cellwater.hpp:62
osg::Group * mParentNode
Definition: cellwater.hpp:60
osg::ref_ptr< osg::Geometry > mWaterGeometry
Definition: cellwater.hpp:64
bool mHasWater
Definition: cellwater.hpp:68
CellWater(CSMWorld::Data &data, osg::Group *cellNode, const std::string &id, const CSMWorld::CellCoordinates &cellCoords)
Definition: cellwater.cpp:25
void recreate()
Definition: cellwater.cpp:127
Definition: cellwater.hpp:32
bool mExterior
Definition: cellwater.hpp:67
CSMWorld::Data & mData
Definition: cellwater.hpp:57
bool mDeleted
Definition: cellwater.hpp:66
static const int CellSize
Definition: cellwater.hpp:55
Definition: data.hpp:80
Definition: cellcoordinates.hpp:12
void reloadAssets()
Definition: cellwater.cpp:95
std::string mId
Definition: cellwater.hpp:58
void cellDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
Definition: cellwater.cpp:100
void updateCellData(const CSMWorld::Record< CSMWorld::Cell > &cellRecord)
Definition: cellwater.cpp:64