]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/MEDMEM_Coordinate.hxx
Salome HOME
NRI : Merge from V1_2.
[modules/med.git] / src / MEDMEM / MEDMEM_Coordinate.hxx
1 //  MED MEDMEM : MED files in memory
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : MEDMEM_Coordinate.hxx
25 //  Module : MED
26
27 /*
28  File Coordinate.hxx
29  $Header$
30 */
31
32 #ifndef COORDINATE_HXX
33 #define COORDINATE_HXX
34
35 #include <string>
36
37 #include "MEDMEM_PointerOf.hxx"
38 #include "MEDMEM_Exception.hxx"
39 #include "MEDMEM_define.hxx"
40
41
42 #include "MEDMEM_Array.hxx"
43
44 /*!
45     This class contains coordinates of the nodes ./n
46     It could also store useful optional information about nodes
47     as  node numbers and about axes as names or units. /n
48     spaceDimension and  numberOfNodes can be found in _coordinate object.
49 */
50
51 class COORDINATE
52 {
53
54 protected:
55                                     /*! contains "CARTESIAN",
56                                         "CYLINDRICAL" or "SPHERICAL"*/
57   string                       _coordinateSystem;
58
59
60                                      /*! _coordinate is a MEDARRAY<double> object : \n
61                                          - spaceDimension /n
62                                          - numberOfNodes /n
63                                          - default storage mode /n
64                                          - Up to 4 "PointerOf" to an array of size spaceDimension*NumberOfNodes/n
65
66                                          Storing the object (not a pointer to this object) is more convenient for memory
67                                          management.
68                                          */
69   MEDARRAY<double>            _coordinate;
70
71                                      /*! PointerOf to an array of size spaceDimension storing axes names*/
72   PointerOf<string>          _coordinateName;
73
74                                      /*! PointerOf to an array of size spaceDimension storing units */
75   PointerOf<string>          _coordinateUnit;
76
77                                      /*! PointerOf to an array of size NumberOfNodes : optional nodes numbers */
78   PointerOf<int>             _nodeNumber;
79
80
81 public :
82
83   friend class MED_MESH_RDONLY_DRIVER;
84   friend class MED_MESH_WRONLY_DRIVER;
85
86
87   COORDINATE();
88   COORDINATE(int SpaceDimension, int NumberOfNodes, medModeSwitch Mode);
89   COORDINATE(const COORDINATE & m);
90   ~COORDINATE();
91
92   void setCoordinates(MEDARRAY<double> *Coordinate);
93   void setCoordinates(const medModeSwitch Mode, const double *Coordinate);
94   void setCoordinatesNames(const string * CoordinateName);
95   void setCoordinateName(const string CoordinateName, const int i);
96   void setCoordinatesUnits(const string * CoordinateUnit);
97   void setCoordinateUnit(const string CoordinateUnit, const int i);
98   void setCoordinatesSystem(const string CoordinateSystem);
99   void setNodesNumbers(const int * NodeNumber);
100
101   int             getSpaceDimension() const;
102   int             getNumberOfNodes() const;
103
104   const int*      getNodesNumbers() const;
105   //const int*            getNodesNumbers() ;
106   string          getCoordinatesSystem() const;
107
108   const double *  getCoordinates(medModeSwitch Mode);
109   double          getCoordinate(int Number,int Axis);
110   const double *  getCoordinateAxis(int Axis);
111
112   const string * getCoordinatesNames() const;
113   string   getCoordinateName(int Axis) const;
114   const string * getCoordinatesUnits() const;
115   string   getCoordinateUnit(int Axis) const;
116 };
117
118 #endif /* COORDINATE_HXX */