1 // Copyright (C) 2007-2016 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, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 // File : BLSURFPlugin_Hypothesis.cxx
22 // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA)
23 // Size maps developement: Nicolas GEIMER (OCC) & Gilles DAVID (EURIWARE)
26 #include "BLSURFPlugin_Hypothesis_i.hxx"
28 #include <SMESH_Gen.hxx>
29 #include <SMESH_Gen_i.hxx>
30 #include <SMESH_PythonDump.hxx>
32 #include <SALOMEDS_wrap.hxx>
33 #include <Utils_CorbaException.hxx>
34 #include <utilities.h>
38 #include <boost/regex.hpp>
42 //=============================================================================
44 * BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i
48 //=============================================================================
49 BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA,
50 ::SMESH_Gen* theGenImpl) :
51 SALOME::GenericObj_i(thePOA), SMESH_Hypothesis_i(thePOA) {
52 MESSAGE( "BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i" );
53 myBaseImpl = new ::BLSURFPlugin_Hypothesis(theGenImpl->GetANewId(), theGenImpl);
56 //=============================================================================
58 * BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i
62 //=============================================================================
63 BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i() {
64 MESSAGE( "BLSURFPlugin_Hypothesis_i::~BLSURFPlugin_Hypothesis_i" );
67 //=============================================================================
69 //=============================================================================
71 * BLSURFPlugin_Hypothesis_i::SetPhysicalMesh
76 //=============================================================================
77 void BLSURFPlugin_Hypothesis_i::SetPhysicalMesh(CORBA::Long theValue) {
78 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhysicalMesh");
80 this->GetImpl()->SetPhysicalMesh((::BLSURFPlugin_Hypothesis::PhysicalMesh) theValue);
81 SMESH::TPythonDump() << _this() << ".SetPhysicalMesh( " << theValue << " )";
84 //=============================================================================
86 * BLSURFPlugin_Hypothesis_i::GetPhysicalMesh
90 //=============================================================================
91 CORBA::Long BLSURFPlugin_Hypothesis_i::GetPhysicalMesh() {
92 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhysicalMesh");
94 return this->GetImpl()->GetPhysicalMesh();
97 //=============================================================================
99 * BLSURFPlugin_Hypothesis_i::SetGeometricMesh
104 //=============================================================================
105 void BLSURFPlugin_Hypothesis_i::SetGeometricMesh(CORBA::Long theValue) {
106 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGeometricMesh");
108 this->GetImpl()->SetGeometricMesh((::BLSURFPlugin_Hypothesis::GeometricMesh) theValue);
109 SMESH::TPythonDump() << _this() << ".SetGeometricMesh( " << theValue << " )";
112 //=============================================================================
114 * BLSURFPlugin_Hypothesis_i::GetGeometricMesh
118 //=============================================================================
119 CORBA::Long BLSURFPlugin_Hypothesis_i::GetGeometricMesh() {
120 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGeometricMesh");
122 return this->GetImpl()->GetGeometricMesh();
125 //=============================================================================
127 * BLSURFPlugin_Hypothesis_i::SetPhySize
131 //=============================================================================
132 void BLSURFPlugin_Hypothesis_i::SetPhySize(CORBA::Double theValue) {
133 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySize");
135 this->GetImpl()->SetPhySize(theValue, false);
136 SMESH::TPythonDump() << _this() << ".SetPhySize( " << theValue << " )";
139 //=============================================================================
141 * BLSURFPlugin_Hypothesis_i::SetPhySizeRel
143 * Set Relative PhySize
145 //=============================================================================
146 void BLSURFPlugin_Hypothesis_i::SetPhySizeRel(CORBA::Double theValue) {
147 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPhySizeRel");
149 this->GetImpl()->SetPhySize(theValue, true);
150 SMESH::TPythonDump() << _this() << ".SetPhySizeRel( " << theValue << " )";
153 //=============================================================================
155 * BLSURFPlugin_Hypothesis_i::GetPhySize
159 //=============================================================================
160 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhySize() {
161 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPhySize");
163 return this->GetImpl()->GetPhySize();
166 //=============================================================================
168 * BLSURFPlugin_Hypothesis_i::IsPhySizeRel
170 * Returns True if PhySize is relative
172 //=============================================================================
173 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsPhySizeRel() {
174 // MESSAGE("BLSURFPlugin_Hypothesis_i::IsPhySizeRel");
176 return this->GetImpl()->IsPhySizeRel();
179 //=============================================================================
180 void BLSURFPlugin_Hypothesis_i::SetMinSize(CORBA::Double theMinSize) {
182 if (IsMinSizeRel() || GetMinSize() != theMinSize ) {
183 this->GetImpl()->SetMinSize(theMinSize, false);
184 SMESH::TPythonDump() << _this() << ".SetMinSize( " << theMinSize << " )";
188 //=============================================================================
189 void BLSURFPlugin_Hypothesis_i::SetMinSizeRel(CORBA::Double theMinSize) {
191 if ( !IsMinSizeRel() || (GetMinSize() != theMinSize) ) {
192 this->GetImpl()->SetMinSize(theMinSize, true);
193 SMESH::TPythonDump() << _this() << ".SetMinSizeRel( " << theMinSize << " )";
197 //=============================================================================
198 CORBA::Double BLSURFPlugin_Hypothesis_i::GetMinSize() {
200 return this->GetImpl()->GetMinSize();
203 //=============================================================================
204 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMinSizeRel() {
205 // MESSAGE("BLSURFPlugin_Hypothesis_i::IsMinSizeRel");
207 return this->GetImpl()->IsMinSizeRel();
210 //=============================================================================
211 void BLSURFPlugin_Hypothesis_i::SetMaxSize(CORBA::Double theMaxSize) {
213 if (IsMaxSizeRel() || GetMaxSize() != theMaxSize) {
214 this->GetImpl()->SetMaxSize(theMaxSize, false);
215 SMESH::TPythonDump() << _this() << ".SetMaxSize( " << theMaxSize << " )";
219 //=============================================================================
220 void BLSURFPlugin_Hypothesis_i::SetMaxSizeRel(CORBA::Double theMaxSize) {
222 if ( !IsMaxSizeRel() || (GetMaxSize() != theMaxSize) ) {
223 this->GetImpl()->SetMaxSize(theMaxSize, true);
224 SMESH::TPythonDump() << _this() << ".SetMaxSizeRel( " << theMaxSize << " )";
228 //=============================================================================
229 CORBA::Double BLSURFPlugin_Hypothesis_i::GetMaxSize() {
231 return this->GetImpl()->GetMaxSize();
234 //=============================================================================
235 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsMaxSizeRel() {
236 // MESSAGE("BLSURFPlugin_Hypothesis_i::IsMaxSizeRel");
238 return this->GetImpl()->IsMaxSizeRel();
242 //=============================================================================
244 * BLSURFPlugin_Hypothesis_i::SetUseGradation
248 //=============================================================================
249 void BLSURFPlugin_Hypothesis_i::SetUseGradation(CORBA::Boolean theValue) {
250 MESSAGE("BLSURFPlugin_Hypothesis_i::SetUseGradation");
252 if ( GetImpl()->GetUseGradation() != bool( theValue ))
254 this->GetImpl()->SetUseGradation(theValue);
255 std::string theValueStr = theValue ? "True" : "False";
256 SMESH::TPythonDump() << _this() << ".SetUseGradation( " << theValueStr.c_str() << " )";
260 //=============================================================================
262 * BLSURFPlugin_Hypothesis_i::GetUseGradation
266 //=============================================================================
267 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetUseGradation() {
268 MESSAGE("BLSURFPlugin_Hypothesis_i::GetUseGradation");
270 return this->GetImpl()->GetUseGradation();
273 //=============================================================================
275 * BLSURFPlugin_Hypothesis_i::SetGradation
279 //=============================================================================
280 void BLSURFPlugin_Hypothesis_i::SetGradation(CORBA::Double theValue) {
281 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetGradation");
283 this->GetImpl()->SetGradation(theValue);
286 SetUseGradation( false );
288 SMESH::TPythonDump() << _this() << ".SetGradation( " << theValue << " )";
291 //=============================================================================
293 * BLSURFPlugin_Hypothesis_i::GetGradation
297 //=============================================================================
298 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGradation() {
299 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetGradation");
301 return this->GetImpl()->GetGradation();
304 //=============================================================================
306 * BLSURFPlugin_Hypothesis_i::SetUseVolumeGradation
310 //=============================================================================
311 void BLSURFPlugin_Hypothesis_i::SetUseVolumeGradation(CORBA::Boolean theValue) {
312 MESSAGE("BLSURFPlugin_Hypothesis_i::SetUseVolumeGradation");
314 if ( GetImpl()->GetUseVolumeGradation() != bool( theValue ))
316 this->GetImpl()->SetUseVolumeGradation(theValue);
317 std::string theValueStr = theValue ? "True" : "False";
318 SMESH::TPythonDump() << _this() << ".SetUseVolumeGradation( " << theValueStr.c_str() << " )";
322 //=============================================================================
324 * BLSURFPlugin_Hypothesis_i::GetUseVolumeGradation
328 //=============================================================================
329 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetUseVolumeGradation() {
330 MESSAGE("BLSURFPlugin_Hypothesis_i::GetUseVolumeGradation");
332 return this->GetImpl()->GetUseVolumeGradation();
335 //=============================================================================
337 * BLSURFPlugin_Hypothesis_i::SetVolumeGradation
339 * Set VolumeGradation
341 //=============================================================================
342 void BLSURFPlugin_Hypothesis_i::SetVolumeGradation(CORBA::Double theValue) {
343 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetVolumeGradation");
345 this->GetImpl()->SetVolumeGradation(theValue);
347 SetUseVolumeGradation( false );
349 SMESH::TPythonDump() << _this() << ".SetVolumeGradation( " << theValue << " )";
352 //=============================================================================
354 * BLSURFPlugin_Hypothesis_i::GetVolumeGradation
356 * Get VolumeGradation
358 //=============================================================================
359 CORBA::Double BLSURFPlugin_Hypothesis_i::GetVolumeGradation() {
360 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetVolumeGradation");
362 return this->GetImpl()->GetVolumeGradation();
365 //=============================================================================
367 * BLSURFPlugin_Hypothesis_i::SetQuadAllowed
371 //=============================================================================
372 void BLSURFPlugin_Hypothesis_i::SetQuadAllowed(CORBA::Boolean theValue) {
373 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetQuadAllowed");
375 this->GetImpl()->SetQuadAllowed(theValue);
376 std::string theValueStr = theValue ? "True" : "False";
377 SMESH::TPythonDump() << _this() << ".SetQuadAllowed( " << theValueStr.c_str() << " )";
380 //=============================================================================
382 * BLSURFPlugin_Hypothesis_i::GetQuadAllowed
386 //=============================================================================
387 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadAllowed() {
388 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetQuadAllowed");
390 return this->GetImpl()->GetQuadAllowed();
393 //=============================================================================
395 * BLSURFPlugin_Hypothesis_i::SetAngleMesh
399 //=============================================================================
400 void BLSURFPlugin_Hypothesis_i::SetAngleMesh(CORBA::Double theValue) {
401 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAngleMesh");
403 this->GetImpl()->SetAngleMesh(theValue);
404 SMESH::TPythonDump() << _this() << ".SetAngleMesh( " << theValue << " )";
407 //=============================================================================
409 * BLSURFPlugin_Hypothesis_i::GetAngleMesh
413 //=============================================================================
414 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMesh() {
415 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAngleMesh");
417 return this->GetImpl()->GetAngleMesh();
420 //=============================================================================
422 * BLSURFPlugin_Hypothesis_i::SetChordalError
426 //=============================================================================
427 void BLSURFPlugin_Hypothesis_i::SetChordalError(CORBA::Double theValue) {
428 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetChordalError");
430 this->GetImpl()->SetChordalError(theValue);
431 SMESH::TPythonDump() << _this() << ".SetChordalError( " << theValue << " )";
434 //=============================================================================
436 * BLSURFPlugin_Hypothesis_i::GetChordalError
440 //=============================================================================
441 CORBA::Double BLSURFPlugin_Hypothesis_i::GetChordalError() {
442 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetChordalError");
444 return this->GetImpl()->GetChordalError();
447 //=============================================================================
449 * BLSURFPlugin_Hypothesis_i::SetAnisotropic
453 //=============================================================================
454 void BLSURFPlugin_Hypothesis_i::SetAnisotropic(CORBA::Boolean theValue) {
455 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAnisotropic");
457 this->GetImpl()->SetAnisotropic(theValue);
458 std::string theValueStr = theValue ? "True" : "False";
459 SMESH::TPythonDump() << _this() << ".SetAnisotropic( " << theValueStr.c_str() << " )";
462 //=============================================================================
464 * BLSURFPlugin_Hypothesis_i::GetAnisotropic
468 //=============================================================================
469 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetAnisotropic() {
470 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAnisotropic");
472 return this->GetImpl()->GetAnisotropic();
475 //=============================================================================
477 * BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio
479 * Set Anisotropic Ratio
481 //=============================================================================
482 void BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio(CORBA::Double theValue) {
483 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetAnisotropicRatio");
485 this->GetImpl()->SetAnisotropicRatio(theValue);
486 SMESH::TPythonDump() << _this() << ".SetAnisotropicRatio( " << theValue << " )";
489 //=============================================================================
491 * BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio
493 * Get Anisotropic Ratio
495 //=============================================================================
496 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio() {
497 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetAnisotropicRatio");
499 return this->GetImpl()->GetAnisotropicRatio();
503 //=============================================================================
505 * BLSURFPlugin_Hypothesis_i::SetRemoveTinyEdges
509 //=============================================================================
510 void BLSURFPlugin_Hypothesis_i::SetRemoveTinyEdges(CORBA::Boolean theValue) {
511 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetRemoveTinyEdges");
513 this->GetImpl()->SetRemoveTinyEdges(theValue);
514 std::string theValueStr = theValue ? "True" : "False";
515 SMESH::TPythonDump() << _this() << ".SetRemoveTinyEdges( " << theValueStr.c_str() << " )";
518 //=============================================================================
520 * BLSURFPlugin_Hypothesis_i::GetRemoveTinyEdges
524 //=============================================================================
525 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetRemoveTinyEdges() {
526 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetRemoveTinyEdges");
528 return this->GetImpl()->GetRemoveTinyEdges();
531 //=============================================================================
533 * BLSURFPlugin_Hypothesis_i::SetTinyEdgeLength
535 * Set Tiny Edge Length
537 //=============================================================================
538 void BLSURFPlugin_Hypothesis_i::SetTinyEdgeLength(CORBA::Double theValue) {
539 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTinyEdgeLength");
541 this->GetImpl()->SetTinyEdgeLength(theValue);
542 SMESH::TPythonDump() << _this() << ".SetTinyEdgeLength( " << theValue << " )";
545 //=============================================================================
547 * BLSURFPlugin_Hypothesis_i::GetTinyEdgeLength
549 * Get Tiny Edge Length
551 //=============================================================================
552 CORBA::Double BLSURFPlugin_Hypothesis_i::GetTinyEdgeLength() {
553 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTinyEdgeLength");
555 return this->GetImpl()->GetTinyEdgeLength();
558 //=============================================================================
560 * BLSURFPlugin_Hypothesis_i::SetOptimiseTinyEdges
564 //=============================================================================
565 void BLSURFPlugin_Hypothesis_i::SetOptimiseTinyEdges(CORBA::Boolean theValue) {
566 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetOptimiseTinyEdges");
568 this->GetImpl()->SetOptimiseTinyEdges(theValue);
569 std::string theValueStr = theValue ? "True" : "False";
570 SMESH::TPythonDump() << _this() << ".SetOptimiseTinyEdges( " << theValueStr.c_str() << " )";
573 //=============================================================================
575 * BLSURFPlugin_Hypothesis_i::GetOptimiseTinyEdges
579 //=============================================================================
580 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetOptimiseTinyEdges() {
581 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetOptimiseTinyEdges");
583 return this->GetImpl()->GetOptimiseTinyEdges();
586 //=============================================================================
588 * BLSURFPlugin_Hypothesis_i::SetTinyEdgeOptimisationLength
590 * Set Tiny Edge OptimisationLength
592 //=============================================================================
593 void BLSURFPlugin_Hypothesis_i::SetTinyEdgeOptimisationLength(CORBA::Double theValue) {
594 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTinyEdgeOptimisationLength");
596 this->GetImpl()->SetTinyEdgeOptimisationLength(theValue);
597 SMESH::TPythonDump() << _this() << ".SetTinyEdgeOptimisationLength( " << theValue << " )";
600 //=============================================================================
602 * BLSURFPlugin_Hypothesis_i::GetTinyEdgeOptimisationLength
604 * Get Tiny Edge OptimisationLength
606 //=============================================================================
607 CORBA::Double BLSURFPlugin_Hypothesis_i::GetTinyEdgeOptimisationLength() {
608 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTinyEdgeOptimisationLength");
610 return this->GetImpl()->GetTinyEdgeOptimisationLength();
613 //=============================================================================
615 * BLSURFPlugin_Hypothesis_i::SetCorrectSurfaceIntersection
619 //=============================================================================
620 void BLSURFPlugin_Hypothesis_i::SetCorrectSurfaceIntersection(CORBA::Boolean theValue) {
621 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetCorrectSurfaceIntersection");
623 this->GetImpl()->SetCorrectSurfaceIntersection(theValue);
624 std::string theValueStr = theValue ? "True" : "False";
625 SMESH::TPythonDump() << _this() << ".SetCorrectSurfaceIntersection( " << theValueStr.c_str() << " )";
628 //=============================================================================
630 * BLSURFPlugin_Hypothesis_i::GetCorrectSurfaceIntersection
634 //=============================================================================
635 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetCorrectSurfaceIntersection() {
636 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetCorrectSurfaceIntersection");
638 return this->GetImpl()->GetCorrectSurfaceIntersection();
641 //=============================================================================
643 * BLSURFPlugin_Hypothesis_i::SetCorrectSurfaceIntersectionMaxCost
645 * Set Tiny Edge OptimisationLength
647 //=============================================================================
648 void BLSURFPlugin_Hypothesis_i::SetCorrectSurfaceIntersectionMaxCost(CORBA::Double theValue) {
649 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetCorrectSurfaceIntersectionMaxCost");
651 this->GetImpl()->SetCorrectSurfaceIntersectionMaxCost(theValue);
652 SMESH::TPythonDump() << _this() << ".SetCorrectSurfaceIntersectionMaxCost( " << theValue << " )";
655 //=============================================================================
657 * BLSURFPlugin_Hypothesis_i::GetCorrectSurfaceIntersectionMaxCost
659 * Get Tiny Edge OptimisationLength
661 //=============================================================================
662 CORBA::Double BLSURFPlugin_Hypothesis_i::GetCorrectSurfaceIntersectionMaxCost() {
663 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetCorrectSurfaceIntersectionMaxCost");
665 return this->GetImpl()->GetCorrectSurfaceIntersectionMaxCost();
668 //=============================================================================
670 * BLSURFPlugin_Hypothesis_i::SetBadElementRemoval
674 //=============================================================================
675 void BLSURFPlugin_Hypothesis_i::SetBadElementRemoval(CORBA::Boolean theValue) {
676 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetBadElementRemoval");
678 this->GetImpl()->SetBadElementRemoval(theValue);
679 std::string theValueStr = theValue ? "True" : "False";
680 SMESH::TPythonDump() << _this() << ".SetBadElementRemoval( " << theValueStr.c_str() << " )";
683 //=============================================================================
685 * BLSURFPlugin_Hypothesis_i::GetBadElementRemoval
689 //=============================================================================
690 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetBadElementRemoval() {
691 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetBadElementRemoval");
693 return this->GetImpl()->GetBadElementRemoval();
696 //=============================================================================
698 * BLSURFPlugin_Hypothesis_i::SetBadElementAspectRatio
700 * Set Bad Surface Element Aspect Ratio
702 //=============================================================================
703 void BLSURFPlugin_Hypothesis_i::SetBadElementAspectRatio(CORBA::Double theValue) {
704 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetBadElementAspectRatio");
706 this->GetImpl()->SetBadElementAspectRatio(theValue);
707 SMESH::TPythonDump() << _this() << ".SetBadElementAspectRatio( " << theValue << " )";
710 //=============================================================================
712 * BLSURFPlugin_Hypothesis_i::GetBadElementAspectRatio
714 * Get Bad Surface Element Aspect Ratio
716 //=============================================================================
717 CORBA::Double BLSURFPlugin_Hypothesis_i::GetBadElementAspectRatio() {
718 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetBadElementAspectRatio");
720 return this->GetImpl()->GetBadElementAspectRatio();
723 //=============================================================================
725 * BLSURFPlugin_Hypothesis_i::SetOptimizeMesh
729 //=============================================================================
730 void BLSURFPlugin_Hypothesis_i::SetOptimizeMesh(CORBA::Boolean theValue) {
731 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetOptimizeMesh");
733 this->GetImpl()->SetOptimizeMesh(theValue);
734 std::string theValueStr = theValue ? "True" : "False";
735 SMESH::TPythonDump() << _this() << ".SetOptimizeMesh( " << theValueStr.c_str() << " )";
738 //=============================================================================
740 * BLSURFPlugin_Hypothesis_i::GetOptimizeMesh
744 //=============================================================================
745 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetOptimizeMesh() {
746 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetOptimizeMesh");
748 return this->GetImpl()->GetOptimizeMesh();
751 //=============================================================================
753 * BLSURFPlugin_Hypothesis_i::SetQuadraticMesh
757 //=============================================================================
758 void BLSURFPlugin_Hypothesis_i::SetQuadraticMesh(CORBA::Boolean theValue) {
759 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetQuadraticMesh");
761 this->GetImpl()->SetQuadraticMesh(theValue);
762 std::string theValueStr = theValue ? "True" : "False";
763 SMESH::TPythonDump() << _this() << ".SetQuadraticMesh( " << theValueStr.c_str() << " )";
766 //=============================================================================
768 * BLSURFPlugin_Hypothesis_i::GetQuadraticMesh
772 //=============================================================================
773 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetQuadraticMesh() {
774 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetQuadraticMesh");
776 return this->GetImpl()->GetQuadraticMesh();
784 * BLSURFPlugin_Hypothesis_i::SetTopology
789 //=============================================================================
790 void BLSURFPlugin_Hypothesis_i::SetTopology(CORBA::Long theValue) {
791 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetTopology");
793 this->GetImpl()->SetTopology((::BLSURFPlugin_Hypothesis::Topology) theValue);
794 SMESH::TPythonDump() << _this() << ".SetTopology( " << theValue << " )";
797 //=============================================================================
799 * BLSURFPlugin_Hypothesis_i::GetTopology
803 //=============================================================================
804 CORBA::Long BLSURFPlugin_Hypothesis_i::GetTopology() {
805 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetTopology");
807 return this->GetImpl()->GetTopology();
810 //=============================================================================
811 void BLSURFPlugin_Hypothesis_i::SetVerbosity(CORBA::Short theVal) throw (SALOME::SALOME_Exception) {
813 if (theVal < 0 || theVal > 100)
814 THROW_SALOME_CORBA_EXCEPTION( "Invalid verbosity level",SALOME::BAD_PARAM );
815 this->GetImpl()->SetVerbosity(theVal);
816 SMESH::TPythonDump() << _this() << ".SetVerbosity( " << theVal << " )";
819 //=============================================================================
821 CORBA::Short BLSURFPlugin_Hypothesis_i::GetVerbosity() {
823 return (CORBA::Short) this->GetImpl()->GetVerbosity();
826 //=============================================================================
827 void BLSURFPlugin_Hypothesis_i::SetEnforceCadEdgesSize( CORBA::Boolean toEnforce )
829 if ( GetEnforceCadEdgesSize() != toEnforce )
831 this->GetImpl()->SetEnforceCadEdgesSize(toEnforce);
832 SMESH::TPythonDump() << _this() << ".SetEnforceCadEdgesSize( " << toEnforce << " )";
835 //=============================================================================
836 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetEnforceCadEdgesSize()
838 return this->GetImpl()->GetEnforceCadEdgesSize();
840 //=============================================================================
842 void BLSURFPlugin_Hypothesis_i::SetJacobianRectificationRespectGeometry( CORBA::Boolean allowRectification )
844 if ( GetJacobianRectificationRespectGeometry() != allowRectification )
846 this->GetImpl()->SetJacobianRectificationRespectGeometry(allowRectification);
847 SMESH::TPythonDump() << _this() << ".SetJacobianRectificationRespectGeometry( " << allowRectification << " )";
850 //=============================================================================
851 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetJacobianRectificationRespectGeometry()
853 return this->GetImpl()->GetJacobianRectificationRespectGeometry();
855 //=============================================================================
857 void BLSURFPlugin_Hypothesis_i::SetJacobianRectification( CORBA::Boolean allowRectification )
859 if ( GetJacobianRectification() != allowRectification )
861 this->GetImpl()->SetJacobianRectification(allowRectification);
862 SMESH::TPythonDump() << _this() << ".SetJacobianRectification( " << allowRectification << " )";
865 //=============================================================================
866 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetJacobianRectification()
868 return this->GetImpl()->GetJacobianRectification();
870 //=============================================================================
872 void BLSURFPlugin_Hypothesis_i::SetMaxNumberOfPointsPerPatch( CORBA::Long nb ) throw (SALOME::SALOME_Exception)
874 if ( GetMaxNumberOfPointsPerPatch() != nb )
877 this->GetImpl()->SetMaxNumberOfPointsPerPatch(nb);
879 } catch (const std::invalid_argument& ex) {
880 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
881 } catch (SALOME_Exception& ex) {
882 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
884 SMESH::TPythonDump() << _this() << ".SetMaxNumberOfPointsPerPatch( " << nb << " )";
887 //=============================================================================
888 CORBA::Long BLSURFPlugin_Hypothesis_i::GetMaxNumberOfPointsPerPatch()
890 return this->GetImpl()->GetMaxNumberOfPointsPerPatch();
892 //=============================================================================
894 void BLSURFPlugin_Hypothesis_i::SetRespectGeometry( CORBA::Boolean toRespect )
896 if ( GetRespectGeometry() != toRespect )
898 this->GetImpl()->SetRespectGeometry(toRespect);
899 SMESH::TPythonDump() << _this() << ".SetRespectGeometry( " << toRespect << " )";
902 //=============================================================================
903 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetRespectGeometry()
905 return this->GetImpl()->GetRespectGeometry();
907 //=============================================================================
909 void BLSURFPlugin_Hypothesis_i::SetTinyEdgesAvoidSurfaceIntersections( CORBA::Boolean toAvoidIntersection )
911 if ( GetTinyEdgesAvoidSurfaceIntersections() != toAvoidIntersection )
913 this->GetImpl()->SetTinyEdgesAvoidSurfaceIntersections(toAvoidIntersection);
914 SMESH::TPythonDump() << _this() << ".SetTinyEdgesAvoidSurfaceIntersections( " << toAvoidIntersection << " )";
917 //=============================================================================
918 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetTinyEdgesAvoidSurfaceIntersections()
920 return this->GetImpl()->GetTinyEdgesAvoidSurfaceIntersections();
922 //=============================================================================
924 void BLSURFPlugin_Hypothesis_i::SetClosedGeometry( CORBA::Boolean isClosed )
926 if ( GetClosedGeometry() != isClosed )
928 this->GetImpl()->SetClosedGeometry(isClosed);
929 SMESH::TPythonDump() << _this() << ".SetClosedGeometry( " << isClosed << " )";
932 //=============================================================================
933 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetClosedGeometry()
935 return this->GetImpl()->GetClosedGeometry();
937 //=============================================================================
939 void BLSURFPlugin_Hypothesis_i::SetDebug( CORBA::Boolean isDebug )
941 if ( GetDebug() != isDebug )
943 this->GetImpl()->SetDebug(isDebug);
944 SMESH::TPythonDump() << _this() << ".SetDebug( " << isDebug << " )";
947 //=============================================================================
948 bool BLSURFPlugin_Hypothesis_i::GetDebug()
950 return this->GetImpl()->GetDebug();
952 //=============================================================================
954 void BLSURFPlugin_Hypothesis_i::SetPeriodicTolerance( CORBA::Double tol ) throw (SALOME::SALOME_Exception)
957 if ( GetImpl()->GetPreCADOptionValue("periodic_tolerance",&isDefault) != SMESH_Comment( tol ))
961 this->GetImpl()->SetPeriodicTolerance(tol);
963 } catch (const std::invalid_argument& ex) {
964 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
965 } catch (SALOME_Exception& ex) {
966 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
968 SMESH::TPythonDump() << _this() << ".SetPeriodicTolerance( " << tol << " )";
971 //=============================================================================
972 double BLSURFPlugin_Hypothesis_i::GetPeriodicTolerance() throw (SALOME::SALOME_Exception)
975 return this->GetImpl()->GetPeriodicTolerance();
977 } catch (const std::invalid_argument& ex) {
978 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
979 } catch (SALOME_Exception& ex) {
980 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
984 //=============================================================================
986 void BLSURFPlugin_Hypothesis_i::SetRequiredEntities( const char* howToTreat ) throw (SALOME::SALOME_Exception)
988 if ( GetImpl()->GetRequiredEntities() != howToTreat )
991 this->GetImpl()->SetRequiredEntities(howToTreat);
993 } catch (const std::invalid_argument& ex) {
994 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
995 } catch (SALOME_Exception& ex) {
996 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
998 SMESH::TPythonDump() << _this() << ".SetRequiredEntities( '" << howToTreat << "' )";
1001 //=============================================================================
1002 char* BLSURFPlugin_Hypothesis_i::GetRequiredEntities()
1004 return CORBA::string_dup( this->GetImpl()->GetRequiredEntities().c_str() );
1006 //=============================================================================
1008 void BLSURFPlugin_Hypothesis_i::SetSewingTolerance( CORBA::Double tol ) throw (SALOME::SALOME_Exception)
1011 if ( GetImpl()->GetPreCADOptionValue("sewing_tolerance",&isDefault) != SMESH_Comment( tol ))
1015 this->GetImpl()->SetSewingTolerance(tol);
1016 SMESH::TPythonDump() << _this() << ".SetSewingTolerance( " << tol << " )";
1018 } catch (const std::invalid_argument& ex) {
1019 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1020 } catch (SALOME_Exception& ex) {
1021 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1025 //=============================================================================
1026 CORBA::Double BLSURFPlugin_Hypothesis_i::GetSewingTolerance() throw (SALOME::SALOME_Exception)
1030 return this->GetImpl()->GetSewingTolerance();
1032 } catch (const std::invalid_argument& ex) {
1033 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1034 } catch (SALOME_Exception& ex) {
1035 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1039 //=============================================================================
1041 void BLSURFPlugin_Hypothesis_i::SetTags( const char* howToTreat ) throw (SALOME::SALOME_Exception)
1043 if ( GetImpl()->GetTags() != howToTreat )
1046 this->GetImpl()->SetTags(howToTreat);
1048 catch (const std::invalid_argument& ex) {
1049 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1050 } catch (SALOME_Exception& ex) {
1051 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1054 SMESH::TPythonDump() << _this() << ".SetTags( '" << howToTreat << "' )";
1056 //=============================================================================
1057 char* BLSURFPlugin_Hypothesis_i::GetTags()
1059 return CORBA::string_dup( this->GetImpl()->GetTags().c_str() );
1062 //=============================================================================
1064 * BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges
1068 //=============================================================================
1069 void BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges(CORBA::Boolean theValue) {
1070 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges");
1072 this->GetImpl()->SetPreCADMergeEdges(theValue);
1073 std::string theValueStr = theValue ? "True" : "False";
1074 SMESH::TPythonDump() << _this() << ".SetPreCADMergeEdges( " << theValueStr.c_str() << " )";
1077 //=============================================================================
1079 * BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges
1083 //=============================================================================
1084 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges() {
1085 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges");
1087 return this->GetImpl()->GetPreCADMergeEdges();
1090 //=============================================================================
1092 * BLSURFPlugin_Hypothesis_i::SetPreCADRemoveTinyUVEdges
1096 //=============================================================================
1097 void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveTinyUVEdges(CORBA::Boolean theValue) {
1098 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADRemoveTinyUVEdges");
1100 this->GetImpl()->SetPreCADRemoveTinyUVEdges(theValue);
1101 std::string theValueStr = theValue ? "True" : "False";
1102 SMESH::TPythonDump() << _this() << ".SetPreCADRemoveTinyUVEdges( " << theValueStr.c_str() << " )";
1105 //=============================================================================
1107 * BLSURFPlugin_Hypothesis_i::GetPreCADRemoveTinyUVEdges
1111 //=============================================================================
1112 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveTinyUVEdges() {
1113 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADRemoveTinyUVEdges");
1115 return this->GetImpl()->GetPreCADRemoveTinyUVEdges();
1118 //=============================================================================
1120 * BLSURFPlugin_Hypothesis_i::SetPreCADRemoveDuplicateCADFaces
1124 //=============================================================================
1125 void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveDuplicateCADFaces(CORBA::Boolean theValue) {
1126 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADRemoveDuplicateCADFaces");
1128 this->GetImpl()->SetPreCADRemoveDuplicateCADFaces(theValue);
1129 std::string theValueStr = theValue ? "True" : "False";
1130 SMESH::TPythonDump() << _this() << ".SetPreCADRemoveDuplicateCADFaces( " << theValueStr.c_str() << " )";
1133 //=============================================================================
1135 * BLSURFPlugin_Hypothesis_i::GetPreCADRemoveDuplicateCADFaces
1139 //=============================================================================
1140 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveDuplicateCADFaces() {
1141 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADRemoveDuplicateCADFaces");
1143 return this->GetImpl()->GetPreCADRemoveDuplicateCADFaces();
1146 //=============================================================================
1148 * BLSURFPlugin_Hypothesis_i::SetPreCADProcess3DTopology
1152 //=============================================================================
1153 void BLSURFPlugin_Hypothesis_i::SetPreCADProcess3DTopology(CORBA::Boolean theValue) {
1154 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADProcess3DTopology");
1156 this->GetImpl()->SetPreCADProcess3DTopology(theValue);
1157 std::string theValueStr = theValue ? "True" : "False";
1158 SMESH::TPythonDump() << _this() << ".SetPreCADProcess3DTopology( " << theValueStr.c_str() << " )";
1161 //=============================================================================
1163 * BLSURFPlugin_Hypothesis_i::GetPreCADProcess3DTopology
1167 //=============================================================================
1168 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADProcess3DTopology() {
1169 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADProcess3DTopology");
1171 return this->GetImpl()->GetPreCADProcess3DTopology();
1174 //=============================================================================
1176 * BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput
1180 //=============================================================================
1181 void BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput(CORBA::Boolean theValue) {
1182 // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput");
1184 this->GetImpl()->SetPreCADDiscardInput(theValue);
1185 std::string theValueStr = theValue ? "True" : "False";
1186 SMESH::TPythonDump() << _this() << ".SetPreCADDiscardInput( " << theValueStr.c_str() << " )";
1189 //=============================================================================
1191 * BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput
1195 //=============================================================================
1196 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput() {
1197 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput");
1199 return this->GetImpl()->GetPreCADDiscardInput();
1203 //=============================================================================
1205 void BLSURFPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const char* optionValue)
1206 throw (SALOME::SALOME_Exception) {
1209 std::string name( optionName );
1210 if ( !optionValue || !optionValue[0] )
1211 UnsetOption( optionName );
1213 // basic options (visible in Advanced table)
1215 else if ( name == "enforce_cad_edge_sizes" )
1216 SetEnforceCadEdgesSize( GetImpl()->ToBool( optionValue ));
1218 else if ( name == "jacobian_rectification_respect_geometry" )
1219 SetJacobianRectificationRespectGeometry( GetImpl()->ToBool( optionValue ));
1221 else if ( name == "max_number_of_points_per_patch" )
1222 SetMaxNumberOfPointsPerPatch( GetImpl()->ToInt( optionValue ));
1224 else if ( name == "rectify_jacobian" )
1225 SetJacobianRectification( GetImpl()->ToBool( optionValue ));
1227 else if ( name == "respect_geometry" )
1228 SetRespectGeometry( GetImpl()->ToBool( optionValue ));
1230 else if ( name == "tiny_edge_avoid_surface_intersections" )
1231 SetTinyEdgesAvoidSurfaceIntersections( GetImpl()->ToBool( optionValue ));
1233 else if ( name == "closed_geometry" )
1234 SetClosedGeometry( GetImpl()->ToBool( optionValue ));
1236 else if ( name == "debug" )
1237 SetDebug( GetImpl()->ToBool( optionValue ));
1239 else if ( name == "discard_input_topology" )
1240 SetPreCADDiscardInput( GetImpl()->ToBool( optionValue ));
1242 else if ( name == "merge_edges" )
1243 SetPreCADMergeEdges( GetImpl()->ToBool( optionValue ));
1245 else if ( name == "periodic_tolerance" )
1246 SetPeriodicTolerance( GetImpl()->ToDbl( optionValue ));
1248 else if ( name == "remove_duplicate_cad_faces" )
1249 SetPreCADRemoveDuplicateCADFaces( GetImpl()->ToBool( optionValue ));
1251 else if ( name == "required_entities" )
1252 SetRequiredEntities( optionValue );
1254 else if ( name == "sewing_tolerance" )
1255 SetSewingTolerance( GetImpl()->ToDbl( optionValue ));
1257 else if ( name == "tags" )
1258 SetTags( optionValue );
1260 // other basic options with specific methods
1262 else if ( name == "correct_surface_intersections" )
1263 SetCorrectSurfaceIntersection( GetImpl()->ToBool( optionValue ));
1265 else if ( name == "optimise_tiny_edges" )
1266 SetOptimiseTinyEdges( GetImpl()->ToBool( optionValue ));
1268 else if ( name == "surface_intersections_processing_max_cost" )
1269 SetCorrectSurfaceIntersectionMaxCost( GetImpl()->ToDbl( optionValue ));
1271 else if ( name == "volume_gradation" )
1272 SetVolumeGradation( GetImpl()->ToDbl( optionValue ));
1274 else if ( name == "tiny_edge_optimisation_length" )
1275 SetTinyEdgeOptimisationLength( GetImpl()->ToDbl( optionValue ));
1277 // advanced options (for backward compatibility)
1279 else if ( name == "create_tag_on_collision" ||
1280 name == "tiny_edge_respect_geometry" )
1281 AddOption( optionName, optionValue );
1285 valueChanged = ( this->GetImpl()->GetOptionValue( name ) != optionValue &&
1286 this->GetImpl()->GetOptionValue( name, &valueChanged ) != optionValue );
1289 this->GetImpl()->SetOptionValue(optionName, optionValue);
1290 SMESH::TPythonDump() << _this() << ".SetOptionValue( '" << optionName << "', '" << optionValue << "' )";
1293 } catch (const std::invalid_argument& ex) {
1294 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1295 } catch (SALOME_Exception& ex) {
1296 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1300 //=============================================================================
1302 void BLSURFPlugin_Hypothesis_i::SetPreCADOptionValue(const char* optionName, const char* optionValue)
1303 throw (SALOME::SALOME_Exception) {
1305 bool valueChanged = false;
1307 std::string name( optionName );
1308 if ( !optionValue || !optionValue[0] )
1309 UnsetOption( optionName );
1311 else if ( name == "closed_geometry" )
1312 SetClosedGeometry( GetImpl()->ToBool( optionValue ));
1314 else if ( name == "debug" )
1315 SetDebug( GetImpl()->ToBool( optionValue ));
1317 else if ( name == "discard_input_topology" )
1318 SetPreCADDiscardInput( GetImpl()->ToBool( optionValue ));
1320 else if ( name == "merge_edges" )
1321 SetPreCADMergeEdges( GetImpl()->ToBool( optionValue ));
1323 else if ( name == "periodic_tolerance" )
1324 SetPeriodicTolerance( GetImpl()->ToDbl( optionValue ));
1326 else if ( name == "remove_duplicate_cad_faces" )
1327 SetPreCADRemoveDuplicateCADFaces( GetImpl()->ToBool( optionValue ));
1329 else if ( name == "required_entities" )
1330 SetRequiredEntities( optionValue );
1332 else if ( name == "sewing_tolerance" )
1333 SetSewingTolerance( GetImpl()->ToDbl( optionValue ));
1335 else if ( name == "tags" )
1336 SetTags( optionValue );
1338 // other basic options with specific methods
1340 else if ( name == "correct_surface_intersections" )
1341 SetCorrectSurfaceIntersection( GetImpl()->ToBool( optionValue ));
1343 else if ( name == "optimise_tiny_edges" )
1344 SetOptimiseTinyEdges( GetImpl()->ToBool( optionValue ));
1346 else if ( name == "surface_intersections_processing_max_cost" )
1347 SetCorrectSurfaceIntersectionMaxCost( GetImpl()->ToDbl( optionValue ));
1349 else if ( name == "volume_gradation" )
1350 SetVolumeGradation( GetImpl()->ToDbl( optionValue ));
1352 else if ( name == "tiny_edge_optimisation_length" )
1353 SetTinyEdgeOptimisationLength( GetImpl()->ToDbl( optionValue ));
1355 else if ( name == "remove_tiny_uv_edges" )
1356 SetPreCADRemoveTinyUVEdges( GetImpl()->ToBool( optionValue ));
1358 else if ( name == "process_3d_topology" )
1359 SetPreCADProcess3DTopology( GetImpl()->ToBool( optionValue ));
1361 // advanced options (for backward compatibility)
1363 else if ( name == "create_tag_on_collision" ||
1364 name == "tiny_edge_respect_geometry" ||
1365 name == "remove_tiny_edges" ||
1366 name == "tiny_edge_length")
1367 AddPreCADOption( optionName, optionValue );
1370 valueChanged = (this->GetImpl()->GetPreCADOptionValue(optionName) != optionValue);
1372 this->GetImpl()->SetPreCADOptionValue(optionName, optionValue);
1374 } catch (const std::invalid_argument& ex) {
1375 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1376 } catch (SALOME_Exception& ex) {
1377 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1380 SMESH::TPythonDump() << _this() << ".SetPreCADOptionValue( '" << optionName << "', '" << optionValue << "' )";
1383 //=============================================================================
1385 char* BLSURFPlugin_Hypothesis_i::GetOptionValue(const char* optionName) throw (SALOME::SALOME_Exception) {
1389 return CORBA::string_dup(this->GetImpl()->GetOptionValue(optionName,&isDefault).c_str());
1390 } catch (const std::invalid_argument& ex) {
1391 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1392 } catch (SALOME_Exception& ex) {
1393 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1398 //=============================================================================
1400 char* BLSURFPlugin_Hypothesis_i::GetPreCADOptionValue(const char* optionName) throw (SALOME::SALOME_Exception) {
1404 return CORBA::string_dup(this->GetImpl()->GetPreCADOptionValue(optionName,&isDefault).c_str());
1405 } catch (const std::invalid_argument& ex) {
1406 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1407 } catch (SALOME_Exception& ex) {
1408 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1413 //=============================================================================
1415 void BLSURFPlugin_Hypothesis_i::UnsetOption(const char* optionName) {
1417 if ( !GetImpl()->GetOptionValue( optionName ).empty() )
1419 this->GetImpl()->ClearOption(optionName);
1420 SMESH::TPythonDump() << _this() << ".UnsetOption( '" << optionName << "' )";
1424 //=============================================================================
1426 void BLSURFPlugin_Hypothesis_i::UnsetPreCADOption(const char* optionName) {
1428 if ( !GetImpl()->GetPreCADOptionValue( optionName ).empty() )
1430 this->GetImpl()->ClearPreCADOption(optionName);
1431 SMESH::TPythonDump() << _this() << ".UnsetPreCADOption( '" << optionName << "' )";
1435 //=============================================================================
1437 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetOptionValues() {
1439 BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
1441 const ::BLSURFPlugin_Hypothesis::TOptionValues & opts = this->GetImpl()->GetOptionValues();
1442 result->length(opts.size());
1446 ::BLSURFPlugin_Hypothesis::TOptionValues::const_iterator opIt = opts.begin();
1447 for (; opIt != opts.end(); ++opIt, ++i) {
1448 string name_value_type = opIt->first;
1449 if (!opIt->second.empty()) {
1450 name_value_type += ":";
1451 name_value_type += GetImpl()->GetOptionValue( opIt->first, &isDefault );
1452 name_value_type += isDefault ? ":0" : ":1";
1454 result[i] = CORBA::string_dup(name_value_type.c_str());
1457 return result._retn();
1460 //=============================================================================
1462 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetPreCADOptionValues() {
1464 BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
1466 const ::BLSURFPlugin_Hypothesis::TOptionValues & opts = this->GetImpl()->GetPreCADOptionValues();
1467 result->length(opts.size());
1471 ::BLSURFPlugin_Hypothesis::TOptionValues::const_iterator opIt = opts.begin();
1472 for (; opIt != opts.end(); ++opIt, ++i) {
1473 string name_value_type = opIt->first;
1474 if (!opIt->second.empty()) {
1475 name_value_type += ":";
1476 name_value_type += GetImpl()->GetPreCADOptionValue( opIt->first, &isDefault );
1477 name_value_type += isDefault ? ":0" : ":1";
1479 result[i] = CORBA::string_dup(name_value_type.c_str());
1481 return result._retn();
1484 //=============================================================================
1486 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetAdvancedOptionValues()
1488 BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
1490 const ::BLSURFPlugin_Hypothesis::TOptionValues & custom_opts = this->GetImpl()->GetCustomOptionValues();
1491 result->length(custom_opts.size());
1494 ::BLSURFPlugin_Hypothesis::TOptionValues::const_iterator opIt = custom_opts.begin();
1495 for (; opIt != custom_opts.end(); ++opIt, ++i) {
1496 string name_value_type = opIt->first;
1497 if (!opIt->second.empty()) {
1498 name_value_type += ":";
1499 name_value_type += opIt->second;
1500 name_value_type += ":1"; // user defined
1502 result[i] = CORBA::string_dup(name_value_type.c_str());
1504 return result._retn();
1507 //=============================================================================
1509 void BLSURFPlugin_Hypothesis_i::SetOptionValues(const BLSURFPlugin::string_array& options)
1510 throw (SALOME::SALOME_Exception) {
1512 for (CORBA::ULong i = 0; i < options.length(); ++i) {
1513 string name_value_type = options[i].in();
1514 if(name_value_type.empty())
1516 size_t colonPos = name_value_type.find(':');
1518 if (colonPos == string::npos) // ':' not found
1519 name = name_value_type;
1521 name = name_value_type.substr(0, colonPos);
1522 if (colonPos < name_value_type.size() - 1 && name_value_type[colonPos] != ' ') {
1523 string value_type = name_value_type.substr(colonPos + 1);
1524 colonPos = value_type.find(':');
1525 value = value_type.substr(0, colonPos);
1526 if (colonPos < value_type.size() - 1 && value_type[colonPos] != ' ')
1527 if ( value_type.substr(colonPos + 1) == "0" ) // is default
1531 SetOptionValue(name.c_str(), value.c_str());
1535 //=============================================================================
1537 void BLSURFPlugin_Hypothesis_i::SetPreCADOptionValues(const BLSURFPlugin::string_array& options)
1538 throw (SALOME::SALOME_Exception) {
1540 for ( CORBA::ULong i = 0; i < options.length(); ++i) {
1541 string name_value_type = options[i].in();
1542 if(name_value_type.empty())
1544 size_t colonPos = name_value_type.find(':');
1546 if (colonPos == string::npos) // ':' not found
1547 name = name_value_type;
1549 name = name_value_type.substr(0, colonPos);
1550 if (colonPos < name_value_type.size() - 1 && name_value_type[colonPos] != ' ') {
1551 string value_type = name_value_type.substr(colonPos + 1);
1552 colonPos = value_type.find(':');
1553 value = value_type.substr(0, colonPos);
1554 if (colonPos < value_type.size() - 1 && value_type[colonPos] != ' ')
1555 if ( value_type.substr(colonPos + 1) == "0" ) // is default
1559 SetPreCADOptionValue(name.c_str(), value.c_str());
1563 //=============================================================================
1565 void BLSURFPlugin_Hypothesis_i::SetAdvancedOptionValues(const BLSURFPlugin::string_array& options)
1567 SMESH::TPythonDump dump;
1569 string optionsAndValues;
1570 for ( CORBA::ULong i = 0; i < options.length(); ++i) {
1571 string name_value_type = options[i].in();
1572 if(name_value_type.empty())
1574 size_t colonPos = name_value_type.find(':');
1576 if (colonPos == string::npos) // ':' not found
1577 name = name_value_type;
1579 name = name_value_type.substr(0, colonPos);
1580 if (colonPos < name_value_type.size() - 1 && name_value_type[colonPos] != ' ') {
1581 string value_type = name_value_type.substr(colonPos + 1);
1582 colonPos = value_type.find(':');
1583 value = value_type.substr(0, colonPos);
1586 AddOption(name.c_str(), value.c_str());
1588 optionsAndValues += name + " " + value + " ";
1591 if ( !optionsAndValues.empty() )
1592 dump << _this() << ".SetAdvancedOptions( '" << optionsAndValues.c_str() << "' )";
1595 //=============================================================================
1597 void BLSURFPlugin_Hypothesis_i::SetAdvancedOption(const char* optionsAndValues)
1598 throw (SALOME::SALOME_Exception)
1600 if ( !optionsAndValues ) return;
1602 SMESH::TPythonDump dump;
1604 std::istringstream strm( optionsAndValues );
1605 std::istream_iterator<std::string> sIt( strm ), sEnd;
1606 while ( sIt != sEnd )
1608 std::string option = *sIt;
1609 if ( ++sIt != sEnd )
1611 std::string value = *sIt;
1613 AddOption( option.c_str(), value.c_str() );
1617 THROW_SALOME_CORBA_EXCEPTION( "Uneven number of options and values" ,SALOME::BAD_PARAM );
1620 dump << _this() << ".SetAdvancedOption( '" << optionsAndValues << "' )";
1623 //=============================================================================
1625 void BLSURFPlugin_Hypothesis_i::AddOption(const char* optionName, const char* optionValue)
1628 bool valueChanged = (this->GetImpl()->GetOption(optionName) != optionValue);
1630 this->GetImpl()->AddOption(optionName, optionValue);
1631 SMESH::TPythonDump() << _this() << ".AddOption( '" << optionName << "', '" << optionValue << "' )";
1635 //=============================================================================
1637 void BLSURFPlugin_Hypothesis_i::AddPreCADOption(const char* optionName, const char* optionValue)
1640 bool valueChanged = (this->GetImpl()->GetPreCADOption(optionName) != optionValue);
1642 this->GetImpl()->AddPreCADOption(optionName, optionValue);
1643 SMESH::TPythonDump() << _this() << ".AddPreCADOption( '" << optionName << "', '" << optionValue << "' )";
1647 //=============================================================================
1649 char* BLSURFPlugin_Hypothesis_i::GetOption(const char* optionName)
1652 return CORBA::string_dup(this->GetImpl()->GetOption(optionName).c_str());
1655 //=============================================================================
1657 char* BLSURFPlugin_Hypothesis_i::GetPreCADOption(const char* optionName)
1660 return CORBA::string_dup(this->GetImpl()->GetPreCADOption(optionName).c_str());
1663 //=============================================================================
1665 void BLSURFPlugin_Hypothesis_i::SetSizeMapEntry(const char* entry, const char* sizeMap)
1666 throw (SALOME::SALOME_Exception) {
1668 MESSAGE("ENGINE : SETSIZEMAP START ENTRY : " << entry);
1669 if ( !entry || !entry[0] )
1670 THROW_SALOME_CORBA_EXCEPTION( "SetSizeMapEntry(): empty geom entry", SALOME::BAD_PARAM );
1671 bool valueChanged = false;
1673 valueChanged = (this->GetImpl()->GetSizeMapEntry(entry) != sizeMap);
1675 this->GetImpl()->SetSizeMapEntry(entry, sizeMap);
1676 } catch (const std::invalid_argument& ex) {
1677 SALOME::ExceptionStruct ExDescription;
1678 ExDescription.text = ex.what();
1679 ExDescription.type = SALOME::BAD_PARAM;
1680 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetSizeMapEntry(entry,sizemap)";
1681 ExDescription.lineNumber = 0;
1682 throw SALOME::SALOME_Exception(ExDescription);
1683 } catch (SALOME_Exception& ex) {
1684 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1686 MESSAGE("ENGINE : SETSIZEMAP END ENTRY : " << entry);
1688 SMESH::TPythonDump() << _this() << ".SetSizeMap(" << entry << ", '" << sizeMap << "' )";
1691 //=============================================================================
1693 void BLSURFPlugin_Hypothesis_i::SetConstantSizeMapEntry(const char* entry, GEOM::shape_type shapeType, CORBA::Double sizeMap)
1694 throw (SALOME::SALOME_Exception) {
1696 MESSAGE("ENGINE : SETSIZEMAP START ENTRY : " << entry);
1697 bool valueChanged = false;
1698 std::ostringstream sizeMapFunction;
1699 switch (shapeType) {
1700 case GEOM::FACE: sizeMapFunction << "def f(u,v): return " << sizeMap ; break;
1701 case GEOM::EDGE: sizeMapFunction << "def f(t): return " << sizeMap ; break;
1702 case GEOM::VERTEX: sizeMapFunction << "def f(): return " << sizeMap ; break;
1706 valueChanged = (this->GetImpl()->GetSizeMapEntry(entry) != sizeMapFunction.str());
1708 this->GetImpl()->SetSizeMapEntry(entry, sizeMapFunction.str());
1709 } catch (const std::invalid_argument& ex) {
1710 SALOME::ExceptionStruct ExDescription;
1711 ExDescription.text = ex.what();
1712 ExDescription.type = SALOME::BAD_PARAM;
1713 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetSizeMapEntry(entry,sizemap)";
1714 ExDescription.lineNumber = 0;
1715 throw SALOME::SALOME_Exception(ExDescription);
1716 } catch (SALOME_Exception& ex) {
1717 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1719 MESSAGE("ENGINE : SETSIZEMAP END ENTRY : " << entry);
1721 SMESH::TPythonDump() << _this() << ".SetConstantSizeMap(" << entry << ", '" << sizeMap << "' )";
1724 //=============================================================================
1726 void BLSURFPlugin_Hypothesis_i::SetAttractorEntry(const char* entry, const char* attractor)
1727 throw (SALOME::SALOME_Exception) {
1729 MESSAGE("ENGINE : SETATTRACTOR START ENTRY : " << entry);
1730 bool valueChanged = false;
1732 valueChanged = ( this->GetImpl()->GetAttractorEntry(entry) != attractor );
1733 if ( valueChanged ) {
1734 boost::regex re("^ATTRACTOR\\((?:(-?0(\\.\\d*)*|-?[1-9]+\\d*(\\.\\d*)*|-?\\.(\\d)+);){5}(True|False)(?:;(-?0(\\.\\d*)*|-?[1-9]+\\d*(\\.\\d*)*|-?\\.(\\d)+))?\\)$");
1735 if (!boost::regex_match(string(attractor), re))
1736 throw std::invalid_argument("Error: an attractor is defined with the following pattern: ATTRACTOR(xa;ya;za;a;b;True|False;d(opt.))");
1737 this->GetImpl()->SetAttractorEntry(entry, attractor);
1739 } catch (const std::invalid_argument& ex) {
1740 SALOME::ExceptionStruct ExDescription;
1741 ExDescription.text = ex.what();
1742 ExDescription.type = SALOME::BAD_PARAM;
1743 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetAttractorEntry(entry,attractor)";
1744 ExDescription.lineNumber = 0;
1745 throw SALOME::SALOME_Exception(ExDescription);
1746 } catch (SALOME_Exception& ex) {
1747 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1749 MESSAGE("ENGINE : SETATTRACTOR END ENTRY : " << entry);
1751 SMESH::TPythonDump() << _this() << ".SetAttractor(" << entry << ", '" << attractor << "' )";
1754 //=============================================================================
1756 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
1757 throw (SALOME::SALOME_Exception)
1760 MESSAGE("ENGINE : SETATTRACTOR START ENTRY : " << entry);
1761 //bool valueChanged = false;
1763 this->GetImpl()->SetClassAttractorEntry(entry, att_entry, StartSize, EndSize, ActionRadius, ConstantRadius);
1765 catch (const std::invalid_argument& ex) {
1766 SALOME::ExceptionStruct ExDescription;
1767 ExDescription.text = ex.what();
1768 ExDescription.type = SALOME::BAD_PARAM;
1769 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetClassAttractorEntry(entry, att_entry, StartSize, EndSize, ActionRadius, ConstantRadius)";
1770 ExDescription.lineNumber = 0;
1771 throw SALOME::SALOME_Exception(ExDescription);
1772 } catch (SALOME_Exception& ex) {
1773 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1775 MESSAGE("ENGINE : SETATTRACTOR END ENTRY : " << entry);
1776 //if ( valueChanged )
1777 SMESH::TPythonDump() << _this() << ".SetAttractorGeom( "
1778 << entry << ", " << att_entry << ", "<<StartSize<<", "<<EndSize<<", "<<ActionRadius<<", "<<ConstantRadius<<" )";
1781 //=============================================================================
1783 char* BLSURFPlugin_Hypothesis_i::GetSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception) {
1786 return CORBA::string_dup(this->GetImpl()->GetSizeMapEntry(entry).c_str());
1787 } catch (const std::invalid_argument& ex) {
1788 SALOME::ExceptionStruct ExDescription;
1789 ExDescription.text = ex.what();
1790 ExDescription.type = SALOME::BAD_PARAM;
1791 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetSizeMapEntry(name)";
1792 ExDescription.lineNumber = 0;
1793 throw SALOME::SALOME_Exception(ExDescription);
1794 } catch (SALOME_Exception& ex) {
1795 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1800 //=============================================================================
1802 char* BLSURFPlugin_Hypothesis_i::GetAttractorEntry(const char* entry) throw (SALOME::SALOME_Exception) {
1805 return CORBA::string_dup(this->GetImpl()->GetAttractorEntry(entry).c_str());
1806 } catch (const std::invalid_argument& ex) {
1807 SALOME::ExceptionStruct ExDescription;
1808 ExDescription.text = ex.what();
1809 ExDescription.type = SALOME::BAD_PARAM;
1810 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetAttractorEntry(name)";
1811 ExDescription.lineNumber = 0;
1812 throw SALOME::SALOME_Exception(ExDescription);
1813 } catch (SALOME_Exception& ex) {
1814 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1819 // //=============================================================================
1821 // // TODO coder cette fonction (utilisée pour savoir si la valeur a changé
1822 // // A finir pour le dump
1823 // char* BLSURFPlugin_Hypothesis_i::GetClassAttractorEntry(const char* entry)
1824 // throw (SALOME::SALOME_Exception)
1826 // ASSERT(myBaseImpl);
1828 // return CORBA::string_dup( this->GetImpl()->GetClassAttractorEntry(entry).c_str());
1830 // catch (const std::invalid_argument& ex) {
1831 // SALOME::ExceptionStruct ExDescription;
1832 // ExDescription.text = ex.what();
1833 // ExDescription.type = SALOME::BAD_PARAM;
1834 // ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::GetClassAttractorEntry(name)";
1835 // ExDescription.lineNumber = 0;
1836 // throw SALOME::SALOME_Exception(ExDescription);
1838 // catch (SALOME_Exception& ex) {
1839 // THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
1844 //=============================================================================
1846 void BLSURFPlugin_Hypothesis_i::UnsetEntry(const char* entry) {
1848 this->GetImpl()->ClearEntry(entry);
1849 // SMESH::TPythonDump() << _this() << ".UnsetSizeMap( " << entry << " )";
1852 //=============================================================================
1854 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetSizeMapEntries() {
1856 BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
1858 const ::BLSURFPlugin_Hypothesis::TSizeMap sizeMaps = this->GetImpl()->_GetSizeMapEntries();
1859 result->length(sizeMaps.size());
1861 ::BLSURFPlugin_Hypothesis::TSizeMap::const_iterator smIt = sizeMaps.begin();
1862 for (int i = 0; smIt != sizeMaps.end(); ++smIt, ++i) {
1863 string entry_sizemap = smIt->first;
1864 if (!smIt->second.empty()) {
1865 entry_sizemap += "|";
1866 entry_sizemap += smIt->second;
1868 result[i] = CORBA::string_dup(entry_sizemap.c_str());
1870 return result._retn();
1873 //=============================================================================
1875 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetAttractorEntries() {
1877 BLSURFPlugin::string_array_var result = new BLSURFPlugin::string_array();
1879 const ::BLSURFPlugin_Hypothesis::TSizeMap attractors = this->GetImpl()->_GetAttractorEntries();
1880 result->length(attractors.size());
1882 ::BLSURFPlugin_Hypothesis::TSizeMap::const_iterator atIt = attractors.begin();
1883 for (int i = 0; atIt != attractors.end(); ++atIt, ++i) {
1884 string entry_attractor = atIt->first;
1885 if (!atIt->second.empty()) {
1886 entry_attractor += "|";
1887 entry_attractor += atIt->second;
1889 result[i] = CORBA::string_dup(entry_attractor.c_str());
1891 return result._retn();
1894 //=============================================================================
1896 BLSURFPlugin::TAttParamsMap* BLSURFPlugin_Hypothesis_i::GetAttractorParams()
1899 BLSURFPlugin::TAttParamsMap_var result = new BLSURFPlugin::TAttParamsMap();
1901 const ::BLSURFPlugin_Hypothesis::TAttractorMap attractors= this->GetImpl()->_GetClassAttractorEntries();
1902 result->length( attractors.size() );
1904 ::BLSURFPlugin_Hypothesis::TAttractorMap::const_iterator atIt = attractors.begin();
1905 for ( int i = 0 ; atIt != attractors.end(); ++atIt, ++i ) {
1906 string faceEntry = atIt->first;
1908 double startSize, endSize, infDist, constDist;
1909 if ( !atIt->second->Empty() ) {
1910 attEntry = atIt->second->GetAttractorEntry();
1911 MESSAGE("GetAttractorParams : attEntry ="<<attEntry)
1912 std::vector<double> params = atIt->second->GetParameters();
1913 startSize = params[0];
1914 endSize = params[1];
1915 infDist = params[2];
1916 constDist = params[3];
1918 result[i].faceEntry = CORBA::string_dup(faceEntry.c_str());
1919 result[i].attEntry = CORBA::string_dup(attEntry.c_str());
1920 result[i].startSize = startSize;
1921 result[i].endSize = endSize;
1922 result[i].infDist = infDist;
1923 result[i].constDist = constDist;
1924 MESSAGE("GetAttractorParams : result[i].attEntry ="<<result[i].attEntry)
1925 MESSAGE("GetAttractorParams : result[i].faceEntry ="<<result[i].faceEntry)
1927 return result._retn();
1930 //=============================================================================
1932 void BLSURFPlugin_Hypothesis_i::SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps)
1933 throw (SALOME::SALOME_Exception) {
1935 for ( CORBA::ULong i = 0; i < sizeMaps.length(); ++i) {
1936 string entry_sizemap = sizeMaps[i].in();
1937 size_t colonPos = entry_sizemap.find('|');
1938 string entry, sizemap;
1939 if (colonPos == string::npos) // '|' separator not found
1940 entry = entry_sizemap;
1942 entry = entry_sizemap.substr(0, colonPos);
1943 if (colonPos < entry_sizemap.size() - 1 && entry_sizemap[colonPos] != ' ')
1944 sizemap = entry_sizemap.substr(colonPos + 1);
1946 this->GetImpl()->SetSizeMapEntry(entry.c_str(), sizemap.c_str());
1950 //=============================================================================
1952 void BLSURFPlugin_Hypothesis_i::ClearSizeMaps() {
1954 this->GetImpl()->ClearSizeMaps();
1957 //=============================================================================
1959 void BLSURFPlugin_Hypothesis_i::SetSizeMap(const GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap)
1960 throw (SALOME::SALOME_Exception)
1964 entry = GeomObj->GetStudyEntry();
1965 MESSAGE("IDL : GetName : " << GeomObj->GetName());
1966 MESSAGE("IDL : SETSIZEMAP ( "<< entry << " , " << sizeMap << ")");
1967 SetSizeMapEntry(entry.c_str(), sizeMap);
1970 //=============================================================================
1972 void BLSURFPlugin_Hypothesis_i::SetConstantSizeMap(const GEOM::GEOM_Object_ptr GeomObj, CORBA::Double sizeMap) {
1974 string entry = GeomObj->GetStudyEntry();
1975 GEOM::shape_type shapeType = GeomObj->GetShapeType();
1976 if (shapeType == GEOM::COMPOUND)
1977 shapeType = GeomObj->GetMaxShapeType();
1978 MESSAGE("IDL : GetName : " << GeomObj->GetName());
1979 MESSAGE("IDL : SETSIZEMAP ( "<< entry << " , " << sizeMap << ")");
1980 SetConstantSizeMapEntry(entry.c_str(), shapeType, sizeMap);
1983 //=============================================================================
1984 void BLSURFPlugin_Hypothesis_i::UnsetSizeMap(const GEOM::GEOM_Object_ptr GeomObj) {
1987 entry = GeomObj->GetStudyEntry();
1988 MESSAGE("IDL : GetName : " << GeomObj->GetName());
1989 MESSAGE("IDL : UNSETSIZEMAP ( "<< entry << ")");
1990 UnsetEntry(entry.c_str());
1991 SMESH::TPythonDump() << _this() << ".UnsetSizeMap( " << entry.c_str() << " )";
1994 void BLSURFPlugin_Hypothesis_i::SetAttractor(GEOM::GEOM_Object_ptr GeomObj, const char* attractor) {
1997 entry = GeomObj->GetStudyEntry();
1998 MESSAGE("IDL : GetName : " << GeomObj->GetName());
1999 MESSAGE("IDL : SETATTRACTOR ( "<< entry << " , " << attractor << ")");
2000 SetAttractorEntry(entry.c_str(), attractor);
2003 void BLSURFPlugin_Hypothesis_i::UnsetAttractor(GEOM::GEOM_Object_ptr GeomObj) {
2006 entry = GeomObj->GetStudyEntry();
2007 MESSAGE("IDL : GetName : " << GeomObj->GetName());
2008 MESSAGE("IDL : UNSETATTRACTOR ( "<< entry << ")");
2009 UnsetEntry(entry.c_str());
2010 SMESH::TPythonDump() << _this() << ".UnsetAttractor( " << entry.c_str() << " )";
2013 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)
2016 string theFaceEntry;
2018 theFaceEntry = theFace->GetStudyEntry();
2019 theAttEntry = theAttractor->GetStudyEntry();
2021 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2024 if (theFaceEntry.empty()) {
2026 aName += theFace->GetEntry();
2027 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
2028 if (!theSFace->_is_nil())
2029 theFaceEntry = theSFace->GetID();
2031 if (theFaceEntry.empty())
2032 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2034 if (theAttEntry.empty()) {
2035 if (theAttractor->GetShapeType() == GEOM::VERTEX)
2037 if (theAttractor->GetShapeType() == GEOM::EDGE)
2039 if (theAttractor->GetShapeType() == GEOM::WIRE)
2041 if (theAttractor->GetShapeType() == GEOM::COMPOUND)
2042 aName = "Compound_";
2043 aName += theAttractor->GetEntry();
2044 SALOMEDS::SObject_wrap theSAtt = geomGen->PublishInStudy(NULL, theAttractor, aName.c_str());
2045 if (!theSAtt->_is_nil())
2046 theAttEntry = theSAtt->GetID();
2048 if (theAttEntry.empty())
2049 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2051 TopoDS_Face FaceShape = TopoDS::Face(SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( theFace ));
2052 TopoDS_Shape AttractorShape = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( theAttractor );
2053 MESSAGE("IDL : GetName : " << theFace->GetName());
2054 MESSAGE("IDL : SETATTRACTOR () ");//<< entry << " , " << att_entry << ")");
2055 SetClassAttractorEntry( theFaceEntry.c_str(), theAttEntry.c_str(), StartSize, EndSize, ActionRadius, ConstantRadius);
2058 void BLSURFPlugin_Hypothesis_i::UnsetAttractorGeom(GEOM::GEOM_Object_ptr theFace,
2059 GEOM::GEOM_Object_ptr theAttractor)
2062 CORBA::String_var theFaceEntry = theFace->GetStudyEntry();
2063 CORBA::String_var theAttrEntry = theAttractor->GetStudyEntry();
2065 // GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2068 // if (theFaceEntry.empty()) {
2070 // aName += theFace->GetEntry();
2071 // SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
2072 // if (!theSFace->_is_nil())
2073 // theFaceEntry = theSFace->GetID();
2075 if ( !theFaceEntry.in() || !theFaceEntry.in()[0] ||
2076 !theAttrEntry.in() || !theAttrEntry.in()[0] )
2077 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2079 MESSAGE("IDL : GetName : " << theFace->GetName());
2080 MESSAGE("IDL : UNSETATTRACTOR ( "<< theFaceEntry << ")");
2081 GetImpl()->ClearEntry( theFaceEntry.in(), theAttrEntry.in() );
2082 SMESH::TPythonDump() << _this() << ".UnsetAttractorGeom( "
2083 << theFace << ", " << theAttractor << " )";
2086 void BLSURFPlugin_Hypothesis_i::UnsetAttractorEntry(const char* faceEntry,
2087 const char* attractorEntry)
2089 GetImpl()->ClearEntry( faceEntry, attractorEntry );
2090 SMESH::TPythonDump() << _this() << ".UnsetAttractorEntry( '"
2091 << faceEntry << "', '" << attractorEntry << "' )";
2096 void BLSURFPlugin_Hypothesis_i::SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap)
2099 void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj)
2102 void BLSURFPlugin_Hypothesis_i::SetCustomSizeMapEntry(const char* entry,const char* sizeMap ) throw (SALOME::SALOME_Exception)
2105 char* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception)
2108 void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMapEntry(const char* entry)
2111 this->GetImpl()->UnsetCustomSizeMap(entry);
2112 SMESH::TPythonDump() << _this() << ".UnsetCustomSizeMap( " << entry << " )";
2116 BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntries()
2121 // ///////////////////////
2122 // // ENFORCED VERTICES //
2123 // ///////////////////////
2127 * Returns the list of enforced vertices for a given Face entry
2128 * @return A map of Face entry / List of enforced vertices
2131 BLSURFPlugin::TFaceEntryEnfVertexListMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByFace() {
2132 MESSAGE("IDL: GetAllEnforcedVerticesByFace()");
2135 BLSURFPlugin::TFaceEntryEnfVertexListMap_var resultMap = new BLSURFPlugin::TFaceEntryEnfVertexListMap();
2137 const ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap faceEntryEnfVertexListMap =
2138 this->GetImpl()->_GetAllEnforcedVerticesByFace();
2139 resultMap->length(faceEntryEnfVertexListMap.size());
2140 MESSAGE("Face entry to Enforced Vertex map size is " << resultMap->length());
2142 ::BLSURFPlugin_Hypothesis::TEnfVertexList _enfVertexList;
2143 ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexListMap::const_iterator it_entry = faceEntryEnfVertexListMap.begin();
2144 for (int i = 0; it_entry != faceEntryEnfVertexListMap.end(); ++it_entry, ++i) {
2145 BLSURFPlugin::TFaceEntryEnfVertexListMapElement_var mapElement =
2146 new BLSURFPlugin::TFaceEntryEnfVertexListMapElement();
2147 mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
2148 MESSAGE("Face Entry: " << mapElement->faceEntry);
2150 _enfVertexList = it_entry->second;
2151 BLSURFPlugin::TEnfVertexList_var enfVertexList = new BLSURFPlugin::TEnfVertexList();
2152 enfVertexList->length(_enfVertexList.size());
2153 MESSAGE("Number of enf vertex: " << enfVertexList->length());
2155 ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator it_enfVertex = _enfVertexList.begin();
2156 ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
2157 for (int j = 0; it_enfVertex != _enfVertexList.end(); ++it_enfVertex, ++j) {
2158 currentEnfVertex = (*it_enfVertex);
2160 BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
2163 enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
2166 enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
2169 BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
2170 coords->length(currentEnfVertex->coords.size());
2171 for (CORBA::ULong i=0;i<coords->length();i++)
2172 coords[i] = currentEnfVertex->coords[i];
2173 enfVertex->coords = coords;
2176 enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());
2179 BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
2180 faceEntryList->length(currentEnfVertex->faceEntries.size());
2181 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
2182 for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
2183 faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
2184 enfVertex->faceEntries = faceEntryList;
2187 msg << "Enforced vertex: \n"
2188 << "Name: " << enfVertex->name << "\n";
2189 if (coords->length())
2190 msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
2191 msg << "Geom entry: " << enfVertex->geomEntry << "\n"
2192 << "Group Name: " << enfVertex->grpName;
2195 enfVertexList[j] = enfVertex;
2197 mapElement->enfVertexList = enfVertexList;
2199 resultMap[i] = mapElement;
2202 return resultMap._retn();
2206 * Returns the list of all enforced vertices
2207 * @return a list of enforced vertices
2210 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVertices() {
2211 MESSAGE("IDL: GetAllEnforcedVertices()");
2213 BLSURFPlugin::TEnfVertexList_var resultMap = new BLSURFPlugin::TEnfVertexList();
2214 const ::BLSURFPlugin_Hypothesis::TEnfVertexList enfVertexList = this->GetImpl()->_GetAllEnforcedVertices();
2215 resultMap->length(enfVertexList.size());
2216 MESSAGE("Enforced Vertex map size is " << resultMap->length());
2218 ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = enfVertexList.begin();
2219 ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
2220 for (int i = 0; evlIt != enfVertexList.end(); ++evlIt, ++i) {
2221 MESSAGE("Enforced Vertex #" << i);
2222 currentEnfVertex = (*evlIt);
2223 BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
2225 enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
2227 enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
2229 BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
2230 coords->length(currentEnfVertex->coords.size());
2231 for (CORBA::ULong ind = 0; ind < coords->length(); ind++)
2232 coords[ind] = currentEnfVertex->coords[ind];
2233 enfVertex->coords = coords;
2235 enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());
2237 BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
2238 faceEntryList->length(currentEnfVertex->faceEntries.size());
2239 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
2240 for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
2241 faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
2242 enfVertex->faceEntries = faceEntryList;
2245 msg << "Enforced vertex: \n"
2246 << "Name: " << enfVertex->name << "\n";
2247 if (coords->length())
2248 msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
2249 msg << "Geom entry: " << enfVertex->geomEntry << "\n"
2250 << "Group Name: " << enfVertex->grpName;
2253 resultMap[i] = enfVertex;
2255 return resultMap._retn();
2260 * Returns the list of enforced vertices coords for a given Face entry.
2261 * They are the coords of the "manual" enforced vertices.
2262 * @return A map of Face entry / List of enforced vertices coords
2265 BLSURFPlugin::TFaceEntryCoordsListMap* BLSURFPlugin_Hypothesis_i::GetAllCoordsByFace() {
2266 MESSAGE("IDL: GetAllCoordsByFace()");
2269 BLSURFPlugin::TFaceEntryCoordsListMap_var resultMap = new BLSURFPlugin::TFaceEntryCoordsListMap();
2271 const ::BLSURFPlugin_Hypothesis::TFaceEntryCoordsListMap entryCoordsListMap = this->GetImpl()->_GetAllCoordsByFace();
2272 resultMap->length(entryCoordsListMap.size());
2273 MESSAGE("Enforced Vertex map size is " << resultMap->length());
2275 ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList _coordsList;
2276 ::BLSURFPlugin_Hypothesis::TFaceEntryCoordsListMap::const_iterator it_entry = entryCoordsListMap.begin();
2277 for (int i = 0; it_entry != entryCoordsListMap.end(); ++it_entry, ++i) {
2278 BLSURFPlugin::TFaceEntryCoordsListMapElement_var mapElement = new BLSURFPlugin::TFaceEntryCoordsListMapElement();
2279 mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
2280 MESSAGE("Face Entry: " << mapElement->faceEntry);
2282 _coordsList = it_entry->second;
2283 BLSURFPlugin::TEnfVertexCoordsList_var coordsList = new BLSURFPlugin::TEnfVertexCoordsList();
2284 coordsList->length(_coordsList.size());
2285 MESSAGE("Number of coords: " << coordsList->length());
2287 ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList::const_iterator it_coords = _coordsList.begin();
2288 for (int j = 0; it_coords != _coordsList.end(); ++it_coords, ++j) {
2289 BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
2290 coords->length((*it_coords).size());
2291 for (CORBA::ULong i=0;i<coords->length();i++)
2292 coords[i] = (*it_coords)[i];
2293 coordsList[j] = coords;
2294 MESSAGE("Coords #" << j << ": " << coords[0] << ", " << coords[1] << ", " << coords[2]);
2296 mapElement->coordsList = coordsList;
2298 resultMap[i] = mapElement;
2301 return resultMap._retn();
2305 * Returns a map of enforced vertices coords / enforced vertex.
2306 * They are the coords of the "manual" enforced vertices.
2308 BLSURFPlugin::TCoordsEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByCoords() {
2309 MESSAGE("IDL: GetAllEnforcedVerticesByCoords()");
2312 BLSURFPlugin::TCoordsEnfVertexMap_var resultMap = new BLSURFPlugin::TCoordsEnfVertexMap();
2313 const ::BLSURFPlugin_Hypothesis::TCoordsEnfVertexMap coordsEnfVertexMap =
2314 this->GetImpl()->_GetAllEnforcedVerticesByCoords();
2315 resultMap->length(coordsEnfVertexMap.size());
2316 MESSAGE("Enforced Vertex map size is " << resultMap->length());
2318 ::BLSURFPlugin_Hypothesis::TCoordsEnfVertexMap::const_iterator it_coords = coordsEnfVertexMap.begin();
2319 ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
2320 for (int i = 0; it_coords != coordsEnfVertexMap.end(); ++it_coords, ++i) {
2321 MESSAGE("Enforced Vertex #" << i);
2322 currentEnfVertex = (it_coords->second);
2323 BLSURFPlugin::TCoordsEnfVertexElement_var mapElement = new BLSURFPlugin::TCoordsEnfVertexElement();
2324 BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
2325 coords->length(it_coords->first.size());
2326 for (CORBA::ULong ind=0;ind<coords->length();ind++)
2327 coords[ind] = it_coords->first[ind];
2328 mapElement->coords = coords;
2329 MESSAGE("Coords: " << mapElement->coords[0] << ", " << mapElement->coords[1] << ", " << mapElement->coords[2]);
2331 BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
2333 enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
2335 enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
2337 BLSURFPlugin::TEnfVertexCoords_var coords2 = new BLSURFPlugin::TEnfVertexCoords();
2338 coords2->length(currentEnfVertex->coords.size());
2339 for (CORBA::ULong ind=0;ind<coords2->length();ind++)
2340 coords2[ind] = currentEnfVertex->coords[ind];
2341 enfVertex->coords = coords2;
2343 enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());
2345 BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
2346 faceEntryList->length(currentEnfVertex->faceEntries.size());
2347 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
2348 for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
2349 faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
2350 enfVertex->faceEntries = faceEntryList;
2352 mapElement->enfVertex = enfVertex;
2354 msg << "Enforced vertex: \n"
2355 << "Name: " << enfVertex->name << "\n";
2356 if (coords->length())
2357 msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
2358 msg << "Geom entry: " << enfVertex->geomEntry << "\n"
2359 << "Group Name: " << enfVertex->grpName;
2362 resultMap[i] = mapElement;
2364 return resultMap._retn();
2368 * Returns the list of enforced vertices entries for a given Face entry.
2369 * They are the geom entries of the enforced vertices based on geom shape (vertex, compound, group).
2370 * @return A map of Face entry / List of enforced vertices geom entries
2373 BLSURFPlugin::TFaceEntryEnfVertexEntryListMap* BLSURFPlugin_Hypothesis_i::GetAllEnfVertexEntriesByFace() {
2374 MESSAGE("IDL: GetAllEnfVertexEntriesByFace()");
2377 BLSURFPlugin::TFaceEntryEnfVertexEntryListMap_var resultMap = new BLSURFPlugin::TFaceEntryEnfVertexEntryListMap();
2379 const ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexEntryListMap entryEnfVertexEntryListMap =
2380 this->GetImpl()->_GetAllEnfVertexEntriesByFace();
2381 resultMap->length(entryEnfVertexEntryListMap.size());
2382 MESSAGE("Enforced Vertex map size is " << resultMap->length());
2384 ::BLSURFPlugin_Hypothesis::TEntryList _enfVertexEntryList;
2385 ::BLSURFPlugin_Hypothesis::TFaceEntryEnfVertexEntryListMap::const_iterator it_entry =
2386 entryEnfVertexEntryListMap.begin();
2387 for (int i = 0; it_entry != entryEnfVertexEntryListMap.end(); ++it_entry, ++i) {
2388 BLSURFPlugin::TFaceEntryEnfVertexEntryListMapElement_var mapElement =
2389 new BLSURFPlugin::TFaceEntryEnfVertexEntryListMapElement();
2390 mapElement->faceEntry = CORBA::string_dup(it_entry->first.c_str());
2391 MESSAGE("Face Entry: " << mapElement->faceEntry);
2393 _enfVertexEntryList = it_entry->second;
2394 BLSURFPlugin::TEntryList_var enfVertexEntryList = new BLSURFPlugin::TEntryList();
2395 enfVertexEntryList->length(_enfVertexEntryList.size());
2396 MESSAGE("Number of enf vertex entries: " << enfVertexEntryList->length());
2398 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_enfVertexEntry = _enfVertexEntryList.begin();
2399 for (int j = 0; it_enfVertexEntry != _enfVertexEntryList.end(); ++it_enfVertexEntry, ++j) {
2400 enfVertexEntryList[j] = CORBA::string_dup((*it_enfVertexEntry).c_str());
2401 MESSAGE("Enf Vertex Entry #" << j << ": " << enfVertexEntryList[j]);
2403 mapElement->enfVertexEntryList = enfVertexEntryList;
2405 resultMap[i] = mapElement;
2408 return resultMap._retn();
2412 * Returns a map of enforced vertices geom entry / enforced vertex.
2413 * They are the geom entries of the enforced vertices defined with geom shape (vertex, compound, group).
2415 BLSURFPlugin::TEnfVertexEntryEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVerticesByEnfVertexEntry() {
2416 MESSAGE("IDL: GetAllEnforcedVerticesByEnfVertexEntry()");
2419 BLSURFPlugin::TEnfVertexEntryEnfVertexMap_var resultMap = new BLSURFPlugin::TEnfVertexEntryEnfVertexMap();
2420 const ::BLSURFPlugin_Hypothesis::TEnfVertexEntryEnfVertexMap enfVertexEntryEnfVertexMap =
2421 this->GetImpl()->_GetAllEnforcedVerticesByEnfVertexEntry();
2422 resultMap->length(enfVertexEntryEnfVertexMap.size());
2423 MESSAGE("Enforced Vertex map size is " << resultMap->length());
2425 ::BLSURFPlugin_Hypothesis::TEnfVertexEntryEnfVertexMap::const_iterator it_enfVertexEntry = enfVertexEntryEnfVertexMap.begin();
2426 ::BLSURFPlugin_Hypothesis::TEnfVertex *currentEnfVertex;
2427 for (int i = 0; it_enfVertexEntry != enfVertexEntryEnfVertexMap.end(); ++it_enfVertexEntry, ++i) {
2428 MESSAGE("Enforced Vertex #" << i);
2429 currentEnfVertex = it_enfVertexEntry->second;
2430 BLSURFPlugin::TEnfVertexEntryEnfVertexElement_var mapElement = new BLSURFPlugin::TEnfVertexEntryEnfVertexElement();
2431 mapElement->enfVertexEntry = CORBA::string_dup(it_enfVertexEntry->first.c_str());;
2432 MESSAGE("Enf Vertex Entry #" << i << ": " << mapElement->enfVertexEntry);
2434 BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
2436 enfVertex->name = CORBA::string_dup(currentEnfVertex->name.c_str());
2438 enfVertex->geomEntry = CORBA::string_dup(currentEnfVertex->geomEntry.c_str());
2440 BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
2441 coords->length(currentEnfVertex->coords.size());
2442 for (CORBA::ULong ind=0;ind<coords->length();ind++)
2443 coords[ind] = currentEnfVertex->coords[ind];
2444 enfVertex->coords = coords;
2446 enfVertex->grpName = CORBA::string_dup(currentEnfVertex->grpName.c_str());
2448 BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
2449 faceEntryList->length(currentEnfVertex->faceEntries.size());
2450 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = currentEnfVertex->faceEntries.begin();
2451 for (int ind = 0; it_entry != currentEnfVertex->faceEntries.end();++it_entry, ++ind)
2452 faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
2453 enfVertex->faceEntries = faceEntryList;
2456 msg << "Enforced vertex: \n"
2457 << "Name: " << enfVertex->name << "\n";
2458 if (coords->length())
2459 msg << "Coords: " << enfVertex->coords[0] << ", " << enfVertex->coords[1] << ", " << enfVertex->coords[2] << "\n";
2460 msg << "Geom entry: " << enfVertex->geomEntry << "\n"
2461 << "Group Name: " << enfVertex->grpName;
2464 mapElement->enfVertex = enfVertex;
2465 resultMap[i] = mapElement;
2467 return resultMap._retn();
2471 * Erase all enforced vertices
2473 void BLSURFPlugin_Hypothesis_i::ClearAllEnforcedVertices() {
2475 this->GetImpl()->ClearAllEnforcedVertices();
2476 SMESH::TPythonDump() << _this() << ".ClearAllEnforcedVertices()";
2480 * Set/get/unset an enforced vertex on face
2482 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
2483 CORBA::Double z) throw (SALOME::SALOME_Exception) {
2486 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2487 MESSAGE("theFace shape type is not FACE or COMPOUND");
2488 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2491 string theFaceEntry = theFace->GetStudyEntry();
2493 if (theFaceEntry.empty()) {
2494 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2496 if (theFace->GetShapeType() == GEOM::FACE)
2498 if (theFace->GetShapeType() == GEOM::COMPOUND)
2499 aName = "Compound_";
2500 aName += theFace->GetEntry();
2501 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
2502 if (!theSFace->_is_nil())
2503 theFaceEntry = theSFace->GetID();
2505 if (theFaceEntry.empty())
2506 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2507 MESSAGE("IDL : GetName : " << theFace->GetName());
2508 MESSAGE("IDL : SetEnforcedVertex( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ")");
2510 return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z);
2511 } catch (SALOME_Exception& ex) {
2512 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2517 * Set/get/unset an enforced vertex with name on face
2519 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
2520 CORBA::Double z, const char* theVertexName) throw (SALOME::SALOME_Exception) {
2523 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2524 MESSAGE("theFace shape type is not FACE or COMPOUND");
2525 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2528 string theFaceEntry = theFace->GetStudyEntry();
2530 if (theFaceEntry.empty()) {
2531 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2533 if (theFace->GetShapeType() == GEOM::FACE)
2535 if (theFace->GetShapeType() == GEOM::COMPOUND)
2536 aName = "Compound_";
2537 aName += theFace->GetEntry();
2538 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
2539 if (!theSFace->_is_nil())
2540 theFaceEntry = theSFace->GetID();
2542 if (theFaceEntry.empty())
2543 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2545 MESSAGE("IDL : GetName : " << theFace->GetName());
2546 MESSAGE("IDL : SetEnforcedVertexNamed( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theVertexName << ")");
2548 return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, theVertexName);
2549 } catch (SALOME_Exception& ex) {
2550 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2555 * Set/get/unset an enforced vertex with geom object on face
2557 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
2558 throw (SALOME::SALOME_Exception) {
2561 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2562 MESSAGE("theFace shape type is not FACE or COMPOUND");
2563 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2566 if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
2567 MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
2568 THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
2571 // GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2572 // GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations();
2573 // if (CORBA::is_nil(measureOp))
2576 // CORBA::Double x, y, z;
2578 // measureOp->PointCoordinates(theVertex, x, y, z);
2580 string theFaceEntry = theFace->GetStudyEntry();
2581 string theVertexEntry = theVertex->GetStudyEntry();
2583 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2586 if (theFaceEntry.empty()) {
2587 if (theFace->GetShapeType() == GEOM::FACE)
2589 if (theFace->GetShapeType() == GEOM::COMPOUND)
2590 aName = "Compound_";
2591 aName += theFace->GetEntry();
2592 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
2593 if (!theSFace->_is_nil())
2594 theFaceEntry = theSFace->GetID();
2596 if (theFaceEntry.empty())
2597 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2599 if (theVertexEntry.empty()) {
2600 if (theVertex->GetShapeType() == GEOM::VERTEX)
2602 if (theVertex->GetShapeType() == GEOM::COMPOUND)
2603 aName = "Compound_";
2604 aName += theVertex->GetEntry();
2605 SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(NULL, theVertex, aName.c_str());
2606 if (!theSVertex->_is_nil())
2607 theVertexEntry = theSVertex->GetID();
2609 if (theVertexEntry.empty())
2610 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2612 string theVertexName = theVertex->GetName();
2613 MESSAGE("IDL : theFace->GetName : " << theFace->GetName());
2614 MESSAGE("IDL : theVertex->GetName : " << theVertexName);
2615 MESSAGE("IDL : SetEnforcedVertexGeom( "<< theFaceEntry << ", " << theVertexEntry<< ")");
2617 return SetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexName.c_str(), theVertexEntry.c_str());
2618 } catch (SALOME_Exception& ex) {
2619 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2624 * Set an enforced vertex with group name on face
2626 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
2627 throw (SALOME::SALOME_Exception)
2631 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2632 MESSAGE("theFace shape type is not FACE or COMPOUND");
2633 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2636 string theFaceEntry = theFace->GetStudyEntry();
2638 if (theFaceEntry.empty()) {
2639 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2641 if (theFace->GetShapeType() == GEOM::FACE)
2643 if (theFace->GetShapeType() == GEOM::COMPOUND)
2644 aName = "Compound_";
2645 aName += theFace->GetEntry();
2646 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
2647 if (!theSFace->_is_nil())
2648 theFaceEntry = theSFace->GetID();
2650 if (theFaceEntry.empty())
2651 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2652 MESSAGE("IDL : GetName : " << theFace->GetName());
2653 MESSAGE("IDL : SetEnforcedVertexWithGroup( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theGroupName << ")");
2655 return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, "", "", theGroupName);
2656 } catch (SALOME_Exception& ex) {
2657 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2662 * Set an enforced vertex with name and group name on face
2664 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z,
2665 const char* theVertexName, const char* theGroupName)
2666 throw (SALOME::SALOME_Exception)
2670 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2671 MESSAGE("theFace shape type is not FACE or COMPOUND");
2672 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2675 string theFaceEntry = theFace->GetStudyEntry();
2677 if (theFaceEntry.empty()) {
2678 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2680 if (theFace->GetShapeType() == GEOM::FACE)
2682 if (theFace->GetShapeType() == GEOM::COMPOUND)
2683 aName = "Compound_";
2684 aName += theFace->GetEntry();
2685 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
2686 if (!theSFace->_is_nil())
2687 theFaceEntry = theSFace->GetID();
2689 if (theFaceEntry.empty())
2690 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2691 MESSAGE("IDL : GetName : " << theFace->GetName());
2692 MESSAGE("IDL : SetEnforcedVertexNamedWithGroup( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ", " << theVertexName << ", " << theGroupName << ")");
2694 return SetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z, theVertexName, "", theGroupName);
2695 } catch (SALOME_Exception& ex) {
2696 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2701 * Set an enforced vertex with geom entry and group name on face
2703 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
2704 throw (SALOME::SALOME_Exception)
2708 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2709 MESSAGE("theFace shape type is not FACE or COMPOUND");
2710 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2713 if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
2714 MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
2715 THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
2718 string theFaceEntry = theFace->GetStudyEntry();
2719 string theVertexEntry = theVertex->GetStudyEntry();
2721 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2724 if (theFaceEntry.empty()) {
2725 if (theFace->GetShapeType() == GEOM::FACE)
2727 if (theFace->GetShapeType() == GEOM::COMPOUND)
2728 aName = "Compound_";
2729 aName += theFace->GetEntry();
2730 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
2731 if (!theSFace->_is_nil())
2732 theFaceEntry = theSFace->GetID();
2734 if (theFaceEntry.empty())
2735 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2737 if (theVertexEntry.empty()) {
2738 if (theVertex->GetShapeType() == GEOM::VERTEX)
2740 if (theVertex->GetShapeType() == GEOM::COMPOUND)
2741 aName = "Compound_";
2742 aName += theVertex->GetEntry();
2743 SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(NULL, theVertex, aName.c_str());
2744 if (!theSVertex->_is_nil())
2745 theVertexEntry = theSVertex->GetID();
2747 if (theVertexEntry.empty())
2748 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2750 string theVertexName = theVertex->GetName();
2751 MESSAGE("IDL : theFace->GetName : " << theFace->GetName());
2752 MESSAGE("IDL : theVertex->GetName : " << theVertexName);
2753 MESSAGE("IDL : SetEnforcedVertexGeomWithGroup( "<< theFaceEntry << ", " << theVertexEntry<< ", " << theGroupName<< ")");
2755 return SetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexName.c_str(), theVertexEntry.c_str(), theGroupName);
2756 } catch (SALOME_Exception& ex) {
2757 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2761 //Enable internal enforced vertices on specific face if requested by user
2763 // * Are internal enforced vertices used for a face ?
2765 //CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace)
2766 // throw (SALOME::SALOME_Exception) {
2767 // ASSERT(myBaseImpl);
2769 // if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2770 // MESSAGE("theFace shape type is not FACE or COMPOUND");
2771 // THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2774 // string theFaceEntry = theFace->GetStudyEntry();
2776 // if (theFaceEntry.empty()) {
2777 // GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2779 // if (theFace->GetShapeType() == GEOM::FACE)
2781 // if (theFace->GetShapeType() == GEOM::COMPOUND)
2782 // aName = "Compound_";
2783 // aName += theFace->GetEntry();
2784 // SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
2785 // if (!theSFace->_is_nil())
2786 // theFaceEntry = theSFace->GetID();
2788 // if (theFaceEntry.empty())
2789 // THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2791 // MESSAGE("IDL : GetName : " << theFace->GetName());
2792 // MESSAGE("IDL : GetInternalEnforcedVertexEntry ( "<< theFaceEntry << ")");
2794 // return GetInternalEnforcedVertexEntry(theFaceEntry.c_str());
2795 // } catch (SALOME_Exception& ex) {
2796 // THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2801 * Get the list of all enforced vertices
2803 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVertices(GEOM::GEOM_Object_ptr theFace)
2804 throw (SALOME::SALOME_Exception) {
2807 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2808 MESSAGE("theFace shape type is not FACE or COMPOUND");
2809 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2812 string theFaceEntry = theFace->GetStudyEntry();
2814 if (theFaceEntry.empty()) {
2815 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2817 if (theFace->GetShapeType() == GEOM::FACE)
2819 if (theFace->GetShapeType() == GEOM::COMPOUND)
2820 aName = "Compound_";
2821 aName += theFace->GetEntry();
2822 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
2823 if (!theSFace->_is_nil())
2824 theFaceEntry = theSFace->GetID();
2826 if (theFaceEntry.empty())
2827 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2829 MESSAGE("IDL : GetName : " << theFace->GetName());
2830 MESSAGE("IDL : GetEnforcedVerticesEntry ( "<< theFaceEntry << ")");
2832 return GetEnforcedVerticesEntry(theFaceEntry.c_str());
2833 } catch (SALOME_Exception& ex) {
2834 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2838 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y,
2839 CORBA::Double z) throw (SALOME::SALOME_Exception) {
2842 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2843 MESSAGE("theFace shape type is not FACE or COMPOUND");
2844 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2847 string theFaceEntry = theFace->GetStudyEntry();
2849 if (theFaceEntry.empty()) {
2850 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2852 if (theFace->GetShapeType() == GEOM::FACE)
2854 if (theFace->GetShapeType() == GEOM::COMPOUND)
2855 aName = "Compound_";
2856 aName += theFace->GetEntry();
2857 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
2858 if (!theSFace->_is_nil())
2859 theFaceEntry = theSFace->GetID();
2861 if (theFaceEntry.empty())
2862 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2863 MESSAGE("IDL : GetName : " << theFace->GetName());
2864 MESSAGE("IDL : UnsetEnforcedVertex ( "<< theFaceEntry << ", " << x << ", " << y << ", " << z << ")");
2867 return UnsetEnforcedVertexEntry(theFaceEntry.c_str(), x, y, z);
2868 } catch (SALOME_Exception& ex) {
2869 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2873 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
2874 throw (SALOME::SALOME_Exception) {
2877 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2878 MESSAGE("theFace shape type is not FACE or COMPOUND");
2879 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2881 if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) {
2882 MESSAGE("theVertex shape type is not VERTEX or COMPOUND");
2883 THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM);
2886 // GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2887 // GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations();
2888 // if (CORBA::is_nil(measureOp))
2891 // CORBA::Double x, y, z;
2893 // measureOp->PointCoordinates(theVertex, x, y, z);
2895 std::string theFaceEntry = theFace->GetStudyEntry();
2896 std::string theVertexEntry = theVertex->GetStudyEntry();
2898 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2901 if (theFaceEntry.empty()) {
2902 if (theFace->GetShapeType() == GEOM::FACE)
2904 if (theFace->GetShapeType() == GEOM::COMPOUND)
2905 aName = "Compound_";
2906 aName += theFace->GetEntry();
2907 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
2908 if (!theSFace->_is_nil())
2909 theFaceEntry = theSFace->GetID();
2911 if (theFaceEntry.empty())
2912 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2914 if (theVertexEntry.empty()) {
2915 if (theVertex->GetShapeType() == GEOM::VERTEX)
2917 if (theVertex->GetShapeType() == GEOM::COMPOUND)
2918 aName = "Compound_";
2919 aName += theVertex->GetEntry();
2920 SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(NULL, theVertex, aName.c_str());
2921 if (!theSVertex->_is_nil())
2922 theVertexEntry = theSVertex->GetID();
2924 if (theVertexEntry.empty())
2925 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2927 MESSAGE("IDL : UnsetEnforcedVertexGeom ( "<< theFaceEntry << ", " << theVertexEntry << ")");
2930 return UnsetEnforcedVertexEntry(theFaceEntry.c_str(), 0, 0, 0, theVertexEntry.c_str());
2931 } catch (SALOME_Exception& ex) {
2932 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2936 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception) {
2939 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
2940 MESSAGE("theFace shape type is not FACE or COMPOUND");
2941 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
2944 string theFaceEntry = theFace->GetStudyEntry();
2946 if (theFaceEntry.empty()) {
2947 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
2949 if (theFace->GetShapeType() == GEOM::FACE)
2951 if (theFace->GetShapeType() == GEOM::COMPOUND)
2952 aName = "Compound_";
2953 aName += theFace->GetEntry();
2954 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
2955 if (!theSFace->_is_nil())
2956 theFaceEntry = theSFace->GetID();
2958 if (theFaceEntry.empty())
2959 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
2961 MESSAGE("IDL : GetName : " << theFace->GetName());
2962 MESSAGE("IDL : UnsetEnforcedVertices ( "<< theFaceEntry << ")");
2965 return UnsetEnforcedVerticesEntry(theFaceEntry.c_str());
2966 } catch (SALOME_Exception& ex) {
2967 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
2972 * Set/get/unset an enforced vertex on geom object given by entry
2974 bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y,
2975 CORBA::Double z, const char* theVertexName, const char* theVertexEntry, const char* theGroupName)
2976 throw (SALOME::SALOME_Exception) {
2978 MESSAGE("IDL : SetEnforcedVertexEntry(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theVertexName << "\", \"" << theVertexEntry << "\", \"" << theGroupName << "\")");
2979 bool newValue = false;
2980 if (string(theVertexEntry).empty()) {
2982 ::BLSURFPlugin_Hypothesis::TEnfVertexCoordsList coordsList =
2983 this->GetImpl()->GetEnfVertexCoordsList(theFaceEntry);
2984 ::BLSURFPlugin_Hypothesis::TEnfVertexCoords coords;
2985 coords.push_back(x);
2986 coords.push_back(y);
2987 coords.push_back(z);
2988 if (coordsList.find(coords) == coordsList.end()) {
2989 MESSAGE("Coords not found: add it in coordsList");
2992 MESSAGE("Coords already found, compare names");
2993 ::BLSURFPlugin_Hypothesis::TEnfVertex *enfVertex = this->GetImpl()->GetEnfVertex(coords);
2994 if ((enfVertex->name != theVertexName) || (enfVertex->grpName != theGroupName)) {
2995 MESSAGE("The names are different: update");
2996 // this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z);
3000 MESSAGE("The names are identical");
3003 } catch (const std::invalid_argument& ex) {
3004 // no enforced vertex for entry
3005 MESSAGE("Face entry not found : add it to the list");
3009 if (string(theVertexName).empty()) {
3010 if (string(theGroupName).empty())
3011 SMESH::TPythonDump() << _this() << ".SetEnforcedVertex(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ")";
3013 SMESH::TPythonDump() << _this() << ".SetEnforcedVertexWithGroup(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theGroupName << "\")";
3016 if (string(theGroupName).empty())
3017 SMESH::TPythonDump() << _this() << ".SetEnforcedVertexNamed(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \"" << theVertexName << "\")";
3019 SMESH::TPythonDump() << _this() << ".SetEnforcedVertexNamedWithGroup(" << theFaceEntry << ", " << x << ", " << y << ", " << z << ", \""
3020 << theVertexName << "\", \"" << theGroupName << "\")";
3025 ::BLSURFPlugin_Hypothesis::TEntryList enfVertexEntryList = this->GetImpl()->GetEnfVertexEntryList(theFaceEntry);
3026 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it = enfVertexEntryList.find(theVertexEntry);
3027 if ( it == enfVertexEntryList.end()) {
3028 MESSAGE("Geom entry not found: add it in enfVertexEntryList");
3032 MESSAGE("Geom entry already found, compare names");
3033 ::BLSURFPlugin_Hypothesis::TEnfVertex *enfVertex = this->GetImpl()->GetEnfVertex((*it));
3034 if ((enfVertex->name != theVertexName) || (enfVertex->grpName != theGroupName)) {
3035 MESSAGE("The names are different: update");
3036 // this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z);
3040 MESSAGE("The names are identical");
3043 } catch (const std::invalid_argument& ex) {
3044 // no enforced vertex for entry
3045 MESSAGE("Face entry not found : add it to the list");
3049 if (string(theGroupName).empty())
3050 SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGeom(" << theFaceEntry << ", " << theVertexEntry << ")";
3052 SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGeomWithGroup(" << theFaceEntry << ", " << theVertexEntry << ", \"" << theGroupName << "\")";
3057 this->GetImpl()->SetEnforcedVertex(theFaceEntry, theVertexName, theVertexEntry, theGroupName, x, y, z);
3059 MESSAGE("IDL : SetEnforcedVertexEntry END");
3063 //Enable internal enforced vertices on specific face if requested by user
3064 //CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexEntry(const char* theFaceEntry)
3065 // throw (SALOME::SALOME_Exception) {
3066 // ASSERT(myBaseImpl);
3068 // return this->GetImpl()->GetInternalEnforcedVertex(theFaceEntry);
3069 // } catch (const std::exception& ex) {
3070 // std::cout << "Exception: " << ex.what() << std::endl;
3071 // THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
3075 BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(const char* entry)
3076 throw (SALOME::SALOME_Exception) {
3078 MESSAGE("ENGINE : GetEnforcedVerticesEntry START ENTRY : " << entry);
3081 BLSURFPlugin::TEnfVertexList_var vertexList = new BLSURFPlugin::TEnfVertexList();
3082 ::BLSURFPlugin_Hypothesis::TEnfVertexList _vList = this->GetImpl()->GetEnfVertexList(entry);
3083 vertexList->length(_vList.size());
3084 MESSAGE("Number of enforced vertices: " << vertexList->length());
3085 ::BLSURFPlugin_Hypothesis::TEnfVertexList::const_iterator evlIt = _vList.begin();
3086 for (int i = 0; evlIt != _vList.end(); ++evlIt, ++i) {
3087 ::BLSURFPlugin_Hypothesis::TEnfVertex *_enfVertex = (*evlIt);
3089 BLSURFPlugin::TEnfVertex_var enfVertex = new BLSURFPlugin::TEnfVertex();
3092 enfVertex->name = CORBA::string_dup(_enfVertex->name.c_str());
3093 // Geom Vertex Entry
3094 enfVertex->geomEntry = CORBA::string_dup(_enfVertex->geomEntry.c_str());
3096 BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords();
3097 coords->length(_enfVertex->coords.size());
3098 for ( CORBA::ULong ind = 0; ind < coords->length(); ind++ )
3099 coords[ind] = _enfVertex->coords[ind];
3100 enfVertex->coords = coords;
3102 enfVertex->grpName = CORBA::string_dup(_enfVertex->grpName.c_str());
3104 BLSURFPlugin::TEntryList_var faceEntryList = new BLSURFPlugin::TEntryList();
3105 faceEntryList->length(_enfVertex->faceEntries.size());
3106 ::BLSURFPlugin_Hypothesis::TEntryList::const_iterator it_entry = _enfVertex->faceEntries.begin();
3107 for (int ind = 0; it_entry != _enfVertex->faceEntries.end();++it_entry, ++ind)
3108 faceEntryList[ind] = CORBA::string_dup((*it_entry).c_str());
3109 enfVertex->faceEntries = faceEntryList;
3111 vertexList[i] = enfVertex;
3113 MESSAGE("ENGINE : GetEnforcedVerticesEntry END ENTRY : " << entry);
3114 return vertexList._retn();
3115 } catch (const std::invalid_argument& ex) {
3116 SALOME::ExceptionStruct ExDescription;
3117 ExDescription.text = ex.what();
3118 ExDescription.type = SALOME::BAD_PARAM;
3119 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(entry)";
3120 ExDescription.lineNumber = 1385;
3121 throw SALOME::SALOME_Exception(ExDescription);
3122 } catch (const std::exception& ex) {
3123 std::cout << "Exception: " << ex.what() << std::endl;
3124 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
3128 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y,
3129 CORBA::Double z, const char* theVertexEntry) throw (SALOME::SALOME_Exception) {
3131 MESSAGE("IDL : UnsetEnforcedVertexEntry(" << theFaceEntry << "," << x << "," << y << "," << z << ", " << theVertexEntry << ")");
3135 res = this->GetImpl()->ClearEnforcedVertex(theFaceEntry, x, y, z, theVertexEntry);
3137 if (string(theVertexEntry).empty())
3138 SMESH::TPythonDump() << "isDone = " << _this() << ".UnsetEnforcedVertex(" << theFaceEntry << ", " << x << ", " << y << ", " << z
3141 SMESH::TPythonDump() << "isDone = " << _this() << ".UnsetEnforcedVertexGeom(" << theFaceEntry << ", " << theVertexEntry << ")";
3143 } catch (const std::invalid_argument& ex) {
3145 } catch (const std::exception& ex) {
3146 std::cout << "Exception: " << ex.what() << std::endl;
3147 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
3150 MESSAGE("ENGINE : UnsetEnforcedVertexEntry END ENTRY : " << theFaceEntry);
3154 //bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntryWithPoint(const char* theFaceEntry, const char* theVertexEntry,
3155 // CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception) {
3156 // MESSAGE("IDL : UnsetEnforcedVertexEntryWithPoint START theFaceEntry=" << theFaceEntry << ", theVertexEntry=" << theVertexEntry);
3158 // bool ret = false;
3161 // ret = _unsetEnfVertex(theFaceEntry, x, y, z);
3162 // } catch (SALOME_Exception& ex) {
3163 // THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
3167 // SMESH::TPythonDump() << _this() << ".UnsetEnforcedVertexWithPoint(" << theFaceEntry << ", " << theVertexEntry
3170 // MESSAGE("IDL : UnsetEnforcedVertexEntryWithPoint END ENTRY : " << theFaceEntry);
3174 bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception) {
3176 MESSAGE("IDL : UnsetEnforcedVerticesEntry(" << theFaceEntry << ")");
3179 this->GetImpl()->ClearEnforcedVertices(theFaceEntry);
3180 SMESH::TPythonDump() << _this() << ".UnsetEnforcedVertices(" << theFaceEntry << ")";
3181 } catch (const std::invalid_argument& ex) {
3183 } catch (const std::exception& ex) {
3184 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
3187 MESSAGE("IDL : UnsetEnforcedVerticesEntry END ENTRY : " << theFaceEntry);
3191 //=============================================================================
3193 * BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces
3197 //=============================================================================
3198 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces(CORBA::Boolean theValue) {
3199 MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFaces");
3201 this->GetImpl()->SetInternalEnforcedVertexAllFaces(theValue);
3202 std::string theValueStr = theValue ? "True" : "False";
3203 SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexAllFaces( " << theValueStr.c_str() << " )";
3206 //=============================================================================
3208 * BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces
3212 //=============================================================================
3213 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces() {
3214 MESSAGE("BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFaces");
3216 return this->GetImpl()->_GetInternalEnforcedVertexAllFaces();
3219 //=============================================================================
3221 * BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup
3225 //=============================================================================
3226 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup(const char* groupName) {
3227 MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexAllFacesGroup");
3229 this->GetImpl()->SetInternalEnforcedVertexAllFacesGroup(groupName);
3230 SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexAllFacesGroup( \"" << groupName << "\" )";
3233 //=============================================================================
3235 * BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup
3239 //=============================================================================
3240 char* BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup() {
3241 MESSAGE("BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup");
3243 return CORBA::string_dup(this->GetImpl()->_GetInternalEnforcedVertexAllFacesGroup().c_str());
3247 * Enable internal enforced vertices on specific face if requested by user
3249 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices)
3250 throw (SALOME::SALOME_Exception)
3252 MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFace");
3254 SetInternalEnforcedVertexWithGroup(theFace, toEnforceInternalVertices);
3255 } catch (SALOME_Exception& ex) {
3256 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
3260 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName)
3261 throw (SALOME::SALOME_Exception)
3263 MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFaceWithGroup");
3265 if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) {
3266 MESSAGE("theFace shape type is not FACE or COMPOUND");
3267 THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM);
3270 string theFaceEntry = theFace->GetStudyEntry();
3272 if (theFaceEntry.empty()) {
3273 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
3275 if (theFace->GetShapeType() == GEOM::FACE)
3277 if (theFace->GetShapeType() == GEOM::COMPOUND)
3278 aName = "Compound_";
3279 aName += theFace->GetEntry();
3280 SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str());
3281 if (!theSFace->_is_nil())
3282 theFaceEntry = theSFace->GetID();
3284 if (theFaceEntry.empty())
3285 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
3287 MESSAGE("IDL : GetName : " << theFace->GetName());
3288 MESSAGE("IDL : GetInternalEnforcedVertexEntry ( "<< theFaceEntry << ")");
3290 SetInternalEnforcedVertexEntry(theFaceEntry.c_str(), toEnforceInternalVertices, theGroupName);
3291 } catch (SALOME_Exception& ex) {
3292 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
3296 void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName)
3297 throw (SALOME::SALOME_Exception)
3299 MESSAGE("BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexForFaceEntry");
3302 this->GetImpl()->SetInternalEnforcedVertex(theFaceEntry, toEnforceInternalVertices, theGroupName);
3303 std::string theValueStr = toEnforceInternalVertices ? "True" : "False";
3304 if (string(theGroupName).empty())
3305 SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertex( " << theFaceEntry << ", " << theValueStr.c_str() << " )";
3307 SMESH::TPythonDump() << _this() << ".SetInternalEnforcedVertexWithGroup( " << theFaceEntry << ", " << theValueStr.c_str() << ", \"" << theGroupName << "\" )";
3308 } catch (const std::exception& ex) {
3309 std::cout << "Exception: " << ex.what() << std::endl;
3310 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
3317 char* BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z)
3318 throw (SALOME::SALOME_Exception)
3321 MESSAGE("ENGINE : GetEnforcedVertexGroupName START ");
3323 return CORBA::string_dup( this->GetImpl()->GetEnforcedVertexGroupName(x, y, z).c_str());
3325 catch (const std::invalid_argument& ex) {
3326 SALOME::ExceptionStruct ExDescription;
3327 ExDescription.text = ex.what();
3328 ExDescription.type = SALOME::BAD_PARAM;
3329 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis_i::GetEnforcedVertexGroupName(entry)";
3330 ExDescription.lineNumber = 1146;
3331 throw SALOME::SALOME_Exception(ExDescription);
3333 catch (SALOME_Exception& ex) {
3334 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
3336 MESSAGE("ENGINE : GetEnforcedVertexGroupName END ");
3341 void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* groupName)
3342 throw (SALOME::SALOME_Exception)
3345 MESSAGE("ENGINE : SetEnforcedVertexGroupName START ");
3347 this->GetImpl()->SetEnforcedVertexGroupName(x, y, z, groupName);
3349 catch (const std::invalid_argument& ex) {
3350 SALOME::ExceptionStruct ExDescription;
3351 ExDescription.text = ex.what();
3352 ExDescription.type = SALOME::BAD_PARAM;
3353 ExDescription.sourceFile = "BLSURFPlugin_Hypothesis::SetEnforcedVertexGroupName(x,y,z)";
3354 ExDescription.lineNumber = 1170;
3355 throw SALOME::SALOME_Exception(ExDescription);
3357 catch (SALOME_Exception& ex) {
3358 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
3361 SMESH::TPythonDump() << _this() << ".SetEnforcedVertexGroupName("
3362 << x << ", " << y << ", " << z << ", '" << groupName << "' )";
3364 MESSAGE("ENGINE : SetEnforcedVertexGroupName END ");
3367 ///////////////////////
3369 ///////////////////////
3371 ///////////////////////
3374 std::string BLSURFPlugin_Hypothesis_i::ShapeTypeToString(GEOM::shape_type theShapeType)
3376 //enum shape_type { COMPOUND, COMPSOLID, SOLID, SHELL, FACE, WIRE, EDGE, VERTEX, SHAPE /*, __max_shape_type=0xffffffff */ };
3377 std::map<GEOM::shape_type, std::string> MapShapeTypeToString;
3378 MapShapeTypeToString[GEOM::COMPOUND] = std::string("COMPOUND");
3379 MapShapeTypeToString[GEOM::COMPSOLID] = std::string("COMPSOLID");
3380 MapShapeTypeToString[GEOM::SOLID] = std::string("SOLID");
3381 MapShapeTypeToString[GEOM::SHELL] = std::string("SHELL");
3382 MapShapeTypeToString[GEOM::FACE] = std::string("FACE");
3383 MapShapeTypeToString[GEOM::WIRE] = std::string("WIRE");
3384 MapShapeTypeToString[GEOM::EDGE] = std::string("EDGE");
3385 MapShapeTypeToString[GEOM::VERTEX] = std::string("VERTEX");
3386 MapShapeTypeToString[GEOM::SHAPE] = std::string("SHAPE");
3387 std::string txtShapeType = MapShapeTypeToString[theShapeType];
3388 return txtShapeType;
3391 void BLSURFPlugin_Hypothesis_i::CheckShapeTypes(GEOM::GEOM_Object_ptr shape, std::vector<GEOM::shape_type> theShapeTypes)
3393 // Check shape types
3395 std::stringstream typesTxt;
3396 for (std::size_t i=0; i<theShapeTypes.size(); i++)
3398 GEOM::shape_type theShapeType = theShapeTypes[i];
3399 if (shape->GetShapeType() == theShapeType)
3401 typesTxt << ShapeTypeToString(theShapeType);
3402 if (i < theShapeTypes.size()-1 )
3406 std::stringstream msg;
3407 msg << "shape shape type is not in" << typesTxt.str();
3409 THROW_SALOME_CORBA_EXCEPTION(msg.str().c_str(), SALOME::BAD_PARAM);
3413 void BLSURFPlugin_Hypothesis_i::CheckShapeType(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType)
3416 if (shape->GetShapeType() != theShapeType) {
3417 std::stringstream msg;
3418 msg << "shape shape type is not " << ShapeTypeToString(theShapeType);
3420 THROW_SALOME_CORBA_EXCEPTION(msg.str().c_str(), SALOME::BAD_PARAM);
3424 std::string BLSURFPlugin_Hypothesis_i::PublishIfNeeded(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType, std::string prefix)
3426 // Check shape is published in the object browser
3427 string shapeEntry = shape->GetStudyEntry();
3429 GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine();
3432 // Publish shape if needed
3433 if (shapeEntry.empty()) {
3434 if (shape->GetShapeType() == theShapeType)
3436 aName += shape->GetEntry();
3437 SALOMEDS::SObject_wrap theSFace1 = geomGen->PublishInStudy(NULL, shape, aName.c_str());
3438 if (!theSFace1->_is_nil())
3439 shapeEntry = theSFace1->GetID();
3441 if (shapeEntry.empty())
3442 THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM );
3446 // Format the output of two vectors to use it in MESSAGE and PythonDump
3447 std::string BLSURFPlugin_Hypothesis_i::FormatVerticesEntries(vector<string> &theSourceVerticesEntries, vector<string> &theTargetVerticesEntries)
3449 std::stringstream listEntriesTxt;
3451 if (!theSourceVerticesEntries.empty())
3453 listEntriesTxt << ", [" ;
3455 for (std::vector<std::string>::const_iterator it = theSourceVerticesEntries.begin(); it != theSourceVerticesEntries.end(); it++, i++)
3458 listEntriesTxt << ", ";
3459 listEntriesTxt << *it;
3462 listEntriesTxt << "], [" ;
3464 for (std::vector<std::string>::const_iterator it = theTargetVerticesEntries.begin(); it != theTargetVerticesEntries.end(); it++, i++)
3467 listEntriesTxt << ", ";
3468 listEntriesTxt << *it;
3470 listEntriesTxt << "]" ;
3472 return listEntriesTxt.str();
3476 * Erase all PreCad periodicity associations
3478 void BLSURFPlugin_Hypothesis_i::ClearPreCadPeriodicityVectors() {
3480 this->GetImpl()->ClearPreCadPeriodicityVectors();
3481 SMESH::TPythonDump() << _this() << ".ClearPreCadPeriodicityVectors()";
3484 BLSURFPlugin::TPeriodicityList* BLSURFPlugin_Hypothesis_i::GetPreCadFacesPeriodicityVector()
3486 MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCadFacesPeriodicityVector");
3487 const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector preCadPeriodicityVector =
3488 this->GetImpl()->_GetPreCadFacesPeriodicityVector();
3490 BLSURFPlugin::TPeriodicityList_var periodicityList = PreCadVectorToSequence(preCadPeriodicityVector);
3492 MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCadFacesPeriodicityVector end");
3493 return periodicityList._retn();
3496 BLSURFPlugin::TPeriodicityList* BLSURFPlugin_Hypothesis_i::GetPreCadEdgesPeriodicityVector()
3498 MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCadEdgesPeriodicityVector");
3499 const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector preCadPeriodicityVector =
3500 this->GetImpl()->_GetPreCadEdgesPeriodicityVector();
3502 BLSURFPlugin::TPeriodicityList_var periodicityList = PreCadVectorToSequence(preCadPeriodicityVector);
3504 MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCadEdgesPeriodicityVector end");
3505 return periodicityList._retn();
3508 // convert a vector preCadPeriodicityVector into TPeriodicityList Corba sequence
3509 BLSURFPlugin::TPeriodicityList* BLSURFPlugin_Hypothesis_i::PreCadVectorToSequence(const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector& preCadPeriodicityVector)
3511 MESSAGE("BLSURFPlugin_Hypothesis_i::PreCadVectorToSequence");
3512 BLSURFPlugin::TPeriodicityList_var periodicityList = new BLSURFPlugin::TPeriodicityList();
3514 periodicityList->length(preCadPeriodicityVector.size());
3516 for (size_t i = 0; i<preCadPeriodicityVector.size(); i++)
3518 ::BLSURFPlugin_Hypothesis::TPreCadPeriodicity preCadPeriodicityVector_i = preCadPeriodicityVector[i];
3520 BLSURFPlugin::TPreCadPeriodicity_var myPreCadPeriodicity = new BLSURFPlugin::TPreCadPeriodicity();
3521 myPreCadPeriodicity->shape1Entry = CORBA::string_dup(preCadPeriodicityVector_i.shape1Entry.c_str());
3522 myPreCadPeriodicity->shape2Entry = CORBA::string_dup(preCadPeriodicityVector_i.shape2Entry.c_str());
3524 BLSURFPlugin::TEntryList_var sourceVertices = new BLSURFPlugin::TEntryList();
3525 if (! preCadPeriodicityVector_i.theSourceVerticesEntries.empty())
3527 sourceVertices->length(preCadPeriodicityVector_i.theSourceVerticesEntries.size());
3528 for (size_t j=0; j<preCadPeriodicityVector_i.theSourceVerticesEntries.size(); j++)
3529 sourceVertices[j]=CORBA::string_dup(preCadPeriodicityVector_i.theSourceVerticesEntries[j].c_str());
3532 myPreCadPeriodicity->theSourceVerticesEntries = sourceVertices;
3534 BLSURFPlugin::TEntryList_var targetVertices = new BLSURFPlugin::TEntryList();
3535 if (! preCadPeriodicityVector_i.theTargetVerticesEntries.empty())
3537 targetVertices->length(preCadPeriodicityVector_i.theTargetVerticesEntries.size());
3538 for (size_t j=0; j<preCadPeriodicityVector_i.theTargetVerticesEntries.size(); j++)
3539 targetVertices[j]=CORBA::string_dup(preCadPeriodicityVector_i.theTargetVerticesEntries[j].c_str());
3542 myPreCadPeriodicity->theTargetVerticesEntries = targetVertices;
3544 periodicityList[i] = myPreCadPeriodicity;
3548 return periodicityList._retn();
3552 void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicity(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2)
3553 throw (SALOME::SALOME_Exception)
3556 const GEOM::ListOfGO theSourceVertices;
3557 const GEOM::ListOfGO theTargetVertices;
3558 AddPreCadFacesPeriodicityWithVertices(theFace1, theFace2, theSourceVertices, theTargetVertices);
3562 void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2,
3563 const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
3564 throw (SALOME::SALOME_Exception)
3567 MESSAGE("BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicityWithVertices");
3569 size_t theLength = theSourceVertices.length();
3570 if (theLength != theTargetVertices.length())
3571 THROW_SALOME_CORBA_EXCEPTION( "The sizes of theSourceVertices and theTargetVertices must be the same" ,SALOME::BAD_PARAM );
3573 std::vector<GEOM::shape_type> allowedShapeTypes;
3574 allowedShapeTypes.push_back(GEOM::FACE);
3575 allowedShapeTypes.push_back(GEOM::COMPOUND);
3577 string prefix1 = "Source_face_";
3578 CheckShapeTypes(theFace1, allowedShapeTypes);
3579 string theFace1Entry = PublishIfNeeded(theFace1, GEOM::FACE, prefix1);
3581 string prefix2 = "Target_face_";
3582 CheckShapeTypes(theFace2, allowedShapeTypes);
3583 string theFace2Entry = PublishIfNeeded(theFace2, GEOM::FACE, prefix2);
3585 string prefix3 = "Source_vertex_";
3586 BLSURFPlugin::TEntryList_var theSourceVerticesEntries = new BLSURFPlugin::TEntryList();
3587 theSourceVerticesEntries->length(theLength);
3588 GEOM::GEOM_Object_ptr theVtx_i;
3590 for (size_t ind = 0; ind < theLength; ind++) {
3591 theVtx_i = theSourceVertices[ind];
3592 theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix3);
3593 theSourceVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
3596 string prefix4 = "Target_vertex_";
3597 BLSURFPlugin::TEntryList_var theTargetVerticesEntries = new BLSURFPlugin::TEntryList();
3598 theTargetVerticesEntries->length(theLength);
3599 for (size_t ind = 0; ind < theLength; ind++) {
3600 theVtx_i = theTargetVertices[ind];
3601 theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix4);
3602 theTargetVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
3605 string theFace2Name = theFace2->GetName();
3606 MESSAGE("IDL : theFace1->GetName : " << theFace1->GetName());
3607 MESSAGE("IDL : theFace2->GetName : " << theFace2->GetName());
3608 MESSAGE("IDL : AddPreCadFacesPeriodicity( "<< theFace1Entry << ", " << theFace2Entry << ")");
3610 AddPreCadFacesPeriodicityEntry(theFace1Entry.c_str(), theFace2Entry.c_str(),
3611 theSourceVerticesEntries, theTargetVerticesEntries);
3612 } catch (SALOME_Exception& ex) {
3613 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
3618 void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicityEntry(const char* theFace1Entry, const char* theFace2Entry,
3619 const BLSURFPlugin::TEntryList& theSourceVerticesEntriesCorba, const BLSURFPlugin::TEntryList& theTargetVerticesEntriesCorba)
3620 throw (SALOME::SALOME_Exception)
3625 // Convert BLSURFPlugin::TEntryList to vector<string>
3626 vector<string> theSourceVerticesEntries, theTargetVerticesEntries;
3627 for (size_t ind = 0; ind < theSourceVerticesEntriesCorba.length(); ind++) {
3628 theSourceVerticesEntries.push_back(theSourceVerticesEntriesCorba[ind].in());
3629 theTargetVerticesEntries.push_back(theTargetVerticesEntriesCorba[ind].in());
3632 string listEntriesTxt = FormatVerticesEntries(theSourceVerticesEntries, theTargetVerticesEntries);
3634 MESSAGE("IDL : AddPreCadFacesPeriodicityEntry(" << theFace1Entry << ", " << theFace2Entry << listEntriesTxt.c_str() << ")");
3636 this->GetImpl()->AddPreCadFacesPeriodicity(theFace1Entry, theFace2Entry,
3637 theSourceVerticesEntries, theTargetVerticesEntries);
3639 SMESH::TPythonDump pd;
3640 if (!theSourceVerticesEntries.empty())
3642 pd << _this() << ".AddPreCadFacesPeriodicityWithVertices(" << theFace1Entry << ", " << theFace2Entry;
3643 pd << listEntriesTxt.c_str();
3647 pd << _this() << ".AddPreCadFacesPeriodicity(" << theFace1Entry << ", " << theFace2Entry << ")";
3648 MESSAGE("IDL : AddPreCadFacesPeriodicityEntry END");
3651 void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicity(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2)
3652 throw (SALOME::SALOME_Exception)
3655 const GEOM::ListOfGO theSourceVertices;
3656 const GEOM::ListOfGO theTargetVertices;
3657 AddPreCadEdgesPeriodicityWithVertices(theEdge1, theEdge2, theSourceVertices, theTargetVertices);
3660 void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2,
3661 const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
3662 throw (SALOME::SALOME_Exception)
3664 MESSAGE("BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityWithVertices");
3667 size_t theLength = theSourceVertices.length();
3668 if (theLength != theTargetVertices.length())
3669 THROW_SALOME_CORBA_EXCEPTION( "The sizes of theSourceVertices and theTargetVertices must be the same" ,SALOME::BAD_PARAM );
3671 std::vector<GEOM::shape_type> allowedShapeTypes;
3672 allowedShapeTypes.push_back(GEOM::EDGE);
3673 allowedShapeTypes.push_back(GEOM::COMPOUND);
3675 string prefix1 = "Source_edge_";
3676 CheckShapeTypes(theEdge1, allowedShapeTypes);
3677 string theEdge1Entry = PublishIfNeeded(theEdge1, GEOM::EDGE, prefix1);
3679 string prefix2 = "Target_edge_";
3680 CheckShapeTypes(theEdge2, allowedShapeTypes);
3681 string theEdge2Entry = PublishIfNeeded(theEdge2, GEOM::EDGE, prefix2);
3683 string prefix3 = "Source_vertex_";
3684 BLSURFPlugin::TEntryList_var theSourceVerticesEntries = new BLSURFPlugin::TEntryList();
3685 theSourceVerticesEntries->length(theLength);
3686 GEOM::GEOM_Object_ptr theVtx_i;
3688 for (size_t ind = 0; ind < theLength; ind++) {
3689 theVtx_i = theSourceVertices[ind];
3690 theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix3);
3691 theSourceVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
3694 string prefix4 = "Target_vertex_";
3695 BLSURFPlugin::TEntryList_var theTargetVerticesEntries = new BLSURFPlugin::TEntryList();
3696 theTargetVerticesEntries->length(theLength);
3697 for (size_t ind = 0; ind < theLength; ind++) {
3698 theVtx_i = theTargetVertices[ind];
3699 theEntry_i = PublishIfNeeded(theVtx_i, GEOM::VERTEX, prefix4);
3700 theTargetVerticesEntries[ind] = CORBA::string_dup(theEntry_i.c_str());
3703 string theEdge2Name = theEdge2->GetName();
3704 MESSAGE("IDL : theEdge1->GetName : " << theEdge1->GetName());
3705 MESSAGE("IDL : theEdge2->GetName : " << theEdge2->GetName());
3706 MESSAGE("IDL : AddPreCadEdgesPeriodicity( "<< theEdge1Entry << ", " << theEdge2Entry << ")");
3708 AddPreCadEdgesPeriodicityEntry(theEdge1Entry.c_str(), theEdge2Entry.c_str(),
3709 theSourceVerticesEntries, theTargetVerticesEntries);
3710 } catch (SALOME_Exception& ex) {
3711 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
3716 void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityEntry(const char* theEdge1Entry, const char* theEdge2Entry,
3717 const BLSURFPlugin::TEntryList& theSourceVerticesEntriesCorba, const BLSURFPlugin::TEntryList& theTargetVerticesEntriesCorba)
3718 throw (SALOME::SALOME_Exception)
3723 // Convert BLSURFPlugin::TEntryList to vector<string>
3724 vector<string> theSourceVerticesEntries, theTargetVerticesEntries;
3725 for (size_t ind = 0; ind < theSourceVerticesEntriesCorba.length(); ind++) {
3726 theSourceVerticesEntries.push_back(theSourceVerticesEntriesCorba[ind].in());
3727 theTargetVerticesEntries.push_back(theTargetVerticesEntriesCorba[ind].in());
3730 string listEntriesTxt = FormatVerticesEntries(theSourceVerticesEntries, theTargetVerticesEntries);
3732 MESSAGE("IDL : AddPreCadEdgesPeriodicityEntry(" << theEdge1Entry << ", " << theEdge2Entry << listEntriesTxt.c_str() << ")");
3733 this->GetImpl()->AddPreCadEdgesPeriodicity(theEdge1Entry, theEdge2Entry,
3734 theSourceVerticesEntries, theTargetVerticesEntries);
3736 SMESH::TPythonDump pd;
3737 if (!theSourceVerticesEntries.empty())
3739 pd << _this() << ".AddPreCadEdgesPeriodicityWithVertices(" << theEdge1Entry << ", " << theEdge2Entry;
3740 pd << listEntriesTxt.c_str();
3744 pd << _this() << ".AddPreCadEdgesPeriodicity(" << theEdge1Entry << ", " << theEdge2Entry << ")";
3746 MESSAGE("IDL : AddPreCadEdgesPeriodicityEntry END");
3750 //================================================================================
3752 * \brief Sets the file for export resulting mesh in GMF format
3753 * \param theFileName - full name of the file (.mesh, .meshb)
3755 * After compute, export the resulting mesh in the given file with the GMF format (.mesh)
3757 //================================================================================
3758 // void BLSURFPlugin_Hypothesis_i::SetGMFFile(const char* theFileName, CORBA::Boolean isBinary) {
3759 void BLSURFPlugin_Hypothesis_i::SetGMFFile(const char* theFileName) {
3761 MESSAGE("IDL : SetGMFFile(" << theFileName << ")");
3762 bool valueChanged/*, modeChanged*/ = false;
3764 valueChanged = (this->GetImpl()->GetGMFFile() != theFileName);
3765 // modeChanged = (this->GetImpl()->GetGMFFileMode() != isBinary);
3766 if (valueChanged)// or (!valueChanged && modeChanged))
3767 this->GetImpl()->SetGMFFile(theFileName);// ,isBinary);
3768 } catch (const std::exception& ex) {
3769 THROW_SALOME_CORBA_EXCEPTION( ex.what() ,SALOME::BAD_PARAM );
3771 if (valueChanged)// or (!valueChanged && modeChanged))
3772 SMESH::TPythonDump() << _this() << ".SetGMFFile(\"" << theFileName << "\")"; //", " << isBinary << ")";
3773 MESSAGE("IDL : SetGMFFile END ");
3776 //================================================================================
3778 * \brief Gets the file name for export resulting mesh in GMF format
3779 * \retval char* - The file name
3781 * Returns the GMF file name
3783 //================================================================================
3784 char* BLSURFPlugin_Hypothesis_i::GetGMFFile() {
3786 // MESSAGE("IDL : GetGMFFile()");
3787 return CORBA::string_dup(this->GetImpl()->GetGMFFile().c_str());
3790 // //================================================================================
3792 // * \brief Gets the file mode for export resulting mesh in GMF format
3793 // * \retval CORBA::Boolean - TRUE if binary mode, FALSE if ascii mode
3795 // * Returns the GMF file mode
3797 // //================================================================================
3798 // CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetGMFFileMode() {
3799 // ASSERT(myBaseImpl);
3800 // MESSAGE("IDL : GetGMFFileMode()");
3801 // return this->GetImpl()->GetGMFFileMode();
3804 //=============================================================================
3806 * BLSURFPlugin_Hypothesis_i::GetImpl
3808 * Get implementation
3810 //=============================================================================
3811 ::BLSURFPlugin_Hypothesis* BLSURFPlugin_Hypothesis_i::GetImpl() {
3812 // MESSAGE("BLSURFPlugin_Hypothesis_i::GetImpl");
3813 return (::BLSURFPlugin_Hypothesis*) myBaseImpl;
3816 //================================================================================
3818 * \brief Verify whether hypothesis supports given entity type
3819 * \param type - dimension (see SMESH::Dimension enumeration)
3820 * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
3822 * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
3824 //================================================================================
3825 CORBA::Boolean BLSURFPlugin_Hypothesis_i::IsDimSupported(SMESH::Dimension type) {
3826 return type == SMESH::DIM_2D;
3830 // Obsolete methods - To be removed in V7
3833 void BLSURFPlugin_Hypothesis_i::SetPhyMin(CORBA::Double theMinSize) {
3834 this->SetMinSize(theMinSize);
3836 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMin() {
3837 return this->GetMinSize();
3839 void BLSURFPlugin_Hypothesis_i::SetPhyMax(CORBA::Double theMaxSize) {
3840 this->SetMaxSize(theMaxSize);
3842 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPhyMax() {
3843 return this->GetMaxSize();
3845 void BLSURFPlugin_Hypothesis_i::SetGeoMin(CORBA::Double theMinSize) {
3846 this->SetMinSize(theMinSize);
3848 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMin() {
3849 return this->GetMinSize();
3851 void BLSURFPlugin_Hypothesis_i::SetGeoMax(CORBA::Double theMaxSize) {
3852 this->SetMaxSize(theMaxSize);
3854 CORBA::Double BLSURFPlugin_Hypothesis_i::GetGeoMax() {
3855 return this->GetMaxSize();
3857 void BLSURFPlugin_Hypothesis_i::SetAngleMeshS(CORBA::Double theValue) {
3858 this->SetAngleMesh(theValue);
3860 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshS() {
3861 return this->GetAngleMesh();
3863 void BLSURFPlugin_Hypothesis_i::SetAngleMeshC(CORBA::Double theValue) {
3864 this->SetAngleMesh(theValue);
3866 CORBA::Double BLSURFPlugin_Hypothesis_i::GetAngleMeshC() {
3867 return this->GetAngleMesh();
3869 void BLSURFPlugin_Hypothesis_i::SetDecimesh(CORBA::Boolean theValue) {
3870 std::string theValueStr = theValue ? "1" : "0";
3871 this->SetOptionValue("respect_geometry",theValueStr.c_str());
3873 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetDecimesh() {
3874 std::string theValueStr = this->GetOptionValue("respect_geometry");
3875 if (theValueStr.empty() || theValueStr == "respect")
3879 void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveNanoEdges(CORBA::Boolean theValue) {
3880 std::string theValueStr = theValue ? "1" : "0";
3881 this->AddPreCADOption("remove_tiny_edges",theValueStr.c_str());
3883 CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveNanoEdges() {
3884 std::string theValueStr = this->GetPreCADOption("remove_tiny_edges");
3885 if (theValueStr == "1")
3889 void BLSURFPlugin_Hypothesis_i::SetPreCADEpsNano(CORBA::Double theValue) {
3890 std::ostringstream theValueStr;
3891 theValueStr << theValue;
3892 this->AddPreCADOption("tiny_edge_length",theValueStr.str().c_str());
3894 CORBA::Double BLSURFPlugin_Hypothesis_i::GetPreCADEpsNano() {
3895 std::istringstream theValueStr(this->GetPreCADOption("tiny_edge_length"));
3897 theValueStr >> result;