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