1 // Copyright (C) 2007-2012 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;
85 friend class MED_MESH_RDONLY_DRIVER;
86 friend class MED_MESH_WRONLY_DRIVER;
90 COORDINATE(int SpaceDimension, int NumberOfNodes, MED_EN::medModeSwitch Mode);
91 COORDINATE(int SpaceDimension,const string * CoordinateName, const string * CoordinateUnit);
92 COORDINATE(const COORDINATE & m);
93 virtual ~COORDINATE();
95 void setCoordinates(MEDARRAY<double> *Coordinate,bool shallowCopy=false);
96 void setCoordinates(const MED_EN::medModeSwitch Mode, const double *Coordinate);
97 void setCoordinatesNames(const string * CoordinateName);
98 void setCoordinateName(const string CoordinateName, const int i);
99 void setCoordinatesUnits(const string * CoordinateUnit);
100 void setCoordinateUnit(const string CoordinateUnit, const int i);
101 void setCoordinatesSystem(const string CoordinateSystem);
102 void setNodesNumbers(const int * NodeNumber);
104 int getSpaceDimension() const;
105 int getNumberOfNodes() const;
107 virtual const int* getNodesNumbers() const;
108 //const int* getNodesNumbers() ;
109 string getCoordinatesSystem() const;
111 virtual const double * getCoordinates(MED_EN::medModeSwitch Mode);
112 virtual double getCoordinate(int Number,int Axis);
113 virtual const double * getCoordinateAxis(int Axis);
115 const string * getCoordinatesNames() const;
116 string getCoordinateName(int Axis) const;
117 const string * getCoordinatesUnits() const;
118 string getCoordinateUnit(int Axis) const;
122 #endif /* COORDINATE_HXX */