MouseToolState.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef MOUSETOOLSTATE_H_
00031 #define MOUSETOOLSTATE_H_
00032
00033 #include <string>
00034
00035
00036
00037
00038
00039
00040 namespace casa {
00041 namespace QtMouseToolNames {
00042
00043 enum { nTools = 13 };
00044
00045 extern const std::string ZOOM, PAN, SHIFTSLOPE, BRIGHTCONTRAST, POINT, RECTANGLE, ELLIPSE, POLYGON, POLYLINE,
00046 RULERLINE, POSITIONVELOCITY, MULTICROSSHAIR, ANNOTATIONS, NONE;
00047
00048
00049 extern const std::string tools[nTools+1], longnames[nTools+1], helptexts[nTools+1];
00050 extern std::string iconnames[nTools+1];
00051
00052
00053
00054 inline int toolIndex(std::string tool) {
00055 for(int i=0;; i++) if (tools[i]==tool || i==nTools) return i;
00056
00057 }
00058
00059 inline std::string toolName(int toolindex) {
00060 if(toolindex<0 || toolindex>=nTools) return NONE;
00061 return tools[toolindex];
00062 }
00063
00064 inline std::string longName(std::string tool) {
00065 return longnames[toolIndex(tool)];
00066 }
00067 inline std::string iconName(std::string tool) {
00068 return iconnames[toolIndex(tool)];
00069 }
00070 inline std::string help(std::string tool) {
00071 return helptexts[toolIndex(tool)];
00072 }
00073
00074 enum PointRegionSymbols { SYM_DOT=0, SYM_DOWN_RIGHT_ARROW=1, SYM_DOWN_LEFT_ARROW=2,
00075 SYM_UP_RIGHT_ARROW=3, SYM_UP_LEFT_ARROW=4, SYM_PLUS=5,
00076 SYM_X=6, SYM_CIRCLE=7, SYM_DIAMOND=8, SYM_SQUARE=9,
00077 SYM_POINT_REGION_COUNT=10, SYM_UNKNOWN
00078 };
00079 std::string pointRegionSymbolIcon( PointRegionSymbols, int button=-1 );
00080 std::string pointRegionSymbolRc(PointRegionSymbols);
00081
00082 };
00083 };
00084
00085 #endif