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
23 #ifndef UNV2420_Structure_HeaderFile
24 #define UNV2420_Structure_HeaderFile
26 // Name: Coordinate Systems
27 // -----------------------------------------------------------------------
29 // Record 1: FORMAT (1I10)
30 // Field 1 -- Part UID
32 // Record 2: FORMAT (40A2)
33 // Field 1 -- Part Name
35 // Record 3: FORMAT (3I10)
36 // Field 1 -- Coordinate System Label
37 // Field 2 -- Coordinate System Type
41 // Field 3 -- Coordinate System Color
43 // Record 4: FORMAT (40A2)
44 // Field 1 -- Coordinate System Name
46 // Record 5: FORMAT (1P3D25.16)
47 // Field 1-3 -- Transformation Matrix Row 1
49 // Record 6: FORMAT (1P3D25.16)
50 // Field 1-3 -- Transformation Matrix Row 2
52 // Record 7: FORMAT (1P3D25.16)
53 // Field 1-3 -- Transformation Matrix Row 3
55 // Record 8: FORMAT (1P3D25.16)
56 // Field 1-3 -- Transformation Matrix Row 4
58 // Records 3 thru 8 are repeated for each Coordinate System in the Part.
66 // FEMAP Global Cylindrical (6)
67 // 1.0000000000000000E+0 0.0000000000000000E+0 0.0000000000000000E+0
68 // 0.0000000000000000E+0 1.0000000000000000E+0 0.0000000000000000E+0
69 // 0.0000000000000000E+0 0.0000000000000000E+0 1.0000000000000000E+0
70 // 0.0000000000000000E+0 0.0000000000000000E+0 0.0000000000000000E+0
72 // Coordinate System 4
73 // 1.0000000000000000E+0 0.0000000000000000E+0 0.0000000000000000E+0
74 // 0.0000000000000000E+0 1.0000000000000000E+0 0.0000000000000000E+0
75 // 0.0000000000000000E+0 0.0000000000000000E+0 1.0000000000000000E+0
76 // 0.0000000000000000E+0 0.0000000000000000E+0 0.0000000000000000E+0
79 #include "SMESH_DriverUNV.hxx"
86 enum { Cartesian=0, Cylindrical, Spherical };
88 typedef int TCSLabel; // type of coord system label
90 struct MESHDRIVERUNV_EXPORT TRecord
92 TCSLabel coord_sys_label;
93 int coord_sys_type; // { Cartesian=0, Cylindrical, Spherical }
95 std::string coord_sys_name;
98 bool isIdentityMatrix() const;
99 void ApplyMatrix ( double* coords ) const;
100 static void FromCylindricalCS( double* coords );
101 static void FromSphericalCS ( double* coords );
104 typedef std::vector<TRecord> TDataSet;
106 MESHDRIVERUNV_EXPORT void
107 Read(std::ifstream& in_stream,
108 std::string& part_name, // can re-store a mesh name
109 TDataSet& theDataSet);
111 MESHDRIVERUNV_EXPORT void
112 Write(std::ofstream& out_stream,
113 const std::string& part_name); // can store a mesh name
114 // const TDataSet& theDataSet);