1 // Copyright (C) 2007-2012 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"
27 #include "SMESH_Gen.hxx"
28 #include "SMESH_Gen_i.hxx"
29 #include "SMESH_PythonDump.hxx"
30 #include "GEOM_Object.hxx"
32 #include "Utils_CorbaException.hxx"
33 #include "utilities.h"
37 #include "boost/regex.hpp"
39 //=============================================================================
41 * BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i
45 //=============================================================================
46 BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA, int theStudyId,
47 ::SMESH_Gen* theGenImpl) :
48 SALOME::GenericObj_i(thePOA), SMESH_Hypothesis_i(thePOA) {
49 MESSAGE( "BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i" );
50 myBaseImpl = new ::BLSURFPlugin_Hypothesis(theGenImpl->GetANewId(), theStudyId, theGenImpl);
53 //=============================================================================
55 * BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i
59 //=============================================================================
60 BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i() {
61 MESSAGE( "BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i" );
64 //=============================================================================
66 //=============================================================================
68 * BLSURFPlugin_Hypothesis_i::SetPhysicalMesh
73 //=============================================================================
74 void BLSURFPlugin_Hypothesis_i::SetPhysicalMesh(CORBA::Long theValue) {
75 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhysicalMesh");
77 this->GetImpl()->SetPhysicalMesh((::BLSURFPlugin_Hypothesis::PhysicalMesh) theValue);
78 SMESH::TPythonDump() << _this() << ".SetPhysicalMesh( " << theValue << " )";
81 //=============================================================================
83 * BLSURFPlugin_Hypothesis_i::GetPhysicalMesh
87 //=============================================================================
88 CORBA::Long BLSURFPlugin_Hypothesis_i::GetPhysicalMesh() {
89 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhysicalMesh");
91 return this->GetImpl()->GetPhysicalMesh();
94 //=============================================================================
96 * BLSURFPlugin_Hypothesis_i::SetGeometricMesh
101 //=============================================================================
102 void BLSURFPlugin_Hypothesis_i::SetGeometricMesh(CORBA::Long theValue) {
103 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGeometricMesh");
105 this->GetImpl()->SetGeometricMesh((::BLSURFPlugin_Hypothesis::GeometricMesh) theValue);
106 SMESH::TPythonDump() << _this() << ".SetGeometricMesh( " << theValue << " )";
109 //=============================================================================
111 * BLSURFPlugin_Hypothesis_i::GetGeometricMesh
115 //=============================================================================
116 CORBA::Long BLSURFPlugin_Hypothesis_i::GetGeometricMesh() {
117 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGeometricMesh");
119 return this->GetImpl()->GetGeometricMesh();
122 //=============================================================================
124 * BLSURFPlugin_Hypothesis_i::SetPhySize
128 //=============================================================================
129 void BLSURFPlugin_Hypothesis_i::SetPhySize(CORBA::Double theValue) {
130 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySize");
132 this->GetImpl()->SetPhySize(theValue, false);
133 SMESH::TPythonDump() << _this() << ".SetPhySize( " << theValue << " )";
136 //=============================================================================
138 * BLSURFPlugin_Hypothesis_i::SetPhySizeRel
140 * Set Relative PhySize
142 //=============================================================================
143 void BLSURFPlugin_Hypothesis_i::SetPhySizeRel(CORBA::Double theValue) {
144 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySizeRel");
146 this->GetImpl()->SetPhySize(theValue, true);
147 SMESH::TPythonDump() << _this() << ".SetPhySize( " << theValue << ", isRelative = True )";
150 //=============================================================================
152 * BLSURFPlugin_Hypothesis_i::GetPhySize
156 //=============================================================================
157 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhySize() {
158 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhySize");
160 return this->GetImpl()->GetPhySize();
163 //=============================================================================
165 * BLSURFPlugin_Hypothesis_i::IsPhySizeRel
167 * Returns True if PhySize is relative
169 //=============================================================================
170 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsPhySizeRel() {
171 // MESSAGE("BLSURFPlugin_Hypothesis_i::IsPhySizeRel");
173 return this->GetImpl()->IsPhySizeRel();
176 //=============================================================================
177 void BLSURFPlugin_Hypothesis_i::SetMinSize(CORBA::Double theMinSize) {
179 if (GetMinSize() != theMinSize) {
180 this->GetImpl()->SetMinSize(theMinSize, false);
181 SMESH::TPythonDump() << _this() << ".SetMinSize( " << theMinSize << " )";
185 //=============================================================================
186 void BLSURFPlugin_Hypothesis_i::SetMinSizeRel(CORBA::Double theMinSize) {
188 if ( IsMinSizeRel() && (GetMinSize() != theMinSize) ) {
189 this->GetImpl()->SetMinSize(theMinSize, true);
190 SMESH::TPythonDump() << _this() << ".SetMinSize( " << theMinSize << ", isRelative = True )";
194 //=============================================================================
195 CORBA::Double BLSURFPlugin_Hypothesis_i::GetMinSize() {
197 return this->GetImpl()->GetMinSize();
200 //=============================================================================
201 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMinSizeRel() {
202 // MESSAGE("BLSURFPlugin_Hypothesis_i::IsMinSizeRel");
204 return this->GetImpl()->IsMinSizeRel();
207 //=============================================================================
208 void BLSURFPlugin_Hypothesis_i::SetMaxSize(CORBA::Double theMaxSize) {
210 if (GetMaxSize() != theMaxSize) {
211 this->GetImpl()->SetMaxSize(theMaxSize, false);
212 SMESH::TPythonDump() << _this() << ".SetMaxSize( " << theMaxSize << " )";
216 //=============================================================================
217 void BLSURFPlugin_Hypothesis_i::SetMaxSizeRel(CORBA::Double theMaxSize) {
219 if ( IsMaxSizeRel() && (GetMaxSize() != theMaxSize) ) {
220 this->GetImpl()->SetMaxSize(theMaxSize, true);
221 SMESH::TPythonDump() << _this() << ".SetMaxSize( " << theMaxSize << ", isRelative = True )";
225 //=============================================================================
226 CORBA::Double BLSURFPlugin_Hypothesis_i::GetMaxSize() {
228 return this->GetImpl()->GetMaxSize();
231 //=============================================================================
232 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMaxSizeRel() {
233 // MESSAGE("BLSURFPlugin_Hypothesis_i::IsMaxSizeRel");
235 return this->GetImpl()->IsMaxSizeRel();
238 //=============================================================================
240 * BLSURFPlugin_Hypothesis_i::SetGradation
244 //=============================================================================
245 void BLSURFPlugin_Hypothesis_i::SetGradation(CORBA::Double theValue) {
246 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGradation");
248 this->GetImpl()->SetGradation(theValue);
249 SMESH::TPythonDump() << _this() << ".SetGradation( " << theValue << " )";
252 //=============================================================================
254 * BLSURFPlugin_Hypothesis_i::GetGradation
258 //=============================================================================
259 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGradation() {
260 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGradation");
262 return this->GetImpl()->GetGradation();
265 //=============================================================================
267 * BLSURFPlugin_Hypothesis_i::SetQuadAllowed
271 //=============================================================================
272 void BLSURFPlugin_Hypothesis_i::SetQuadAllowed(CORBA::Boolean theValue) {
273 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetQuadAllowed");
275 this->GetImpl()->SetQuadAllowed(theValue);
276 std::string theValueStr = theValue ? "True" : "False";
277 SMESH::TPythonDump() << _this() << ".SetQuadAllowed( " << theValueStr.c_str() << " )";
280 //=============================================================================
282 * BLSURFPlugin_Hypothesis_i::GetQuadAllowed
286 //=============================================================================
287 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadAllowed() {
288 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetQuadAllowed");
290 return this->GetImpl()->GetQuadAllowed();
293 //=============================================================================
295 * BLSURFPlugin_Hypothesis_i::SetAngleMesh
299 //=============================================================================
300 void BLSURFPlugin_Hypothesis_i::SetAngleMesh(CORBA::Double theValue) {
301 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAngleMesh");
303 this->GetImpl()->SetAngleMesh(theValue);
304 SMESH::TPythonDump() << _this() << ".SetAngleMesh( " << theValue << " )";
307 //=============================================================================
309 * BLSURFPlugin_Hypothesis_i::GetAngleMesh
313 //=============================================================================
314 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMesh() {
315 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAngleMesh");
317 return this->GetImpl()->GetAngleMesh();
320 //=============================================================================
322 * BLSURFPlugin_Hypothesis_i::SetChordalError
326 //=============================================================================
327 void BLSURFPlugin_Hypothesis_i::SetChordalError(CORBA::Double theValue) {
328 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetChordalError");
330 this->GetImpl()->SetChordalError(theValue);
331 SMESH::TPythonDump() << _this() << ".SetChordalError( " << theValue << " )";
334 //=============================================================================
336 * BLSURFPlugin_Hypothesis_i::GetChordalError
340 //=============================================================================
341 CORBA::Double BLSURFPlugin_Hypothesis_i::GetChordalError() {
342 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetChordalError");
344 return this->GetImpl()->GetChordalError();
347 //=============================================================================
349 * BLSURFPlugin_Hypothesis_i::SetAnisotropic
353 //=============================================================================
354 void BLSURFPlugin_Hypothesis_i::SetAnisotropic(CORBA::Boolean theValue) {
355 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAnisotropic");
357 this->GetImpl()->SetAnisotropic(theValue);
358 std::string theValueStr = theValue ? "True" : "False";
359 SMESH::TPythonDump() << _this() << ".SetAnisotropic( " << theValueStr.c_str() << " )";
362 //=============================================================================
364 * BLSURFPlugin_Hypothesis_i::GetAnisotropic
368 //=============================================================================
369 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetAnisotropic() {
370 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAnisotropic");
372 return this->GetImpl()->GetAnisotropic();
375 //=============================================================================
377 * BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio
379 * Set Anisotropic Ratio
381 //=============================================================================
382 void BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio(CORBA::Double theValue) {
383 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio");
385 this->GetImpl()->SetAnisotropicRatio(theValue);
386 SMESH::TPythonDump() << _this() << ".SetAnisotropicRatio( " << theValue << " )";
389 //=============================================================================
391 * BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio
393 * Get Anisotropic Ratio
395 //=============================================================================
396 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio() {
397 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio");
399 return this->GetImpl()->GetAnisotropicRatio();
403 //=============================================================================
405 * BLSURFPlugin_Hypothesis_i::SetRemoveTinyEdges
409 //=============================================================================
410 void BLSURFPlugin_Hypothesis_i::SetRemoveTinyEdges(CORBA::Boolean theValue) {
411 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetRemoveTinyEdges");
413 this->GetImpl()->SetRemoveTinyEdges(theValue);
414 std::string theValueStr = theValue ? "True" : "False";
415 SMESH::TPythonDump() << _this() << ".SetRemoveTinyEdges( " << theValueStr.c_str() << " )";
418 //=============================================================================
420 * BLSURFPlugin_Hypothesis_i::GetRemoveTinyEdges
424 //=============================================================================
425 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetRemoveTinyEdges() {
426 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetRemoveTinyEdges");
428 return this->GetImpl()->GetRemoveTinyEdges();
431 //=============================================================================
433 * BLSURFPlugin_Hypothesis_i::SetTinyEdgeLength
435 * Set Tiny Edge Length
437 //=============================================================================
438 void BLSURFPlugin_Hypothesis_i::SetTinyEdgeLength(CORBA::Double theValue) {
439 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTinyEdgeLength");
441 this->GetImpl()->SetTinyEdgeLength(theValue);
442 SMESH::TPythonDump() << _this() << ".SetTinyEdgeLength( " << theValue << " )";
445 //=============================================================================
447 * BLSURFPlugin_Hypothesis_i::GetTinyEdgeLength
449 * Get Tiny Edge Length
451 //=============================================================================
452 CORBA::Double BLSURFPlugin_Hypothesis_i::GetTinyEdgeLength() {
453 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTinyEdgeLength");
455 return this->GetImpl()->GetTinyEdgeLength();
458 //=============================================================================
460 * BLSURFPlugin_Hypothesis_i::SetBadElementRemoval
464 //=============================================================================
465 void BLSURFPlugin_Hypothesis_i::SetBadElementRemoval(CORBA::Boolean theValue) {
466 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetBadElementRemoval");
468 this->GetImpl()->SetBadElementRemoval(theValue);
469 std::string theValueStr = theValue ? "True" : "False";
470 SMESH::TPythonDump() << _this() << ".SetBadElementRemoval( " << theValueStr.c_str() << " )";
473 //=============================================================================
475 * BLSURFPlugin_Hypothesis_i::GetBadElementRemoval
479 //=============================================================================
480 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetBadElementRemoval() {
481 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetBadElementRemoval");
483 return this->GetImpl()->GetBadElementRemoval();
486 //=============================================================================
488 * BLSURFPlugin_Hypothesis_i::SetBadElementAspectRatio
490 * Set Bad Surface Element Aspect Ratio
492 //=============================================================================
493 void BLSURFPlugin_Hypothesis_i::SetBadElementAspectRatio(CORBA::Double theValue) {
494 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetBadElementAspectRatio");
496 this->GetImpl()->SetBadElementAspectRatio(theValue);
497 SMESH::TPythonDump() << _this() << ".SetBadElementAspectRatio( " << theValue << " )";
500 //=============================================================================
502 * BLSURFPlugin_Hypothesis_i::GetBadElementAspectRatio
504 * Get Bad Surface Element Aspect Ratio
506 //=============================================================================
507 CORBA::Double BLSURFPlugin_Hypothesis_i::GetBadElementAspectRatio() {
508 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetBadElementAspectRatio");
510 return this->GetImpl()->GetBadElementAspectRatio();
513 //=============================================================================
515 * BLSURFPlugin_Hypothesis_i::SetOptimizeMesh
519 //=============================================================================
520 void BLSURFPlugin_Hypothesis_i::SetOptimizeMesh(CORBA::Boolean theValue) {
521 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetOptimizeMesh");
523 this->GetImpl()->SetOptimizeMesh(theValue);
524 std::string theValueStr = theValue ? "True" : "False";
525 SMESH::TPythonDump() << _this() << ".SetOptimizeMesh( " << theValueStr.c_str() << " )";
528 //=============================================================================
530 * BLSURFPlugin_Hypothesis_i::GetOptimizeMesh
534 //=============================================================================
535 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetOptimizeMesh() {
536 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetOptimizeMesh");
538 return this->GetImpl()->GetOptimizeMesh();
541 //=============================================================================
543 * BLSURFPlugin_Hypothesis_i::SetQuadraticMesh
547 //=============================================================================
548 void BLSURFPlugin_Hypothesis_i::SetQuadraticMesh(CORBA::Boolean theValue) {
549 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetQuadraticMesh");
551 this->GetImpl()->SetQuadraticMesh(theValue);
552 std::string theValueStr = theValue ? "True" : "False";
553 SMESH::TPythonDump() << _this() << ".SetQuadraticMesh( " << theValueStr.c_str() << " )";
556 //=============================================================================
558 * BLSURFPlugin_Hypothesis_i::GetQuadraticMesh
562 //=============================================================================
563 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadraticMesh() {
564 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetQuadraticMesh");
566 return this->GetImpl()->GetQuadraticMesh();
574 * BLSURFPlugin_Hypothesis_i::SetTopology
579 //=============================================================================
580 void BLSURFPlugin_Hypothesis_i::SetTopology(CORBA::Long theValue) {
581 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTopology");
583 this->GetImpl()->SetTopology((::BLSURFPlugin_Hypothesis::Topology) theValue);
584 SMESH::TPythonDump() << _this() << ".SetTopology( " << theValue << " )";
587 //=============================================================================
589 * BLSURFPlugin_Hypothesis_i::GetTopology
593 //=============================================================================
594 CORBA::Long BLSURFPlugin_Hypothesis_i::GetTopology() {
595 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTopology");
597 return this->GetImpl()->GetTopology();
600 //=============================================================================
601 void BLSURFPlugin_Hypothesis_i::SetVerbosity(CORBA::Short theVal) throw (SALOME::SALOME_Exception) {
603 if (theVal < 0 || theVal > 100)
604 THROW_SALOME_CORBA_EXCEPTION( "Invalid verbosity level",SALOME::BAD_PARAM );
605 this->GetImpl()->SetVerbosity(theVal);
606 SMESH::TPythonDump() << _this() << ".SetVerbosity( " << theVal << " )";
609 //=============================================================================
611 CORBA::Short BLSURFPlugin_Hypothesis_i::GetVerbosity() {
613 return (CORBA::Short) this->GetImpl()->GetVerbosity();
616 //=============================================================================
618 * BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges
622 //=============================================================================
623 void BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges(CORBA::Boolean theValue) {
624 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges");
626 this->GetImpl()->SetPreCADMergeEdges(theValue);
627 std::string theValueStr = theValue ? "True" : "False";
628 SMESH::TPythonDump() << _this() << ".SetPreCADMergeEdges( " << theValueStr.c_str() << " )";
631 //=============================================================================
633 * BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges
637 //=============================================================================
638 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges() {
639 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges");
641 return this->GetImpl()->GetPreCADMergeEdges();
644 //=============================================================================
646 * BLSURFPlugin_Hypothesis_i::SetPreCADProcess3DTopology
650 //=============================================================================
651 void BLSURFPlugin_Hypothesis_i::SetPreCADProcess3DTopology(CORBA::Boolean theValue) {
652 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADProcess3DTopology");
654 this->GetImpl()->SetPreCADProcess3DTopology(theValue);
655 std::string theValueStr = theValue ? "True" : "False";
656 SMESH::TPythonDump() << _this() << ".SetPreCADProcess3DTopology( " << theValueStr.c_str() << " )";
659 //=============================================================================
661 * BLSURFPlugin_Hypothesis_i::GetPreCADProcess3DTopology
665 //=============================================================================
666 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADProcess3DTopology() {
667 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADProcess3DTopology");
669 return this->GetImpl()->GetPreCADProcess3DTopology();
672 //=============================================================================
674 * BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput
678 //=============================================================================
679 void BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput(CORBA::Boolean theValue) {
680 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput");
682 this->GetImpl()->SetPreCADDiscardInput(theValue);
683 std::string theValueStr = theValue ? "True" : "False";
684 SMESH::TPythonDump() << _this() << ".SetPreCADDiscardInput( " << theValueStr.c_str() << " )";
687 //=============================================================================
689 * BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput
693 //=============================================================================
694 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput() {
695 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput");
697 return this->GetImpl()->GetPreCADDiscardInput();
701 //=============================================================================
703 void BLSURFPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const char* optionValue)
704 throw (SALOME::SALOME_Exception) {
706 bool valueChanged = false;
708 valueChanged = (this->GetImpl()->GetOptionValue(optionName) != optionValue);
710 this->GetImpl()->SetOptionValue(optionName, optionValue);
711 } catch (const std::invalid_argument& ex) {
712 SALOME::ExceptionStruct ExDescription;
713 ExDescription.text = ex.what();
714 ExDescription.type = SALOME::BAD_PARAM;
715 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetOptionValue(name,value)";
716 ExDescription.lineNumber = 0;
717 throw SALOME::SALOME_Exception(ExDescription);
718 } catch (SALOME_Exception& ex) {
719 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
722 SMESH::TPythonDump() << _this() << ".SetOptionValue( '" << optionName << "', '" << optionValue << "' )";
725 //=============================================================================
727 void BLSURFPlugin_Hypothesis_i::SetPreCADOptionValue(const char* optionName, const char* optionValue)
728 throw (SALOME::SALOME_Exception) {
730 bool valueChanged = false;
732 valueChanged = (this->GetImpl()->GetPreCADOptionValue(optionName) != optionValue);
734 this->GetImpl()->SetPreCADOptionValue(optionName, optionValue);
735 } catch (const std::invalid_argument& ex) {
736 SALOME::ExceptionStruct ExDescription;
737 ExDescription.text = ex.what();
738 ExDescription.type = SALOME::BAD_PARAM;
739 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetPreCADOptionValue(name,value)";
740 ExDescription.lineNumber = 0;
741 throw SALOME::SALOME_Exception(ExDescription);
742 } catch (SALOME_Exception& ex) {
743 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
746 SMESH::TPythonDump() << _this() << ".SetPreCADOptionValue( '" << optionName << "', '" << optionValue << "' )";
749 //=============================================================================
751 char* BLSURFPlugin_Hypothesis_i::GetOptionValue(const char* optionName) throw (SALOME::SALOME_Exception) {
754 return CORBA::string_dup(this->GetImpl()->GetOptionValue(optionName).c_str());
755 } catch (const std::invalid_argument& ex) {
756 SALOME::ExceptionStruct ExDescription;
757 ExDescription.text = ex.what();
758 ExDescription.type = SALOME::BAD_PARAM;
759 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetOptionValue(name)";
760 ExDescription.lineNumber = 0;
761 throw SALOME::SALOME_Exception(ExDescription);
762 } catch (SALOME_Exception& ex) {
763 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
768 //=============================================================================
770 char* BLSURFPlugin_Hypothesis_i::GetPreCADOptionValue(const char* optionName) throw (SALOME::SALOME_Exception) {
773 return CORBA::string_dup(this->GetImpl()->GetPreCADOptionValue(optionName).c_str());
774 } catch (const std::invalid_argument& ex) {
775 SALOME::ExceptionStruct ExDescription;
776 ExDescription.text = ex.what();
777 ExDescription.type = SALOME::BAD_PARAM;
778 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetPreCADOptionValue(name)";
779 ExDescription.lineNumber = 0;
780 throw SALOME::SALOME_Exception(ExDescription);
781 } catch (SALOME_Exception& ex) {
782 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
787 //=============================================================================
789 void BLSURFPlugin_Hypothesis_i::UnsetOption(const char* optionName) {
791 this->GetImpl()->ClearOption(optionName);
792 SMESH::TPythonDump() << _this() << ".UnsetOption( '" << optionName << "' )";
795 //=============================================================================
797 void BLSURFPlugin_Hypothesis_i::UnsetPreCADOption(const char* optionName) {
799 this->GetImpl()->ClearPreCADOption(optionName);
800 SMESH::TPythonDump() << _this() << ".UnsetPreCADOption( '" << optionName << "' )";
803 //=============================================================================
805 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetOptionValues() {
807 BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
809 const ::BLSURFPlugin_Hypothesis::TOptionValues & opts = this->GetImpl()->GetOptionValues();
810 result->length(opts.size());
812 ::BLSURFPlugin_Hypothesis::TOptionValues::const_iterator opIt = opts.begin();
813 for (int i = 0; opIt != opts.end(); ++opIt, ++i) {
814 string name_value = opIt->first;
815 if (!opIt->second.empty()) {
817 name_value += opIt->second;
819 result[i] = CORBA::string_dup(name_value.c_str());
821 return result._retn();
824 //=============================================================================
826 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetPreCADOptionValues() {
828 BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
830 const ::BLSURFPlugin_Hypothesis::TOptionValues & opts = this->GetImpl()->GetPreCADOptionValues();
831 result->length(opts.size());
833 ::BLSURFPlugin_Hypothesis::TOptionValues::const_iterator opIt = opts.begin();
834 for (int i = 0; opIt != opts.end(); ++opIt, ++i) {
835 string name_value = opIt->first;
836 if (!opIt->second.empty()) {
838 name_value += opIt->second;
840 result[i] = CORBA::string_dup(name_value.c_str());
842 return result._retn();
845 //=============================================================================
847 void BLSURFPlugin_Hypothesis_i::SetOptionValues(const BLSURFPlugin::string_array& options)
848 throw (SALOME::SALOME_Exception) {
850 for (int i = 0; i < options.length(); ++i) {
851 string name_value = options[i].in();
852 int colonPos = name_value.find(':');
854 if (colonPos == string::npos) // ':' not found
857 name = name_value.substr(0, colonPos);
858 if (colonPos < name_value.size() - 1 && name_value[colonPos] != ' ')
859 value = name_value.substr(colonPos + 1);
861 SetOptionValue(name.c_str(), value.c_str());
865 //=============================================================================
867 void BLSURFPlugin_Hypothesis_i::SetPreCADOptionValues(const BLSURFPlugin::string_array& options)
868 throw (SALOME::SALOME_Exception) {
870 for (int i = 0; i < options.length(); ++i) {
871 string name_value = options[i].in();
872 int colonPos = name_value.find(':');
874 if (colonPos == string::npos) // ':' not found
877 name = name_value.substr(0, colonPos);
878 if (colonPos < name_value.size() - 1 && name_value[colonPos] != ' ')
879 value = name_value.substr(colonPos + 1);
881 SetPreCADOptionValue(name.c_str(), value.c_str());
885 //=============================================================================
887 void BLSURFPlugin_Hypothesis_i::SetSizeMapEntry(const char* entry, const char* sizeMap)
888 throw (SALOME::SALOME_Exception) {
890 MESSAGE("ENGINE : SETSIZEMAP START ENTRY : " << entry);
891 bool valueChanged = false;
893 valueChanged = (this->GetImpl()->GetSizeMapEntry(entry) != sizeMap);
895 this->GetImpl()->SetSizeMapEntry(entry, sizeMap);
896 } catch (const std::invalid_argument& ex) {
897 SALOME::ExceptionStruct ExDescription;
898 ExDescription.text = ex.what();
899 ExDescription.type = SALOME::BAD_PARAM;
900 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetSizeMapEntry(entry,sizemap)";
901 ExDescription.lineNumber = 0;
902 throw SALOME::SALOME_Exception(ExDescription);
903 } catch (SALOME_Exception& ex) {
904 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
906 MESSAGE("ENGINE : SETSIZEMAP END ENTRY : " << entry);
908 SMESH::TPythonDump() << _this() << ".SetSizeMap(" << entry << ", '" << sizeMap << "' )";
911 //=============================================================================
913 void BLSURFPlugin_Hypothesis_i::SetConstantSizeMapEntry(const char* entry, GEOM::shape_type shapeType, CORBA::Double sizeMap)
914 throw (SALOME::SALOME_Exception) {
916 MESSAGE("ENGINE : SETSIZEMAP START ENTRY : " << entry);
917 bool valueChanged = false;
918 std::ostringstream sizeMapFunction;
920 case GEOM::FACE: sizeMapFunction << "def f(u,v): return " << sizeMap ; break;
921 case GEOM::EDGE: sizeMapFunction << "def f(t): return " << sizeMap ; break;
922 case GEOM::VERTEX: sizeMapFunction << "def f(): return " << sizeMap ; break;
925 valueChanged = (this->GetImpl()->GetSizeMapEntry(entry) != sizeMapFunction.str());
927 this->GetImpl()->SetSizeMapEntry(entry, sizeMapFunction.str());
928 } catch (const std::invalid_argument& ex) {
929 SALOME::ExceptionStruct ExDescription;
930 ExDescription.text = ex.what();
931 ExDescription.type = SALOME::BAD_PARAM;
932 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetSizeMapEntry(entry,sizemap)";
933 ExDescription.lineNumber = 0;
934 throw SALOME::SALOME_Exception(ExDescription);
935 } catch (SALOME_Exception& ex) {
936 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
938 MESSAGE("ENGINE : SETSIZEMAP END ENTRY : " << entry);
940 SMESH::TPythonDump() << _this() << ".SetConstantSizeMap(" << entry << ", '" << sizeMap << "' )";
943 //=============================================================================
945 void BLSURFPlugin_Hypothesis_i::SetAttractorEntry(const char* entry, const char* attractor)
946 throw (SALOME::SALOME_Exception) {
948 MESSAGE("ENGINE : SETATTRACTOR START ENTRY : " << entry);
949 bool valueChanged = false;
951 valueChanged = ( this->GetImpl()->GetAttractorEntry(entry) != attractor );
952 if ( valueChanged ) {
953 boost::regex re("^ATTRACTOR\\((?:(-?0(\\.\\d*)*|-?[1-9]+\\d*(\\.\\d*)*|-?\\.(\\d)+);){5}(True|False)(?:;(-?0(\\.\\d*)*|-?[1-9]+\\d*(\\.\\d*)*|-?\\.(\\d)+))?\\)$");
954 if (!boost::regex_match(string(attractor), re))
955 throw std::invalid_argument("Error: an attractor is defined with the following pattern: ATTRACTOR(xa;ya;za;a;b;True|False;d(opt.))");
956 this->GetImpl()->SetAttractorEntry(entry, attractor);
958 } catch (const std::invalid_argument& ex) {
959 SALOME::ExceptionStruct ExDescription;
960 ExDescription.text = ex.what();
961 ExDescription.type = SALOME::BAD_PARAM;
962 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetAttractorEntry(entry,attractor)";
963 ExDescription.lineNumber = 0;
964 throw SALOME::SALOME_Exception(ExDescription);
965 } catch (SALOME_Exception& ex) {
966 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
968 MESSAGE("ENGINE : SETATTRACTOR END ENTRY : " << entry);
970 SMESH::TPythonDump() << _this() << ".SetAttractor(" << entry << ", '" << attractor << "' )";
973 //=============================================================================
975 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
976 throw (SALOME::SALOME_Exception)
979 MESSAGE("ENGINE : SETATTRACTOR START ENTRY : " << entry);
980 bool valueChanged = false;
982 this->GetImpl()->SetClassAttractorEntry(entry, att_entry, StartSize, EndSize, ActionRadius, ConstantRadius);
984 catch (const std::invalid_argument& ex) {
985 SALOME::ExceptionStruct ExDescription;
986 ExDescription.text = ex.what();
987 ExDescription.type = SALOME::BAD_PARAM;
988 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetClassAttractorEntry(entry, att_entry, StartSize, EndSize, ActionRadius, ConstantRadius)";
989 ExDescription.lineNumber = 0;
990 throw SALOME::SALOME_Exception(ExDescription);
991 } catch (SALOME_Exception& ex) {
992 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
994 MESSAGE("ENGINE : SETATTRACTOR END ENTRY : " << entry);
995 //if ( valueChanged )
996 SMESH::TPythonDump() << _this() << ".SetAttractorGeom("
997 << entry << ", " << att_entry << ", "<<StartSize<<", "<<EndSize<<", "<<ActionRadius<<", "<<ConstantRadius<<" )";
1000 //=============================================================================
1002 char* BLSURFPlugin_Hypothesis_i::GetSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception) {
1005 return CORBA::string_dup(this->GetImpl()->GetSizeMapEntry(entry).c_str());
1006 } catch (const std::invalid_argument& ex) {
1007 SALOME::ExceptionStruct ExDescription;
1008 ExDescription.text = ex.what();
1009 ExDescription.type = SALOME::BAD_PARAM;
1010 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetSizeMapEntry(name)";
1011 ExDescription.lineNumber = 0;
1012 throw SALOME::SALOME_Exception(ExDescription);
1013 } catch (SALOME_Exception& ex) {
1014 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1019 //=============================================================================
1021 char* BLSURFPlugin_Hypothesis_i::GetAttractorEntry(const char* entry) throw (SALOME::SALOME_Exception) {
1024 return CORBA::string_dup(this->GetImpl()->GetAttractorEntry(entry).c_str());
1025 } catch (const std::invalid_argument& ex) {
1026 SALOME::ExceptionStruct ExDescription;
1027 ExDescription.text = ex.what();
1028 ExDescription.type = SALOME::BAD_PARAM;
1029 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetAttractorEntry(name)";
1030 ExDescription.lineNumber = 0;
1031 throw SALOME::SALOME_Exception(ExDescription);
1032 } catch (SALOME_Exception& ex) {
1033 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1038 // //=============================================================================
1040 // // TODO coder cette fonction (utilisée pour savoir si la valeur a changé
1041 // // A finir pour le dump
1042 // char* BLSURFPlugin_Hypothesis_i::GetClassAttractorEntry(const char* entry)
1043 // throw (SALOME::SALOME_Exception)
1045 // ASSERT(myBaseImpl);
1047 // return CORBA::string_dup( this->GetImpl()->GetClassAttractorEntry(entry).c_str());
1049 // catch (const std::invalid_argument& ex) {
1050 // SALOME::ExceptionStruct ExDescription;
1051 // ExDescription.text = ex.what();
1052 // ExDescription.type = SALOME::BAD_PARAM;
1053 // ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetClassAttractorEntry(name)";
1054 // ExDescription.lineNumber = 0;
1055 // throw SALOME::SALOME_Exception(ExDescription);
1057 // catch (SALOME_Exception& ex) {
1058 // THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1063 //=============================================================================
1065 void BLSURFPlugin_Hypothesis_i::UnsetEntry(const char* entry) {
1067 this->GetImpl()->ClearEntry(entry);
1068 // SMESH::TPythonDump() << _this() << ".UnsetSizeMap( " << entry << " )";
1071 //=============================================================================
1073 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetSizeMapEntries() {
1075 BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
1077 const ::BLSURFPlugin_Hypothesis::TSizeMap sizeMaps = this->GetImpl()->_GetSizeMapEntries();
1078 result->length(sizeMaps.size());
1080 ::BLSURFPlugin_Hypothesis::TSizeMap::const_iterator smIt = sizeMaps.begin();
1081 for (int i = 0; smIt != sizeMaps.end(); ++smIt, ++i) {
1082 string entry_sizemap = smIt->first;
1083 if (!smIt->second.empty()) {
1084 entry_sizemap += "|";
1085 entry_sizemap += smIt->second;
1087 result[i] = CORBA::string_dup(entry_sizemap.c_str());
1089 return result._retn();
1092 //=============================================================================
1094 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetAttractorEntries() {
1096 BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
1098 const ::BLSURFPlugin_Hypothesis::TSizeMap attractors = this->GetImpl()->_GetAttractorEntries();
1099 result->length(attractors.size());
1101 ::BLSURFPlugin_Hypothesis::TSizeMap::const_iterator atIt = attractors.begin();
1102 for (int i = 0; atIt != attractors.end(); ++atIt, ++i) {
1103 string entry_attractor = atIt->first;
1104 if (!atIt->second.empty()) {
1105 entry_attractor += "|";
1106 entry_attractor += atIt->second;
1108 result[i] = CORBA::string_dup(entry_attractor.c_str());
1110 return result._retn();
1113 //=============================================================================
1115 BLSURFPlugin::TAttParamsMap* BLSURFPlugin_Hypothesis_i::GetAttractorParams()
1118 BLSURFPlugin::TAttParamsMap_var result = new BLSURFPlugin::TAttParamsMap();
1120 const ::BLSURFPlugin_Hypothesis::TAttractorMap attractors= this->GetImpl()->_GetClassAttractorEntries();
1121 result->length( attractors.size() );
1123 ::BLSURFPlugin_Hypothesis::TAttractorMap::const_iterator atIt = attractors.begin();
1124 for ( int i = 0 ; atIt != attractors.end(); ++atIt, ++i ) {
1125 string faceEntry = atIt->first;
1127 double startSize, endSize, infDist, constDist;
1128 if ( !atIt->second->Empty() ) {
1129 attEntry = atIt->second->GetAttractorEntry();
1130 MESSAGE("GetAttractorParams : attEntry ="<<attEntry)
1131 std::vector<double> params = atIt->second->GetParameters();
1132 startSize = params[0];
1133 endSize = params[1];
1134 infDist = params[2];
1135 constDist = params[3];
1137 result[i].faceEntry = CORBA::string_dup(faceEntry.c_str());
1138 result[i].attEntry = CORBA::string_dup(attEntry.c_str());
1139 result[i].startSize = startSize;
1140 result[i].endSize = endSize;
1141 result[i].infDist = infDist;
1142 result[i].constDist = constDist;
1143 MESSAGE("GetAttractorParams : result[i].attEntry ="<<result[i].attEntry)
1144 MESSAGE("GetAttractorParams : result[i].faceEntry ="<<result[i].faceEntry)
1146 return result._retn();
1149 //=============================================================================
1151 void BLSURFPlugin_Hypothesis_i::SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps)
1152 throw (SALOME::SALOME_Exception) {
1154 for (int i = 0; i < sizeMaps.length(); ++i) {
1155 string entry_sizemap = sizeMaps[i].in();
1156 int colonPos = entry_sizemap.find('|');
1157 string entry, sizemap;
1158 if (colonPos == string::npos) // '|' separator not found
1159 entry = entry_sizemap;
1161 entry = entry_sizemap.substr(0, colonPos);
1162 if (colonPos < entry_sizemap.size() - 1 && entry_sizemap[colonPos] != ' ')
1163 sizemap = entry_sizemap.substr(colonPos + 1);
1165 this->GetImpl()->SetSizeMapEntry(entry.c_str(), sizemap.c_str());
1169 //=============================================================================
1171 void BLSURFPlugin_Hypothesis_i::ClearSizeMaps() {
1173 this->GetImpl()->ClearSizeMaps();
1176 //=============================================================================
1178 void BLSURFPlugin_Hypothesis_i::SetSizeMap(const GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap) {
1181 entry = GeomObj->GetStudyEntry();
1182 MESSAGE("IDL : GetName : " << GeomObj->GetName());
1183 MESSAGE("IDL : SETSIZEMAP ( "<< entry << " , " << sizeMap << ")");
1184 SetSizeMapEntry(entry.c_str(), sizeMap);
1187 //=============================================================================
1189 void BLSURFPlugin_Hypothesis_i::SetConstantSizeMap(const GEOM::GEOM_Object_ptr GeomObj, CORBA::Double sizeMap) {
1191 string entry = GeomObj->GetStudyEntry();
1192 GEOM::shape_type shapeType = GeomObj->GetShapeType();
1193 if (shapeType == GEOM::COMPOUND)
1194 shapeType = GeomObj->GetMaxShapeType();
1195 MESSAGE("IDL : GetName : " << GeomObj->GetName());
1196 MESSAGE("IDL : SETSIZEMAP ( "<< entry << " , " << sizeMap << ")");
1197 SetConstantSizeMapEntry(entry.c_str(), shapeType, sizeMap);
1200 //=============================================================================
1201 void BLSURFPlugin_Hypothesis_i::UnsetSizeMap(const GEOM::GEOM_Object_ptr GeomObj) {
1204 entry = GeomObj->GetStudyEntry();
1205 MESSAGE("IDL : GetName : " << GeomObj->GetName());
1206 MESSAGE("IDL : UNSETSIZEMAP ( "<< entry << ")");
1207 UnsetEntry(entry.c_str());
1208 SMESH::TPythonDump() << _this() << ".UnsetSizeMap( " << entry.c_str() << " )";
1211 void BLSURFPlugin_Hypothesis_i::SetAttractor(GEOM::GEOM_Object_ptr GeomObj, const char* attractor) {
1214 entry = GeomObj->GetStudyEntry();
1215 MESSAGE("IDL : GetName : " << GeomObj->GetName());
1216 MESSAGE("IDL : SETATTRACTOR ( "<< entry << " , " << attractor << ")");
1217 SetAttractorEntry(entry.c_str(), attractor);
1220 void BLSURFPlugin_Hypothesis_i::UnsetAttractor(GEOM::GEOM_Object_ptr GeomObj) {
1223 entry = GeomObj->GetStudyEntry();
1224 MESSAGE("IDL : GetName : " << GeomObj->GetName());
1225 MESSAGE("IDL : UNSETATTRACTOR ( "<< entry << ")");
1226 UnsetEntry(entry.c_str());
1227 SMESH::TPythonDump() << _this() << ".UnsetAttractor( " << entry.c_str() << " )";
1230 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)
1233 string theFaceEntry;
1235 theFaceEntry = theFace->GetStudyEntry();
1236 theAttEntry = theAttractor->GetStudyEntry();
1238 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1239 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1242 if (theFaceEntry.empty()) {
1244 aName += theFace->GetEntry();
1245 SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1246 if (!theSFace->_is_nil())
1247 theFaceEntry = theSFace->GetID();
1249 if (theFaceEntry.empty())
1250 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1252 if (theAttEntry.empty()) {
1253 if (theAttractor->GetShapeType() == GEOM::VERTEX)
1255 if (theAttractor->GetShapeType() == GEOM::EDGE)
1257 if (theAttractor->GetShapeType() == GEOM::WIRE)
1259 if (theAttractor->GetShapeType() == GEOM::COMPOUND)
1260 aName = "Compound_";
1261 aName += theAttractor->GetEntry();
1262 SALOMEDS::SObject_ptr theSAtt = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theAttractor, aName.c_str());
1263 if (!theSAtt->_is_nil())
1264 theAttEntry = theSAtt->GetID();
1266 if (theAttEntry.empty())
1267 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1269 TopoDS_Face FaceShape = TopoDS::Face(SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( theFace ));
1270 TopoDS_Shape AttractorShape = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( theAttractor );
1271 MESSAGE("IDL : GetName : " << theFace->GetName());
1272 MESSAGE("IDL : SETATTRACTOR () ");//<< entry << " , " << att_entry << ")");
1273 SetClassAttractorEntry( theFaceEntry.c_str(), theAttEntry.c_str(), StartSize, EndSize, ActionRadius, ConstantRadius);
1276 void BLSURFPlugin_Hypothesis_i::UnsetAttractorGeom(GEOM::GEOM_Object_ptr theFace)
1279 string theFaceEntry;
1280 theFaceEntry = theFace->GetStudyEntry();
1282 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1283 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1286 if (theFaceEntry.empty()) {
1288 aName += theFace->GetEntry();
1289 SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1290 if (!theSFace->_is_nil())
1291 theFaceEntry = theSFace->GetID();
1293 if (theFaceEntry.empty())
1294 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1296 MESSAGE("IDL : GetName : " << theFace->GetName());
1297 MESSAGE("IDL : UNSETATTRACTOR ( "<< theFaceEntry << ")");
1298 UnsetEntry( theFaceEntry.c_str());
1299 SMESH::TPythonDump() << _this() << ".UnsetAttractorGeom( " << theFaceEntry.c_str() << " )";
1303 void BLSURFPlugin_Hypothesis_i::SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap)
1306 void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj)
1309 void BLSURFPlugin_Hypothesis_i::SetCustomSizeMapEntry(const char* entry,const char* sizeMap ) throw (SALOME::SALOME_Exception)
1312 char* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception)
1315 void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMapEntry(const char* entry)
1318 this->GetImpl()->UnsetCustomSizeMap(entry);
1319 SMESH::TPythonDump() << _this() << ".UnsetCustomSizeMap( " << entry << " )";
1323 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntries()
1328 // ///////////////////////
1329 // // ENFORCED VERTICES //
1330 // ///////////////////////
1334 * Returns the list of enforced vertices for a given Face entry
1335 * @return A map of Face entry / List of enforced vertices
1338 BLSURFPlugin::TFaceEntryEnfVertexListMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByFace() {
1339 MESSAGE("IDL: GetAllEnforcedVerticesByFace()");
1342 BLSURFPlugin::TFaceEntryEnfVertexListMap_var resultMap = new BLSURFPlugin::TFaceEntryEnfVertexListMap();
1344 const ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap faceEntryEnfVertexListMap =
1345 this->GetImpl()->_GetAllEnforcedVerticesByFace();
1346 resultMap->length(faceEntryEnfVertexListMap.size());
1347 MESSAGE("Face entry to Enforced Vertex map size is " << resultMap->length());
1349 ::BLSURFPlugin_Hypothesis::TEnfVertexList _enfVertexList;
1350 ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap::const_iterator it_entry = faceEntryEnfVertexListMap.begin();
1351 for (int i = 0; it_entry != faceEntryEnfVertexListMap.end(); ++it_entry, ++i) {
1352 BLSURFPlugin::TFaceEntryEnfVertexListMapElement_var mapElement =
1353 new BLSURFPlugin::TFaceEntryEnfVertexListMapElement();
1354 mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
1355 MESSAGE("Face Entry: " << mapElement->faceEntry);
1357 _enfVertexList = it_entry->second;
1358 BLSURFPlugin::TEnfVertexList_var enfVertexList = new BLSURFPlugin::TEnfVertexList();
1359 enfVertexList->length(_enfVertexList.size());
1360 MESSAGE("Number of enf vertex: " << enfVertexList->length());
1362 ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator it_enfVertex = _enfVertexList.begin();
1363 ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
1364 for (int j = 0; it_enfVertex != _enfVertexList.end(); ++it_enfVertex, ++j) {
1365 currentEnfVertex = (*it_enfVertex);
1367 BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
1370 enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
1373 enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
1376 BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
1377 coords->length(currentEnfVertex->coords.size());
1378 for (int i=0;i<coords->length();i++)
1379 coords[i] = currentEnfVertex->coords[i];
1380 enfVertex->coords = coords;
1383 enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());
1386 BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
1387 faceEntryList->length(currentEnfVertex->faceEntries.size());
1388 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
1389 for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
1390 faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
1391 enfVertex->faceEntries = faceEntryList;
1394 msg << "Enforced vertex: \n"
1395 << "Name: " << enfVertex->name << "\n";
1396 if (coords->length())
1397 msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
1398 msg << "Geom entry: " << enfVertex->geomEntry << "\n"
1399 << "Group Name: " << enfVertex->grpName;
1402 enfVertexList[j] = enfVertex;
1404 mapElement->enfVertexList = enfVertexList;
1406 resultMap[i] = mapElement;
1409 return resultMap._retn();
1413 * Returns the list of all enforced vertices
1414 * @return a list of enforced vertices
1417 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVertices() {
1418 MESSAGE("IDL: GetAllEnforcedVertices()");
1420 BLSURFPlugin::TEnfVertexList_var resultMap = new BLSURFPlugin::TEnfVertexList();
1421 const ::BLSURFPlugin_Hypothesis::TEnfVertexList enfVertexList = this->GetImpl()->_GetAllEnforcedVertices();
1422 resultMap->length(enfVertexList.size());
1423 MESSAGE("Enforced Vertex map size is " << resultMap->length());
1425 ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = enfVertexList.begin();
1426 ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
1427 for (int i = 0; evlIt != enfVertexList.end(); ++evlIt, ++i) {
1428 MESSAGE("Enforced Vertex #" << i);
1429 currentEnfVertex = (*evlIt);
1430 BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
1432 enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
1434 enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
1436 BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
1437 coords->length(currentEnfVertex->coords.size());
1438 for (int ind = 0; ind < coords->length(); ind++)
1439 coords[ind] = currentEnfVertex->coords[ind];
1440 enfVertex->coords = coords;
1442 enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());
1444 BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
1445 faceEntryList->length(currentEnfVertex->faceEntries.size());
1446 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
1447 for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
1448 faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
1449 enfVertex->faceEntries = faceEntryList;
1452 msg << "Enforced vertex: \n"
1453 << "Name: " << enfVertex->name << "\n";
1454 if (coords->length())
1455 msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
1456 msg << "Geom entry: " << enfVertex->geomEntry << "\n"
1457 << "Group Name: " << enfVertex->grpName;
1460 resultMap[i] = enfVertex;
1462 return resultMap._retn();
1467 * Returns the list of enforced vertices coords for a given Face entry.
1468 * They are the coords of the "manual" enforced vertices.
1469 * @return A map of Face entry / List of enforced vertices coords
1472 BLSURFPlugin::TFaceEntryCoordsListMap* BLSURFPlugin_Hypothesis_i::GetAllCoordsByFace() {
1473 MESSAGE("IDL: GetAllCoordsByFace()");
1476 BLSURFPlugin::TFaceEntryCoordsListMap_var resultMap = new BLSURFPlugin::TFaceEntryCoordsListMap();
1478 const ::BLSURFPlugin_Hypothesis::TFaceEntryCoordsListMap entryCoordsListMap = this->GetImpl()->_GetAllCoordsByFace();
1479 resultMap->length(entryCoordsListMap.size());
1480 MESSAGE("Enforced Vertex map size is " << resultMap->length());
1482 ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList _coordsList;
1483 ::BLSURFPlugin_Hypothesis::TFaceEntryCoordsListMap::const_iterator it_entry = entryCoordsListMap.begin();
1484 for (int i = 0; it_entry != entryCoordsListMap.end(); ++it_entry, ++i) {
1485 BLSURFPlugin::TFaceEntryCoordsListMapElement_var mapElement = new BLSURFPlugin::TFaceEntryCoordsListMapElement();
1486 mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
1487 MESSAGE("Face Entry: " << mapElement->faceEntry);
1489 _coordsList = it_entry->second;
1490 BLSURFPlugin::TEnfVertexCoordsList_var coordsList = new BLSURFPlugin::TEnfVertexCoordsList();
1491 coordsList->length(_coordsList.size());
1492 MESSAGE("Number of coords: " << coordsList->length());
1494 ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList::const_iterator it_coords = _coordsList.begin();
1495 for (int j = 0; it_coords != _coordsList.end(); ++it_coords, ++j) {
1496 BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
1497 coords->length((*it_coords).size());
1498 for (int i=0;i<coords->length();i++)
1499 coords[i] = (*it_coords)[i];
1500 coordsList[j] = coords;
1501 MESSAGE("Coords #" << j << ": " << coords[0] << ", " << coords[1] << ", " << coords[2]);
1503 mapElement->coordsList = coordsList;
1505 resultMap[i] = mapElement;
1508 return resultMap._retn();
1512 * Returns a map of enforced vertices coords / enforced vertex.
1513 * They are the coords of the "manual" enforced vertices.
1515 BLSURFPlugin::TCoordsEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByCoords() {
1516 MESSAGE("IDL: GetAllEnforcedVerticesByCoords()");
1519 BLSURFPlugin::TCoordsEnfVertexMap_var resultMap = new BLSURFPlugin::TCoordsEnfVertexMap();
1520 const ::BLSURFPlugin_Hypothesis::TCoordsEnfVertexMap coordsEnfVertexMap =
1521 this->GetImpl()->_GetAllEnforcedVerticesByCoords();
1522 resultMap->length(coordsEnfVertexMap.size());
1523 MESSAGE("Enforced Vertex map size is " << resultMap->length());
1525 ::BLSURFPlugin_Hypothesis::TCoordsEnfVertexMap::const_iterator it_coords = coordsEnfVertexMap.begin();
1526 ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
1527 for (int i = 0; it_coords != coordsEnfVertexMap.end(); ++it_coords, ++i) {
1528 MESSAGE("Enforced Vertex #" << i);
1529 currentEnfVertex = (it_coords->second);
1530 BLSURFPlugin::TCoordsEnfVertexElement_var mapElement = new BLSURFPlugin::TCoordsEnfVertexElement();
1531 BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
1532 coords->length(it_coords->first.size());
1533 for (int ind=0;ind<coords->length();ind++)
1534 coords[ind] = it_coords->first[ind];
1535 mapElement->coords = coords;
1536 MESSAGE("Coords: " << mapElement->coords[0] << ", " << mapElement->coords[1] << ", " << mapElement->coords[2]);
1538 BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
1540 enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
1542 enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
1544 BLSURFPlugin::TEnfVertexCoords_var coords2 = new BLSURFPlugin::TEnfVertexCoords();
1545 coords2->length(currentEnfVertex->coords.size());
1546 for (int ind=0;ind<coords2->length();ind++)
1547 coords2[ind] = currentEnfVertex->coords[ind];
1548 enfVertex->coords = coords2;
1550 enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());
1552 BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
1553 faceEntryList->length(currentEnfVertex->faceEntries.size());
1554 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
1555 for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
1556 faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
1557 enfVertex->faceEntries = faceEntryList;
1559 mapElement->enfVertex = enfVertex;
1561 msg << "Enforced vertex: \n"
1562 << "Name: " << enfVertex->name << "\n";
1563 if (coords->length())
1564 msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
1565 msg << "Geom entry: " << enfVertex->geomEntry << "\n"
1566 << "Group Name: " << enfVertex->grpName;
1569 resultMap[i] = mapElement;
1571 return resultMap._retn();
1575 * Returns the list of enforced vertices entries for a given Face entry.
1576 * They are the geom entries of the enforced vertices based on geom shape (vertex, compound, group).
1577 * @return A map of Face entry / List of enforced vertices geom entries
1580 BLSURFPlugin::TFaceEntryEnfVertexEntryListMap* BLSURFPlugin_Hypothesis_i::GetAllEnfVertexEntriesByFace() {
1581 MESSAGE("IDL: GetAllEnfVertexEntriesByFace()");
1584 BLSURFPlugin::TFaceEntryEnfVertexEntryListMap_var resultMap = new BLSURFPlugin::TFaceEntryEnfVertexEntryListMap();
1586 const ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexEntryListMap entryEnfVertexEntryListMap =
1587 this->GetImpl()->_GetAllEnfVertexEntriesByFace();
1588 resultMap->length(entryEnfVertexEntryListMap.size());
1589 MESSAGE("Enforced Vertex map size is " << resultMap->length());
1591 ::BLSURFPlugin_Hypothesis::TEntryList _enfVertexEntryList;
1592 ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexEntryListMap::const_iterator it_entry =
1593 entryEnfVertexEntryListMap.begin();
1594 for (int i = 0; it_entry != entryEnfVertexEntryListMap.end(); ++it_entry, ++i) {
1595 BLSURFPlugin::TFaceEntryEnfVertexEntryListMapElement_var mapElement =
1596 new BLSURFPlugin::TFaceEntryEnfVertexEntryListMapElement();
1597 mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
1598 MESSAGE("Face Entry: " << mapElement->faceEntry);
1600 _enfVertexEntryList = it_entry->second;
1601 BLSURFPlugin::TEntryList_var enfVertexEntryList = new BLSURFPlugin::TEntryList();
1602 enfVertexEntryList->length(_enfVertexEntryList.size());
1603 MESSAGE("Number of enf vertex entries: " << enfVertexEntryList->length());
1605 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_enfVertexEntry = _enfVertexEntryList.begin();
1606 for (int j = 0; it_enfVertexEntry != _enfVertexEntryList.end(); ++it_enfVertexEntry, ++j) {
1607 enfVertexEntryList[j] = CORBA::string_dup((*it_enfVertexEntry).c_str());
1608 MESSAGE("Enf Vertex Entry #" << j << ": " << enfVertexEntryList[j]);
1610 mapElement->enfVertexEntryList = enfVertexEntryList;
1612 resultMap[i] = mapElement;
1615 return resultMap._retn();
1619 * Returns a map of enforced vertices geom entry / enforced vertex.
1620 * They are the geom entries of the enforced vertices defined with geom shape (vertex, compound, group).
1622 BLSURFPlugin::TEnfVertexEntryEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByEnfVertexEntry() {
1623 MESSAGE("IDL: GetAllEnforcedVerticesByEnfVertexEntry()");
1626 BLSURFPlugin::TEnfVertexEntryEnfVertexMap_var resultMap = new BLSURFPlugin::TEnfVertexEntryEnfVertexMap();
1627 const ::BLSURFPlugin_Hypothesis::TEnfVertexEntryEnfVertexMap enfVertexEntryEnfVertexMap =
1628 this->GetImpl()->_GetAllEnforcedVerticesByEnfVertexEntry();
1629 resultMap->length(enfVertexEntryEnfVertexMap.size());
1630 MESSAGE("Enforced Vertex map size is " << resultMap->length());
1632 ::BLSURFPlugin_Hypothesis::TEnfVertexEntryEnfVertexMap::const_iterator it_enfVertexEntry = enfVertexEntryEnfVertexMap.begin();
1633 ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
1634 for (int i = 0; it_enfVertexEntry != enfVertexEntryEnfVertexMap.end(); ++it_enfVertexEntry, ++i) {
1635 MESSAGE("Enforced Vertex #" << i);
1636 currentEnfVertex = it_enfVertexEntry->second;
1637 BLSURFPlugin::TEnfVertexEntryEnfVertexElement_var mapElement = new BLSURFPlugin::TEnfVertexEntryEnfVertexElement();
1638 mapElement->enfVertexEntry = CORBA::string_dup(it_enfVertexEntry->first.c_str());;
1639 MESSAGE("Enf Vertex Entry #" << i << ": " << mapElement->enfVertexEntry);
1641 BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
1643 enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
1645 enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
1647 BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
1648 coords->length(currentEnfVertex->coords.size());
1649 for (int ind=0;ind<coords->length();ind++)
1650 coords[ind] = currentEnfVertex->coords[ind];
1651 enfVertex->coords = coords;
1653 enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());
1655 BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
1656 faceEntryList->length(currentEnfVertex->faceEntries.size());
1657 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
1658 for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
1659 faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
1660 enfVertex->faceEntries = faceEntryList;
1663 msg << "Enforced vertex: \n"
1664 << "Name: " << enfVertex->name << "\n";
1665 if (coords->length())
1666 msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
1667 msg << "Geom entry: " << enfVertex->geomEntry << "\n"
1668 << "Group Name: " << enfVertex->grpName;
1671 mapElement->enfVertex = enfVertex;
1672 resultMap[i] = mapElement;
1674 return resultMap._retn();
1678 * Erase all enforced vertices
1680 void BLSURFPlugin_Hypothesis_i::ClearAllEnforcedVertices() {
1682 this->GetImpl()->ClearAllEnforcedVertices();
1683 SMESH::TPythonDump() << _this() << ".ClearAllEnforcedVertices()";
1687 * Set/get/unset an enforced vertex on face
1689 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
1690 CORBA::Double z) throw (SALOME::SALOME_Exception) {
1693 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
1694 MESSAGE("theFace shape type is not FACE or COMPOUND");
1695 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
1698 string theFaceEntry = theFace->GetStudyEntry();
1700 if (theFaceEntry.empty()) {
1701 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1702 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1704 if (theFace->GetShapeType() == GEOM::FACE)
1706 if (theFace->GetShapeType() == GEOM::COMPOUND)
1707 aName = "Compound_";
1708 aName += theFace->GetEntry();
1709 SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1710 if (!theSFace->_is_nil())
1711 theFaceEntry = theSFace->GetID();
1713 if (theFaceEntry.empty())
1714 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1715 MESSAGE("IDL : GetName : " << theFace->GetName());
1716 MESSAGE("IDL : SetEnforcedVertex( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ")");
1718 return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z);
1719 } catch (SALOME_Exception& ex) {
1720 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1725 * Set/get/unset an enforced vertex with name on face
1727 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
1728 CORBA::Double z, const char* theVertexName) throw (SALOME::SALOME_Exception) {
1731 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
1732 MESSAGE("theFace shape type is not FACE or COMPOUND");
1733 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
1736 string theFaceEntry = theFace->GetStudyEntry();
1738 if (theFaceEntry.empty()) {
1739 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1740 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1742 if (theFace->GetShapeType() == GEOM::FACE)
1744 if (theFace->GetShapeType() == GEOM::COMPOUND)
1745 aName = "Compound_";
1746 aName += theFace->GetEntry();
1747 SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1748 if (!theSFace->_is_nil())
1749 theFaceEntry = theSFace->GetID();
1751 if (theFaceEntry.empty())
1752 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1754 MESSAGE("IDL : GetName : " << theFace->GetName());
1755 MESSAGE("IDL : SetEnforcedVertexNamed( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theVertexName << ")");
1757 return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, theVertexName);
1758 } catch (SALOME_Exception& ex) {
1759 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1764 * Set/get/unset an enforced vertex with geom object on face
1766 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
1767 throw (SALOME::SALOME_Exception) {
1770 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
1771 MESSAGE("theFace shape type is not FACE or COMPOUND");
1772 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
1775 if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
1776 MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
1777 THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
1780 // GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1781 // GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations(this->GetImpl()->GetStudyId());
1782 // if (CORBA::is_nil(measureOp))
1785 // CORBA::Double x, y, z;
1787 // measureOp->PointCoordinates(theVertex, x, y, z);
1789 string theFaceEntry = theFace->GetStudyEntry();
1790 string theVertexEntry = theVertex->GetStudyEntry();
1792 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1793 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1796 if (theFaceEntry.empty()) {
1797 if (theFace->GetShapeType() == GEOM::FACE)
1799 if (theFace->GetShapeType() == GEOM::COMPOUND)
1800 aName = "Compound_";
1801 aName += theFace->GetEntry();
1802 SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1803 if (!theSFace->_is_nil())
1804 theFaceEntry = theSFace->GetID();
1806 if (theFaceEntry.empty())
1807 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1809 if (theVertexEntry.empty()) {
1810 if (theVertex->GetShapeType() == GEOM::VERTEX)
1812 if (theVertex->GetShapeType() == GEOM::COMPOUND)
1813 aName = "Compound_";
1814 aName += theVertex->GetEntry();
1815 SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
1816 if (!theSVertex->_is_nil())
1817 theVertexEntry = theSVertex->GetID();
1819 if (theVertexEntry.empty())
1820 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1822 string theVertexName = theVertex->GetName();
1823 MESSAGE("IDL : theFace->GetName : " << theFace->GetName());
1824 MESSAGE("IDL : theVertex->GetName : " << theVertexName);
1825 MESSAGE("IDL : SetEnforcedVertexGeom( "<< theFaceEntry << ", " << theVertexEntry<< ")");
1827 return SetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexName.c_str(), theVertexEntry.c_str());
1828 } catch (SALOME_Exception& ex) {
1829 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1834 * Set an enforced vertex with group name on face
1836 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
1837 throw (SALOME::SALOME_Exception)
1841 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
1842 MESSAGE("theFace shape type is not FACE or COMPOUND");
1843 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
1846 string theFaceEntry = theFace->GetStudyEntry();
1848 if (theFaceEntry.empty()) {
1849 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1850 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1852 if (theFace->GetShapeType() == GEOM::FACE)
1854 if (theFace->GetShapeType() == GEOM::COMPOUND)
1855 aName = "Compound_";
1856 aName += theFace->GetEntry();
1857 SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1858 if (!theSFace->_is_nil())
1859 theFaceEntry = theSFace->GetID();
1861 if (theFaceEntry.empty())
1862 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1863 MESSAGE("IDL : GetName : " << theFace->GetName());
1864 MESSAGE("IDL : SetEnforcedVertexWithGroup( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theGroupName << ")");
1866 return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, "", "", theGroupName);
1867 } catch (SALOME_Exception& ex) {
1868 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1873 * Set an enforced vertex with name and group name on face
1875 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z,
1876 const char* theVertexName, const char* theGroupName)
1877 throw (SALOME::SALOME_Exception)
1881 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
1882 MESSAGE("theFace shape type is not FACE or COMPOUND");
1883 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
1886 string theFaceEntry = theFace->GetStudyEntry();
1888 if (theFaceEntry.empty()) {
1889 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1890 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1892 if (theFace->GetShapeType() == GEOM::FACE)
1894 if (theFace->GetShapeType() == GEOM::COMPOUND)
1895 aName = "Compound_";
1896 aName += theFace->GetEntry();
1897 SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1898 if (!theSFace->_is_nil())
1899 theFaceEntry = theSFace->GetID();
1901 if (theFaceEntry.empty())
1902 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1903 MESSAGE("IDL : GetName : " << theFace->GetName());
1904 MESSAGE("IDL : SetEnforcedVertexNamedWithGroup( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theVertexName << ", " << theGroupName << ")");
1906 return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, theVertexName, "", theGroupName);
1907 } catch (SALOME_Exception& ex) {
1908 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1913 * Set an enforced vertex with geom entry and group name on face
1915 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
1916 throw (SALOME::SALOME_Exception)
1920 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
1921 MESSAGE("theFace shape type is not FACE or COMPOUND");
1922 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
1925 if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
1926 MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
1927 THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
1930 string theFaceEntry = theFace->GetStudyEntry();
1931 string theVertexEntry = theVertex->GetStudyEntry();
1933 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1934 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1937 if (theFaceEntry.empty()) {
1938 if (theFace->GetShapeType() == GEOM::FACE)
1940 if (theFace->GetShapeType() == GEOM::COMPOUND)
1941 aName = "Compound_";
1942 aName += theFace->GetEntry();
1943 SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1944 if (!theSFace->_is_nil())
1945 theFaceEntry = theSFace->GetID();
1947 if (theFaceEntry.empty())
1948 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1950 if (theVertexEntry.empty()) {
1951 if (theVertex->GetShapeType() == GEOM::VERTEX)
1953 if (theVertex->GetShapeType() == GEOM::COMPOUND)
1954 aName = "Compound_";
1955 aName += theVertex->GetEntry();
1956 SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
1957 if (!theSVertex->_is_nil())
1958 theVertexEntry = theSVertex->GetID();
1960 if (theVertexEntry.empty())
1961 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
1963 string theVertexName = theVertex->GetName();
1964 MESSAGE("IDL : theFace->GetName : " << theFace->GetName());
1965 MESSAGE("IDL : theVertex->GetName : " << theVertexName);
1966 MESSAGE("IDL : SetEnforcedVertexGeomWithGroup( "<< theFaceEntry << ", " << theVertexEntry<< ", " << theGroupName<< ")");
1968 return SetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexName.c_str(), theVertexEntry.c_str(), theGroupName);
1969 } catch (SALOME_Exception& ex) {
1970 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1974 //Enable internal enforced vertices on specific face if requested by user
1976 // * Are internal enforced vertices used for a face ?
1978 //CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace)
1979 // throw (SALOME::SALOME_Exception) {
1980 // ASSERT(myBaseImpl);
1982 // if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
1983 // MESSAGE("theFace shape type is not FACE or COMPOUND");
1984 // THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
1987 // string theFaceEntry = theFace->GetStudyEntry();
1989 // if (theFaceEntry.empty()) {
1990 // GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
1991 // SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
1993 // if (theFace->GetShapeType() == GEOM::FACE)
1995 // if (theFace->GetShapeType() == GEOM::COMPOUND)
1996 // aName = "Compound_";
1997 // aName += theFace->GetEntry();
1998 // SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
1999 // if (!theSFace->_is_nil())
2000 // theFaceEntry = theSFace->GetID();
2002 // if (theFaceEntry.empty())
2003 // THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2005 // MESSAGE("IDL : GetName : " << theFace->GetName());
2006 // MESSAGE("IDL : GetInternalEnforcedVertexEntry ( "<< theFaceEntry << ")");
2008 // return GetInternalEnforcedVertexEntry(theFaceEntry.c_str());
2009 // } catch (SALOME_Exception& ex) {
2010 // THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2015 * Get the list of all enforced vertices
2017 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVertices(GEOM::GEOM_Object_ptr theFace)
2018 throw (SALOME::SALOME_Exception) {
2021 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2022 MESSAGE("theFace shape type is not FACE or COMPOUND");
2023 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2026 string theFaceEntry = theFace->GetStudyEntry();
2028 if (theFaceEntry.empty()) {
2029 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2030 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2032 if (theFace->GetShapeType() == GEOM::FACE)
2034 if (theFace->GetShapeType() == GEOM::COMPOUND)
2035 aName = "Compound_";
2036 aName += theFace->GetEntry();
2037 SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2038 if (!theSFace->_is_nil())
2039 theFaceEntry = theSFace->GetID();
2041 if (theFaceEntry.empty())
2042 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2044 MESSAGE("IDL : GetName : " << theFace->GetName());
2045 MESSAGE("IDL : GetEnforcedVerticesEntry ( "<< theFaceEntry << ")");
2047 return GetEnforcedVerticesEntry(theFaceEntry.c_str());
2048 } catch (SALOME_Exception& ex) {
2049 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2053 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
2054 CORBA::Double z) throw (SALOME::SALOME_Exception) {
2057 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2058 MESSAGE("theFace shape type is not FACE or COMPOUND");
2059 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2062 string theFaceEntry = theFace->GetStudyEntry();
2064 if (theFaceEntry.empty()) {
2065 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2066 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2068 if (theFace->GetShapeType() == GEOM::FACE)
2070 if (theFace->GetShapeType() == GEOM::COMPOUND)
2071 aName = "Compound_";
2072 aName += theFace->GetEntry();
2073 SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2074 if (!theSFace->_is_nil())
2075 theFaceEntry = theSFace->GetID();
2077 if (theFaceEntry.empty())
2078 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2079 MESSAGE("IDL : GetName : " << theFace->GetName());
2080 MESSAGE("IDL : UnsetEnforcedVertex ( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ")");
2083 return UnsetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z);
2084 } catch (SALOME_Exception& ex) {
2085 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2089 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
2090 throw (SALOME::SALOME_Exception) {
2093 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2094 MESSAGE("theFace shape type is not FACE or COMPOUND");
2095 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2097 if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
2098 MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
2099 THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
2102 // GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2103 // GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations(this->GetImpl()->GetStudyId());
2104 // if (CORBA::is_nil(measureOp))
2107 // CORBA::Double x, y, z;
2109 // measureOp->PointCoordinates(theVertex, x, y, z);
2111 std::string theFaceEntry = theFace->GetStudyEntry();
2112 std::string theVertexEntry = theVertex->GetStudyEntry();
2114 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2115 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2118 if (theFaceEntry.empty()) {
2119 if (theFace->GetShapeType() == GEOM::FACE)
2121 if (theFace->GetShapeType() == GEOM::COMPOUND)
2122 aName = "Compound_";
2123 aName += theFace->GetEntry();
2124 SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2125 if (!theSFace->_is_nil())
2126 theFaceEntry = theSFace->GetID();
2128 if (theFaceEntry.empty())
2129 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2131 if (theVertexEntry.empty()) {
2132 if (theVertex->GetShapeType() == GEOM::VERTEX)
2134 if (theVertex->GetShapeType() == GEOM::COMPOUND)
2135 aName = "Compound_";
2136 aName += theVertex->GetEntry();
2137 SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str());
2138 if (!theSVertex->_is_nil())
2139 theVertexEntry = theSVertex->GetID();
2141 if (theVertexEntry.empty())
2142 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2144 MESSAGE("IDL : UnsetEnforcedVertexGeom ( "<< theFaceEntry << ", " << theVertexEntry << ")");
2147 return UnsetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexEntry.c_str());
2148 } catch (SALOME_Exception& ex) {
2149 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2153 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception) {
2156 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2157 MESSAGE("theFace shape type is not FACE or COMPOUND");
2158 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2161 string theFaceEntry = theFace->GetStudyEntry();
2163 if (theFaceEntry.empty()) {
2164 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2165 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2167 if (theFace->GetShapeType() == GEOM::FACE)
2169 if (theFace->GetShapeType() == GEOM::COMPOUND)
2170 aName = "Compound_";
2171 aName += theFace->GetEntry();
2172 SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2173 if (!theSFace->_is_nil())
2174 theFaceEntry = theSFace->GetID();
2176 if (theFaceEntry.empty())
2177 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2179 MESSAGE("IDL : GetName : " << theFace->GetName());
2180 MESSAGE("IDL : UnsetEnforcedVertices ( "<< theFaceEntry << ")");
2183 return UnsetEnforcedVerticesEntry(theFaceEntry.c_str());
2184 } catch (SALOME_Exception& ex) {
2185 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2190 * Set/get/unset an enforced vertex on geom object given by entry
2192 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y,
2193 CORBA::Double z, const char* theVertexName, const char* theVertexEntry, const char* theGroupName)
2194 throw (SALOME::SALOME_Exception) {
2196 MESSAGE("IDL : SetEnforcedVertexEntry(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theVertexName << "\", \"" << theVertexEntry << "\", \"" << theGroupName << "\")");
2197 bool newValue = false;
2198 if (string(theVertexEntry).empty()) {
2200 ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList coordsList =
2201 this->GetImpl()->GetEnfVertexCoordsList(theFaceEntry);
2202 ::BLSURFPlugin_Hypothesis::TEnfVertexCoords coords;
2203 coords.push_back(x);
2204 coords.push_back(y);
2205 coords.push_back(z);
2206 if (coordsList.find(coords) == coordsList.end()) {
2207 MESSAGE("Coords not found: add it in coordsList");
2210 MESSAGE("Coords already found, compare names");
2211 ::BLSURFPlugin_Hypothesis::TEnfVertex *enfVertex = this->GetImpl()->GetEnfVertex(coords);
2212 if ((enfVertex->name != theVertexName) || (enfVertex->grpName != theGroupName)) {
2213 MESSAGE("The names are different: update");
2214 // this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z);
2218 MESSAGE("The names are identical");
2221 } catch (const std::invalid_argument& ex) {
2222 // no enforced vertex for entry
2223 MESSAGE("Face entry not found : add it to the list");
2227 if (string(theVertexName).empty())
2228 if (string(theGroupName).empty())
2229 SMESH::TPythonDump() << _this() << ".SetEnforcedVertex(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ")";
2231 SMESH::TPythonDump() << _this() << ".SetEnforcedVertexWithGroup(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theGroupName << "\")";
2233 if (string(theGroupName).empty())
2234 SMESH::TPythonDump() << _this() << ".SetEnforcedVertexNamed(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theVertexName << "\")";
2236 SMESH::TPythonDump() << _this() << ".SetEnforcedVertexNamedWithGroup(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \""
2237 << theVertexName << "\", \"" << theGroupName << "\")";
2240 ::BLSURFPlugin_Hypothesis::TEntryList enfVertexEntryList = this->GetImpl()->GetEnfVertexEntryList(theFaceEntry);
2241 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it = enfVertexEntryList.find(theVertexEntry);
2242 if ( it == enfVertexEntryList.end()) {
2243 MESSAGE("Geom entry not found: add it in enfVertexEntryList");
2247 MESSAGE("Geom entry already found, compare names");
2248 ::BLSURFPlugin_Hypothesis::TEnfVertex *enfVertex = this->GetImpl()->GetEnfVertex((*it));
2249 if ((enfVertex->name != theVertexName) || (enfVertex->grpName != theGroupName)) {
2250 MESSAGE("The names are different: update");
2251 // this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z);
2255 MESSAGE("The names are identical");
2258 } catch (const std::invalid_argument& ex) {
2259 // no enforced vertex for entry
2260 MESSAGE("Face entry not found : add it to the list");
2264 if (string(theGroupName).empty())
2265 SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGeom(" << theFaceEntry << ", " << theVertexEntry << ")";
2267 SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGeomWithGroup(" << theFaceEntry << ", " << theVertexEntry << ", \"" << theGroupName << "\")";
2271 this->GetImpl()->SetEnforcedVertex(theFaceEntry, theVertexName, theVertexEntry, theGroupName, x, y, z);
2273 MESSAGE("IDL : SetEnforcedVertexEntry END");
2277 //Enable internal enforced vertices on specific face if requested by user
2278 //CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexEntry(const char* theFaceEntry)
2279 // throw (SALOME::SALOME_Exception) {
2280 // ASSERT(myBaseImpl);
2282 // return this->GetImpl()->GetInternalEnforcedVertex(theFaceEntry);
2283 // } catch (const std::exception& ex) {
2284 // std::cout << "Exception: " << ex.what() << std::endl;
2285 // THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2289 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(const char* entry)
2290 throw (SALOME::SALOME_Exception) {
2292 MESSAGE("ENGINE : GetEnforcedVerticesEntry START ENTRY : " << entry);
2295 BLSURFPlugin::TEnfVertexList_var vertexList = new BLSURFPlugin::TEnfVertexList();
2296 ::BLSURFPlugin_Hypothesis::TEnfVertexList _vList = this->GetImpl()->GetEnfVertexList(entry);
2297 vertexList->length(_vList.size());
2298 MESSAGE("Number of enforced vertices: " << vertexList->length());
2299 ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = _vList.begin();
2300 for (int i = 0; evlIt != _vList.end(); ++evlIt, ++i) {
2301 ::BLSURFPlugin_Hypothesis::TEnfVertex *_enfVertex = (*evlIt);
2303 BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
2306 enfVertex->name = CORBA::string_dup(_enfVertex->name.c_str());
2307 // Geom Vertex Entry
2308 enfVertex->geomEntry = CORBA::string_dup(_enfVertex->geomEntry.c_str());
2310 BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
2311 coords->length(_enfVertex->coords.size());
2312 for (int ind=0;ind<coords->length();ind++)
2313 coords[ind] = _enfVertex->coords[ind];
2314 enfVertex->coords = coords;
2316 enfVertex->grpName = CORBA::string_dup(_enfVertex->grpName.c_str());
2318 BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
2319 faceEntryList->length(_enfVertex->faceEntries.size());
2320 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = _enfVertex->faceEntries.begin();
2321 for (int ind = 0; it_entry != _enfVertex->faceEntries.end();++it_entry, ++ind)
2322 faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
2323 enfVertex->faceEntries = faceEntryList;
2325 vertexList[i] = enfVertex;
2327 MESSAGE("ENGINE : GetEnforcedVerticesEntry END ENTRY : " << entry);
2328 return vertexList._retn();
2329 } catch (const std::invalid_argument& ex) {
2330 SALOME::ExceptionStruct ExDescription;
2331 ExDescription.text = ex.what();
2332 ExDescription.type = SALOME::BAD_PARAM;
2333 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(entry)";
2334 ExDescription.lineNumber = 1385;
2335 throw SALOME::SALOME_Exception(ExDescription);
2336 } catch (const std::exception& ex) {
2337 std::cout << "Exception: " << ex.what() << std::endl;
2338 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2342 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y,
2343 CORBA::Double z, const char* theVertexEntry) throw (SALOME::SALOME_Exception) {
2345 MESSAGE("IDL : UnsetEnforcedVertexEntry(" << theFaceEntry << "," << x << "," << y << "," << z << ", " << theVertexEntry << ")");
2349 res = this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z, theVertexEntry);
2351 if (string(theVertexEntry).empty())
2352 SMESH::TPythonDump() << "isDone = " << _this() << ".UnsetEnforcedVertex(" << theFaceEntry << ", " << x << ", " << y << ", " << z
2355 SMESH::TPythonDump() << "isDone = " << _this() << ".UnsetEnforcedVertexGeom(" << theFaceEntry << ", " << theVertexEntry << ")";
2357 } catch (const std::invalid_argument& ex) {
2359 } catch (const std::exception& ex) {
2360 std::cout << "Exception: " << ex.what() << std::endl;
2361 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2364 MESSAGE("ENGINE : UnsetEnforcedVertexEntry END ENTRY : " << theFaceEntry);
2368 //bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntryWithPoint(const char* theFaceEntry, const char* theVertexEntry,
2369 // CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception) {
2370 // MESSAGE("IDL : UnsetEnforcedVertexEntryWithPoint START theFaceEntry=" << theFaceEntry << ", theVertexEntry=" << theVertexEntry);
2372 // bool ret = false;
2375 // ret = _unsetEnfVertex(theFaceEntry, x, y, z);
2376 // } catch (SALOME_Exception& ex) {
2377 // THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2381 // SMESH::TPythonDump() << _this() << ".UnsetEnforcedVertexWithPoint(" << theFaceEntry << ", " << theVertexEntry
2384 // MESSAGE("IDL : UnsetEnforcedVertexEntryWithPoint END ENTRY : " << theFaceEntry);
2388 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception) {
2390 MESSAGE("IDL : UnsetEnforcedVerticesEntry(" << theFaceEntry << ")");
2393 this->GetImpl()->ClearEnforcedVertices(theFaceEntry);
2394 SMESH::TPythonDump() << _this() << ".UnsetEnforcedVertices(" << theFaceEntry << ")";
2395 } catch (const std::invalid_argument& ex) {
2397 } catch (const std::exception& ex) {
2398 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2401 MESSAGE("IDL : UnsetEnforcedVerticesEntry END ENTRY : " << theFaceEntry);
2405 //=============================================================================
2407 * BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces
2411 //=============================================================================
2412 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces(CORBA::Boolean theValue) {
2413 MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces");
2415 this->GetImpl()->SetInternalEnforcedVertexAllFaces(theValue);
2416 std::string theValueStr = theValue ? "True" : "False";
2417 SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexAllFaces( " << theValueStr.c_str() << " )";
2420 //=============================================================================
2422 * BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces
2426 //=============================================================================
2427 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces() {
2428 MESSAGE("BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces");
2430 return this->GetImpl()->_GetInternalEnforcedVertexAllFaces();
2433 //=============================================================================
2435 * BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup
2439 //=============================================================================
2440 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup(const char* groupName) {
2441 MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup");
2443 this->GetImpl()->SetInternalEnforcedVertexAllFacesGroup(groupName);
2444 SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexAllFacesGroup( \"" << groupName << "\" )";
2447 //=============================================================================
2449 * BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup
2453 //=============================================================================
2454 char* BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup() {
2455 MESSAGE("BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup");
2457 return CORBA::string_dup(this->GetImpl()->_GetInternalEnforcedVertexAllFacesGroup().c_str());
2461 * Enable internal enforced vertices on specific face if requested by user
2463 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices)
2464 throw (SALOME::SALOME_Exception)
2466 MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFace");
2468 SetInternalEnforcedVertexWithGroup(theFace, toEnforceInternalVertices);
2469 } catch (SALOME_Exception& ex) {
2470 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2474 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName)
2475 throw (SALOME::SALOME_Exception)
2477 MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFaceWithGroup");
2479 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2480 MESSAGE("theFace shape type is not FACE or COMPOUND");
2481 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2484 string theFaceEntry = theFace->GetStudyEntry();
2486 if (theFaceEntry.empty()) {
2487 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2488 SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen();
2490 if (theFace->GetShapeType() == GEOM::FACE)
2492 if (theFace->GetShapeType() == GEOM::COMPOUND)
2493 aName = "Compound_";
2494 aName += theFace->GetEntry();
2495 SALOMEDS::SObject_ptr theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str());
2496 if (!theSFace->_is_nil())
2497 theFaceEntry = theSFace->GetID();
2499 if (theFaceEntry.empty())
2500 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2502 MESSAGE("IDL : GetName : " << theFace->GetName());
2503 MESSAGE("IDL : GetInternalEnforcedVertexEntry ( "<< theFaceEntry << ")");
2505 SetInternalEnforcedVertexEntry(theFaceEntry.c_str(), toEnforceInternalVertices, theGroupName);
2506 } catch (SALOME_Exception& ex) {
2507 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2511 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName)
2512 throw (SALOME::SALOME_Exception)
2514 MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFaceEntry");
2517 this->GetImpl()->SetInternalEnforcedVertex(theFaceEntry, toEnforceInternalVertices, theGroupName);
2518 std::string theValueStr = toEnforceInternalVertices ? "True" : "False";
2519 if (string(theGroupName).empty())
2520 SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertex( " << theFaceEntry << ", " << theValueStr.c_str() << " )";
2522 SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexWithGroup( " << theFaceEntry << ", " << theValueStr.c_str() << ", \"" << theGroupName << "\" )";
2523 } catch (const std::exception& ex) {
2524 std::cout << "Exception: " << ex.what() << std::endl;
2525 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2532 char* BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z)
2533 throw (SALOME::SALOME_Exception)
2536 MESSAGE("ENGINE : GetEnforcedVertexGroupName START ");
2538 return CORBA::string_dup( this->GetImpl()->GetEnforcedVertexGroupName(x, y, z).c_str());
2540 catch (const std::invalid_argument& ex) {
2541 SALOME::ExceptionStruct ExDescription;
2542 ExDescription.text = ex.what();
2543 ExDescription.type = SALOME::BAD_PARAM;
2544 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(entry)";
2545 ExDescription.lineNumber = 1146;
2546 throw SALOME::SALOME_Exception(ExDescription);
2548 catch (SALOME_Exception& ex) {
2549 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2551 MESSAGE("ENGINE : GetEnforcedVertexGroupName END ");
2556 void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* groupName)
2557 throw (SALOME::SALOME_Exception)
2560 MESSAGE("ENGINE : SetEnforcedVertexGroupName START ");
2562 this->GetImpl()->SetEnforcedVertexGroupName(x, y, z, groupName);
2564 catch (const std::invalid_argument& ex) {
2565 SALOME::ExceptionStruct ExDescription;
2566 ExDescription.text = ex.what();
2567 ExDescription.type = SALOME::BAD_PARAM;
2568 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetEnforcedVertexGroupName(x,y,z)";
2569 ExDescription.lineNumber = 1170;
2570 throw SALOME::SALOME_Exception(ExDescription);
2572 catch (SALOME_Exception& ex) {
2573 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2576 SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGroupName("
2577 << x << ", " << y << ", " << z << ", '" << groupName << "' )";
2579 MESSAGE("ENGINE : SetEnforcedVertexGroupName END ");
2582 ///////////////////////
2585 //================================================================================
2587 * \brief Sets the file for export resulting mesh in GMF format
2588 * \param theFileName - full name of the file (.mesh, .meshb)
2590 * After compute, export the resulting mesh in the given file with the GMF format (.mesh)
2592 //================================================================================
2593 // void BLSURFPlugin_Hypothesis_i::SetGMFFile(const char* theFileName, CORBA::Boolean isBinary) {
2594 void BLSURFPlugin_Hypothesis_i::SetGMFFile(const char* theFileName) {
2596 MESSAGE("IDL : SetGMFFile(" << theFileName << ")");
2597 bool valueChanged/*, modeChanged*/ = false;
2599 valueChanged = (this->GetImpl()->GetGMFFile() != theFileName);
2600 // modeChanged = (this->GetImpl()->GetGMFFileMode() != isBinary);
2601 if (valueChanged)// or (!valueChanged && modeChanged))
2602 this->GetImpl()->SetGMFFile(theFileName);// ,isBinary);
2603 } catch (const std::exception& ex) {
2604 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2606 if (valueChanged)// or (!valueChanged && modeChanged))
2607 SMESH::TPythonDump() << _this() << ".SetGMFFile(\"" << theFileName << "\")"; //", " << isBinary << ")";
2608 MESSAGE("IDL : SetGMFFile END ");
2611 //================================================================================
2613 * \brief Gets the file name for export resulting mesh in GMF format
2614 * \retval char* - The file name
2616 * Returns the GMF file name
2618 //================================================================================
2619 char* BLSURFPlugin_Hypothesis_i::GetGMFFile() {
2621 // MESSAGE("IDL : GetGMFFile()");
2622 return CORBA::string_dup(this->GetImpl()->GetGMFFile().c_str());
2625 // //================================================================================
2627 // * \brief Gets the file mode for export resulting mesh in GMF format
2628 // * \retval CORBA::Boolean - TRUE if binary mode, FALSE if ascii mode
2630 // * Returns the GMF file mode
2632 // //================================================================================
2633 // CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetGMFFileMode() {
2634 // ASSERT(myBaseImpl);
2635 // MESSAGE("IDL : GetGMFFileMode()");
2636 // return this->GetImpl()->GetGMFFileMode();
2639 //=============================================================================
2641 * BLSURFPlugin_Hypothesis_i::GetImpl
2643 * Get implementation
2645 //=============================================================================
2646 ::BLSURFPlugin_Hypothesis* BLSURFPlugin_Hypothesis_i::GetImpl() {
2647 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetImpl");
2648 return (::BLSURFPlugin_Hypothesis*) myBaseImpl;
2651 //================================================================================
2653 * \brief Verify whether hypothesis supports given entity type
2654 * \param type - dimension (see SMESH::Dimension enumeration)
2655 * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
2657 * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
2659 //================================================================================
2660 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsDimSupported(SMESH::Dimension type) {
2661 return type == SMESH::DIM_2D;
2665 // Obsolete methods - To be removed in V7
2668 void BLSURFPlugin_Hypothesis_i::SetPhyMin(CORBA::Double theMinSize) {
2669 this->SetMinSize(theMinSize);
2671 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMin() {
2672 return this->GetMinSize();
2674 void BLSURFPlugin_Hypothesis_i::SetPhyMax(CORBA::Double theMaxSize) {
2675 this->SetMaxSize(theMaxSize);
2677 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMax() {
2678 return this->GetMaxSize();
2680 void BLSURFPlugin_Hypothesis_i::SetGeoMin(CORBA::Double theMinSize) {
2681 this->SetMinSize(theMinSize);
2683 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMin() {
2684 return this->GetMinSize();
2686 void BLSURFPlugin_Hypothesis_i::SetGeoMax(CORBA::Double theMaxSize) {
2687 this->SetMaxSize(theMaxSize);
2689 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMax() {
2690 return this->GetMaxSize();
2692 void BLSURFPlugin_Hypothesis_i::SetAngleMeshS(CORBA::Double theValue) {
2693 this->SetAngleMesh(theValue);
2695 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshS() {
2696 return this->GetAngleMesh();
2698 void BLSURFPlugin_Hypothesis_i::SetAngleMeshC(CORBA::Double theValue) {
2699 this->SetAngleMesh(theValue);
2701 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshC() {
2702 return this->GetAngleMesh();
2704 void BLSURFPlugin_Hypothesis_i::SetDecimesh(CORBA::Boolean theValue) {
2705 std::string theValueStr = theValue ? "1" : "0";
2706 this->SetOptionValue("respect_geometry",theValueStr.c_str());
2708 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetDecimesh() {
2709 std::string theValueStr = this->GetOptionValue("respect_geometry");
2710 if (theValueStr.empty() || theValueStr == "respect")
2714 void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveNanoEdges(CORBA::Boolean theValue) {
2715 std::string theValueStr = theValue ? "1" : "0";
2716 this->SetPreCADOptionValue("remove_tiny_edges",theValueStr.c_str());
2718 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveNanoEdges() {
2719 std::string theValueStr = this->GetPreCADOptionValue("remove_tiny_edges");
2720 if (theValueStr == "1")
2724 void BLSURFPlugin_Hypothesis_i::SetPreCADEpsNano(CORBA::Double theValue) {
2725 std::ostringstream theValueStr;
2726 theValueStr << theValue;
2727 this->SetPreCADOptionValue("tiny_edge_length",theValueStr.str().c_str());
2729 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPreCADEpsNano() {
2730 std::istringstream theValueStr(this->GetPreCADOptionValue("tiny_edge_length"));
2732 theValueStr >> result;