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  private slots:
46 
47  void cellDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
48 
49  private:
50 
51  void recreate();
52 
53  static const int CellSize;
54 
56  std::string mId;
57 
58  osg::Group* mParentNode;
59 
60  osg::ref_ptr<osg::PositionAttitudeTransform> mWaterTransform;
61  osg::ref_ptr<osg::Geode> mWaterNode;
62  osg::ref_ptr<osg::Geometry> mWaterGeometry;
63 
64  bool mDeleted;
65  bool mExterior;
66  bool mHasWater;
67  };
68 }
69 
70 #endif
~CellWater()
Definition: cellwater.cpp:59
osg::ref_ptr< osg::Geode > mWaterNode
Definition: cellwater.hpp:61
osg::ref_ptr< osg::PositionAttitudeTransform > mWaterTransform
Definition: cellwater.hpp:60
osg::Group * mParentNode
Definition: cellwater.hpp:58
osg::ref_ptr< osg::Geometry > mWaterGeometry
Definition: cellwater.hpp:62
bool mHasWater
Definition: cellwater.hpp:66
CellWater(CSMWorld::Data &data, osg::Group *cellNode, const std::string &id, const CSMWorld::CellCoordinates &cellCoords)
Definition: cellwater.cpp:25
void recreate()
Definition: cellwater.cpp:122
Definition: cellwater.hpp:32
bool mExterior
Definition: cellwater.hpp:65
CSMWorld::Data & mData
Definition: cellwater.hpp:55
bool mDeleted
Definition: cellwater.hpp:64
static const int CellSize
Definition: cellwater.hpp:53
Definition: data.hpp:77
Definition: cellcoordinates.hpp:12
std::string mId
Definition: cellwater.hpp:56
void cellDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
Definition: cellwater.cpp:95
void updateCellData(const CSMWorld::Record< CSMWorld::Cell > &cellRecord)
Definition: cellwater.cpp:64