1 // Copyright (C) 2007-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
21 // File : BLSURFPlugin_Hypothesis.cxx
22 // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA)
23 // Size maps developement: Nicolas GEIMER (OCC) & Gilles DAVID (EURIWARE)
26 #include "BLSURFPlugin_Hypothesis_i.hxx"
28 #include <SMESH_Gen.hxx>
29 #include <SMESH_Gen_i.hxx>
30 #include <SMESH_PythonDump.hxx>
32 #include <GEOM_Object.hxx>
34 #include <SALOMEDS_wrap.hxx>
35 #include <Utils_CorbaException.hxx>
36 #include <utilities.h>
40 #include <boost/regex.hpp>
42 //=============================================================================
44 * BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i
48 //=============================================================================
49 BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA, int theStudyId,
50 ::SMESH_Gen* theGenImpl) :
51 SALOME::GenericObj_i(thePOA), SMESH_Hypothesis_i(thePOA) {
52 MESSAGE( "BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i" );
53 myBaseImpl = new ::BLSURFPlugin_Hypothesis(theGenImpl->GetANewId(), theStudyId, theGenImpl);
56 //=============================================================================
58 * BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i
62 //=============================================================================
63 BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i() {
64 MESSAGE( "BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i" );
67 //=============================================================================
69 //=============================================================================
71 * BLSURFPlugin_Hypothesis_i::SetPhysicalMesh
76 //=============================================================================
77 void BLSURFPlugin_Hypothesis_i::SetPhysicalMesh(CORBA::Long theValue) {
78 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhysicalMesh");
80 this->GetImpl()->SetPhysicalMesh((::BLSURFPlugin_Hypothesis::PhysicalMesh) theValue);
81 SMESH::TPythonDump() << _this() << ".SetPhysicalMesh( " << theValue << " )";
84 //=============================================================================
86 * BLSURFPlugin_Hypothesis_i::GetPhysicalMesh
90 //=============================================================================
91 CORBA::Long BLSURFPlugin_Hypothesis_i::GetPhysicalMesh() {
92 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhysicalMesh");
94 return this->GetImpl()->GetPhysicalMesh();
97 //=============================================================================
99 * BLSURFPlugin_Hypothesis_i::SetGeometricMesh
104 //=============================================================================
105 void BLSURFPlugin_Hypothesis_i::SetGeometricMesh(CORBA::Long theValue) {
106 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGeometricMesh");
108 this->GetImpl()->SetGeometricMesh((::BLSURFPlugin_Hypothesis::GeometricMesh) theValue);
109 SMESH::TPythonDump() << _this() << ".SetGeometricMesh( " << theValue << " )";
112 //=============================================================================
114 * BLSURFPlugin_Hypothesis_i::GetGeometricMesh
118 //=============================================================================
119 CORBA::Long BLSURFPlugin_Hypothesis_i::GetGeometricMesh() {
120 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGeometricMesh");
122 return this->GetImpl()->GetGeometricMesh();
125 //=============================================================================
127 * BLSURFPlugin_Hypothesis_i::SetPhySize
131 //=============================================================================
132 void BLSURFPlugin_Hypothesis_i::SetPhySize(CORBA::Double theValue) {
133 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySize");
135 this->GetImpl()->SetPhySize(theValue, false);
136 SMESH::TPythonDump() << _this() << ".SetPhySize( " << theValue << " )";
139 //=============================================================================
141 * BLSURFPlugin_Hypothesis_i::SetPhySizeRel
143 * Set Relative PhySize
145 //=============================================================================
146 void BLSURFPlugin_Hypothesis_i::SetPhySizeRel(CORBA::Double theValue) {
147 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySizeRel");
149 this->GetImpl()->SetPhySize(theValue, true);
150 SMESH::TPythonDump() << _this() << ".SetPhySize( " << theValue << ", isRelative = True )";
153 //=============================================================================
155 * BLSURFPlugin_Hypothesis_i::GetPhySize
159 //=============================================================================
160 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhySize() {
161 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhySize");
163 return this->GetImpl()->GetPhySize();
166 //=============================================================================
168 * BLSURFPlugin_Hypothesis_i::IsPhySizeRel
170 * Returns True if PhySize is relative
172 //=============================================================================
173 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsPhySizeRel() {
174 // MESSAGE("BLSURFPlugin_Hypothesis_i::IsPhySizeRel");
176 return this->GetImpl()->IsPhySizeRel();
179 //=============================================================================
180 void BLSURFPlugin_Hypothesis_i::SetMinSize(CORBA::Double theMinSize) {
182 if (IsMinSizeRel() || GetMinSize() != theMinSize ) {
183 this->GetImpl()->SetMinSize(theMinSize, false);
184 SMESH::TPythonDump() << _this() << ".SetMinSize( " << theMinSize << " )";
188 //=============================================================================
189 void BLSURFPlugin_Hypothesis_i::SetMinSizeRel(CORBA::Double theMinSize) {
191 if ( !IsMinSizeRel() || (GetMinSize() != theMinSize) ) {
192 this->GetImpl()->SetMinSize(theMinSize, true);
193 SMESH::TPythonDump() << _this() << ".SetMinSize( " << theMinSize << ", isRelative = True )";
197 //=============================================================================
198 CORBA::Double BLSURFPlugin_Hypothesis_i::GetMinSize() {
200 return this->GetImpl()->GetMinSize();
203 //=============================================================================
204 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMinSizeRel() {
205 // MESSAGE("BLSURFPlugin_Hypothesis_i::IsMinSizeRel");
207 return this->GetImpl()->IsMinSizeRel();
210 //=============================================================================
211 void BLSURFPlugin_Hypothesis_i::SetMaxSize(CORBA::Double theMaxSize) {
213 if (IsMaxSizeRel() || GetMaxSize() != theMaxSize) {
214 this->GetImpl()->SetMaxSize(theMaxSize, false);
215 SMESH::TPythonDump() << _this() << ".SetMaxSize( " << theMaxSize << " )";
219 //=============================================================================
220 void BLSURFPlugin_Hypothesis_i::SetMaxSizeRel(CORBA::Double theMaxSize) {
222 if ( !IsMaxSizeRel() || (GetMaxSize() != theMaxSize) ) {
223 this->GetImpl()->SetMaxSize(theMaxSize, true);
224 SMESH::TPythonDump() << _this() << ".SetMaxSize( " << theMaxSize << ", isRelative = True )";
228 //=============================================================================
229 CORBA::Double BLSURFPlugin_Hypothesis_i::GetMaxSize() {
231 return this->GetImpl()->GetMaxSize();
234 //=============================================================================
235 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMaxSizeRel() {
236 // MESSAGE("BLSURFPlugin_Hypothesis_i::IsMaxSizeRel");
238 return this->GetImpl()->IsMaxSizeRel();
241 //=============================================================================
243 * BLSURFPlugin_Hypothesis_i::SetGradation
247 //=============================================================================
248 void BLSURFPlugin_Hypothesis_i::SetGradation(CORBA::Double theValue) {
249 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGradation");
251 this->GetImpl()->SetGradation(theValue);
252 SMESH::TPythonDump() << _this() << ".SetGradation( " << theValue << " )";
255 //=============================================================================
257 * BLSURFPlugin_Hypothesis_i::GetGradation
261 //=============================================================================
262 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGradation() {
263 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGradation");
265 return this->GetImpl()->GetGradation();
268 //=============================================================================
270 * BLSURFPlugin_Hypothesis_i::SetQuadAllowed
274 //=============================================================================
275 void BLSURFPlugin_Hypothesis_i::SetQuadAllowed(CORBA::Boolean theValue) {
276 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetQuadAllowed");
278 this->GetImpl()->SetQuadAllowed(theValue);
279 std::string theValueStr = theValue ? "True" : "False";
280 SMESH::TPythonDump() << _this() << ".SetQuadAllowed( " << theValueStr.c_str() << " )";
283 //=============================================================================
285 * BLSURFPlugin_Hypothesis_i::GetQuadAllowed
289 //=============================================================================
290 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadAllowed() {
291 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetQuadAllowed");
293 return this->GetImpl()->GetQuadAllowed();
296 //=============================================================================
298 * BLSURFPlugin_Hypothesis_i::SetAngleMesh
302 //=============================================================================
303 void BLSURFPlugin_Hypothesis_i::SetAngleMesh(CORBA::Double theValue) {
304 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAngleMesh");
306 this->GetImpl()->SetAngleMesh(theValue);
307 SMESH::TPythonDump() << _this() << ".SetAngleMesh( " << theValue << " )";
310 //=============================================================================
312 * BLSURFPlugin_Hypothesis_i::GetAngleMesh
316 //=============================================================================
317 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMesh() {
318 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAngleMesh");
320 return this->GetImpl()->GetAngleMesh();
323 //=============================================================================
325 * BLSURFPlugin_Hypothesis_i::SetChordalError
329 //=============================================================================
330 void BLSURFPlugin_Hypothesis_i::SetChordalError(CORBA::Double theValue) {
331 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetChordalError");
333 this->GetImpl()->SetChordalError(theValue);
334 SMESH::TPythonDump() << _this() << ".SetChordalError( " << theValue << " )";
337 //=============================================================================
339 * BLSURFPlugin_Hypothesis_i::GetChordalError
343 //=============================================================================
344 CORBA::Double BLSURFPlugin_Hypothesis_i::GetChordalError() {
345 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetChordalError");
347 return this->GetImpl()->GetChordalError();
350 //=============================================================================
352 * BLSURFPlugin_Hypothesis_i::SetAnisotropic
356 //=============================================================================
357 void BLSURFPlugin_Hypothesis_i::SetAnisotropic(CORBA::Boolean theValue) {
358 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAnisotropic");
360 this->GetImpl()->SetAnisotropic(theValue);
361 std::string theValueStr = theValue ? "True" : "False";
362 SMESH::TPythonDump() << _this() << ".SetAnisotropic( " << theValueStr.c_str() << " )";
365 //=============================================================================
367 * BLSURFPlugin_Hypothesis_i::GetAnisotropic
371 //=============================================================================
372 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetAnisotropic() {
373 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAnisotropic");
375 return this->GetImpl()->GetAnisotropic();
378 //=============================================================================
380 * BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio
382 * Set Anisotropic Ratio
384 //=============================================================================
385 void BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio(CORBA::Double theValue) {
386 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio");
388 this->GetImpl()->SetAnisotropicRatio(theValue);
389 SMESH::TPythonDump() << _this() << ".SetAnisotropicRatio( " << theValue << " )";
392 //=============================================================================
394 * BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio
396 * Get Anisotropic Ratio
398 //=============================================================================
399 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio() {
400 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio");
402 return this->GetImpl()->GetAnisotropicRatio();
406 //=============================================================================
408 * BLSURFPlugin_Hypothesis_i::SetRemoveTinyEdges
412 //=============================================================================
413 void BLSURFPlugin_Hypothesis_i::SetRemoveTinyEdges(CORBA::Boolean theValue) {
414 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetRemoveTinyEdges");
416 this->GetImpl()->SetRemoveTinyEdges(theValue);
417 std::string theValueStr = theValue ? "True" : "False";
418 SMESH::TPythonDump() << _this() << ".SetRemoveTinyEdges( " << theValueStr.c_str() << " )";
421 //=============================================================================
423 * BLSURFPlugin_Hypothesis_i::GetRemoveTinyEdges
427 //=============================================================================
428 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetRemoveTinyEdges() {
429 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetRemoveTinyEdges");
431 return this->GetImpl()->GetRemoveTinyEdges();
434 //=============================================================================
436 * BLSURFPlugin_Hypothesis_i::SetTinyEdgeLength
438 * Set Tiny Edge Length
440 //=============================================================================
441 void BLSURFPlugin_Hypothesis_i::SetTinyEdgeLength(CORBA::Double theValue) {
442 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTinyEdgeLength");
444 this->GetImpl()->SetTinyEdgeLength(theValue);
445 SMESH::TPythonDump() << _this() << ".SetTinyEdgeLength( " << theValue << " )";
448 //=============================================================================
450 * BLSURFPlugin_Hypothesis_i::GetTinyEdgeLength
452 * Get Tiny Edge Length
454 //=============================================================================
455 CORBA::Double BLSURFPlugin_Hypothesis_i::GetTinyEdgeLength() {
456 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTinyEdgeLength");
458 return this->GetImpl()->GetTinyEdgeLength();
461 //=============================================================================
463 * BLSURFPlugin_Hypothesis_i::SetBadElementRemoval
467 //=============================================================================
468 void BLSURFPlugin_Hypothesis_i::SetBadElementRemoval(CORBA::Boolean theValue) {
469 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetBadElementRemoval");
471 this->GetImpl()->SetBadElementRemoval(theValue);
472 std::string theValueStr = theValue ? "True" : "False";
473 SMESH::TPythonDump() << _this() << ".SetBadElementRemoval( " << theValueStr.c_str() << " )";
476 //=============================================================================
478 * BLSURFPlugin_Hypothesis_i::GetBadElementRemoval
482 //=============================================================================
483 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetBadElementRemoval() {
484 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetBadElementRemoval");
486 return this->GetImpl()->GetBadElementRemoval();
489 //=============================================================================
491 * BLSURFPlugin_Hypothesis_i::SetBadElementAspectRatio
493 * Set Bad Surface Element Aspect Ratio
495 //=============================================================================
496 void BLSURFPlugin_Hypothesis_i::SetBadElementAspectRatio(CORBA::Double theValue) {
497 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetBadElementAspectRatio");
499 this->GetImpl()->SetBadElementAspectRatio(theValue);
500 SMESH::TPythonDump() << _this() << ".SetBadElementAspectRatio( " << theValue << " )";
503 //=============================================================================
505 * BLSURFPlugin_Hypothesis_i::GetBadElementAspectRatio
507 * Get Bad Surface Element Aspect Ratio
509 //=============================================================================
510 CORBA::Double BLSURFPlugin_Hypothesis_i::GetBadElementAspectRatio() {
511 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetBadElementAspectRatio");
513 return this->GetImpl()->GetBadElementAspectRatio();
516 //=============================================================================
518 * BLSURFPlugin_Hypothesis_i::SetOptimizeMesh
522 //=============================================================================
523 void BLSURFPlugin_Hypothesis_i::SetOptimizeMesh(CORBA::Boolean theValue) {
524 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetOptimizeMesh");
526 this->GetImpl()->SetOptimizeMesh(theValue);
527 std::string theValueStr = theValue ? "True" : "False";
528 SMESH::TPythonDump() << _this() << ".SetOptimizeMesh( " << theValueStr.c_str() << " )";
531 //=============================================================================
533 * BLSURFPlugin_Hypothesis_i::GetOptimizeMesh
537 //=============================================================================
538 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetOptimizeMesh() {
539 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetOptimizeMesh");
541 return this->GetImpl()->GetOptimizeMesh();
544 //=============================================================================
546 * BLSURFPlugin_Hypothesis_i::SetQuadraticMesh
550 //=============================================================================
551 void BLSURFPlugin_Hypothesis_i::SetQuadraticMesh(CORBA::Boolean theValue) {
552 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetQuadraticMesh");
554 this->GetImpl()->SetQuadraticMesh(theValue);
555 std::string theValueStr = theValue ? "True" : "False";
556 SMESH::TPythonDump() << _this() << ".SetQuadraticMesh( " << theValueStr.c_str() << " )";
559 //=============================================================================
561 * BLSURFPlugin_Hypothesis_i::GetQuadraticMesh
565 //=============================================================================
566 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadraticMesh() {
567 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetQuadraticMesh");
569 return this->GetImpl()->GetQuadraticMesh();
577 * BLSURFPlugin_Hypothesis_i::SetTopology
582 //=============================================================================
583 void BLSURFPlugin_Hypothesis_i::SetTopology(CORBA::Long theValue) {
584 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTopology");
586 this->GetImpl()->SetTopology((::BLSURFPlugin_Hypothesis::Topology) theValue);
587 SMESH::TPythonDump() << _this() << ".SetTopology( " << theValue << " )";
590 //=============================================================================
592 * BLSURFPlugin_Hypothesis_i::GetTopology
596 //=============================================================================
597 CORBA::Long BLSURFPlugin_Hypothesis_i::GetTopology() {
598 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTopology");
600 return this->GetImpl()->GetTopology();
603 //=============================================================================
604 void BLSURFPlugin_Hypothesis_i::SetVerbosity(CORBA::Short theVal) throw (SALOME::SALOME_Exception) {
606 if (theVal < 0 || theVal > 100)
607 THROW_SALOME_CORBA_EXCEPTION( "Invalid verbosity level",SALOME::BAD_PARAM );
608 this->GetImpl()->SetVerbosity(theVal);
609 SMESH::TPythonDump() << _this() << ".SetVerbosity( " << theVal << " )";
612 //=============================================================================
614 CORBA::Short BLSURFPlugin_Hypothesis_i::GetVerbosity() {
616 return (CORBA::Short) this->GetImpl()->GetVerbosity();
619 //=============================================================================
621 * BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges
625 //=============================================================================
626 void BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges(CORBA::Boolean theValue) {
627 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges");
629 this->GetImpl()->SetPreCADMergeEdges(theValue);
630 std::string theValueStr = theValue ? "True" : "False";
631 SMESH::TPythonDump() << _this() << ".SetPreCADMergeEdges( " << theValueStr.c_str() << " )";
634 //=============================================================================
636 * BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges
640 //=============================================================================
641 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges() {
642 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges");
644 return this->GetImpl()->GetPreCADMergeEdges();
647 //=============================================================================
649 * BLSURFPlugin_Hypothesis_i::SetPreCADProcess3DTopology
653 //=============================================================================
654 void BLSURFPlugin_Hypothesis_i::SetPreCADProcess3DTopology(CORBA::Boolean theValue) {
655 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADProcess3DTopology");
657 this->GetImpl()->SetPreCADProcess3DTopology(theValue);
658 std::string theValueStr = theValue ? "True" : "False";
659 SMESH::TPythonDump() << _this() << ".SetPreCADProcess3DTopology( " << theValueStr.c_str() << " )";
662 //=============================================================================
664 * BLSURFPlugin_Hypothesis_i::GetPreCADProcess3DTopology
668 //=============================================================================
669 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADProcess3DTopology() {
670 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADProcess3DTopology");
672 return this->GetImpl()->GetPreCADProcess3DTopology();
675 //=============================================================================
677 * BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput
681 //=============================================================================
682 void BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput(CORBA::Boolean theValue) {
683 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput");
685 this->GetImpl()->SetPreCADDiscardInput(theValue);
686 std::string theValueStr = theValue ? "True" : "False";
687 SMESH::TPythonDump() << _this() << ".SetPreCADDiscardInput( " << theValueStr.c_str() << " )";
690 //=============================================================================
692 * BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput
696 //=============================================================================
697 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput() {
698 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput");
700 return this->GetImpl()->GetPreCADDiscardInput();
704 //=============================================================================
706 void BLSURFPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const char* optionValue)
707 throw (SALOME::SALOME_Exception) {
709 bool valueChanged = false;
711 valueChanged = (this->GetImpl()->GetOptionValue(optionName) != optionValue);
713 this->GetImpl()->SetOptionValue(optionName, optionValue);
714 } catch (const std::invalid_argument& ex) {
715 SALOME::ExceptionStruct ExDescription;
716 ExDescription.text = ex.what();
717 ExDescription.type = SALOME::BAD_PARAM;
718 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetOptionValue(name,value)";
719 ExDescription.lineNumber = 0;
720 throw SALOME::SALOME_Exception(ExDescription);
721 } catch (SALOME_Exception& ex) {
722 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
725 SMESH::TPythonDump() << _this() << ".SetOptionValue( '" << optionName << "', '" << optionValue << "' )";
728 //=============================================================================
730 void BLSURFPlugin_Hypothesis_i::SetPreCADOptionValue(const char* optionName, const char* optionValue)
731 throw (SALOME::SALOME_Exception) {
733 bool valueChanged = false;
735 valueChanged = (this->GetImpl()->GetPreCADOptionValue(optionName) != optionValue);
737 this->GetImpl()->SetPreCADOptionValue(optionName, optionValue);
738 } catch (const std::invalid_argument& ex) {
739 SALOME::ExceptionStruct ExDescription;
740 ExDescription.text = ex.what();
741 ExDescription.type = SALOME::BAD_PARAM;
742 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetPreCADOptionValue(name,value)";
743 ExDescription.lineNumber = 0;
744 throw SALOME::SALOME_Exception(ExDescription);
745 } catch (SALOME_Exception& ex) {
746 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
749 SMESH::TPythonDump() << _this() << ".SetPreCADOptionValue( '" << optionName << "', '" << optionValue << "' )";
752 //=============================================================================
754 char* BLSURFPlugin_Hypothesis_i::GetOptionValue(const char* optionName) throw (SALOME::SALOME_Exception) {
757 return CORBA::string_dup(this->GetImpl()->GetOptionValue(optionName).c_str());
758 } catch (const std::invalid_argument& ex) {
759 SALOME::ExceptionStruct ExDescription;
760 ExDescription.text = ex.what();
761 ExDescription.type = SALOME::BAD_PARAM;
762 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetOptionValue(name)";
763 ExDescription.lineNumber = 0;
764 throw SALOME::SALOME_Exception(ExDescription);
765 } catch (SALOME_Exception& ex) {
766 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
771 //=============================================================================
773 char* BLSURFPlugin_Hypothesis_i::GetPreCADOptionValue(const char* optionName) throw (SALOME::SALOME_Exception) {
776 return CORBA::string_dup(this->GetImpl()->GetPreCADOptionValue(optionName).c_str());
777 } catch (const std::invalid_argument& ex) {
778 SALOME::ExceptionStruct ExDescription;
779 ExDescription.text = ex.what();
780 ExDescription.type = SALOME::BAD_PARAM;
781 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetPreCADOptionValue(name)";
782 ExDescription.lineNumber = 0;
783 throw SALOME::SALOME_Exception(ExDescription);
784 } catch (SALOME_Exception& ex) {
785 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
790 //=============================================================================
792 void BLSURFPlugin_Hypothesis_i::UnsetOption(const char* optionName) {
794 this->GetImpl()->ClearOption(optionName);
795 SMESH::TPythonDump() << _this() << ".UnsetOption( '" << optionName << "' )";
798 //=============================================================================
800 void BLSURFPlugin_Hypothesis_i::UnsetPreCADOption(const char* optionName) {
802 this->GetImpl()->ClearPreCADOption(optionName);
803 SMESH::TPythonDump() << _this() << ".UnsetPreCADOption( '" << optionName << "' )";
806 //=============================================================================
808 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetOptionValues() {
810 BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
812 const ::BLSURFPlugin_Hypothesis::TOptionValues & opts = this->GetImpl()->GetOptionValues();
813 result->length(opts.size());
815 ::BLSURFPlugin_Hypothesis::TOptionValues::const_iterator opIt = opts.begin();
816 for (int i = 0; opIt != opts.end(); ++opIt, ++i) {
817 string name_value = opIt->first;
818 if (!opIt->second.empty()) {
820 name_value += opIt->second;
822 result[i] = CORBA::string_dup(name_value.c_str());
824 return result._retn();
827 //=============================================================================
829 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetPreCADOptionValues() {
831 BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
833 const ::BLSURFPlugin_Hypothesis::TOptionValues & opts = this->GetImpl()->GetPreCADOptionValues();
834 result->length(opts.size());
836 ::BLSURFPlugin_Hypothesis::TOptionValues::const_iterator opIt = opts.begin();
837 for (int i = 0; opIt != opts.end(); ++opIt, ++i) {
838 string name_value = opIt->first;
839 if (!opIt->second.empty()) {
841 name_value += opIt->second;
843 result[i] = CORBA::string_dup(name_value.c_str());
845 return result._retn();
848 //=============================================================================
850 void BLSURFPlugin_Hypothesis_i::SetOptionValues(const BLSURFPlugin::string_array& options)
851 throw (SALOME::SALOME_Exception) {
853 for (int i = 0; i < options.length(); ++i) {
854 string name_value = options[i].in();
855 int colonPos = name_value.find(':');
857 if (colonPos == string::npos) // ':' not found
860 name = name_value.substr(0, colonPos);
861 if (colonPos < name_value.size() - 1 && name_value[colonPos] != ' ')
862 value = name_value.substr(colonPos + 1);
864 SetOptionValue(name.c_str(), value.c_str());
868 //=============================================================================
870 void BLSURFPlugin_Hypothesis_i::SetPreCADOptionValues(const BLSURFPlugin::string_array& options)
871 throw (SALOME::SALOME_Exception) {
873 for (int i = 0; i < options.length(); ++i) {
874 string name_value = options[i].in();
875 int colonPos = name_value.find(':');
877 if (colonPos == string::npos) // ':' not found
880 name = name_value.substr(0, colonPos);
881 if (colonPos < name_value.size() - 1 && name_value[colonPos] != ' ')
882 value = name_value.substr(colonPos + 1);
884 SetPreCADOptionValue(name.c_str(), value.c_str());
888 //=============================================================================
890 void BLSURFPlugin_Hypothesis_i::SetSizeMapEntry(const char* entry, const char* sizeMap)
891 throw (SALOME::SALOME_Exception) {
893 MESSAGE("ENGINE : SETSIZEMAP START ENTRY : " << entry);
894 bool valueChanged = false;
896 valueChanged = (this->GetImpl()->GetSizeMapEntry(entry) != sizeMap);
898 this->GetImpl()->SetSizeMapEntry(entry, sizeMap);
899 } catch (const std::invalid_argument& ex) {
900 SALOME::ExceptionStruct ExDescription;
901 ExDescription.text = ex.what();
902 ExDescription.type = SALOME::BAD_PARAM;
903 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetSizeMapEntry(entry,sizemap)";
904 ExDescription.lineNumber = 0;
905 throw SALOME::SALOME_Exception(ExDescription);
906 } catch (SALOME_Exception& ex) {
907 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
909 MESSAGE("ENGINE : SETSIZEMAP END ENTRY : " << entry);
911 SMESH::TPythonDump() << _this() << ".SetSizeMap(" << entry << ", '" << sizeMap << "' )";
914 //=============================================================================
916 void BLSURFPlugin_Hypothesis_i::SetConstantSizeMapEntry(const char* entry, GEOM::shape_type shapeType, CORBA::Double sizeMap)
917 throw (SALOME::SALOME_Exception) {
919 MESSAGE("ENGINE : SETSIZEMAP START ENTRY : " << entry);
920 bool valueChanged = false;
921 std::ostringstream sizeMapFunction;
923 case GEOM::FACE: sizeMapFunction << "def f(u,v): return " << sizeMap ; break;
924 case GEOM::EDGE: sizeMapFunction << "def f(t): return " << sizeMap ; break;
925 case GEOM::VERTEX: sizeMapFunction << "def f(): return " << sizeMap ; break;
928 valueChanged = (this->GetImpl()->GetSizeMapEntry(entry) != sizeMapFunction.str());
930 this->GetImpl()->SetSizeMapEntry(entry, sizeMapFunction.str());
931 } catch (const std::invalid_argument& ex) {
932 SALOME::ExceptionStruct ExDescription;
933 ExDescription.text = ex.what();
934 ExDescription.type = SALOME::BAD_PARAM;
935 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetSizeMapEntry(entry,sizemap)";
936 ExDescription.lineNumber = 0;
937 throw SALOME::SALOME_Exception(ExDescription);
938 } catch (SALOME_Exception& ex) {
939 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
941 MESSAGE("ENGINE : SETSIZEMAP END ENTRY : " << entry);
943 SMESH::TPythonDump() << _this() << ".SetConstantSizeMap(" << entry << ", '" << sizeMap << "' )";
946 //=============================================================================
948 void BLSURFPlugin_Hypothesis_i::SetAttractorEntry(const char* entry, const char* attractor)
949 throw (SALOME::SALOME_Exception) {
951 MESSAGE("ENGINE : SETATTRACTOR START ENTRY : " << entry);
952 bool valueChanged = false;
954 valueChanged = ( this->GetImpl()->GetAttractorEntry(entry) != attractor );
955 if ( valueChanged ) {
956 boost::regex re("^ATTRACTOR\\((?:(-?0(\\.\\d*)*|-?[1-9]+\\d*(\\.\\d*)*|-?\\.(\\d)+);){5}(True|False)(?:;(-?0(\\.\\d*)*|-?[1-9]+\\d*(\\.\\d*)*|-?\\.(\\d)+))?\\)$");
957 if (!boost::regex_match(string(attractor), re))
958 throw std::invalid_argument("Error: an attractor is defined with the following pattern: ATTRACTOR(xa;ya;za;a;b;True|False;d(opt.))");
959 this->GetImpl()->SetAttractorEntry(entry, attractor);
961 } catch (const std::invalid_argument& ex) {
962 SALOME::ExceptionStruct ExDescription;
963 ExDescription.text = ex.what();
964 ExDescription.type = SALOME::BAD_PARAM;
965 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetAttractorEntry(entry,attractor)";
966 ExDescription.lineNumber = 0;
967 throw SALOME::SALOME_Exception(ExDescription);
968 } catch (SALOME_Exception& ex) {
969 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
971 MESSAGE("ENGINE : SETATTRACTOR END ENTRY : " << entry);
973 SMESH::TPythonDump() << _this() << ".SetAttractor(" << entry << ", '" << attractor << "' )";
976 //=============================================================================
978 void BLSURFPlugin_Hypothesis_i::SetClassAttractorEntry(const char* entry, const char* att_entry, CORBA::Double StartSize, CORBA::Double EndSize, CORBA::Double ActionRadius, CORBA::Double ConstantRadius) //TODO à finir
979 throw (SALOME::SALOME_Exception)
982 MESSAGE("ENGINE : SETATTRACTOR START ENTRY : " << entry);
983 bool valueChanged = false;
985 this->GetImpl()->SetClassAttractorEntry(entry, att_entry, StartSize, EndSize, ActionRadius, ConstantRadius);
987 catch (const std::invalid_argument& ex) {
988 SALOME::ExceptionStruct ExDescription;
989 ExDescription.text = ex.what();
990 ExDescription.type = SALOME::BAD_PARAM;
991 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetClassAttractorEntry(entry, att_entry, StartSize, EndSize, ActionRadius, ConstantRadius)";
992 ExDescription.lineNumber = 0;
993 throw SALOME::SALOME_Exception(ExDescription);
994 } catch (SALOME_Exception& ex) {
995 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
997 MESSAGE("ENGINE : SETATTRACTOR END ENTRY : " << entry);
998 //if ( valueChanged )
999 SMESH::TPythonDump() << _this() << ".SetAttractorGeom("
1000 << entry << ", " << att_entry << ", "<<StartSize<<", "<<EndSize<<", "<<ActionRadius<<", "<<ConstantRadius<<" )";
1003 //=============================================================================
1005 char* BLSURFPlugin_Hypothesis_i::GetSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception) {
1008 return CORBA::string_dup(this->GetImpl()->GetSizeMapEntry(entry).c_str());
1009 } catch (const std::invalid_argument& ex) {
1010 SALOME::ExceptionStruct ExDescription;
1011 ExDescription.text = ex.what();
1012 ExDescription.type = SALOME::BAD_PARAM;
1013 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetSizeMapEntry(name)";
1014 ExDescription.lineNumber = 0;
1015 throw SALOME::SALOME_Exception(ExDescription);
1016 } catch (SALOME_Exception& ex) {
1017 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1022 //=============================================================================
1024 char* BLSURFPlugin_Hypothesis_i::GetAttractorEntry(const char* entry) throw (SALOME::SALOME_Exception) {
1027 return CORBA::string_dup(this->GetImpl()->GetAttractorEntry(entry).c_str());
1028 } catch (const std::invalid_argument& ex) {
1029 SALOME::ExceptionStruct ExDescription;
1030 ExDescription.text = ex.what();
1031 ExDescription.type = SALOME::BAD_PARAM;
1032 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetAttractorEntry(name)";
1033 ExDescription.lineNumber = 0;
1034 throw SALOME::SALOME_Exception(ExDescription);
1035 } catch (SALOME_Exception& ex) {
1036 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1041 // //=============================================================================
1043 // // TODO coder cette fonction (utilisée pour savoir si la valeur a changé
1044 // // A finir pour le dump
1045 // char* BLSURFPlugin_Hypothesis_i::GetClassAttractorEntry(const char* entry)
1046 // throw (SALOME::SALOME_Exception)
1048 // ASSERT(myBaseImpl);
1050 // return CORBA::string_dup( this->GetImpl()->GetClassAttractorEntry(entry).c_str());
1052 // catch (const std::invalid_argument& ex) {
1053 // SALOME::ExceptionStruct ExDescription;
1054 // ExDescription.text = ex.what();
1055 // ExDescription.type = SALOME::BAD_PARAM;
1056 // ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetClassAttractorEntry(name)";
1057 // ExDescription.lineNumber = 0;
1058 // throw SALOME::SALOME_Exception(ExDescription);
1060 // catch (SALOME_Exception& ex) {
1061 // THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1066 //=============================================================================
1068 void BLSURFPlugin_Hypothesis_i::UnsetEntry(const char* entry) {
1070 this->GetImpl()->ClearEntry(entry);
1071 // SMESH::TPythonDump() << _this() << ".UnsetSizeMap( " << entry << " )";
1074 //=============================================================================
1076 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetSizeMapEntries() {
1078 BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
1080 const ::BLSURFPlugin_Hypothesis::TSizeMap sizeMaps = this->GetImpl()->_GetSizeMapEntries();
1081 result->length(sizeMaps.size());
1083 ::BLSURFPlugin_Hypothesis::TSizeMap::const_iterator smIt = sizeMaps.begin();
1084 for (int i = 0; smIt != sizeMaps.end(); ++smIt, ++i) {
1085 string entry_sizemap = smIt->first;
1086 if (!smIt->second.empty()) {
1087 entry_sizemap += "|";
1088 entry_sizemap += smIt->second;
1090 result[i] = CORBA::string_dup(entry_sizemap.c_str());
1092 return result._retn();
1095 //=============================================================================
1097 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetAttractorEntries() {
1099 BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
1101 const ::BLSURFPlugin_Hypothesis::TSizeMap attractors = this->GetImpl()->_GetAttractorEntries();
1102 result->length(attractors.size());
1104 ::BLSURFPlugin_Hypothesis::TSizeMap::const_iterator atIt = attractors.begin();
1105 for (int i = 0; atIt != attractors.end(); ++atIt, ++i) {
1106 string entry_attractor = atIt->first;
1107 if (!atIt->second.empty()) {
1108 entry_attractor += "|";
1109 entry_attractor += atIt->second;
1111 result[i] = CORBA::string_dup(entry_attractor.c_str());
1113 return result._retn();
1116 //=============================================================================
1118 BLSURFPlugin::TAttParamsMap* BLSURFPlugin_Hypothesis_i::GetAttractorParams()
1121 BLSURFPlugin::TAttParamsMap_var result = new BLSURFPlugin::TAttParamsMap();
1123 const ::BLSURFPlugin_Hypothesis::TAttractorMap attractors= this->GetImpl()->_GetClassAttractorEntries();
1124 result->length( attractors.size() );
1126 ::BLSURFPlugin_Hypothesis::TAttractorMap::const_iterator atIt = attractors.begin();
1127 for ( int i = 0 ; atIt != attractors.end(); ++atIt, ++i ) {
1128 string faceEntry = atIt->first;
1130 double startSize, endSize, infDist, constDist;
1131 if ( !atIt->second->Empty() ) {
1132 attEntry = atIt->second->GetAttractorEntry();
1133 MESSAGE("GetAttractorParams : attEntry ="<<attEntry)
1134 std::vector<double> params = atIt->second->GetParameters();
1135 startSize = params[0];
1136 endSize = params[1];
1137 infDist = params[2];
1138 constDist = params[3];
1140 result[i].faceEntry = CORBA::string_dup(faceEntry.c_str());
1141 result[i].attEntry = CORBA::string_dup(attEntry.c_str());
1142 result[i].startSize = startSize;
1143 result[i].endSize = endSize;
1144 result[i].infDist = infDist;
1145 result[i].constDist = constDist;
1146 MESSAGE("GetAttractorParams : result[i].attEntry ="<<result[i].attEntry)
1147 MESSAGE("GetAttractorParams : result[i].faceEntry ="<<result[i].faceEntry)
1149 return result._retn();
1152 //=============================================================================
1154 void BLSURFPlugin_Hypothesis_i::SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps)
1155 throw (SALOME::SALOME_Exception) {
1157 for (int i = 0; i < sizeMaps.length(); ++i) {
1158 string entry_sizemap = sizeMaps[i].in();
1159 int colonPos = entry_sizemap.find('|');
1160 string entry, sizemap;
1161 if (colonPos == string::npos) // '|' separator not found
1162 entry = entry_sizemap;
1164 entry = entry_sizemap.substr(0, colonPos);
1165 if (colonPos < entry_sizemap.size() - 1 && entry_sizemap[colonPos] != ' ')
1166 sizemap = entry_sizemap.substr(colonPos + 1);
1168 this->GetImpl()->SetSizeMapEntry(entry.c_str(), sizemap.c_str());
1172 //=============================================================================
1174 void BLSURFPlugin_Hypothesis_i::ClearSizeMaps() {
1176 this->GetImpl()->ClearSizeMaps();
1179 //=============================================================================
1181 void BLSURFPlugin_Hypothesis_i::SetSizeMap(const GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap) {
1184 entry = GeomObj->GetStudyEntry();
1185 MESSAGE("IDL : GetName : " << GeomObj->GetName());
1186 MESSAGE("IDL : SETSIZEMAP ( "<< entry << " , " << sizeMap << ")");
1187 SetSizeMapEntry(entry.c_str(), sizeMap);
1190 //=============================================================================
1192 void BLSURFPlugin_Hypothesis_i::SetConstantSizeMap(const GEOM::GEOM_Object_ptr GeomObj, CORBA::Double sizeMap) {
1194 string entry = GeomObj->GetStudyEntry();
1195 GEOM::shape_type shapeType = GeomObj->GetShapeType();
1196 if (shapeType == GEOM::COMPOUND)
1197 shapeType = GeomObj->GetMaxShapeType();
1198 MESSAGE("IDL : GetName : " << GeomObj->GetName());
1199 MESSAGE("IDL : SETSIZEMAP ( "<< entry << " , " << sizeMap << ")");
1200 SetConstantSizeMapEntry(entry.c_str(), shapeType, sizeMap);
1203 //=============================================================================
1204 void BLSURFPlugin_Hypothesis_i::UnsetSizeMap(const GEOM::GEOM_Object_ptr GeomObj) {
1207 entry = GeomObj->GetStudyEntry();
1208 MESSAGE("IDL : GetName : " << GeomObj->GetName());
1209 MESSAGE("IDL : UNSETSIZEMAP ( "<< entry << ")");
1210 UnsetEntry(entry.c_str());
1211 SMESH::TPythonDump() << _this() << ".UnsetSizeMap( " << entry.c_str() << " )";
1214 void BLSURFPlugin_Hypothesis_i::SetAttractor(GEOM::GEOM_Object_ptr GeomObj, const char* attractor) {
1217 entry = GeomObj->GetStudyEntry();
1218 MESSAGE("IDL : GetName : " << GeomObj->GetName());
1219 MESSAGE("IDL : SETATTRACTOR ( "<< entry << " , " << attractor << ")");
1220 SetAttractorEntry(entry.c_str(), attractor);
1223 void BLSURFPlugin_Hypothesis_i::UnsetAttractor(GEOM::GEOM_Object_ptr GeomObj) {
1226 entry = GeomObj->GetStudyEntry();
1227 MESSAGE("IDL : GetName : " << GeomObj->GetName());
1228 MESSAGE("IDL : UNSETATTRACTOR ( "<< entry << ")");
1229 UnsetEntry(entry.c_str());
1230 SMESH::TPythonDump() << _this() << ".UnsetAttractor( " << entry.c_str() << " )";
1233 void BLSURFPlugin_Hypothesis_i::SetAttractorGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theAttractor, CORBA::Double StartSize, CORBA::Double EndSize, CORBA::Double ActionRadius, CORBA::Double ConstantRadius)
1236 string theFaceEntry;
1238 theFaceEntry = theFace->GetStudyEntry();
1239 theAttEntry = theAttractor->GetStudyEntry();
1241 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1242 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1245 if (theFaceEntry.empty()) {
1247 aName += theFace->GetEntry();
1248 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1249 if (!theSFace->_is_nil())
1250 theFaceEntry = theSFace->GetID();
1252 if (theFaceEntry.empty())
1253 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1255 if (theAttEntry.empty()) {
1256 if (theAttractor->GetShapeType() == GEOM::VERTEX)
1258 if (theAttractor->GetShapeType() == GEOM::EDGE)
1260 if (theAttractor->GetShapeType() == GEOM::WIRE)
1262 if (theAttractor->GetShapeType() == GEOM::COMPOUND)
1263 aName = "Compound_";
1264 aName += theAttractor->GetEntry();
1265 SALOMEDS::SObject_wrap theSAtt = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theAttractor, aName.c_str());
1266 if (!theSAtt->_is_nil())
1267 theAttEntry = theSAtt->GetID();
1269 if (theAttEntry.empty())
1270 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1272 TopoDS_Face FaceShape = TopoDS::Face(SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( theFace ));
1273 TopoDS_Shape AttractorShape = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( theAttractor );
1274 MESSAGE("IDL : GetName : " << theFace->GetName());
1275 MESSAGE("IDL : SETATTRACTOR () ");//<< entry << " , " << att_entry << ")");
1276 SetClassAttractorEntry( theFaceEntry.c_str(), theAttEntry.c_str(), StartSize, EndSize, ActionRadius, ConstantRadius);
1279 void BLSURFPlugin_Hypothesis_i::UnsetAttractorGeom(GEOM::GEOM_Object_ptr theFace)
1282 string theFaceEntry;
1283 theFaceEntry = theFace->GetStudyEntry();
1285 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1286 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1289 if (theFaceEntry.empty()) {
1291 aName += theFace->GetEntry();
1292 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1293 if (!theSFace->_is_nil())
1294 theFaceEntry = theSFace->GetID();
1296 if (theFaceEntry.empty())
1297 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1299 MESSAGE("IDL : GetName : " << theFace->GetName());
1300 MESSAGE("IDL : UNSETATTRACTOR ( "<< theFaceEntry << ")");
1301 UnsetEntry( theFaceEntry.c_str());
1302 SMESH::TPythonDump() << _this() << ".UnsetAttractorGeom( " << theFaceEntry.c_str() << " )";
1306 void BLSURFPlugin_Hypothesis_i::SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap)
1309 void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj)
1312 void BLSURFPlugin_Hypothesis_i::SetCustomSizeMapEntry(const char* entry,const char* sizeMap ) throw (SALOME::SALOME_Exception)
1315 char* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception)
1318 void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMapEntry(const char* entry)
1321 this->GetImpl()->UnsetCustomSizeMap(entry);
1322 SMESH::TPythonDump() << _this() << ".UnsetCustomSizeMap( " << entry << " )";
1326 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntries()
1331 // ///////////////////////
1332 // // ENFORCED VERTICES //
1333 // ///////////////////////
1337 * Returns the list of enforced vertices for a given Face entry
1338 * @return A map of Face entry / List of enforced vertices
1341 BLSURFPlugin::TFaceEntryEnfVertexListMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByFace() {
1342 MESSAGE("IDL: GetAllEnforcedVerticesByFace()");
1345 BLSURFPlugin::TFaceEntryEnfVertexListMap_var resultMap = new BLSURFPlugin::TFaceEntryEnfVertexListMap();
1347 const ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap faceEntryEnfVertexListMap =
1348 this->GetImpl()->_GetAllEnforcedVerticesByFace();
1349 resultMap->length(faceEntryEnfVertexListMap.size());
1350 MESSAGE("Face entry to Enforced Vertex map size is " << resultMap->length());
1352 ::BLSURFPlugin_Hypothesis::TEnfVertexList _enfVertexList;
1353 ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap::const_iterator it_entry = faceEntryEnfVertexListMap.begin();
1354 for (int i = 0; it_entry != faceEntryEnfVertexListMap.end(); ++it_entry, ++i) {
1355 BLSURFPlugin::TFaceEntryEnfVertexListMapElement_var mapElement =
1356 new BLSURFPlugin::TFaceEntryEnfVertexListMapElement();
1357 mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
1358 MESSAGE("Face Entry: " << mapElement->faceEntry);
1360 _enfVertexList = it_entry->second;
1361 BLSURFPlugin::TEnfVertexList_var enfVertexList = new BLSURFPlugin::TEnfVertexList();
1362 enfVertexList->length(_enfVertexList.size());
1363 MESSAGE("Number of enf vertex: " << enfVertexList->length());
1365 ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator it_enfVertex = _enfVertexList.begin();
1366 ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
1367 for (int j = 0; it_enfVertex != _enfVertexList.end(); ++it_enfVertex, ++j) {
1368 currentEnfVertex = (*it_enfVertex);
1370 BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
1373 enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
1376 enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
1379 BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
1380 coords->length(currentEnfVertex->coords.size());
1381 for (int i=0;i<coords->length();i++)
1382 coords[i] = currentEnfVertex->coords[i];
1383 enfVertex->coords = coords;
1386 enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());
1389 BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
1390 faceEntryList->length(currentEnfVertex->faceEntries.size());
1391 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
1392 for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
1393 faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
1394 enfVertex->faceEntries = faceEntryList;
1397 msg << "Enforced vertex: \n"
1398 << "Name: " << enfVertex->name << "\n";
1399 if (coords->length())
1400 msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
1401 msg << "Geom entry: " << enfVertex->geomEntry << "\n"
1402 << "Group Name: " << enfVertex->grpName;
1405 enfVertexList[j] = enfVertex;
1407 mapElement->enfVertexList = enfVertexList;
1409 resultMap[i] = mapElement;
1412 return resultMap._retn();
1416 * Returns the list of all enforced vertices
1417 * @return a list of enforced vertices
1420 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVertices() {
1421 MESSAGE("IDL: GetAllEnforcedVertices()");
1423 BLSURFPlugin::TEnfVertexList_var resultMap = new BLSURFPlugin::TEnfVertexList();
1424 const ::BLSURFPlugin_Hypothesis::TEnfVertexList enfVertexList = this->GetImpl()->_GetAllEnforcedVertices();
1425 resultMap->length(enfVertexList.size());
1426 MESSAGE("Enforced Vertex map size is " << resultMap->length());
1428 ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = enfVertexList.begin();
1429 ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
1430 for (int i = 0; evlIt != enfVertexList.end(); ++evlIt, ++i) {
1431 MESSAGE("Enforced Vertex #" << i);
1432 currentEnfVertex = (*evlIt);
1433 BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
1435 enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
1437 enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
1439 BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
1440 coords->length(currentEnfVertex->coords.size());
1441 for (int ind = 0; ind < coords->length(); ind++)
1442 coords[ind] = currentEnfVertex->coords[ind];
1443 enfVertex->coords = coords;
1445 enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());
1447 BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
1448 faceEntryList->length(currentEnfVertex->faceEntries.size());
1449 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
1450 for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
1451 faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
1452 enfVertex->faceEntries = faceEntryList;
1455 msg << "Enforced vertex: \n"
1456 << "Name: " << enfVertex->name << "\n";
1457 if (coords->length())
1458 msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
1459 msg << "Geom entry: " << enfVertex->geomEntry << "\n"
1460 << "Group Name: " << enfVertex->grpName;
1463 resultMap[i] = enfVertex;
1465 return resultMap._retn();
1470 * Returns the list of enforced vertices coords for a given Face entry.
1471 * They are the coords of the "manual" enforced vertices.
1472 * @return A map of Face entry / List of enforced vertices coords
1475 BLSURFPlugin::TFaceEntryCoordsListMap* BLSURFPlugin_Hypothesis_i::GetAllCoordsByFace() {
1476 MESSAGE("IDL: GetAllCoordsByFace()");
1479 BLSURFPlugin::TFaceEntryCoordsListMap_var resultMap = new BLSURFPlugin::TFaceEntryCoordsListMap();
1481 const ::BLSURFPlugin_Hypothesis::TFaceEntryCoordsListMap entryCoordsListMap = this->GetImpl()->_GetAllCoordsByFace();
1482 resultMap->length(entryCoordsListMap.size());
1483 MESSAGE("Enforced Vertex map size is " << resultMap->length());
1485 ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList _coordsList;
1486 ::BLSURFPlugin_Hypothesis::TFaceEntryCoordsListMap::const_iterator it_entry = entryCoordsListMap.begin();
1487 for (int i = 0; it_entry != entryCoordsListMap.end(); ++it_entry, ++i) {
1488 BLSURFPlugin::TFaceEntryCoordsListMapElement_var mapElement = new BLSURFPlugin::TFaceEntryCoordsListMapElement();
1489 mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
1490 MESSAGE("Face Entry: " << mapElement->faceEntry);
1492 _coordsList = it_entry->second;
1493 BLSURFPlugin::TEnfVertexCoordsList_var coordsList = new BLSURFPlugin::TEnfVertexCoordsList();
1494 coordsList->length(_coordsList.size());
1495 MESSAGE("Number of coords: " << coordsList->length());
1497 ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList::const_iterator it_coords = _coordsList.begin();
1498 for (int j = 0; it_coords != _coordsList.end(); ++it_coords, ++j) {
1499 BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
1500 coords->length((*it_coords).size());
1501 for (int i=0;i<coords->length();i++)
1502 coords[i] = (*it_coords)[i];
1503 coordsList[j] = coords;
1504 MESSAGE("Coords #" << j << ": " << coords[0] << ", " << coords[1] << ", " << coords[2]);
1506 mapElement->coordsList = coordsList;
1508 resultMap[i] = mapElement;
1511 return resultMap._retn();
1515 * Returns a map of enforced vertices coords / enforced vertex.
1516 * They are the coords of the "manual" enforced vertices.
1518 BLSURFPlugin::TCoordsEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByCoords() {
1519 MESSAGE("IDL: GetAllEnforcedVerticesByCoords()");
1522 BLSURFPlugin::TCoordsEnfVertexMap_var resultMap = new BLSURFPlugin::TCoordsEnfVertexMap();
1523 const ::BLSURFPlugin_Hypothesis::TCoordsEnfVertexMap coordsEnfVertexMap =
1524 this->GetImpl()->_GetAllEnforcedVerticesByCoords();
1525 resultMap->length(coordsEnfVertexMap.size());
1526 MESSAGE("Enforced Vertex map size is " << resultMap->length());
1528 ::BLSURFPlugin_Hypothesis::TCoordsEnfVertexMap::const_iterator it_coords = coordsEnfVertexMap.begin();
1529 ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
1530 for (int i = 0; it_coords != coordsEnfVertexMap.end(); ++it_coords, ++i) {
1531 MESSAGE("Enforced Vertex #" << i);
1532 currentEnfVertex = (it_coords->second);
1533 BLSURFPlugin::TCoordsEnfVertexElement_var mapElement = new BLSURFPlugin::TCoordsEnfVertexElement();
1534 BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
1535 coords->length(it_coords->first.size());
1536 for (int ind=0;ind<coords->length();ind++)
1537 coords[ind] = it_coords->first[ind];
1538 mapElement->coords = coords;
1539 MESSAGE("Coords: " << mapElement->coords[0] << ", " << mapElement->coords[1] << ", " << mapElement->coords[2]);
1541 BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
1543 enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
1545 enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
1547 BLSURFPlugin::TEnfVertexCoords_var coords2 = new BLSURFPlugin::TEnfVertexCoords();
1548 coords2->length(currentEnfVertex->coords.size());
1549 for (int ind=0;ind<coords2->length();ind++)
1550 coords2[ind] = currentEnfVertex->coords[ind];
1551 enfVertex->coords = coords2;
1553 enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());
1555 BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
1556 faceEntryList->length(currentEnfVertex->faceEntries.size());
1557 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
1558 for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
1559 faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
1560 enfVertex->faceEntries = faceEntryList;
1562 mapElement->enfVertex = enfVertex;
1564 msg << "Enforced vertex: \n"
1565 << "Name: " << enfVertex->name << "\n";
1566 if (coords->length())
1567 msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
1568 msg << "Geom entry: " << enfVertex->geomEntry << "\n"
1569 << "Group Name: " << enfVertex->grpName;
1572 resultMap[i] = mapElement;
1574 return resultMap._retn();
1578 * Returns the list of enforced vertices entries for a given Face entry.
1579 * They are the geom entries of the enforced vertices based on geom shape (vertex, compound, group).
1580 * @return A map of Face entry / List of enforced vertices geom entries
1583 BLSURFPlugin::TFaceEntryEnfVertexEntryListMap* BLSURFPlugin_Hypothesis_i::GetAllEnfVertexEntriesByFace() {
1584 MESSAGE("IDL: GetAllEnfVertexEntriesByFace()");
1587 BLSURFPlugin::TFaceEntryEnfVertexEntryListMap_var resultMap = new BLSURFPlugin::TFaceEntryEnfVertexEntryListMap();
1589 const ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexEntryListMap entryEnfVertexEntryListMap =
1590 this->GetImpl()->_GetAllEnfVertexEntriesByFace();
1591 resultMap->length(entryEnfVertexEntryListMap.size());
1592 MESSAGE("Enforced Vertex map size is " << resultMap->length());
1594 ::BLSURFPlugin_Hypothesis::TEntryList _enfVertexEntryList;
1595 ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexEntryListMap::const_iterator it_entry =
1596 entryEnfVertexEntryListMap.begin();
1597 for (int i = 0; it_entry != entryEnfVertexEntryListMap.end(); ++it_entry, ++i) {
1598 BLSURFPlugin::TFaceEntryEnfVertexEntryListMapElement_var mapElement =
1599 new BLSURFPlugin::TFaceEntryEnfVertexEntryListMapElement();
1600 mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
1601 MESSAGE("Face Entry: " << mapElement->faceEntry);
1603 _enfVertexEntryList = it_entry->second;
1604 BLSURFPlugin::TEntryList_var enfVertexEntryList = new BLSURFPlugin::TEntryList();
1605 enfVertexEntryList->length(_enfVertexEntryList.size());
1606 MESSAGE("Number of enf vertex entries: " << enfVertexEntryList->length());
1608 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_enfVertexEntry = _enfVertexEntryList.begin();
1609 for (int j = 0; it_enfVertexEntry != _enfVertexEntryList.end(); ++it_enfVertexEntry, ++j) {
1610 enfVertexEntryList[j] = CORBA::string_dup((*it_enfVertexEntry).c_str());
1611 MESSAGE("Enf Vertex Entry #" << j << ": " << enfVertexEntryList[j]);
1613 mapElement->enfVertexEntryList = enfVertexEntryList;
1615 resultMap[i] = mapElement;
1618 return resultMap._retn();
1622 * Returns a map of enforced vertices geom entry / enforced vertex.
1623 * They are the geom entries of the enforced vertices defined with geom shape (vertex, compound, group).
1625 BLSURFPlugin::TEnfVertexEntryEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByEnfVertexEntry() {
1626 MESSAGE("IDL: GetAllEnforcedVerticesByEnfVertexEntry()");
1629 BLSURFPlugin::TEnfVertexEntryEnfVertexMap_var resultMap = new BLSURFPlugin::TEnfVertexEntryEnfVertexMap();
1630 const ::BLSURFPlugin_Hypothesis::TEnfVertexEntryEnfVertexMap enfVertexEntryEnfVertexMap =
1631 this->GetImpl()->_GetAllEnforcedVerticesByEnfVertexEntry();
1632 resultMap->length(enfVertexEntryEnfVertexMap.size());
1633 MESSAGE("Enforced Vertex map size is " << resultMap->length());
1635 ::BLSURFPlugin_Hypothesis::TEnfVertexEntryEnfVertexMap::const_iterator it_enfVertexEntry = enfVertexEntryEnfVertexMap.begin();
1636 ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
1637 for (int i = 0; it_enfVertexEntry != enfVertexEntryEnfVertexMap.end(); ++it_enfVertexEntry, ++i) {
1638 MESSAGE("Enforced Vertex #" << i);
1639 currentEnfVertex = it_enfVertexEntry->second;
1640 BLSURFPlugin::TEnfVertexEntryEnfVertexElement_var mapElement = new BLSURFPlugin::TEnfVertexEntryEnfVertexElement();
1641 mapElement->enfVertexEntry = CORBA::string_dup(it_enfVertexEntry->first.c_str());;
1642 MESSAGE("Enf Vertex Entry #" << i << ": " << mapElement->enfVertexEntry);
1644 BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
1646 enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
1648 enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
1650 BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
1651 coords->length(currentEnfVertex->coords.size());
1652 for (int ind=0;ind<coords->length();ind++)
1653 coords[ind] = currentEnfVertex->coords[ind];
1654 enfVertex->coords = coords;
1656 enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());
1658 BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
1659 faceEntryList->length(currentEnfVertex->faceEntries.size());
1660 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
1661 for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
1662 faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
1663 enfVertex->faceEntries = faceEntryList;
1666 msg << "Enforced vertex: \n"
1667 << "Name: " << enfVertex->name << "\n";
1668 if (coords->length())
1669 msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
1670 msg << "Geom entry: " << enfVertex->geomEntry << "\n"
1671 << "Group Name: " << enfVertex->grpName;
1674 mapElement->enfVertex = enfVertex;
1675 resultMap[i] = mapElement;
1677 return resultMap._retn();
1681 * Erase all enforced vertices
1683 void BLSURFPlugin_Hypothesis_i::ClearAllEnforcedVertices() {
1685 this->GetImpl()->ClearAllEnforcedVertices();
1686 SMESH::TPythonDump() << _this() << ".ClearAllEnforcedVertices()";
1690 * Set/get/unset an enforced vertex on face
1692 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
1693 CORBA::Double z) throw (SALOME::SALOME_Exception) {
1696 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
1697 MESSAGE("theFace shape type is not FACE or COMPOUND");
1698 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
1701 string theFaceEntry = theFace->GetStudyEntry();
1703 if (theFaceEntry.empty()) {
1704 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1705 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1707 if (theFace->GetShapeType() == GEOM::FACE)
1709 if (theFace->GetShapeType() == GEOM::COMPOUND)
1710 aName = "Compound_";
1711 aName += theFace->GetEntry();
1712 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1713 if (!theSFace->_is_nil())
1714 theFaceEntry = theSFace->GetID();
1716 if (theFaceEntry.empty())
1717 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1718 MESSAGE("IDL : GetName : " << theFace->GetName());
1719 MESSAGE("IDL : SetEnforcedVertex( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ")");
1721 return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z);
1722 } catch (SALOME_Exception& ex) {
1723 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1728 * Set/get/unset an enforced vertex with name on face
1730 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
1731 CORBA::Double z, const char* theVertexName) throw (SALOME::SALOME_Exception) {
1734 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
1735 MESSAGE("theFace shape type is not FACE or COMPOUND");
1736 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
1739 string theFaceEntry = theFace->GetStudyEntry();
1741 if (theFaceEntry.empty()) {
1742 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1743 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1745 if (theFace->GetShapeType() == GEOM::FACE)
1747 if (theFace->GetShapeType() == GEOM::COMPOUND)
1748 aName = "Compound_";
1749 aName += theFace->GetEntry();
1750 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1751 if (!theSFace->_is_nil())
1752 theFaceEntry = theSFace->GetID();
1754 if (theFaceEntry.empty())
1755 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1757 MESSAGE("IDL : GetName : " << theFace->GetName());
1758 MESSAGE("IDL : SetEnforcedVertexNamed( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theVertexName << ")");
1760 return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, theVertexName);
1761 } catch (SALOME_Exception& ex) {
1762 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1767 * Set/get/unset an enforced vertex with geom object on face
1769 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
1770 throw (SALOME::SALOME_Exception) {
1773 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
1774 MESSAGE("theFace shape type is not FACE or COMPOUND");
1775 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
1778 if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
1779 MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
1780 THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
1783 // GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1784 // GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations(this->GetImpl()->GetStudyId());
1785 // if (CORBA::is_nil(measureOp))
1788 // CORBA::Double x, y, z;
1790 // measureOp->PointCoordinates(theVertex, x, y, z);
1792 string theFaceEntry = theFace->GetStudyEntry();
1793 string theVertexEntry = theVertex->GetStudyEntry();
1795 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1796 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1799 if (theFaceEntry.empty()) {
1800 if (theFace->GetShapeType() == GEOM::FACE)
1802 if (theFace->GetShapeType() == GEOM::COMPOUND)
1803 aName = "Compound_";
1804 aName += theFace->GetEntry();
1805 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1806 if (!theSFace->_is_nil())
1807 theFaceEntry = theSFace->GetID();
1809 if (theFaceEntry.empty())
1810 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1812 if (theVertexEntry.empty()) {
1813 if (theVertex->GetShapeType() == GEOM::VERTEX)
1815 if (theVertex->GetShapeType() == GEOM::COMPOUND)
1816 aName = "Compound_";
1817 aName += theVertex->GetEntry();
1818 SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
1819 if (!theSVertex->_is_nil())
1820 theVertexEntry = theSVertex->GetID();
1822 if (theVertexEntry.empty())
1823 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1825 string theVertexName = theVertex->GetName();
1826 MESSAGE("IDL : theFace->GetName : " << theFace->GetName());
1827 MESSAGE("IDL : theVertex->GetName : " << theVertexName);
1828 MESSAGE("IDL : SetEnforcedVertexGeom( "<< theFaceEntry << ", " << theVertexEntry<< ")");
1830 return SetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexName.c_str(), theVertexEntry.c_str());
1831 } catch (SALOME_Exception& ex) {
1832 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1837 * Set an enforced vertex with group name on face
1839 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
1840 throw (SALOME::SALOME_Exception)
1844 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
1845 MESSAGE("theFace shape type is not FACE or COMPOUND");
1846 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
1849 string theFaceEntry = theFace->GetStudyEntry();
1851 if (theFaceEntry.empty()) {
1852 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1853 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1855 if (theFace->GetShapeType() == GEOM::FACE)
1857 if (theFace->GetShapeType() == GEOM::COMPOUND)
1858 aName = "Compound_";
1859 aName += theFace->GetEntry();
1860 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1861 if (!theSFace->_is_nil())
1862 theFaceEntry = theSFace->GetID();
1864 if (theFaceEntry.empty())
1865 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1866 MESSAGE("IDL : GetName : " << theFace->GetName());
1867 MESSAGE("IDL : SetEnforcedVertexWithGroup( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theGroupName << ")");
1869 return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, "", "", theGroupName);
1870 } catch (SALOME_Exception& ex) {
1871 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1876 * Set an enforced vertex with name and group name on face
1878 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z,
1879 const char* theVertexName, const char* theGroupName)
1880 throw (SALOME::SALOME_Exception)
1884 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
1885 MESSAGE("theFace shape type is not FACE or COMPOUND");
1886 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
1889 string theFaceEntry = theFace->GetStudyEntry();
1891 if (theFaceEntry.empty()) {
1892 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1893 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1895 if (theFace->GetShapeType() == GEOM::FACE)
1897 if (theFace->GetShapeType() == GEOM::COMPOUND)
1898 aName = "Compound_";
1899 aName += theFace->GetEntry();
1900 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1901 if (!theSFace->_is_nil())
1902 theFaceEntry = theSFace->GetID();
1904 if (theFaceEntry.empty())
1905 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1906 MESSAGE("IDL : GetName : " << theFace->GetName());
1907 MESSAGE("IDL : SetEnforcedVertexNamedWithGroup( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theVertexName << ", " << theGroupName << ")");
1909 return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, theVertexName, "", theGroupName);
1910 } catch (SALOME_Exception& ex) {
1911 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1916 * Set an enforced vertex with geom entry and group name on face
1918 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
1919 throw (SALOME::SALOME_Exception)
1923 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
1924 MESSAGE("theFace shape type is not FACE or COMPOUND");
1925 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
1928 if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
1929 MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
1930 THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
1933 string theFaceEntry = theFace->GetStudyEntry();
1934 string theVertexEntry = theVertex->GetStudyEntry();
1936 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1937 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1940 if (theFaceEntry.empty()) {
1941 if (theFace->GetShapeType() == GEOM::FACE)
1943 if (theFace->GetShapeType() == GEOM::COMPOUND)
1944 aName = "Compound_";
1945 aName += theFace->GetEntry();
1946 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1947 if (!theSFace->_is_nil())
1948 theFaceEntry = theSFace->GetID();
1950 if (theFaceEntry.empty())
1951 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1953 if (theVertexEntry.empty()) {
1954 if (theVertex->GetShapeType() == GEOM::VERTEX)
1956 if (theVertex->GetShapeType() == GEOM::COMPOUND)
1957 aName = "Compound_";
1958 aName += theVertex->GetEntry();
1959 SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
1960 if (!theSVertex->_is_nil())
1961 theVertexEntry = theSVertex->GetID();
1963 if (theVertexEntry.empty())
1964 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1966 string theVertexName = theVertex->GetName();
1967 MESSAGE("IDL : theFace->GetName : " << theFace->GetName());
1968 MESSAGE("IDL : theVertex->GetName : " << theVertexName);
1969 MESSAGE("IDL : SetEnforcedVertexGeomWithGroup( "<< theFaceEntry << ", " << theVertexEntry<< ", " << theGroupName<< ")");
1971 return SetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexName.c_str(), theVertexEntry.c_str(), theGroupName);
1972 } catch (SALOME_Exception& ex) {
1973 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1977 //Enable internal enforced vertices on specific face if requested by user
1979 // * Are internal enforced vertices used for a face ?
1981 //CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace)
1982 // throw (SALOME::SALOME_Exception) {
1983 // ASSERT(myBaseImpl);
1985 // if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
1986 // MESSAGE("theFace shape type is not FACE or COMPOUND");
1987 // THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
1990 // string theFaceEntry = theFace->GetStudyEntry();
1992 // if (theFaceEntry.empty()) {
1993 // GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1994 // SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1996 // if (theFace->GetShapeType() == GEOM::FACE)
1998 // if (theFace->GetShapeType() == GEOM::COMPOUND)
1999 // aName = "Compound_";
2000 // aName += theFace->GetEntry();
2001 // SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2002 // if (!theSFace->_is_nil())
2003 // theFaceEntry = theSFace->GetID();
2005 // if (theFaceEntry.empty())
2006 // THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2008 // MESSAGE("IDL : GetName : " << theFace->GetName());
2009 // MESSAGE("IDL : GetInternalEnforcedVertexEntry ( "<< theFaceEntry << ")");
2011 // return GetInternalEnforcedVertexEntry(theFaceEntry.c_str());
2012 // } catch (SALOME_Exception& ex) {
2013 // THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2018 * Get the list of all enforced vertices
2020 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVertices(GEOM::GEOM_Object_ptr theFace)
2021 throw (SALOME::SALOME_Exception) {
2024 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2025 MESSAGE("theFace shape type is not FACE or COMPOUND");
2026 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2029 string theFaceEntry = theFace->GetStudyEntry();
2031 if (theFaceEntry.empty()) {
2032 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2033 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2035 if (theFace->GetShapeType() == GEOM::FACE)
2037 if (theFace->GetShapeType() == GEOM::COMPOUND)
2038 aName = "Compound_";
2039 aName += theFace->GetEntry();
2040 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2041 if (!theSFace->_is_nil())
2042 theFaceEntry = theSFace->GetID();
2044 if (theFaceEntry.empty())
2045 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2047 MESSAGE("IDL : GetName : " << theFace->GetName());
2048 MESSAGE("IDL : GetEnforcedVerticesEntry ( "<< theFaceEntry << ")");
2050 return GetEnforcedVerticesEntry(theFaceEntry.c_str());
2051 } catch (SALOME_Exception& ex) {
2052 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2056 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
2057 CORBA::Double z) throw (SALOME::SALOME_Exception) {
2060 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2061 MESSAGE("theFace shape type is not FACE or COMPOUND");
2062 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2065 string theFaceEntry = theFace->GetStudyEntry();
2067 if (theFaceEntry.empty()) {
2068 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2069 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2071 if (theFace->GetShapeType() == GEOM::FACE)
2073 if (theFace->GetShapeType() == GEOM::COMPOUND)
2074 aName = "Compound_";
2075 aName += theFace->GetEntry();
2076 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2077 if (!theSFace->_is_nil())
2078 theFaceEntry = theSFace->GetID();
2080 if (theFaceEntry.empty())
2081 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2082 MESSAGE("IDL : GetName : " << theFace->GetName());
2083 MESSAGE("IDL : UnsetEnforcedVertex ( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ")");
2086 return UnsetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z);
2087 } catch (SALOME_Exception& ex) {
2088 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2092 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
2093 throw (SALOME::SALOME_Exception) {
2096 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2097 MESSAGE("theFace shape type is not FACE or COMPOUND");
2098 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2100 if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
2101 MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
2102 THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
2105 // GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2106 // GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations(this->GetImpl()->GetStudyId());
2107 // if (CORBA::is_nil(measureOp))
2110 // CORBA::Double x, y, z;
2112 // measureOp->PointCoordinates(theVertex, x, y, z);
2114 std::string theFaceEntry = theFace->GetStudyEntry();
2115 std::string theVertexEntry = theVertex->GetStudyEntry();
2117 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2118 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2121 if (theFaceEntry.empty()) {
2122 if (theFace->GetShapeType() == GEOM::FACE)
2124 if (theFace->GetShapeType() == GEOM::COMPOUND)
2125 aName = "Compound_";
2126 aName += theFace->GetEntry();
2127 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2128 if (!theSFace->_is_nil())
2129 theFaceEntry = theSFace->GetID();
2131 if (theFaceEntry.empty())
2132 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2134 if (theVertexEntry.empty()) {
2135 if (theVertex->GetShapeType() == GEOM::VERTEX)
2137 if (theVertex->GetShapeType() == GEOM::COMPOUND)
2138 aName = "Compound_";
2139 aName += theVertex->GetEntry();
2140 SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
2141 if (!theSVertex->_is_nil())
2142 theVertexEntry = theSVertex->GetID();
2144 if (theVertexEntry.empty())
2145 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2147 MESSAGE("IDL : UnsetEnforcedVertexGeom ( "<< theFaceEntry << ", " << theVertexEntry << ")");
2150 return UnsetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexEntry.c_str());
2151 } catch (SALOME_Exception& ex) {
2152 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2156 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception) {
2159 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2160 MESSAGE("theFace shape type is not FACE or COMPOUND");
2161 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2164 string theFaceEntry = theFace->GetStudyEntry();
2166 if (theFaceEntry.empty()) {
2167 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2168 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2170 if (theFace->GetShapeType() == GEOM::FACE)
2172 if (theFace->GetShapeType() == GEOM::COMPOUND)
2173 aName = "Compound_";
2174 aName += theFace->GetEntry();
2175 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2176 if (!theSFace->_is_nil())
2177 theFaceEntry = theSFace->GetID();
2179 if (theFaceEntry.empty())
2180 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2182 MESSAGE("IDL : GetName : " << theFace->GetName());
2183 MESSAGE("IDL : UnsetEnforcedVertices ( "<< theFaceEntry << ")");
2186 return UnsetEnforcedVerticesEntry(theFaceEntry.c_str());
2187 } catch (SALOME_Exception& ex) {
2188 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2193 * Set/get/unset an enforced vertex on geom object given by entry
2195 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y,
2196 CORBA::Double z, const char* theVertexName, const char* theVertexEntry, const char* theGroupName)
2197 throw (SALOME::SALOME_Exception) {
2199 MESSAGE("IDL : SetEnforcedVertexEntry(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theVertexName << "\", \"" << theVertexEntry << "\", \"" << theGroupName << "\")");
2200 bool newValue = false;
2201 if (string(theVertexEntry).empty()) {
2203 ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList coordsList =
2204 this->GetImpl()->GetEnfVertexCoordsList(theFaceEntry);
2205 ::BLSURFPlugin_Hypothesis::TEnfVertexCoords coords;
2206 coords.push_back(x);
2207 coords.push_back(y);
2208 coords.push_back(z);
2209 if (coordsList.find(coords) == coordsList.end()) {
2210 MESSAGE("Coords not found: add it in coordsList");
2213 MESSAGE("Coords already found, compare names");
2214 ::BLSURFPlugin_Hypothesis::TEnfVertex *enfVertex = this->GetImpl()->GetEnfVertex(coords);
2215 if ((enfVertex->name != theVertexName) || (enfVertex->grpName != theGroupName)) {
2216 MESSAGE("The names are different: update");
2217 // this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z);
2221 MESSAGE("The names are identical");
2224 } catch (const std::invalid_argument& ex) {
2225 // no enforced vertex for entry
2226 MESSAGE("Face entry not found : add it to the list");
2230 if (string(theVertexName).empty())
2231 if (string(theGroupName).empty())
2232 SMESH::TPythonDump() << _this() << ".SetEnforcedVertex(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ")";
2234 SMESH::TPythonDump() << _this() << ".SetEnforcedVertexWithGroup(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theGroupName << "\")";
2236 if (string(theGroupName).empty())
2237 SMESH::TPythonDump() << _this() << ".SetEnforcedVertexNamed(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theVertexName << "\")";
2239 SMESH::TPythonDump() << _this() << ".SetEnforcedVertexNamedWithGroup(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \""
2240 << theVertexName << "\", \"" << theGroupName << "\")";
2243 ::BLSURFPlugin_Hypothesis::TEntryList enfVertexEntryList = this->GetImpl()->GetEnfVertexEntryList(theFaceEntry);
2244 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it = enfVertexEntryList.find(theVertexEntry);
2245 if ( it == enfVertexEntryList.end()) {
2246 MESSAGE("Geom entry not found: add it in enfVertexEntryList");
2250 MESSAGE("Geom entry already found, compare names");
2251 ::BLSURFPlugin_Hypothesis::TEnfVertex *enfVertex = this->GetImpl()->GetEnfVertex((*it));
2252 if ((enfVertex->name != theVertexName) || (enfVertex->grpName != theGroupName)) {
2253 MESSAGE("The names are different: update");
2254 // this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z);
2258 MESSAGE("The names are identical");
2261 } catch (const std::invalid_argument& ex) {
2262 // no enforced vertex for entry
2263 MESSAGE("Face entry not found : add it to the list");
2267 if (string(theGroupName).empty())
2268 SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGeom(" << theFaceEntry << ", " << theVertexEntry << ")";
2270 SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGeomWithGroup(" << theFaceEntry << ", " << theVertexEntry << ", \"" << theGroupName << "\")";
2274 this->GetImpl()->SetEnforcedVertex(theFaceEntry, theVertexName, theVertexEntry, theGroupName, x, y, z);
2276 MESSAGE("IDL : SetEnforcedVertexEntry END");
2280 //Enable internal enforced vertices on specific face if requested by user
2281 //CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexEntry(const char* theFaceEntry)
2282 // throw (SALOME::SALOME_Exception) {
2283 // ASSERT(myBaseImpl);
2285 // return this->GetImpl()->GetInternalEnforcedVertex(theFaceEntry);
2286 // } catch (const std::exception& ex) {
2287 // std::cout << "Exception: " << ex.what() << std::endl;
2288 // THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2292 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(const char* entry)
2293 throw (SALOME::SALOME_Exception) {
2295 MESSAGE("ENGINE : GetEnforcedVerticesEntry START ENTRY : " << entry);
2298 BLSURFPlugin::TEnfVertexList_var vertexList = new BLSURFPlugin::TEnfVertexList();
2299 ::BLSURFPlugin_Hypothesis::TEnfVertexList _vList = this->GetImpl()->GetEnfVertexList(entry);
2300 vertexList->length(_vList.size());
2301 MESSAGE("Number of enforced vertices: " << vertexList->length());
2302 ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = _vList.begin();
2303 for (int i = 0; evlIt != _vList.end(); ++evlIt, ++i) {
2304 ::BLSURFPlugin_Hypothesis::TEnfVertex *_enfVertex = (*evlIt);
2306 BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
2309 enfVertex->name = CORBA::string_dup(_enfVertex->name.c_str());
2310 // Geom Vertex Entry
2311 enfVertex->geomEntry = CORBA::string_dup(_enfVertex->geomEntry.c_str());
2313 BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
2314 coords->length(_enfVertex->coords.size());
2315 for (int ind=0;ind<coords->length();ind++)
2316 coords[ind] = _enfVertex->coords[ind];
2317 enfVertex->coords = coords;
2319 enfVertex->grpName = CORBA::string_dup(_enfVertex->grpName.c_str());
2321 BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
2322 faceEntryList->length(_enfVertex->faceEntries.size());
2323 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = _enfVertex->faceEntries.begin();
2324 for (int ind = 0; it_entry != _enfVertex->faceEntries.end();++it_entry, ++ind)
2325 faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
2326 enfVertex->faceEntries = faceEntryList;
2328 vertexList[i] = enfVertex;
2330 MESSAGE("ENGINE : GetEnforcedVerticesEntry END ENTRY : " << entry);
2331 return vertexList._retn();
2332 } catch (const std::invalid_argument& ex) {
2333 SALOME::ExceptionStruct ExDescription;
2334 ExDescription.text = ex.what();
2335 ExDescription.type = SALOME::BAD_PARAM;
2336 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(entry)";
2337 ExDescription.lineNumber = 1385;
2338 throw SALOME::SALOME_Exception(ExDescription);
2339 } catch (const std::exception& ex) {
2340 std::cout << "Exception: " << ex.what() << std::endl;
2341 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2345 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y,
2346 CORBA::Double z, const char* theVertexEntry) throw (SALOME::SALOME_Exception) {
2348 MESSAGE("IDL : UnsetEnforcedVertexEntry(" << theFaceEntry << "," << x << "," << y << "," << z << ", " << theVertexEntry << ")");
2352 res = this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z, theVertexEntry);
2354 if (string(theVertexEntry).empty())
2355 SMESH::TPythonDump() << "isDone = " << _this() << ".UnsetEnforcedVertex(" << theFaceEntry << ", " << x << ", " << y << ", " << z
2358 SMESH::TPythonDump() << "isDone = " << _this() << ".UnsetEnforcedVertexGeom(" << theFaceEntry << ", " << theVertexEntry << ")";
2360 } catch (const std::invalid_argument& ex) {
2362 } catch (const std::exception& ex) {
2363 std::cout << "Exception: " << ex.what() << std::endl;
2364 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2367 MESSAGE("ENGINE : UnsetEnforcedVertexEntry END ENTRY : " << theFaceEntry);
2371 //bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntryWithPoint(const char* theFaceEntry, const char* theVertexEntry,
2372 // CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception) {
2373 // MESSAGE("IDL : UnsetEnforcedVertexEntryWithPoint START theFaceEntry=" << theFaceEntry << ", theVertexEntry=" << theVertexEntry);
2375 // bool ret = false;
2378 // ret = _unsetEnfVertex(theFaceEntry, x, y, z);
2379 // } catch (SALOME_Exception& ex) {
2380 // THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2384 // SMESH::TPythonDump() << _this() << ".UnsetEnforcedVertexWithPoint(" << theFaceEntry << ", " << theVertexEntry
2387 // MESSAGE("IDL : UnsetEnforcedVertexEntryWithPoint END ENTRY : " << theFaceEntry);
2391 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception) {
2393 MESSAGE("IDL : UnsetEnforcedVerticesEntry(" << theFaceEntry << ")");
2396 this->GetImpl()->ClearEnforcedVertices(theFaceEntry);
2397 SMESH::TPythonDump() << _this() << ".UnsetEnforcedVertices(" << theFaceEntry << ")";
2398 } catch (const std::invalid_argument& ex) {
2400 } catch (const std::exception& ex) {
2401 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2404 MESSAGE("IDL : UnsetEnforcedVerticesEntry END ENTRY : " << theFaceEntry);
2408 //=============================================================================
2410 * BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces
2414 //=============================================================================
2415 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces(CORBA::Boolean theValue) {
2416 MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces");
2418 this->GetImpl()->SetInternalEnforcedVertexAllFaces(theValue);
2419 std::string theValueStr = theValue ? "True" : "False";
2420 SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexAllFaces( " << theValueStr.c_str() << " )";
2423 //=============================================================================
2425 * BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces
2429 //=============================================================================
2430 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces() {
2431 MESSAGE("BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces");
2433 return this->GetImpl()->_GetInternalEnforcedVertexAllFaces();
2436 //=============================================================================
2438 * BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup
2442 //=============================================================================
2443 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup(const char* groupName) {
2444 MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup");
2446 this->GetImpl()->SetInternalEnforcedVertexAllFacesGroup(groupName);
2447 SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexAllFacesGroup( \"" << groupName << "\" )";
2450 //=============================================================================
2452 * BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup
2456 //=============================================================================
2457 char* BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup() {
2458 MESSAGE("BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup");
2460 return CORBA::string_dup(this->GetImpl()->_GetInternalEnforcedVertexAllFacesGroup().c_str());
2464 * Enable internal enforced vertices on specific face if requested by user
2466 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices)
2467 throw (SALOME::SALOME_Exception)
2469 MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFace");
2471 SetInternalEnforcedVertexWithGroup(theFace, toEnforceInternalVertices);
2472 } catch (SALOME_Exception& ex) {
2473 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2477 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName)
2478 throw (SALOME::SALOME_Exception)
2480 MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFaceWithGroup");
2482 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2483 MESSAGE("theFace shape type is not FACE or COMPOUND");
2484 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2487 string theFaceEntry = theFace->GetStudyEntry();
2489 if (theFaceEntry.empty()) {
2490 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2491 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2493 if (theFace->GetShapeType() == GEOM::FACE)
2495 if (theFace->GetShapeType() == GEOM::COMPOUND)
2496 aName = "Compound_";
2497 aName += theFace->GetEntry();
2498 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2499 if (!theSFace->_is_nil())
2500 theFaceEntry = theSFace->GetID();
2502 if (theFaceEntry.empty())
2503 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2505 MESSAGE("IDL : GetName : " << theFace->GetName());
2506 MESSAGE("IDL : GetInternalEnforcedVertexEntry ( "<< theFaceEntry << ")");
2508 SetInternalEnforcedVertexEntry(theFaceEntry.c_str(), toEnforceInternalVertices, theGroupName);
2509 } catch (SALOME_Exception& ex) {
2510 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2514 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName)
2515 throw (SALOME::SALOME_Exception)
2517 MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFaceEntry");
2520 this->GetImpl()->SetInternalEnforcedVertex(theFaceEntry, toEnforceInternalVertices, theGroupName);
2521 std::string theValueStr = toEnforceInternalVertices ? "True" : "False";
2522 if (string(theGroupName).empty())
2523 SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertex( " << theFaceEntry << ", " << theValueStr.c_str() << " )";
2525 SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexWithGroup( " << theFaceEntry << ", " << theValueStr.c_str() << ", \"" << theGroupName << "\" )";
2526 } catch (const std::exception& ex) {
2527 std::cout << "Exception: " << ex.what() << std::endl;
2528 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2535 char* BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z)
2536 throw (SALOME::SALOME_Exception)
2539 MESSAGE("ENGINE : GetEnforcedVertexGroupName START ");
2541 return CORBA::string_dup( this->GetImpl()->GetEnforcedVertexGroupName(x, y, z).c_str());
2543 catch (const std::invalid_argument& ex) {
2544 SALOME::ExceptionStruct ExDescription;
2545 ExDescription.text = ex.what();
2546 ExDescription.type = SALOME::BAD_PARAM;
2547 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(entry)";
2548 ExDescription.lineNumber = 1146;
2549 throw SALOME::SALOME_Exception(ExDescription);
2551 catch (SALOME_Exception& ex) {
2552 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2554 MESSAGE("ENGINE : GetEnforcedVertexGroupName END ");
2559 void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* groupName)
2560 throw (SALOME::SALOME_Exception)
2563 MESSAGE("ENGINE : SetEnforcedVertexGroupName START ");
2565 this->GetImpl()->SetEnforcedVertexGroupName(x, y, z, groupName);
2567 catch (const std::invalid_argument& ex) {
2568 SALOME::ExceptionStruct ExDescription;
2569 ExDescription.text = ex.what();
2570 ExDescription.type = SALOME::BAD_PARAM;
2571 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetEnforcedVertexGroupName(x,y,z)";
2572 ExDescription.lineNumber = 1170;
2573 throw SALOME::SALOME_Exception(ExDescription);
2575 catch (SALOME_Exception& ex) {
2576 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2579 SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGroupName("
2580 << x << ", " << y << ", " << z << ", '" << groupName << "' )";
2582 MESSAGE("ENGINE : SetEnforcedVertexGroupName END ");
2585 ///////////////////////
2588 //================================================================================
2590 * \brief Sets the file for export resulting mesh in GMF format
2591 * \param theFileName - full name of the file (.mesh, .meshb)
2593 * After compute, export the resulting mesh in the given file with the GMF format (.mesh)
2595 //================================================================================
2596 // void BLSURFPlugin_Hypothesis_i::SetGMFFile(const char* theFileName, CORBA::Boolean isBinary) {
2597 void BLSURFPlugin_Hypothesis_i::SetGMFFile(const char* theFileName) {
2599 MESSAGE("IDL : SetGMFFile(" << theFileName << ")");
2600 bool valueChanged/*, modeChanged*/ = false;
2602 valueChanged = (this->GetImpl()->GetGMFFile() != theFileName);
2603 // modeChanged = (this->GetImpl()->GetGMFFileMode() != isBinary);
2604 if (valueChanged)// or (!valueChanged && modeChanged))
2605 this->GetImpl()->SetGMFFile(theFileName);// ,isBinary);
2606 } catch (const std::exception& ex) {
2607 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2609 if (valueChanged)// or (!valueChanged && modeChanged))
2610 SMESH::TPythonDump() << _this() << ".SetGMFFile(\"" << theFileName << "\")"; //", " << isBinary << ")";
2611 MESSAGE("IDL : SetGMFFile END ");
2614 //================================================================================
2616 * \brief Gets the file name for export resulting mesh in GMF format
2617 * \retval char* - The file name
2619 * Returns the GMF file name
2621 //================================================================================
2622 char* BLSURFPlugin_Hypothesis_i::GetGMFFile() {
2624 // MESSAGE("IDL : GetGMFFile()");
2625 return CORBA::string_dup(this->GetImpl()->GetGMFFile().c_str());
2628 // //================================================================================
2630 // * \brief Gets the file mode for export resulting mesh in GMF format
2631 // * \retval CORBA::Boolean - TRUE if binary mode, FALSE if ascii mode
2633 // * Returns the GMF file mode
2635 // //================================================================================
2636 // CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetGMFFileMode() {
2637 // ASSERT(myBaseImpl);
2638 // MESSAGE("IDL : GetGMFFileMode()");
2639 // return this->GetImpl()->GetGMFFileMode();
2642 //=============================================================================
2644 * BLSURFPlugin_Hypothesis_i::GetImpl
2646 * Get implementation
2648 //=============================================================================
2649 ::BLSURFPlugin_Hypothesis* BLSURFPlugin_Hypothesis_i::GetImpl() {
2650 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetImpl");
2651 return (::BLSURFPlugin_Hypothesis*) myBaseImpl;
2654 //================================================================================
2656 * \brief Verify whether hypothesis supports given entity type
2657 * \param type - dimension (see SMESH::Dimension enumeration)
2658 * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
2660 * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
2662 //================================================================================
2663 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsDimSupported(SMESH::Dimension type) {
2664 return type == SMESH::DIM_2D;
2668 // Obsolete methods - To be removed in V7
2671 void BLSURFPlugin_Hypothesis_i::SetPhyMin(CORBA::Double theMinSize) {
2672 this->SetMinSize(theMinSize);
2674 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMin() {
2675 return this->GetMinSize();
2677 void BLSURFPlugin_Hypothesis_i::SetPhyMax(CORBA::Double theMaxSize) {
2678 this->SetMaxSize(theMaxSize);
2680 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMax() {
2681 return this->GetMaxSize();
2683 void BLSURFPlugin_Hypothesis_i::SetGeoMin(CORBA::Double theMinSize) {
2684 this->SetMinSize(theMinSize);
2686 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMin() {
2687 return this->GetMinSize();
2689 void BLSURFPlugin_Hypothesis_i::SetGeoMax(CORBA::Double theMaxSize) {
2690 this->SetMaxSize(theMaxSize);
2692 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMax() {
2693 return this->GetMaxSize();
2695 void BLSURFPlugin_Hypothesis_i::SetAngleMeshS(CORBA::Double theValue) {
2696 this->SetAngleMesh(theValue);
2698 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshS() {
2699 return this->GetAngleMesh();
2701 void BLSURFPlugin_Hypothesis_i::SetAngleMeshC(CORBA::Double theValue) {
2702 this->SetAngleMesh(theValue);
2704 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshC() {
2705 return this->GetAngleMesh();
2707 void BLSURFPlugin_Hypothesis_i::SetDecimesh(CORBA::Boolean theValue) {
2708 std::string theValueStr = theValue ? "1" : "0";
2709 this->SetOptionValue("respect_geometry",theValueStr.c_str());
2711 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetDecimesh() {
2712 std::string theValueStr = this->GetOptionValue("respect_geometry");
2713 if (theValueStr.empty() || theValueStr == "respect")
2717 void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveNanoEdges(CORBA::Boolean theValue) {
2718 std::string theValueStr = theValue ? "1" : "0";
2719 this->SetPreCADOptionValue("remove_tiny_edges",theValueStr.c_str());
2721 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveNanoEdges() {
2722 std::string theValueStr = this->GetPreCADOptionValue("remove_tiny_edges");
2723 if (theValueStr == "1")
2727 void BLSURFPlugin_Hypothesis_i::SetPreCADEpsNano(CORBA::Double theValue) {
2728 std::ostringstream theValueStr;
2729 theValueStr << theValue;
2730 this->SetPreCADOptionValue("tiny_edge_length",theValueStr.str().c_str());
2732 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPreCADEpsNano() {
2733 std::istringstream theValueStr(this->GetPreCADOptionValue("tiny_edge_length"));
2735 theValueStr >> result;