1 // Copyright (C) 2004-2013 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : HYBRIDPlugin_Hypothesis_i.cxx
21 // Created : Wed Apr 2 13:53:01 2008
22 // Author : Edward AGAPOV (eap)
24 #include "HYBRIDPlugin_Hypothesis_i.hxx"
26 #include "SMESH_Gen.hxx"
27 #include "SMESH_PythonDump.hxx"
28 //#include "SMESH_Mesh.hxx"
29 //#include "SMESH_ProxyMesh.hxx"
30 //#include <StdMeshers_QuadToTriaAdaptor.hxx>
32 #include "Utils_CorbaException.hxx"
33 #include "utilities.h"
34 #include "SMESH_Mesh_i.hxx"
35 #include "SMESH_Group_i.hxx"
36 #include "SMESH_Gen_i.hxx"
37 #include "SMESH_TypeDefs.hxx"
38 #include "SMESHDS_GroupBase.hxx"
40 // SALOME KERNEL includes
41 #include "SALOMEDSClient.hxx"
42 #include <SALOMEDSClient_definitions.hxx>
44 // #include <SALOMEconfig.h>
45 // #include CORBA_SERVER_HEADER(SALOMEDS)
47 //=======================================================================
48 //function : HYBRIDPlugin_Hypothesis_i
49 //=======================================================================
50 HYBRIDPlugin_Hypothesis_i::HYBRIDPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
52 ::SMESH_Gen* theGenImpl)
53 : SALOME::GenericObj_i( thePOA ),
54 SMESH_Hypothesis_i( thePOA )
56 MESSAGE( "HYBRIDPlugin_Hypothesis_i::HYBRIDPlugin_Hypothesis_i" );
57 myBaseImpl = new ::HYBRIDPlugin_Hypothesis (theGenImpl->GetANewId(),
62 //=======================================================================
63 //function : ~HYBRIDPlugin_Hypothesis_i
64 //=======================================================================
65 HYBRIDPlugin_Hypothesis_i::~HYBRIDPlugin_Hypothesis_i()
67 MESSAGE( "HYBRIDPlugin_Hypothesis_i::~HYBRIDPlugin_Hypothesis_i" );
70 //=======================================================================
71 //function : SetToMeshHoles
72 //=======================================================================
74 void HYBRIDPlugin_Hypothesis_i::SetToMeshHoles(CORBA::Boolean toMesh)
77 this->GetImpl()->SetToMeshHoles(toMesh);
78 SMESH::TPythonDump() << _this() << ".SetToMeshHoles( " << toMesh << " )";
81 //=======================================================================
82 //function : GetToMeshHoles
83 //=======================================================================
85 CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetToMeshHoles()
88 return this->GetImpl()->GetToMeshHoles();
91 //=======================================================================
92 //function : SetToMakeGroupsOfDomains
93 //=======================================================================
95 void HYBRIDPlugin_Hypothesis_i::SetToMakeGroupsOfDomains(CORBA::Boolean toMakeGroups)
98 this->GetImpl()->SetToMakeGroupsOfDomains(toMakeGroups);
99 SMESH::TPythonDump() << _this() << ".SetToMakeGroupsOfDomains( " << toMakeGroups << " )";
102 //=======================================================================
103 //function : GetToMakeGroupsOfDomains
104 //=======================================================================
106 CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetToMakeGroupsOfDomains()
109 return this->GetImpl()->GetToMakeGroupsOfDomains();
112 //=======================================================================
113 //function : SetMaximumMemory
114 //=======================================================================
116 void HYBRIDPlugin_Hypothesis_i::SetMaximumMemory(CORBA::Double MB)
117 throw ( SALOME::SALOME_Exception )
120 THROW_SALOME_CORBA_EXCEPTION( "Invalid memory size",SALOME::BAD_PARAM );
122 this->GetImpl()->SetMaximumMemory(MB);
123 SMESH::TPythonDump() << _this() << ".SetMaximumMemory( " << MB << " )";
126 //=======================================================================
127 //function : GetMaximumMemory
128 //=======================================================================
130 CORBA::Double HYBRIDPlugin_Hypothesis_i::GetMaximumMemory()
133 return this->GetImpl()->GetMaximumMemory();
136 //=======================================================================
137 //function : SetInitialMemory
138 //=======================================================================
140 void HYBRIDPlugin_Hypothesis_i::SetInitialMemory(CORBA::Double MB)
141 throw ( SALOME::SALOME_Exception )
144 THROW_SALOME_CORBA_EXCEPTION( "Invalid memory size",SALOME::BAD_PARAM );
146 this->GetImpl()->SetInitialMemory(MB);
147 SMESH::TPythonDump() << _this() << ".SetInitialMemory( " << MB << " )";
150 //=======================================================================
151 //function : GetInitialMemory
152 //=======================================================================
154 CORBA::Double HYBRIDPlugin_Hypothesis_i::GetInitialMemory()
157 return this->GetImpl()->GetInitialMemory();
160 //=======================================================================
161 //function : SetOptimizationLevel
162 //=======================================================================
164 void HYBRIDPlugin_Hypothesis_i::SetOptimizationLevel(CORBA::Short level)
165 throw ( SALOME::SALOME_Exception )
167 ::HYBRIDPlugin_Hypothesis::OptimizationLevel l =
168 (::HYBRIDPlugin_Hypothesis::OptimizationLevel) level;
169 if ( l < ::HYBRIDPlugin_Hypothesis::None ||
170 l > ::HYBRIDPlugin_Hypothesis::Strong )
171 THROW_SALOME_CORBA_EXCEPTION( "Invalid optimization level",SALOME::BAD_PARAM );
174 this->GetImpl()->SetOptimizationLevel(l);
175 SMESH::TPythonDump() << _this() << ".SetOptimizationLevel( " << level << " )";
178 //=======================================================================
179 //function : GetOptimizationLevel
180 //=======================================================================
182 CORBA::Short HYBRIDPlugin_Hypothesis_i::GetOptimizationLevel()
185 return this->GetImpl()->GetOptimizationLevel();
188 //=======================================================================
189 //function : SetWorkingDirectory
190 //=======================================================================
191 void HYBRIDPlugin_Hypothesis_i::SetWorkingDirectory(const char* path) throw ( SALOME::SALOME_Exception )
194 THROW_SALOME_CORBA_EXCEPTION( "Null working directory",SALOME::BAD_PARAM );
197 const char lastChar = *file.rbegin();
199 if ( lastChar != '\\' ) file += '\\';
201 if ( lastChar != '/' ) file += '/';
203 file += "HYBRID.log";
204 SMESH_Mesh_i::PrepareForWriting (file.c_str());
207 this->GetImpl()->SetWorkingDirectory(path);
208 SMESH::TPythonDump() << _this() << ".SetWorkingDirectory( '" << path << "' )";
211 //=======================================================================
212 //function : GetWorkingDirectory
213 //=======================================================================
214 char* HYBRIDPlugin_Hypothesis_i::GetWorkingDirectory()
217 return CORBA::string_dup( this->GetImpl()->GetWorkingDirectory().c_str() );
220 //=======================================================================
221 //function : SetKeepFiles
222 //=======================================================================
223 void HYBRIDPlugin_Hypothesis_i::SetKeepFiles(CORBA::Boolean toKeep)
226 this->GetImpl()->SetKeepFiles(toKeep);
227 SMESH::TPythonDump() << _this() << ".SetKeepFiles( " << toKeep << " )";
230 //=======================================================================
231 //function : GetKeepFiles
232 //=======================================================================
233 CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetKeepFiles()
236 return this->GetImpl()->GetKeepFiles();
239 //=======================================================================
240 //function : SetVerboseLevel
241 //=======================================================================
242 void HYBRIDPlugin_Hypothesis_i::SetVerboseLevel(CORBA::Short level)
243 throw ( SALOME::SALOME_Exception )
245 if (level < 0 || level > 10 )
246 THROW_SALOME_CORBA_EXCEPTION( "Invalid verbose level, valid range is [0-10]",
249 this->GetImpl()->SetVerboseLevel(level);
250 SMESH::TPythonDump() << _this() << ".SetVerboseLevel( " << level << " )";
253 //=======================================================================
254 //function : GetVerboseLevel
255 //=======================================================================
256 CORBA::Short HYBRIDPlugin_Hypothesis_i::GetVerboseLevel()
259 return this->GetImpl()->GetVerboseLevel();
262 //=======================================================================
263 //function : SetToCreateNewNodes
264 //=======================================================================
266 void HYBRIDPlugin_Hypothesis_i::SetToCreateNewNodes(CORBA::Boolean toCreate)
269 this->GetImpl()->SetToCreateNewNodes(toCreate);
270 SMESH::TPythonDump() << _this() << ".SetToCreateNewNodes( " << toCreate << " )";
273 //=======================================================================
274 //function : GetToCreateNewNodes
275 //=======================================================================
277 CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetToCreateNewNodes()
280 return this->GetImpl()->GetToCreateNewNodes();
283 //=======================================================================
284 //function : SetToUseBoundaryRecoveryVersion
285 //=======================================================================
287 void HYBRIDPlugin_Hypothesis_i::SetToUseBoundaryRecoveryVersion(CORBA::Boolean toUse)
290 this->GetImpl()->SetToUseBoundaryRecoveryVersion(toUse);
291 SMESH::TPythonDump() << _this() << ".SetToUseBoundaryRecoveryVersion( " << toUse << " )";
294 //=======================================================================
295 //function : GetToUseBoundaryRecoveryVersion
296 //=======================================================================
298 CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetToUseBoundaryRecoveryVersion()
301 return this->GetImpl()->GetToUseBoundaryRecoveryVersion();
304 //=======================================================================
305 //function : SetFEMCorrection
306 //=======================================================================
308 void HYBRIDPlugin_Hypothesis_i::SetFEMCorrection(CORBA::Boolean toUseFem)
311 this->GetImpl()->SetFEMCorrection(toUseFem);
312 SMESH::TPythonDump() << _this() << ".SetFEMCorrection( " << toUseFem << " )";
315 //=======================================================================
316 //function : GetFEMCorrection
317 //=======================================================================
319 CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetFEMCorrection()
322 return this->GetImpl()->GetFEMCorrection();
325 //=======================================================================
326 //function : SetToRemoveCentralPoint
327 //=======================================================================
329 void HYBRIDPlugin_Hypothesis_i::SetToRemoveCentralPoint(CORBA::Boolean toRemove)
332 this->GetImpl()->SetToRemoveCentralPoint(toRemove);
333 SMESH::TPythonDump() << _this() << ".SetToRemoveCentralPoint( " << toRemove << " )";
336 //=======================================================================
337 //function : GetToRemoveCentralPoint
338 //=======================================================================
340 CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetToRemoveCentralPoint()
343 return this->GetImpl()->GetToRemoveCentralPoint();
346 //=======================================================================
347 //function : SetTextOption
348 //=======================================================================
349 void HYBRIDPlugin_Hypothesis_i::SetTextOption(const char* option)
352 this->GetImpl()->SetTextOption(option);
353 SMESH::TPythonDump() << _this() << ".SetTextOption( '" << option << "' )";
356 //=======================================================================
357 //function : GetTextOption
358 //=======================================================================
359 char* HYBRIDPlugin_Hypothesis_i::GetTextOption()
362 return CORBA::string_dup( this->GetImpl()->GetTextOption().c_str() );
365 //=======================================================================
366 //function : SetToRemoveCentralPoint
367 //=======================================================================
369 void HYBRIDPlugin_Hypothesis_i::SetGradation(CORBA::Double gradation)
372 THROW_SALOME_CORBA_EXCEPTION( "The volumic gradation must be > 1",SALOME::BAD_PARAM );
374 if (gradation != GetGradation()) {
375 this->GetImpl()->SetGradation(gradation);
376 SMESH::TPythonDump() << _this() << ".SetGradation( " << gradation << " )";
380 //=======================================================================
381 //function : GetToRemoveCentralPoint
382 //=======================================================================
384 CORBA::Double HYBRIDPlugin_Hypothesis_i::GetGradation()
387 return this->GetImpl()->GetGradation();
390 //=======================================================================
391 //function : SetStandardOutputLog
392 //=======================================================================
393 void HYBRIDPlugin_Hypothesis_i::SetStandardOutputLog(CORBA::Boolean logInStandardOutput)
396 this->GetImpl()->SetStandardOutputLog(logInStandardOutput);
397 SMESH::TPythonDump() << _this() << ".SetPrintLogInFile( " << !logInStandardOutput << " )";
400 //=======================================================================
401 //function : GetStandardOutputLog
402 //=======================================================================
403 CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetStandardOutputLog()
406 return this->GetImpl()->GetStandardOutputLog();
409 //=======================================================================
410 //function : SetRemoveLogOnSuccess
411 //=======================================================================
412 void HYBRIDPlugin_Hypothesis_i::SetRemoveLogOnSuccess(CORBA::Boolean removeLogOnSuccess)
415 this->GetImpl()->SetRemoveLogOnSuccess(removeLogOnSuccess);
416 SMESH::TPythonDump() << _this() << ".SetRemoveLogOnSuccess( " << removeLogOnSuccess << " )";
419 //=======================================================================
420 //function : GetRemoveLogOnSuccess
421 //=======================================================================
422 CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetRemoveLogOnSuccess()
425 return this->GetImpl()->GetRemoveLogOnSuccess();
428 //=======================================================================
429 //function : SetBoundaryLayersInward
430 //=======================================================================
431 void HYBRIDPlugin_Hypothesis_i::SetBoundaryLayersInward(CORBA::Boolean toBoundaryLayersInward)
434 this->GetImpl()->SetBoundaryLayersInward(toBoundaryLayersInward);
435 SMESH::TPythonDump() << _this() << ".SetBoundaryLayersInward( " << toBoundaryLayersInward << " )";
438 //=======================================================================
439 //function : GetBoundaryLayersInward
440 //=======================================================================
441 CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetBoundaryLayersInward()
444 return this->GetImpl()->GetBoundaryLayersInward();
447 //=======================================================================
448 //function : SetElemGenTetraDominant
449 //=======================================================================
450 void HYBRIDPlugin_Hypothesis_i::SetElemGenTetraDominant(CORBA::Boolean toElemGenTetraDominant)
453 this->GetImpl()->SetElemGenTetraDominant(toElemGenTetraDominant);
454 SMESH::TPythonDump() << _this() << ".SetElemGenTetraDominant( " << toElemGenTetraDominant << " )";
457 //=======================================================================
458 //function : GetElemGenTetraDominant
459 //=======================================================================
460 CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetElemGenTetraDominant()
463 return this->GetImpl()->GetElemGenTetraDominant();
466 //=======================================================================
467 //function : SetAddMultinormals
468 //=======================================================================
469 void HYBRIDPlugin_Hypothesis_i::SetAddMultinormals(CORBA::Boolean toAddMultinormals)
472 this->GetImpl()->SetAddMultinormals(toAddMultinormals);
473 SMESH::TPythonDump() << _this() << ".SetAddMultinormals( " << toAddMultinormals << " )";
476 //=======================================================================
477 //function : GetAddMultinormals
478 //=======================================================================
479 CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetAddMultinormals()
482 return this->GetImpl()->GetAddMultinormals();
485 //=======================================================================
486 //function : SetSmoothNormals
487 //=======================================================================
488 void HYBRIDPlugin_Hypothesis_i::SetSmoothNormals(CORBA::Boolean toSmoothNormals)
491 this->GetImpl()->SetSmoothNormals(toSmoothNormals);
492 SMESH::TPythonDump() << _this() << ".SetSmoothNormals( " << toSmoothNormals << " )";
495 //=======================================================================
496 //function : GetSmoothNormals
497 //=======================================================================
498 CORBA::Boolean HYBRIDPlugin_Hypothesis_i::GetSmoothNormals()
501 return this->GetImpl()->GetSmoothNormals();
504 //=======================================================================
505 //function : SetHeightFirstLayer
506 //=======================================================================
507 void HYBRIDPlugin_Hypothesis_i::SetHeightFirstLayer(CORBA::Double toHeightFirstLayer)
510 this->GetImpl()->SetHeightFirstLayer(toHeightFirstLayer);
511 SMESH::TPythonDump() << _this() << ".SetHeightFirstLayer( " << toHeightFirstLayer << " )";
514 //=======================================================================
515 //function : GetHeightFirstLayer
516 //=======================================================================
517 CORBA::Double HYBRIDPlugin_Hypothesis_i::GetHeightFirstLayer()
520 return this->GetImpl()->GetHeightFirstLayer();
523 //=======================================================================
524 //function : SetBoundaryLayersProgression
525 //=======================================================================
526 void HYBRIDPlugin_Hypothesis_i::SetBoundaryLayersProgression(CORBA::Double toBoundaryLayersProgression)
529 this->GetImpl()->SetBoundaryLayersProgression(toBoundaryLayersProgression);
530 SMESH::TPythonDump() << _this() << ".SetBoundaryLayersProgression( " << toBoundaryLayersProgression << " )";
533 //=======================================================================
534 //function : GetBoundaryLayersProgression
535 //=======================================================================
536 CORBA::Double HYBRIDPlugin_Hypothesis_i::GetBoundaryLayersProgression()
539 return this->GetImpl()->GetBoundaryLayersProgression();
542 //=======================================================================
543 //function : SetMultinormalsAngle
544 //=======================================================================
545 void HYBRIDPlugin_Hypothesis_i::SetMultinormalsAngle(CORBA::Double toMultinormalsAngle)
548 this->GetImpl()->SetMultinormalsAngle(toMultinormalsAngle);
549 SMESH::TPythonDump() << _this() << ".SetMultinormalsAngle( " << toMultinormalsAngle << " )";
552 //=======================================================================
553 //function : GetMultinormalsAngle
554 //=======================================================================
555 CORBA::Double HYBRIDPlugin_Hypothesis_i::GetMultinormalsAngle()
558 return this->GetImpl()->GetMultinormalsAngle();
561 //=======================================================================
562 //function : SetNbOfBoundaryLayers
563 //=======================================================================
564 void HYBRIDPlugin_Hypothesis_i::SetNbOfBoundaryLayers(CORBA::Short toNbOfBoundaryLayers)
567 this->GetImpl()->SetNbOfBoundaryLayers(toNbOfBoundaryLayers);
568 SMESH::TPythonDump() << _this() << ".SetNbOfBoundaryLayers( " << toNbOfBoundaryLayers << " )";
571 //=======================================================================
572 //function : GetNbOfBoundaryLayers
573 //=======================================================================
574 CORBA::Short HYBRIDPlugin_Hypothesis_i::GetNbOfBoundaryLayers()
577 return this->GetImpl()->GetNbOfBoundaryLayers();
580 //=======================================================================
581 //function : SetEnforcedVertex
582 //=======================================================================
584 bool HYBRIDPlugin_Hypothesis_i::SetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size)
585 throw (SALOME::SALOME_Exception) {
587 MESSAGE("IDL : SetEnforcedVertex( "<< x << ", " << y << ", " << z << ", " << size << ")");
588 return p_SetEnforcedVertex(size, x, y, z);
591 bool HYBRIDPlugin_Hypothesis_i::SetEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName)
592 throw (SALOME::SALOME_Exception) {
594 MESSAGE("IDL : SetEnforcedVertexNamed( "<< x << ", " << y << ", " << z << ", " << size << ", " << theVertexName << ")");
595 return p_SetEnforcedVertex(size, x, y, z, theVertexName, "", "");
598 bool HYBRIDPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theGroupName)
599 throw (SALOME::SALOME_Exception) {
601 MESSAGE("IDL : SetEnforcedVertexWithGroup( "<< x << ", " << y << ", " << z << ", " << size << ", " << theGroupName << ")");
602 return p_SetEnforcedVertex(size, x, y, z, "", "", theGroupName);
605 bool HYBRIDPlugin_Hypothesis_i::SetEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName, const char* theGroupName)
606 throw (SALOME::SALOME_Exception) {
608 MESSAGE("IDL : SetEnforcedVertexNamedWithGroup( "<< x << ", " << y << ", " << z << ", " << size << ", " << theVertexName << ", " << theGroupName << ")");
609 return p_SetEnforcedVertex(size, x, y, z, theVertexName, "", theGroupName);
612 bool HYBRIDPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size)
613 throw (SALOME::SALOME_Exception) {
616 if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
617 MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
618 THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
621 string theVertexEntry = theVertex->GetStudyEntry();
622 CORBA::Double x = 0, y = 0, z = 0;
623 CORBA::Boolean isCompound = false;
624 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
625 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
626 if (theVertexEntry.empty()) {
628 if (theVertex->GetShapeType() == GEOM::VERTEX) {
631 if (theVertex->GetShapeType() == GEOM::COMPOUND) {
635 aName += theVertex->GetEntry();
636 SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
637 if (!theSVertex->_is_nil())
638 theVertexEntry = theSVertex->GetID();
640 if (theVertexEntry.empty())
641 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
643 if (theVertex->GetShapeType() == GEOM::VERTEX) {
644 GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations( smeshGen->GetCurrentStudy()->StudyId() );
645 if (CORBA::is_nil(measureOp))
648 measureOp->PointCoordinates (theVertex, x, y, z);
649 MESSAGE("Point coordinates from measureOp: " << x << ", " << y << ", " << z);
652 string theVertexName = theVertex->GetName();
653 MESSAGE("IDL : SetEnforcedVertexGeom( "<< theVertexEntry << ", " << size<< ")");
655 return p_SetEnforcedVertex(size, x, y, z, theVertexName.c_str(), theVertexEntry.c_str(), "", isCompound);
658 bool HYBRIDPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size, const char* theGroupName)
659 throw (SALOME::SALOME_Exception) {
662 if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
663 MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
664 THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
667 string theVertexEntry = theVertex->GetStudyEntry();
668 CORBA::Double x = 0, y = 0, z = 0;
669 CORBA::Boolean isCompound = false;
670 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
671 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
672 if (theVertexEntry.empty()) {
674 if (theVertex->GetShapeType() == GEOM::VERTEX) {
677 if (theVertex->GetShapeType() == GEOM::COMPOUND) {
681 aName += theVertex->GetEntry();
682 SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
683 if (!theSVertex->_is_nil())
684 theVertexEntry = theSVertex->GetID();
686 if (theVertexEntry.empty())
687 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
689 if (theVertex->GetShapeType() == GEOM::VERTEX) {
690 GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations( smeshGen->GetCurrentStudy()->StudyId() );
691 if (CORBA::is_nil(measureOp))
694 measureOp->PointCoordinates (theVertex, x, y, z);
695 MESSAGE("Point coordinates from measureOp: " << x << ", " << y << ", " << z);
698 string theVertexName = theVertex->GetName();
699 MESSAGE("IDL : SetEnforcedVertexGeomWithGroup( "<< theVertexEntry << ", " << size<< ", " << theGroupName << ")");
701 return p_SetEnforcedVertex(size, x, y, z, theVertexName.c_str(), theVertexEntry.c_str(), theGroupName, isCompound);
704 bool HYBRIDPlugin_Hypothesis_i:: p_SetEnforcedVertex(CORBA::Double size, CORBA::Double x, CORBA::Double y, CORBA::Double z,
705 const char* theVertexName, const char* theVertexEntry, const char* theGroupName,
706 CORBA::Boolean isCompound)
707 throw (SALOME::SALOME_Exception) {
709 MESSAGE("IDL : p_SetEnforcedVertex(" << size << ", " << x << ", " << y << ", " << z << ", \"" << theVertexName << "\", \"" << theVertexEntry << "\", \"" << theGroupName << "\", " << isCompound<< ")");
710 bool newValue = false;
712 ::HYBRIDPlugin_Hypothesis::TCoordsHYBRIDEnforcedVertexMap coordsList;
713 ::HYBRIDPlugin_Hypothesis::TGeomEntryHYBRIDEnforcedVertexMap enfVertexEntryList;
714 if (string(theVertexEntry).empty()) {
715 coordsList = this->GetImpl()->_GetEnforcedVerticesByCoords();
716 std::vector<double> coords;
720 if (coordsList.find(coords) == coordsList.end()) {
721 MESSAGE("Coords not found: add it in coordsList");
725 MESSAGE("Coords already found, compare names");
726 ::HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertex *enfVertex = this->GetImpl()->GetEnforcedVertex(x, y, z);
727 if ((enfVertex->name != theVertexName) || (enfVertex->groupName != theGroupName) || (enfVertex->size != size)) {
728 MESSAGE("The names or size are different: update");
729 // this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z);
733 MESSAGE("The names and size are identical");
738 if (string(theVertexName).empty()) {
739 if (string(theGroupName).empty())
740 SMESH::TPythonDump() << "isDone = " << _this() << ".SetEnforcedVertex(" << x << ", " << y << ", " << z << ", " << size << ")";
742 SMESH::TPythonDump() << "isDone = " << _this() << ".SetEnforcedVertexWithGroup(" << x << ", " << y << ", " << z << ", " << size << ", \"" << theGroupName << "\")";
745 if (string(theGroupName).empty())
746 SMESH::TPythonDump() << "isDone = " << _this() << ".SetEnforcedVertexNamed(" << x << ", " << y << ", " << z << ", " << size << ", \"" << theVertexName << "\")";
748 SMESH::TPythonDump() << "isDone = " << _this() << ".SetEnforcedVertexNamedWithGroup(" << x << ", " << y << ", " << z << ", " << size << ", \"" << theVertexName << "\", \"" << theGroupName << "\")";
753 // if (isCompound || (!isCompound && !string(theVertexEntry).empty())) {
754 enfVertexEntryList = this->GetImpl()->_GetEnforcedVerticesByEntry();
755 // ::BLSURFPlugin_Hypothesis::TGeomEntryHYBRIDEnforcedVertexMap::const_iterator it = enfVertexEntryList.find(theVertexEntry);
756 if ( enfVertexEntryList.find(theVertexEntry) == enfVertexEntryList.end()) {
757 MESSAGE("Geom entry not found: add it in enfVertexEntryList");
761 MESSAGE("Geom entry already found, compare names");
762 ::HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertex *enfVertex = this->GetImpl()->GetEnforcedVertex(theVertexEntry);
763 if ((enfVertex->name != theVertexName) || (enfVertex->groupName != theGroupName) || (enfVertex->size != size)) {
764 MESSAGE("The names or size are different: update");
765 // this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z);
769 MESSAGE("The names and size are identical");
774 if (string(theGroupName).empty())
775 SMESH::TPythonDump() << "isDone = " << _this() << ".SetEnforcedVertexGeom(" << theVertexEntry << ", " << size << ")";
777 SMESH::TPythonDump() << "isDone = " << _this() << ".SetEnforcedVertexGeomWithGroup(" << theVertexEntry << ", " << size << ", \"" << theGroupName << "\")";
782 this->GetImpl()->SetEnforcedVertex(theVertexName, theVertexEntry, theGroupName, size, x, y, z, isCompound);
784 MESSAGE("IDL : SetEnforcedVertexEntry END");
788 //=======================================================================
789 //function : GetEnforcedVertex
790 //=======================================================================
792 CORBA::Double HYBRIDPlugin_Hypothesis_i::GetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z)
793 throw (SALOME::SALOME_Exception)
797 bool isDone = this->GetImpl()->GetEnforcedVertex(x,y,z)->size;
798 SMESH::TPythonDump() << "aSize = " << _this() << ".GetEnforcedVertex(" << x << ", " << y << ", " << z << ")";
801 catch (const std::invalid_argument& ex) {
802 SALOME::ExceptionStruct ExDescription;
803 ExDescription.text = ex.what();
804 ExDescription.type = SALOME::BAD_PARAM;
805 ExDescription.sourceFile = "HYBRIDPlugin_Hypothesis_i.cxx";
806 ExDescription.lineNumber = 513;
807 throw SALOME::SALOME_Exception(ExDescription);
809 catch (SALOME_Exception& ex) {
810 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
814 //=======================================================================
815 //function : GetEnforcedVertex
816 //=======================================================================
818 CORBA::Double HYBRIDPlugin_Hypothesis_i::GetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex)
819 throw (SALOME::SALOME_Exception)
823 if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
824 MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
825 THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
828 string theVertexEntry = theVertex->GetStudyEntry();
829 if (theVertexEntry.empty()) {
830 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
831 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
833 if (theVertex->GetShapeType() == GEOM::VERTEX)
835 if (theVertex->GetShapeType() == GEOM::COMPOUND)
837 aName += theVertex->GetEntry();
838 SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
839 if (!theSVertex->_is_nil())
840 theVertexEntry = theSVertex->GetID();
842 if (theVertexEntry.empty())
843 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
845 string theVertexName = theVertex->GetName();
848 bool isDone = this->GetImpl()->GetEnforcedVertex(theVertexName)->size;
849 SMESH::TPythonDump() << "aSize = " << _this() << ".GetEnforcedVertexGeom(" << theVertex << ")";
852 catch (const std::invalid_argument& ex) {
853 SALOME::ExceptionStruct ExDescription;
854 ExDescription.text = ex.what();
855 ExDescription.type = SALOME::BAD_PARAM;
856 ExDescription.sourceFile = "HYBRIDPlugin_Hypothesis_i.cxx";
857 ExDescription.lineNumber = 538;
858 throw SALOME::SALOME_Exception(ExDescription);
860 catch (SALOME_Exception& ex) {
861 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
865 //=======================================================================
866 //function : GetEnforcedVertices
867 //=======================================================================
869 HYBRIDPlugin::HYBRIDEnforcedVertexList* HYBRIDPlugin_Hypothesis_i::GetEnforcedVertices()
872 HYBRIDPlugin::HYBRIDEnforcedVertexList_var result = new HYBRIDPlugin::HYBRIDEnforcedVertexList();
874 const ::HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertexList enfVertexList = this->GetImpl()->_GetEnforcedVertices();
875 result->length( enfVertexList.size() );
877 ::HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertexList::const_iterator it = enfVertexList.begin();
879 for (int i = 0 ; it != enfVertexList.end(); ++it, ++i ) {
880 ::HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertex* currentVertex = (*it);
881 HYBRIDPlugin::HYBRIDEnforcedVertex_var enfVertex = new HYBRIDPlugin::HYBRIDEnforcedVertex();
883 enfVertex->name = CORBA::string_dup(currentVertex->name.c_str());
885 enfVertex->geomEntry = CORBA::string_dup(currentVertex->geomEntry.c_str());
887 HYBRIDPlugin::TCoords_var coords = new HYBRIDPlugin::TCoords();
888 coords->length(currentVertex->coords.size());
889 for (int ind = 0; ind < currentVertex->coords.size(); ind++)
890 coords[ind] = currentVertex->coords[ind];
891 enfVertex->coords = coords;
893 enfVertex->groupName = CORBA::string_dup(currentVertex->groupName.c_str());
895 enfVertex->size = currentVertex->size;
897 enfVertex->isCompound = currentVertex->isCompound;
902 // SMESH::TPythonDump() << "allEnforcedVertices = " << _this() << ".GetEnforcedVertices()";
904 return result._retn();
907 //=======================================================================
908 //function : RemoveEnforcedVertex
909 //=======================================================================
911 bool HYBRIDPlugin_Hypothesis_i::RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z)
912 throw (SALOME::SALOME_Exception)
916 bool res = this->GetImpl()->RemoveEnforcedVertex(x,y,z);
917 SMESH::TPythonDump() << " isDone = " << _this() << ".RemoveEnforcedVertex( " << x << ", " << y << ", " << z << " )";
920 catch (const std::invalid_argument& ex) {
921 SALOME::ExceptionStruct ExDescription;
922 ExDescription.text = ex.what();
923 ExDescription.type = SALOME::BAD_PARAM;
924 ExDescription.sourceFile = "HYBRIDPlugin_Hypothesis_i.cxx";
925 ExDescription.lineNumber = 625;
926 throw SALOME::SALOME_Exception(ExDescription);
928 catch (SALOME_Exception& ex) {
929 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
933 bool HYBRIDPlugin_Hypothesis_i::RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex)
934 throw (SALOME::SALOME_Exception)
938 if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
939 MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
940 THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
943 string theVertexEntry = theVertex->GetStudyEntry();
944 if (theVertexEntry.empty()) {
945 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
946 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
948 if (theVertex->GetShapeType() == GEOM::VERTEX)
950 if (theVertex->GetShapeType() == GEOM::COMPOUND)
952 aName += theVertex->GetEntry();
953 SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
954 if (!theSVertex->_is_nil())
955 theVertexEntry = theSVertex->GetID();
957 if (theVertexEntry.empty())
958 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
961 bool res = this->GetImpl()->RemoveEnforcedVertex(0,0,0, theVertexEntry.c_str());
962 SMESH::TPythonDump() << "isDone = " << _this() << ".RemoveEnforcedVertexGeom( " << theVertexEntry.c_str() << " )";
965 catch (const std::invalid_argument& ex) {
966 SALOME::ExceptionStruct ExDescription;
967 ExDescription.text = ex.what();
968 ExDescription.type = SALOME::BAD_PARAM;
969 ExDescription.sourceFile = "HYBRIDPlugin_Hypothesis_i.cxx";
970 ExDescription.lineNumber = 648;
971 throw SALOME::SALOME_Exception(ExDescription);
973 catch (SALOME_Exception& ex) {
974 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
978 //=======================================================================
979 //function : ClearEnforcedVertices
980 //=======================================================================
982 void HYBRIDPlugin_Hypothesis_i::ClearEnforcedVertices()
985 this->GetImpl()->ClearEnforcedVertices();
986 SMESH::TPythonDump () << _this() << ".ClearEnforcedVertices() ";
989 //=======================================================================
990 //function : ClearEnforcedMeshes
991 //=======================================================================
993 void HYBRIDPlugin_Hypothesis_i::ClearEnforcedMeshes()
996 this->GetImpl()->ClearEnforcedMeshes();
997 SMESH::TPythonDump () << _this() << ".ClearEnforcedMeshes() ";
1000 //=======================================================================
1001 //function : GetEnforcedMeshes
1002 //=======================================================================
1004 HYBRIDPlugin::HYBRIDEnforcedMeshList* HYBRIDPlugin_Hypothesis_i::GetEnforcedMeshes()
1007 HYBRIDPlugin::HYBRIDEnforcedMeshList_var result = new HYBRIDPlugin::HYBRIDEnforcedMeshList();
1009 const ::HYBRIDPlugin_Hypothesis::THYBRIDEnforcedMeshList enfMeshList = this->GetImpl()->_GetEnforcedMeshes();
1010 result->length( enfMeshList.size() );
1012 ::HYBRIDPlugin_Hypothesis::THYBRIDEnforcedMeshList::const_iterator it = enfMeshList.begin();
1014 for (int i = 0 ; it != enfMeshList.end(); ++it, ++i ) {
1015 ::HYBRIDPlugin_Hypothesis::THYBRIDEnforcedMesh* currentMesh = (*it);
1016 HYBRIDPlugin::HYBRIDEnforcedMesh_var enfMesh = new HYBRIDPlugin::HYBRIDEnforcedMesh();
1018 enfMesh->name = CORBA::string_dup(currentMesh->name.c_str());
1020 enfMesh->entry = CORBA::string_dup(currentMesh->entry.c_str());
1022 enfMesh->elementType = currentMesh->elementType;
1024 enfMesh->groupName = CORBA::string_dup(currentMesh->groupName.c_str());
1029 // SMESH::TPythonDump() << "allEnforcedVertices = " << _this() << ".GetEnforcedVertices()";
1031 return result._retn();
1035 * \brief Adds enforced elements of type elementType using another mesh/sub-mesh/mesh group theSource. The elements will be grouped in theGroupName.
1037 bool HYBRIDPlugin_Hypothesis_i::SetEnforcedMeshWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType theType, const char* theGroupName)
1038 throw (SALOME::SALOME_Exception)
1040 // #if HYBRID_VERSION >= 42
1041 return p_SetEnforcedMesh(theSource, theType, "", theGroupName);
1043 // SALOME::ExceptionStruct ExDescription;
1044 // ExDescription.text = "Bad version of HYBRID. It must >= 4.2.";
1045 // ExDescription.type = SALOME::BAD_PARAM;
1046 // ExDescription.sourceFile = "HYBRIDPlugin_Hypothesis_i.cxx";
1047 // ExDescription.lineNumber = 719;
1048 // throw SALOME::SALOME_Exception(ExDescription);
1053 * \brief Adds enforced elements of type elementType using another mesh/sub-mesh/mesh group theSource.
1055 bool HYBRIDPlugin_Hypothesis_i::SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType theType)
1056 throw (SALOME::SALOME_Exception)
1058 // MESSAGE("HYBRIDPlugin_Hypothesis_i::SetEnforcedMesh");
1059 // #if HYBRID_VERSION >= 42
1060 return p_SetEnforcedMesh(theSource, theType);
1062 // SALOME::ExceptionStruct ExDescription;
1063 // ExDescription.text = "Bad version of HYBRID. It must >= 4.2.";
1064 // ExDescription.type = SALOME::BAD_PARAM;
1065 // ExDescription.sourceFile = "HYBRIDPlugin_Hypothesis_i.cxx";
1066 // ExDescription.lineNumber = 750;
1067 // throw SALOME::SALOME_Exception(ExDescription);
1072 * \brief OBSOLETE FUNCTION - Adds enforced elements of type elementType using another mesh/sub-mesh/mesh group theSource and a size. The elements will be grouped in theGroupName.
1074 bool HYBRIDPlugin_Hypothesis_i::SetEnforcedMeshSizeWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType theType, double theSize, const char* theGroupName)
1075 throw (SALOME::SALOME_Exception)
1077 // #if HYBRID_VERSION >= 42
1078 return p_SetEnforcedMesh(theSource, theType, "", theGroupName);
1080 // SALOME::ExceptionStruct ExDescription;
1081 // ExDescription.text = "Bad version of HYBRID. It must >= 4.2.";
1082 // ExDescription.type = SALOME::BAD_PARAM;
1083 // ExDescription.sourceFile = "HYBRIDPlugin_Hypothesis_i.cxx";
1084 // ExDescription.lineNumber = 750;
1085 // throw SALOME::SALOME_Exception(ExDescription);
1090 * \brief OBSOLETE FUNCTION - Adds enforced elements of type elementType using another mesh/sub-mesh/mesh group theSource and a size.
1092 bool HYBRIDPlugin_Hypothesis_i::SetEnforcedMeshSize(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType theType, double theSize)
1093 throw (SALOME::SALOME_Exception)
1095 // #if HYBRID_VERSION >= 42
1096 return p_SetEnforcedMesh(theSource, theType);
1098 // SALOME::ExceptionStruct ExDescription;
1099 // ExDescription.text = "Bad version of HYBRID. It must >= 4.2.";
1100 // ExDescription.type = SALOME::BAD_PARAM;
1101 // ExDescription.sourceFile = "HYBRIDPlugin_Hypothesis_i.cxx";
1102 // ExDescription.lineNumber = 750;
1103 // throw SALOME::SALOME_Exception(ExDescription);
1107 bool HYBRIDPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType theType, const char* theName, const char* theGroupName)
1108 throw (SALOME::SALOME_Exception)
1110 MESSAGE("HYBRIDPlugin_Hypothesis_i::p_SetEnforcedMesh");
1113 if (CORBA::is_nil( theSource ))
1115 SALOME::ExceptionStruct ExDescription;
1116 ExDescription.text = "The source mesh CORBA object is NULL";
1117 ExDescription.type = SALOME::BAD_PARAM;
1118 ExDescription.sourceFile = "HYBRIDPlugin_Hypothesis_i.cxx";
1119 ExDescription.lineNumber = 840;
1120 throw SALOME::SALOME_Exception(ExDescription);
1125 MESSAGE("Required type is NODE");
1128 MESSAGE("Required type is EDGE");
1131 MESSAGE("Required type is FACE");
1134 MESSAGE("Incompatible required type: " << theType);
1137 // MESSAGE("Required type is "<<theType);
1138 SMESH::array_of_ElementType_var types = theSource->GetTypes();
1139 MESSAGE("Available types:");
1140 for (int i=0;i<types->length();i++){MESSAGE(types[i]);}
1141 if ( types->length() >= 1 && types[types->length()-1] < theType)
1143 MESSAGE("Required type not available");
1145 // SALOME::ExceptionStruct ExDescription;
1146 // ExDescription.text = "The source mesh has bad type";
1147 // ExDescription.type = SALOME::BAD_PARAM;
1148 // ExDescription.sourceFile = "HYBRIDPlugin_Hypothesis_i.cxx";
1149 // ExDescription.lineNumber = 840;
1150 // throw SALOME::SALOME_Exception(ExDescription);
1154 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1155 SALOMEDS::SObject_ptr SObj = smeshGen->ObjectToSObject(smeshGen->GetCurrentStudy(),theSource);
1157 SMESH_Mesh_i* theMesh_i = SMESH::DownCast<SMESH_Mesh_i*>( theSource);
1158 SMESH_Group_i* theGroup_i = SMESH::DownCast<SMESH_Group_i*>( theSource);
1159 SMESH_GroupOnGeom_i* theGroupOnGeom_i = SMESH::DownCast<SMESH_GroupOnGeom_i*>( theSource);
1161 string enfMeshName = theName;
1162 if (enfMeshName.empty())
1163 enfMeshName = SObj->GetName();
1168 bool res = this->GetImpl()->SetEnforcedMesh(theMesh_i->GetImpl(), theType, enfMeshName , SObj->GetID(), theGroupName);
1169 if (theGroupName != "") {
1170 SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( "
1171 << theSource << ".GetMesh(), " << theType << ", \"" << theGroupName << "\" )";
1174 SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMesh( "
1175 << theSource << ".GetMesh(), " << theType << " )";
1180 catch (const std::invalid_argument& ex) {
1181 SALOME::ExceptionStruct ExDescription;
1182 ExDescription.text = ex.what();
1183 ExDescription.type = SALOME::BAD_PARAM;
1184 ExDescription.sourceFile = "HYBRIDPlugin_Hypothesis_i.cxx";
1185 ExDescription.lineNumber = 840;
1186 throw SALOME::SALOME_Exception(ExDescription);
1188 catch (SALOME_Exception& ex) {
1189 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1192 else if (theGroup_i)// && types->length() == 1 && types[0] == theType)
1194 MESSAGE("The source is a group")
1196 bool res = this->GetImpl()->SetEnforcedGroup(theGroup_i->GetGroupDS()->GetMesh(), theGroup_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName);
1197 if (theGroupName != "") {
1198 SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( "
1199 << theSource << ", " << theType << ", \"" << theGroupName << "\" )";
1202 SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMesh( "
1203 << theSource << ", " << theType << " )";
1207 catch (const std::invalid_argument& ex) {
1208 SALOME::ExceptionStruct ExDescription;
1209 ExDescription.text = ex.what();
1210 ExDescription.type = SALOME::BAD_PARAM;
1211 ExDescription.sourceFile = "HYBRIDPlugin_Hypothesis_i.cxx";
1212 ExDescription.lineNumber = 840;
1213 throw SALOME::SALOME_Exception(ExDescription);
1215 catch (SALOME_Exception& ex) {
1216 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1219 else if (theGroupOnGeom_i)// && types->length() == 1 && types[0] == theType)
1221 MESSAGE("The source is a group on geom")
1223 bool res = this->GetImpl()->SetEnforcedGroup(theGroupOnGeom_i->GetGroupDS()->GetMesh(),theGroupOnGeom_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName);
1224 if (theGroupName != "") {
1225 SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( "
1226 << theSource << ", " << theType << ", \"" << theGroupName << "\" )";
1229 SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMesh( "
1230 << theSource << ", " << theType << " )";
1234 catch (const std::invalid_argument& ex) {
1235 SALOME::ExceptionStruct ExDescription;
1236 ExDescription.text = ex.what();
1237 ExDescription.type = SALOME::BAD_PARAM;
1238 ExDescription.sourceFile = "HYBRIDPlugin_Hypothesis_i.cxx";
1239 ExDescription.lineNumber = 840;
1240 throw SALOME::SALOME_Exception(ExDescription);
1242 catch (SALOME_Exception& ex) {
1243 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1248 //=============================================================================
1250 * Get implementation
1252 //=============================================================================
1254 ::HYBRIDPlugin_Hypothesis* HYBRIDPlugin_Hypothesis_i::GetImpl()
1256 return (::HYBRIDPlugin_Hypothesis*)myBaseImpl;
1259 //================================================================================
1261 * \brief Verify whether hypothesis supports given entity type
1263 //================================================================================
1265 CORBA::Boolean HYBRIDPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension type )
1267 return type == SMESH::DIM_3D;