source: XMLIO_V2/dev/dev_rv/src/xmlio/node/domain.cpp @ 200

Last change on this file since 200 was 196, checked in by hozdoba, 13 years ago
File size: 22.6 KB
RevLine 
[152]1#include "domain.hpp"
2
3#include "attribute_template_impl.hpp"
4#include "object_template_impl.hpp"
5#include "group_template_impl.hpp"
6
[187]7#include "mpi_manager.hpp"
8
[180]9#include <algorithm>
10
[168]11namespace xmlioserver {
12namespace tree {
13   
14   /// ////////////////////// Définitions ////////////////////// ///
[152]15
[168]16   CDomain::CDomain(void)
17      : CObjectTemplate<CDomain>(), CDomainAttributes()
[187]18      , isChecked(false), local_mask(new CArray<int, 2>(boost::extents[0][0])), relFiles()
[180]19      , ibegin_sub(), iend_sub(), jbegin_sub(), jend_sub()
[182]20      , lonvalue_sub(), latvalue_sub()
[168]21   { /* Ne rien faire de plus */ }
[152]22
[168]23   CDomain::CDomain(const StdString & id)
24      : CObjectTemplate<CDomain>(id), CDomainAttributes()
[187]25      , isChecked(false), local_mask(new CArray<int, 2>(boost::extents[0][0])), relFiles()
[180]26      , ibegin_sub(), iend_sub(), jbegin_sub(), jend_sub()
[182]27      , lonvalue_sub(), latvalue_sub()
[168]28   { /* Ne rien faire de plus */ }
[152]29
[168]30   CDomain::~CDomain(void)
[182]31   { 
32      this->local_mask.reset();
33      for (StdSize i = 0; i < this->lonvalue_sub.size(); i++)
34      {
35         this->lonvalue_sub[i].reset();
36         this->latvalue_sub[i].reset();
37      }     
38   }
[152]39
[168]40   ///---------------------------------------------------------------
[152]41
[168]42   const std::set<StdString> & CDomain::getRelFiles(void) const
43   {
44      return (this->relFiles);
45   }
[152]46
[180]47   //----------------------------------------------------------------
[184]48   
49   bool CDomain::hasZoom(void) const
50   {
51      return ((this->zoom_ni.getValue() != this->ni_glo.getValue()) && 
52              (this->zoom_nj.getValue() != this->nj_glo.getValue()));
53   }
54   
55   //----------------------------------------------------------------
56   
57   bool CDomain::isEmpty(void) const
58   {
59      return ((this->zoom_ni_loc.getValue() == 0) || 
60              (this->zoom_nj_loc.getValue() == 0));
61   }
[180]62
[184]63   //----------------------------------------------------------------
64
[168]65   bool CDomain::IsWritten(const StdString & filename) const
66   {
67      return (this->relFiles.find(filename) != this->relFiles.end());
68   }
[152]69
[180]70   //----------------------------------------------------------------
71
[168]72   void CDomain::addRelFile(const StdString & filename)
73   {
74      this->relFiles.insert(filename);
75   }
[152]76
[168]77   //----------------------------------------------------------------
[152]78
[180]79   void CDomain::fromBinary(StdIStream & is)
80   {
81      SuperClass::fromBinary(is);
82     
83      this->ibegin_sub.push_back(this->ibegin.getValue());
84      this->jbegin_sub.push_back(this->jbegin.getValue());
85      this->iend_sub.push_back(this->iend.getValue());
[182]86      this->jend_sub.push_back(this->jend.getValue()); 
[180]87     
[182]88      this->latvalue_sub.push_back(this->latvalue.getValue());
89      this->lonvalue_sub.push_back(this->lonvalue.getValue());   
90     
[180]91#define CLEAR_ATT(name_)\
92      SuperClassAttribute::operator[](#name_)->clear()
93
94         CLEAR_ATT(mask);
95         CLEAR_ATT(data_n_index);
96         CLEAR_ATT(data_i_index);
97         CLEAR_ATT(data_j_index);
98         
99         CLEAR_ATT(data_ni);
100         CLEAR_ATT(data_nj);
101         CLEAR_ATT(data_ibegin);
102         CLEAR_ATT(data_jbegin);
103         
104         CLEAR_ATT(ni);
105         CLEAR_ATT(nj);
106         
107#undef CLEAR_ATT
108
109      this->ibegin.setValue(*std::min_element(this->ibegin_sub.begin(),this->ibegin_sub.end()));
110      this->jbegin.setValue(*std::min_element(this->jbegin_sub.begin(),this->jbegin_sub.end()));
111      this->iend.setValue(*std::max_element(this->iend_sub.begin(),this->iend_sub.end()));
112      this->jend.setValue(*std::max_element(this->jend_sub.begin(),this->jend_sub.end()));
113   }
114
115   //----------------------------------------------------------------
116
[168]117   StdString CDomain::GetName(void)   { return (StdString("domain")); }
118   StdString CDomain::GetDefName(void){ return (CDomain::GetName()); }
119   ENodeType CDomain::GetType(void)   { return (eDomain); }
[152]120
[168]121   //----------------------------------------------------------------
[152]122
[168]123   void CDomain::checkGlobalDomain(void)
124   {
125      if ((ni_glo.isEmpty() || ni_glo.getValue() <= 0 ) ||
126          (ni_glo.isEmpty() || nj_glo.getValue() <= 0 ))
127         ERROR("CDomain::checkAttributes(void)",
[187]128               << "[ Id = " << this->getId() << " ] "
[168]129               << "Le domaine global est mal défini,"
130               << " vérifiez les valeurs de \'ni_glo\' et \'nj_glo\' !") ;
131   }
[152]132
[168]133   //----------------------------------------------------------------
[152]134
[168]135   void CDomain::checkLocalIDomain(void)
136   {
137      if (!ni.isEmpty() && !ibegin.isEmpty() && iend.isEmpty())
138         iend.setValue(ibegin.getValue() + ni.getValue() - 1) ;
139
140      else if (!ni.isEmpty() && !iend.isEmpty()   && ibegin.isEmpty())
141         ibegin.setValue( - ni.getValue() + iend.getValue() + 1) ;
142
143      else if (!ibegin.isEmpty() && !iend.isEmpty() && ni.isEmpty())
144         ni.setValue(iend.getValue() - ibegin.getValue() + 1) ;
145
146      else if (!ibegin.isEmpty() && !iend.isEmpty() &&
147               !ni.isEmpty() && (iend.getValue() != ibegin.getValue() + ni.getValue() - 1))
[152]148      {
[168]149         ERROR("CDomain::checkAttributes(void)",
150               << "Le domaine est mal défini,"
151               << " iend est différent de (ibegin + ni - 1) !") ;
152      }
153      else
154      {
155         ERROR("CDomain::checkAttributes(void)",
156               << "Le domaine est mal défini,"
157               << " deux valeurs au moins parmis iend, ibegin, ni doivent être définies !") ;
158      }
[152]159
160
[168]161      if (ni.getValue() < 0 || ibegin.getValue() > iend.getValue() ||
162          ibegin.getValue() < 1 || iend.getValue() > ni_glo.getValue())
163         ERROR("CDomain::checkAttributes(void)",
[187]164               << "[ Id = " << this->getId() << " ] "
[168]165               << "Domaine local mal défini,"
166               << " vérifiez les valeurs ni, ni_glo, ibegin, iend") ;
[152]167
[168]168   }
[152]169
[168]170   //----------------------------------------------------------------
[152]171
[168]172   void CDomain::checkLocalJDomain(void)
173   {
174      if (!nj.isEmpty() && !jbegin.isEmpty() && jend.isEmpty())
175         jend.setValue(jbegin.getValue() + nj.getValue() - 1) ;
[152]176
[168]177      else if (!nj.isEmpty() && !jend.isEmpty() && jbegin.isEmpty())
178         jbegin.setValue( - nj.getValue() + jend.getValue() + 1) ;
[152]179
[168]180      else if (!jbegin.isEmpty() && !jend.isEmpty() && nj.isEmpty())
181         nj.setValue(jend.getValue() - jbegin.getValue() + 1) ;
[152]182
[183]183      else if (!jbegin.isEmpty() && !jend.isEmpty() && !nj.isEmpty() &&
184               (jend.getValue() != jbegin.getValue() + nj.getValue() - 1))
[152]185      {
[168]186         ERROR("CDomain::checkAttributes(void)",
187               << "Le domaine est mal défini,"
188               << " iend est différent de (jbegin + nj - 1) !") ;
189      }
190      else
191      {
192         ERROR("CDomain::checkAttributes(void)",
193               << "Le domaine est mal défini,"
194               << " deux valeurs au moins parmis jend, jbegin, nj doivent être définies !") ;
195      }
[152]196
[168]197      if (nj.getValue() < 0 || jbegin.getValue() > jend.getValue() ||
198          jbegin.getValue() < 1 || jend.getValue() > nj_glo.getValue())
199         ERROR("CDomain::checkAttributes(void)",
200               << "Domaine local mal défini,"
201               << " vérifiez les valeurs nj, nj_glo, jbegin, jend") ;
202   }
[152]203
[168]204   //----------------------------------------------------------------
[152]205
[168]206   void CDomain::checkMask(void)
207   {
[183]208      using namespace std;
209     
210      int ibegin_mask = 0,
211          jbegin_mask = 0,
212          iend_mask = iend.getValue() - ibegin.getValue(),
213          jend_mask = jend.getValue() - jbegin.getValue();
214     
215      if (!zoom_ibegin.isEmpty())
216      {
[184]217         int zoom_iend = zoom_ibegin.getValue() + zoom_ni.getValue() - 1;
[183]218         int zoom_jend = zoom_jbegin.getValue() + zoom_nj.getValue() - 1;
219         
220         ibegin_mask = max (ibegin.getValue(), zoom_ibegin.getValue());
221         jbegin_mask = max (jbegin.getValue(), zoom_jbegin.getValue());
222         iend_mask   = min (iend.getValue(), zoom_iend);
223         jend_mask   = min (jend.getValue(), zoom_jend);
[184]224                 
[183]225         ibegin_mask -= ibegin.getValue();
226         jbegin_mask -= jbegin.getValue();
227         iend_mask   -= ibegin.getValue();
228         jend_mask   -= jbegin.getValue();
229      }
230     
231      //~ std::cout << "-------------------" << std::endl
[184]232                //~ << "zoom : " << std::boolalpha << this->hasZoom() << std::endl
233                //~ << "size : " << ni.getValue()  << " X " << nj.getValue()   << std::endl
234                //~ << "it : " << ibegin.getValue() << ", " << iend.getValue() << std::endl
235                //~ << "jt : " << jbegin.getValue() << ", " << jend.getValue() << std::endl
236                //~ << "im : " << ibegin_mask << ", " << iend_mask << std::endl
237                //~ << "jm : " << jbegin_mask << ", " << jend_mask << std::endl
238                //~ << "-------------------" << std::endl;
[183]239
[168]240      if (!mask.isEmpty())
241      {
[183]242         ARRAY(bool, 2) mask_ = mask.getValue();
[168]243         unsigned int niu = ni.getValue(), nju = nj.getValue();
[183]244         if ((mask_->shape()[0] != niu) ||
245             (mask_->shape()[1] != nju))
[152]246            ERROR("CDomain::checkAttributes(void)",
[168]247                  <<"Le masque n'a pas la même taille que le domaine local") ;
[183]248                 
249         for (int i = 0; i < ni.getValue(); i++)
250         {
251            for (int j = 0; j < nj.getValue(); j++)
252            {
253               if (i < ibegin_mask && i > iend_mask &&
254                   j < jbegin_mask && j > jend_mask )
255                     (*mask_)[i][j] = false;
256            }
257         }
[152]258      }
[168]259      else // (!mask.hasValue())
260      { // Si aucun masque n'est défini,
261        // on en crée un nouveau qui valide l'intégralité du domaine.
262         ARRAY_CREATE(__arr, bool, 2, [ni.getValue()][nj.getValue()]);
263         for (int i = 0; i < ni.getValue(); i++)
[183]264         {
[168]265            for (int j = 0; j < nj.getValue(); j++)
[183]266            {
267               if (i >= ibegin_mask && i <= iend_mask &&
268                   j >= jbegin_mask && j <= jend_mask )
269                     (*__arr)[i][j] = true;
270               else  (*__arr)[i][j] = false;
271            }
272         }
273               
[168]274         mask.setValue(__arr);
[182]275         __arr.reset();
[168]276      }
277   }
[152]278
279
[168]280   //----------------------------------------------------------------
281
282   void CDomain::checkDomainData(void)
[180]283   {     
[168]284      if (!data_dim.isEmpty() &&
285         !(data_dim.getValue() == 1 || data_dim.getValue() == 2))
[152]286      {
[168]287         ERROR("CDomain::checkAttributes(void)",
288               << "Dimension des données non comptatible (doit être 1 ou 2) !") ;
[152]289      }
[168]290      else if (data_dim.isEmpty())
291      {
292         ERROR("CDomain::checkAttributes(void)",
293               << "Dimension des données non définie !") ;
294      }
[152]295
[168]296      if (data_ibegin.isEmpty())
297         data_ibegin.setValue(0) ;
298      if (data_jbegin.isEmpty() && (data_dim.getValue() == 2))
[187]299         data_jbegin.setValue(0) ;
[152]300
[168]301      if (!data_ni.isEmpty() && (data_ni.getValue() <= 0))
302      {
303         ERROR("CDomain::checkAttributes(void)",
304               << "Dimension des données négative (data_ni).") ;
305      }
306      else if (data_ni.isEmpty())
307      {
308         data_ni.setValue((data_dim.getValue() == 1)
309                           ? (ni.getValue() * nj.getValue())
310                           : ni.getValue());
311      }
[152]312
[168]313      if (data_dim.getValue() == 2)
[152]314      {
[168]315         if (!data_nj.isEmpty() && (data_nj.getValue() <= 0) )
[152]316         {
317            ERROR("CDomain::checkAttributes(void)",
[168]318                  << "Dimension des données négative (data_nj).") ;
[152]319         }
[168]320         else if (data_nj.isEmpty())
321            data_nj.setValue(nj.getValue()) ;
322      }
[152]323
[168]324   }
[152]325
[168]326   //----------------------------------------------------------------
327
328   void CDomain::checkCompression(void)
329   {
330      if (!data_i_index.isEmpty())
331      {
332         int ssize = data_i_index.getValue()->size();
333         if (!data_n_index.isEmpty() &&
334            (data_n_index.getValue() != ssize))
[152]335         {
336            ERROR("CDomain::checkAttributes(void)",
[168]337                  <<"Dimension data_i_index incompatible avec data_n_index.") ;
[152]338         }
[168]339         else if (data_n_index.isEmpty())
340            data_n_index.setValue(ssize) ;
[152]341
342         if (data_dim.getValue() == 2)
343         {
[168]344            if (!data_j_index.isEmpty() &&
345               (data_j_index.getValue()->size() != data_i_index.getValue()->size()))
[152]346            {
347               ERROR("CDomain::checkAttributes(void)",
[168]348                     <<"Dimension data_j_index incompatible avec data_i_index.") ;
[152]349            }
[168]350            else if (data_j_index.isEmpty())
351            {
352               ERROR("CDomain::checkAttributes(void)",
353                     <<"La donnée data_j_index doit être renseignée !") ;
354            }
[152]355         }
356      }
[168]357      else
358      {
359         if (!data_n_index.isEmpty() ||
360            ((data_dim.getValue() == 2) && (!data_j_index.isEmpty())))
361            ERROR("CDomain::checkAttributes(void)", << "data_i_index non défini") ;
362      }
[152]363
[168]364      if (data_n_index.isEmpty())
365      { // -> bloc re-vérifié OK
366         if (data_dim.getValue() == 1)
[152]367         {
[168]368            const int dni = data_ni.getValue();
369            ARRAY_CREATE(__arri, int, 1, [dni]);
370            data_n_index.setValue(dni);
371            for (int i = 0; i < dni; i++)
372               (*__arri)[i] = i+1 ;
373            data_i_index.setValue(__arri) ;
[152]374         }
[168]375         else   // (data_dim == 2)
[152]376         {
[168]377            const int dni = data_ni.getValue() * data_nj.getValue();
[180]378           
[168]379            ARRAY_CREATE(__arri, int, 1, [dni]);
380            ARRAY_CREATE(__arrj, int, 1, [dni]);               
381            data_n_index.setValue(dni);
382           
383            for(int count = 0, i = 0; i  < data_ni.getValue(); i++)
[182]384            {
[168]385               for(int j = 0; j < data_nj.getValue(); j++, count++)
[183]386               {
[168]387                  (*__arri)[count] = i+1 ;
388                  (*__arrj)[count] = j+1 ;
389               }
[182]390            }
[168]391            data_i_index.setValue(__arri) ;
[182]392            data_j_index.setValue(__arrj) ;           
393            __arri.reset();
394            __arrj.reset();
[152]395         }
396      }
[168]397   }
[152]398
[168]399   //----------------------------------------------------------------
[182]400   
401   void CDomain::completeLonLat(void)
402   {
[187]403      ARRAY_CREATE(lonvalue_temp, double, 1, [0]);
404      ARRAY_CREATE(latvalue_temp, double, 1, [0]);
[185]405     
[187]406      const int ibegin_serv  = ibegin.getValue(),
407                jbegin_serv  = jbegin.getValue(),
408                zoom_ni_serv = zoom_ni_loc.getValue(),
409                zoom_nj_serv = zoom_nj_loc.getValue();
410                     
411      /*std::cout << "Rang du serveur :" << comm::CMPIManager::GetCommRank()   << std::endl
412                << "Begin serv : "     << ibegin_serv << ", " << jbegin_serv <<  std::endl
413                << "End serv : "       << iend_serv   << ", " << jend_serv   <<  std::endl
414                << "Zoom_loc begin : " << zoom_ibegin_loc << ", " << zoom_jbegin_loc <<  std::endl
415                << "Zoom_loc size : "  << zoom_ni_loc << ", " << zoom_nj_loc <<  std::endl;*/
416     
417     
[182]418      ARRAY(double, 1) lonvalue_ = this->lonvalue.getValue(),
419                       latvalue_ = this->latvalue.getValue();
420                       
421      if (this->data_dim.getValue() == 2)
422      {
[187]423         StdSize dm = zoom_ni_serv * zoom_nj_serv;
[185]424         StdSize dn = this->ni.getValue() * this->nj.getValue();
[187]425         
[182]426         lonvalue_->resize(boost::extents[dn]);
427         latvalue_->resize(boost::extents[dn]);
[187]428         lonvalue_temp->resize(boost::extents[dm]);
429         latvalue_temp->resize(boost::extents[dm]);
430         
[182]431         for (StdSize k = 0; k < lonvalue_sub.size(); k++)
432         {
433            int l = 0;
434            ARRAY(double, 1) lonvalue_loc = this->lonvalue_sub[k],
435                             latvalue_loc = this->latvalue_sub[k];
436            const int ibegin_loc = ibegin_sub[k], iend_loc = iend_sub[k],
437                      jbegin_loc = jbegin_sub[k], jend_loc = jend_sub[k];
[187]438                     
439            for (int i = ibegin_loc - ibegin_serv; i < (iend_loc - ibegin_serv + 1); i++)
[182]440            {
[187]441               for (int j = jbegin_loc - jbegin_serv; j < (jend_loc - jbegin_serv + 1); j++)
[182]442               {
[187]443                  (*lonvalue_)[i + j * this->ni.getValue()] = (*lonvalue_loc)[l];             
444                  (*latvalue_)[i + j * this->ni.getValue()] = (*latvalue_loc)[l++];
[182]445               }
446            }
[187]447         }
448         this->lonvalue.setValue(lonvalue_temp);
449         this->latvalue.setValue(latvalue_temp);
[182]450      }
451      else
452      {
[187]453         lonvalue_->resize(boost::extents[this->ni.getValue()]);
454         latvalue_->resize(boost::extents[this->nj.getValue()]);
455         lonvalue_temp->resize(boost::extents[zoom_ni_serv]);
456         latvalue_temp->resize(boost::extents[zoom_nj_serv]);
[182]457         
458         for (StdSize k = 0; k < lonvalue_sub.size(); k++)
459         {
460            int l = 0;
461            ARRAY(double, 1) lonvalue_loc = this->lonvalue_sub[k],
462                             latvalue_loc = this->latvalue_sub[k];
463            const int ibegin_loc = ibegin_sub[k], iend_loc = iend_sub[k],
464                      jbegin_loc = jbegin_sub[k], jend_loc = jend_sub[k];
465                     
[187]466            for (int i = ibegin_loc - ibegin_serv; i < (iend_loc - ibegin_loc + 1); i++)
[182]467               (*lonvalue_)[i] = (*lonvalue_loc)[l++];
468               
[187]469            for (int j = jbegin_loc - jbegin_serv; j < (jend_loc - jbegin_loc + 1); j++)
[182]470               (*latvalue_)[j] = (*latvalue_loc)[l++];
[187]471         }       
472         this->lonvalue.setValue(lonvalue_temp);
473         this->latvalue.setValue(latvalue_temp);
[182]474      }
475   }
476
477   //----------------------------------------------------------------
478
[183]479   void CDomain::checkZoom(void)
480   {
[184]481      // Résolution et vérification des données globales de zoom.
[183]482      if (!this->zoom_ni.isEmpty() || !this->zoom_nj.isEmpty() ||
483          !this->zoom_ibegin.isEmpty() || !this->zoom_jbegin.isEmpty())
484      {
485         if (this->zoom_ni.isEmpty()     && this->zoom_nj.isEmpty() &&
486             this->zoom_ibegin.isEmpty() && this->zoom_jbegin.isEmpty())
487         {
488            ERROR("CDomain::checkZoom(void)",
489                  <<"Les attributs définissant un zoom doivent tous être définis") ;
490         }
491         else
492         {
[184]493            int zoom_iend = zoom_ibegin.getValue() + zoom_ni.getValue() - 1;
[183]494            int zoom_jend = zoom_jbegin.getValue() + zoom_nj.getValue() - 1;
495               
496            if (zoom_ibegin.getValue() < 1  || zoom_jbegin.getValue() < 1 ||
[184]497                zoom_iend > ni_glo.getValue() || zoom_jend > nj_glo.getValue())
[183]498               ERROR("CDomain::checkZoom(void)",
499                     << "Zoom mal défini,"
500                     << " vérifiez les valeurs zoom_ni, zoom_nj, zoom_ibegin, zoom_ibegin") ;
501         }
[184]502      }
503      else
504      {
505         this->zoom_ni.setValue(this->ni_glo.getValue()); 
506         this->zoom_nj.setValue(this->nj_glo.getValue());
507         this->zoom_ibegin.setValue(1);
508         this->zoom_jbegin.setValue(1);
509      }
510      // Résolution des données locales de zoom.
511      {
512         int zoom_iend = zoom_ibegin.getValue() + zoom_ni.getValue() - 1;
513         int zoom_jend = zoom_jbegin.getValue() + zoom_nj.getValue() - 1;
514         
515         if ((zoom_ibegin.getValue() > iend.getValue()) || 
516             (zoom_iend < ibegin.getValue()))
517         {
518            zoom_ni_loc.setValue(0);
519            zoom_ibegin_loc.setValue(-1);
520         }
521         else
522         {
523            int zoom_ibegin_loc_ = (zoom_ibegin.getValue() > ibegin.getValue()) 
524                                 ? zoom_ibegin.getValue()
525                                 : ibegin.getValue();
526            int zoom_iend_loc_  = (zoom_iend < iend.getValue()) 
527                                 ? zoom_iend
528                                 : iend.getValue();
529            int zoom_ni_loc_ = zoom_iend_loc_ - zoom_ibegin_loc_ + 1;
530           
531            zoom_ni_loc.setValue(zoom_ni_loc_);
532            zoom_ibegin_loc.setValue(zoom_ibegin_loc_-ibegin.getValue()+1);
533         }
534         
535         if ((zoom_jbegin.getValue() > jend.getValue()) || 
536             (zoom_jend < jbegin.getValue()))
537         {
538            zoom_nj_loc.setValue(0);
539            zoom_jbegin_loc.setValue(-1);
540         }
541         else
542         {
543            int zoom_jbegin_loc_ = (zoom_jbegin.getValue() > jbegin.getValue()) 
544                                 ? zoom_jbegin.getValue()
545                                 : jbegin.getValue();
546            int zoom_jend_loc_  = (zoom_jend < jend.getValue()) 
547                                 ? zoom_jend
548                                 : jend.getValue();
549            int zoom_nj_loc_ = zoom_jend_loc_ - zoom_jbegin_loc_ + 1;
550           
551            zoom_nj_loc.setValue(zoom_nj_loc_);
552            zoom_jbegin_loc.setValue(zoom_jbegin_loc_-jbegin.getValue()+1);
553         }
554      }
[183]555   }
556
557   //----------------------------------------------------------------
558
[168]559   void CDomain::checkAttributes(void)
560   {
561      if (this->isChecked) return;
[152]562
[168]563      this->checkGlobalDomain();
564      this->checkLocalIDomain();
565      this->checkLocalJDomain();
[183]566     
567      this->checkZoom();
[152]568
[182]569      if (this->latvalue_sub.size() == 0)
[183]570      { // CÃŽté client uniquement
[182]571         this->checkMask();
572         this->checkDomainData();
573         this->checkCompression();
574      }
575      else
[183]576      { // CÃŽté serveur uniquement
[187]577         if (!this->isEmpty())
578            this->completeLonLat();
[182]579      }
[168]580      this->completeMask();
[152]581
[168]582      this->isChecked = true;
583   }
[182]584   
585   //----------------------------------------------------------------
586   
[168]587   void CDomain::completeMask(void)
588   {
[185]589      this->local_mask->resize(boost::extents[zoom_ni_loc.getValue()][zoom_nj_loc.getValue()]);
[168]590   }
[152]591
[182]592   //----------------------------------------------------------------
593
[183]594   ARRAY(int, 2) CDomain::getLocalMask(void) const
[168]595   {
596      return (this->local_mask);
597   }
[182]598   
599   //----------------------------------------------------------------
600   
601   const std::vector<int> & CDomain::getIBeginSub(void) const
602   {
603      return (this->ibegin_sub);
604   }
605   
606   //----------------------------------------------------------------
607   
608   const std::vector<int> & CDomain::getIEndSub(void) const
609   {
610      return (this->iend_sub);
611   }
612   
613   //----------------------------------------------------------------
614   
615   const std::vector<int> & CDomain::getJBeginSub(void) const
616   {
617      return (this->jbegin_sub);
618   }
619   
620   //----------------------------------------------------------------
621   
622   const std::vector<int> & CDomain::getJEndSub(void) const
623   {
624      return (this->iend_sub);
625   }
626   
627   //----------------------------------------------------------------
628   
629   const std::vector<ARRAY(double, 1)> & CDomain::getLonValueSub(void) const
630   {
631      return (this->lonvalue_sub);
632   }
633   
634   //----------------------------------------------------------------
635   
636   const std::vector<ARRAY(double, 1)> & CDomain::getLatValueSub(void) const
637   {
638      return (this->latvalue_sub);
639   }   
640   
[168]641   ///---------------------------------------------------------------
[152]642
[168]643} // namespace tree
[152]644} // namespace xmlioserver
Note: See TracBrowser for help on using the repository browser.