Changeset 180 for XMLIO_V2/dev/dev_rv/src/xmlio/node
- Timestamp:
- 04/19/11 15:06:51 (13 years ago)
- Location:
- XMLIO_V2/dev/dev_rv/src/xmlio/node
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/xmlio/node/domain.cpp
r168 r180 4 4 #include "object_template_impl.hpp" 5 5 #include "group_template_impl.hpp" 6 7 #include <algorithm> 6 8 7 9 namespace xmlioserver { … … 13 15 : CObjectTemplate<CDomain>(), CDomainAttributes() 14 16 , isChecked(false), local_mask(new CMask()), relFiles() 17 , ibegin_sub(), iend_sub(), jbegin_sub(), jend_sub() 15 18 { /* Ne rien faire de plus */ } 16 19 … … 18 21 : CObjectTemplate<CDomain>(id), CDomainAttributes() 19 22 , isChecked(false), local_mask(new CMask()), relFiles() 23 , ibegin_sub(), iend_sub(), jbegin_sub(), jend_sub() 20 24 { /* Ne rien faire de plus */ } 21 25 … … 30 34 } 31 35 36 //---------------------------------------------------------------- 37 32 38 bool CDomain::IsWritten(const StdString & filename) const 33 39 { … … 35 41 } 36 42 43 //---------------------------------------------------------------- 44 37 45 void CDomain::addRelFile(const StdString & filename) 38 46 { 39 47 this->relFiles.insert(filename); 48 } 49 50 //---------------------------------------------------------------- 51 52 void CDomain::fromBinary(StdIStream & is) 53 { 54 SuperClass::fromBinary(is); 55 56 this->ibegin_sub.push_back(this->ibegin.getValue()); 57 this->jbegin_sub.push_back(this->jbegin.getValue()); 58 this->iend_sub.push_back(this->iend.getValue()); 59 this->jend_sub.push_back(this->jend.getValue()); 60 61 #define CLEAR_ATT(name_)\ 62 SuperClassAttribute::operator[](#name_)->clear() 63 64 CLEAR_ATT(mask); 65 CLEAR_ATT(data_n_index); 66 CLEAR_ATT(data_i_index); 67 CLEAR_ATT(data_j_index); 68 69 CLEAR_ATT(data_ni); 70 CLEAR_ATT(data_nj); 71 CLEAR_ATT(data_ibegin); 72 CLEAR_ATT(data_jbegin); 73 74 CLEAR_ATT(ni); 75 CLEAR_ATT(nj); 76 77 CLEAR_ATT(latvalue); 78 CLEAR_ATT(lonvalue); 79 #undef CLEAR_ATT 80 81 this->ibegin.setValue(*std::min_element(this->ibegin_sub.begin(),this->ibegin_sub.end())); 82 this->jbegin.setValue(*std::min_element(this->jbegin_sub.begin(),this->jbegin_sub.end())); 83 this->iend.setValue(*std::max_element(this->iend_sub.begin(),this->iend_sub.end())); 84 this->jend.setValue(*std::max_element(this->jend_sub.begin(),this->jend_sub.end())); 85 86 this->checkGlobalDomain(); 87 this->checkLocalIDomain(); 88 this->checkLocalJDomain(); 89 this->completeMask(); 90 91 this->isChecked = true; 40 92 } 41 93 … … 150 202 mask.setValue(__arr); 151 203 } 152 153 204 } 154 205 … … 157 208 158 209 void CDomain::checkDomainData(void) 159 { 210 { 160 211 if (!data_dim.isEmpty() && 161 212 !(data_dim.getValue() == 1 || data_dim.getValue() == 2)) … … 252 303 { 253 304 const int dni = data_ni.getValue() * data_nj.getValue(); 305 254 306 ARRAY_CREATE(__arri, int, 1, [dni]); 255 307 ARRAY_CREATE(__arrj, int, 1, [dni]); … … 289 341 void CDomain::completeMask(void) 290 342 { 291 this->local_mask->resize( data_ni.getValue(), data_nj.getValue());343 this->local_mask->resize(ni.getValue(), nj.getValue()); 292 344 /*this->local_mask->setDataPosition 293 345 (data_dim.getValue(), data_ni.getValue(), data_nj.getValue(), -
XMLIO_V2/dev/dev_rv/src/xmlio/node/domain.hpp
r173 r180 63 63 64 64 public : 65 66 /// Autres /// 67 virtual void fromBinary(StdIStream & is); 65 68 66 69 /// Accesseurs /// … … 90 93 std::set<StdString> relFiles; 91 94 95 std::vector<int> ibegin_sub, iend_sub, jbegin_sub, jend_sub; 96 92 97 }; // class CDomain 93 98 -
XMLIO_V2/dev/dev_rv/src/xmlio/node/grid.cpp
r168 r180 34 34 35 35 const ARRAY(int, 1) & CGrid::getStoreIndex(void) const 36 { return (this->storeIndex ); } 36 { 37 return (this->storeIndex ); 38 } 39 40 //--------------------------------------------------------------- 41 37 42 const ARRAY(int, 1) & CGrid::getOutIIndex(void) const 38 { return (this->out_i_index ); } 43 { 44 return (this->out_i_index ); 45 } 46 47 //--------------------------------------------------------------- 48 39 49 const ARRAY(int, 1) & CGrid::getOutJIndex(void) const 40 { return (this->out_j_index ); } 50 { 51 return (this->out_j_index ); 52 } 53 54 //--------------------------------------------------------------- 55 41 56 const ARRAY(int, 1) & CGrid::getOutLIndex(void) const 42 { return (this->out_l_index ); } 57 { 58 return (this->out_l_index ); 59 } 60 61 //--------------------------------------------------------------- 43 62 44 63 const boost::shared_ptr<CAxis> CGrid::getRelAxis (void) const 45 { return (this->axis ); } 64 { 65 return (this->axis ); 66 } 67 68 //--------------------------------------------------------------- 69 46 70 const boost::shared_ptr<CDomain> CGrid::getRelDomain(void) const 47 { return (this->domain ); } 48 49 bool CGrid::hasAxis(void) const { return (this->withAxis); } 71 { 72 return (this->domain ); 73 } 74 75 //--------------------------------------------------------------- 76 77 bool CGrid::hasAxis(void) const 78 { 79 return (this->withAxis); 80 } 50 81 51 82 //--------------------------------------------------------------- … … 59 90 this->isChecked = true; 60 91 } 92 93 //--------------------------------------------------------------- 61 94 62 95 void CGrid::solveDomainRef(void) … … 76 109 } 77 110 111 //--------------------------------------------------------------- 112 78 113 void CGrid::solveAxisRef(void) 79 114 { … … 95 130 96 131 void CGrid::computeIndex(void) 97 { 132 { 98 133 const int ni = domain->ni.getValue() , 99 134 nj = domain->nj.getValue() , … … 113 148 data_j_index = domain->data_j_index.getValue() ; 114 149 115 /*std::cout << data_n_index 116 << data_i_index .size()<< " : "117 << data_j_index .size() << std::endl;*/150 /*std::cout << data_n_index << " : " 151 << data_i_index << " : " 152 << data_j_index << std::endl; */ 118 153 119 154 ARRAY(bool, 2) mask = domain->mask.getValue() ; … … 204 239 } 205 240 241 //--------------------------------------------------------------- 242 206 243 template <> 207 244 void CGrid::outputField … … 211 248 (*field)[(*out_i_index)[n]][(*out_j_index)[n]] = (*stored)[n] ; 212 249 } 250 251 //--------------------------------------------------------------- 213 252 214 253 template <> … … 230 269 (*stored)[i] = data[(*storeIndex)[i]] ; 231 270 } 271 272 //--------------------------------------------------------------- 273 274 void CGrid::toBinary (StdOStream & os) const 275 { 276 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); 281 } 282 283 //--------------------------------------------------------------- 284 285 void CGrid::fromBinary(StdIStream & is) 286 { 287 SuperClass::fromBinary(is); 288 289 ARRAY_CREATE(storeIndex_ , int, 1, [1]); 290 ARRAY_CREATE(out_l_index_, int, 1, [1]); 291 ARRAY_CREATE(out_i_index_, int, 1, [1]); 292 ARRAY_CREATE(out_j_index_, int, 1, [1]); 293 294 storeIndex_ ->fromBinary(is); 295 out_i_index_->fromBinary(is); 296 out_j_index_->fromBinary(is); 297 out_l_index_->fromBinary(is); 298 299 } 232 300 233 301 ///--------------------------------------------------------------- -
XMLIO_V2/dev/dev_rv/src/xmlio/node/grid.hpp
r173 r180 49 49 /// Traitements /// 50 50 void solveReference(void); 51 52 virtual void toBinary (StdOStream & os) const; 53 virtual void fromBinary(StdIStream & is); 51 54 52 55 /// Tests ///
Note: See TracChangeset
for help on using the changeset viewer.