#ifndef _AtAxis3P_h
#define _AtAxis3P_h

#include <X11/IntrinsicP.h>
#include <Scale.h>
#include <X11/ObjectP.h>
#include <Text.h>

#include "Axis3.h"

#define AxisTypeX 0
#define AxisTypeY 1
#define AxisTypeZ 2

#define PI 3.141592653589

typedef struct _AtAxis3Part{
  /* resources */
  String axisLabel;
  String labelFontFamily;
  Boolean drawLabel;
  Boolean drawNumbers;
  Boolean autoNumber;
  int labelSize;
  String numberFontFamily;
  int numberSize;
  int numberStyle;
  Pixel axisColor;
  Pixel labelColor;
  Pixel numberColor;
  
  double min, max;
  short transform;
  
  double ticSide;
  double ticInterval;
  int ticsPerAxis, subsPerTic;
  short axisType;
  double labelSide;
  short ticLength;
  short subticLength;

  /* private state */
  
  double angle;           /* axis angle */
  Boolean ticsVertical;   /* true iff ticks are vertical */
  AtScale *xscale, *yscale;
  AtText *labelText;
  AtFontFamily *labelFF, *numberFF;
  XFontStruct *numberFont;
  int maxTicWidth; /* max width of numbered tick, incl number */
  GC axisGC, numberGC, labelGC;
  
  Boolean valid;
  XPoint *endpoints; /* axis endpoints for drawing */
  XSegment *lines; 
  short *ticXCoords, *ticYCoords; /* coords for tick labels, ticks */
  short *subXCoords, *subYCoords; /* coords for subticks */
  double *ticvalues;               /* numerical values of ticks */
  char **ticlabels;                /* string labels of ticks */
  short nlines;                    /* # lines */
  short ntics;                     /* # ticks */
  short nsubs;                     /* # subticks */
  int maxticwidth;
  short labelX, labelY;            /* coords of label */
  short subticspacing;
  /* double origin ???? */
  
} AtAxis3Part;

typedef struct _AtAxis3Rec {
  ObjectPart object;
  AtAxis3Part axis3;
} AtAxis3Rec;

typedef struct _AtAxis3ClassPart {
  int blah;
} AtAxis3ClassPart;

typedef struct _AtAxis3ClassRec {
  ObjectClassPart object_class;
  AtAxis3ClassPart axis3_class;
} AtAxis3ClassRec;

extern AtAxis3ClassRec atAxis3ClassRec;

#define MIN_MARGIN 5
#define TIC_LINE_LENGTH 5
#define SUBTIC_LINE_LENGTH 3

#endif

