1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/
25 #ifndef COORDINATE_HXX
26 #define COORDINATE_HXX
30 #include "MEDMEM_PointerOf.hxx"
31 #include "MEDMEM_Exception.hxx"
32 #include "MEDMEM_define.hxx"
35 #include "MEDMEM_Array.hxx"
38 This class contains coordinates of the nodes .\n
39 It could also store useful optional information about nodes
40 as node numbers and about axes as names or units. \n
41 spaceDimension and numberOfNodes can be found in _coordinate object.
49 /*! contains "CARTESIAN",
50 "CYLINDRICAL" or "SPHERICAL"*/
51 string _coordinateSystem;
54 /*! _coordinate is a MEDARRAY<double> object : \n
57 - default storage mode \n
58 - Up to 4 "PointerOf" to an array of size spaceDimension*NumberOfNodes\n
60 Storing the object (not a pointer to this object) is more convenient for memory
63 mutable MEDARRAY<double> _coordinate;
65 /*! PointerOf to an array of size spaceDimension storing axes names*/
66 PointerOf<string> _coordinateName;
68 /*! PointerOf to an array of size spaceDimension storing units */
69 PointerOf<string> _coordinateUnit;
71 /*! PointerOf to an array of size NumberOfNodes : optional nodes numbers */
72 PointerOf<int> _nodeNumber;
77 friend class IMED_MESH_RDONLY_DRIVER;
78 friend class MED_MESH_RDONLY_DRIVER21;
79 friend class IMED_MESH_WRONLY_DRIVER;
80 friend class MED_MESH_WRONLY_DRIVER21;
81 friend class MED_MESH_RDONLY_DRIVER22;
82 friend class MED_MESH_WRONLY_DRIVER22;
86 COORDINATE(int SpaceDimension, int NumberOfNodes, MED_EN::medModeSwitch Mode);
87 COORDINATE(int SpaceDimension,const string * CoordinateName, const string * CoordinateUnit);
88 COORDINATE(const COORDINATE & m);
89 virtual ~COORDINATE();
91 void setCoordinates(MEDARRAY<double> *Coordinate,bool shallowCopy=false);
92 void setCoordinates(const MED_EN::medModeSwitch Mode, const double *Coordinate);
93 void setCoordinatesNames(const string * CoordinateName);
94 void setCoordinateName(const string CoordinateName, const int i);
95 void setCoordinatesUnits(const string * CoordinateUnit);
96 void setCoordinateUnit(const string CoordinateUnit, const int i);
97 void setCoordinatesSystem(const string CoordinateSystem);
98 void setNodesNumbers(const int * NodeNumber);
100 int getSpaceDimension() const;
101 int getNumberOfNodes() const;
103 virtual const int* getNodesNumbers() const;
104 //const int* getNodesNumbers() ;
105 string getCoordinatesSystem() const;
107 virtual const double * getCoordinates(MED_EN::medModeSwitch Mode);
108 virtual double getCoordinate(int Number,int Axis);
109 virtual const double * getCoordinateAxis(int Axis);
111 const string * getCoordinatesNames() const;
112 string getCoordinateName(int Axis) const;
113 const string * getCoordinatesUnits() const;
114 string getCoordinateUnit(int Axis) const;
118 #endif /* COORDINATE_HXX */