UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
u3d_abstract_shooter.hpp
1 /* u3d_abstract_shooter.hpp */
2 /* $Id: u3d_abstract_shooter.hpp,v 1.4 2008/09/29 11:15:15 ibadm Exp $ */
3 //-----------------------------------------------------------------------------
4 #ifndef __u3d_abstract_shooter_hpp
5 #define __u3d_abstract_shooter_hpp
6 
7 #include "u3d_raydyn_calculator.hpp"
8 #include "u3d_shooter_defines.hpp"
9 
10 #define SHOOTER_DEBUG
11 
12 //#define ARS_DEBUG
13 
14 //=============================================================================
16 //class U3dAbstractRayShooter : public U3dRayTracing
18 {
19 public:
20 
21  U3dAbstractRayShooter(U3dModel *mod3d, URayReflCoefType coeff_type = ZOEPPRITZ);
22  virtual ~U3dAbstractRayShooter() {}
23  //protected:
24 
25 
26 
28  bool findNextCell(int faceId, int &condId, int &i, int &j,
29  int &filled_cells_num, int &shadow_cells_num, int& conf_type,
30  int debug_level=0);
31 
32  bool findNextCleanCell(int faceId, int &confId, int &resI, int &resJ,
33  int &filled_cells_num, int &shadow_cells_num, int& conf_type,
34  int debug_level=0);
35 
36  bool checkFaceZone(int faceId, int zoneId, int conf, int& conf_type, int &resI, int &recJ);
37 
38 
39 
40 
41 
42 
43 
45  bool coverConf(int confId, int faceId, int i0, int j0, U3dPoint p, U3dCodeAr c, int conf_type);
46 
48  bool coverNhbCCross(int faceId, int ni, int nj, U3dPoint p, U3dCodeAr c,
49  int &resi, int &resj);
50 
52  bool coverNhbC1(int faceId, int i0, int j0, U3dPoint p, U3dCodeAr c);
53 
55  bool coverNhbC2(int faceId, int i0, int j0, U3dPoint p, U3dCodeAr c);
56 
57  bool shootNhbC2Cross(int faceId, int i0, int j0, U3dPoint p, U3dCodeAr c,
58  int i_n0, int j_n0, int i_n1, int j_n1);
59 
61  bool coverNhbC3(int faceId, int i0, int j0, U3dPoint p, U3dCodeAr c, int conf_type);
62 
64  bool coverNhbC4(int faceId, int i0, int j0, U3dPoint p, U3dCodeAr c);
65 
67  bool coverNhbC5(int faceId, int i0, int j0, U3dPoint p, U3dCodeAr c);
68 
70  bool coverNhbCSpiral(int faceId, int i0, int j0, U3dPoint p, U3dCodeAr c);
71 
72 
73 
74  /* =================== Neighbour cells configuration analysis procedures (u3d_abstract_shooter_conf.cpp) =================== */
75 
76  int checkConf(int i0, int j0, int faceId);
77 
78  bool checkConf(int confId, int i0, int j0, int faceId, int& conf_type);
79 
81  bool checkConf1(int i0, int j0, int faceId);
82 
84  bool checkConf2(int i0, int j0, int faceId);
85 
87  bool checkConf3(int i0, int j0, int faceId, int& conf_type);
88 
90  bool checkConf4(int i0, int j0, int faceId);
91 
93  bool checkConf5(int i0, int j0, int faceId);
94 
96  bool checkConf6(int i0, int j0, int faceId);
97 
98 
99  bool find2FilledNhbC3(int faceId, int i0, int j0, int conf_type,
100  int& i_n0, int& j_n0, int& i_n1, int& j_n1);
101 
103  bool find3FilledNhbC4(int faceId, int i0, int j0,
104  int& i_n0, int& j_n0, int& i_n1, int& j_n1, int& i_n2, int& j_n2);
105 
107  bool find3FilledNhbC5(int faceId, int i0, int j0,
108  int& i_n0, int& j_n0, int& i_n1, int& j_n1, int& i_n2, int& j_n2);
109 
112  bool calcNhbCPlaneAngles(int faceId, int i0, int j0,
113  int i_n0, int j_n0, int i_n1, int j_n1, int i_n2, int j_n2,
114  float& stF, float& stAz);
115 
116  void printConfCell(int i0, int j0, int faceId, int confId = 3);
117 
118  void printCellNhbC(int i0, int j0, int faceId, int nhb_num = 7);
119 
120 
121 
122  /* =================== Service procedures (u3d_abstract_shooter_service.cpp) =================== */
123 
125  int checkNhbCell(int faceId, int i0, int j0);
126 
128  int shootNcheckPh1(int faceId, U3dPoint p, float f, float az,
129  int ni, int nj, U3dCodeAr c, int &resI, int &resJ);
130 
132  bool shootNcheckPh2(int faceId, U3dPoint p, float f, float az,
133  int i0, int j0, U3dCodeAr c, int &resI, int &resJ);
134 
136  bool findFilledNhbCell(int faceId, int &i, int &j);
137 
140  bool findFilledFaceNhbCell(U3dPoint p, int faceId, U3dCodeAr c, int &resI, int &resJ);
141 
143  bool findCleanNhbCell(int faceId, int &i, int &j, int &filled_cells_num, int &shadow_cells_num);
144 
146  bool isFaceCellClean(int i, int j, int faceId);
147 
149  bool isFaceCellShadowed(int i, int j, int faceId);
150 
152  bool isFaceCellFilled(int i, int j, int faceId);
153 
154  char getCellStatus(int i, int j, int faceId);
155 
156 
157 
158 
159 
160 
161 
163  virtual int getFaceId(U3dRay *r)
164  {
165 #ifdef SHOOTER_DEBUG
166  UMessage::error("U3dAbstractRayShooter :: getFaceId works...");
167 #endif
168  return -1;
169  }
170 
172  virtual int getFaceIMax(int faceId)
173  {
174 #ifdef SHOOTER_DEBUG
175  UMessage::error("U3dAbstractRayShooter :: getFaceIMax works...");
176 #endif
177  return -1;
178  }
179 
181  virtual int getFaceJMax(int faceId)
182  {
183 #ifdef SHOOTER_DEBUG
184  UMessage::error("U3dAbstractRayShooter :: getFaceJMax works...");
185 #endif
186  return -1;
187  }
188 
190  virtual void getFaceCellIJ(U3dPoint p, int faceId, int &i, int &j)
191  {
192 #ifdef SHOOTER_DEBUG
193  UMessage::error("U3dAbstractRayShooter :: getFaceCellIJ works...");
194 #endif
195  }
196 
198  virtual void setShadowedFlag(int i, int j, int faceId)
199  {
200 #ifdef SHOOTER_DEBUG
201  UMessage::error("U3dAbstractRayShooter :: setShadowedFlag works...");
202 #endif
203  }
204 
206  virtual float getFaceCellT(int i, int j, int faceId)
207  {
208 #ifdef SHOOTER_DEBUG
209  UMessage::error("U3dAbstractRayShooter :: getFaceCellT works...");
210 #endif
211  return 0;
212  }
213 
215  virtual float getFaceCellStF(int i, int j, int faceId)
216  {
217 #ifdef SHOOTER_DEBUG
218  UMessage::error("U3dAbstractRayShooter :: getFaceCellStF works...");
219 #endif
220  return 0;
221  }
222 
224  virtual float getFaceCellStAz(int i, int j, int faceId)
225  {
226 #ifdef SHOOTER_DEBUG
227  UMessage::error("U3dAbstractRayShooter :: getFaceCellStAz works...");
228 #endif
229  return 0;
230  }
231 
232 
233 
234  struct ARSFaceZone
235  {
236  int imin;
237  int imax;
238  int jmin;
239  int jmax;
240  };
241 
242  typedef std::vector<ARSFaceZone> ARSFaceZonesAr;
243 
244  ARSFaceZonesAr m_face_active_zones;
245 
246  virtual void formFaceActiveZones(int faceId)
247  {
248 #ifdef SHOOTER_DEBUG
249  UMessage::error("U3dAbstractRayShooter :: formFaceActiveZones works...");
250 #endif
251  int imax = getFaceIMax(faceId), jmax = getFaceJMax(faceId);
252 
253  ARSFaceZone face_zone;
254 
255  face_zone.imin = 0;
256  face_zone.imax = imax;
257 
258  face_zone.jmin = 0;
259  face_zone.jmax = jmax;
260 
261  m_face_active_zones.push_back(face_zone);
262 
263  }
264 
265 };
266 
267 #endif
268 
269 //-----------------------------------------------------------------------------
270 /* u3d_abstract_shooter.hpp */
bool isFaceCellShadowed(int i, int j, int faceId)
bool coverConf(int confId, int faceId, int i0, int j0, U3dPoint p, U3dCodeAr c, int conf_type)
bool find3FilledNhbC5(int faceId, int i0, int j0, int &i_n0, int &j_n0, int &i_n1, int &j_n1, int &i_n2, int &j_n2)
virtual void getFaceCellIJ(U3dPoint p, int faceId, int &i, int &j)
Definition: u3d_abstract_shooter.hpp:190
bool coverNhbC5(int faceId, int i0, int j0, U3dPoint p, U3dCodeAr c)
bool coverNhbC1(int faceId, int i0, int j0, U3dPoint p, U3dCodeAr c)
bool findNextCell(int faceId, int &condId, int &i, int &j, int &filled_cells_num, int &shadow_cells_num, int &conf_type, int debug_level=0)
virtual void setShadowedFlag(int i, int j, int faceId)
Definition: u3d_abstract_shooter.hpp:198
bool shootNcheckPh2(int faceId, U3dPoint p, float f, float az, int i0, int j0, U3dCodeAr c, int &resI, int &resJ)
bool checkConf2(int i0, int j0, int faceId)
Definition: u3d_abstract_shooter.hpp:234
bool checkConf5(int i0, int j0, int faceId)
bool coverNhbC2(int faceId, int i0, int j0, U3dPoint p, U3dCodeAr c)
static void error(const char *format,...)
bool checkConf4(int i0, int j0, int faceId)
bool findCleanNhbCell(int faceId, int &i, int &j, int &filled_cells_num, int &shadow_cells_num)
virtual float getFaceCellT(int i, int j, int faceId)
Definition: u3d_abstract_shooter.hpp:206
int checkNhbCell(int faceId, int i0, int j0)
Definition: u3d_point.hpp:16
virtual int getFaceId(U3dRay *r)
Definition: u3d_abstract_shooter.hpp:163
bool checkConf1(int i0, int j0, int faceId)
bool findFilledFaceNhbCell(U3dPoint p, int faceId, U3dCodeAr c, int &resI, int &resJ)
bool coverNhbC4(int faceId, int i0, int j0, U3dPoint p, U3dCodeAr c)
Definition: u3d_ray.hpp:14
int shootNcheckPh1(int faceId, U3dPoint p, float f, float az, int ni, int nj, U3dCodeAr c, int &resI, int &resJ)
bool coverNhbCSpiral(int faceId, int i0, int j0, U3dPoint p, U3dCodeAr c)
bool coverNhbC3(int faceId, int i0, int j0, U3dPoint p, U3dCodeAr c, int conf_type)
virtual int getFaceIMax(int faceId)
Definition: u3d_abstract_shooter.hpp:172
bool find3FilledNhbC4(int faceId, int i0, int j0, int &i_n0, int &j_n0, int &i_n1, int &j_n1, int &i_n2, int &j_n2)
Definition: u3d_raydyn_calculator.hpp:14
virtual float getFaceCellStAz(int i, int j, int faceId)
Definition: u3d_abstract_shooter.hpp:224
Definition: u3d_model.hpp:15
bool calcNhbCPlaneAngles(int faceId, int i0, int j0, int i_n0, int j_n0, int i_n1, int j_n1, int i_n2, int j_n2, float &stF, float &stAz)
Definition: u3d_abstract_shooter.hpp:17
bool checkConf6(int i0, int j0, int faceId)
virtual int getFaceJMax(int faceId)
Definition: u3d_abstract_shooter.hpp:181
bool checkConf3(int i0, int j0, int faceId, int &conf_type)
bool isFaceCellClean(int i, int j, int faceId)
bool findFilledNhbCell(int faceId, int &i, int &j)
virtual float getFaceCellStF(int i, int j, int faceId)
Definition: u3d_abstract_shooter.hpp:215
bool coverNhbCCross(int faceId, int ni, int nj, U3dPoint p, U3dCodeAr c, int &resi, int &resj)
bool isFaceCellFilled(int i, int j, int faceId)