summaryrefslogtreecommitdiffstats
path: root/tksao/frame/framebase.h
blob: 49587fe25a183583235ba138b15ffffcdf407100 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// Copyright (C) 1999-2018
// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
// For conditions of distribution and use, see copyright notice in "copyright"

#ifndef __framebase_h__
#define __framebase_h__

#include "base.h"

class FrameBase : public Base {
protected:
  XImage* rotateSrcXM;       // rotate src ximage
  XImage* rotateDestXM;      // rotate dest ximage
  Pixmap rotatePM;           // rotate pixmap

  XImage* colormapXM;      // rotate dest ximage
  Pixmap colormapPM;       // rotate pixmap
  GC colormapGCXOR;        // GC for interactive rotation

  Vector iisLastCursor;      // iis cursor state info
				  
 private:
  void coordToTclArray(FitsImage*, const Vector&, Coord::CoordSystem, 
		       const char*, const char*);

  void getInfoWCS(char*, Vector&, FitsImage*);

protected:
  double calcZoomPanner();
  void cancelDetach() {};

  void rotateMotion();

  void saveFitsResampleFits(OutFitsStream&);
  void saveFitsResampleKeyword(OutFitsStream&, FitsHead&);
  void setBinCursor();

  virtual void updateBin(const Matrix&);
  void updatePanner();

  void x11MagnifierCursor(const Vector&);

public:
  FrameBase(Tcl_Interp*, Tk_Canvas, Tk_Item*);
  virtual ~FrameBase();

  FrameType frameType() {return F2D;}
  void setSlice(int,int);

  Vector mapFromRef(const Vector&, Coord::InternalSystem);
  Vector mapToRef(const Vector&, Coord::InternalSystem);

  // Bin Commands
  void binToFitCmd();

  // Block Commands
  void blockToFitCmd();

  // Coordinate Commands
  void getCursorCmd(Coord::InternalSystem);
  void getCursorCmd(Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat);

  // Grid Commands
  void gridCmd(Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat, 
	       Grid::GridType, const char*, const char*);

  // Info Commands
  void getInfoCmd(const Vector&, Coord::InternalSystem, char*);

  // Fits Commands
  void saveFitsResample(OutFitsStream&);
  void saveFitsResampleFileCmd(const char*);
  void saveFitsResampleChannelCmd(const char*);
  void saveFitsResampleSocketCmd(int);

  // IIS Commands
  void iisCursorModeCmd(int);
  void iisGetCursorCmd();
  void iisGetFileNameCmd();
  void iisGetFileNameCmd(int);
  void iisGetFileNameCmd(const Vector&);
  void iisMessageCmd(const char*);
  void iisSetCursorCmd(const Vector&, Coord::InternalSystem);
  void iisSetCursorCmd(const Vector&, Coord::CoordSystem);
  void iisSetFileNameCmd(const char*);
  void iisSetFileNameCmd(const char*,int);
  void iisUpdateCmd() {updateNow(MATRIX);}

  // Pan Zoom Rotate Orient Commands
  void panCmd(const Vector&);
  void panCmd(const Vector&, const Vector&);
  void panCmd(const Vector&, Coord::CoordSystem, Coord::SkyFrame);
  void panToCmd(const Vector&);
  void panToCmd(const Vector&, Coord::CoordSystem, Coord::SkyFrame);
  void panBBoxCmd(const Vector&);
  void panEndCmd(const Vector&);
  void rotateBeginCmd();
  void rotateMotionCmd(double);
  void rotateEndCmd();
  void zoomAboutCmd(const Vector&, const Vector&);
  void zoomAboutCmd(const Vector&, const Vector&, Coord::CoordSystem, Coord::SkyFrame);
  void zoomToAboutCmd(const Vector&, const Vector&);
  void zoomToAboutCmd(const Vector&, const Vector&, Coord::CoordSystem, Coord::SkyFrame);
  void zoomToFitCmd(double);

  // 3d
  void get3dBorderCmd();
  void get3dBorderColorCmd();
  void get3dCompassCmd();
  void get3dCompassColorCmd();
  void get3dHighliteCmd();
  void get3dHighliteColorCmd();
  void get3dScaleCmd();
  void get3dViewCmd();
  void get3dViewPointCmd();
  void get3dRenderMethodCmd();
  void get3dRenderBackgroundCmd();
};

#endif