/[escript]/branches/diaplayground/ripley/src/Brick.cpp
ViewVC logotype

Diff of /branches/diaplayground/ripley/src/Brick.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4002 by caltinay, Fri Sep 28 00:16:56 2012 UTC revision 4009 by caltinay, Tue Oct 2 05:53:37 2012 UTC
# Line 299  void Brick::readBinaryGrid(escript::Data Line 299  void Brick::readBinaryGrid(escript::Data
299      vector<float> values(num0*numComp);      vector<float> values(num0*numComp);
300      const int dpp = out.getNumDataPointsPerSample();      const int dpp = out.getNumDataPointsPerSample();
301    
     // whether the y-coordinate runs top-down (invert=true) or bottom-up (false)  
     bool invertY=true;  
   
302      for (index_t z=0; z<num2; z++) {      for (index_t z=0; z<num2; z++) {
303          for (index_t y=0; y<num1; y++) {          for (index_t y=0; y<num1; y++) {
304              const int fileofs = numComp*(idx0+(idx1+y)*numValues[0]+(idx2+z)*numValues[0]*numValues[1]);              const int fileofs = numComp*(idx0+(idx1+y)*numValues[0]+(idx2+z)*numValues[0]*numValues[1]);
305              f.seekg(fileofs*sizeof(float));              f.seekg(fileofs*sizeof(float));
306              f.read((char*)&values[0], num0*numComp*sizeof(float));              f.read((char*)&values[0], num0*numComp*sizeof(float));
307              int dataIndex;              const int dataIndex = first0+(first1+y)*myN0+(first2+z)*myN0*myN1;
             if (invertY)  
                 dataIndex = first0+(first1+num1-1-y)*myN0+(first2+z)*myN0*myN1;  
             else  
                 dataIndex = first0+(first1+y)*myN0+(first2+z)*myN0*myN1;  
308    
309              for (index_t x=0; x<num0; x++) {              for (index_t x=0; x<num0; x++) {
310                  double* dest = out.getSampleDataRW(dataIndex+x);                  double* dest = out.getSampleDataRW(dataIndex+x);

Legend:
Removed from v.4002  
changed lines
  Added in v.4009

  ViewVC Help
Powered by ViewVC 1.1.26