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