UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
u3d_prgrid2d.hpp
1 /* u3d_prgrid2d.hpp */
2 /* $Id: u3d_prgrid2d.hpp,v 1.5 2008/04/14 08:17:02 urij Exp $ */
3 #ifndef __u3d_prgrid2d_hpp
4 #define __u3d_prgrid2d_hpp
5 
6 #include "u3d_abstract_prgrid2d.hpp"
7 
13 {
14 
15  friend class U3dPRGrid3d;
16 
17 public:
18 
20  U3dPRGrid2d();
21 
23  U3dPRGrid2d(const U3dPointsAr &points, double g_step, U3dBox *area = NULL);
24 
25  U3dPRGrid2d(const U3dPoints &points, double g_step, U3dBox *area = NULL);
26 
27  U3dPRGrid2d(const U3dPoints &points,
28  double g_step_x,
29  double g_step_y,
30  U3dBox *area = NULL);
31 
32  U3dPRGrid2d(const U3dPointsAr &points,
33  double g_step_x,
34  double g_step_y,
35  U3dBox *area = NULL);
36 
38  U3dPRGrid2d(const U3dPRGrid2d &obj);
39 
41  virtual ~U3dPRGrid2d();
42 
43 
46  virtual void construct(const U3dPointsAr &points,
47  double g_step_x,
48  double g_step_y,
49  U3dBox *area = NULL);
50 
51  virtual void construct(const U3dPoints &points,
52  double g_step_x,
53  double g_step_y,
54  U3dBox *area = NULL);
55 
56 protected:
57 
60  virtual void push_ip(const U3dPoint *point);
61 
68  static int get_ip_id(double x, std::vector<double> &grd_x,
69  double dx, double &xmn, double &xmx);
70 
72  void clear();
73 
75  virtual void calc_grid_z_levels();
76 
80  virtual double calc_nip_z(double x, double y);
81 
83  void expand_grid_area(U3dBox *area);
84 
90  static bool add_grid_cell(int ix, int jy, GridCell &cell, GridMatrix &rgrid,
91  double &zmn, double &zmx, double &pzmn, double &pzmx,
92  std::vector<double> &xgd, std::vector<double> &ygd,
93  double x, double y, bool is_increase_xy = true);
94 
95 private:
96 
101  {
102  public:
104  U3dIntEqLeftPart()
105  {is_init = false;}
106 
108  U3dIntEqLeftPart(const U3dIntEqLeftPart &obj);
109 
111  virtual ~U3dIntEqLeftPart(){}
112 
114  double calc(double z);
115 
117  void init(U3dPointsAr &pips)
118  {ips = pips; is_init = true;}
119 
121  void setPCoords(double px, double py)
122  {x = px; y = py;}
123 
128  double get_2d_ip_dist(int i, double x, double y) {
129  return ((ips[i]->getX() - x)*(ips[i]->getX() - x) +
130  (ips[i]->getY() - y)*(ips[i]->getY() - y));
131  }
132 
137  double get_3d_ip_dist(int i, double x, double y, double z) {
138  return ((ips[i]->getX() - x)*(ips[i]->getX() - x) +
139  (ips[i]->getY() - y)*(ips[i]->getY() - y) +
140  (ips[i]->getZ() - z)*(ips[i]->getZ() - z));
141  }
142 
143  protected:
144 
146  U3dPointsAr ips;
147 
149  double x, y;
150 
152  bool is_init;
153  };
154 
156  UEqDiv2Solve *m_grd_eq_solver;
157 
159  U3dIntEqLeftPart *m_grd_eq_lp;
160 
162  double m_prev_zmn, m_prev_zmx;
163 };
164 
165 //------------------------------------------------------------------------------------------
168 {
169 public:
170 
171  static bool fill(U3dPRGrid2d::GridMatrix &M);
172 
173 protected:
174 
175  static double x_i(const U3dPRGrid2d::GridMatrix &M, const U3dPRGrid2d::GridLine &y,
176  const U3dPRGrid2d::GridLine &b, int i);
177 
178  static double y_j(const U3dPRGrid2d::GridMatrix &M, const U3dPRGrid2d::GridLine &x, int j);
179 
180  static double b_j(const U3dPRGrid2d::GridMatrix &M, const U3dPRGrid2d::GridLine &x,
181  const U3dPRGrid2d::GridLine &y, int j);
182 };
183 
184 
185 #endif /* u3d_prgrid2d.hpp */
virtual ~U3dPRGrid2d()
U3dIntEqLeftPart()
Definition: u3d_svrg_math_abstract_surface.hpp:190
static bool add_grid_cell(int ix, int jy, GridCell &cell, GridMatrix &rgrid, double &zmn, double &zmx, double &pzmn, double &pzmx, std::vector< double > &xgd, std::vector< double > &ygd, double x, double y, bool is_increase_xy=true)
void expand_grid_area(U3dBox *area)
std::vector< GridLine > GridMatrix
Definition: u3d_abstract_prgrid2d.hpp:132
virtual void construct(const U3dPointsAr &points, double g_step_x, double g_step_y, U3dBox *area=NULL)
Definition: u3d_box.hpp:24
virtual void calc_grid_z_levels()
virtual void push_ip(const U3dPoint *point)
Definition: geometry.H:16
Definition: u3d_prgrid3d.hpp:13
Definition: u3d_point.hpp:16
Definition: u3d_prgrid2d.hpp:167
void clear()
std::vector< GridCell > GridLine
Definition: u3d_abstract_prgrid2d.hpp:129
Definition: u3d_abstract_prgrid2d.hpp:116
static int get_ip_id(double x, std::vector< double > &grd_x, double dx, double &xmn, double &xmx)
virtual double calc_nip_z(double x, double y)
Definition: u_base_math.hpp:136
Definition: u_base_math.hpp:88
Definition: u3d_prgrid2d.hpp:12
Definition: u3d_abstract_prgrid2d.hpp:11