1 | #ifndef __XMLIO_CGrid__ |
---|
2 | #define __XMLIO_CGrid__ |
---|
3 | |
---|
4 | /// xmlioserver headers /// |
---|
5 | #include "xmlioserver_spl.hpp" |
---|
6 | #include "group_factory.hpp" |
---|
7 | |
---|
8 | #include "declare_group.hpp" |
---|
9 | #include "domain.hpp" |
---|
10 | #include "axis.hpp" |
---|
11 | |
---|
12 | namespace xmlioserver { |
---|
13 | namespace tree { |
---|
14 | |
---|
15 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
16 | |
---|
17 | class CGridGroup; |
---|
18 | class CGridAttributes; |
---|
19 | class CGrid; |
---|
20 | |
---|
21 | ///-------------------------------------------------------------- |
---|
22 | |
---|
23 | // Declare/Define CGridAttribute |
---|
24 | BEGIN_DECLARE_ATTRIBUTE_MAP(CGrid) |
---|
25 | # include "grid_attribute.conf" |
---|
26 | END_DECLARE_ATTRIBUTE_MAP(CGrid) |
---|
27 | |
---|
28 | ///-------------------------------------------------------------- |
---|
29 | |
---|
30 | class CGrid |
---|
31 | : public CObjectTemplate<CGrid> |
---|
32 | , public CGridAttributes |
---|
33 | { |
---|
34 | /// typedef /// |
---|
35 | typedef CObjectTemplate<CGrid> SuperClass; |
---|
36 | typedef CGridAttributes SuperClassAttribute; |
---|
37 | |
---|
38 | public : |
---|
39 | |
---|
40 | typedef CGridAttributes RelAttributes; |
---|
41 | typedef CGridGroup RelGroup; |
---|
42 | |
---|
43 | /// Constructeurs /// |
---|
44 | CGrid(void); |
---|
45 | explicit CGrid(const StdString & id); |
---|
46 | CGrid(const CGrid & grid); // Not implemented yet. |
---|
47 | CGrid(const CGrid * const grid); // Not implemented yet. |
---|
48 | |
---|
49 | /// Traitements /// |
---|
50 | void solveReference(void); |
---|
51 | |
---|
52 | virtual void toBinary (StdOStream & os) const; |
---|
53 | virtual void fromBinary(StdIStream & is); |
---|
54 | |
---|
55 | /// Tests /// |
---|
56 | bool hasAxis(void) const; |
---|
57 | |
---|
58 | public : |
---|
59 | |
---|
60 | /// Accesseurs /// |
---|
61 | const std::deque<ARRAY(int, 1)> & getStoreIndex(void) const; |
---|
62 | const std::deque<ARRAY(int, 1)> & getOutIIndex(void) const; |
---|
63 | const std::deque<ARRAY(int, 1)> & getOutJIndex(void) const; |
---|
64 | const std::deque<ARRAY(int, 1)> & getOutLIndex(void) const; |
---|
65 | |
---|
66 | const boost::shared_ptr<CAxis> getRelAxis (void) const; |
---|
67 | const boost::shared_ptr<CDomain> getRelDomain(void) const; |
---|
68 | |
---|
69 | /// Entrées-sorties de champs /// |
---|
70 | template <StdSize n> |
---|
71 | void inputField(const ARRAY(double, n) field, ARRAY(double, 1) stored) const; |
---|
72 | |
---|
73 | void inputFieldServer(const std::deque<ARRAY(double, 1)> storedClient, |
---|
74 | ARRAY(double, 1) storedServer) const; |
---|
75 | |
---|
76 | template <StdSize n> |
---|
77 | void outputField(const ARRAY(double, 1) stored, ARRAY(double, n) field) const; |
---|
78 | |
---|
79 | /// Destructeur /// |
---|
80 | virtual ~CGrid(void); |
---|
81 | |
---|
82 | public : |
---|
83 | |
---|
84 | /// Accesseurs statiques /// |
---|
85 | static StdString GetName(void); |
---|
86 | static StdString GetDefName(void); |
---|
87 | |
---|
88 | static ENodeType GetType(void); |
---|
89 | |
---|
90 | /// Instanciateurs Statiques /// |
---|
91 | static boost::shared_ptr<CGrid> |
---|
92 | CreateGrid(boost::shared_ptr<CDomain> domain); |
---|
93 | static boost::shared_ptr<CGrid> |
---|
94 | CreateGrid(boost::shared_ptr<CDomain> domain, boost::shared_ptr<CAxis> axis); |
---|
95 | |
---|
96 | protected : |
---|
97 | |
---|
98 | /// Entrées-sorties de champs (interne) /// |
---|
99 | void storeField_arr(const double * const data, ARRAY(double, 1) stored) const; |
---|
100 | |
---|
101 | /// Traitements protégés /// |
---|
102 | void computeIndexServer(void); |
---|
103 | void computeIndex(void); |
---|
104 | void solveDomainRef(void); |
---|
105 | void solveAxisRef(void); |
---|
106 | |
---|
107 | public: |
---|
108 | |
---|
109 | /// Propriétés privées /// |
---|
110 | bool withAxis ; |
---|
111 | bool isChecked; |
---|
112 | |
---|
113 | boost::shared_ptr<CAxis> axis ; |
---|
114 | boost::shared_ptr<CDomain> domain ; |
---|
115 | |
---|
116 | std::deque<ARRAY(int, 1)> storeIndex ; |
---|
117 | std::deque<ARRAY(int, 1)> out_i_index ; |
---|
118 | std::deque<ARRAY(int, 1)> out_j_index ; |
---|
119 | std::deque<ARRAY(int, 1)> out_l_index ; |
---|
120 | |
---|
121 | }; // class CGrid |
---|
122 | |
---|
123 | ///-------------------------------------------------------------- |
---|
124 | |
---|
125 | template <StdSize n> |
---|
126 | void CGrid::inputField(const ARRAY(double, n) field, ARRAY(double, 1) stored) const |
---|
127 | { this->storeField_arr(field.data(), stored) ; } |
---|
128 | |
---|
129 | ///-------------------------------------------------------------- |
---|
130 | |
---|
131 | // Declare/Define CGridGroup and CGridDefinition |
---|
132 | DECLARE_GROUP(CGrid); |
---|
133 | |
---|
134 | ///-------------------------------------------------------------- |
---|
135 | |
---|
136 | } // namespace tree |
---|
137 | } // namespace xmlioserver |
---|
138 | |
---|
139 | #endif // __XMLIO_CGrid__ |
---|