// Filename: input/device/isotrak/Receiver.h
// Author: Jorge Bernadas (JB)
// Date of Creation: 11/02/2007
// Version: 1.0
//
// TODO(): Put general comment here!
//
// Azimuth: Angle from the projection in the xy-plane to the x-axis.
// Elevation: Angle from the xy-plane to the raster position.
// Roll: Angle of rotation over its own axis.
#ifndef INPUT_DEVICE_ISOTRAK_RECEIVER_H__
#define INPUT_DEVICE_ISOTRAK_RECEIVER_H__

//#include "base/General.h"
//#include "math/Vector.h"
#include "../../../math/Vector.h"

BEGIN_TEG_NAMESPACE();
//BEGIN_ENGINE_NAMESPACE();

class Receiver {
public:
  // standard constructor and destructor
  Receiver();
  ~Receiver();

  // accesor methods to receiver's position
  Vec3f position() const {return position_;}
  float x() const {return position_.x;}
  float y() const {return position_.y;}
  float z() const {return position_.z;}

  // accesor methods to receiver's orientation
  Vec3f direction() const;
  Vec3f orientation() const {return orientation_;}
  float azimuth() const {return orientation_.x;}
  float elevation() const {return orientation_.y;}
  float roll() const {return orientation_.z;}

  // accesor method for button state
  bool buttonPressed() const {return buttonPressed_;}

  // mutator methods for receiver's position
  void setPosition(const Vec3f& position) {position_ = position;}
  void setX(float x) {position_.x = x;}
  void setY(float y) {position_.y = y;}
  void setZ(float z) {position_.z = z;}

  // mutator methods for receiver's orientation
  void setOrientation(const Vec3f& orientation) {orientation_ = orientation;}
  void setAzimuth(float azimuth) {orientation_.x = azimuth;}
  void setElevation(float elevation) {orientation_.y = elevation;}
  void setRoll(float roll) {orientation_.z = roll;}

  // mutator method for button state
  void setButtonPressed(bool buttonPressed) {buttonPressed_ = buttonPressed;}

private:
  // receiver's position and orientation
  Vec3f position_;
  Vec3f orientation_;

  // receiver's button state
  bool buttonPressed_;
//  DISALLOW_COPY_CONSTRUCTORS(Receiver);
};

//END_ENGINE_NAMESPACE();
END_TEG_NAMESPACE();

#endif  // INPUT_DEVICE_ISOTRAK_RECEIVER_H__
