00001 /*************************************************************************** 00002 ** 00003 ** This file is part of DinverDCGui. 00004 ** 00005 ** This file may be distributed and/or modified under the terms of the 00006 ** GNU General Public License version 2 or 3 as published by the Free 00007 ** Software Foundation and appearing in the file LICENSE.GPL included 00008 ** in the packaging of this file. 00009 ** 00010 ** This file is distributed in the hope that it will be useful, but WITHOUT 00011 ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00013 ** more details. 00014 ** 00015 ** You should have received a copy of the GNU General Public License 00016 ** along with this program. If not, see <http://www.gnu.org/licenses/>. 00017 ** 00018 ** See http://www.geopsy.org for more information. 00019 ** 00020 ** Created : 2006-05-18 00021 ** Authors: 00022 ** Marc Wathelet 00023 ** Marc Wathelet (LGIT, Grenoble, France) 00024 ** 00025 ***************************************************************************/ 00026 00027 #ifndef DCMODELVIEWER_H 00028 #define DCMODELVIEWER_H 00029 00030 #include <DinverCore.h> 00031 #include <DinverDCCore.h> 00032 #include <QGpCoreTools.h> 00033 #include <SciFigs.h> 00034 00035 #include "DinverDCGuiDLLExport.h" 00036 00037 namespace DinverDCGui { 00038 00039 class DINVERDCGUI_EXPORT DCModelViewer : public QWidget 00040 { 00041 Q_OBJECT 00042 public: 00043 DCModelViewer(QWidget * parent=0); 00044 ~DCModelViewer(); 00045 00046 void initGraphs(int nGraphs); 00047 virtual void setMode(const Mode& ) {} 00048 virtual void setModeIndex(int) {} 00049 virtual void setFrequencyAxis(bool) {} 00050 virtual void setTarget(TargetList * tl); 00051 void selectModels(QString reportFileName, double maxMisfit); 00052 void selectModels(DCModelViewer * w, const QVector<int> * indexes); 00053 void rejectModels(DCModelViewer * w, const QVector<int> * indexes); 00054 void loadModels(); 00055 int modelCount() const {return _models.count();} 00056 00057 GraphicSheet * sheet() {return &_sheet;} 00058 public slots: 00059 void setLimits(); 00060 void showSelectedModels(int id, const QVector<int>* indexes); 00061 protected slots: 00062 virtual void showTarget(bool isVisible); 00063 protected: 00064 QMenu * addMenu(QString title); 00065 TextEdit * addText(int ig, QString text); 00066 virtual AbstractLine * targetReferenceLine() const=0; 00067 00068 GraphicSheet _sheet; 00069 ColorPaletteWidget * _palette; 00070 QVBoxLayout* _childLayout; 00071 #ifndef Q_WS_MAC 00072 QMenuBar * _menuBar; 00073 #endif 00074 00075 QList<DCModelInfo *> _models; 00076 00077 int _nGraphs; 00078 AxisWindow ** _graphs; 00079 XYValueLines ** _curveLayers; 00080 LineLayer ** _targetLayers; 00081 int ** _pCounts; 00082 double * _misfits; 00083 00084 void addActions(); 00085 virtual void setTitles(int i)=0; 00086 virtual bool hasCurves(DCReportBlock& dcBlock)=0; 00087 virtual void setSampleCount(DCModelInfo * info, DCReportBlock& dcBlock)=0; 00088 virtual void report2plot(DCReportBlock& dcBlock, Point2D ** points, const DCModelInfo& info)=0; 00089 virtual void setLimits(int i, const Rect& r)=0; 00090 virtual void setGlobalLimits(const Rect&) {} 00091 }; 00092 00093 } // namespace DinverDCGui 00094 00095 #endif // DCMODELVIEWER_H