Ignore:
Timestamp:
04/19/11 16:01:52 (13 years ago)
Author:
hozdoba
Message:
 
Location:
XMLIO_V2/dev/dev_rv/src/xmlio/node
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/src/xmlio/node/field.cpp

    r168 r181  
    130130   { 
    131131      // TODO : à compléter; 
     132   } 
     133    
     134   //---------------------------------------------------------------- 
     135    
     136   void CField::fromBinary(StdIStream & is) 
     137   { 
     138      SuperClass::fromBinary(is); 
     139#define CLEAR_ATT(name_)\ 
     140      SuperClassAttribute::operator[](#name_)->clear() 
     141 
     142         CLEAR_ATT(domain_ref); 
     143         CLEAR_ATT(axis_ref); 
     144#undef CLEAR_ATT 
     145 
    132146   } 
    133147 
  • XMLIO_V2/dev/dev_rv/src/xmlio/node/field.hpp

    r173 r181  
    7676         void solveOperation(void); 
    7777 
     78         virtual void fromBinary(StdIStream & is); 
     79 
    7880         /// Destructeur /// 
    7981         virtual ~CField(void); 
  • XMLIO_V2/dev/dev_rv/src/xmlio/node/grid.cpp

    r180 r181  
    1313      : CObjectTemplate<CGrid>(), CGridAttributes() 
    1414      , withAxis(false), isChecked(false), axis(), domain() 
    15       , storeIndex(), out_i_index(), out_j_index(), out_l_index() 
     15      , storeIndex(1), out_i_index(1), out_j_index(1), out_l_index(1) 
    1616   { /* Ne rien faire de plus */ } 
    1717 
     
    1919      : CObjectTemplate<CGrid>(id), CGridAttributes() 
    2020      , withAxis(false), isChecked(false), axis(), domain() 
    21       , storeIndex(), out_i_index(), out_j_index(), out_l_index() 
     21      , storeIndex(1), out_i_index(1), out_j_index(1), out_l_index(1) 
    2222   { /* Ne rien faire de plus */ } 
    2323 
     
    3333   //---------------------------------------------------------------- 
    3434 
    35    const ARRAY(int, 1) & CGrid::getStoreIndex(void) const 
     35   const std::deque<ARRAY(int, 1)> & CGrid::getStoreIndex(void) const 
    3636   {  
    3737      return (this->storeIndex ); 
     
    4040   //--------------------------------------------------------------- 
    4141 
    42    const ARRAY(int, 1) & CGrid::getOutIIndex(void)  const 
     42   const std::deque<ARRAY(int, 1)> & CGrid::getOutIIndex(void)  const 
    4343   {  
    4444      return (this->out_i_index );  
     
    4747   //--------------------------------------------------------------- 
    4848 
    49    const ARRAY(int, 1) & CGrid::getOutJIndex(void)  const 
     49   const std::deque<ARRAY(int, 1)> & CGrid::getOutJIndex(void)  const 
    5050   {  
    5151      return (this->out_j_index );  
     
    5454   //--------------------------------------------------------------- 
    5555 
    56    const ARRAY(int, 1) & CGrid::getOutLIndex(void)  const 
     56   const std::deque<ARRAY(int, 1)> & CGrid::getOutLIndex(void)  const 
    5757   {  
    5858      return (this->out_l_index );  
     
    8787      this->solveDomainRef() ; 
    8888      this->solveAxisRef() ; 
    89       this->computeIndex() ; 
     89      if (this->storeIndex.size() == 1) 
     90         this->computeIndex() ; 
    9091      this->isChecked = true; 
    9192   } 
     
    175176       
    176177      //std::cout << indexCount  << std::endl; 
    177       ARRAY_ASSIGN(this->storeIndex , int, 1, [indexCount]); 
    178       ARRAY_ASSIGN(this->out_l_index, int, 1, [indexCount]); 
    179       ARRAY_ASSIGN(this->out_i_index, int, 1, [indexCount]); 
    180       ARRAY_ASSIGN(this->out_j_index, int, 1, [indexCount]); 
     178      ARRAY_ASSIGN(this->storeIndex[0] , int, 1, [indexCount]); 
     179      ARRAY_ASSIGN(this->out_l_index[0], int, 1, [indexCount]); 
     180      ARRAY_ASSIGN(this->out_i_index[0], int, 1, [indexCount]); 
     181      ARRAY_ASSIGN(this->out_j_index[0], int, 1, [indexCount]); 
    181182 
    182183      for(int count = 0, indexCount = 0,  l = 0; l < size; l++) 
     
    195196                (j >= 0 && j < nj) && (*mask)[i][j]) 
    196197            { 
    197                (*this->storeIndex) [indexCount] = count ; 
    198                (*this->out_l_index)[indexCount] = l ; 
    199                (*this->out_i_index)[indexCount] = i ; 
    200                (*this->out_j_index)[indexCount] = j ; 
     198               (*this->storeIndex[0]) [indexCount] = count ; 
     199               (*this->out_l_index[0])[indexCount] = l ; 
     200               (*this->out_i_index[0])[indexCount] = i ; 
     201               (*this->out_j_index[0])[indexCount] = j ; 
    201202               indexCount++ ; 
    202203            } 
     
    235236         (const ARRAY(double, 1) stored,  ARRAY(double, 3) field) const 
    236237   { 
    237       for(StdSize n = 0; n < storeIndex->num_elements(); n++) 
    238          (*field)[(*out_i_index)[n]][(*out_j_index)[n]][(*out_l_index)[n]] = (*stored)[n] ; 
     238      for(StdSize n = 0; n < storeIndex[0]->num_elements(); n++) 
     239         (*field)[(*out_i_index[0])[n]][(*out_j_index[0])[n]][(*out_l_index[0])[n]] = (*stored)[n] ; 
    239240   } 
    240241 
     
    245246         (const ARRAY(double, 1) stored,  ARRAY(double, 2) field) const 
    246247   { 
    247       for(StdSize n = 0; n < storeIndex->num_elements(); n++) 
    248          (*field)[(*out_i_index)[n]][(*out_j_index)[n]] = (*stored)[n] ; 
     248      for(StdSize n = 0; n < storeIndex[0]->num_elements(); n++) 
     249         (*field)[(*out_i_index[0])[n]][(*out_j_index[0])[n]] = (*stored)[n] ; 
    249250   } 
    250251 
     
    255256         (const ARRAY(double, 1) stored,  ARRAY(double, 1) field) const 
    256257   { 
    257       for(StdSize n = 0; n < storeIndex->num_elements(); n++) 
    258          (*field)[(*out_i_index)[n]] = (*stored)[n] ; 
     258      for(StdSize n = 0; n < storeIndex[0]->num_elements(); n++) 
     259         (*field)[(*out_i_index[0])[n]] = (*stored)[n] ; 
    259260   } 
    260261 
     
    264265      (const double * const data, ARRAY(double, 1) stored) const 
    265266   { 
    266       const StdSize size = storeIndex->num_elements() ; 
     267      const StdSize size = storeIndex[0]->num_elements() ; 
    267268      stored->resize(boost::extents[size]) ; 
    268269      for(StdSize i = 0; i < size; i++) 
    269          (*stored)[i] = data[(*storeIndex)[i]] ; 
     270         (*stored)[i] = data[(*storeIndex[0])[i]] ; 
    270271   } 
    271272    
     
    275276   { 
    276277      SuperClass::toBinary(os); 
    277       this->storeIndex->toBinary(os); 
    278       this->out_i_index->toBinary(os); 
    279       this->out_j_index->toBinary(os); 
    280       this->out_l_index->toBinary(os); 
     278      this->storeIndex[0]->toBinary(os); 
     279      this->out_i_index[0]->toBinary(os); 
     280      this->out_j_index[0]->toBinary(os); 
     281      this->out_l_index[0]->toBinary(os); 
    281282   } 
    282283 
     
    297298      out_l_index_->fromBinary(is); 
    298299       
     300      this->storeIndex .push_back(storeIndex_); 
     301      this->out_i_index.push_back(out_i_index_); 
     302      this->out_j_index.push_back(out_j_index_); 
     303      this->out_l_index.push_back(out_l_index_); 
    299304   } 
    300305 
  • XMLIO_V2/dev/dev_rv/src/xmlio/node/grid.hpp

    r180 r181  
    5959 
    6060         /// Accesseurs /// 
    61          const ARRAY(int, 1) & getStoreIndex(void) const; 
    62          const ARRAY(int, 1) & getOutIIndex(void)  const; 
    63          const ARRAY(int, 1) & getOutJIndex(void)  const; 
    64          const ARRAY(int, 1) & getOutLIndex(void)  const; 
     61         const std::deque<ARRAY(int, 1)> & getStoreIndex(void) const; 
     62         const std::deque<ARRAY(int, 1)> & getOutIIndex(void)  const; 
     63         const std::deque<ARRAY(int, 1)> & getOutJIndex(void)  const; 
     64         const std::deque<ARRAY(int, 1)> & getOutLIndex(void)  const; 
    6565 
    6666         const boost::shared_ptr<CAxis>   getRelAxis  (void) const; 
     
    110110         boost::shared_ptr<CDomain> domain ; 
    111111 
    112          ARRAY(int, 1) storeIndex ; 
    113          ARRAY(int, 1) out_i_index ; 
    114          ARRAY(int, 1) out_j_index ; 
    115          ARRAY(int, 1) out_l_index ; 
     112         std::deque<ARRAY(int, 1)> storeIndex ; 
     113         std::deque<ARRAY(int, 1)> out_i_index ; 
     114         std::deque<ARRAY(int, 1)> out_j_index ; 
     115         std::deque<ARRAY(int, 1)> out_l_index ; 
    116116 
    117117   }; // class CGrid 
Note: See TracChangeset for help on using the changeset viewer.