/************************************************************************/
/* Copyright 1998 MBARI							*/
/************************************************************************/
#ifndef _PANTILTGRAPH_H
#define _PANTILTGRAPH_H
static char PanTiltGraph_h_id[] = "$Header: /u/oreilly/rov/tmacs/RCS/PanTiltGraph.h,v 1.2 1998/12/18 21:07:21 oreilly Exp $";

/*
$Log: PanTiltGraph.h,v $
Revision 1.2  1998/12/18 21:07:21  oreilly
Added documentation

Revision 1.1  1996/10/28 09:13:52  oreilly
Initial revision

*/


#include <math.h>
#include <values.h>
#include <Xm/Xm.h>
#include "Math.h"

#define NoPanTiltValue MAXDOUBLE

enum
{
  PortLight = 0, StbdLight, PortCamera, StbdCamera
};


/*
CLASS 
PanTiltGraph

DESCRIPTION
Display pan and tilt for a camera or light unit

AUTHOR
Tom O'Reilly
*/
class PanTiltGraph 
{
  public:

  
  ///////////////////////////////////////////////////////////////////
  // Display camera point as rectangle, light point as circle
  enum
  {
    Circle, Rectangle

  };
  
  PanTiltGraph(Display *display, GC axisGC, GC pointGC, 
	       Radians panRange, Radians tiltRange,
	       int pointType);

  ~PanTiltGraph();
  
  void setDimensions(int originX, int originY, int width, int height);
  void setPanRange(Radians panRange);
  void setTiltRange(Radians tiltRange);
  void setPan(Radians pan);
  void setCenterPan(Radians centerPan);
  void setTilt(Radians tilt);
  
  void draw(Drawable canvas);
  void setLabel(const char *label);
  
  protected:

  int physicalCoords(Radians pan, Radians tilt, int *i, int *j);
  Display *_display;
  GC _axisGC, _pointGC;
  
  int _originX;
  int _originY;
  int _width;
  int _height;
  Radians _panRange;
  Radians _tiltRange;
  Radians _centerPan;
  
  Radians _pan;
  Radians _tilt;

  int _pointType;
  char *_label;
  
};



#endif
