XYView.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #import <appkit/appkit.h>
  2. #import "mathlib.h"
  3. #import "SetBrush.h"
  4. extern id xyview_i;
  5. #define MINSCALE 0.125
  6. #define MAXSCALE 2.0
  7. extern vec3_t xy_viewnormal; // v_forward for xy view
  8. extern float xy_viewdist; // clip behind this plane
  9. extern NXRect xy_draw_rect;
  10. void linestart (float r, float g, float b);
  11. void lineflush (void);
  12. void linecolor (float r, float g, float b);
  13. void XYmoveto (vec3_t pt);
  14. void XYlineto (vec3_t pt);
  15. typedef enum {dr_wire, dr_flat, dr_texture} drawmode_t;
  16. @interface XYView : View
  17. {
  18. NXRect realbounds, newrect, combinedrect;
  19. NXPoint midpoint;
  20. int gridsize;
  21. float scale;
  22. // for textured view
  23. int xywidth, xyheight;
  24. float *xyzbuffer;
  25. unsigned *xypicbuffer;
  26. drawmode_t drawmode;
  27. // UI links
  28. id mode_radio_i;
  29. }
  30. - (float)currentScale;
  31. - setModeRadio: m;
  32. - drawMode: sender;
  33. - setDrawMode: (drawmode_t)mode;
  34. - newSuperBounds;
  35. - newRealBounds: (NXRect *)nb;
  36. - addToScrollRange: (float)x :(float)y;
  37. - setOrigin: (NXPoint *)pt scale: (float)sc;
  38. - centerOn: (vec3_t)org;
  39. - drawMode: sender;
  40. - superviewChanged;
  41. - (int)gridsize;
  42. - (float)snapToGrid: (float)f;
  43. @end