UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
zd_lith_vector.hpp
1 /* zd_lith_vector.hpp */
2 /* $Id: zd_lith_vector.hpp,v 1.2 2006/07/05 10:18:22 guser4 Exp $ */
3 
4 /*
5  * $Log: zd_lith_vector.hpp,v $
6  * Revision 1.2 2006/07/05 10:18:22 guser4
7  * + layerThickness() and ZD_LITH_UNKNOWN
8  *
9  * Revision 1.1 2006/06/23 07:06:22 guser4
10  * + lithology support classes
11  *
12  */
13 
14 #ifndef __zd_lith_vector_hpp
15 #define __zd_lith_vector_hpp
16 
17 #include <vector>
18 
19 #include "zd_lith_data.hpp"
20 
21 
27 class ZdLithVector : public ZdLithData
28 {
29 public:
30 
32  struct LithLayer
33  {
34  double m_fTopDepth;
35  int m_iCode;
36  QBitmap m_qPattern;
37  QColor m_qColor;
39  LithLayer ()
40  : m_fTopDepth(0.0), m_iCode(0) {}
41  LithLayer (const LithLayer& lit)
44  LithLayer (double top, int code,
45  const QBitmap& pattern,
46  const QColor& color = Qt::black)
47  : m_fTopDepth(top), m_iCode(code),
48  m_qPattern(pattern), m_qColor(color) {}
49 
50  bool operator< (const LithLayer& lit) const {
51  return m_fTopDepth < lit.m_fTopDepth;
52  }
53 
54  LithLayer& operator= (const LithLayer& lit) {
55  m_fTopDepth = lit.m_fTopDepth;
56  m_iCode = lit.m_iCode;
57  m_qPattern = lit.m_qPattern;
58  m_qColor = lit.m_qColor;
59  return *this;
60  }
61  };
62 
64  ZdLithVector (const char* szDocName = NULL);
65 
66 
67  /*
68  * Run-time type identification facility
69  */
70 
72  virtual bool compatibleType (const char* szType) const;
73 
74 
75  /*
76  * Methods to compose vector and access its items
77  */
78 
80  virtual void addLayer (double top, int code,
81  const QBitmap& pattern,
82  const QColor& color = Qt::black);
83 
85  virtual void addLastLayer (double last);
86 
88  virtual void commit ();
89 
90 
91  /*
92  * Obligatory data access methods
93  */
94 
97  virtual bool getCoordRange (double c[2]);
98 
100  virtual double averageCoordStep ();
101 
104  virtual bool goFirstCoord ();
105 
108  virtual bool goNextCoord ();
109 
112  virtual double coord ();
113 
114 
115  /*
116  * Lithology specifics
117  */
118 
121  virtual double layerThickness ();
122 
125  virtual int lithCode ();
126 
130  virtual QBitmap lithTileBitmap ();
131 
134  virtual QColor lithTileColor ();
135 
136 protected:
137 
139  std::vector<LithLayer> m_vLayers;
140 
143 
144 private:
145 
147  static int s_iNameCounter;
148 
150  static char *s_szOwnType;
151 
152 };
153 
154 
155 #endif /* zd_lith_vector.hpp */
virtual double coord()
virtual void commit()
int m_iCode
Definition: zd_lith_vector.hpp:35
virtual bool goNextCoord()
Definition: zd_lith_vector.hpp:32
virtual double averageCoordStep()
virtual void addLastLayer(double last)
virtual double layerThickness()
int m_iCurLayer
Definition: zd_lith_vector.hpp:142
Definition: zd_lith_vector.hpp:27
virtual bool goFirstCoord()
QColor m_qColor
Definition: zd_lith_vector.hpp:37
virtual void addLayer(double top, int code, const QBitmap &pattern, const QColor &color=Qt::black)
virtual bool compatibleType(const char *szType) const
QBitmap m_qPattern
Definition: zd_lith_vector.hpp:36
virtual QBitmap lithTileBitmap()
virtual QColor lithTileColor()
std::vector< LithLayer > m_vLayers
Definition: zd_lith_vector.hpp:139
Definition: zd_lith_data.hpp:67
virtual bool getCoordRange(double c[2])
double m_fTopDepth
Definition: zd_lith_vector.hpp:34
virtual int lithCode()
ZdLithVector(const char *szDocName=NULL)