1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
27 #ifndef COORDINATE_HXX
28 #define COORDINATE_HXX
35 #include "MEDMEM_PointerOf.hxx"
36 #include "MEDMEM_Exception.hxx"
37 #include "MEDMEM_define.hxx"
40 #include "MEDMEM_Array.hxx"
43 This class contains coordinates of the nodes .\n
44 It could also store useful optional information about nodes
45 as node numbers and about axes as names or units. \n
46 spaceDimension and numberOfNodes can be found in _coordinate object.
50 class MEDMEM_EXPORT COORDINATE
54 /*! contains "CARTESIAN",
55 "CYLINDRICAL" or "SPHERICAL"*/
56 string _coordinateSystem;
59 /*! _coordinate is a MEDARRAY<double> object : \n
62 - default storage mode \n
63 - Up to 4 "PointerOf" to an array of size spaceDimension*NumberOfNodes\n
65 Storing the object (not a pointer to this object) is more convenient for memory
68 mutable MEDARRAY<double> _coordinate;
70 /*! PointerOf to an array of size spaceDimension storing axes names*/
71 //PointerOf<string> _coordinateName;
72 vector<string> _coordinateName;
74 /*! PointerOf to an array of size spaceDimension storing units */
75 //PointerOf<string> _coordinateUnit;
76 vector<string> _coordinateUnit;
78 /*! PointerOf to an array of size NumberOfNodes : optional nodes numbers */
79 PointerOf<int> _nodeNumber;
84 friend class IMED_MESH_RDONLY_DRIVER;
85 friend class MED_MESH_RDONLY_DRIVER21;
86 friend class IMED_MESH_WRONLY_DRIVER;
87 friend class MED_MESH_WRONLY_DRIVER21;
88 friend class MED_MESH_RDONLY_DRIVER22;
89 friend class MED_MESH_WRONLY_DRIVER22;
93 COORDINATE(int SpaceDimension, int NumberOfNodes, MED_EN::medModeSwitch Mode);
94 COORDINATE(int SpaceDimension,const string * CoordinateName, const string * CoordinateUnit);
95 COORDINATE(const COORDINATE & m);
96 virtual ~COORDINATE();
98 void setCoordinates(MEDARRAY<double> *Coordinate,bool shallowCopy=false);
99 void setCoordinates(const MED_EN::medModeSwitch Mode, const double *Coordinate);
100 void setCoordinatesNames(const string * CoordinateName);
101 void setCoordinateName(const string CoordinateName, const int i);
102 void setCoordinatesUnits(const string * CoordinateUnit);
103 void setCoordinateUnit(const string CoordinateUnit, const int i);
104 void setCoordinatesSystem(const string CoordinateSystem);
105 void setNodesNumbers(const int * NodeNumber);
107 int getSpaceDimension() const;
108 int getNumberOfNodes() const;
110 virtual const int* getNodesNumbers() const;
111 //const int* getNodesNumbers() ;
112 string getCoordinatesSystem() const;
114 virtual const double * getCoordinates(MED_EN::medModeSwitch Mode);
115 virtual double getCoordinate(int Number,int Axis);
116 virtual const double * getCoordinateAxis(int Axis);
118 const string * getCoordinatesNames() const;
119 string getCoordinateName(int Axis) const;
120 const string * getCoordinatesUnits() const;
121 string getCoordinateUnit(int Axis) const;
125 #endif /* COORDINATE_HXX */