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