]> SALOME platform Git repositories - modules/med.git/blob - src/MEDWrapper/Base/MED_Structures.cxx
Salome HOME
Join modifications from branch CEAFor_V3_2_0
[modules/med.git] / src / MEDWrapper / Base / MED_Structures.cxx
1 //  Copyright (C) 2003  CEA/DEN, EDF R&D
2 //
3 //
4 //
5 //  File   : VISU_Structure.cxx
6 //  Author : Eugeny NIKOLAEV
7 //  Module : VISU
8
9 #include "MED_Structures.hxx"
10 #include "MED_Utilities.hxx"
11
12 using namespace MED;
13
14 namespace MED
15 {
16   TInt
17   GetNbNodes(EGeometrieElement typmai)
18   {
19     return typmai%100;
20   }
21
22   std::string 
23   GetString(TInt theId, 
24             TInt theStep, 
25             const TString& theString)
26   {
27     const char* aPos = &theString[theId*theStep];
28     TInt aSize = std::min(TInt(strlen(aPos)),theStep);
29     return std::string(aPos,aSize);
30   }
31
32   void 
33   SetString(TInt theId, 
34             TInt theStep, 
35             TString& theString, 
36             const std::string& theValue)
37   {
38     TInt aSize = std::min(TInt(theValue.size()+1),theStep);
39     char* aPos = &theString[theId*theStep];
40     strncpy(aPos,theValue.c_str(),aSize);
41   }
42
43   TInt
44   GetDimGaussCoord(EGeometrieElement theGeom)
45   {
46     return theGeom/100;
47   }
48
49   TInt
50   GetNbRefCoord(EGeometrieElement theGeom)
51   {
52     return (theGeom%100);
53   }
54
55 }
56
57 //---------------------------------------------------------------
58 TInt
59 TFamilyInfo
60 ::GetAttrId(TInt theId) const 
61 {
62   return myAttrId[theId];
63 }
64
65 TInt
66 TFamilyInfo
67 ::GetAttrVal(TInt theId) const 
68 {
69   return myAttrVal[theId];
70 }
71
72 void
73 TFamilyInfo
74 ::SetAttrId(TInt theId,TInt theVal) 
75 {
76   myAttrId[theId] = theVal;
77 }
78
79 void
80 TFamilyInfo
81 ::SetAttrVal(TInt theId,TInt theVal) 
82 {
83   myAttrVal[theId] = theVal;
84 }
85
86 //---------------------------------------------------------------
87 TInt
88 TElemInfo
89 ::GetFamNum(TInt theId) const 
90 {
91   return myFamNum[theId];
92 }
93
94 TInt
95 TElemInfo
96 ::GetElemNum(TInt theId) const 
97 {
98   return myElemNum[theId];
99 }
100
101 void
102 TElemInfo
103 ::SetFamNum(TInt theId,TInt theVal) 
104 {
105   myFamNum[theId] = theVal;
106 }
107
108 //---------------------------------------------------------------
109 TCCoordSlice 
110 TNodeInfo
111 ::GetCoordSlice(TInt theId) const
112 {
113   TInt aDim = myMeshInfo->GetDim();
114   if(GetModeSwitch() == eFULL_INTERLACE)
115     return TCCoordSlice(myCoord,std::slice(theId*aDim,aDim,1));
116   else
117     return TCCoordSlice(myCoord,std::slice(theId,aDim,aDim));
118 }
119
120 TCoordSlice 
121 TNodeInfo
122 ::GetCoordSlice(TInt theId)
123 {
124   TInt aDim = myMeshInfo->GetDim();
125   if(GetModeSwitch() == eFULL_INTERLACE)
126     return TCoordSlice(myCoord,std::slice(theId*aDim,aDim,1));
127   else
128     return TCoordSlice(myCoord,std::slice(theId,aDim,aDim));
129 }
130
131 //---------------------------------------------------------------
132 TCConnSlice 
133 TCellInfo
134 ::GetConnSlice(TInt theElemId) const
135 {
136   if(GetModeSwitch() == eFULL_INTERLACE)
137     return TCConnSlice(myConn,std::slice(GetConnDim()*theElemId,GetNbNodes(myGeom),1));
138   else
139     return TCConnSlice(myConn,std::slice(theElemId,GetNbNodes(myGeom),GetConnDim()));
140 }
141
142 TConnSlice 
143 TCellInfo
144 ::GetConnSlice(TInt theElemId)
145 {
146   if(GetModeSwitch() == eFULL_INTERLACE)
147     return TConnSlice(myConn,std::slice(GetConnDim()*theElemId,GetNbNodes(myGeom),1));
148   else
149     return TConnSlice(myConn,std::slice(theElemId,GetNbNodes(myGeom),GetConnDim()));
150 }
151
152
153 //---------------------------------------------------------------
154 TInt
155 TPolygoneInfo
156 ::GetNbConn(TInt theElemId) const 
157 {
158   return myIndex[theElemId + 1] - myIndex[theElemId];
159 }
160
161 TCConnSlice 
162 TPolygoneInfo
163 ::GetConnSlice(TInt theElemId) const
164 {
165   return TCConnSlice(myConn,std::slice(myIndex[theElemId]-1,GetNbConn(theElemId),1));
166 }
167
168 TConnSlice 
169 TPolygoneInfo
170 ::GetConnSlice(TInt theElemId)
171 {
172   return TConnSlice(myConn,std::slice(myIndex[theElemId]-1,GetNbConn(theElemId),1));
173 }
174
175
176 //---------------------------------------------------------------
177 TInt 
178 TPolyedreInfo
179 ::GetNbFaces(TInt theElemId) const 
180 {
181   return myIndex[theElemId+1] - myIndex[theElemId];
182 }
183
184 TInt 
185 TPolyedreInfo
186 ::GetNbNodes(TInt theElemId) const 
187 {
188   TInt aNbNodes = 0;
189   TInt aNbFaces = GetNbFaces(theElemId);
190   TInt aStartFaceId = myIndex[theElemId] - 1;
191   for(TInt aFaceId = 0; aFaceId < aNbFaces; aFaceId++, aStartFaceId++){
192     TInt aCurrentId = myFaces[aStartFaceId];
193     TInt aDiff = myFaces[aStartFaceId + 1] - aCurrentId;
194     aNbNodes += aDiff;
195   }
196   return aNbNodes;
197 }
198
199 TCConnSliceArr 
200 TPolyedreInfo
201 ::GetConnSliceArr(TInt theElemId) const
202 {
203   TInt aNbFaces = GetNbFaces(theElemId);
204   TCConnSliceArr aConnSliceArr(aNbFaces);
205   TInt aStartFaceId = myIndex[theElemId] - 1;
206   for(TInt aFaceId = 0; aFaceId < aNbFaces; aFaceId++, aStartFaceId++){
207     TInt aCurrentId = myFaces[aStartFaceId];
208     TInt aDiff = myFaces[aStartFaceId + 1] - aCurrentId;
209     aConnSliceArr[aFaceId] =
210       TCConnSlice(myConn,std::slice(aCurrentId - 1,aDiff,1));
211   }
212   return aConnSliceArr;
213 }
214
215 TConnSliceArr 
216 TPolyedreInfo
217 ::GetConnSliceArr(TInt theElemId)
218 {
219   TInt aNbFaces = GetNbFaces(theElemId);
220   TConnSliceArr aConnSliceArr(aNbFaces);
221   TInt aStartFaceId = myIndex[theElemId] - 1;
222   for(TInt aFaceId = 0; aFaceId < aNbFaces; aFaceId++, aStartFaceId++){
223     TInt aCurrentId = myFaces[aStartFaceId];
224     TInt aDiff = myFaces[aStartFaceId + 1] - aCurrentId;
225     aConnSliceArr[aFaceId] =
226       TConnSlice(myConn,std::slice(aCurrentId - 1,aDiff,1));
227   }
228   return aConnSliceArr;
229 }
230
231
232 //---------------------------------------------------------------
233 TInt
234 TProfileInfo
235 ::GetElemNum(TInt theId) const 
236 {
237   return myElemNum[theId];
238 }
239
240 void
241 TProfileInfo
242 ::SetElemNum(TInt theId,TInt theVal) 
243 {
244   myElemNum[theId] = theVal;
245 }
246
247 //---------------------------------------------------------------
248 bool
249 TGaussInfo::TLess
250 ::operator()(const TKey& theLeft, const TKey& theRight) const
251 {
252   EGeometrieElement aLGeom = boost::get<0>(theLeft);
253   EGeometrieElement aRGeom = boost::get<0>(theRight);
254   if(aLGeom != aRGeom)
255     return aLGeom < aRGeom;
256
257   const std::string& aLStr = boost::get<1>(theLeft);
258   const std::string& aRStr = boost::get<1>(theRight);
259   return aLStr < aRStr;
260 }
261
262 bool
263 TGaussInfo::TLess
264 ::operator()(const TGaussInfo& theLeft, const TGaussInfo& theRight) const
265 {
266   if(theLeft.myGeom != theRight.myGeom)
267     return theLeft.myGeom < theRight.myGeom;
268
269   if(theLeft.myRefCoord != theRight.myRefCoord)
270     return theLeft.myRefCoord < theRight.myRefCoord;
271
272   return theLeft.myGaussCoord < theRight.myGaussCoord;
273 }
274
275 TCCoordSlice 
276 TGaussInfo
277 ::GetRefCoordSlice(TInt theId) const
278 {
279   if(GetModeSwitch() == eFULL_INTERLACE)
280     return TCCoordSlice(myRefCoord,std::slice(theId*GetDim(),GetDim(),1));
281   else
282     return TCCoordSlice(myRefCoord,std::slice(theId,GetDim(),GetDim()));
283 }
284
285 TCoordSlice 
286 TGaussInfo
287 ::GetRefCoordSlice(TInt theId)
288 {
289   if(GetModeSwitch() == eFULL_INTERLACE)
290     return TCoordSlice(myRefCoord,std::slice(theId*GetDim(),GetDim(),1));
291   else
292     return TCoordSlice(myRefCoord,std::slice(theId,GetDim(),GetDim()));
293 }
294
295 TCCoordSlice 
296 TGaussInfo
297 ::GetGaussCoordSlice(TInt theId) const
298 {
299   if(GetModeSwitch() == eFULL_INTERLACE)
300     return TCCoordSlice(myGaussCoord,std::slice(theId*GetDim(),GetDim(),1));
301   else
302     return TCCoordSlice(myGaussCoord,std::slice(theId,GetDim(),GetDim()));
303 }
304
305 TCoordSlice 
306 TGaussInfo
307 ::GetGaussCoordSlice(TInt theId)
308 {
309   if(GetModeSwitch() == eFULL_INTERLACE)
310     return TCoordSlice(myGaussCoord,std::slice(theId*GetDim(),GetNbGauss(),1));
311   else
312     return TCoordSlice(myGaussCoord,std::slice(theId,GetNbGauss(),GetDim()));
313 }
314
315
316 //---------------------------------------------------------------
317 TInt
318 TTimeStampInfo
319 ::GetNbGauss(EGeometrieElement theGeom) const
320 {
321   TGeom2NbGauss::const_iterator anIter = myGeom2NbGauss.find(theGeom);
322   if(anIter == myGeom2NbGauss.end())
323     EXCEPTION(runtime_error,"TTimeStampInfo::GetNbGauss - myGeom2NbGauss.find(theGeom) fails");
324
325   return anIter->second;
326 }
327
328
329 //---------------------------------------------------------------
330 void
331 TMeshValue
332 ::Init(TInt theNbElem,
333        TInt theNbGauss,
334        TInt theNbComp,
335        EModeSwitch theMode)
336 {
337   myModeSwitch = theMode;
338   
339   myNbElem = theNbElem;
340   myNbGauss = theNbGauss;
341   myNbComp = theNbComp;
342   
343   myStep = theNbComp*theNbGauss;
344   
345   myValue.resize(theNbElem*myStep);
346 }
347
348 //---------------------------------------------------------------
349 TCValueSliceArr 
350 TMeshValue
351 ::GetGaussValueSliceArr(TInt theElemId) const
352 {
353   TCValueSliceArr aValueSliceArr(myNbGauss);
354   if(GetModeSwitch() == eFULL_INTERLACE){
355     TInt anId = theElemId*myStep;
356     for(TInt aGaussId = 0; aGaussId < myNbGauss; aGaussId++){
357       aValueSliceArr[aGaussId] =
358         TCValueSlice(myValue,std::slice(anId,myNbComp,1));
359       anId += myNbComp;
360     }
361   }
362   else{
363     for(TInt aGaussId = 0; aGaussId < myNbGauss; aGaussId++){
364       aValueSliceArr[aGaussId] =
365         TCValueSlice(myValue,std::slice(theElemId,myNbComp,myStep));
366     }
367   }
368   return aValueSliceArr;
369 }
370
371 TValueSliceArr 
372 TMeshValue
373 ::GetGaussValueSliceArr(TInt theElemId)
374 {
375   TValueSliceArr aValueSliceArr(myNbGauss);
376   if(GetModeSwitch() == eFULL_INTERLACE){
377     TInt anId = theElemId*myStep;
378     for(TInt aGaussId = 0; aGaussId < myNbGauss; aGaussId++){
379       aValueSliceArr[aGaussId] =
380         TValueSlice(myValue,std::slice(anId,myNbComp,1));
381       anId += myNbComp;
382     }
383   }
384   else{
385     for(TInt aGaussId = 0; aGaussId < myNbGauss; aGaussId++){
386       aValueSliceArr[aGaussId] =
387         TValueSlice(myValue,std::slice(theElemId,myNbComp,myStep));
388     }
389   }
390   return aValueSliceArr;
391 }
392
393 //---------------------------------------------------------------
394 TCValueSliceArr 
395 TMeshValue
396 ::GetCompValueSliceArr(TInt theElemId) const
397 {
398   TCValueSliceArr aValueSliceArr(myNbComp);
399   if(GetModeSwitch() == eFULL_INTERLACE){
400     TInt anId = theElemId*myStep;
401     for(TInt aCompId = 0; aCompId < myNbComp; aCompId++){
402       aValueSliceArr[aCompId] =
403         TCValueSlice(myValue,std::slice(anId,myNbGauss,myNbComp));
404       anId += 1;
405     }
406   }
407   else{
408     for(TInt aCompId = 0; aCompId < myNbComp; aCompId++){
409       aValueSliceArr[aCompId] =
410         TCValueSlice(myValue,std::slice(theElemId,myNbGauss,myStep));
411     }
412   }
413   return aValueSliceArr;
414 }
415
416
417 TValueSliceArr 
418 TMeshValue
419 ::GetCompValueSliceArr(TInt theElemId)
420 {
421   TValueSliceArr aValueSliceArr(myNbGauss);
422   if(GetModeSwitch() == eFULL_INTERLACE){
423     TInt anId = theElemId*myStep;
424     for(TInt aCompId = 0; aCompId < myNbComp; aCompId++){
425       aValueSliceArr[aCompId] =
426         TValueSlice(myValue,std::slice(anId,myNbGauss,myNbComp));
427       anId += 1;
428     }
429   }
430   else{
431     for(TInt aGaussId = 0; aGaussId < myNbGauss; aGaussId++){
432       aValueSliceArr[aGaussId] =
433         TValueSlice(myValue,std::slice(theElemId,myNbComp,myStep));
434     }
435   }
436   return aValueSliceArr;
437 }
438
439
440 //---------------------------------------------------------------
441 const TMeshValue& 
442 TTimeStampVal
443 ::GetMeshValue(EGeometrieElement theGeom) const
444 {
445   TGeom2Value::const_iterator anIter = myGeom2Value.find(theGeom);
446   if(anIter == myGeom2Value.end())
447     EXCEPTION(runtime_error,"TTimeStampVal::GetMeshValue - myGeom2Value.find(theGeom) fails");
448   return anIter->second;
449 }
450
451 TMeshValue& 
452 TTimeStampVal
453 ::GetMeshValue(EGeometrieElement theGeom)
454 {
455   return myGeom2Value[theGeom];
456 }
457
458 //---------------------------------------------------------------
459 // TGrilleInfo structure methods
460 //---------------------------------------------------------------
461 const EGrilleType&
462 TGrilleInfo
463 ::GetGrilleType() const
464 {
465   return myGrilleType;
466 }
467
468 EGrilleType
469 TGrilleInfo
470 ::GetGrilleType()
471 {
472   return myGrilleType;
473 }
474
475 void
476 TGrilleInfo
477 ::SetGrilleType(EGrilleType theGrilleType)
478 {
479   myGrilleType = theGrilleType;
480 }
481
482 const
483 TIndexes&
484 TGrilleInfo
485 ::GetMapOfIndexes() const
486 {
487   return myIndixes;
488 }
489
490 TIndexes
491 TGrilleInfo
492 ::GetMapOfIndexes()
493 {
494   return myIndixes;
495 }
496
497 const
498 TFloatVector&
499 TGrilleInfo
500 ::GetIndexes(TInt theAxisNumber) const
501 {
502   TIndexes::const_iterator aIter=myIndixes.find(theAxisNumber);
503   if(aIter==myIndixes.end())
504     EXCEPTION(runtime_error,"const TGrilleInfo::GetIndexes - myIndixes.find(theAxisNumber); fails");
505   return aIter->second;
506 }
507
508 TFloatVector
509 TGrilleInfo
510 ::GetIndexes(TInt theAxisNumber)
511 {
512   TIndexes::iterator aIter=myIndixes.find(theAxisNumber);
513   if(aIter==myIndixes.end())
514     EXCEPTION(runtime_error,"TGrilleInfo::GetIndexes - myIndixes.find(theAxisNumber); fails");
515   return aIter->second;
516 }
517
518 TInt
519 TGrilleInfo
520 ::GetNbIndexes(TInt theAxisNumber)
521 {
522   const TFloatVector& aVector=GetIndexes(theAxisNumber);
523   return aVector.size();
524 }
525
526 TInt
527 TGrilleInfo
528 ::GetNbNodes()
529 {
530   TInt nbNodes=0;
531   TInt aDim = myMeshInfo->GetDim();
532   if(myGrilleType == eGRILLE_STANDARD)
533     for(int i=0;i<aDim;i++)
534       if(nbNodes == 0)
535         nbNodes = myGrilleStructure[i];
536       else
537         nbNodes = nbNodes*myGrilleStructure[i];
538   else
539     for(int i=0;i<aDim;i++)
540       if(nbNodes == 0)
541         nbNodes = GetNbIndexes(i);
542       else
543         nbNodes = nbNodes*GetNbIndexes(i);
544   
545   return nbNodes;
546 }
547
548 TInt
549 TGrilleInfo
550 ::GetNbCells()
551 {
552   TInt nbCells=0;
553   TInt aDim = myMeshInfo->GetDim();
554   if(myGrilleType == eGRILLE_STANDARD)
555     for(int i=0;i<aDim;i++)
556       if(nbCells == 0)
557         nbCells = myGrilleStructure[i]-1;
558       else
559         nbCells = nbCells*(myGrilleStructure[i]-1);
560   else
561     for(int i=0;i<aDim;i++)
562       if(nbCells == 0)
563         nbCells = GetNbIndexes(i)-1;
564       else
565         nbCells = nbCells*(GetNbIndexes(i)-1);
566   return nbCells;
567 }
568
569 EGeometrieElement
570 TGrilleInfo
571 ::GetGeom()
572 {
573   TInt aDim = myMeshInfo->GetDim();
574   switch(aDim){
575   case 1:
576     return eSEG2;
577   case 2:
578     return eQUAD4;
579   case 3:
580     return eHEXA8;
581   default:
582     return eNONE;
583   }
584 }
585
586 EEntiteMaillage
587 TGrilleInfo
588 ::GetEntity()
589 {
590   return eMAILLE;
591 }
592
593 const
594 TIntVector&
595 TGrilleInfo
596 ::GetGrilleStructure() const
597 {
598   return myGrilleStructure;
599 }
600
601 TIntVector
602 TGrilleInfo
603 ::GetGrilleStructure()
604 {
605   return myGrilleStructure;
606 }
607
608 void
609 TGrilleInfo
610 ::SetGrilleStructure(TInt theAxis,TInt theNb)
611 {
612   if(theAxis >= 0 && theAxis <=2 && theNb >= 0)
613   myGrilleStructure[theAxis]=theNb;
614 }
615
616 const
617 TNodeCoord&
618 TGrilleInfo
619 ::GetNodeCoord() const
620 {
621   return myCoord;
622 }
623
624 TNodeCoord
625 TGrilleInfo
626 ::GetNodeCoord()
627 {
628   return myCoord;
629 }
630
631 TNodeCoord
632 TGrilleInfo
633 ::GetCoord(TInt theId)
634 {
635   TNodeCoord aCoord;
636   TInt aDim       = myMeshInfo->GetDim();
637   TInt aNbNodes   = this->GetNbNodes();
638   aCoord.resize(aDim);
639   
640   if(theId >= aNbNodes)
641     EXCEPTION(runtime_error,"TGrilleInfo::GetCoord - theId out of range");
642
643   if(myGrilleType == eGRILLE_STANDARD){
644     switch(aDim){
645     case 3:
646       aCoord[2] = myCoord[aDim*theId+2];
647     case 2:
648       aCoord[1] = myCoord[aDim*theId+1];
649     case 1:{
650       aCoord[0] = myCoord[aDim*theId];
651       break;
652     }
653     }
654   } else {
655
656     TFloatVector aVecX  = this->GetIndexes(0);
657     TInt nbIndxX        = this->GetNbIndexes(0);
658     
659     switch(aDim){
660     case 1:{
661       aCoord[0] = aVecX[theId];
662       break;
663     }
664     case 2:{
665       TFloatVector aVecY = this->GetIndexes(1);
666       TInt i,j,k;
667       i = j = k = 0;
668       i = theId % nbIndxX;
669       j = theId / nbIndxX;
670       if(myGrilleType == eGRILLE_CARTESIENNE){
671         aCoord[0] = aVecX[i];
672         aCoord[1] = aVecY[j];
673       } else { // eGRILLE_POLAIRE (cylindrical)
674         aCoord[0] = aVecX[i] * cos(aVecY[j]);
675         aCoord[1] = aVecX[i] * sin(aVecY[j]);
676       }
677       break;
678     }
679     case 3:{
680       TFloatVector aVecY = this->GetIndexes(1);
681       TInt nbIndxY       = this->GetNbIndexes(1);
682       TFloatVector aVecZ = this->GetIndexes(2);
683       TInt i,j,k;
684       i = j = k = 0;
685       
686       i = theId % nbIndxX;
687       j = (theId / nbIndxX) % nbIndxY;
688       k = theId / (nbIndxX*nbIndxY);
689
690       if(myGrilleType == eGRILLE_CARTESIENNE){
691         aCoord[0] = aVecX[i];
692         aCoord[1] = aVecY[j];
693         aCoord[2] = aVecZ[k];
694       } else { // eGRILLE_POLAIRE (cylindrical)
695         aCoord[0] = aVecX[i] * cos(aVecY[j]);
696         aCoord[1] = aVecX[i] * sin(aVecY[j]);
697         aCoord[2] = aVecZ[k];
698       }
699       
700       break;
701     }
702     }
703   }
704     
705   return aCoord;
706 }
707
708 TIntVector
709 TGrilleInfo
710 ::GetConn(TInt theId)
711 {
712   TIntVector anIndexes;
713   TInt aDim       = myMeshInfo->GetDim();
714   TInt aArrSize   = 2;
715   for(int i=1;i<aDim;i++) aArrSize = aArrSize*2;
716   
717   TInt idx;
718   TInt iMin, iMax, jMin, jMax, kMin, kMax;
719   TInt loc[3];
720
721   loc[0] = loc[1] = loc[2] = 0;
722   iMin = iMax = jMin = jMax = kMin = kMax = 0;
723  
724   TInt nbX,nbY;
725   if (myGrilleType == eGRILLE_STANDARD)
726     {
727       nbX = this->GetGrilleStructure()[0];
728       nbY = this->GetGrilleStructure()[1];
729     }
730   else
731     {
732       nbX = this->GetNbIndexes(0);
733       nbY = this->GetNbIndexes(1);
734     }
735
736   TInt d01 = nbX*nbY;
737   
738   switch(aDim){
739   case 3:{
740     iMin = theId % (nbX - 1);
741     iMax = iMin + 1;
742     jMin = (theId / (nbX - 1)) % (nbY - 1);
743     jMax = jMin + 1;
744     kMin = theId / ((nbX - 1) * (nbY - 1));
745     kMax = kMin + 1;
746     break;
747   }
748   case 2:{
749     iMin = theId % (nbX-1);
750     iMax = iMin + 1;
751     jMin = theId / (nbX-1);
752     jMax = jMin + 1;
753     break;
754   }
755   case 1:{
756     iMin = theId;
757     iMax = theId + 1;
758     break;
759   }
760   }
761   
762   
763   for (loc[2]=kMin; loc[2]<=kMax; loc[2]++)
764     {
765       for (loc[1]=jMin; loc[1]<=jMax; loc[1]++)
766         {
767           for (loc[0]=iMin; loc[0]<=iMax; loc[0]++)
768             {
769               idx = loc[0] + loc[1]*nbX + loc[2]*d01;
770               anIndexes.push_back(idx);
771             }
772         }
773     }
774   
775   return anIndexes;
776 }