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 #ifndef DCMODELINFO_H
00028 #define DCMODELINFO_H
00029
00030 #include <DinverCore.h>
00031 #include <QGpCoreTools.h>
00032 #include "DinverDCCoreDLLExport.h"
00033
00034 namespace DinverDCCore {
00035
00036 class DINVERDCCORE_EXPORT DCModelInfo : public SharedObject
00037 {
00038 public:
00039 DCModelInfo() {_report=0;_samples=0;}
00040 ~DCModelInfo()
00041 {
00042 ReportReader::removeReference(_report);
00043 delete [] _samples;
00044 }
00045
00046 void setCurveCount(int n) {delete [] _samples; if(n>0) _samples=new Curve[n]; else _samples=0;}
00047
00048 void setReport(ReportReader * r) {_report=r;_report->addReference();}
00049 void setIndexInReport(int i) {_indexInReport=i;}
00050 void setMisfit(double m) {_misfit=m;}
00051 void setOffset(int curveIndex, int offset) {_samples[ curveIndex ].offset=offset;}
00052 void setSampleCount(int curveIndex, int nSamples) {_samples[ curveIndex ].nSamples=nSamples;}
00053
00054 ReportReader * report() const {return _report;}
00055 int indexInReport() const {return _indexInReport;}
00056 double misfit() const {return _misfit;}
00057 int offset(int curveIndex) const {return _samples[ curveIndex ].offset;}
00058 int sampleCount(int curveIndex) const {return _samples[ curveIndex ].nSamples;}
00059
00060
00061 static bool misfitLessThan(const DCModelInfo * i1, const DCModelInfo * i2)
00062 {
00063
00064
00065
00066 if(i1->_misfit>i2->_misfit) return true;
00067 else if (i1->_misfit<i2->_misfit) return false;
00068 else {
00069 if(i1->_indexInReport<i2->_indexInReport) return true;
00070 else return false;
00071 }
00072 }
00073 static bool loadLessThan(const DCModelInfo * i1, const DCModelInfo * i2)
00074 {
00075 if(i1->_report < i2->_report) return true;
00076 else if(i1->_report > i2->_report) return false;
00077 else {
00078 if(i1->_indexInReport < i2->_indexInReport) return true;
00079 else return false;
00080 }
00081 }
00082 private:
00083 ReportReader * _report;
00084 int _indexInReport;
00085 double _misfit;
00086 struct Curve {
00087 int nSamples, offset;
00088 };
00089 Curve * _samples;
00090 };
00091
00092 }
00093
00094 #endif // DCMODELINFO_H