1 #include "HOMARD_Boundary_i.hxx"
2 #include "HOMARD_Gen_i.hxx"
3 #include "HOMARD_Boundary.hxx"
4 #include "HOMARD_DriverTools.hxx"
8 //=============================================================================
10 * standard constructor
12 //=============================================================================
13 HOMARD_Boundary_i::HOMARD_Boundary_i()
15 MESSAGE( "Default constructor, not for use" );
19 //=============================================================================
21 * standard constructor
23 //=============================================================================
24 HOMARD_Boundary_i::HOMARD_Boundary_i( CORBA::ORB_ptr orb,
25 HOMARD::HOMARD_Gen_var engine )
27 MESSAGE( "HOMARD_Boundary_i" );
30 myHomardBoundary = new ::HOMARD_Boundary();
31 ASSERT( myHomardBoundary );
33 //=============================================================================
37 //=============================================================================
39 HOMARD_Boundary_i::~HOMARD_Boundary_i()
43 //=============================================================================
46 //=============================================================================
47 void HOMARD_Boundary_i::SetName( const char* NomBoundary )
49 ASSERT( myHomardBoundary );
50 myHomardBoundary->SetName( NomBoundary );
53 //=============================================================================
54 char* HOMARD_Boundary_i::GetName()
56 ASSERT( myHomardBoundary );
57 return CORBA::string_dup( myHomardBoundary->GetName().c_str() );
60 //=============================================================================
61 char* HOMARD_Boundary_i::GetDumpPython()
63 ASSERT( myHomardBoundary );
64 return CORBA::string_dup( myHomardBoundary->GetDumpPython().c_str() );
68 //=============================================================================
69 void HOMARD_Boundary_i::SetBoundaryType( CORBA::Long BoundaryType )
71 ASSERT( myHomardBoundary );
72 myHomardBoundary->SetBoundaryType( BoundaryType );
75 //=============================================================================
76 CORBA::Long HOMARD_Boundary_i::GetBoundaryType()
78 ASSERT( myHomardBoundary );
79 return CORBA::Long( myHomardBoundary->GetBoundaryType() );
82 //=============================================================================
83 void HOMARD_Boundary_i::SetMeshFile( const char* MeshFile )
85 ASSERT( myHomardBoundary );
86 myHomardBoundary->SetMeshFile( MeshFile );
87 _gen_i->PublishResultInSmesh(MeshFile, 0);
89 //=============================================================================
90 char* HOMARD_Boundary_i::GetMeshFile()
92 ASSERT( myHomardBoundary );
93 return CORBA::string_dup( myHomardBoundary->GetMeshFile().c_str() );
96 //=============================================================================
97 void HOMARD_Boundary_i::SetMeshName( const char* MeshName )
99 ASSERT( myHomardBoundary );
100 myHomardBoundary->SetMeshName( MeshName );
103 //=============================================================================
104 char* HOMARD_Boundary_i::GetMeshName()
106 ASSERT( myHomardBoundary );
107 return CORBA::string_dup( myHomardBoundary->GetMeshName().c_str() );
111 //=============================================================================
112 void HOMARD_Boundary_i::SetCylinder( double X0, double X1, double X2, double X3, double X4, double X5, double X6 )
114 ASSERT( myHomardBoundary );
115 myHomardBoundary->SetCylinder( X0, X1, X2, X3, X4, X5, X6 );
118 //=============================================================================
119 HOMARD::double_array* HOMARD_Boundary_i::GetCylinder()
121 ASSERT( myHomardBoundary );
122 HOMARD::double_array_var aResult = new HOMARD::double_array();
123 std::vector<double> mesCoor = myHomardBoundary->GetCylinder();
124 aResult->length( mesCoor .size() );
125 std::vector<double>::const_iterator it;
127 for ( it = mesCoor.begin(); it != mesCoor.end(); it++ )
128 aResult[i++] = (*it);
129 return aResult._retn();
132 //=============================================================================
133 void HOMARD_Boundary_i::SetSphere( double Xcentre, double Ycentre, double ZCentre, double rayon )
135 ASSERT( myHomardBoundary );
136 myHomardBoundary->SetSphere( Xcentre, Ycentre, ZCentre, rayon );
139 //=============================================================================
140 HOMARD::double_array* HOMARD_Boundary_i::GetSphere()
142 ASSERT( myHomardBoundary );
143 HOMARD::double_array_var aResult = new HOMARD::double_array();
144 std::vector<double> mesCoor = myHomardBoundary->GetSphere();
145 aResult->length( mesCoor .size() );
146 std::vector<double>::const_iterator it;
148 for ( it = mesCoor.begin(); it != mesCoor.end(); it++ )
149 aResult[i++] = (*it);
150 return aResult._retn();
153 //=============================================================================
154 void HOMARD_Boundary_i::SetLimit( double Xincr, double Yincr, double Zincr )
156 ASSERT( myHomardBoundary );
157 myHomardBoundary->SetLimit( Xincr, Yincr, Zincr );
160 //=============================================================================
161 HOMARD::double_array* HOMARD_Boundary_i::GetLimit()
163 ASSERT( myHomardBoundary );
164 HOMARD::double_array_var aResult = new HOMARD::double_array();
165 std::vector<double> mesCoor = myHomardBoundary->GetLimit();
166 aResult->length( mesCoor .size() );
167 std::vector<double>::const_iterator it;
169 for ( it = mesCoor.begin(); it != mesCoor.end(); it++ )
170 aResult[i++] = (*it);
171 return aResult._retn();
173 //=============================================================================
176 //=============================================================================
177 void HOMARD_Boundary_i::SetCaseCreation( const char* NomCaseCreation )
179 ASSERT( myHomardBoundary );
180 myHomardBoundary->SetCaseCreation( NomCaseCreation );
183 //=============================================================================
184 char* HOMARD_Boundary_i::GetCaseCreation()
186 ASSERT( myHomardBoundary );
187 return CORBA::string_dup( myHomardBoundary->GetCaseCreation().c_str() );
189 //=============================================================================
190 void HOMARD_Boundary_i::AddGroup( const char* Group)
192 ASSERT( myHomardBoundary );
193 myHomardBoundary->AddGroup( Group );
195 //=============================================================================
196 void HOMARD_Boundary_i::SetGroups(const HOMARD::ListGroupType& ListGroup)
198 ASSERT( myHomardBoundary );
199 std::list<std::string> ListString;
200 for ( int i = 0; i < ListGroup.length(); i++ )
202 ListString.push_back(std::string(ListGroup[i]));
204 myHomardBoundary->SetGroups( ListString );
206 //=============================================================================
207 HOMARD::ListGroupType* HOMARD_Boundary_i::GetGroups()
209 ASSERT( myHomardBoundary );
210 const std::list<std::string>& ListString = myHomardBoundary->GetGroups();
211 HOMARD::ListGroupType_var aResult = new HOMARD::ListGroupType;
212 aResult->length( ListString.size() );
213 std::list<std::string>::const_iterator it;
215 for ( it = ListString.begin(); it != ListString.end(); it++ )
217 aResult[i++] = CORBA::string_dup( (*it).c_str() );
219 return aResult._retn();
224 //=============================================================================
225 std::string HOMARD_Boundary_i::Dump() const
227 return HOMARD::Dump( *myHomardBoundary );
230 //=============================================================================
231 bool HOMARD_Boundary_i::Restore( const std::string& stream )
233 return HOMARD::Restore( *myHomardBoundary, stream );