Moka libraries
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
precodes-f.icc
Go to the documentation of this file.
1 /*
2  * lib-extraction-images : Extraction de cartes à partir d'images 2D et 3D.
3  * Copyright (C) 2004, Moka Team, Université de Poitiers, Laboratoire SIC
4  * http://www.sic.sp2mi.univ-poitiers.fr/
5  * Copyright (C) 2009, Guillaume Damiand, CNRS, LIRIS,
6  * guillaume.damiand@liris.cnrs.fr, http://liris.cnrs.fr/
7  *
8  * This file is part of lib-extraction-images
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU Lesser General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 //******************************************************************************
25 // Les précodes "frontières" utilisés pour extraire la carte de niveau 3
26 // Normalement Precodes f1=>f27, mais ici on les regroupes quitte à
27 // ne pas avoir les méthodes totalement optimales
28 //******************************************************************************
29 
30 #include "pixel-step.hh"
31 
32 namespace GMap3d
33 {
34 //******************************************************************************
35 // Méthode générique utilisée pour les précodes f1 -> f12
36 // Ce n'est pas la version optimale, on appelle d'abord la méthode
37 // oneSameNeighboorF pour faire les fusions de volumes et de face, puis
38 // on fait la fusion d'arête "à la main"
39 INLINE
40 CDart* CExtractionImage::oneSameNeighboorF(CDart* d1, CDart* fo1, CDart* fo2, const CVertex & AVertex)
41 {
42  CDart *t1, *t2,*tmp1, *tmp2, *last;
43 
44  t1 = FMap->alpha1(fo1);
45 
46  last=oneSameNeighboorFc(AVertex,d1,fo1,fo2,3);
47 
48  t2=FMap->alpha1(t1);
49  tmp1=FMap->alpha0(t1);
50  tmp2=FMap->alpha0(t2);
51 
52  FMap->topoUnsew0(t1);
53  FMap->topoUnsew0(t2);
54 
55  FMap->topoSew0(tmp1,tmp2);
56 
57  CStaticCoverage23 it(FMap,t1);
58  while (it.cont())
59  {
60  FMap->delMapDart(FMap->alpha1(*it));
61  FMap->delMapDart(it++);
62  }
63 
64  return last;
65 }
66 
67 //******************************************************************************
70 INLINE
71 void CExtractionImage::precodesF1F4F7F10( CDart* &last, CDart* up, CDart* behind, const CVertex & AVertex )
72 {
73 #ifdef DEBUG_EXTRACT_IMAGE
74  cout<<"GmapV::precodesF1F4F7F10...";cout.flush();
75 #endif
76 
77  last = FMap->alpha101(oneSameNeighboorF( FMap->alpha010(last), FMap->alpha010(up), FMap->alpha101(behind), AVertex ));
78 
79 #ifdef DEBUG_EXTRACT_IMAGE
80  cout<<"OK\n";
81 #endif
82 }
83 
84 //******************************************************************************
87 INLINE
88 void CExtractionImage::precodesF2F5F8F11( CDart* &last, CDart* up, CDart* behind, const CVertex & AVertex )
89 {
90 #ifdef DEBUG_EXTRACT_IMAGE
91  cout<<"GmapV::precodesF2F5F8F11...";cout.flush();
92 #endif
93 
94  last = FMap->alpha201(oneSameNeighboorF( FMap->alpha101(up), FMap->alpha010(behind), FMap->alpha010(last), AVertex ));
95 
96 #ifdef DEBUG_EXTRACT_IMAGE
97  cout<<"OK\n";
98 #endif
99 }
100 
101 //******************************************************************************
104 INLINE
105 void CExtractionImage::precodesF3F6F9F12( CDart* &last, CDart* up, CDart* behind, const CVertex & AVertex )
106 {
107 #ifdef DEBUG_EXTRACT_IMAGE
108  cout<<"GmapV::precodesF3F6F9F12...";cout.flush();
109 #endif
110 
111  last = FMap->alpha12101(oneSameNeighboorF( FMap->alpha101(behind), FMap->alpha0(last), FMap->alpha101(up), AVertex ));
112 
113 #ifdef DEBUG_EXTRACT_IMAGE
114  cout<<"OK\n";
115 #endif
116 }
117 
118 //******************************************************************************
119 // Méthode générique utilisée pour les précodes f13, f14, f15, f19, f20, f21
120 // (les sous précodes des précodes fc13, fc14 et fc15 traités par twoSameNeighboorFc1)
121 INLINE
122 CDart* CExtractionImage::twoSameNeighboorF1( CDart* d1, CDart* d5, CDart* fo, const CVertex & AVertex )
123 {
124  CDart *t1, *t2,*tmp1, *tmp2, *last;
125  t1= FMap->alpha1(fo);
126 
127  last = twoSameNeighboorFc1(AVertex,d1,d5,fo);
128 
129  t2=FMap->alpha1(t1);
130  tmp1=FMap->alpha0(t1);
131  tmp2=FMap->alpha0(t2);
132 
133  FMap->topoUnsew0(t1);
134  FMap->topoUnsew0(t2);
135 
136  FMap->topoSew0(tmp1,tmp2);
137 
138  CStaticCoverage23 it(FMap,t1);
139  while (it.cont())
140  {
141  FMap->delMapDart(FMap->alpha1(*it));
142  FMap->delMapDart(it++);
143  }
144 
145  return last;
146 }
147 
148 //******************************************************************************
150 INLINE
151 void CExtractionImage::precodesF13F19( CDart* &last, CDart* up, CDart* behind, const CVertex & AVertex )
152 {
153 #ifdef DEBUG_EXTRACT_IMAGE
154  cout<<"GmapV::precodesF13F19...";cout.flush();
155 #endif
156 
157  last = FMap->alpha0(twoSameNeighboorF1( FMap->alpha0(last), FMap->alpha101(behind), FMap->alpha010(up), AVertex ));
158 
159 #ifdef DEBUG_EXTRACT_IMAGE
160  cout<<"OK\n";
161 #endif
162 }
163 
164 //******************************************************************************
166 INLINE
167 void CExtractionImage::precodesF14F20( CDart* &last, CDart* up, CDart* behind, const CVertex & AVertex )
168 {
169 #ifdef DEBUG_EXTRACT_IMAGE
170  cout<<"GmapV::precodesF14F20...";cout.flush();
171 #endif
172 
173  last = FMap->alpha10121(twoSameNeighboorF1( FMap->alpha010(up), FMap->alpha010(last), FMap->alpha010(behind), AVertex ));
174 
175 #ifdef DEBUG_EXTRACT_IMAGE
176  cout<<"OK\n";
177 #endif
178 }
179 
180 //******************************************************************************
182 INLINE
183 void CExtractionImage::precodesF15F21( CDart* &last, CDart* up, CDart* behind, const CVertex & AVertex )
184 {
185 #ifdef DEBUG_EXTRACT_IMAGE
186  cout<<"GmapV::precodesF15F21...";cout.flush();
187 #endif
188 
189  last = FMap->alpha0102101(twoSameNeighboorF1( FMap->alpha010(behind), FMap->alpha101(up), FMap->alpha0(last), AVertex ));
190 
191 #ifdef DEBUG_EXTRACT_IMAGE
192  cout<<"OK\n";
193 #endif
194 }
195 
196 //******************************************************************************
197 // Méthode générique utilisée pour les précodes f16, f17, f18, f22, f23, f24
198 // (les sous précodes des précodes fc10, fc11 et fc12 traités par twoSameNeighboorFc2)
199 INLINE
200 CDart* CExtractionImage::twoSameNeighboorF2( CDart* d1, CDart* d5, CDart* fo, const CVertex & AVertex )
201 
202 {
203  CDart *t1, *t2,*tmp1, *tmp2, *last;
204  t1 = fo;
205 
206  last = twoSameNeighboorFc2(AVertex,d1,d5,fo);
207 
208  t2 = FMap->alpha1(t1);
209  tmp1 = FMap->alpha0(t1);
210  tmp2 = FMap->alpha0(t2);
211 
212  FMap->topoUnsew0(t1);
213  FMap->topoUnsew0(t2);
214  FMap->topoSew0(tmp1,tmp2);
215 
216  CStaticCoverage23 it(FMap,t1);
217  while (it.cont())
218  {
219  FMap->delMapDart(FMap->alpha1(*it));
220  FMap->delMapDart(it++);
221  }
222 
223  return last;
224 }
225 
226 //******************************************************************************
228 INLINE
229 void CExtractionImage::precodesF16F22( CDart* &last, CDart* up, CDart* behind, const CVertex & AVertex )
230 {
231 #ifdef DEBUG_EXTRACT_IMAGE
232  cout<<"GmapV::precodesF16F22...";cout.flush();
233 #endif
234 
235  last = FMap->alpha0(twoSameNeighboorF2( FMap->alpha0(last), FMap->alpha101(behind), FMap->alpha010(up), AVertex ));
236 
237 #ifdef DEBUG_EXTRACT_IMAGE
238  cout<<"OK\n";
239 #endif
240 }
241 
242 //******************************************************************************
244 INLINE
245 void CExtractionImage::precodesF17F23( CDart* &last, CDart* up, CDart* behind, const CVertex & AVertex )
246 {
247 #ifdef DEBUG_EXTRACT_IMAGE
248  cout<<"GmapV::precodesF17F23...";cout.flush();
249 #endif
250 
251  last = FMap->alpha10121(twoSameNeighboorF2( FMap->alpha010(up), FMap->alpha010(last), FMap->alpha010(behind), AVertex ));
252 
253 #ifdef DEBUG_EXTRACT_IMAGE
254  cout<<"OK\n";
255 #endif
256 }
257 
258 //******************************************************************************
260 INLINE
261 void CExtractionImage::precodesF18F24( CDart* &last, CDart* up, CDart* behind, const CVertex & AVertex )
262 {
263 #ifdef DEBUG_EXTRACT_IMAGE
264  cout<<"GmapV::precodesF18F24...";cout.flush();
265 #endif
266 
267  last = FMap->alpha0102101(twoSameNeighboorF2( FMap->alpha010(behind), FMap->alpha101(up), FMap->alpha0(last), AVertex ));
268 
269 #ifdef DEBUG_EXTRACT_IMAGE
270  cout<<"OK\n";
271 #endif
272 }
273 
274 //******************************************************************************
275 // Méthode générique qui traite les précodes f25, f26 et f27
276 // les sous-précodes direct du précode l8
277 INLINE
278 CDart* CExtractionImage::threeSameNeighboorF(CDart* d10, CDart* d50, CDart* fo, const CVertex & AVertex )
279 {
280  CDart *d1,*d2 ,*d3, *d4,*d5 ,*d6,*t1,*t2,*t3,*t4, *t5, *t6, *s1,*s2,*s3,*s4, *s5;
281 
282  d1 = FMap->alpha01(d10);
283  d2 = FMap->alpha01(d1);
284  d3 = FMap->alpha01(fo);
285  d4 = FMap->alpha01(d3);
286  d5 = FMap->alpha1010(d50);
287  d6 = FMap->alpha01(d5);
288 
289  s1 = FMap->alpha0(FMap->alpha2(FMap->alpha1(fo))); //FMap->alpha102(fo);
290  s2 = FMap->alpha0(s1);
291  s3 = FMap->alpha1(s2);
292  s4 = FMap->alpha0(s3);
293 
294  s5=FMap->alpha12(d5);
295  FMap->unsew2(s1);
296  FMap->unsew2(FMap->alpha1(d5));
297  FMap->sew2(s1,s5);
298 
299  FMap->topoUnsew0(s2);
300  FMap->topoUnsew0(s3);
301  FMap->topoSew0(s1,s4);
302 
303  t1 = FMap->alpha01(d2);
304  t2 = FMap->alpha01(t1);
305  t3 = FMap->alpha01(d4);
306  t4 = FMap->alpha01(t3);
307  t5 = FMap->alpha01(d6);
308  t6 = FMap->alpha01(t5);
309 
310  FMap->unsew1(d1);
311  FMap->unsew1(d5);
312  FMap->unsew1(FMap->alpha0(d6));
313  FMap->unsew1(FMap->alpha0(d4));
314  FMap->unsew1(FMap->alpha0(d2));
315  FMap->unsew1(FMap->alpha10(d4));
316 
317  closeFace(d2,d3);
318  closeFace(d6,d1);
319  closeFace(d4,d5);
320 
321  FMap->topoSew2(FMap->alpha01(d1),FMap->alpha1(d2));
322  FMap->topoSew2(FMap->alpha01(d3),FMap->alpha1(d4));
323  FMap->topoSew2(FMap->alpha01(d5),FMap->alpha1(d6));
324 
325  FMap->setVertex(FMap->alpha010(d5), new CAttributeVertex(AVertex.getX()*STEP3D_X,
326  AVertex.getY()*STEP3D_Y,
327  AVertex.getZ()*STEP3D_Z));
328 
329  FMap->delMapDart(FMap->alpha0(t2));
330  FMap->delMapDart(t2);
331  FMap->delMapDart(FMap->alpha0(t1));
332  FMap->delMapDart(t1);
333  FMap->delMapDart(FMap->alpha0(t4));
334  FMap->delMapDart(t4);
335  FMap->delMapDart(FMap->alpha0(t3));
336  FMap->delMapDart(t3);
337  FMap->delMapDart(FMap->alpha0(t6));
338  FMap->delMapDart(t6);
339  FMap->delMapDart(FMap->alpha0(t5));
340  FMap->delMapDart(t5);
341 
342  CStaticCoverage23 it(FMap,s2);
343  while (it.cont())
344  {
345  FMap->delMapDart(FMap->alpha1(*it));
346  FMap->delMapDart(it++);
347  }
348 
349  return d5;
350 }
351 
352 //******************************************************************************
354 INLINE
355 void CExtractionImage::precodeF25( CDart* &last, CDart* up, CDart* behind, const CVertex & AVertex )
356 {
357 #ifdef DEBUG_EXTRACT_IMAGE
358  cout<<"GmapV::precodeF25...";cout.flush();
359 #endif
360 
361  last = FMap->alpha10121(threeSameNeighboorF( FMap->alpha010(up), FMap->alpha010(last), FMap->alpha010(behind), AVertex ));
362 
363 #ifdef DEBUG_EXTRACT_IMAGE
364  cout<<"OK\n";
365 #endif
366 }
367 
368 INLINE
369 void CExtractionImage::precodeF26( CDart* &last, CDart* up, CDart* behind, const CVertex & AVertex )
370 {
371 #ifdef DEBUG_EXTRACT_IMAGE
372  cout<<"GmapV::precodeF26...";cout.flush();
373 #endif
374 
375  last = FMap->alpha0102101(threeSameNeighboorF( FMap->alpha010(behind), FMap->alpha101(up), FMap->alpha0(last), AVertex ));
376 
377 #ifdef DEBUG_EXTRACT_IMAGE
378  cout<<"OK\n";
379 #endif
380 }
381 
382 INLINE
383 void CExtractionImage::precodeF27( CDart* &last, CDart* up, CDart* behind, const CVertex & AVertex )
384 {
385 #ifdef DEBUG_EXTRACT_IMAGE
386  cout<<"GmapV::precodeF27...";cout.flush();
387 #endif
388 
389  last = FMap->alpha0(threeSameNeighboorF( FMap->alpha0(last), FMap->alpha101(behind), FMap->alpha010(up), AVertex ));
390 
391 #ifdef DEBUG_EXTRACT_IMAGE
392  cout<<"OK\n";
393 #endif
394 }
395 
396 //******************************************************************************
397 // Pour décaler les arêtes fictives, il y FMap->alpha trois cas différents suivant l'orientation des
398 // arêtes (ou des faces) qu'on fusionne.
399 
400 // Ici on décale les arêtes fictives éventuelle se trouvant sur le sommet central
401 // entre les 2 faces dans le plan xy (c'est à dire up et sa voisine de gauche)
402 INLINE
403 void CExtractionImage::shiftFictiveEdgesForFacesXy( CDart* last, CDart* up, CDart* behind, int FictiveMark )
404 {
405  CDynamicCoverage23 it(FMap,FMap->alpha010(behind));
406  ++it; // car on sait qu'il n'y FMap->alpha pas d'arêtes fictive sur la face contenant behind
407  while(*it != FMap->alpha0101(up))
408  {
409  FMap->shiftAllFictiveEdges(*it,FictiveMark);
410  ++it; ++it; // Pour sauter le brin cousu par FMap->alpha3
411  }
412 }
413 
414 // Ici on décale les arêtes fictives éventuelle se trouvant sur le sommet central
415 // entre les 2 faces dans le plan xz (c'est à dire behind et sa voisine du dessus)
416 INLINE
417 void CExtractionImage::shiftFictiveEdgesForFacesXz( CDart* last, CDart* up, CDart* behind, int FictiveMark )
418 {
419  CDynamicCoverage23 it(FMap,FMap->alpha0(last));
420  ++it; // pas d'arête fictive sur la première face
421  while(*it != FMap->alpha0101(behind))
422  {
423  FMap->shiftAllFictiveEdges(*it,FictiveMark);
424  ++it;
425  }
426 }
427 
428 // Ici on décale les arêtes fictives éventuelle se trouvant sur le sommet central
429 // entre les 2 faces dans le plan yz (c'est à dire last et sa voisine de derrière)
430 INLINE
431 void CExtractionImage::shiftFictiveEdgesForFacesYz( CDart* last, CDart* up, CDart* behind, int FictiveMark )
432 {
433  CDynamicCoverage23 it(FMap,FMap->alpha01(last));
434  ++it; // pas d'arête fictive sur la première face
435  while(*it != FMap->alpha010(up))
436  {
437  FMap->shiftAllFictiveEdges(*it,FictiveMark);
438  ++it;
439  }
440 }
441 
442 //******************************************************************************
443 // Les méthodes subcase, qui vont gérer éventuellement les arêtes fictives, et peuvent ensuite
444 // être modifiées pour rajouter des niveaux...
445 
446 //******************************************************************************
447 INLINE
448 void CExtractionImage::subcasePrecodesF1F4F7F10( CImage3d & image,
449  unsigned int x, unsigned int y,
450  CDart* &last, CDart* up, CDart* behind,
451  int level, const CVertex & AVertex, int FictiveMark,
452  bool keepFictiveEdges, bool shiftFictiveEdges )
453 {
454  if (keepFictiveEdges)
455  {
456  if (shiftFictiveEdges)
457  {
458  shiftFictiveEdgesForFacesXy(last,up,behind,FictiveMark);
459  precodesF1F4F7F10(last,up,behind,AVertex);
460  }
461  else
462  if (FMap->existFictiveEdgeIncidentTo(FMap->alpha0(last),FictiveMark))
463  subcasePrecodeFc7(image,x,y,last,up,behind,2,AVertex,
464  FictiveMark,keepFictiveEdges,shiftFictiveEdges);
465  else
466  precodesF1F4F7F10(last,up,behind,AVertex);
467  }
468  else
469  precodesF1F4F7F10(last,up,behind,AVertex);
470 }
471 
472 //******************************************************************************
473 INLINE
474 void CExtractionImage::subcasePrecodesF2F5F8F11( CImage3d & image,
475  unsigned int x, unsigned int y,
476  CDart* &last, CDart* up, CDart* behind,
477  int level, const CVertex & AVertex, int FictiveMark,
478  bool keepFictiveEdges, bool shiftFictiveEdges )
479 {
480  if (keepFictiveEdges)
481  {
482  if (shiftFictiveEdges)
483  {
484  shiftFictiveEdgesForFacesXz(last,up,behind,FictiveMark);
485  precodesF2F5F8F11(last,up,behind,AVertex);
486  }
487  else
488  if (FMap->existFictiveEdgeIncidentTo(FMap->alpha0(last),FictiveMark))
489  subcasePrecodeFc8(image,x,y,last,up,behind,2,AVertex,
490  FictiveMark,keepFictiveEdges,shiftFictiveEdges);
491  else
492  precodesF2F5F8F11(last,up,behind,AVertex);
493  }
494  else
495  precodesF2F5F8F11(last,up,behind,AVertex);
496 }
497 
498 //******************************************************************************
499 INLINE
500 void CExtractionImage::subcasePrecodesF3F6F9F12( CImage3d & image,
501  unsigned int x, unsigned int y,
502  CDart* &last, CDart* up, CDart* behind,
503  int level, const CVertex & AVertex, int FictiveMark,
504  bool keepFictiveEdges, bool shiftFictiveEdges )
505 {
506  if (keepFictiveEdges)
507  {
508  if (shiftFictiveEdges)
509  {
510  shiftFictiveEdgesForFacesYz(last,up,behind,FictiveMark);
511  precodesF3F6F9F12(last,up,behind,AVertex);
512  }
513  else
514  if (FMap->existFictiveEdgeIncidentTo(FMap->alpha0(last),FictiveMark))
515  subcasePrecodeFc9(image,x,y,last,up,behind,2,AVertex,
516  FictiveMark,keepFictiveEdges,shiftFictiveEdges);
517  else
518  precodesF3F6F9F12(last,up,behind,AVertex);
519  }
520  else
521  precodesF3F6F9F12(last,up,behind,AVertex);
522 }
523 
524 //******************************************************************************
525 INLINE
526 void CExtractionImage::subcasePrecodesF13F19( CImage3d & image,
527  unsigned int x, unsigned int y,
528  CDart* &last, CDart* up, CDart* behind,
529  int level, const CVertex & AVertex, int FictiveMark,
530  bool keepFictiveEdges, bool shiftFictiveEdges )
531 {
532  if (keepFictiveEdges)
533  {
534  if (shiftFictiveEdges)
535  {
536  shiftFictiveEdgesForFacesXy(last,up,behind,FictiveMark);
537  precodesF13F19(last,up,behind,AVertex);
538  }
539  else
540  if (FMap->existFictiveEdgeIncidentTo(FMap->alpha0(last),FictiveMark))
541  subcasePrecodeFc13(image,x,y,last,up,behind,2,AVertex,
542  FictiveMark,keepFictiveEdges,shiftFictiveEdges);
543  else
544  precodesF13F19(last,up,behind,AVertex);
545  }
546  else
547  precodesF13F19(last,up,behind,AVertex);
548 }
549 
550 //******************************************************************************
551 INLINE
552 void CExtractionImage::subcasePrecodesF14F20( CImage3d & image,
553  unsigned int x, unsigned int y,
554  CDart* &last, CDart* up, CDart* behind,
555  int level, const CVertex & AVertex, int FictiveMark,
556  bool keepFictiveEdges, bool shiftFictiveEdges )
557 {
558  if (keepFictiveEdges)
559  {
560  if (shiftFictiveEdges)
561  {
562  shiftFictiveEdgesForFacesXz(last,up,behind,FictiveMark);
563  precodesF14F20(last,up,behind,AVertex);
564  }
565  else
566  if (FMap->existFictiveEdgeIncidentTo(FMap->alpha0(last),FictiveMark))
567  subcasePrecodeFc14(image,x,y,last,up,behind,2,AVertex,
568  FictiveMark,keepFictiveEdges,shiftFictiveEdges);
569  else
570  precodesF14F20(last,up,behind,AVertex);
571  }
572  else
573  precodesF14F20(last,up,behind,AVertex);
574 }
575 
576 //******************************************************************************
577 INLINE
578 void CExtractionImage::subcasePrecodesF15F21( CImage3d & image,
579  unsigned int x, unsigned int y,
580  CDart* &last, CDart* up, CDart* behind,
581  int level, const CVertex & AVertex, int FictiveMark,
582  bool keepFictiveEdges, bool shiftFictiveEdges )
583 {
584  if (keepFictiveEdges)
585  {
586  if (shiftFictiveEdges)
587  {
588  shiftFictiveEdgesForFacesYz(last,up,behind,FictiveMark);
589  precodesF15F21(last,up,behind,AVertex);
590  }
591  else
592  if (FMap->existFictiveEdgeIncidentTo(FMap->alpha0(last),FictiveMark))
593  subcasePrecodeFc15(image,x,y,last,up,behind,2,AVertex,
594  FictiveMark,keepFictiveEdges,shiftFictiveEdges);
595  else
596  precodesF15F21(last,up,behind,AVertex);
597  }
598  else
599  precodesF15F21(last,up,behind,AVertex);
600 }
601 
602 //******************************************************************************
603 INLINE
604 void CExtractionImage::subcasePrecodesF16F22( CImage3d & image,
605  unsigned int x, unsigned int y,
606  CDart* &last, CDart* up, CDart* behind,
607  int level, const CVertex & AVertex, int FictiveMark,
608  bool keepFictiveEdges, bool shiftFictiveEdges )
609 {
610  if (keepFictiveEdges)
611  {
612  if (shiftFictiveEdges)
613  {
614  shiftFictiveEdgesForFacesYz(last,up,behind,FictiveMark);
615  precodesF16F22(last,up,behind,AVertex);
616  }
617  else
618  if (FMap->existFictiveEdgeIncidentTo(FMap->alpha0(last),FictiveMark))
619  subcasePrecodeFc10(image,x,y,last,up,behind,2,AVertex,
620  FictiveMark,keepFictiveEdges,shiftFictiveEdges);
621  else
622  precodesF16F22(last,up,behind,AVertex);
623  }
624  else
625  precodesF16F22(last,up,behind,AVertex);
626 }
627 
628 //******************************************************************************
629 INLINE
630 void CExtractionImage::subcasePrecodesF17F23( CImage3d & image,
631  unsigned int x, unsigned int y,
632  CDart* &last, CDart* up, CDart* behind,
633  int level, const CVertex & AVertex, int FictiveMark,
634  bool keepFictiveEdges, bool shiftFictiveEdges )
635 {
636  if (keepFictiveEdges)
637  {
638  if (shiftFictiveEdges)
639  {
640  shiftFictiveEdgesForFacesXy(last,up,behind,FictiveMark);
641  precodesF17F23(last,up,behind,AVertex);
642  }
643  else
644  if (FMap->existFictiveEdgeIncidentTo(FMap->alpha0(last),FictiveMark))
645  subcasePrecodeFc11(image,x,y,last,up,behind,2,AVertex,
646  FictiveMark,keepFictiveEdges,shiftFictiveEdges);
647  else
648  precodesF17F23(last,up,behind,AVertex);
649  }
650  else
651  precodesF17F23(last,up,behind,AVertex);
652 }
653 
654 //******************************************************************************
655 INLINE
656 void CExtractionImage::subcasePrecodesF18F24( CImage3d & image,
657  unsigned int x, unsigned int y,
658  CDart* &last, CDart* up, CDart* behind,
659  int level, const CVertex & AVertex, int FictiveMark,
660  bool keepFictiveEdges, bool shiftFictiveEdges )
661 {
662  if (keepFictiveEdges)
663  {
664  if (shiftFictiveEdges)
665  {
666  shiftFictiveEdgesForFacesXz(last,up,behind,FictiveMark);
667  precodesF18F24(last,up,behind,AVertex);
668  }
669  else
670  if (FMap->existFictiveEdgeIncidentTo(FMap->alpha0(last),FictiveMark))
671  subcasePrecodeFc12(image,x,y,last,up,behind,2,AVertex,
672  FictiveMark,keepFictiveEdges,shiftFictiveEdges);
673  else
674  precodesF18F24(last,up,behind,AVertex);
675  }
676  else
677  precodesF18F24(last,up,behind,AVertex);
678 }
679 
680 //******************************************************************************
681 INLINE
682 void CExtractionImage::subcasePrecodeF25( CImage3d & image,
683  unsigned int x, unsigned int y,
684  CDart* &last, CDart* up, CDart* behind,
685  int level, const CVertex & AVertex, int FictiveMark,
686  bool keepFictiveEdges, bool shiftFictiveEdges )
687 {
688  if (keepFictiveEdges)
689  {
690  if (shiftFictiveEdges)
691  {
692  shiftFictiveEdgesForFacesXz(last,up,behind,FictiveMark);
693  precodeF25(last,up,behind,AVertex);
694  }
695  else
696  if (FMap->existFictiveEdgeIncidentTo(FMap->alpha0(last),FictiveMark))
697  subcasePrecodeL8(image,x,y,last,up,behind,1,AVertex,
698  FictiveMark,keepFictiveEdges,shiftFictiveEdges);
699  else
700  precodeF25(last,up,behind,AVertex);
701  }
702  else
703  precodeF25(last,up,behind,AVertex);
704 }
705 
706 //******************************************************************************
707 INLINE
708 void CExtractionImage::subcasePrecodeF26( CImage3d & image,
709  unsigned int x, unsigned int y,
710  CDart* &last, CDart* up, CDart* behind,
711  int level, const CVertex & AVertex, int FictiveMark,
712  bool keepFictiveEdges, bool shiftFictiveEdges )
713 {
714  if (keepFictiveEdges)
715  {
716  if (shiftFictiveEdges)
717  {
718  shiftFictiveEdgesForFacesYz(last,up,behind,FictiveMark);
719  precodeF26(last,up,behind,AVertex);
720  }
721  else
722  if (FMap->existFictiveEdgeIncidentTo(FMap->alpha0(last),FictiveMark))
723  subcasePrecodeL8(image,x,y,last,up,behind,1,AVertex,
724  FictiveMark,keepFictiveEdges,shiftFictiveEdges);
725  else
726  precodeF26(last,up,behind,AVertex);
727  }
728  else
729  precodeF26(last,up,behind,AVertex);
730 }
731 
732 //******************************************************************************
733 INLINE
734 void CExtractionImage::subcasePrecodeF27( CImage3d & image,
735  unsigned int x, unsigned int y,
736  CDart* &last, CDart* up, CDart* behind,
737  int level, const CVertex & AVertex, int FictiveMark,
738  bool keepFictiveEdges, bool shiftFictiveEdges )
739 {
740  if (keepFictiveEdges)
741  {
742  if (shiftFictiveEdges)
743  {
744  shiftFictiveEdgesForFacesXy(last,up,behind,FictiveMark);
745  precodeF27(last,up,behind,AVertex);
746  }
747  else
748  if (FMap->existFictiveEdgeIncidentTo(FMap->alpha0(last),FictiveMark))
749  subcasePrecodeL8(image,x,y,last,up,behind,1,AVertex,
750  FictiveMark,keepFictiveEdges,shiftFictiveEdges);
751  else
752  precodeF27(last,up,behind,AVertex);
753  }
754  else
755  precodeF27(last,up,behind,AVertex);
756 }
757 
758 } // namespace GMap3d