Jamoma API  0.6.0.a19
Moveable.h
1 // Moveable.h
2 /***************************************************/
3 /*! \class Moveable
4  \brief Moveable class
5 
6  This class implements an object that can be moved in
7  3d space.
8 
9  by Tristan Matthews and Nils Peters, 2007-2008.
10  */
11 /***************************************************/
12 
13 #ifndef _MOVEABLE_H_
14 #define _MOVEABLE_H_
15 
16 #include "Coordinate.h"
17 
18 class Moveable {
19  private:
20  Coordinate xPos_, yPos_, zPos_;
21  bool flag_;
22 
23  public:
24  //! Class constructor.
25  Moveable();
26  //! Class constructor, taking arguments for x, y and z position.
27  Moveable(double x, double y, double z);
28  virtual ~Moveable() {}
29  //! Get x position.
30  double xPos() const;
31  //! Set x position.
32  void xPos(double x);
33  //! Get y position.
34  double yPos() const;
35  //! Set y position.
36  void yPos(double y);
37  //! Get z position.
38  double zPos() const;
39  //! Set z position.
40  void zPos(double z);
41  //! True if object has moved.
42  bool flag() const;
43  //! To be set if object has moved.
44  void flag(bool changed);
45  //! Check if a room's new width will still contain this object.
46  bool checkWidth(double newWidth);
47  //! Check if a room's new depth will still contain this object.
48  bool checkDepth(double newDepth);
49  //! Check if a room's new height will still contain this object.
50  bool checkHeight(double newHeight);
51  //! Virtual function that must be overriden in derived classes. Prints position for this object.
52  virtual void printPos() const = 0;
53 };
54 
55 #endif
56 
57 // vim:sw=4:et:cindent:
bool checkDepth(double newDepth)
Check if a room's new depth will still contain this object.
Definition: Moveable.cpp:80
virtual void printPos() const =0
Virtual function that must be overriden in derived classes. Prints position for this object...
Coordinate class.
Definition: Coordinate.h:15
double xPos() const
Get x position.
Definition: Moveable.cpp:26
bool flag() const
True if object has moved.
Definition: Moveable.cpp:65
bool checkWidth(double newWidth)
Check if a room's new width will still contain this object.
Definition: Moveable.cpp:75
bool checkHeight(double newHeight)
Check if a room's new height will still contain this object.
Definition: Moveable.cpp:85
double zPos() const
Get z position.
Definition: Moveable.cpp:52
Moveable()
Class constructor.
Definition: Moveable.cpp:10
Moveable class.
Definition: Moveable.h:18
double yPos() const
Get y position.
Definition: Moveable.cpp:39