QtRegionManager.qo.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 QTREGIONMANAGER_H
00031 #define QTREGIONMANAGER_H
00032
00033 #include <casa/aips.h>
00034 #include <casa/Containers/List.h>
00035 #include <display/QtViewer/QtDisplayPanel.qo.h>
00036 #include <display/DisplayDatas/DisplayData.h>
00037
00038 #include <graphics/X11/X_enter.h>
00039 #include <QtCore>
00040 #include <QtGui>
00041 #include <QHash>
00042
00043
00044
00045 #include <display/QtViewer/QtRegionMgr.ui.h>
00046 #include <graphics/X11/X_exit.h>
00047
00048
00049 namespace casa {
00050
00051 class QtViewer;
00052 class ImageRegion;
00053 class Record;
00054 class RSComposite;
00055 class WCUnion;
00056 template <class T> class PtrBlock;
00057
00058
00059 class QtRegionManager : public QWidget, protected Ui::QtRegionMgr {
00060
00061 Q_OBJECT
00062
00063
00064 public:
00065
00066 QtRegionManager(QtDisplayPanel* qdp, QWidget* parent=0);
00067
00068 ~QtRegionManager() { }
00069
00070 public slots:
00071 void changeAxis(String, String, String);
00072 void activate(Record);
00073
00074 protected slots:
00075
00076 void drawRegion(Record mousereg, WorldCanvasHolder *wch);
00077
00078 void newRegion_(String imgFilename);
00079
00080
00081 void loadRegionFromImage();
00082
00083 void loadRegionFromFile();
00084
00085
00086 void saveRegionInImage();
00087
00088 void saveRegionInFile();
00089
00090 void removeRegion();
00091
00092 void toggleImageRegion();
00093 void zPlaneChanged();
00094 void currentRegionChanged(const QString &);
00095 void showHelp();
00096 void showHelpActive();
00097
00098
00099 RSComposite *regionToShape(
00100 QtDisplayData* qdd, const ImageRegion* wcreg);
00101
00102
00103 void cleanup();
00104
00105 void deleteActiveBox();
00106 void insertActiveBox();
00107
00108
00109 void singlePlane();
00110 void extendChan();
00111 void extendPol();
00112
00113 void resetRegionExtension();
00114
00115 void loadRegionsImageFromFile();
00116 DisplayData* getImageData(QString);
00117 DisplayData* getBoundingBoxData(QString);
00118
00119
00120 void deleteRegion();
00121
00122 void showHideRegion();
00123
00124 void flashActive();
00125 void exportRegions();
00126
00127 public:
00128 bool planeAllowed(int, String&, String&);
00129
00130 protected:
00131 void addRegionsToShape(RSComposite*& theShapes,
00132 const WCRegion*& wcreg);
00133 WCUnion* unfoldCompositeRegionToSimpleUnion(const WCRegion*& wcreg);
00134 void displaySelectedRegion();
00135 void showRegion(const String& regName);
00136
00137 bool deleteBox(QString&, int);
00138 bool insertBox(QString&);
00139 void rotateBox(int);
00140
00141 void addRegionToMenu(const QString&, const QString&);
00142
00143 QtDisplayPanel* qdp_;
00144 QWidget* parent_;
00145
00146 private:
00147 PtrBlock<const ImageRegion * > unionRegions_p;
00148 List<RegionShape*> regShapes_p;
00149 void unfoldIntoSimpleRegionPtrs(PtrBlock<const WCRegion*>& outRegPtrs, const WCRegion*& wcreg);
00150 QHash<QString, DisplayData*> regData;
00151 QHash<QString, bool> regState;
00152 QMenu *showHideMenu;
00153 QMenu *deleteMenu;
00154
00155 QString activeGroup;
00156 int activeBox;
00157 RegionShape* activeShape;
00158 QTimer* timer;
00159 bool flash;
00160
00161 int cb;
00162
00163 signals:
00164 void extendRegion(String, String);
00165
00166 };
00167
00168
00169 }
00170
00171 #endif