Ignore:
Timestamp:
07/10/17 18:17:04 (7 years ago)
Author:
yushan
Message:

branch merged with trunk @1200

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan_merged/src/node/zoom_axis.cpp

    r836 r1205  
    4646    axisGlobalSize   = axisDest->n_glo.getValue(); 
    4747 
    48     begin = (this->begin.isEmpty()) ?  0 : this->begin.getValue(); 
    49     n     = (this->n.isEmpty()) ?  axisGlobalSize : this->n.getValue(); 
    50     end   = begin+n-1; 
     48    bool zoomByIndex = !this->index.isEmpty() && (0 != this->index.numElements()); 
     49 
     50    if (zoomByIndex) 
     51    { 
     52      begin = min(this->index); 
     53      end   = max(this->index); 
     54      n     = end - begin + 1; 
     55    } 
     56    else 
     57    { 
     58      begin = (this->begin.isEmpty()) ?  0 : this->begin.getValue(); 
     59      n     = (this->n.isEmpty()) ?  axisGlobalSize : this->n.getValue(); 
     60      end   = begin+n-1; 
     61    } 
    5162 
    5263    if (begin < 0 || begin > axisGlobalSize - 1 || end < 0 || end > axisGlobalSize - 1 
     
    5566            << "One or more attributes among 'begin' (" << begin << "), 'end' (" << end << "), 'n' (" << n << ") " 
    5667            << "of axis transformation [ id = '" << axisDest->getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] are not well specified"); 
     68     
     69    if (zoomByIndex && (!this->begin.isEmpty() || !this->n.isEmpty())) 
     70      ERROR("CZoomAxis::checkValid(CAxis* axisDest)", 
     71            << "Only one type of zoom is accepted. Define zoom by index with global_zoom_index or define zoom with begin and n. " 
     72            << "Axis transformation [ id = '" << axisDest->getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] are not well specified"); 
    5773 
    5874    this->begin.setValue(begin); 
Note: See TracChangeset for help on using the changeset viewer.