source: XIOS/trunk/src/node/zoom_axis.cpp @ 787

Last change on this file since 787 was 787, checked in by mhnguyen, 5 years ago

Changing name of attributes of zoom

Test
+) test_client and test_complete are correct

File size: 1.7 KB
Line 
1#include "zoom_axis.hpp"
2#include "type.hpp"
3
4namespace xios {
5
6  /// ////////////////////// Définitions ////////////////////// ///
7
8  CZoomAxis::CZoomAxis(void)
9    : CObjectTemplate<CZoomAxis>(), CZoomAxisAttributes(), CTransformation<CAxis>()
10  { /* Ne rien faire de plus */ }
11
12  CZoomAxis::CZoomAxis(const StdString & id)
13    : CObjectTemplate<CZoomAxis>(id), CZoomAxisAttributes(), CTransformation<CAxis>()
14  { /* Ne rien faire de plus */ }
15
16  CZoomAxis::~CZoomAxis(void)
17  {}
18
19  //----------------------------------------------------------------
20
21  StdString CZoomAxis::GetName(void)    { return StdString("zoom_axis"); }
22  StdString CZoomAxis::GetDefName(void) { return StdString("zoom_axis"); }
23  ENodeType CZoomAxis::GetType(void)    { return eZoomAxis; }
24
25  void CZoomAxis::checkValid(CAxis* axisDest)
26  {
27    int axisIBegin, axisNi, axisGlobalSize;
28    int begin, end, n;
29
30    axisIBegin = axisDest->begin.getValue();
31    axisNi     = axisDest->n.getValue();
32    axisGlobalSize   = axisDest->n_glo.getValue();
33
34    begin = (this->begin.isEmpty()) ?  0 : this->begin.getValue();
35    n     = (this->n.isEmpty()) ?  axisGlobalSize : this->n.getValue();
36    end   = begin+n-1;
37
38    if (begin < 0 || begin > axisGlobalSize - 1 || end < 0 || end > axisGlobalSize - 1
39        || n < 1 || n > axisGlobalSize || begin > end)
40      ERROR("CZoomAxis::checkValid(CAxis* axisDest)",
41            << "One or more attributes among 'begin' (" << begin << "), 'end' (" << end << "), 'n' (" << n << ") "
42            << "of axis transformation [ id = '" << axisDest->getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] are not well specified");
43
44    this->begin.setValue(begin);
45    this->n.setValue(n);
46
47  }
48
49}
Note: See TracBrowser for help on using the repository browser.