summaryrefslogtreecommitdiffstats
path: root/tksao/frame/base.h
blob: 8808ff8a6800428856b37214acd3db95524c1e66 (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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
// Copyright (C) 1999-2018
// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
// For conditions of distribution and use, see copyright notice in "copyright"

#ifndef __base_h__
#define __base_h__

#include "widget.h"
#include "vector3d.h"

#include "callback.h"
#include "fvcontour.h"
#include "frscale.h"
#include "grid2d.h"
#include "grid25d.h"
#include "grid3d.h"
#include "hist.h"
#include "inversescale.h"
#include "list.h"
#include "tag.h"
#include "util.h"
#include "point.h"

extern int DebugMosaic;
extern int DebugPerf;
extern int DebugWCS;
extern int DebugBin;
extern int DebugBlock;
extern int DebugCompress;
extern int DebugCrop;
extern int DebugGZ;
extern int DebugRGB;

#define DEFAULTLOW 0
#define DEFAULTHIGH 100
#define HISTEQUSIZE 16384
#define SCALESIZE 16384

class Attribute;
class BaseBox;
class BaseEllipse;
class BaseMarker;
class Composite;
class Context;
class Contour;
class ContourLevel;
class Filter;
class FitsImage;
class FitsMask;
class FVContour;
class Grid;
class Grid2d;
class Grid25d;
class Grid3d;
class Marker;

class Annulus;
class Box;
class BoxAnnulus;
class Bpanda;
class Circle;
class Compass;
class Cpanda;
class Ellipse;
class EllipseAnnulus;
class Epanda;
class Line;
class Point;
class Projection;
class Polygon;
class Ruler;
class Segment;
class Text;
class Vect;

class Base : public Widget {
  friend class Attribute;
  friend class BaseBox;
  friend class BaseEllipse;
  friend class BaseLine;
  friend class BaseMarker;
  friend class BasePolygon;
  friend class Composite;
  friend class Context;
  friend class Contour;
  friend class ContourLevel;
  friend class FitsImage;
  friend class FitsMask;
  friend class FVContour;
  friend class Grid;
  friend class Grid2d;
  friend class Grid25d;
  friend class Grid3d;
  friend class Marker;

  friend class Annulus;
  friend class Box;
  friend class BoxAnnulus;
  friend class Bpanda;
  friend class Circle;
  friend class Compass;
  friend class Cpanda;
  friend class Ellipse;
  friend class EllipseAnnulus;
  friend class Epanda;
  friend class Line;
  friend class Point;
  friend class Projection;
  friend class Polygon;
  friend class Ruler;
  friend class Segment;
  friend class Text;
  friend class Vect;

public:
  enum FrameType {F2D, F3D};
  enum CompressType {NOCOMPRESS, GZ};
  enum FileNameType {ROOTBASE, FULLBASE, ROOT, FULL};
  enum MarkerFormat {DS9, XML, CIAO, SAOTNG, SAOIMAGE, PROS, RAWXY};
  enum MarkerLayer {USER, TEMPLATE, CATALOG, ANALYSIS};
  enum ShmType {SHMID,KEY};
  enum UndoMarkerType {NONE, MOVE, EDIT, DELETE};
  enum UpdateType {MATRIX, BASE, BASEONLY, PIXMAP, NOUPDATE};

  enum MemType {ALLOC, ALLOCGZ, CHANNEL, MMAP, SMMAP, MMAPINCR, 
		SHARE, SSHARE, SOCKET, SOCKETGZ, VAR, HIST, POST, PHOTO};
  enum MosaicType {NOMOSAIC, IRAF, WCSMOSAIC, WFPC2};
  enum LayerType {IMG, MASK};
  enum CutMethod {SUM,AVERAGE};

 private:
  InverseScale* inverseScale;

 protected:
  Context* context;
  int nthreads_;

  int byteorder_;
  int bitsperpixel_;

  List<Marker>* markers;     // pointer to current marker stack
  List<Marker>* undoMarkers; // pointer to current marker stack
  List<Marker>* pasteMarkers;// pointer to current marker stack

  List<Marker> userMarkers;      // foreground marker stack
  List<Marker> undoUserMarkers;  // remember marker to undo
  List<Marker> pasteUserMarkers; // cut/copy/paste

  List<Marker> catalogMarkers;      // background marker stack
  List<Marker> undoCatalogMarkers;  // remember marker to undo
  List<Marker> pasteCatalogMarkers; // cut/copy/paste

  UndoMarkerType undoMarkerType; // type

  Vector markerBegin;        // marker move begin in image coords
  Marker* editMarker;        // pointer to marker currently being edited
  Marker* rotateMarker;      // pointer to marker currently being rotated
  Vector regionBegin;        // select region begin in canvas coords
  Vector regionEnd;          // select region end in canvas coords

  Composite* compositeMarker; // pointer to current composite marker

  Vector cursor; // current cursor position in REF coords
  Vector crosshair; // crosshair location in REF coords

  XImage* baseXImage; // ximage of image
  Pixmap basePixmap; // pixmap of image
  UpdateType needsUpdate; // updateFlags
  int syncUpdate; // update 3d syncronously

  Context* currentContext;
  Context* keyContext;
  int keyContextSet;

  Coord::Orientation orientation;   // current image orientation
  Matrix orientationMatrix;  // current image orientation matrix
  double rotation;           // current image rotation angle

  double rotateRotation;     // tmp cursor for interactive rotation

  int preservePan;           // flag to indicate preserve between loads

  Vector zoom_; // current image zoom value

  Pixmap panPM;              // tmp pixmap for pan motion
  Vector panCursor;          // cursor for interactive panning
  GC panGCXOR;               // GC for interactive panning

  GC rotateGCXOR;            // GC for interactive rotation

  Pixmap pannerPixmap;       // pixmap for panner
  XImage* pannerXImage;      // ximage for panner
  int pannerWidth;           // panner width
  int pannerHeight;          // panner height
  char pannerName[32];       // panner widget name
  int usePanner;             // panner status
  GC pannerGC;

  Pixmap magnifierPixmap;    // pixmap for magnifier
  XImage* magnifierXImage;   // ximage for magnifier
  int magnifierWidth;        // magnifier width
  int magnifierHeight;       // magnifier height
  double magnifierZoom_;     // magnifier zoom factor
  char magnifierName[32];    // magnifer widget name
  int useMagnifier;          // magnifer status
  int useMagnifierGraphics;  // magnifer marker status
  int useMagnifierCursor;    // magnifier cursor status
  Vector magnifierCursor;    // we need to save the last cursor used
  char* magnifierColorName;

  Vector cropBegin;
  Vector cropEnd;

  Coord::CoordSystem wcsSystem_;
  Coord::SkyFrame wcsSky_;
  Coord::SkyFormat wcsSkyFormat_;

  int wcsAlign_; // flag to indicate wcs alignment

  Coord::CoordSystem xySystem_; // default marker sys (RAWXY)
  Coord::SkyFrame xySky_; // default marker sky (RAWXY)

  Coord::Orientation wcsOrientation; // wcs image orientation
  Matrix wcsOrientationMatrix; // wcs image orientation matrix
  double wcsRotation; // wcs image rotation angle

  int irafAlign_;
  Coord::Orientation irafOrientation_; // orientation of first iraf segment
  Matrix irafMatrix_; // orientation matrix for iraf mosaic

  char* maskColorName;
  float maskAlpha;
  int maskMark;

  int invert;

  int useHighlite;
  GC highliteGC;

  XRectangle rectWidget[1];
  XRectangle rectWindow[1];

  int useCrosshair;

  int precLinear_;
  int precDeg_;
  int precHMS_;
  int precDMS_;
  int precArcmin_;
  int precArcsec_;

  int markerEpsilon;       // mouse tolerance for select/edit
  int showMarkers;
  int showMarkersText;
  int centroidAuto;
  int centroidIteration;
  float centroidRadius;
  int preserveMarkers;       // flag to indicate preserve between loads

  GC markerGC_; // marker gc
  GC markerGCXOR_; // marker xor gc
  GC selectGCXOR; // select gc

  Grid* grid;
  GC gridGC_;

  GC contourGC_;

  char* bgColorName;
  XColor* bgColor;
  char bgTrueColor_[4];   // color encoded

  char* nanColorName;
  XColor* nanColor;
  char nanTrueColor_[4];  // color encoded

  float dlist[2];

  char* colorbartag;

  Matrix dataToImage;
  Matrix imageToData;

  Matrix refToUser;
  Matrix userToRef;
  Matrix refToWidget;
  Matrix widgetToRef;
  Matrix refToCanvas;
  Matrix canvasToRef;
  Matrix refToWindow;
  Matrix windowToRef;

  Matrix userToWidget;
  Matrix widgetToUser;
  Matrix userToCanvas;
  Matrix canvasToUser;

  Matrix widgetToCanvas;
  Matrix canvasToWidget;
  Matrix widgetToWindow;
  Matrix windowToWidget;

  Matrix canvasToWindow;
  Matrix windowToCanvas;

  Matrix refToMagnifier;
  Matrix magnifierToRef;
  Matrix userToMagnifier;
  Matrix magnifierToUser;
  Matrix widgetToMagnifier;
  Matrix magnifierToWidget;

  Matrix refToPanner;
  Matrix pannerToRef;
  Matrix userToPanner;
  Matrix pannerToUser;
  Matrix widgetToPanner;
  Matrix pannerToWidget;

 private:
  void bltHist(char*, char*); // frblt.C

  void invalidPixmap();

  int updatePixmap(const BBox&);

 protected:
  void alignIRAF();
  virtual void alignWCS();
  virtual void alignWCS(Coord::CoordSystem, Coord::SkyFrame);
  virtual void alignWCS(FitsImage*, Coord::CoordSystem);

  void bltCut(char*, char*, Coord::Orientation, const Vector&, 
	      int, Base::CutMethod);
  void bltCutFits(double*, double*, int, Coord::Orientation, const Vector&,
		  int, Base::CutMethod);

  double calcZoom(Vector,Vector);
  virtual double calcZoomPanner() =0;
  virtual void cancelDetach() =0;
  virtual void centerImage();
  Marker* createMarker(Marker*);
  void createTemplate(const Vector&, istream&);
  void contourCreatePolygon(List<ContourLevel>&);

  virtual int doRender();
  void doubleToTclArray(double, const char*, const char*, const char*);

  void encodeTrueColor(int oo, int bb) {byteorder_ = oo; bitsperpixel_ = bb;}
  virtual void encodeTrueColor(XColor*, char*) =0;
  virtual void encodeTrueColor(unsigned char*, XImage*) =0;

  virtual unsigned char* fillImage(int, int, Coord::InternalSystem) =0;

  void getInfoClearName(char*);
  void getInfoClearValue(char*);
  void getInfoClearWCS(char*);

  Coord::Orientation getOrientation() {return orientation;}
  double getRotation() {return rotation + wcsRotation;}
  Coord::Orientation getWCSOrientation() {return wcsOrientation;}

  int hasATMV();
  int hasContour();
  int hasContourAux();
  int hasDTMV();
  int hasLTMV();
  int hasWCS(Coord::CoordSystem);
  int hasWCSCel(Coord::CoordSystem); 
  int hasWCSLinear(Coord::CoordSystem); 
  int hasWCS3D(Coord::CoordSystem);

  virtual BBox imageBBox(FrScale::SecMode);
  Vector imageCenter(FrScale::SecMode);
  Vector imageSize(FrScale::SecMode);

  virtual int isIIS();
  FitsImage* isInFits(const Vector&, Coord::InternalSystem, Vector*);
  FitsImage* isInCFits(const Vector&, Coord::InternalSystem, Vector*);
  virtual int isAzElZero() {return 1;}
  virtual int isFrame() {return 0;}
  virtual int isFrame3d() {return 0;}
  virtual int isFrameRGB() {return 0;}

  void loadDone(int, LayerType);

  void markerAnalysisHistogram(Marker*, double**, double**, const BBox&, int);
  int markerAnalysisPlot2d(Marker*, double**, double**, double**, double**,
			   Vector&, Vector&, int, 
			   Coord::CoordSystem, Coord::SkyFrame, 
			   Marker::AnalysisMethod);
  int markerAnalysisPlot3d(Marker*, double**, double**, const BBox&,
			   Coord::CoordSystem, Marker::AnalysisMethod);
  int markerAnalysisRadial(Marker*, double**, double**, double**, 
			   int, Vector*, BBox*, Coord::CoordSystem);
  int markerAnalysisPanda(Marker*, double**, double**, double**, 
			  int, Vector*, int, double*, 
			  BBox*, Coord::CoordSystem);
  int markerAnalysisStats1(Marker*, FitsImage*, ostream&, 
			   Coord::CoordSystem, Coord::SkyFrame);
  void markerAnalysisStats2(FitsImage*, ostream&, Coord::CoordSystem,
			    int, int, double, int);
  void markerAnalysisStats3(ostream&);
  void markerAnalysisStats4(ostream&, int, double, double, double,	
			    double, double, double);
  void markerAnalysisStats(Marker*, ostream&, const BBox&, 
			   Coord::CoordSystem, Coord::SkyFrame);
  void markerAnalysisStats(Marker*, ostream&, int, BBox*, 
			   Coord::CoordSystem, Coord::SkyFrame);
  void markerAnalysisStats(Marker*, ostream&, int, int, 
			   BBox*, Coord::CoordSystem, Coord::SkyFrame);

  void markerListHeader(ostream&);
  void markerListXMLHeader(ostream&, Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat);
  void markerListXMLFooter(ostream&);
  void markerListSAOtngHeader(ostream&,Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat);
  void markerUndo(Marker*, UndoMarkerType);

  void parseMarker(MarkerFormat,istream&);
  int postscriptProc(int prepass);
  void printCoordSystem(Coord::CoordSystem);
  void printDistFromRef(FitsImage*, const Vector&, const Vector&, Coord::CoordSystem, Coord::DistFormat);
  void printDouble(double);
  void printFromRef(FitsImage*, const Vector&, Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat);
  void printLenFromRef(FitsImage*, double, Coord::CoordSystem, Coord::DistFormat);
  void printLenFromRef(FitsImage*, const Vector&, Coord::CoordSystem, Coord::DistFormat);
  void printInteger(int);
  void printSkyFrame(Coord::SkyFrame);
  void printSkyFormat(Coord::SkyFormat);
  void printDistFormat(Coord::DistFormat);
  void ps();
  void psCrosshair(PSColorSpace);
  virtual void psGraphics(PSColorSpace) {}
  void psImage(ostream&, Filter&, int, int, float);
  void psMarkers(List<Marker>*, int);
  Matrix psMatrix(float scale, int width, int height);
  virtual void pushMatrices();
  virtual void pushMagnifierMatrices();
  virtual void pushPannerMatrices();
  virtual void pushPSMatrices(float, int, int);

  virtual void reset();
  void resetSecMode();

  virtual void setBinCursor() =0;
  void setClip();
  FrScale::SecMode secMode();
  void setSecMode(FrScale::SecMode);
  virtual void setSlice(int,int);

  void unhighliteMarkers();
  void unselectMarkers(List<Marker>*);
  void update(UpdateType);
  void update(UpdateType,BBox);
  void updateMarkers(List<Marker>*);
  void updateMarkerCBs(List<Marker>*);
  void updateMarkerCoords(List<Marker>*, const Matrix&);
  virtual void unloadFits();
  virtual void unloadAllFits();
  void updateBase();
  virtual void updateBin(const Matrix&);
  virtual void updateBlock(const Vector&);
  void updateCBMarkers(List<Marker>*);
  virtual void updateColorScale() =0;
  virtual void updateGCs();
  void updateMagnifier();
  void updateMagnifier(const Vector&);

  virtual void updateMatrices();
  virtual void updateMagnifierMatrices();
  virtual void updatePannerMatrices();

  void updateNow(UpdateType); 
  void updateNow(UpdateType,BBox);
  virtual void updatePanner();
  void updatePM(const BBox&);

  char* varcat(char*, char*, char, char*);
  virtual int validColorScale() =0;

  void x11Crosshair(Pixmap, Coord::InternalSystem, int, int);
  void x11Dash(GC, int);
  virtual void x11Graphics();
  virtual void x11MagnifierCursor(const Vector&) {}
  void x11MagnifierMarkers(List<Marker>*, const BBox& bb);
  void x11Markers(List<Marker>*, const BBox&);
  void x11MarkerXOR(Marker*);
  void xmlParse(istream&);
  void xmlParseFIELD(void*, int*, char**, char**, char**, char**, int);
  void xmlParseTR(char**, int*, char**, char**, char**, char**, int);
  void xmlSetProps(unsigned short*, unsigned short, char*);
  int xmlCount(const char*);
  Vector xmlPoint(FitsImage*, const char* x, const char* y, 
		  Coord::CoordSystem sys, Coord::SkyFrame sky, Coord::SkyFormat format, int which=0);
  List<Vertex>* xmlVertex(FitsImage*, const char*, const char*, 
			  Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat);
  double xmlAngle(const char*, int, double, Coord::AngleFormat, Coord::CoordSystem, Coord::SkyFrame);
  double* xmlAngles(const char*, int, double, int, Coord::AngleFormat, Coord::CoordSystem, Coord::SkyFrame);
  double* xmlDistance(FitsImage*, const char*, int, Coord::CoordSystem, Coord::DistFormat);
  Vector* xmlDistance(FitsImage*, const char*, const char*, int, Coord::CoordSystem, Coord::DistFormat);
  void ximageToPixmap(Pixmap, XImage*, Coord::InternalSystem);
  virtual void ximageToPixmapMagnifier();

  Vector zoom() {return zoom_;}

#ifdef MAC_OSX_TK
  void macosx();
  void macosxCrosshair();
  virtual void macosxGraphics() {}
  void macosxImage(float, int, int, const Vector&, const Vector&);
  void macosxMarkers(List<Marker>* ml);
#endif
#ifdef __WIN32
  void win32();
  void win32Crosshair();
  virtual void win32Graphics() {}
  void win32Image(float, int, int, const Vector&, const Vector&);
  void win32Markers(List<Marker>* ml);
#endif

 public:
  Base(Tcl_Interp* i, Tk_Canvas c, Tk_Item* item);
  virtual ~Base();

  virtual FrameType frameType() =0;
  void calcAlignWCS(FitsImage*, Coord::CoordSystem, Coord::SkyFrame,
		    Coord::Orientation*, Matrix*, double*);
#ifdef OLDWCS
  void calcAlignWCS(FitsImage*, FitsImage*, Coord::CoordSystem, Coord::CoordSystem, Coord::SkyFrame,
		    Coord::Orientation*, Matrix*, double*, Vector*);
#endif
  Matrix calcAlignWCS(FitsImage*, FitsImage*, Coord::CoordSystem, Coord::CoordSystem, Coord::SkyFrame);
  Vector centroid(const Vector&);

  FitsImage* findFits();
  FitsImage* findFits(Coord::CoordSystem, const Vector&);
  FitsImage* findFits(const Vector&);
  FitsImage* findFits(int);
  int findFits(FitsImage*);
  FitsImage* findAllFits(int);
  int fitsCount();

  Coord::Orientation IRAFOrientation(Coord::Orientation);
  int isMosaic();
  int isCube();
  int isBinTable();

  virtual Vector mapFromRef(const Vector&, Coord::InternalSystem) =0;
  virtual Vector mapToRef(const Vector&, Coord::InternalSystem) =0;
  double mapAngleFromRef(double,Coord::CoordSystem,Coord::SkyFrame =Coord::FK5);
  double mapAngleToRef(double, Coord::CoordSystem, Coord::SkyFrame =Coord::FK5);

  int parse(istringstream&);

  void resetCompositeMarker() {compositeMarker = NULL;}

  Coord::CoordSystem wcsSystem() {return wcsSystem_;}
  Coord::SkyFrame wcsSky() {return wcsSky_;}
  Coord::SkyFormat wcsSkyFormat() {return wcsSkyFormat_;}

  Coord::CoordSystem xySystem() {return xySystem_;}
  Coord::SkyFrame xySky() {return xySky_;}

  void matchCmd(const char* xxname1, const char* yyname1,
		Coord::CoordSystem sys1, Coord::SkyFrame sky1,
		const char* xxname2, const char* yyname2,
		Coord::CoordSystem sys2, Coord::SkyFrame sky2,
		double rad, Coord::CoordSystem sys, Coord::DistFormat dist,
		const char* rr);

  // Axes Order
  void axesOrderCmd(int);
  void getAxesOrderCmd();

  // Background Commands
  void bgColorCmd(const char*);
  void getBgColorCmd();

  // Bin Commands
  void binCmd(const Vector&, const char*, const char*, const char*);
  void binCmd(const Vector&, const Vector&, const char*, const char*, 
	      const char*);
  void binCmd(const Vector&, int, const Vector&, 
	      const char*, const char*, const char*, const char*);
  void binCmd(const Vector&, int, const Vector&, const Vector&, 
	      const char*, const char*, const char*, const char*);
  void binAboutCmd();
  void binAboutCmd(const Vector&);
  void binColsCmd(const char*, const char*, const char*);
  void binDepthCmd(int);
  void binFactorCmd(const Vector&);
  void binFactorAboutCmd(const Vector&, const Vector&);
  void binFactorToCmd(const Vector&);
  void binFactorToAboutCmd(const Vector&, const Vector&);
  void binFunctionCmd(FitsHist::Function);
  void binBufferSizeCmd(int);
  void binFilterCmd(const char*);
  virtual void binToFitCmd() =0;
  void getBinDepthCmd();
  void getBinFactorCmd();
  void getBinFunctionCmd();
  void getBinBufferSizeCmd();
  void getBinCursorCmd();
  void getBinFilterCmd();
  void getBinColsCmd();
  void getBinColsMinMaxCmd(const char*);
  void getBinColsDimCmd(const char*);
  void getBinListCmd();
  void hasBinColCmd(const char*);

  // Block Commands
  void blockCmd(const Vector&);
  void blockToCmd(const Vector&);
  virtual void blockToFitCmd() =0;
  void getBlockCmd();

  // Clip Commands
  virtual void clipScopeCmd(FrScale::ClipScope);
  void clipModeCmd(float);
  void clipModeCmd(FrScale::ClipMode);
  void clipMinMaxCmd(FrScale::MinMaxMode, int);
  // backward compatibilty backup
  void clipMinMaxModeCmd(FrScale::MinMaxMode);
  // backward compatibilty backup
  void clipMinMaxSampleCmd(int);
  void clipUserCmd(double, double);
  void clipZScaleCmd(float,int,int);
  // backward compatibilty backup
  void clipZScaleContrastCmd(float);
  // backward compatibilty backup
  void clipZScaleSampleCmd(int);
  // backward compatibilty backup
  void clipZScaleLineCmd(int);

  void getClipCmd();
  void getClipCmd(float, FrScale::ClipScope);
  void getClipCmd(FrScale::ClipMode, FrScale::ClipScope);
  void getClipMinMaxModeCmd();
  void getClipMinMaxSampleCmd();
  void getClipModeCmd();
  void getClipPreserveCmd();
  void getClipScopeCmd();
  void getClipUserCmd();
  void getClipZScaleContrastCmd();
  void getClipZScaleSampleCmd();
  void getClipZScaleLineCmd();
  void getHistogramCmd(char*, char*, int);
  void getMinMaxCmd();
  void hasDATAMINCmd();
  void hasIRAFMINCmd();

  // Colormap Commands
  void colorbarTagCmd(const char*);
  virtual void colormapCmd(int, float, float, int, unsigned char*, int) {}
  virtual void colormapCmd(float, float, float, float, float, float, int,
			   unsigned char*, int) {}
  virtual void colormapBeginCmd() {}
  virtual void colormapEndCmd() {}
  virtual void colormapMotionCmd(int, float, float, int, unsigned char*, int) {}
  virtual void colormapMotionCmd(float, float, float, float, float, float, int,
				 unsigned char*, int) {}
  virtual void getColorbarCmd() =0;
  void getColorbarTagCmd();

  // Contour Commands
  void contourAppendCmd(ContourLevel*);
  void contourCreateCmd(const char*, int, int, FVContour::Method, int, int, FrScale::ColorScaleType, float, FrScale::ClipMode, float, FrScale::ClipScope, double, double, const char*);
  void contourCreatePolygonCmd();
  void contourDeleteCmd();
  void contourDeleteAuxCmd();
  void contourLoadCmd(const char*);
  void contourLoadCmd(const char*, const char*, int, int);
  void contourLoadCmd(const char*, Coord::CoordSystem, Coord::SkyFrame, const char*, int, int);
  void contourPasteCmd(const char*);
  void contourPasteCmd(const char*, const char*, int, int);
  void contourSaveCmd(const char*, Coord::CoordSystem, Coord::SkyFrame);
  void contourSaveAuxCmd(const char*, Coord::CoordSystem, Coord::SkyFrame);

  void getContourCmd(Coord::CoordSystem sys, Coord::SkyFrame sky);
  void getContourClipCmd();
  void getContourClipModeCmd();
  void getContourClipScopeCmd();
  void getContourColorNameCmd();
  void getContourDashCmd();
  void getContourLevelCmd();
  void getContourLineWidthCmd();
  void getContourMethodCmd();
  void getContourNumLevelCmd();
  void getContourScaleCmd();
  void getContourScaleLogCmd();
  void getContourSmoothCmd();
  void hasContourCmd();
  void hasContourAuxCmd();

  // Coordinate Commands
  void getWCSCmd();
  void wcsCmd(Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat);
  void getWCSNameCmd(Coord::CoordSystem);
  void getWCSAlignPointerCmd();
  void getCoordCmd(const Vector&, Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat);
  void getCoord3axisCmd(double, Coord::CoordSystem, Coord::CoordSystem, int);
  virtual void getCursorCmd(Coord::InternalSystem) =0;
  virtual void getCursorCmd(Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat) =0;
  void hasSystemCmd(Coord::CoordSystem);
  void hasAmplifierCmd();
  void hasDetectorCmd();
  void hasPhysicalCmd();
  void hasImageCmd();
  void hasWCSAltCmd();
  void hasWCSCmd(Coord::CoordSystem);
  void hasWCSCelCmd(Coord::CoordSystem);
  void hasWCSLinearCmd(Coord::CoordSystem);
  void hasWCS3DCmd(Coord::CoordSystem);

  // Crop Commands
  void cropCmd();
  void cropCmd(const Vector&, const Vector&, Coord::CoordSystem, Coord::SkyFrame);
  void cropCenterCmd(const Vector&, Coord::CoordSystem, Coord::SkyFrame, const Vector&, Coord::CoordSystem, Coord::DistFormat);
  void cropBeginCmd(const Vector&);
  void cropMotionCmd(const Vector&);
  void cropEndCmd(const Vector&);
  void crop3dCmd();
  void crop3dCmd(double, double, Coord::CoordSystem);
  virtual void crop3dBeginCmd(const Vector&, int) {}
  virtual void crop3dMotionCmd(const Vector&, int) {}
  virtual void crop3dEndCmd(const Vector&, int) {}
  void getCropCmd(Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat);
  void getCropCenterCmd(Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat, Coord::CoordSystem, Coord::DistFormat);
  void getCrop3dCmd(Coord::CoordSystem);
  void hasCropCmd();

  // CrossHair Commands
  void crosshairCmd(int);
  void crosshairCmd(const Vector&, Coord::InternalSystem);
  void crosshairCmd(const Vector&, Coord::CoordSystem, Coord::SkyFrame =Coord::FK5);
  void crosshairWarpCmd(const Vector&);
  void getCrosshairCmd(Coord::InternalSystem);
  void getCrosshairCmd(Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat);
  void getCrosshairStatusCmd();

  // DATASEC Commands
  void DATASECCmd(int);
  void getDATASECCmd();
  void hasDATASECCmd();

  // Data Values
  void getDataValuesCmd(int, const Vector&, Coord::CoordSystem, 
			Coord::SkyFrame, const Vector&, char*);
  void getDataValuesCmd(const Vector&, Coord::InternalSystem, const Vector&);

  // Fits Commands
  void getBitpixCmd();
  void getFitsNAxesCmd();
  void getFitsCountCmd();
  void getFitsCenterCmd(Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat);
  void getFitsDepthCmd(int);
  void getFitsExtCmd(int);
  void getFitsExtCmd(const Vector&, Coord::InternalSystem);
  void getFitsFileNameCmd(FileNameType);
  void getFitsFileNameCmd(int, FileNameType);
  void getFitsFileNameCmd(const Vector&, Coord::InternalSystem, FileNameType);
  void getFitsHeaderCmd(int);
  void getFitsHeaderWCSCmd(int);
  void getFitsHeaderKeywordCmd(int,const char*);
  void getFitsObjectNameCmd();
  void getFitsSizeCmd();
  void getFitsSizeCmd(Coord::CoordSystem, Coord::SkyFrame, Coord::DistFormat);
  void getFitsSliceCmd(int id);
  void getFitsSliceCmd(int id, Coord::CoordSystem sys);
  void hasFitsCmd();
  void hasFitsHPXCmd();
  void hasFitsBinCmd();
  void hasFitsCubeCmd();
  void hasFitsMosaicCmd();

  void loadFitsAllocCmd(const char*, const char*, LayerType);
  void loadFitsAllocGZCmd(const char*, const char*, LayerType);
  void loadFitsChannelCmd(const char*, const char*, LayerType);
  void loadFitsMMapCmd(const char*, LayerType);
  void loadFitsSMMapCmd(const char*, const char*, LayerType);
  void loadFitsMMapIncrCmd(const char*, LayerType);
  void loadFitsShareCmd(ShmType, int, const char*, LayerType);
  void loadFitsSShareCmd(ShmType, int, int, const char*, LayerType);
  void loadFitsSocketCmd(int, const char*, LayerType);
  void loadFitsSocketGZCmd(int, const char*, LayerType);
  void loadFitsVarCmd(const char*, const char*, LayerType);

  void loadArrAllocCmd(const char*, const char*, LayerType);
  void loadArrAllocGZCmd(const char*, const char*, LayerType);
  void loadArrChannelCmd(const char*, const char*, LayerType);
  void loadArrMMapCmd(const char*, LayerType);
  void loadArrMMapIncrCmd(const char*, LayerType);
  void loadArrShareCmd(ShmType, int, const char*, LayerType);
  void loadArrSocketCmd(int, const char*, LayerType);
  void loadArrSocketGZCmd(int, const char*, LayerType);
  void loadArrVarCmd(const char*, const char*, LayerType);

  void loadENVISMMapCmd(const char*, const char*);

  void loadNRRDAllocCmd(const char*, const char*, LayerType);
  void loadNRRDChannelCmd(const char*, const char*, LayerType);
  void loadNRRDMMapCmd(const char*, LayerType);
  void loadNRRDShareCmd(ShmType, int, const char*, LayerType);
  void loadNRRDSocketCmd(int, const char*, LayerType);
  void loadNRRDVarCmd(const char*, const char*, LayerType);

  virtual void loadPhotoCmd(const char*, const char*);
  virtual void loadSlicePhotoCmd(const char*, const char*);

  void loadExtCubeAllocCmd(const char*, const char*);
  void loadExtCubeAllocGZCmd(const char*, const char*);
  void loadExtCubeChannelCmd(const char*, const char*);
  void loadExtCubeMMapCmd(const char*);
  void loadExtCubeMMapIncrCmd(const char*);
  void loadExtCubeShareCmd(ShmType, int, const char*);
  void loadExtCubeSocketCmd(int, const char*);
  void loadExtCubeSocketGZCmd(int, const char*);
  void loadExtCubeVarCmd(const char*, const char*);

  void loadSliceAllocCmd(const char*, const char*);
  void loadSliceAllocGZCmd(const char*, const char*);
  void loadSliceChannelCmd(const char*, const char*);
  void loadSliceMMapCmd(const char*);
  void loadSliceSMMapCmd(const char*, const char*);
  void loadSliceMMapIncrCmd(const char*);
  void loadSliceShareCmd(ShmType, int, const char*);
  void loadSliceSShareCmd(ShmType, int, int, const char*);
  void loadSliceSocketCmd(int, const char*);
  void loadSliceSocketGZCmd(int, const char*);
  void loadSliceVarCmd(const char*, const char*);

  void loadMosaicImageAllocCmd(MosaicType, Coord::CoordSystem, const char*, const char*, LayerType);
  void loadMosaicImageAllocGZCmd(MosaicType, Coord::CoordSystem, const char*, const char*, LayerType);
  void loadMosaicImageChannelCmd(MosaicType, Coord::CoordSystem, const char*, const char*, LayerType);
  void loadMosaicImageMMapCmd(MosaicType, Coord::CoordSystem, const char*, LayerType);
  void loadMosaicImageMMapIncrCmd(MosaicType, Coord::CoordSystem, const char*, LayerType);
  void loadMosaicImageShareCmd(MosaicType, Coord::CoordSystem, ShmType, int, const char*, LayerType);
  void loadMosaicImageSocketCmd(MosaicType, Coord::CoordSystem, int, const char*, LayerType);
  void loadMosaicImageSocketGZCmd(MosaicType, Coord::CoordSystem, int, const char*, LayerType);
  void loadMosaicImageVarCmd(MosaicType, Coord::CoordSystem, const char*,const char*, LayerType);

  void loadMosaicAllocCmd(MosaicType, Coord::CoordSystem, const char*, const char*, LayerType);
  void loadMosaicAllocGZCmd(MosaicType, Coord::CoordSystem, const char*, const char*, LayerType);
  void loadMosaicChannelCmd(MosaicType, Coord::CoordSystem, const char*, const char*, LayerType);
  void loadMosaicMMapCmd(MosaicType, Coord::CoordSystem, const char*, LayerType);
  void loadMosaicSMMapCmd(MosaicType, Coord::CoordSystem, const char*, const char*, LayerType);
  void loadMosaicMMapIncrCmd(MosaicType, Coord::CoordSystem, const char*, LayerType);
  void loadMosaicShareCmd(MosaicType, Coord::CoordSystem, ShmType, int, const char*, LayerType);
  void loadMosaicSShareCmd(MosaicType, Coord::CoordSystem, ShmType, int, int, const char*, LayerType);
  void loadMosaicSocketCmd(MosaicType, Coord::CoordSystem, int, const char*, LayerType);
  void loadMosaicSocketGZCmd(MosaicType, Coord::CoordSystem, int, const char*, LayerType);
  void loadMosaicVarCmd(MosaicType, Coord::CoordSystem, const char*, const char*, LayerType);

  void loadMosaicImageWFPC2AllocCmd(const char*, const char*);
  void loadMosaicImageWFPC2AllocGZCmd(const char*, const char*);
  void loadMosaicImageWFPC2ChannelCmd(const char*, const char*);
  void loadMosaicImageWFPC2MMapCmd(const char*);
  void loadMosaicImageWFPC2MMapIncrCmd(const char*);
  void loadMosaicImageWFPC2ShareCmd(ShmType, int, const char*);
  void loadMosaicImageWFPC2SocketCmd(int, const char*);
  void loadMosaicImageWFPC2SocketGZCmd(int, const char*);
  void loadMosaicImageWFPC2VarCmd(const char*, const char*);

  // Fits RGB
  virtual void loadRGBCubeAllocCmd(const char*, const char*) {}
  virtual void loadRGBCubeAllocGZCmd(const char*, const char*) {}
  virtual void loadRGBCubeChannelCmd(const char*, const char*) {}
  virtual void loadRGBCubeMMapCmd(const char*) {}
  virtual void loadRGBCubeSMMapCmd(const char*, const char*) {}
  virtual void loadRGBCubeMMapIncrCmd(const char*) {}
  virtual void loadRGBCubeShareCmd(ShmType, int, const char*) {}
  virtual void loadRGBCubeSShareCmd(ShmType,int,int,const char*) {}
  virtual void loadRGBCubeSocketCmd(int, const char*) {}
  virtual void loadRGBCubeSocketGZCmd(int, const char*) {}
  virtual void loadRGBCubeVarCmd(const char*, const char*) {}

  virtual void loadRGBImageAllocCmd(const char*, const char*) {}
  virtual void loadRGBImageAllocGZCmd(const char*, const char*) {}
  virtual void loadRGBImageChannelCmd(const char*, const char*) {}
  virtual void loadRGBImageMMapCmd(const char*) {}
  virtual void loadRGBImageMMapIncrCmd(const char*) {}
  virtual void loadRGBImageShareCmd(ShmType, int, const char*) {}
  virtual void loadRGBImageSocketCmd(int, const char*) {}
  virtual void loadRGBImageSocketGZCmd(int, const char*) {}
  virtual void loadRGBImageVarCmd(const char*, const char*) {}

  virtual void loadArrayRGBCubeAllocCmd(const char*, const char*) {}
  virtual void loadArrayRGBCubeAllocGZCmd(const char*, const char*) {}
  virtual void loadArrayRGBCubeChannelCmd(const char*, const char*) {}
  virtual void loadArrayRGBCubeMMapCmd(const char*) {}
  virtual void loadArrayRGBCubeMMapIncrCmd(const char*) {}
  virtual void loadArrayRGBCubeShareCmd(ShmType, int, const char*) {}
  virtual void loadArrayRGBCubeSocketCmd(int, const char*) {}
  virtual void loadArrayRGBCubeSocketGZCmd(int, const char*) {}
  virtual void loadArrayRGBCubeVarCmd(const char*, const char*) {}

  virtual void savePhotoCmd(const char*) {}

  void saveFits(OutFitsStream&);
  void saveFitsFileCmd(const char*);
  void saveFitsChannelCmd(const char*);
  void saveFitsSocketCmd(int);

  void saveFitsTable(OutFitsStream&);
  void saveFitsTableFileCmd(const char*);
  void saveFitsTableChannelCmd(const char*);
  void saveFitsTableSocketCmd(int);

  void saveFitsSlice(OutFitsStream&);
  void saveFitsSliceFileCmd(const char*);
  void saveFitsSliceChannelCmd(const char*);
  void saveFitsSliceSocketCmd(int);

  void saveFitsExtCube(OutFitsStream&);
  void saveFitsExtCubeFileCmd(const char*);
  void saveFitsExtCubeChannelCmd(const char*);
  void saveFitsExtCubeSocketCmd(int);

  void saveFitsMosaic(OutFitsStream&, int);
  void saveFitsMosaicFileCmd(const char*, int);
  void saveFitsMosaicChannelCmd(const char*, int);
  void saveFitsMosaicSocketCmd(int, int);

  void saveFitsMosaicImage(OutFitsStream&);
  void saveFitsMosaicImageFileCmd(const char*);
  void saveFitsMosaicImageChannelCmd(const char*);
  void saveFitsMosaicImageSocketCmd(int);

  virtual void saveFitsRGBImage(OutFitsStream&) {}
  virtual void saveFitsRGBImageFileCmd(const char*) {}
  virtual void saveFitsRGBImageChannelCmd(const char*) {}
  virtual void saveFitsRGBImageSocketCmd(int) {}

  virtual void saveFitsRGBCube(OutFitsStream&) {}
  virtual void saveFitsRGBCubeFileCmd(const char*) {}
  virtual void saveFitsRGBCubeChannelCmd(const char*) {}
  virtual void saveFitsRGBCubeSocketCmd(int) {}

  virtual void saveFitsResampleFileCmd(const char*) {}
  virtual void saveFitsResampleChannelCmd(const char*) {}
  virtual void saveFitsResampleSocketCmd(int) {}

  void saveArray(OutFitsStream&, FitsFile::ArchType);
  void saveArrayFileCmd(const char*, FitsFile::ArchType);
  void saveArrayChannelCmd(const char*, FitsFile::ArchType);
  void saveArraySocketCmd(int, FitsFile::ArchType);

  virtual void saveArrayRGBCube(OutFitsStream&, FitsFile::ArchType) {}
  virtual void saveArrayRGBCubeFileCmd(const char*, FitsFile::ArchType) {}
  virtual void saveArrayRGBCubeChannelCmd(const char*, FitsFile::ArchType) {}
  virtual void saveArrayRGBCubeSocketCmd(int, FitsFile::ArchType) {}

  void saveNRRD(OutFitsStream&, FitsFile::ArchType);
  void saveNRRDFileCmd(const char*, FitsFile::ArchType);
  void saveNRRDChannelCmd(const char*, FitsFile::ArchType);
  void saveNRRDSocketCmd(int, FitsFile::ArchType);

  void saveENVI(ostream&, OutFitsStream&, FitsFile::ArchType);
  void saveENVIFileCmd(const char*, const char*, FitsFile::ArchType);

  void sliceCmd(int, int);
  void sliceCmd(int, double, Coord::CoordSystem);

  void updateFitsCmd(int);
  void updateFitsCmd(int, BBox, int);
  void unloadFitsCmd();

  // Fitsy Commands
  void fitsyHasExtCmd(const char*);

  // Frame Commands
  void clearCmd();
  void getFitsHeightCmd();
  virtual void getTypeCmd() =0;
  void getFitsWidthCmd();
  void highliteCmd(int);
  void warpCmd(const Vector&);
  void warpToCmd(const Vector&);

  // Graph Commands
  void getHorzCutCmd(char*, char*, const Vector&, Coord::InternalSystem, 
		     int, Base::CutMethod);
  void getVertCutCmd(char*, char*, const Vector&, Coord::InternalSystem, 
		     int, Base::CutMethod);

  // Grid Commands
  virtual void gridCmd(Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat, 
		       Grid::GridType, const char*, const char*) =0;
  void gridDeleteCmd();
  void getGridCmd();
  void getGridOptionCmd();
  void getGridVarsCmd();
  void hasGridCmd();

  // IIS Commands
  virtual void iisCmd(int, int) {}
  virtual void iisCursorModeCmd(int) {}
  virtual void iisEraseCmd() {}
  virtual void iisGetCmd(char*, int, int, int, int) {}
  virtual void iisGetCursorCmd() {}
  virtual void iisGetFileNameCmd() {}
  virtual void iisGetFileNameCmd(int) {}
  virtual void iisGetFileNameCmd(const Vector&) {}
  virtual void iisMessageCmd(const char*) {}
  virtual void iisSetCmd(const char*, int, int, int, int) {}
  virtual void iisSetCursorCmd(const Vector&, Coord::InternalSystem) {}
  virtual void iisSetCursorCmd(const Vector&, Coord::CoordSystem) {}
  virtual void iisSetFileNameCmd(const char*) {}
  virtual void iisSetFileNameCmd(const char*,int) {}
  virtual void iisUpdateCmd() {}
  virtual void iisWCSCmd(const Matrix&, const Vector&, int) {}
  void hasIISCmd();

  // Info Commands
  void getInfoCmd(char*);
  virtual void getInfoCmd(const Vector&, Coord::InternalSystem, char*) =0;
  void getInfoClipCmd();
  void getValueCmd(const Vector&, Coord::InternalSystem);

  // loadIncr is only used by LICK OBS
  // maintained for backward compatibility
  void loadIncrDataCmd(int, int, int, int, int);
  void loadIncrMinMaxCmd(int, int, int, int, int);
  void loadIncrEndCmd();

  // Magnifier Commands
  void magnifierCmd(char*, int, int);
  void magnifierCmd(int);
  void magnifierGraphicsCmd(int);
  void magnifierCursorCmd(int);
  void magnifierZoomCmd(double);
  void magnifierColorCmd(const char*);
  void updateMagnifierCmd(const Vector& v);

  // Marker Commands
  // Basic Regions
  void createCircleCmd(const Vector&, 
		       double, int,
		       const char*, int*, int, const char*, 
		       const char*, unsigned short, const char*,
		       const List<Tag>&, const List<CallBack>& cb);
  void createEllipseCmd(const Vector&, 
			const Vector&, 
			double, int,
			const char*, int*, int, const char*, 
			const char*, unsigned short, const char*,
			const List<Tag>&, const List<CallBack>& cb);
  void createBoxCmd(const Vector&, 
		    const Vector&, 
		    double, int,
		    const char*, int*, int, const char*, 
		    const char*, unsigned short, const char*,
		    const List<Tag>&, const List<CallBack>& cb);
  void createPolygonCmd(const Vector&, 
			const Vector&, int,
			const char*, int*, int, const char*, 
			const char*, unsigned short, const char*,
			const List<Tag>&, const List<CallBack>& cb);
  void createPolygonCmd(const List<Vertex>&, int,
			const char*, int*, int, const char*, 
			const char*, unsigned short, const char*,
			const List<Tag>&, const List<CallBack>& cb);
  void createSegmentCmd(const Vector&, 
			const Vector&,
			const char*, int*, int, const char*, 
			const char*, unsigned short, const char*,
			const List<Tag>&, const List<CallBack>& cb);
  void createSegmentCmd(const List<Vertex>&,
			const char*, int*, int, const char*, 
			const char*, unsigned short, const char*,
			const List<Tag>&, const List<CallBack>& cb);
  void createLineCmd(const Vector&, 
		     const Vector&, 
		     int, int,
		     const char*, int*, int, const char*,
		     const char*, unsigned short, const char*,
		     const List<Tag>&, const List<CallBack>& cb);
  void createVectCmd(const Vector&, 
		     const Vector&, 
		     int,
		     const char*, int*, int, const char*,
		     const char*, unsigned short, const char*,
		     const List<Tag>&, const List<CallBack>& cb);
  void createVectCmd(const Vector&, 
		     double mag, double ang, 
		     int,
		     const char*, int*, int, const char*,
		     const char*, unsigned short, const char*,
		     const List<Tag>&, const List<CallBack>& cb);
  void createTextCmd(const Vector&, 
		     double, int,
		     const char*, int*, int, const char*, 
		     const char*, unsigned short, const char*,
		     const List<Tag>&, const List<CallBack>& cb);
  void createPointCmd(const Vector&, Point::PointShape, int,
		      const char*, int*, int, const char*,
		      const char*, unsigned short, const char*,
		      const List<Tag>&, 
		      const List<CallBack>& cb);

  // Measurement Regions
  void createRulerCmd(const Vector&, const Vector&, 
		      Coord::CoordSystem, Coord::SkyFrame, 
		      Coord::CoordSystem, Coord::DistFormat, const char*,
		      const char*, int*, int, const char*,
		      const char*, unsigned short, const char*,
		      const List<Tag>&, const List<CallBack>& cb);
  void createCompassCmd(const Vector&, double, 
			const char*, const char*,
			int, int,
			Coord::CoordSystem, Coord::SkyFrame,
			const char*, int*, int, const char*,
			const char*, unsigned short, const char*,
			const List<Tag>&, const List<CallBack>& cb);
  void createProjectionCmd(const Vector&, const Vector&, 
			   double, 
			   const char*, int*, int, const char*,
			   const char*, unsigned short, const char*,
			   const List<Tag>&, 
			   const List<CallBack>& cb);

  // Annulus Regions
  void createAnnulusCmd(const Vector&, 
			double, double, int,
			const char*, int*, int, const char*, 
			const char*, unsigned short, const char*,
			const List<Tag>&, const List<CallBack>& cb);
  void createAnnulusCmd(const Vector&, 
			int, double*,
			const char*, int*, int, const char*, 
			const char*, unsigned short, const char*,
			const List<Tag>&, const List<CallBack>& cb);
  void createEllipseAnnulusCmd(const Vector&, 
			       const Vector&, const Vector&, int, 
			       double,
			       const char*, int*, int, const char*, 
			       const char*, unsigned short, const char*,
			       const List<Tag>&, 
			       const List<CallBack>& cb);
  void createEllipseAnnulusCmd(const Vector&, 
			       int, Vector*,
			       double, 
			       const char*, int*, int,  const char*, 
			       const char*, unsigned short, const char*,
			       const List<Tag>&, 
			       const List<CallBack>& cb);
  void createBoxAnnulusCmd(const Vector&, 
			   const Vector&, const Vector&, int, 
			   double,
			   const char*, int*, int, const char*, 
			   const char*, unsigned short, const char*,
			   const List<Tag>&, 
			   const List<CallBack>& cb);
  void createBoxAnnulusCmd(const Vector&, 
			   int, Vector*,
			   double, 
			   const char*, int*, int, const char*, 
			   const char*, unsigned short, const char*,
			   const List<Tag>&, 
			   const List<CallBack>& cb);

  // Panda Regions
  void createCpandaCmd(const Vector&, 
		       double, double, int, 
		       double, double, int,
		       const char*, int*, int, const char*, 
		       const char*, unsigned short, const char*,
		       const List<Tag>&, const List<CallBack>& cb);
  void createCpandaCmd(const Vector&, 
		       int, double*,
		       int, double*,
		       const char*, int*, int, const char*, 
		       const char*, unsigned short, const char*,
		       const List<Tag>&, const List<CallBack>& cb);
  void createEpandaCmd(const Vector&, 
		       double, double, int, 
		       const Vector&, const Vector&, int, 
		       double,
		       const char*, int*, int, const char*, 
		       const char*, unsigned short, const char*,
		       const List<Tag>&, const List<CallBack>& cb);
  void createEpandaCmd(const Vector&, 
		       int, double*,
		       int, Vector*,
		       double,
		       const char*, int*, int, const char*, 
		       const char*, unsigned short, const char*,
		       const List<Tag>&, const List<CallBack>& cb);
  void createBpandaCmd(const Vector&, 
		       double, double, int, 
		       const Vector&, const Vector&, int, 
		       double,
		       const char*, int*, int, const char*, 
		       const char*, unsigned short, const char*,
		       const List<Tag>&, const List<CallBack>& cb);
  void createBpandaCmd(const Vector&, 
		       int, double*,
		       int, Vector*,
		       double,
		       const char*, int*, int, const char*, 
		       const char*, unsigned short, const char*,
		       const List<Tag>&, const List<CallBack>& cb);

  // Composite Regions
  void createCompositeCmd(const Vector&, double, int,
			  const char*, int*, int, const char*, 
			  const char*, unsigned short, const char*,
			  const List<Tag>&, const List<CallBack>& cb);
  void createCompositeCmd(
			  const char*, int*, int, const char*, 
			  const char*, unsigned short, const char*,
			  const List<Tag>&, const List<CallBack>& cb);

  // Template Regions
  void createTemplateCmd(const Vector&, const char*);
  void createTemplateCmd(const Vector&, Coord::CoordSystem, Coord::SkyFrame, 
			 const char*);
  void createTemplateVarCmd(const Vector&, const char* var);

  void getMarkerAnalysisHistogramCmd(int, char*, char*, int);
  void getMarkerAnalysisPlot2dCmd(int, char*, char*, char*, char*, 
				  Coord::CoordSystem, Coord::SkyFrame, 
				  Marker::AnalysisMethod);
  void getMarkerAnalysisPlot3dCmd(int, char*, char*,
				  Coord::CoordSystem, 
				  Marker::AnalysisMethod);
  void getMarkerAnalysisPandaCmd(int, Coord::CoordSystem);
  void getMarkerAnalysisRadialCmd(int, char*, char*, char*, Coord::CoordSystem);
  void getMarkerAnalysisStatsCmd(int, Coord::CoordSystem, Coord::SkyFrame);

  void getMarkerAngleCmd(int);
  void getMarkerAngleCmd(int, Coord::CoordSystem, Coord::SkyFrame);
  void getMarkerAnnulusRadiusCmd(int, Coord::CoordSystem, Coord::DistFormat);
  void getMarkerBoxFillCmd(int);
  void getMarkerBoxAnnulusRadiusCmd(int, Coord::CoordSystem, Coord::DistFormat);
  void getMarkerBoxRadiusCmd(int, Coord::CoordSystem, Coord::DistFormat);
  void getMarkerBpandaAnglesCmd(int);
  void getMarkerBpandaAnglesCmd(int, Coord::CoordSystem, Coord::SkyFrame);
  void getMarkerBpandaRadiusCmd(int, Coord::CoordSystem, Coord::DistFormat);
  void getMarkerCenterCmd(int, Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat);
  void getMarkerCentroidAutoCmd();
  void getMarkerCentroidRadiusCmd();
  void getMarkerCentroidIterationCmd();
  void getMarkerCentroidOptionCmd();
  void getMarkerCircleFillCmd(int);
  void getMarkerCircleRadiusCmd(int, Coord::CoordSystem, Coord::DistFormat);
  void getMarkerColorCmd();
  void getMarkerColorCmd(const char*);
  void getMarkerColorCmd(int);
  void getMarkerCompassArrowCmd(int);
  void getMarkerCompassLabelCmd(int);
  void getMarkerCompassRadiusCmd(int, Coord::CoordSystem, Coord::DistFormat);
  void getMarkerCompassSystemCmd(int);
  void getMarkerCompositeCmd(int);
  void getMarkerCpandaAnglesCmd(int);
  void getMarkerCpandaAnglesCmd(int, Coord::CoordSystem, Coord::SkyFrame);
  void getMarkerCpandaRadiusCmd(int, Coord::CoordSystem, Coord::DistFormat);
  void getMarkerEllipseFillCmd(int);
  void getMarkerEllipseRadiusCmd(int, Coord::CoordSystem, Coord::DistFormat);
  void getMarkerEllipseAnnulusRadiusCmd(int, Coord::CoordSystem,Coord::DistFormat);
  void getMarkerEpandaAnglesCmd(int);
  void getMarkerEpandaAnglesCmd(int, Coord::CoordSystem, Coord::SkyFrame);
  void getMarkerEpandaRadiusCmd(int, Coord::CoordSystem, Coord::DistFormat);
  void getMarkerEpsilonCmd();
  void getMarkerFontCmd();
  void getMarkerFontCmd(const char*);
  void getMarkerFontCmd(int);
  void getMarkerIdCmd(const char*);
  void getMarkerIdCmd(const Vector&);
  void getMarkerIdAllCmd();
  void getMarkerLineCmd(int, Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat);
  void getMarkerLineArrowCmd(int);
  void getMarkerLineLengthCmd(int, Coord::CoordSystem, Coord::DistFormat);
  void getMarkerLineWidthCmd();
  void getMarkerLineWidthCmd(int);
  void getMarkerMapLenFromRefCmd(int, double, Coord::CoordSystem, Coord::DistFormat);
  void getMarkerNumberCmd();
  void getMarkerPointShapeCmd(int);
  void getMarkerPointSizeCmd(int);
  void getMarkerPolygonFillCmd(int);
  void getMarkerPolygonSegmentCmd(const Vector&);
  void getMarkerPreserveCmd();
  void getMarkerProjectionPointsCmd(int, Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat);
  void getMarkerProjectionLengthCmd(int, Coord::CoordSystem, Coord::DistFormat);
  void getMarkerProjectionMethodCmd(int);
  void getMarkerProjectionWidthCmd(int, Coord::CoordSystem, Coord::DistFormat);
  void getMarkerPropertyCmd(unsigned short);
  void getMarkerPropertyCmd(const char*, unsigned short);
  void getMarkerPropertyCmd(int, unsigned short);
  void getMarkerRulerDistSpecCmd(int);
  void getMarkerRulerLengthCmd(int, Coord::CoordSystem, Coord::DistFormat);
  void getMarkerRulerPointCmd(int, Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat);
  void getMarkerRulerSystemCmd(int);
  void getMarkerSegmentSegmentCmd(const Vector&);
  void getMarkerSelectedCmd();
  void getMarkerSelectedCmd(int);
  void getMarkerSelectedCmd(const Vector&);
  void getMarkerSelectedNumberCmd();
  void getMarkerShowCmd();
  void getMarkerShowTextCmd();
  void getMarkerHandleCmd(const Vector&);
  void getMarkerHighlitedCmd();
  void getMarkerHighlitedCmd(int);
  void getMarkerHighlitedCmd(const Vector&);
  void getMarkerHighlitedNumberCmd();
  void getMarkerTagCmd(const char*);
  void getMarkerTagCmd(int);
  void getMarkerTagCmd(int,int);
  void getMarkerTagDefaultNameCmd();
  void getMarkerTagNumberCmd(const char*);
  void getMarkerTagsCmd();
  void getMarkerTextCmd(int);
  void getMarkerTextRotateCmd(int);
  void getMarkerTypeCmd(int);
  void getMarkerVectorCmd(int, Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat);
  void getMarkerVectorArrowCmd(int);
  void getMarkerVectorLengthCmd(int, Coord::CoordSystem, Coord::DistFormat);

  void hasMarkerHighlitedCmd();
  void hasMarkerPasteCmd();
  void hasMarkerSelectedCmd();
  void hasMarkerUndoCmd();

  void markerLayerCmd(MarkerLayer);

  void markerAnalysisCmd(int, Marker::AnalysisTask, int);

  void markerAngleCmd(int, double);
  void markerAngleCmd(int, double, Coord::CoordSystem, Coord::SkyFrame);
  void markerAnnulusCreateRadiusCmd(int, const Vector&);
  void markerAnnulusDeleteRadiusCmd(int, int);
  void markerAnnulusRadiusCmd(int, double, double, int, Coord::CoordSystem, Coord::DistFormat);
  void markerAnnulusRadiusCmd(int, const char*, Coord::CoordSystem, Coord::DistFormat);

  void markerBackCmd();
  void markerBackCmd(const char*);
  void markerBackCmd(int);
  void markerBoxFillCmd(int, int);
  void markerBoxAnnulusRadiusCmd(int, const Vector&, const Vector&, int, 
				 Coord::CoordSystem, Coord::DistFormat);
  void markerBoxAnnulusRadiusCmd(int, const char*, Coord::CoordSystem, Coord::DistFormat);
  void markerBoxAnnulusCreateRadiusCmd(int, const Vector&);
  void markerBoxAnnulusDeleteRadiusCmd(int, int);
  void markerBoxRadiusCmd(int, const Vector&, Coord::CoordSystem, Coord::DistFormat);
  void markerBpandaCreateAnglesCmd(int, const Vector&);
  void markerBpandaCreateRadiusCmd(int, const Vector&);
  void markerBpandaDeleteCmd(int, int);
  void markerBpandaEditCmd(int, double, double, int, 
			   const Vector&, const Vector&, int);
  void markerBpandaEditCmd(int, double, double, int, 
			   const Vector&, const Vector&, int,
			   Coord::CoordSystem, Coord::SkyFrame);
  void markerBpandaEditCmd(int, const char*, const char*, 
			   Coord::CoordSystem, Coord::SkyFrame,
			   Coord::CoordSystem, Coord::DistFormat);

  void markerCallBackCmd(int, CallBack::Type, const char*, const char*);
  void markerCentroidCmd();
  void markerCentroidCmd(const char*);
  void markerCentroidCmd(int);
  void markerCentroidAutoCmd(int);
  void markerCentroidRadiusCmd(float);
  void markerCentroidIterationCmd(int);
  void markerCircleFillCmd(int, int);
  void markerCircleRadiusCmd(int, double, Coord::CoordSystem, Coord::DistFormat);
  void markerColorCmd(const char*);
  void markerColorCmd(const char*, const char*);
  void markerColorCmd(int, const char*);
  void markerCompassArrowCmd(int, int, int);
  void markerCompassLabelCmd(int, const char*, const char*);
  void markerCompassRadiusCmd(int, double, Coord::CoordSystem, Coord::DistFormat);
  void markerCompassSystemCmd(int, Coord::CoordSystem, Coord::SkyFrame);
  void markerCompositeCmd(int, int);
  void markerCompositeDeleteCmd();
  void markerCommandCmd(MarkerFormat, const char*);
  void markerCommandVarCmd(MarkerFormat, const char*);
  void markerCopyCmd();
  void markerCopyCmd(const char*);
  void markerCpandaCreateAnglesCmd(int, const Vector&);
  void markerCpandaCreateRadiusCmd(int, const Vector&);
  void markerCpandaDeleteCmd(int, int);
  void markerCpandaEditCmd(int, double, double, int, double, double, int);
  void markerCpandaEditCmd(int, double, double, int, double, double, int,
			   Coord::CoordSystem, Coord::SkyFrame);
  void markerCpandaEditCmd(int, const char*, const char*, 
			   Coord::CoordSystem, Coord::SkyFrame,Coord::CoordSystem, Coord::DistFormat);
  void markerCutCmd();
  void markerCutCmd(const char*);

  void markerDeleteCmd();
  void markerDeleteCmd(const char*);
  void markerDeleteCmd(int);
  void markerDeleteAllCmd();
  void markerDeleteLastCmd();
  void markerDeleteCallBackCmd(int, CallBack::Type, const char*);
  void markerDeleteTagCmd(int);
  void markerDeleteTagCmd(int, const char*);
  void markerDeleteTagCmd(int, int);

  void markerEditBeginCmd(int, int);
  void markerEditBeginCmd(const Vector&, int);
  void markerEditMotionCmd(const Vector&, int);
  void markerEditEndCmd();
  void markerEllipseFillCmd(int, int);
  void markerEllipseRadiusCmd(int, const Vector&,
			      Coord::CoordSystem, Coord::DistFormat);
  void markerEllipseAnnulusRadiusCmd(int, const Vector&, const Vector&, int, 
				     Coord::CoordSystem, Coord::DistFormat);
  void markerEllipseAnnulusRadiusCmd(int, const char*, 
				     Coord::CoordSystem, Coord::DistFormat);
  void markerEllipseAnnulusCreateRadiusCmd(int, const Vector&);
  void markerEllipseAnnulusDeleteRadiusCmd(int, int);
  void markerEpandaCreateAnglesCmd(int, const Vector&);
  void markerEpandaCreateRadiusCmd(int, const Vector&);
  void markerEpandaDeleteCmd(int, int);
  void markerEpandaEditCmd(int, double, double, int, 
			   const Vector&, const Vector&, int);
  void markerEpandaEditCmd(int, double, double, int, 
			   const Vector&, const Vector&, int,
			   Coord::CoordSystem, Coord::SkyFrame);
  void markerEpandaEditCmd(int, const char*, const char*, 
			   Coord::CoordSystem, Coord::SkyFrame,
			   Coord::CoordSystem, Coord::DistFormat);
  void markerEpsilonCmd(int ee) {markerEpsilon = ee;}

  void markerFontCmd(const char*);
  void markerFontCmd(const char*, const char*);
  void markerFontCmd(int, const char*);
  void markerFrontCmd();
  void markerFrontCmd(const char*);
  void markerFrontCmd(int);

  void markerHighliteAllCmd(); // not used
  void markerHighliteCmd(int); // not used
  void markerHighliteCmd(const char*); // not used
  void markerHighliteToggleCmd(const Vector&);
  void markerHighliteOnlyCmd(int);
  void markerHighliteOnlyCmd(const char*); // not used
  void markerHighliteOnlyCmd(const Vector&);  // not used

  void markerKeyCmd();
  void markerKeyCmd(const Vector&);

  void markerLineCmd(int, const Vector&, const Vector&, Coord::CoordSystem, Coord::SkyFrame);
  void markerLineArrowCmd(int, int, int);
  void markerLineWidthCmd(int);
  void markerLineWidthCmd(int, int);
  void markerListCmd(MarkerFormat, Coord::CoordSystem, Coord::SkyFrame, Coord::SkyFormat, 
		     int strip, int select,
		     unsigned short, unsigned short, List<Tag>&);
  void markerLoadCmd(MarkerFormat,const char*);
  void markerLoadCmd(MarkerFormat,const char*,Coord::CoordSystem,Coord::SkyFrame);
  void markerLoadCmd(MarkerFormat,int);
  void markerLoadCmd(MarkerFormat,int,Coord::CoordSystem,Coord::SkyFrame);
  void markerLoadFitsCmd(const char*, const char*, int*, int, const char*);

  void markerMoveCmd(const Vector&);
  void markerMoveCmd(const char*, const Vector&);
  void markerMoveCmd(int id, const Vector&);
  void markerMoveBeginCmd(const Vector&);
  void markerMoveBeginCmd(int, const Vector&);
  void markerMoveMotionCmd(const Vector&);
  void markerMoveMotionCmd(int, const Vector&);
  void markerMoveEndCmd();
  void markerMoveEndCmd(int);
  void markerMoveToCmd(const Vector&, Coord::CoordSystem, Coord::SkyFrame);
  void markerMoveToCmd(const char*, const Vector&, Coord::CoordSystem, Coord::SkyFrame);
  void markerMoveToCmd(int, const Vector&, Coord::CoordSystem, Coord::SkyFrame);

  void markerPasteCmd();
  void markerPasteCmd(Coord::CoordSystem);
  void markerPointShapeCmd(int, Point::PointShape);
  void markerPointSizeCmd(int, int);
  void markerPolygonFillCmd(int, int);
  void markerPolygonCreateVertexCmd(int, int, const Vector&);
  void markerPolygonDeleteVertexCmd(int, int);
  void markerPolygonResetCmd(int, const Vector&, Coord::CoordSystem, Coord::DistFormat);
  void markerPreserveCmd(int r) {preserveMarkers = r;}
  void markerPropertyCmd(unsigned short, int);
  void markerPropertyCmd(const char*, unsigned short, int);
  void markerPropertyCmd(int, unsigned short, int);
  void markerPropertyCmd(unsigned short, int, const Vector&);
  void markerProjectionCmd(int, const Vector&, const Vector&, 
			   Coord::CoordSystem, Coord::SkyFrame, 
			   double, Coord::CoordSystem, Coord::DistFormat);

  void markerRotateBeginCmd(int);
  void markerRotateBeginCmd(const Vector&);
  void markerRotateMotionCmd(const Vector&, int h);
  void markerRotateEndCmd();
  void markerRulerDistSpecCmd(int, const char*);
  void markerRulerPointCmd(int, const Vector&, const Vector&, 
			   Coord::CoordSystem, Coord::SkyFrame);
  void markerRulerSystemCmd(int, Coord::CoordSystem, Coord::SkyFrame, 
			    Coord::CoordSystem, Coord::DistFormat);

  void markerSaveCmd(const char*, MarkerFormat, Coord::CoordSystem, Coord::SkyFrame,
		     Coord::SkyFormat, int strip);
  void markerSaveTemplateCmd(const char*);
  void markerSegmentCreateVertexCmd(int, int, const Vector&);
  void markerSegmentDeleteVertexCmd(int, int);
  void markerSegmentResetCmd(int, const Vector&, Coord::CoordSystem, Coord::DistFormat);
  void markerSelectAllCmd();
  void markerSelectCmd(int); // not used
  void markerSelectCmd(const char*);
  void markerSelectToggleCmd();
  void markerSelectToggleCmd(const Vector&);
  void markerSelectOnlyCmd(int);
  void markerSelectOnlyCmd(const char*);
  void markerSelectOnlyCmd(const Vector&);
  void markerShowCmd(int);
  void markerShowTextCmd(int);

  void markerTagCmd(const char*);
  void markerTagCmd(int, const char*);
  void markerTagEditCmd(const char*, const char*);
  void markerTagDeleteCmd(const char*);
  void markerTagDeleteAllCmd();
  void markerTagUpdateCmd(const char*);
  void markerTextCmd(int, const char*);
  void markerTextRotateCmd(int, int);

  void markerUndoCmd();
  void markerUnhighliteAllCmd();
  void markerUnhighliteCmd(int); // not used
  void markerUnhighliteCmd(const char*);
  void markerUnselectAllCmd();
  void markerUnselectCmd(int); // not used
  void markerUnselectCmd(const char*); // not used

  void markerVectorCmd(int, const Vector&, Coord::CoordSystem, Coord::SkyFrame, 
		       double, Coord::CoordSystem, Coord::DistFormat, double);
  void markerVectorArrowCmd(int, int);

  void regionHighliteBeginCmd(const Vector& v) {regionSelectBeginCmd(v);}
  void regionHighliteMotionCmd(const Vector& v) {regionSelectMotionCmd(v);}
  void regionHighliteEndCmd();
  void regionHighliteShiftEndCmd();
  void regionSelectBeginCmd(const Vector&);
  void regionSelectMotionCmd(const Vector&);
  void regionSelectEndCmd();
  void regionSelectShiftEndCmd();

  // Mask Commands
  void getMaskColorCmd();
  void getMaskMarkCmd();
  void getMaskTransparencyCmd();

  void maskColorCmd(const char*);
  void maskClearCmd();
  void maskMarkCmd(int m) {maskMark=m;}
  void maskTransparencyCmd(float);

  // NaN Commands
  void getNANColorCmd();
  void nanColorCmd(const char*);

  // Pan Zoom Rotate Orient Commands
  void centerCmd();
  void getOrientCmd();
  void getRotateCmd();
  void getPanPreserveCmd();
  void getZoomCmd();
  void orientCmd(Coord::Orientation);
  virtual void panCmd(const Vector&) =0;
  virtual void panCmd(const Vector&, const Vector&) =0;
  virtual void panCmd(const Vector&, Coord::CoordSystem, Coord::SkyFrame) =0;
  virtual void panToCmd(const Vector&) =0;
  virtual void panToCmd(const Vector&, Coord::CoordSystem, Coord::SkyFrame) =0;
  void panBeginCmd(const Vector&);
  void panMotionCmd(const Vector&);
  virtual void panEndCmd(const Vector&) =0;
  virtual void panBBoxCmd(const Vector&) =0;
  void panPreserveCmd(int r) {preservePan = r;}
  void rotateCmd(double);
  virtual void rotateBeginCmd() {}
  virtual void rotateMotionCmd(double) {}
  virtual void rotateEndCmd() {}
  void rotateToCmd(double);
  void getIRAFAlignCmd();
  void irafAlignCmd(int);
  void getWCSAlignCmd();
  void wcsAlignCmd(int);
  // used by backup
  void wcsAlignCmd(int, Coord::CoordSystem, Coord::SkyFrame);
  void wcsAlignCmd(int, FitsImage*, Coord::CoordSystem, Coord::SkyFrame);
  void zoomCmd(const Vector&);
  void zoomToCmd(const Vector&);
  virtual void zoomAboutCmd(const Vector&, const Vector&) =0;
  virtual void zoomAboutCmd(const Vector&, const Vector&, 
			    Coord::CoordSystem, Coord::SkyFrame) =0;
  virtual void zoomToAboutCmd(const Vector&, const Vector&) =0;
  virtual void zoomToAboutCmd(const Vector&, const Vector&, 
			      Coord::CoordSystem, Coord::SkyFrame) =0;
  virtual void zoomToFitCmd(double) =0;

  // Panner Commands
  void pannerCmd(int);
  void pannerCmd(char*, int, int);
  void updatePannerCmd();
  // backward compatiblity
  void pannerCmd(Coord::CoordSystem, Coord::SkyFrame) {}

  // Pixel Table Commands
  void getPixelTableCmd(const Vector&, Coord::InternalSystem, int, int, char*);

  // Precision Commands
  void precCmd(int, int, int, int, int, int);

  // Print Commands
#ifdef MAC_OSX_TK
  void macosxPrintCmd();
#endif
#ifdef __WIN32
  void win32PrintCmd();
#endif

  // Scale Commands
  void colorScaleCmd(FrScale::ColorScaleType);
  void colorScaleLogCmd(double);
  void getColorMapLevelCmd(int);
  void getColorMapLevelCmd(int, double, double, FrScale::ColorScaleType, float);
  void getColorMapLevelCmd(int, const Vector&, Coord::InternalSystem);
  void getColorScaleCmd();
  void getColorScaleLevelCmd(int, double, double, 
			     FrScale::ColorScaleType, float);
  void getColorScaleLogCmd();

  // Smooth Commands
  void getSmoothFunctionCmd();
  void getSmoothRadiusCmd();
  void getSmoothRadiusMinorCmd();
  void getSmoothSigmaCmd();
  void getSmoothSigmaMinorCmd();
  void getSmoothAngleCmd();
  void hasSmoothCmd();
  void smoothCmd(int, int, int, double, double, double);
  void smoothDeleteCmd();

  // Threads Commands
  void getThreadsCmd();
  void threadsCmd(int);

  // WCS
  void wcsAppendCmd(int, int);
  void wcsAppendCmd(int, const char*);
  void wcsAppendTxtCmd(int, const char*);
  void wcsReplaceCmd(int, int);
  void wcsReplaceCmd(int, const char*);
  void wcsReplaceTxtCmd(int, const char*);
  void wcsResetCmd(int);

  // RGB Commands
  virtual void getRGBChannelCmd() =0;
  virtual void getRGBViewCmd() =0;
  virtual void getRGBSystemCmd() =0;
  virtual void setRGBChannelCmd(const char*) {}
  virtual void setRGBViewCmd(int, int, int) {}
  virtual void setRGBSystemCmd(Coord::CoordSystem) {}

  // 3d
  virtual void get3dBorderCmd() =0;
  virtual void get3dBorderColorCmd() =0;
  virtual void get3dCompassCmd() =0;
  virtual void get3dCompassColorCmd() =0;
  virtual void get3dHighliteCmd() =0;
  virtual void get3dHighliteColorCmd() =0;
  virtual void get3dScaleCmd() =0;
  virtual void get3dViewCmd() =0;
  virtual void get3dViewPointCmd() =0;
  virtual void get3dRenderMethodCmd() =0;
  virtual void get3dRenderBackgroundCmd() =0;
  virtual void set3dBorderCmd(int) {}
  virtual void set3dBorderColorCmd(const char*) {}
  virtual void set3dCompassCmd(int) {}
  virtual void set3dCompassColorCmd(const char*) {}
  virtual void set3dHighliteCmd(int) {}
  virtual void set3dHighliteColorCmd(const char*) {}
  virtual void set3dScaleCmd(double) {}
  virtual void set3dViewCmd(float, float) {}
  virtual void set3dViewPointCmd(const Vector3d&, const Vector&) {}
  virtual void set3dRenderMethodCmd(int) {}
  virtual void set3dRenderBackgroundCmd(int) {}
  virtual void set3dPreserveCmd() {}
};

#endif