OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
refdata.hpp
Go to the documentation of this file.
1 #ifndef GAME_MWWORLD_REFDATA_H
2 #define GAME_MWWORLD_REFDATA_H
3 
6 
7 #include "../mwscript/locals.hpp"
8 
9 #include <string>
10 #include <osg/Vec3f>
11 
12 namespace SceneUtil
13 {
14  class PositionAttitudeTransform;
15 }
16 
17 namespace ESM
18 {
19  class Script;
20  class CellRef;
21  struct ObjectState;
22 }
23 
24 namespace MWWorld
25 {
26 
27  class CustomData;
28 
29  class RefData
30  {
32 
34 
38 
39  bool mEnabled;
40 
42  int mCount;
43 
45 
47 
49 
50  void copy (const RefData& refData);
51 
52  void cleanup();
53 
54  bool mChanged;
55 
56  unsigned int mFlags;
57 
58  public:
59 
60  RefData();
61 
65  RefData (const ESM::CellRef& cellRef);
66 
67  RefData (const ESM::ObjectState& objectState, bool deletedByContentFile);
70 
71  RefData (const RefData& refData);
72 
73  ~RefData();
74 
75  void write (ESM::ObjectState& objectState, const std::string& scriptId = "") const;
78 
79  RefData& operator= (const RefData& refData);
80 
83 
86 
89 
90  int getCount() const;
91 
92  void setLocals (const ESM::Script& script);
93 
94  void setCount (int count);
100 
103  void setDeletedByContentFile(bool deleted);
104 
106  bool isDeleted() const;
108  bool isDeletedByContentFile() const;
109 
111 
112  bool isEnabled() const;
113 
114  void enable();
115 
116  void disable();
117 
118  void setPosition (const ESM::Position& pos);
119  const ESM::Position& getPosition() const;
120 
121  void setCustomData (CustomData *data);
124 
127 
128  const CustomData *getCustomData() const;
129 
130  bool activate();
131 
132  bool onActivate();
133 
134  bool activateByScript();
135 
136  bool hasChanged() const;
138 
139  const ESM::AnimationState& getAnimationState() const;
141  };
142 }
143 
144 #endif
A customized version of osg::PositionAttitudeTransform optimized for speed. Uses single precision val...
Definition: positionattitudetransform.hpp:11
ESM::Position mPosition
Definition: refdata.hpp:44
~RefData()
Definition: refdata.cpp:124
Definition: locals.hpp:16
bool isDeleted() const
Returns true if the object was either deleted by the content file or by gameplay. ...
Definition: refdata.cpp:175
void write(ESM::ObjectState &objectState, const std::string &scriptId="") const
Definition: refdata.cpp:96
void copy(const RefData &refData)
Definition: refdata.cpp:24
void setLocals(const ESM::Script &script)
Definition: refdata.cpp:154
bool isEnabled() const
Definition: refdata.cpp:190
MWScript::Locals & getLocals()
Definition: refdata.cpp:185
bool activateByScript()
Definition: refdata.cpp:246
RefData & operator=(const RefData &refData)
Definition: refdata.cpp:108
SceneUtil::PositionAttitudeTransform * mBaseNode
Definition: refdata.hpp:31
Definition: loadscpt.hpp:19
bool onActivate()
Definition: refdata.cpp:266
MWScript::Locals mLocals
Definition: refdata.hpp:33
const ESM::AnimationState & getAnimationState() const
Definition: refdata.cpp:274
bool activate()
Definition: refdata.cpp:253
bool isDeletedByContentFile() const
Returns true if the object was deleted by a content file.
Definition: refdata.cpp:180
SceneUtil::PositionAttitudeTransform * getBaseNode()
Return base node (can be a null pointer).
Definition: refdata.cpp:139
Base class for the MW-class-specific part of RefData.
Definition: customdata.hpp:16
Definition: animationstate.hpp:14
Definition: refdata.hpp:29
void setBaseNode(SceneUtil::PositionAttitudeTransform *base)
Set base node (can be a null pointer).
Definition: refdata.cpp:134
bool mEnabled
Definition: refdata.hpp:39
RefData()
Definition: refdata.cpp:48
void setPosition(const ESM::Position &pos)
Definition: refdata.cpp:213
int getCount() const
Definition: refdata.cpp:149
<
Definition: objectstate.hpp:19
void setCustomData(CustomData *data)
Definition: refdata.cpp:224
void setCount(int count)
Definition: refdata.cpp:160
bool mDeletedByContentFile
Definition: refdata.hpp:37
CustomData * mCustomData
Definition: refdata.hpp:48
unsigned int mFlags
Definition: refdata.hpp:56
void cleanup()
Definition: refdata.cpp:40
Definition: cellref.hpp:34
int mCount
0: deleted
Definition: refdata.hpp:42
Definition: defs.hpp:38
void enable()
Definition: refdata.cpp:195
CustomData * getCustomData()
May return a 0-pointer. The ownership of the return data object is not transferred.
Definition: refdata.cpp:231
void setDeletedByContentFile(bool deleted)
Definition: refdata.cpp:170
const ESM::Position & getPosition() const
Definition: refdata.cpp:219
bool mChanged
Definition: refdata.hpp:54
ESM::AnimationState mAnimationState
Definition: refdata.hpp:46
bool hasChanged() const
Has this RefData changed since it was originally loaded?
Definition: refdata.cpp:241
void disable()
Definition: refdata.cpp:204