Salome HOME
9931af09d0b5b3be42ca762b5d6fc703b5af5122
[modules/homard.git] / src / HOMARD / HOMARD_YACS.cxx
1 //  HOMARD HOMARD : implementation of HOMARD idl descriptions
2 //
3 // Copyright (C) 2011-2013  CEA/DEN, EDF R&D
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
18 //
19 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 //
21 //  File   : HOMARD_YACS.cxx
22 //  Author : Paul RASCLE, EDF
23 //  Module : HOMARD
24 //
25 // Remarques :
26 // L'ordre de description des fonctions est le meme dans tous les fichiers
27 // HOMARD_aaaa.idl, HOMARD_aaaa.hxx, HOMARD_aaaa.cxx, HOMARD_aaaa_i.hxx, HOMARD_aaaa_i.cxx :
28 // 1. Les generalites : Name, Delete, DumpPython, Dump, Restore
29 // 2. Les caracteristiques
30 // 3. Le lien avec les autres structures
31 //
32 // Quand les 2 fonctions Setxxx et Getxxx sont presentes, Setxxx est decrit en premier
33
34 #include "HOMARD_YACS.hxx"
35 #include "utilities.h"
36
37 //=============================================================================
38 /*!
39  *  default constructor:
40  */
41 //=============================================================================
42 HOMARD_YACS::HOMARD_YACS():
43   _Name( "" ),
44   _NomCas( "" ),
45   _NomDir( "" ),
46   _MeshFile( "" ),
47   _ScriptFile( "" ),
48   _Type( 1 )
49 {
50   MESSAGE("HOMARD_YACS");
51 }
52 //=============================================================================
53 /*!
54  *
55  */
56 //=============================================================================
57 HOMARD_YACS::~HOMARD_YACS()
58 {
59   MESSAGE("~HOMARD_YACS");
60 }
61 //=============================================================================
62 //=============================================================================
63 // Generalites
64 //=============================================================================
65 //=============================================================================
66 void HOMARD_YACS::SetName( const char* Name )
67 {
68   _Name = std::string( Name );
69 }
70 //=============================================================================
71 std::string HOMARD_YACS::GetName() const
72 {
73   return _Name;
74 }
75 //=============================================================================
76 std::string HOMARD_YACS::GetDumpPython() const
77 {
78   MESSAGE (". Ecriture du schema " << _Name );
79   std::ostringstream aScript;
80   aScript << "\n# Creation of the schema " << _Name << "\n";
81 // Creation du schema
82   aScript << "\t" << _Name << " = " << _NomCas << ".CreateYACSSchema(\"" << _Name << "\", \"" << _ScriptFile << "\", \"" << _NomDir << "\", \"" << _MeshFile << "\")\n";
83 // Le type de schema
84   aScript << "\t" << _Name << ".SetType(" << _Type << ")\n";
85
86 // L'ecriture eventuelle du schema
87   aScript << "\t#" << _Name << ".Write()\n";
88
89   MESSAGE (". Fin de l ecriture du schema " << _Name );
90
91   return aScript.str();
92 }
93 //=============================================================================
94 //=============================================================================
95 // Caracteristiques
96 //=============================================================================
97 //=============================================================================
98 void HOMARD_YACS::SetType( int Type )
99 {
100   _Type = Type;
101 }
102 //=============================================================================
103 int HOMARD_YACS::GetType() const
104 {
105   return _Type;
106 }
107 //=============================================================================
108 void HOMARD_YACS::SetDirName( const char* NomDir )
109 {
110   _NomDir = std::string( NomDir );
111 }
112 //=============================================================================
113 std::string HOMARD_YACS::GetDirName() const
114 {
115    return _NomDir;
116 }
117 //=============================================================================
118 void HOMARD_YACS::SetMeshFile( const char* MeshFile )
119 {
120   _MeshFile = std::string( MeshFile );
121 }
122 //=============================================================================
123 std::string HOMARD_YACS::GetMeshFile() const
124 {
125   return _MeshFile;
126 }
127 //=============================================================================
128 void HOMARD_YACS::SetScriptFile( const char* ScriptFile )
129 {
130   _ScriptFile = std::string( ScriptFile );
131 }
132 //=============================================================================
133 std::string HOMARD_YACS::GetScriptFile() const
134 {
135   return _ScriptFile;
136 }
137 //=============================================================================
138 //=============================================================================
139 // Liens avec les autres structures
140 //=============================================================================
141 //=============================================================================
142 void HOMARD_YACS::SetCaseName( const char* NomCas )
143 {
144   _NomCas = std::string( NomCas );
145 }
146 //=============================================================================
147 std::string HOMARD_YACS::GetCaseName() const
148 {
149   return _NomCas;
150 }
151 //=============================================================================
152 //=============================================================================
153 // Divers
154 //=============================================================================
155 //=============================================================================