UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
sim_vel_model.hpp
1 /* sim_vel_model.hpp */
2 /* $Id$ */
3 #ifndef __sim_vel_model_hpp
4 #define __sim_vel_model_hpp
5 
6 #include <string>
7 #include <utility>
8 #include <list>
9 #include <s2proc/sim_service.hpp>
10 #include <s2proc/sim_vm_layers.hpp>
11 
15 namespace sim
16 {
17  //------------------------------------------------------------------------------------------
23  template <typename ParamsT>
24  class VelModel
25  {
26  public:
27 
28  virtual ~VelModel() {/* nothing to do. */}
29 
34  virtual const ParamsT& operator()(const Point2D &coords) const = 0;
35  };
36 
37  //------------------------------------------------------------------------------------------
44  template <typename ParamsT, typename LayerT>
45  class LayeredVelModel : public VelModel<ParamsT>
46  {
47  public:
48 
49  virtual ~LayeredVelModel() {/* nothing to do. */}
50 
51 
55  virtual void appendLayer(const LayerT &layer, const ParamsT &params) = 0;
56 
60  virtual size_t layersNum() const = 0;
61 
66  virtual const LayerT& layer(const size_t id) const = 0;
67 
72  virtual const ParamsT& params(const size_t id) const = 0;
73 
77  virtual void removeLayer(const size_t id) = 0;
78 
80  virtual void clear() = 0;
81  };
82 
83  //------------------------------------------------------------------------------------------
88  template <typename ParamsT>
89  class VelModel1D2D : public LayeredVelModel<ParamsT, VmLayer1D2D>
90  {
91  public:
92 
93  VelModel1D2D() : LayeredVelModel<ParamsT, VmLayer1D2D>() {/* nothing to do. */}
94 
95  virtual ~VelModel1D2D() {/* nothing to do. */}
96 
97 
102  virtual const ParamsT& operator()(const Point2D &coords) const;
103 
104 
108  virtual void appendLayer(const VmLayer1D2D &layer, const ParamsT &params);
109 
113  virtual size_t layersNum() const;
114 
119  virtual const VmLayer1D2D& layer(const size_t id) const;
120 
125  virtual const ParamsT& params(const size_t id) const;
126 
130  virtual void removeLayer(const size_t id);
131 
133  virtual void clear();
134 
135  protected:
136 
138  std::list<std::pair<VmLayer1D2D, ParamsT> > m_lays;
139 
141  static const ParamsT m_dummy_params;
142 
145  };
146 
147 }; // simulation namespace
148 
149 #include <s2proc/sim_vel_model_impl.hpp>
150 
151 #endif /* sim_vel_model.hpp */
virtual void removeLayer(const size_t id)=0
virtual size_t layersNum() const
Definition: sim_vel_model_impl.hpp:70
static const VmLayer1D2D m_dummy_layer
Definition: sim_vel_model.hpp:144
Definition: sim_vm_layers.hpp:16
virtual const ParamsT & operator()(const Point2D &coords) const
Definition: sim_vel_model_impl.hpp:18
virtual const LayerT & layer(const size_t id) const =0
virtual const ParamsT & params(const size_t id) const =0
virtual void clear()=0
virtual const ParamsT & params(const size_t id) const
Definition: sim_vel_model_impl.hpp:92
Definition: sim_vel_model.hpp:89
virtual void clear()
Definition: sim_vel_model_impl.hpp:133
Definition: sim_point_2d.hpp:16
bool sim(size_t n, const Trace::AmplT *x, const Trace::AmplT *y, Trace::AmplT &s)
virtual const ParamsT & operator()(const Point2D &coords) const =0
Definition: sim_fdm_simulator_iso.hpp:20
virtual void removeLayer(const size_t id)
Definition: sim_vel_model_impl.hpp:108
Definition: sim_vel_model.hpp:45
std::list< std::pair< VmLayer1D2D, ParamsT > > m_lays
Definition: sim_vel_model.hpp:138
virtual size_t layersNum() const =0
virtual void appendLayer(const LayerT &layer, const ParamsT &params)=0
virtual void appendLayer(const VmLayer1D2D &layer, const ParamsT &params)
Definition: sim_vel_model_impl.hpp:44
virtual const VmLayer1D2D & layer(const size_t id) const
Definition: sim_vel_model_impl.hpp:76