Changeset 1169 for XIOS/trunk/src/node/zoom_axis.cpp
- Timestamp:
- 06/15/17 16:17:01 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/zoom_axis.cpp
r836 r1169 46 46 axisGlobalSize = axisDest->n_glo.getValue(); 47 47 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 } 51 62 52 63 if (begin < 0 || begin > axisGlobalSize - 1 || end < 0 || end > axisGlobalSize - 1 … … 55 66 << "One or more attributes among 'begin' (" << begin << "), 'end' (" << end << "), 'n' (" << n << ") " 56 67 << "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"); 57 73 58 74 this->begin.setValue(begin);
Note: See TracChangeset
for help on using the changeset viewer.