[624] | 1 | /*! |
---|
| 2 | \file axis_algorithm_zoom.hpp |
---|
[1559] | 3 | \brief Algorithm for zooming an axis. |
---|
[624] | 4 | */ |
---|
[621] | 5 | #ifndef __XIOS_AXIS_ALGORITHM_ZOOM_HPP__ |
---|
| 6 | #define __XIOS_AXIS_ALGORITHM_ZOOM_HPP__ |
---|
| 7 | |
---|
[622] | 8 | #include "axis_algorithm_transformation.hpp" |
---|
[933] | 9 | #include "transformation.hpp" |
---|
[621] | 10 | |
---|
| 11 | namespace xios { |
---|
[933] | 12 | class CAxis; |
---|
| 13 | class CZoomAxis; |
---|
| 14 | |
---|
[624] | 15 | /*! |
---|
| 16 | \class CAxisAlgorithmZoom |
---|
| 17 | Implementing zoom on axis |
---|
[933] | 18 | A zoomed region can be considered as region that isn't masked. |
---|
[1559] | 19 | Only this zoomed region is zoomed to write on Netcdf. |
---|
[624] | 20 | */ |
---|
[623] | 21 | class CAxisAlgorithmZoom : public CAxisAlgorithmTransformation |
---|
[621] | 22 | { |
---|
| 23 | public: |
---|
[623] | 24 | CAxisAlgorithmZoom(CAxis* axisDestination, CAxis* axisSource, CZoomAxis* zoomAxis); |
---|
[621] | 25 | |
---|
[623] | 26 | virtual ~CAxisAlgorithmZoom() {} |
---|
[621] | 27 | |
---|
[933] | 28 | static bool registerTrans(); |
---|
[1704] | 29 | |
---|
[1982] | 30 | virtual StdString getName() {return "zoom_axis";} |
---|
[1704] | 31 | |
---|
[827] | 32 | protected: |
---|
| 33 | void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); |
---|
[621] | 34 | |
---|
[622] | 35 | private: |
---|
[624] | 36 | |
---|
[623] | 37 | private: |
---|
[624] | 38 | //! Global zoom begin on axis |
---|
[622] | 39 | StdSize zoomBegin_; |
---|
[624] | 40 | |
---|
| 41 | //! Global zoom end on axis |
---|
[622] | 42 | StdSize zoomEnd_; |
---|
[624] | 43 | |
---|
| 44 | //! Global zoom size on axis |
---|
[1559] | 45 | StdSize zoomN_; |
---|
[933] | 46 | |
---|
[1201] | 47 | std::vector<int> zoomIndex_; |
---|
| 48 | |
---|
[933] | 49 | private: |
---|
| 50 | |
---|
| 51 | static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc, |
---|
| 52 | CTransformation<CAxis>* transformation, |
---|
| 53 | int elementPositionInGrid, |
---|
| 54 | std::map<int, int>& elementPositionInGridSrc2ScalarPosition, |
---|
| 55 | std::map<int, int>& elementPositionInGridSrc2AxisPosition, |
---|
| 56 | std::map<int, int>& elementPositionInGridSrc2DomainPosition, |
---|
| 57 | std::map<int, int>& elementPositionInGridDst2ScalarPosition, |
---|
| 58 | std::map<int, int>& elementPositionInGridDst2AxisPosition, |
---|
| 59 | std::map<int, int>& elementPositionInGridDst2DomainPosition); |
---|
[621] | 60 | }; |
---|
| 61 | |
---|
| 62 | } |
---|
| 63 | #endif // __XIOS_AXIS_ALGORITHM_ZOOM_HPP__ |
---|