UltraScan III
us_solutedata.h
Go to the documentation of this file.
1 #ifndef US_SOLDAT_H
3 #define US_SOLDAT_H
4 
5 #include "us_spectrodata.h"
6 
7 typedef struct short_sim_comp_s
8 {
9  double s; // sedimentation coefficient
10  double w; // molecular weight
11  double f; // frictional ratio
12  double c; // concentration
13  double d; // diffusion coefficient
14  double v; // vbar20
15 } SimComp;
16 
18 
19 class bucket
20 {
21  public:
22  double x;
23  double x_min;
24  double x_max;
25  double y;
26  double y_max;
27  double y_min;
28  double conc;
29  int status; // 0 = full-sized bucket,
30  // 1 = this bucket is reduced from overlap
31  // 2 = newly added bucket
32  bucket() {};
33  ~bucket() {};
34  bool operator==(const bucket& objIn)
35  {
36  return ( x == objIn.x && x_min == objIn.x_min && x_max == objIn.x_max
37  && y == objIn.y && y_min == objIn.y_min && y_max == objIn.y_max
38  && conc == objIn.conc && status == objIn.status );
39  }
40  bool operator!=(const bucket& objIn)
41  {
42  return ( x != objIn.x || x_min != objIn.x_min || x_max != objIn.x_max
43  || y != objIn.y || y_min != objIn.y_min || y_max != objIn.y_max
44  || conc != objIn.conc || status != objIn.status );
45  }
46  bool operator < (const bucket& objIn) const
47  {
48  if ( x < objIn.x )
49  {
50  return ( true );
51  }
52  else if ( x == objIn.x && y < objIn.y )
53  {
54  return ( true );
55  }
56  else
57  {
58  return ( false );
59  }
60  }
61 };
62 
64 bool buck_vx_lessthan( const bucket&, const bucket& );
65 
72 class US_SoluteData : public QObject
73 {
74  Q_OBJECT
75 
76  public:
79  US_SoluteData( void );
80 
81  public slots:
82  int clearBuckets();
83  int sortBuckets();
84  int sortBuckets( QList< bucket >* );
85  int appendBucket( bucket& );
86  int appendBucket( QRectF, QPointF, qreal, int );
87  int appendBucket( QRectF, QPointF, qreal );
88  int setBucket( int, QRectF, QPointF, qreal, int );
89  int bucketsCount();
90  bucket createBucket( QRectF, QPointF, qreal, int );
91  bucket minBucket();
92  bucket maxBucket();
93  bucket bucketAt( int );
98  QRectF bucketRect( int );
99  QPointF bucketPoint( int, bool );
100  QPointF bucketPoint( int );
101  QSizeF bucketSize( int );
102  QString bucketLine( int );
103  void setDistro( QList< S_Solute >*, int, int, int );
104  int findNearestPoint( QPointF& );
105  int removeBucketAt( int );
106  int autoCalcBins( int, qreal, qreal );
107  int saveGAdata ( QString&, int = 0, int = 1, int = 3, double = 0.0 );
108  int buildDataMC ( void );
109  int reportDataMC( QString&, int );
110  void outputStats( QTextStream&, QList< qreal >&, QList< qreal >&,
111  bool, QString );
112  void limitBucket( bucket& );
113  int countOverlaps();
114  int countFullestBucket();
115  void bucketSeparate( int, int, QList< QRectF >& );
116 
117  private:
118  QList< bucket > allbucks;
119  QList< SimComp > component;
120  QList< QList< SimComp > > MC_solute;
121  QList< S_Solute >* distro;
122 
123  int bndx;
124  int attr_x;
125  int attr_y;
126  int attr_z;
128 
129  QRectF brecmin;
130  QRectF brecmax;
131 
132  QPointF bpntmin;
133  QPointF bpntmax;
134 
135  QSizeF bsizmin;
136  QSizeF bsizmax;
137 
138  qreal bconmin;
139  qreal bconmax;
140 };
141 
142 #endif