diff --git a/doc/salome/examples/CMakeLists.txt b/doc/salome/examples/CMakeLists.txt
index df54d5a08..54215c734 100644
--- a/doc/salome/examples/CMakeLists.txt
+++ b/doc/salome/examples/CMakeLists.txt
@@ -42,7 +42,7 @@ SALOME_INSTALL_SCRIPTS("${EXAMPLES_TESTS}" ${SALOME_INSTALL_DOC}/examples/SMESH)
SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test)
INSTALL(FILES ${GOOD_TESTS} ${BAD_TESTS} ${SESSION_FREE_TESTS} DESTINATION ${TEST_INSTALL_DIRECTORY})
-INSTALL(FILES Mesh_tri.med DESTINATION ${TEST_INSTALL_DIRECTORY})
+INSTALL(FILES Mesh_tri.med test_homard_adapt.med tutorial_4.00.med tutorial_4.xao tutorial_5.00.med tutorial_5.fr.med DESTINATION ${TEST_INSTALL_DIRECTORY})
INSTALL(FILES CTestTestfileInstall.cmake
DESTINATION ${TEST_INSTALL_DIRECTORY}
diff --git a/doc/salome/examples/test_homard_adapt.med b/doc/salome/examples/test_homard_adapt.med
new file mode 100644
index 000000000..1dae05c2a
Binary files /dev/null and b/doc/salome/examples/test_homard_adapt.med differ
diff --git a/doc/salome/examples/test_homard_adapt.py b/doc/salome/examples/test_homard_adapt.py
new file mode 100644
index 000000000..030bb6f62
--- /dev/null
+++ b/doc/salome/examples/test_homard_adapt.py
@@ -0,0 +1,96 @@
+#!/usr/bin/env python3
+
+
+
+import salome
+salome.salome_init_without_session()
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+import SMESHHOMARD
+
+smesh = smeshBuilder.New()
+
+import os, inspect, tempfile, shutil
+
+data_dir = os.path.abspath(os.path.dirname(inspect.getfile(lambda: None)))
+working_dir = tempfile.mkdtemp()
+
+input_med = os.path.join (data_dir, "test_homard_adapt.med")
+output_med_1 = os.path.join (working_dir, "test_1.00_Uniform_R_01.med")
+output_med_2 = os.path.join (working_dir, "test_1.00_Uniform_R_02.med")
+log_file_1 = os.path.join (working_dir, "test_1.00_Uniform_R_01.med.log")
+log_file_2 = os.path.join (working_dir, "test_1.00_Uniform_R_02.med.log")
+
+# Case 1: input: med file
+# output: med file, log file, published mesh
+if os.path.isfile(output_med_1):
+ os.remove(output_med_1)
+if os.path.isfile(log_file_1):
+ os.remove(log_file_1)
+
+smeshhomard = smesh.Adaptation("Uniform")
+smeshhomard.CreateCase("MAILL", input_med, working_dir)
+smeshhomard.SetConfType(0)
+smeshhomard.SetKeepMedOUT(True)
+smeshhomard.SetPublishMeshOUT(True)
+smeshhomard.SetMeshNameOUT("MAILL_Uniform_R_01")
+smeshhomard.SetMeshFileOUT(output_med_1)
+smeshhomard.SetKeepWorkingFiles(False)
+smeshhomard.SetLogInFile(True)
+smeshhomard.SetLogFile(log_file_1)
+smeshhomard.SetRemoveLogOnSuccess(False)
+smeshhomard.SetVerboseLevel(3)
+smeshhomard.Compute()
+
+if os.path.isfile(output_med_1):
+ os.remove(output_med_1)
+else:
+ print("Test Uniform refinement Case 1: Error: no output med file")
+ assert(False)
+
+if os.path.isfile(log_file_1):
+ os.remove(log_file_1)
+else:
+ print("Test Uniform refinement Case 1: Error: no log file")
+ assert(False)
+
+# Case 2: input: mesh, boundaries
+# output: published mesh
+if os.path.isfile(output_med_2):
+ os.remove(output_med_2)
+if os.path.isfile(log_file_2):
+ os.remove(log_file_2)
+
+# prepare input mesh
+([MAILL], status) = smesh.CreateMeshesFromMED( input_med )
+
+#smeshhomard = smesh.Adaptation("Uniform")
+Boun_1 = smeshhomard.CreateBoundaryCylinder("Boun_1", 0.5, 0.5, 0.5, 0, 0, 1, 0.25)
+smeshhomard.CreateCaseOnMesh("MAILL", MAILL.GetMesh(), working_dir)
+smeshhomard.SetConfType(0)
+smeshhomard.AddBoundaryGroup("Boun_1", "BORD_EXT")
+smeshhomard.AddBoundaryGroup("Boun_1", "MOITIE1")
+smeshhomard.SetKeepMedOUT(False)
+smeshhomard.SetPublishMeshOUT(True)
+smeshhomard.SetMeshNameOUT("MAILL_Uniform_R_02")
+smeshhomard.SetMeshFileOUT(output_med_2)
+smeshhomard.SetKeepWorkingFiles(False)
+smeshhomard.SetLogInFile(True)
+smeshhomard.SetLogFile(log_file_2)
+smeshhomard.SetRemoveLogOnSuccess(True)
+smeshhomard.SetVerboseLevel(0)
+smeshhomard.Compute()
+
+if os.path.isfile(output_med_2):
+ print("Test Uniform refinement Case 2: Error: output med file has not been removed")
+ assert(False)
+
+if os.path.isfile(log_file_2):
+ print("Test Uniform refinement Case 2: Error: log file has not been removed")
+ assert(False)
+
+shutil.rmtree(working_dir)
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser()
diff --git a/doc/salome/examples/test_uniform_refinement.py b/doc/salome/examples/test_uniform_refinement.py
new file mode 100644
index 000000000..9ce353477
--- /dev/null
+++ b/doc/salome/examples/test_uniform_refinement.py
@@ -0,0 +1,100 @@
+#!/usr/bin/env python3
+
+import salome
+salome.salome_init_without_session()
+
+import SMESH, SALOMEDS
+from salome.smesh import smeshBuilder
+import SMESHHOMARD
+
+smesh = smeshBuilder.New()
+
+import os, inspect, tempfile, shutil
+
+data_dir = os.path.abspath(os.path.dirname(inspect.getfile(lambda: None)))
+working_dir = tempfile.mkdtemp()
+
+input_med_1 = os.path.join (data_dir, "tutorial_4.00.med")
+input_xao_1 = os.path.join (data_dir, "tutorial_4.xao")
+output_med_1 = os.path.join (working_dir, "tutorial_4.00_Uniform_R.med")
+log_file_1 = os.path.join (working_dir, "tutorial_4.00_Uniform_R.log")
+
+# Case 1: input: med file
+# output: med file, log file, published mesh
+if os.path.isfile(output_med_1):
+ os.remove(output_med_1)
+if os.path.isfile(log_file_1):
+ os.remove(log_file_1)
+
+cao_name = "CAO_PIQUAGE"
+smeshhomard = smesh.Adaptation("Uniform")
+smeshhomard.CreateBoundaryCAO(cao_name, input_xao_1)
+smeshhomard.CreateCase("PIQUAGE", input_med_1, working_dir)
+smeshhomard.AddBoundary(cao_name)
+smeshhomard.SetConfType(0)
+smeshhomard.SetKeepMedOUT(True)
+smeshhomard.SetPublishMeshOUT(True)
+smeshhomard.SetMeshNameOUT("PIQUAGE_Uniform_R_01")
+smeshhomard.SetMeshFileOUT(output_med_1)
+smeshhomard.SetKeepWorkingFiles(False)
+smeshhomard.SetLogInFile(True)
+smeshhomard.SetLogFile(log_file_1)
+smeshhomard.SetRemoveLogOnSuccess(False)
+smeshhomard.SetVerboseLevel(3)
+smeshhomard.Compute()
+
+if os.path.isfile(output_med_1):
+ os.remove(output_med_1)
+else:
+ print("Test Uniform refinement Case 1: Error: no output med file")
+ assert(False)
+
+if os.path.isfile(log_file_1):
+ os.remove(log_file_1)
+else:
+ print("Test Uniform refinement Case 1: Error: no log file")
+ assert(False)
+
+# Case 2: input: mesh, boundaries
+# output: published mesh
+input_med_2 = os.path.join (data_dir, "tutorial_5.00.med")
+input_fr = os.path.join (data_dir, "tutorial_5.fr.med")
+output_med_2 = os.path.join (working_dir, "tutorial_5.00_Uniform_R.med")
+log_file_2 = os.path.join (working_dir, "tutorial_5.00_Uniform_R.log")
+
+if os.path.isfile(output_med_2):
+ os.remove(output_med_2)
+if os.path.isfile(log_file_2):
+ os.remove(log_file_2)
+
+# prepare input mesh
+([MAILL], status) = smesh.CreateMeshesFromMED( input_med_2 )
+
+smeshhomard = smesh.Adaptation("Uniform")
+smeshhomard.CreateBoundaryDi("Boun_5_1", "MAIL_EXT", input_fr)
+smeshhomard.CreateCaseOnMesh("COEUR_2D", MAILL.GetMesh(), working_dir)
+smeshhomard.AddBoundary("Boun_5_1")
+smeshhomard.SetConfType(1)
+smeshhomard.SetKeepMedOUT(False)
+smeshhomard.SetPublishMeshOUT(True)
+smeshhomard.SetMeshNameOUT("COEUR_2D_Uniform_R")
+smeshhomard.SetMeshFileOUT(output_med_2)
+smeshhomard.SetKeepWorkingFiles(False)
+smeshhomard.SetLogInFile(True)
+smeshhomard.SetLogFile(log_file_2)
+smeshhomard.SetRemoveLogOnSuccess(True)
+smeshhomard.SetVerboseLevel(0)
+smeshhomard.Compute()
+
+if os.path.isfile(output_med_2):
+ print("Test Uniform refinement Case 2: Error: output med file has not been removed")
+ assert(False)
+
+if os.path.isfile(log_file_2):
+ print("Test Uniform refinement Case 2: Error: log file has not been removed")
+ assert(False)
+
+shutil.rmtree(working_dir)
+
+if salome.sg.hasDesktop():
+ salome.sg.updateObjBrowser()
diff --git a/doc/salome/examples/tests.set b/doc/salome/examples/tests.set
index 5382b5e9f..bf759ea13 100644
--- a/doc/salome/examples/tests.set
+++ b/doc/salome/examples/tests.set
@@ -56,6 +56,8 @@ SET(BAD_TESTS
IF(NOT WIN32)
LIST(APPEND BAD_TESTS
MGAdaptTests_without_session.py
+ test_homard_adapt.py
+ test_uniform_refinement.py
test_smeshplugin_mg_tetra_parallele.py
)
ENDIF(NOT WIN32)
diff --git a/doc/salome/examples/tutorial_4.00.med b/doc/salome/examples/tutorial_4.00.med
new file mode 100644
index 000000000..9a70e0c87
Binary files /dev/null and b/doc/salome/examples/tutorial_4.00.med differ
diff --git a/doc/salome/examples/tutorial_4.xao b/doc/salome/examples/tutorial_4.xao
new file mode 100644
index 000000000..415904a64
--- /dev/null
+++ b/doc/salome/examples/tutorial_4.xao
@@ -0,0 +1,652 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/doc/salome/examples/tutorial_5.00.med b/doc/salome/examples/tutorial_5.00.med
new file mode 100644
index 000000000..9c1893a76
Binary files /dev/null and b/doc/salome/examples/tutorial_5.00.med differ
diff --git a/doc/salome/examples/tutorial_5.fr.med b/doc/salome/examples/tutorial_5.fr.med
new file mode 100644
index 000000000..d4faa4c73
Binary files /dev/null and b/doc/salome/examples/tutorial_5.fr.med differ
diff --git a/doc/salome/gui/SMESH/images/adaptation_with_homard_advanced.png b/doc/salome/gui/SMESH/images/adaptation_with_homard_advanced.png
new file mode 100644
index 000000000..dc05826c6
Binary files /dev/null and b/doc/salome/gui/SMESH/images/adaptation_with_homard_advanced.png differ
diff --git a/doc/salome/gui/SMESH/images/adaptation_with_homard_arguments.png b/doc/salome/gui/SMESH/images/adaptation_with_homard_arguments.png
new file mode 100644
index 000000000..2bdd411cd
Binary files /dev/null and b/doc/salome/gui/SMESH/images/adaptation_with_homard_arguments.png differ
diff --git a/doc/salome/gui/SMESH/images/adaptation_with_homard_boundary_analytical.png b/doc/salome/gui/SMESH/images/adaptation_with_homard_boundary_analytical.png
new file mode 100644
index 000000000..2beb58dff
Binary files /dev/null and b/doc/salome/gui/SMESH/images/adaptation_with_homard_boundary_analytical.png differ
diff --git a/doc/salome/gui/SMESH/images/adaptation_with_homard_boundary_cao.png b/doc/salome/gui/SMESH/images/adaptation_with_homard_boundary_cao.png
new file mode 100644
index 000000000..8d823b916
Binary files /dev/null and b/doc/salome/gui/SMESH/images/adaptation_with_homard_boundary_cao.png differ
diff --git a/doc/salome/gui/SMESH/images/adaptation_with_homard_boundary_discrete.png b/doc/salome/gui/SMESH/images/adaptation_with_homard_boundary_discrete.png
new file mode 100644
index 000000000..31d2cdf95
Binary files /dev/null and b/doc/salome/gui/SMESH/images/adaptation_with_homard_boundary_discrete.png differ
diff --git a/doc/salome/gui/SMESH/images/adaptation_with_homard_boundary_groups.png b/doc/salome/gui/SMESH/images/adaptation_with_homard_boundary_groups.png
new file mode 100644
index 000000000..815591e30
Binary files /dev/null and b/doc/salome/gui/SMESH/images/adaptation_with_homard_boundary_groups.png differ
diff --git a/doc/salome/gui/SMESH/images/create_boundary_1.png b/doc/salome/gui/SMESH/images/create_boundary_1.png
new file mode 100644
index 000000000..f6e34b625
Binary files /dev/null and b/doc/salome/gui/SMESH/images/create_boundary_1.png differ
diff --git a/doc/salome/gui/SMESH/images/create_boundary_an_1.png b/doc/salome/gui/SMESH/images/create_boundary_an_1.png
new file mode 100644
index 000000000..2e634da03
Binary files /dev/null and b/doc/salome/gui/SMESH/images/create_boundary_an_1.png differ
diff --git a/doc/salome/gui/SMESH/images/create_boundary_an_2.png b/doc/salome/gui/SMESH/images/create_boundary_an_2.png
new file mode 100644
index 000000000..25c6e9b1d
Binary files /dev/null and b/doc/salome/gui/SMESH/images/create_boundary_an_2.png differ
diff --git a/doc/salome/gui/SMESH/images/create_boundary_an_3.png b/doc/salome/gui/SMESH/images/create_boundary_an_3.png
new file mode 100644
index 000000000..6f38d9f8f
Binary files /dev/null and b/doc/salome/gui/SMESH/images/create_boundary_an_3.png differ
diff --git a/doc/salome/gui/SMESH/images/create_boundary_an_4.png b/doc/salome/gui/SMESH/images/create_boundary_an_4.png
new file mode 100644
index 000000000..abf104213
Binary files /dev/null and b/doc/salome/gui/SMESH/images/create_boundary_an_4.png differ
diff --git a/doc/salome/gui/SMESH/images/create_boundary_an_co_1.png b/doc/salome/gui/SMESH/images/create_boundary_an_co_1.png
new file mode 100644
index 000000000..7212cba31
Binary files /dev/null and b/doc/salome/gui/SMESH/images/create_boundary_an_co_1.png differ
diff --git a/doc/salome/gui/SMESH/images/create_boundary_an_co_2.png b/doc/salome/gui/SMESH/images/create_boundary_an_co_2.png
new file mode 100644
index 000000000..017b56d94
Binary files /dev/null and b/doc/salome/gui/SMESH/images/create_boundary_an_co_2.png differ
diff --git a/doc/salome/gui/SMESH/images/create_boundary_an_cy.png b/doc/salome/gui/SMESH/images/create_boundary_an_cy.png
new file mode 100644
index 000000000..2efc3fdc0
Binary files /dev/null and b/doc/salome/gui/SMESH/images/create_boundary_an_cy.png differ
diff --git a/doc/salome/gui/SMESH/images/create_boundary_an_sp.png b/doc/salome/gui/SMESH/images/create_boundary_an_sp.png
new file mode 100644
index 000000000..be7b28b7b
Binary files /dev/null and b/doc/salome/gui/SMESH/images/create_boundary_an_sp.png differ
diff --git a/doc/salome/gui/SMESH/images/create_boundary_an_to.png b/doc/salome/gui/SMESH/images/create_boundary_an_to.png
new file mode 100644
index 000000000..38e39409b
Binary files /dev/null and b/doc/salome/gui/SMESH/images/create_boundary_an_to.png differ
diff --git a/doc/salome/gui/SMESH/images/create_boundary_cao_1.png b/doc/salome/gui/SMESH/images/create_boundary_cao_1.png
new file mode 100644
index 000000000..96c2382e7
Binary files /dev/null and b/doc/salome/gui/SMESH/images/create_boundary_cao_1.png differ
diff --git a/doc/salome/gui/SMESH/images/create_boundary_cao_2.png b/doc/salome/gui/SMESH/images/create_boundary_cao_2.png
new file mode 100644
index 000000000..94da749c3
Binary files /dev/null and b/doc/salome/gui/SMESH/images/create_boundary_cao_2.png differ
diff --git a/doc/salome/gui/SMESH/images/create_boundary_di_1.png b/doc/salome/gui/SMESH/images/create_boundary_di_1.png
new file mode 100644
index 000000000..8f5770be1
Binary files /dev/null and b/doc/salome/gui/SMESH/images/create_boundary_di_1.png differ
diff --git a/doc/salome/gui/SMESH/images/create_boundary_di_2.png b/doc/salome/gui/SMESH/images/create_boundary_di_2.png
new file mode 100644
index 000000000..33ed85f34
Binary files /dev/null and b/doc/salome/gui/SMESH/images/create_boundary_di_2.png differ
diff --git a/doc/salome/gui/SMESH/images/create_boundary_di_3.png b/doc/salome/gui/SMESH/images/create_boundary_di_3.png
new file mode 100644
index 000000000..e682a3974
Binary files /dev/null and b/doc/salome/gui/SMESH/images/create_boundary_di_3.png differ
diff --git a/doc/salome/gui/SMESH/input/adaptation.rst b/doc/salome/gui/SMESH/input/adaptation.rst
index 624851d75..ceac1c998 100644
--- a/doc/salome/gui/SMESH/input/adaptation.rst
+++ b/doc/salome/gui/SMESH/input/adaptation.rst
@@ -5,9 +5,58 @@ Adaptation
**********
Mesh module provides the possibility to perform different adaptations of a mesh.
+To refine the mesh means to cut out elements indicated according to indications provided by the user.
+
+.. _homard_adapt_anchor:
+
+HOMARD
+######
+
+HOMARD can treat meshes into 2 or 3 dimensions and comprising the following elements:
+ - mesh-points
+ - segments
+ - triangles
+ - quadrangles
+ - tetrahedra
+ - hexahedra
+ - prisms
+
+These elements can be present simultaneously. For example, HOMARD will be able to adapt a comprising mesh of the triangles and the quadrangles.
+
+To start operation, select **Remesh with HOMARD** item in **Adaptation** menu.
+
+.. image:: ../images/adaptation_with_homard_arguments.png
+ :align: center
+
+* **Mesh In** is the initial mesh to remesh.
+* **Mesh Out** is the resulting mesh after remeshing. By default, the name of the initial mesh is kept and the file name is based on the name of the initial mesh.
+* **Conformity type** is a choice between **Conformal** and **Non conformal**.
+* **Boundary type** is a choice between **No boundary**, **CAO** and **Non CAO**.
+
+- If the choice is **CAO**, a XAO file is required for each CAO boundary creation.
+
+.. image:: ../images/adaptation_with_homard_boundary_cao.png
+ :align: center
+
+**See more** at :ref:`homard_create_boundary_CAO`.
+
+- If the choice is **Non CAO**, some discrete and/or analytical boundaries can be created.
+
+.. image:: ../images/adaptation_with_homard_boundary_discrete.png
+ :align: center
+
+**See more** at :ref:`homard_create_boundary_Di`.
+
+.. image:: ../images/adaptation_with_homard_boundary_analytical.png
+ :align: center
+
+**See more** at :ref:`homard_create_boundary_An`.
.. note::
- A mesh adaptation based on splitting is available by the HOMARD module.
+ The exhaustive description of HOMARD can be read into its documentation. It can be reached by the general help button.
+
+**See Also** a sample TUI Script of adaptation with :ref:`tui_homard_adapt`.
+
.. _mg_adapt_anchor:
@@ -16,7 +65,7 @@ MG_Adapt
For meshes made of triangles and/or tetrahedra, remeshing operations are available with the MG-Adapt plugin. The remeshing is based on wanted mesh sizes defined over the mesh or as a constant. The boundaries are dedeuced from the initial mesh.
-To start **Remeshing** operation, select **MG Adapt** tab in **Adaptation** dialog.
+To start **Remeshing** operation, select **Remesh with MG_Adapt** item in **Adaptation** menu.
.. image:: ../images/adaptation_01.png
:align: center
diff --git a/doc/salome/gui/SMESH/input/homard_create_boundary.rst b/doc/salome/gui/SMESH/input/homard_create_boundary.rst
new file mode 100644
index 000000000..230ce001d
--- /dev/null
+++ b/doc/salome/gui/SMESH/input/homard_create_boundary.rst
@@ -0,0 +1,169 @@
+.. _homard_create_boundary:
+
+The boundary
+############
+.. index:: single: boundary
+.. index:: single: frontière
+.. index:: single: CAO
+
+The object boundary contains all the geometrical definitions allowing to describe a curved boundary to be followed.
+
+There are two modes of description of a boundary:
+
+ - CAO: the boundary comes from the geometry of the domain
+ - Non CAO: if the CAO is not available, the boundary can be approximated by its descriptions:
+
+ * Discrete: to describe the set of 1D curves that defines the boundary
+ * Analytics: to describe every surface that defines the boundary
+
+This choice is:
+
+.. image:: ../images/create_boundary_1.png
+ :align: center
+
+.. _homard_create_boundary_CAO:
+
+CAO boundary
+************
+
+The follow-up of a CAO boundary will be made by selecting a boundary chosen in the list of the existing CAO boundaries.
+
+In the starting up, the list is empty. It is necessary to create a first CAO boundary by activation of the button "*New*":
+
+.. image:: ../images/create_boundary_cao_1.png
+ :align: center
+
+The window invites in the choice of a file that contains the CAO with XAO format. This CAO is the one that is the basis for the initial mesh. A name of boundary is automatically proposed: Boun_1, Boun_2, etc. This name can be modified. It must not already have been used for another boundary, whatever its type.
+
+.. image:: ../images/create_boundary_cao_2.png
+ :align: center
+
+.. note::
+ The coherence between this CAO and the initial mesh is not checked.
+
+Filtering by the groups
+***********************
+.. index:: single: group
+
+We can restrict the application of the boundary to groups. So elements not belonging to these groups will not be affected. We check the associated button **Filtering with groups**. The list of the present groups of elements in the mesh is shown. It is enough to check those wanted to restrict the boundary.
+
+.. image:: ../images/adaptation_with_homard_boundary_groups.png
+ :align: center
+
+.. _homard_create_boundary_Di:
+
+Discrete boundary
+*****************
+
+The follow-up of a discrete boundary will be made by selecting a boundary chosen in the list of the existing discrete boundaries.
+
+In the starting up, the list is empty. It is necessary to create a first discrete boundary by activation of the button "*New*":
+
+.. image:: ../images/create_boundary_di_1.png
+ :align: center
+
+The window invites in the choice of a file of mesh. This mesh is the one of all the lines constituting the boundary. A name of boundary is automatically proposed: Boun_1, Boun_2, etc. This name can be modified. It must not already have been used for another boundary, whatever its type.
+
+.. image:: ../images/create_boundary_di_2.png
+ :align: center
+
+.. note::
+ The file has to contain only a single mesh.
+
+If discrete boundaries were already defined for another case, we can select one of them. We can also create a new discrete boundary by activation of the button "*New*", as explained previously.
+
+.. image:: ../images/create_boundary_di_3.png
+ :align: center
+
+
+
+.. _homard_create_boundary_An:
+
+Analytical boundary
+*******************
+In the starting up, SALOME shows a table with one only one column. This column contains the list of all the groups of the initial mesh defining the case.
+
+.. image:: ../images/create_boundary_an_1.png
+ :align: center
+
+It is necessary to create a first analytical boundary by activation of the button "*New*". We shall have the choice between cylinder, sphere, cone or torus. When the boundary will be validated, its name will appear in header of the second column.
+
+.. image:: ../images/create_boundary_an_2.png
+ :align: center
+
+It is now necessary to establish the link enter the mesh defining the case and this boundary described analytically. It is made by checking the groups of the faces which have to be on the boundary.
+
+.. image:: ../images/create_boundary_an_3.png
+ :align: center
+
+This operation is repeated as often as we wish to place faces of meshs on a curved surface:
+
+.. image:: ../images/create_boundary_an_4.png
+ :align: center
+
+.. note::
+
+ A group can be checked very well never: it means that the elements which it defines belong to none of the described boundaries.
+
+ A group can be checked only once. Indeed, surface elements cannot belong to more than one surface.
+
+ Several groups can be checked for the same boundary. It occurs if the initial mesh of the zone was subdivided into several groups: all the surface elements belong to this surface but were distributed in several groups.
+
+ Conversely, a boundary can be very well retained by no group. It occurs if it was defined for a previous case and if it is groundless for the case in the course of definition.
+
+
+There are four types of analytical boundary:
+
+ - Cylindre
+ - Sphere
+ - Cone, described by an axis and an angle or by two radius
+ - Torus
+
+.. note::
+ The numerical values proposed by default take into account the geometry of the mesh.
+
+
+Cylindre
+========
+.. index:: single: cylindre
+
+The cylinder is defined by a point of the axis, its axis and its radius. The axis is defined by a vector. The standard of this vector is not inevitably equal to 1; also, its orientation has no importance. A name of boundary is automatically proposed: Boun_1, Boun_2, etc. This name can be modified. It must not already have been used for another boundary, whatever its type.
+
+.. image:: ../images/create_boundary_an_cy.png
+ :align: center
+
+Sphere
+======
+.. index:: single: sphere
+
+The sphere is defined by its center and its radius. A name of boundary is automatically proposed: Boun_1, Boun_2, etc. This name can be modified. It must not already have been used for another boundary, whatever its type.
+
+.. image:: ../images/create_boundary_an_sp.png
+ :align: center
+
+Cone
+====
+.. index:: single: cone
+
+A cone is defined by two different manners: the center, the axis and the angle of opening in degree or by two points centered on the axis and the associated radius. A name of boundary is automatically proposed: Boun_1, Boun_2, etc. This name can be modified. It must not already have been used for another boundary, whatever its type.
+
+Creation by an origin, an axis and an angle of opening:
+
+.. image:: ../images/create_boundary_an_co_1.png
+ :align: center
+
+Creation by two points centered on the axis and the associated radius:
+
+.. image:: ../images/create_boundary_an_co_2.png
+ :align: center
+
+.. index:: single: object browser
+
+Torus
+=====
+.. index:: single: torus
+
+The torus is defined by its centre, its axis, the revolution radius and the primary radius. The axis is defined by a vector. The standard of this vector is not inevitably equal to 1; also, its orientation has no importance. A name of boundary is automatically proposed: Boun_1, Boun_2, etc. This name can be modified. It must not already have been used for another boundary, whatever its type.
+
+.. image:: ../images/create_boundary_an_to.png
+ :align: center
diff --git a/doc/salome/gui/SMESH/input/tui_adaptation.rst b/doc/salome/gui/SMESH/input/tui_adaptation.rst
index e0bf7d0da..2e90aad82 100644
--- a/doc/salome/gui/SMESH/input/tui_adaptation.rst
+++ b/doc/salome/gui/SMESH/input/tui_adaptation.rst
@@ -4,6 +4,21 @@
Adaptation
**********
+.. _tui_homard_adapt:
+
+HOMARD
+======
+
+.. literalinclude:: ../../../examples/test_uniform_refinement.py
+ :language: python
+
+:download:`Download this script <../../../examples/test_uniform_refinement.py>`
+
+.. literalinclude:: ../../../examples/test_homard_adapt.py
+ :language: python
+
+:download:`Download this script <../../../examples/test_homard_adapt.py>`
+
.. _tui_mg_adapt:
MG_Adapt
diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt
index bd2569e2a..bc5326b53 100644
--- a/idl/CMakeLists.txt
+++ b/idl/CMakeLists.txt
@@ -40,6 +40,7 @@ SET(SalomeIDLSMESH_IDLSOURCES
SMESH_Measurements.idl
${CMAKE_CURRENT_BINARY_DIR}/SMESH_smIdType.idl
MG_ADAPT.idl
+ SMESH_Homard.idl
)
SET(_idl_include_dirs
diff --git a/idl/SMESH_Gen.idl b/idl/SMESH_Gen.idl
index cfdca30f1..532c86122 100644
--- a/idl/SMESH_Gen.idl
+++ b/idl/SMESH_Gen.idl
@@ -35,6 +35,11 @@
#include "SMESH_Hypothesis.idl"
#include "SMESH_smIdType.idl"
+module SMESHHOMARD
+{
+ interface HOMARD_Gen;
+};
+
module SMESH
{
typedef sequence sobject_list;
@@ -581,7 +586,9 @@ module SMESH
in double theTolerance );
MG_ADAPT CreateMG_ADAPT();
- MG_ADAPT_OBJECT Adaptation(in string adaptType);
+ SMESHHOMARD::HOMARD_Gen CreateHOMARD_ADAPT() raises ( SALOME::SALOME_Exception );
+ //MG_ADAPT_OBJECT Adaptation(in string adaptType);
+ SALOME::GenericObj Adaptation(in string adaptType) raises ( SALOME::SALOME_Exception );
MG_ADAPT CreateAdaptationHypothesis();
};
diff --git a/idl/SMESH_Homard.idl b/idl/SMESH_Homard.idl
new file mode 100644
index 000000000..ff25358ec
--- /dev/null
+++ b/idl/SMESH_Homard.idl
@@ -0,0 +1,183 @@
+// Copyright (C) 2011-2021 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _SMESH_HOMARD_IDL
+#define _SMESH_HOMARD_IDL
+
+#include "SMESH_Mesh.idl"
+
+#include "SALOME_Exception.idl"
+#include "SALOMEDS.idl"
+
+module SMESHHOMARD
+{
+ typedef sequence double_array;
+ typedef sequence extrema;
+ typedef sequence ListGroupType;
+ typedef sequence ListBoundaryGroupType;
+ typedef sequence listeBoundarys;
+
+ interface HOMARD_Boundary : SALOME::GenericObj
+ {
+ // Generalites
+ void SetName(in string Name) raises (SALOME::SALOME_Exception);
+ string GetName() raises (SALOME::SALOME_Exception);
+
+ // Caracteristiques
+ void SetType (in long Type) raises (SALOME::SALOME_Exception);
+ long GetType() raises (SALOME::SALOME_Exception);
+
+ void SetDataFile(in string DataFile) raises (SALOME::SALOME_Exception);
+ string GetDataFile() raises (SALOME::SALOME_Exception);
+
+ void SetMeshName(in string MeshName) raises (SALOME::SALOME_Exception);
+ string GetMeshName() raises (SALOME::SALOME_Exception);
+
+ void SetCylinder (in double Xcentre, in double Ycentre, in double Zcentre,
+ in double Xaxe, in double Yaxe, in double Zaxe, in double rayon)
+ raises (SALOME::SALOME_Exception);
+
+ void SetSphere (in double Xcentre, in double Ycentre, in double Zcentre, in double rayon)
+ raises (SALOME::SALOME_Exception);
+
+ void SetConeR (in double Xcentre1, in double Ycentre1, in double Zcentre1,
+ in double Rayon1,
+ in double Xcentre2, in double Ycentre2, in double Zcentre2,
+ in double Rayon2) raises (SALOME::SALOME_Exception);
+
+ void SetConeA(in double Xaxe, in double Yaxe, in double Zaxe, in double Angle,
+ in double Xcentre, in double Ycentre, in double ZCentre)
+ raises (SALOME::SALOME_Exception);
+
+ void SetTorus (in double Xcentre, in double Ycentre, in double Zcentre,
+ in double Xaxe, in double Yaxe, in double Zaxe,
+ in double rayonRev, in double rayonPri)
+ raises (SALOME::SALOME_Exception);
+
+ SMESHHOMARD::double_array GetCoords() raises (SALOME::SALOME_Exception);
+
+ void SetLimit (in double Xincr, in double Yincr, in double Zincr)
+ raises (SALOME::SALOME_Exception);
+ SMESHHOMARD::double_array GetLimit() raises (SALOME::SALOME_Exception);
+
+ void AddGroup(in string LeGroupe) raises (SALOME::SALOME_Exception);
+ void SetGroups(in ListGroupType ListGroup) raises (SALOME::SALOME_Exception);
+ ListGroupType GetGroups() raises (SALOME::SALOME_Exception);
+
+ string GetDumpPython() raises (SALOME::SALOME_Exception);
+ };
+
+ interface HOMARD_Cas : SALOME::GenericObj
+ {
+ void SetDirName(in string NomDir) raises (SALOME::SALOME_Exception);
+ string GetDirName() raises (SALOME::SALOME_Exception);
+
+ void SetBoundingBox(in extrema LesExtremes) raises (SALOME::SALOME_Exception);
+ extrema GetBoundingBox() raises (SALOME::SALOME_Exception);
+
+ void AddGroup(in string Group) raises (SALOME::SALOME_Exception);
+ void SetGroups(in ListGroupType ListGroup) raises (SALOME::SALOME_Exception);
+ ListGroupType GetGroups() raises (SALOME::SALOME_Exception);
+
+ void AddBoundary(in string BoundaryName) raises (SALOME::SALOME_Exception);
+ void AddBoundaryGroup(in string BoundaryName,
+ in string Group) raises (SALOME::SALOME_Exception);
+ ListBoundaryGroupType GetBoundaryGroup() raises (SALOME::SALOME_Exception);
+ void SupprBoundaryGroup() raises (SALOME::SALOME_Exception);
+
+ string GetDumpPython() raises (SALOME::SALOME_Exception);
+ };
+
+ interface HOMARD_Gen : SALOME::GenericObj
+ {
+ // Create boundaries
+ HOMARD_Boundary CreateBoundaryCAO (in string BoundaryName, in string FileName)
+ raises(SALOME::SALOME_Exception);
+ HOMARD_Boundary CreateBoundaryDi (in string BoundaryName, in string MeshName,
+ in string FileName)
+ raises(SALOME::SALOME_Exception);
+ HOMARD_Boundary CreateBoundaryCylinder (in string BoundaryName,
+ in double Xcentre, in double Ycentre, in double Zcentre,
+ in double Xaxis, in double Yaxis, in double Zaxis,
+ in double Radius)
+ raises (SALOME::SALOME_Exception);
+ HOMARD_Boundary CreateBoundarySphere (in string BoundaryName,
+ in double Xcentre, in double Ycentre, in double Zcentre,
+ in double Radius)
+ raises(SALOME::SALOME_Exception);
+ HOMARD_Boundary CreateBoundaryConeR (in string BoundaryName,
+ in double Xcentre1, in double Ycentre1, in double Zcentre1,
+ in double Radius1,
+ in double Xcentre2, in double Ycentre2, in double Zcentre2,
+ in double Radius2)
+ raises(SALOME::SALOME_Exception);
+ HOMARD_Boundary CreateBoundaryConeA (in string BoundaryName,
+ in double Xaxis, in double Yaxis, in double Zaxis,
+ in double Angle,
+ in double Xcentre, in double Ycentre, in double Zcentre)
+ raises(SALOME::SALOME_Exception);
+ HOMARD_Boundary CreateBoundaryTorus (in string BoundaryName,
+ in double Xcentre, in double Ycentre, in double Zcentre,
+ in double Xaxis, in double Yaxis, in double Zaxis,
+ in double RadiusRev, in double RadiusPri)
+ raises (SALOME::SALOME_Exception);
+
+ // Set mesh (SMESH_Mesh object or MED file) and working directory
+ HOMARD_Cas CreateCaseOnMesh(in string MeshName,
+ in SMESH::SMESH_Mesh smeshMesh,
+ in string theWorkingDir) raises(SALOME::SALOME_Exception);
+ HOMARD_Cas CreateCase(in string MeshName,
+ in string FileName,
+ in string theWorkingDir) raises(SALOME::SALOME_Exception);
+
+ // Associate boundaries to groups
+ void AddBoundary(in string BoundaryName) raises (SALOME::SALOME_Exception);
+ void AddBoundaryGroup(in string BoundaryName,
+ in string Group) raises (SALOME::SALOME_Exception);
+
+ // Information
+ HOMARD_Boundary GetBoundary(in string BoundaryName) raises (SALOME::SALOME_Exception);
+ HOMARD_Cas GetCase() raises (SALOME::SALOME_Exception);
+ listeBoundarys GetAllBoundarysName() raises (SALOME::SALOME_Exception);
+
+ // Preferences
+ void SetConfType(in long ConfType) raises (SALOME::SALOME_Exception);
+ void SetKeepMedOUT (in boolean theKeepMedOUT);
+ void SetPublishMeshOUT (in boolean thePublishMeshOUT);
+ void SetMeshNameOUT (in string theMeshName) raises (SALOME::SALOME_Exception);
+ void SetMeshFileOUT (in string theFileName) raises (SALOME::SALOME_Exception);
+
+ void SetVerboseLevel (in long theLevel);
+ void SetKeepWorkingFiles (in boolean theKeepWorkingFiles);
+ void SetLogInFile (in boolean theLogInFile);
+ void SetLogFile (in string theFileName) raises (SALOME::SALOME_Exception);
+ void SetRemoveLogOnSuccess (in boolean theRemoveLogOnSuccess);
+
+ // Computation
+ long Compute() raises (SALOME::SALOME_Exception);
+
+ // Clean data
+ void InvalideBoundary (in string BoundaryName) raises (SALOME::SALOME_Exception);
+ long DeleteBoundary (in string BoundaryName) raises (SALOME::SALOME_Exception);
+ void DeleteCase() raises (SALOME::SALOME_Exception);
+ };
+
+}; // module SMESHHOMARD
+
+#endif
diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt
index 7e0d62012..d1436578a 100644
--- a/resources/CMakeLists.txt
+++ b/resources/CMakeLists.txt
@@ -23,6 +23,7 @@
SET(SMESH_RESOURCES_FILES
ModuleMesh.png
adapt_mg_adapt.png
+ adapt_homard.png
advanced_mesh_info.png
bare_border_face.png
bare_border_volume.png
diff --git a/resources/adapt_homard.png b/resources/adapt_homard.png
new file mode 100644
index 000000000..95b4c139b
Binary files /dev/null and b/resources/adapt_homard.png differ
diff --git a/src/SMESH/CMakeLists.txt b/src/SMESH/CMakeLists.txt
index ad34d18d8..9dd4e5fb2 100644
--- a/src/SMESH/CMakeLists.txt
+++ b/src/SMESH/CMakeLists.txt
@@ -89,6 +89,7 @@ SET(SMESHimpl_HEADERS
SMESH_ProxyMesh.hxx
SMESH_SMESH.hxx
MG_ADAPT.hxx
+ SMESH_Homard.hxx
)
# --- sources ---
@@ -108,6 +109,7 @@ SET(SMESHimpl_SOURCES
SMESH_ProxyMesh.cxx
SMESH_MesherHelper.cxx
MG_ADAPT.cxx
+ SMESH_Homard.cxx
)
# --- rules ---
diff --git a/src/SMESH/SMESH_Homard.cxx b/src/SMESH/SMESH_Homard.cxx
new file mode 100644
index 000000000..3bc4bd651
--- /dev/null
+++ b/src/SMESH/SMESH_Homard.cxx
@@ -0,0 +1,1184 @@
+// SMESH HOMARD : implementation of SMESHHOMARD idl descriptions
+//
+// Copyright (C) 2011-2021 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "SMESH_Homard.hxx"
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+#ifndef WIN32
+#include
+#else
+#include
+#endif
+
+// La gestion des repertoires
+#ifndef CHDIR
+ #ifdef WIN32
+ #define CHDIR _chdir
+ #else
+ #define CHDIR chdir
+ #endif
+#endif
+
+namespace SMESHHOMARDImpl
+{
+
+//=============================================================================
+/*!
+ * default constructor:
+ */
+//=============================================================================
+HOMARD_Boundary::HOMARD_Boundary():
+ _Name( "" ),_Type( 1 ),
+ _Xmin( 0 ), _Xmax( 0 ), _Ymin( 0 ), _Ymax( 0 ), _Zmin( 0 ), _Zmax( 0 ),
+ _Xaxe( 0 ), _Yaxe( 0 ), _Zaxe( 0 ),
+ _Xcentre( 0 ), _Ycentre( 0 ), _Zcentre( 0 ), _rayon( 0 ),
+ _Xincr( 0 ), _Yincr( 0 ), _Zincr( 0 )
+{
+ MESSAGE("HOMARD_Boundary");
+}
+
+//=============================================================================
+HOMARD_Boundary::~HOMARD_Boundary()
+{
+ MESSAGE("~HOMARD_Boundary");
+}
+//=============================================================================
+//=============================================================================
+// Generalites
+//=============================================================================
+//=============================================================================
+void HOMARD_Boundary::SetName( const char* Name )
+{
+ _Name = std::string( Name );
+}
+//=============================================================================
+std::string HOMARD_Boundary::GetName() const
+{
+ return _Name;
+}
+//=============================================================================
+std::string HOMARD_Boundary::GetDumpPython() const
+{
+ std::ostringstream aScript;
+ switch (_Type) {
+ case -1:
+ {
+ aScript << _Name << " = smeshhomard.CreateBoundaryCAO(\"" << _Name << "\", ";
+ aScript << "\"" << _DataFile << "\")\n";
+ break ;
+ }
+ case 0:
+ {
+ aScript << _Name << " = smeshhomard.CreateBoundaryDi(\"" << _Name << "\", ";
+ aScript << "\"" << _MeshName << "\", ";
+ aScript << "\"" << _DataFile << "\")\n";
+ break ;
+ }
+ case 1:
+ {
+ aScript << _Name << " = smeshhomard.CreateBoundaryCylinder(\"" << _Name << "\", ";
+ aScript << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _rayon << ")\n";
+ break ;
+ }
+ case 2:
+ {
+ aScript << _Name << " = smeshhomard.CreateBoundarySphere(\"" << _Name << "\", ";
+ aScript << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _rayon << ")\n";
+ break ;
+ }
+ case 3:
+ {
+ aScript << _Name << " = smeshhomard.CreateBoundaryConeA(\"" << _Name << "\", ";
+ aScript << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _Angle << ", " << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ")\n";
+ break ;
+ }
+ case 4:
+ {
+ aScript << _Name << " = smeshhomard.CreateBoundaryConeR(\"" << _Name << "\", ";
+ aScript << _Xcentre1 << ", " << _Ycentre1 << ", " << _Zcentre1 << ", " << _Rayon1 << ", " << _Xcentre2 << ", " << _Ycentre2 << ", " << _Zcentre2 << ", " << _Rayon2 << ")\n";
+ break ;
+ }
+ case 5:
+ {
+ aScript << _Name << " = smeshhomard.CreateBoundaryTorus(\"" << _Name << "\", ";
+ aScript << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _Rayon1 << ", " << _Rayon2 << ")\n";
+ break ;
+ }
+ }
+
+ return aScript.str();
+}
+//=============================================================================
+//=============================================================================
+// Caracteristiques
+//=============================================================================
+//=============================================================================
+void HOMARD_Boundary::SetType( int Type )
+{
+ _Type = Type;
+}
+//=============================================================================
+int HOMARD_Boundary::GetType() const
+{
+ return _Type;
+}
+//=============================================================================
+void HOMARD_Boundary::SetMeshName( const char* MeshName )
+{
+ _MeshName = std::string( MeshName );
+}
+//=============================================================================
+std::string HOMARD_Boundary::GetMeshName() const
+{
+ return _MeshName;
+}
+//=============================================================================
+void HOMARD_Boundary::SetDataFile( const char* DataFile )
+{
+ _DataFile = std::string( DataFile );
+}
+//=============================================================================
+std::string HOMARD_Boundary::GetDataFile() const
+{
+ return _DataFile;
+}
+//=======================================================================================
+void HOMARD_Boundary::SetCylinder( double X0, double X1, double X2,
+ double X3, double X4, double X5, double X6 )
+{
+ _Xcentre = X0; _Ycentre = X1; _Zcentre = X2;
+ _Xaxe = X3; _Yaxe = X4; _Zaxe = X5;
+ _rayon = X6;
+}
+//======================================================================
+void HOMARD_Boundary::SetSphere( double X0, double X1, double X2, double X3 )
+{
+ _Xcentre = X0; _Ycentre = X1; _Zcentre = X2;
+ _rayon = X3;
+}
+//======================================================================
+void HOMARD_Boundary::SetConeR( double Xcentre1, double Ycentre1, double Zcentre1, double Rayon1,
+ double Xcentre2, double Ycentre2, double Zcentre2, double Rayon2)
+{
+ _Xcentre1 = Xcentre1; _Ycentre1 = Ycentre1; _Zcentre1 = Zcentre1;
+ _Rayon1 = Rayon1;
+ _Xcentre2 = Xcentre2; _Ycentre2 = Ycentre2; _Zcentre2 = Zcentre2;
+ _Rayon2 = Rayon2;
+}
+//======================================================================
+void HOMARD_Boundary::SetConeA( double Xaxe, double Yaxe, double Zaxe, double Angle,
+ double Xcentre, double Ycentre, double Zcentre)
+{
+ _Xaxe = Xaxe; _Yaxe = Yaxe; _Zaxe = Zaxe;
+ _Angle = Angle;
+ _Xcentre = Xcentre; _Ycentre = Ycentre; _Zcentre = Zcentre;
+}
+//=======================================================================================
+void HOMARD_Boundary::SetTorus( double X0, double X1, double X2,
+ double X3, double X4, double X5, double X6, double X7 )
+{
+ _Xcentre = X0; _Ycentre = X1; _Zcentre = X2;
+ _Xaxe = X3; _Yaxe = X4; _Zaxe = X5;
+ _Rayon1 = X6;
+ _Rayon2 = X7;
+}
+//=======================================================================================
+std::vector HOMARD_Boundary::GetCoords() const
+{
+ std::vector mesCoor;
+ switch (_Type)
+ {
+ // Cylindre
+ case 1:
+ {
+ mesCoor.push_back( _Xcentre );
+ mesCoor.push_back( _Ycentre );
+ mesCoor.push_back( _Zcentre );
+ mesCoor.push_back( _Xaxe );
+ mesCoor.push_back( _Yaxe );
+ mesCoor.push_back( _Zaxe );
+ mesCoor.push_back( _rayon );
+ break ;
+ }
+ // Sphere
+ case 2:
+ {
+ mesCoor.push_back( _Xcentre );
+ mesCoor.push_back( _Ycentre );
+ mesCoor.push_back( _Zcentre );
+ mesCoor.push_back( _rayon );
+ break ;
+ }
+ // Cone defini par un axe et un angle
+ case 3:
+ {
+ mesCoor.push_back( _Xaxe );
+ mesCoor.push_back( _Yaxe );
+ mesCoor.push_back( _Zaxe );
+ mesCoor.push_back( _Angle );
+ mesCoor.push_back( _Xcentre );
+ mesCoor.push_back( _Ycentre );
+ mesCoor.push_back( _Zcentre );
+ break ;
+ }
+ // Cone defini par les 2 rayons
+ case 4:
+ {
+ mesCoor.push_back( _Xcentre1 );
+ mesCoor.push_back( _Ycentre1 );
+ mesCoor.push_back( _Zcentre1 );
+ mesCoor.push_back( _Rayon1 );
+ mesCoor.push_back( _Xcentre2 );
+ mesCoor.push_back( _Ycentre2 );
+ mesCoor.push_back( _Zcentre2 );
+ mesCoor.push_back( _Rayon2 );
+ break ;
+ }
+ // Tore
+ case 5:
+ {
+ mesCoor.push_back( _Xcentre );
+ mesCoor.push_back( _Ycentre );
+ mesCoor.push_back( _Zcentre );
+ mesCoor.push_back( _Xaxe );
+ mesCoor.push_back( _Yaxe );
+ mesCoor.push_back( _Zaxe );
+ mesCoor.push_back( _Rayon1 );
+ mesCoor.push_back( _Rayon2 );
+ break ;
+ }
+ default:
+ break ;
+ }
+ return mesCoor;
+}
+//======================================================================
+void HOMARD_Boundary::SetLimit( double X0, double X1, double X2 )
+{
+ _Xincr = X0; _Yincr = X1; _Zincr = X2;
+}
+//=======================================================================================
+std::vector HOMARD_Boundary::GetLimit() const
+{
+ std::vector mesLimit;
+ mesLimit.push_back( _Xincr );
+ mesLimit.push_back( _Yincr );
+ mesLimit.push_back( _Zincr );
+ return mesLimit;
+}
+//=============================================================================
+void HOMARD_Boundary::AddGroup( const char* Group)
+{
+ _ListGroupSelected.push_back(Group);
+}
+//=============================================================================
+void HOMARD_Boundary::SetGroups( const std::list& ListGroup )
+{
+ _ListGroupSelected.clear();
+ std::list::const_iterator it = ListGroup.begin();
+ while(it != ListGroup.end())
+ _ListGroupSelected.push_back((*it++));
+}
+//=============================================================================
+const std::list& HOMARD_Boundary::GetGroups() const
+{
+ return _ListGroupSelected;
+}
+//=============================================================================
+
+//=============================================================================
+/*!
+ * default constructor:
+ * Par defaut, l'adaptation est conforme, sans suivi de frontiere
+ */
+//=============================================================================
+HOMARD_Cas::HOMARD_Cas():
+ _NomDir("/tmp")
+{
+ MESSAGE("HOMARD_Cas");
+}
+//=============================================================================
+HOMARD_Cas::~HOMARD_Cas()
+//=============================================================================
+{
+ MESSAGE("~HOMARD_Cas");
+}
+//=============================================================================
+//=============================================================================
+// Generalites
+//=============================================================================
+//=============================================================================
+std::string HOMARD_Cas::GetDumpPython() const
+{
+ std::ostringstream aScript;
+ // Suivi de frontieres
+ std::list::const_iterator it = _ListBoundaryGroup.begin();
+ while (it != _ListBoundaryGroup.end()) {
+ aScript << "smeshhomard.AddBoundaryGroup(\"" << *it << "\", \"";
+ it++;
+ aScript << *it << "\")\n";
+ it++;
+ }
+
+ return aScript.str();
+}
+//=============================================================================
+//=============================================================================
+// Caracteristiques
+//=============================================================================
+//=============================================================================
+int HOMARD_Cas::SetDirName( const char* NomDir )
+{
+ int erreur = 0 ;
+ // On vérifie qu'aucun calcul n'a eu lieu pour ce cas
+ if ( _ListIter.size() > 1 ) { erreur = 1 ; }
+ // Creation
+ if ( CHDIR(NomDir) == 0 ) {
+ _NomDir = std::string( NomDir );
+ }
+ else {
+#ifndef WIN32
+ if ( mkdir(NomDir, S_IRWXU|S_IRGRP|S_IXGRP) == 0 )
+#else
+ if ( _mkdir(NomDir) == 0 )
+#endif
+ {
+ if ( CHDIR(NomDir) == 0 ) { _NomDir = std::string( NomDir ); }
+ else { erreur = 2 ; }
+ }
+ else { erreur = 2 ; }
+ }
+ return erreur;
+}
+//=============================================================================
+std::string HOMARD_Cas::GetDirName() const
+{
+ return _NomDir;
+}
+//
+// La boite englobante
+//
+//=============================================================================
+void HOMARD_Cas::SetBoundingBox( const std::vector& extremas )
+{
+ _Boite.clear();
+ _Boite.resize( extremas.size() );
+ for ( unsigned int i = 0; i < extremas.size(); i++ )
+ _Boite[i] = extremas[i];
+}
+//=============================================================================
+const std::vector& HOMARD_Cas::GetBoundingBox() const
+{
+ return _Boite;
+}
+//
+// Les groupes
+//
+//=============================================================================
+void HOMARD_Cas::AddGroup( const char* Group )
+{
+ _ListGroup.push_back(Group);
+}
+//=============================================================================
+void HOMARD_Cas::SetGroups( const std::list& ListGroup )
+{
+ _ListGroup.clear();
+ std::list::const_iterator it = ListGroup.begin();
+ while(it != ListGroup.end())
+ {
+ _ListGroup.push_back((*it++));
+ }
+}
+//=============================================================================
+const std::list& HOMARD_Cas::GetGroups() const
+{
+ return _ListGroup;
+}
+//=============================================================================
+void HOMARD_Cas::SupprGroups()
+{
+ _ListGroup.clear();
+}
+//
+// Les frontieres
+//
+//=============================================================================
+void HOMARD_Cas::AddBoundary( const char* Boundary )
+{
+// MESSAGE ( ". HOMARD_Cas::AddBoundary : Boundary = " << Boundary );
+ const char* Group = "";
+ AddBoundaryGroup( Boundary, Group );
+}
+//=============================================================================
+void HOMARD_Cas::AddBoundaryGroup( const char* Boundary, const char* Group )
+{
+// MESSAGE ( ". HOMARD_Cas::AddBoundaryGroup : Boundary = " << Boundary );
+// MESSAGE ( ". HOMARD_Cas::AddBoundaryGroup : Group = " << Group );
+ _ListBoundaryGroup.push_back( Boundary );
+ _ListBoundaryGroup.push_back( Group );
+}
+//=============================================================================
+const std::list& HOMARD_Cas::GetBoundaryGroup() const
+{
+ return _ListBoundaryGroup;
+}
+//=============================================================================
+void HOMARD_Cas::SupprBoundaryGroup()
+{
+ _ListBoundaryGroup.clear();
+}
+//=============================================================================
+//=============================================================================
+// Liens avec les autres structures
+//=============================================================================
+//=============================================================================
+void HOMARD_Cas::AddIteration( const char* NomIteration )
+{
+ _ListIter.push_back( std::string( NomIteration ) );
+}
+
+//=============================================================================
+//=============================================================================
+HomardDriver::HomardDriver(const std::string siter, const std::string siterp1):
+ _HOMARD_Exec( "" ), _NomDir( "" ), _NomFichierConfBase( "HOMARD.Configuration" ),
+ _NomFichierConf( "" ), _NomFichierDonn( "" ), _siter( "" ), _siterp1( "" ),
+ _Texte( "" ), _bLu( false )
+{
+ MESSAGE("siter = "< _HOMARD_Exec ="<<_HOMARD_Exec) ;
+ //
+ _siter = siter ;
+ _siterp1 = siterp1 ;
+}
+//=============================================================================
+//=============================================================================
+HomardDriver::~HomardDriver()
+{
+}
+//===============================================================================
+// A. Generalites
+//===============================================================================
+void HomardDriver::TexteInit( const std::string DirCompute, const std::string LogFile, const std::string Langue )
+{
+ MESSAGE("TexteInit, DirCompute ="< 0 )
+ {
+ _Texte += "# Diametre minimal\n" ;
+ { std::stringstream saux1 ;
+ saux1 << DiamMin ;
+ _Texte += "DiametMi " + saux1.str() + "\n" ;
+ }
+ }
+ if ( AdapInit != 0 )
+ {
+ if ( AdapInit > 0 )
+ { _Texte += "# Raffinement" ; }
+ else
+ { _Texte += "# Deraffinement" ; }
+ _Texte += " des regions sans indicateur\n" ;
+ { std::stringstream saux1 ;
+ saux1 << AdapInit ;
+ _Texte += "AdapInit " + saux1.str() + "\n" ;
+ }
+ }
+ if ( ExtraOutput % 2 == 0 )
+ {
+ _Texte += "# Sortie des niveaux de raffinement\n" ;
+ _Texte += "NCNiveau NIVEAU\n" ;
+ }
+ if ( ExtraOutput % 3 == 0 )
+ {
+ _Texte += "# Sortie des qualités des mailles\n" ;
+ _Texte += "NCQualit QUAL\n" ;
+ }
+ if ( ExtraOutput % 5 == 0 )
+ {
+ _Texte += "# Sortie des diamètres des mailles\n" ;
+ _Texte += "NCDiamet DIAM\n" ;
+ }
+ if ( ExtraOutput % 7 == 0 )
+ {
+ _Texte += "# Sortie des parents des mailles\n" ;
+ _Texte += "NCParent PARENT\n" ;
+ }
+ if ( ExtraOutput % 11 == 0 )
+ {
+ _Texte += "# Volumes voisins par recollement\n" ;
+ _Texte += "NCVoisRc Voisin-Recollement\n" ;
+ }
+}
+//===============================================================================
+// G. Les messages
+//===============================================================================
+void HomardDriver::TexteInfoCompute( int MessInfo )
+{
+ MESSAGE("TexteAdvanced, MessInfo ="<
+#include
+#include
+
+#include
+#include
+
+#if defined WIN32
+#pragma warning ( disable: 4251 )
+#endif
+
+namespace SMESHHOMARDImpl
+{
+
+class SMESH_EXPORT HOMARD_Boundary
+{
+public:
+ HOMARD_Boundary();
+ ~HOMARD_Boundary();
+
+ // Generalites
+ void SetName( const char* Name );
+ std::string GetName() const;
+
+ std::string GetDumpPython() const;
+
+ // Caracteristiques
+ void SetType( int Type );
+ int GetType() const;
+
+ void SetMeshName( const char* MeshName );
+ std::string GetMeshName() const;
+
+ void SetDataFile( const char* DataFile );
+ std::string GetDataFile() const;
+
+ void SetCylinder( double X0, double X1, double X2, double X3,
+ double X4, double X5, double X6 );
+ void SetSphere( double X0, double X1, double X2, double X3 );
+ void SetConeR( double Xcentre1, double Ycentre1, double Zcentre1, double Rayon1,
+ double Xcentre2, double Ycentre2, double Zcentre2, double Rayon2);
+ void SetConeA( double Xaxe, double Yaxe, double Zaxe, double Angle,
+ double Xcentre, double Ycentre, double ZCentre);
+ void SetTorus( double X0, double X1, double X2, double X3,
+ double X4, double X5, double X6, double X7 );
+
+ std::vector GetCoords() const;
+
+ void SetLimit( double X0, double X1, double X2 );
+ std::vector GetLimit() const;
+
+ void AddGroup( const char* LeGroupe);
+ void SetGroups(const std::list& ListGroup );
+ const std::list& GetGroups() const;
+
+private:
+ std::string _Name;
+ std::string _DataFile;
+ std::string _MeshName;
+ int _Type;
+ double _Xmin, _Xmax, _Ymin, _Ymax, _Zmin, _Zmax;
+ double _Xaxe, _Yaxe, _Zaxe;
+ double _Xcentre, _Ycentre, _Zcentre, _rayon;
+ double _Xincr, _Yincr, _Zincr;
+ double _Xcentre1, _Ycentre1, _Zcentre1, _Rayon1;
+ double _Xcentre2, _Ycentre2, _Zcentre2, _Rayon2;
+ double _Angle;
+
+ std::list _ListGroupSelected;
+};
+
+class SMESH_EXPORT HOMARD_Cas
+{
+public:
+ HOMARD_Cas();
+ ~HOMARD_Cas();
+
+ // Generalites
+ std::string GetDumpPython() const;
+
+ // Caracteristiques
+ int SetDirName( const char* NomDir );
+ std::string GetDirName() const;
+
+ void SetBoundingBox( const std::vector& extremas );
+ const std::vector& GetBoundingBox() const;
+
+ void AddGroup( const char* Group);
+ void SetGroups( const std::list& ListGroup );
+ const std::list& GetGroups() const;
+ void SupprGroups();
+
+ void AddBoundary( const char* Boundary );
+ void AddBoundaryGroup( const char* Boundary, const char* Group );
+ const std::list& GetBoundaryGroup() const;
+ void SupprBoundaryGroup();
+
+ void AddIteration( const char* NomIteration );
+
+private:
+ std::string _NomDir;
+ int _Etat;
+
+ std::vector _Boite; // cf HomardQTCommun pour structure du vecteur
+ std::list _ListGroup;
+ std::list _ListBoundaryGroup;
+
+ typedef std::string IterName;
+ typedef std::list IterNames;
+ IterNames _ListIter;
+};
+
+class SMESH_EXPORT HomardDriver
+{
+public:
+ HomardDriver(const std::string siter, const std::string siterp1);
+ ~HomardDriver();
+ //
+ void TexteInit( const std::string DirCompute, const std::string LogFile, const std::string Langue );
+ void TexteInfo( int TypeBila, int NumeIter );
+ void TexteMajCoords( int NumeIter );
+ void CreeFichierDonn();
+ void TexteAdap();
+ void CreeFichier();
+ void TexteMaillage( const std::string NomMesh, const std::string MeshFile, int apres );
+ void TexteMaillageHOMARD( const std::string Dir, const std::string liter, int apres );
+ void TexteConfRaffDera( int ConfType );
+
+ void TexteBoundaryOption( int BoundaryOption );
+ void TexteBoundaryCAOGr( const std::string GroupName );
+ void TexteBoundaryDi( const std::string MeshName, const std::string MeshFile );
+ void TexteBoundaryDiGr( const std::string GroupName );
+ void TexteBoundaryAn( const std::string NameBoundary, int NumeBoundary, int BoundaryType, double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7 );
+ void TexteBoundaryAnGr( const std::string NameBoundary, int NumeBoundary, const std::string GroupName );
+
+ void TexteAdvanced( int NivMax, double DiamMin, int AdapInit, int LevelOutput );
+ void TexteInfoCompute( int MessInfo );
+ //
+ int ExecuteHomard();
+
+public:
+ int _modeHOMARD;
+ std::string _HOMARD_Exec;
+ std::string _NomDir;
+ std::string _NomFichierConfBase;
+ std::string _NomFichierConf;
+ std::string _NomFichierDonn;
+ std::string _siter;
+ std::string _siterp1;
+ std::string _Texte;
+ bool _bLu;
+};
+
+class HOMARD_Iteration;
+
+class SMESH_EXPORT HOMARD_Gen
+{
+public :
+ HOMARD_Gen();
+ ~HOMARD_Gen();
+};
+
+class SMESH_EXPORT HOMARD_Iteration
+{
+public:
+ HOMARD_Iteration();
+ ~HOMARD_Iteration();
+
+ // Generalites
+ void SetName( const char* Name );
+ std::string GetName() const;
+
+ // Caracteristiques
+ void SetDirNameLoc( const char* NomDir );
+ std::string GetDirNameLoc() const;
+
+ void SetNumber( int NumIter );
+ int GetNumber() const;
+
+ void SetState( int etat );
+ int GetState() const;
+
+ void SetMeshName( const char* NomMesh );
+ std::string GetMeshName() const;
+
+ void SetMeshFile( const char* MeshFile );
+ std::string GetMeshFile() const;
+
+ void SetLogFile( const char* LogFile );
+ std::string GetLogFile() const;
+
+ void SetFileInfo( const char* FileInfo );
+ std::string GetFileInfo() const;
+
+ // Divers
+ void SetInfoCompute( int MessInfo );
+ int GetInfoCompute() const;
+
+private:
+ std::string _Name;
+ int _Etat;
+ int _NumIter;
+ std::string _NomMesh;
+ std::string _MeshFile;
+ std::string _LogFile;
+ std::string _NomDir;
+ std::string _FileInfo;
+ int _MessInfo;
+};
+
+}; // namespace SMESHHOMARDImpl
+
+#endif
diff --git a/src/SMESHGUI/CMakeLists.txt b/src/SMESHGUI/CMakeLists.txt
index 587ee89bd..30179b73a 100644
--- a/src/SMESHGUI/CMakeLists.txt
+++ b/src/SMESHGUI/CMakeLists.txt
@@ -150,6 +150,9 @@ SET(_moc_HEADERS
SMESHGUI_PreVisualObj.h
SMESHGUI_MG_ADAPTDRIVER.h
SMESHGUI_MgAdaptDlg.h
+ SMESHGUI_HomardAdaptDlg.h
+ SMESHGUI_HomardBoundaryDlg.h
+ SMESHGUI_HomardListGroup.h
)
# header files / no moc processing
@@ -172,6 +175,7 @@ SET(_other_HEADERS
SMESHGUI_FileValidator.h
SMESHGUI_SelectionProxy.h
SMESH_SMESHGUI.hxx
+ SMESHGUI_HomardUtils.h
)
# header files / to install
@@ -267,6 +271,10 @@ SET(_other_SOURCES
SMESHGUI_IdPreview.cxx
SMESHGUI_MG_ADAPTDRIVER.cxx
SMESHGUI_MgAdaptDlg.cxx
+ SMESHGUI_HomardUtils.cxx
+ SMESHGUI_HomardAdaptDlg.cxx
+ SMESHGUI_HomardBoundaryDlg.cxx
+ SMESHGUI_HomardListGroup.cxx
)
# sources / to compile
@@ -280,6 +288,9 @@ SET(_ts_RESOURCES
SMESH_msg_en.ts
SMESH_msg_fr.ts
SMESH_msg_ja.ts
+ SMESHGUI_Homard_msg_en.ts
+ SMESHGUI_Homard_msg_fr.ts
+ SMESHGUI_Homard_msg_ja.ts
)
# --- rules ---
diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx
index d7b4ed744..3bcce1287 100644
--- a/src/SMESHGUI/SMESHGUI.cxx
+++ b/src/SMESHGUI/SMESHGUI.cxx
@@ -61,6 +61,7 @@
#include "SMESHGUI_Hypotheses.h"
#include "SMESHGUI_HypothesesUtils.h"
#include "SMESHGUI_MG_ADAPTDRIVER.h"
+#include "SMESHGUI_HomardAdaptDlg.h"
#include "SMESHGUI_Make2DFrom3DOp.h"
#include "SMESHGUI_MakeNodeAtPointDlg.h"
#include "SMESHGUI_Measurements.h"
@@ -145,6 +146,7 @@
#include CORBA_CLIENT_HEADER(SMESH_MeshEditor)
#include CORBA_CLIENT_HEADER(SMESH_Measurements)
#include CORBA_CLIENT_HEADER(SMESH_Mesh)
+#include CORBA_CLIENT_HEADER(SMESH_Homard)
// Qt includes
// #define INCLUDE_MENUITEM_DEF // VSR commented ????????
@@ -3028,6 +3030,27 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
break;
}
#endif
+ case SMESHOp::OpHomardAdapt:
+ {
+ if ( isStudyLocked() )
+ break;
+ EmitSignalDeactivateDialog();
+
+ SALOME::GenericObj_wrap< SMESHHOMARD::HOMARD_Gen > homardGen;
+ try {
+ homardGen = GetSMESHGen()->CreateHOMARD_ADAPT();
+ }
+ catch ( const SALOME::SALOME_Exception& S_ex ) {
+ SUIT_MessageBox::critical(SMESHGUI::desktop(),
+ QObject::tr("SMESH_ERROR"),
+ QObject::tr(S_ex.details.text.in()));
+ }
+ if (!homardGen->_is_nil()) {
+ SMESHGUI_HomardAdaptDlg *aDlg = new SMESHGUI_HomardAdaptDlg(homardGen);
+ aDlg->show();
+ }
+ break;
+ }
// Adaptation - end
case SMESHOp::OpSplitBiQuadratic:
case SMESHOp::OpConvertMeshToQuadratic:
@@ -4266,6 +4289,7 @@ void SMESHGUI::initialize( CAM_Application* app )
#ifndef DISABLE_MG_ADAPT
createSMESHAction( SMESHOp::OpMGAdapt, "MG_ADAPT", "ICON_MG_ADAPT" );
#endif
+ createSMESHAction( SMESHOp::OpHomardAdapt, "HOMARD_ADAPT", "ICON_HOMARD_ADAPT" );
// Adaptation - end
createSMESHAction( SMESHOp::OpMinimumDistance, "MEASURE_MIN_DIST", "ICON_MEASURE_MIN_DIST" );
@@ -4486,6 +4510,7 @@ void SMESHGUI::initialize( CAM_Application* app )
#ifndef DISABLE_MG_ADAPT
createMenu( SMESHOp::OpMGAdapt, adaptId, -1 );
#endif
+ createMenu( SMESHOp::OpHomardAdapt, adaptId, -1 );
// Adaptation - end
createMenu( SMESHOp::OpMinimumDistance, measureId, -1 );
@@ -4636,6 +4661,7 @@ void SMESHGUI::initialize( CAM_Application* app )
int adaptTb = createTool( tr( "TB_ADAPTATION" ), QString( "SMESHAdaptationToolbar" ) ) ;
createTool( SMESHOp::OpMGAdapt, adaptTb );
#endif
+ createTool( SMESHOp::OpHomardAdapt, adaptTb );
// Adaptation - end
int measuremTb = createTool( tr( "TB_MEASUREM" ), QString( "SMESHMeasurementsToolbar" ) ) ;
@@ -4719,11 +4745,12 @@ void SMESHGUI::initialize( CAM_Application* app )
createPopupItem( SMESHOp::OpCreateBoundaryElements, OB, mesh_group, "&& selcount=1 && dim>=2");
// Adaptation - begin
+ popupMgr()->insert( separator(), -1, 0 );
#ifndef DISABLE_MG_ADAPT
- popupMgr()->insert( separator(), -1, 0 );
createPopupItem( SMESHOp::OpMGAdapt, OB, mesh );
- popupMgr()->insert( separator(), -1, 0 );
#endif
+ createPopupItem( SMESHOp::OpHomardAdapt, OB, mesh );
+ popupMgr()->insert( separator(), -1, 0 );
// Adaptation - end
QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( dc );
diff --git a/src/SMESHGUI/SMESHGUI_HomardAdaptDlg.cxx b/src/SMESHGUI/SMESHGUI_HomardAdaptDlg.cxx
new file mode 100644
index 000000000..4e25a0ac1
--- /dev/null
+++ b/src/SMESHGUI/SMESHGUI_HomardAdaptDlg.cxx
@@ -0,0 +1,1213 @@
+// Copyright (C) 2011-2021 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "SMESHGUI_HomardAdaptDlg.h"
+
+#include "SMESHGUI.h"
+#include "SMESHGUI_HomardBoundaryDlg.h"
+#include "SMESHGUI_HomardUtils.h"
+#include "SMESHGUI_Utils.h"
+#include "SMESHGUI_VTKUtils.h"
+#include "SMESHGUI_MeshUtils.h"
+#include "SMESH_TryCatch.hxx"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+
+#ifdef WIN32
+#include
+#endif
+
+using namespace std;
+
+// La gestion des repertoires
+#ifndef CHDIR
+ #ifdef WIN32
+ #define CHDIR _chdir
+ #else
+ #define CHDIR chdir
+ #endif
+#endif
+
+const int SPACING = 6; // layout spacing
+const int MARGIN = 9; // layout margin
+
+//================================================================================
+/*!
+ * \brief Constructor
+ */
+//================================================================================
+SMESHGUI_HomardAdaptDlg::SMESHGUI_HomardAdaptDlg(SMESHHOMARD::HOMARD_Gen_ptr myHomardGen0)
+ : QDialog(SMESHGUI::desktop())
+{
+ MESSAGE("Debut du constructeur de SMESHGUI_HomardAdaptDlg");
+ myHomardGen = SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
+ //myHomardGen = SMESHGUI::GetSMESHGen()->CreateHOMARD_ADAPT();
+ myHomardGen->Register();
+
+ setModal(false);
+ setAttribute( Qt::WA_DeleteOnClose, true );
+ setWindowTitle( tr( "ADAPT_WITH_HOMARD" ) );
+ setSizeGripEnabled( true );
+
+ QTabWidget* myTabWidget = new QTabWidget( this );
+
+ // Arguments
+ myArgs = new SMESHGUI_HomardAdaptArguments(myTabWidget);
+
+ // Advanced options
+ myAdvOpt = new SMESHGUI_HomardAdaptAdvanced(myTabWidget);
+
+ myTabWidget->addTab( myArgs, tr( "Args" ) );
+ myTabWidget->addTab( myAdvOpt, tr( "ADVOP" ) );
+
+ myAdvOpt->logGroupBox ->setTitle(tr( "LOG_GROUP_TITLE" ));
+ myAdvOpt->workingDirectoryLabel ->setText (tr( "WORKING_DIR" ));
+ myAdvOpt->workingDirectoryPushButton->setText (tr( "SELECT_DIR" ));
+ myAdvOpt->verboseLevelLabel ->setText (tr( "VERBOSE_LEVEL" ));
+ myAdvOpt->logInFileCheck ->setText (tr( "LOG_IN_FILE" ));
+ myAdvOpt->removeLogOnSuccessCheck ->setText (tr( "REMOVE_LOG_ON_SUCCESS" ));
+ myAdvOpt->keepWorkingFilesCheck ->setText (tr( "KEEP_WORKING_FILES" ));
+
+ //myAdvOpt->logInFileCheck->setChecked(true);
+ //myAdvOpt->removeLogOnSuccessCheck->setChecked(false);
+
+ // Working directory
+ QString aWorkingDir = QDir::tempPath();
+ char *aTmp_dir = getenv("SALOME_TMP_DIR");
+ if (aTmp_dir != NULL) {
+ QDir aTmpDir (aTmp_dir);
+ if (aTmpDir.exists()) {
+ aWorkingDir = aTmpDir.absolutePath();
+ }
+ }
+ myAdvOpt->workingDirectoryLineEdit->setText(aWorkingDir);
+
+ // Out med file and/or mesh publication
+ myArgs->myOutMedFileChk->setChecked(true);
+ myArgs->myOutPublishChk->setChecked(true);
+
+ // buttons
+ QHBoxLayout* btnLayout = new QHBoxLayout;
+ btnLayout->setSpacing( 6 );
+ btnLayout->setMargin( 0 );
+
+ buttonOk = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), this);
+ buttonOk->setAutoDefault(false);
+ btnLayout->addWidget(buttonOk);
+ btnLayout->addStretch( 10 );
+
+ buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), this);
+ buttonApply->setAutoDefault(false);
+ btnLayout->addWidget(buttonApply);
+ btnLayout->addStretch( 10 );
+
+ buttonCancel = new QPushButton(tr( "SMESH_BUT_CANCEL" ), this);
+ buttonCancel->setAutoDefault(false);
+ btnLayout->addWidget(buttonCancel);
+ btnLayout->addStretch( 10 );
+
+ buttonHelp = new QPushButton(tr( "SMESH_BUT_HELP" ), this);
+ buttonHelp->setAutoDefault(false);
+ btnLayout->addWidget(buttonHelp);
+
+ // dialog layout
+ QVBoxLayout* l = new QVBoxLayout ( this );
+ l->setMargin( 9 );
+ l->setSpacing( 6 );
+ l->addWidget( myTabWidget );
+ l->addStretch();
+ l->addLayout( btnLayout );
+
+ // dialog name and size
+ resize(600, 1000);
+ QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
+ sizePolicy.setHorizontalStretch(0);
+ sizePolicy.setVerticalStretch(0);
+ sizePolicy.setHeightForWidth(this->sizePolicy().hasHeightForWidth());
+ setSizePolicy(sizePolicy);
+ setMinimumSize(QSize(500, 320));
+ setSizeIncrement(QSize(1, 1));
+ setBaseSize(QSize(600, 600));
+ setAutoFillBackground(true);
+
+ SetBoundaryNo();
+ InitConnect();
+
+ myArgs->GBBoundaryC->setVisible(0);
+ myArgs->GBBoundaryN->setVisible(0);
+ myArgs->GBBoundaryA->setVisible(0);
+ myArgs->GBBoundaryD->setVisible(0);
+
+ adjustSize();
+
+ //MESSAGE("Fin du constructeur de SMESHGUI_HomardAdaptDlg");
+}
+
+//=================================================================================
+// function : ~SMESHGUI_HomardAdaptDlg()
+// purpose : Destroys the object and frees any allocated resources
+//=================================================================================
+SMESHGUI_HomardAdaptDlg::~SMESHGUI_HomardAdaptDlg()
+{
+ // no need to delete child widgets, Qt does it all for us
+ myHomardGen->DeleteCase();
+}
+
+//=================================================================================
+// function : InitConnect
+// purpose :
+//=================================================================================
+void SMESHGUI_HomardAdaptDlg::InitConnect()
+{
+ connect( myArgs->mySelectInMedFileButton, SIGNAL(pressed()), this, SLOT(SetFileName()));
+
+ connect( myArgs->RBBoundaryNo, SIGNAL(clicked()), this, SLOT(SetBoundaryNo()));
+ connect( myArgs->RBBoundaryCAO, SIGNAL(clicked()), this, SLOT(SetBoundaryCAO()));
+ connect( myArgs->RBBoundaryNonCAO, SIGNAL(clicked()), this, SLOT(SetBoundaryNonCAO()));
+
+ connect( myArgs->PBBoundaryCAONew, SIGNAL(pressed()), this, SLOT(PushBoundaryCAONew()));
+ connect( myArgs->PBBoundaryCAOEdit, SIGNAL(pressed()), this, SLOT(PushBoundaryCAOEdit()) );
+ connect( myArgs->PBBoundaryCAOHelp, SIGNAL(pressed()), this, SLOT(PushBoundaryCAOHelp()) );
+ connect( myArgs->CBBoundaryD, SIGNAL(stateChanged(int)), this, SLOT(SetBoundaryD()));
+ connect( myArgs->PBBoundaryDiNew, SIGNAL(pressed()), this, SLOT(PushBoundaryDiNew()));
+ connect( myArgs->PBBoundaryDiEdit, SIGNAL(pressed()), this, SLOT(PushBoundaryDiEdit()) );
+ connect( myArgs->PBBoundaryDiHelp, SIGNAL(pressed()), this, SLOT(PushBoundaryDiHelp()) );
+ connect( myArgs->CBBoundaryA, SIGNAL(stateChanged(int)), this, SLOT(SetBoundaryA()));
+ connect( myArgs->PBBoundaryAnNew, SIGNAL(pressed()), this, SLOT(PushBoundaryAnNew()));
+ connect( myArgs->PBBoundaryAnEdit, SIGNAL(pressed()), this, SLOT(PushBoundaryAnEdit()) );
+ connect( myArgs->PBBoundaryAnHelp, SIGNAL(pressed()), this, SLOT(PushBoundaryAnHelp()) );
+
+ connect( buttonOk, SIGNAL(pressed()), this, SLOT(PushOnOK()));
+ connect( buttonApply, SIGNAL(pressed()), this, SLOT(PushOnApply()));
+ connect( buttonCancel, SIGNAL(pressed()), this, SLOT(close()));
+ connect( buttonHelp, SIGNAL(pressed()), this, SLOT(PushOnHelp()));
+
+ connect(myArgs, SIGNAL(updateSelection()), this, SLOT(updateSelection()));
+}
+
+//=================================================================================
+// function : InitBoundarys
+// purpose : Initialisation des menus avec les frontieres deja enregistrees
+//=================================================================================
+void SMESHGUI_HomardAdaptDlg::InitBoundarys()
+{
+ MESSAGE("InitBoundarys");
+ //myArgs->TWBoundary->clearContents();
+ //myArgs->TWBoundary->clear();
+ // Pour les frontieres analytiques : la colonne des groupes
+ SMESHHOMARD::ListGroupType_var _listeGroupesCas = myCase->GetGroups();
+ QTableWidgetItem *__colItem = new QTableWidgetItem();
+ __colItem->setText(tr(""));
+ myArgs->TWBoundary->setHorizontalHeaderItem(0, __colItem);
+ for ( int i = 0; i < (int)_listeGroupesCas->length(); i++ ) {
+ myArgs->TWBoundary->insertRow(i);
+ myArgs->TWBoundary->setItem( i, 0, new QTableWidgetItem(QString((_listeGroupesCas)[i]).trimmed()));
+ myArgs->TWBoundary->item( i, 0 )->setFlags(Qt::ItemIsEnabled |Qt::ItemIsSelectable );
+ }
+ // Pour les frontieres CAO : la liste a saisir
+ // Pour les frontieres discretes : la liste a saisir
+ // Pour les frontieres analytiques : les colonnes de chaque frontiere
+ SMESHHOMARD::HOMARD_Boundary_var myBoundary ;
+ SMESHHOMARD::listeBoundarys_var mesBoundarys = myHomardGen->GetAllBoundarysName();
+ //MESSAGE("Nombre de frontieres enregistrees : "<length());
+ for (int i=0; i < (int)mesBoundarys->length(); i++) {
+ myBoundary = myHomardGen->GetBoundary(mesBoundarys[i]);
+ int type_obj = myBoundary->GetType() ;
+ if ( type_obj==-1 ) { myArgs->CBBoundaryCAO->addItem(QString(mesBoundarys[i])); }
+ else if ( type_obj==0 ) { myArgs->CBBoundaryDi->addItem(QString(mesBoundarys[i])); }
+ else { AddBoundaryAn(QString(mesBoundarys[i])); }
+ }
+ // Ajustement
+ myArgs->TWBoundary->resizeColumnsToContents();
+ myArgs->TWBoundary->resizeRowsToContents();
+ myArgs->TWBoundary->clearSelection();
+}
+
+//=================================================================================
+// function : CheckCase
+// purpose :
+//=================================================================================
+bool SMESHGUI_HomardAdaptDlg::CheckCase(bool fixCase)
+{
+ MESSAGE("CheckCase");
+
+ QString aWorkingDir = myAdvOpt->workingDirectoryLineEdit->text().trimmed();
+ if (aWorkingDir == QString("")) {
+ QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+ QObject::tr("HOM_CASE_DIRECTORY_1") );
+ return false;
+ }
+
+ if (CHDIR(aWorkingDir.toStdString().c_str()) != 0) {
+ QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+ QObject::tr("HOM_CASE_DIRECTORY_3") );
+ return false;
+ }
+
+ QString aMeshName, aFileName;
+ if (myArgs->myInMedFileRadio->isChecked()) {
+ aFileName = myArgs->mySelectInMedFileLineEdit->text().trimmed();
+ if (aFileName == QString("")) {
+ QMessageBox::critical(0, QObject::tr("HOM_ERROR"), QObject::tr("HOM_CASE_MESH"));
+ return false;
+ }
+
+ // In mesh name
+ aMeshName = SMESH_HOMARD_QT_COMMUN::LireNomMaillage(aFileName);
+ if (aMeshName == "") {
+ QMessageBox::critical(0, QObject::tr("HOM_ERROR"), QObject::tr("HOM_MED_FILE_2"));
+ return false;
+ }
+ }
+ else {
+ aMeshName = myArgs->myInBrowserObject->text();
+ if (aMeshName == "" || myMesh->_is_nil()) {
+ QMessageBox::critical(0, QObject::tr("HOM_ERROR"),
+ QObject::tr("Mesh object is not selected"));
+ return false;
+ }
+ }
+
+ // On verifie qu'un groupe n'est pas associe a deux frontieres differentes
+ if (myArgs->CBBoundaryA->isChecked()) {
+ QStringList ListeGroup;
+ QString NomGroup;
+ int nbcol = myArgs->TWBoundary->columnCount();
+ int nbrow = myArgs->TWBoundary->rowCount();
+ for ( int col=1; col< nbcol; col++) {
+ for ( int row=0; row< nbrow; row++) {
+ if ( myArgs->TWBoundary->item( row, col )->checkState() == Qt::Checked ) {
+ // Group name
+ NomGroup = QString(myArgs->TWBoundary->item(row, 0)->text()) ;
+ for ( int nugr = 0 ; nugr < ListeGroup.size(); nugr++) {
+ if ( NomGroup == ListeGroup[nugr] ) {
+ QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+ QObject::tr("HOM_CASE_GROUP").arg(NomGroup) );
+ return false;
+ }
+ }
+ ListeGroup.insert(0, NomGroup );
+ }
+ }
+ }
+ }
+
+ if (!fixCase) return true;
+
+ // Creation du cas
+ if (myCase->_is_nil()) {
+ try {
+ if (myArgs->myInMedFileRadio->isChecked()) {
+ // create case from MED file
+ myCase = myHomardGen->CreateCase
+ (CORBA::string_dup(aMeshName.toStdString().c_str()),
+ CORBA::string_dup(aFileName.toStdString().c_str()),
+ aWorkingDir.toStdString().c_str());
+ }
+ else {
+ // create case from SMESH_Mesh
+ myCase = myHomardGen->CreateCaseOnMesh
+ (CORBA::string_dup(aMeshName.toStdString().c_str()),
+ myMesh,
+ aWorkingDir.toStdString().c_str());
+ }
+ }
+ catch( SALOME::SALOME_Exception& S_ex ) {
+ QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+ QObject::tr(CORBA::string_dup(S_ex.details.text)) );
+ return false;
+ }
+ // Prevent changing case data
+ myArgs->myInMedFileRadio->setEnabled(false);
+ myArgs->myInBrowserRadio->setEnabled(false);
+ myArgs->mySelectInMedFileLineEdit->setReadOnly(true);
+ myArgs->mySelectInMedFileButton->setEnabled(false);
+ myArgs->myInBrowserObject->setReadOnly(true);
+ myAdvOpt->workingDirectoryLineEdit->setReadOnly(true);
+ myAdvOpt->workingDirectoryPushButton->setEnabled(false);
+ InitBoundarys();
+ }
+
+ // Menage des eventuelles frontieres deja enregistrees
+ myCase->SupprBoundaryGroup();
+
+ return true;
+}
+
+//=================================================================================
+// function : PushOnApply
+// purpose :
+//=================================================================================
+bool SMESHGUI_HomardAdaptDlg::PushOnApply()
+{
+ MESSAGE("PushOnApply");
+
+ // Check data, create Case if not yet
+ if (!CheckCase(true))
+ return false;
+
+ // Create boundaries
+ if (myArgs->RBBoundaryCAO->isChecked()) {
+ QString monBoundaryCAOName = myArgs->CBBoundaryCAO->currentText();
+ if (monBoundaryCAOName != "" ) {
+ myCase->AddBoundary(monBoundaryCAOName.toStdString().c_str());
+ }
+ }
+ if (myArgs->CBBoundaryD->isChecked()) {
+ QString monBoundaryDiName = myArgs->CBBoundaryDi->currentText();
+ if (monBoundaryDiName != "" ) {
+ myCase->AddBoundary(monBoundaryDiName.toStdString().c_str());
+ }
+ }
+ if (myArgs->CBBoundaryA->isChecked()) {
+ QString NomGroup;
+ int nbcol = myArgs->TWBoundary->columnCount();
+ int nbrow = myArgs->TWBoundary->rowCount();
+ for ( int col = 1; col < nbcol; col++) {
+ for ( int row = 0; row < nbrow; row++) {
+ if ( myArgs->TWBoundary->item( row, col )->checkState() == Qt::Checked ) {
+ // Nom du groupe
+ NomGroup = QString(myArgs->TWBoundary->item(row, 0)->text()) ;
+ // Nom de la frontiere
+ QTableWidgetItem *__colItem = myArgs->TWBoundary->horizontalHeaderItem(col);
+ myCase->AddBoundaryGroup(QString(__colItem->text()).toStdString().c_str(),
+ NomGroup.toStdString().c_str());
+ }
+ }
+ }
+ }
+
+ // Output MED and MESH parameters
+ myHomardGen->SetKeepMedOUT(myArgs->myOutMedFileChk->isChecked());
+ myHomardGen->SetPublishMeshOUT(myArgs->myOutPublishChk->isChecked());
+ QString anOutMeshName = myArgs->myOutMeshNameLineEdit->text();
+ if (anOutMeshName.isEmpty()) anOutMeshName = "DEFAULT_MESH_NAME";
+ myHomardGen->SetMeshNameOUT(anOutMeshName.toStdString().c_str());
+
+ std::string aMeshFileOUT;
+ if (myArgs->myOutMedFileChk->isChecked()) {
+ QString anOutMed = myArgs->mySelectOutMedFileLineEdit->text();
+ if (anOutMed.isEmpty()) {
+ // store in working directory and with default name
+ QString aWorkingDir = myAdvOpt->workingDirectoryLineEdit->text().trimmed();
+ QFileInfo aFileInfo (QDir(aWorkingDir), "Uniform_R.med");
+ anOutMed = aFileInfo.absoluteFilePath();
+ // show it
+ myArgs->mySelectOutMedFileLineEdit->setText(anOutMed);
+ }
+ else {
+ QFileInfo aFileInfo (anOutMed);
+ anOutMed = aFileInfo.absoluteFilePath();
+ }
+ aMeshFileOUT = anOutMed.toStdString();
+ }
+ else {
+ // Set file name without path for it to be created in current directory
+ // (it will be iteration's dir, and it will be destroyed after)
+ aMeshFileOUT = "Uniform_R.med";
+ }
+ myHomardGen->SetMeshFileOUT(aMeshFileOUT.c_str());
+
+ // Conformity type
+ myHomardGen->SetConfType(myArgs->RBConforme->isChecked() ? 0 : 1);
+
+ // Advanced options
+ myHomardGen->SetVerboseLevel(myAdvOpt->verboseLevelSpin->value());
+ myHomardGen->SetKeepWorkingFiles(myAdvOpt->keepWorkingFilesCheck->isChecked());
+ myHomardGen->SetLogInFile(myAdvOpt->logInFileCheck->isChecked());
+ myHomardGen->SetRemoveLogOnSuccess(myAdvOpt->removeLogOnSuccessCheck->isChecked());
+
+ // Log file
+ if (myAdvOpt->logInFileCheck->isChecked()) {
+ // Write log file in the working dir
+ QString aLogBaseName;
+ if (myArgs->myInMedFileRadio->isChecked()) {
+ // Name of log file will be "_Uniform_R.log"
+ QString aMedFileIn = myArgs->mySelectInMedFileLineEdit->text().trimmed();
+ QFileInfo aFileInfoIn (aMedFileIn);
+ aLogBaseName = aFileInfoIn.fileName();
+ }
+ else {
+ // Name of log file will be "SMESH_Mesh__Uniform_R.log"
+ aLogBaseName = "SMESH_Mesh_";
+ aLogBaseName += myArgs->myInBrowserObject->text();
+ }
+ QString aWorkingDir = myAdvOpt->workingDirectoryLineEdit->text().trimmed();
+ QFileInfo aFileInfo (QDir(aWorkingDir), aLogBaseName + "_Uniform_R.log");
+ QString anOutLog = aFileInfo.absoluteFilePath();
+ MESSAGE("myHomardGen->SetLogFile(" << anOutLog.toStdString().c_str() << ")");
+ myHomardGen->SetLogFile(anOutLog.toStdString().c_str());
+ }
+
+ // Compute and publish
+ bool isSuccess = true;
+ try {
+ SUIT_OverrideCursor aWaitCursor;
+ isSuccess = myHomardGen->Compute() == 0;
+ }
+ catch( SALOME::SALOME_Exception& S_ex ) {
+ QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+ QObject::tr(CORBA::string_dup(S_ex.details.text)) );
+ isSuccess = false;
+ }
+
+ // Update Object Browser
+ if (isSuccess) {
+ SMESHGUI::GetSMESHGUI()->updateObjBrowser();
+
+ // Clean case, as it is deleted after successful Compute
+ myCase = SMESHHOMARD::HOMARD_Cas::_nil();
+ }
+
+ // Enable new case data selection
+ myArgs->myInMedFileRadio->setEnabled(true);
+ myArgs->myInBrowserRadio->setEnabled(true);
+ myArgs->mySelectInMedFileLineEdit->setReadOnly(false);
+ myArgs->mySelectInMedFileButton->setEnabled(true);
+ myArgs->myInBrowserObject->setReadOnly(false);
+ myAdvOpt->workingDirectoryLineEdit->setReadOnly(false);
+ myAdvOpt->workingDirectoryPushButton->setEnabled(true);
+
+ return isSuccess;
+}
+
+//=================================================================================
+// function : PushOnOK
+// purpose :
+//=================================================================================
+void SMESHGUI_HomardAdaptDlg::PushOnOK()
+{
+ bool bOK = PushOnApply();
+ if ( bOK ) this->close();
+}
+
+void SMESHGUI_HomardAdaptDlg::PushOnHelp()
+{
+ SMESH::ShowHelpFile("adaptation.html#_homard_adapt_anchor");
+}
+
+void SMESHGUI_HomardAdaptDlg::updateSelection()
+{
+ LightApp_SelectionMgr *selMgr = SMESHGUI::selectionMgr();
+ disconnect(selMgr, 0, this, 0);
+ selMgr->clearFilters();
+
+ if (!myArgs->myInBrowserRadio->isChecked())
+ return;
+
+ SMESH::SetPointRepresentation(false);
+ if (SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow())
+ aViewWindow->SetSelectionMode(ActorSelection);
+ if (myArgs->myInBrowserRadio->isChecked()) {
+ connect(selMgr, SIGNAL(currentSelectionChanged()), this, SLOT(selectionChanged()));
+ selectionChanged();
+ }
+}
+
+void SMESHGUI_HomardAdaptDlg::selectionChanged()
+{
+ if (!myArgs->myInBrowserRadio->isChecked())
+ return;
+
+ //SUIT_OverrideCursor aWaitCursor;
+ LightApp_SelectionMgr *selMgr = SMESHGUI::selectionMgr();
+
+ // get selected mesh
+ SALOME_ListIO aList;
+ selMgr->selectedObjects(aList);
+ QString aMeshName = "";
+
+ if (aList.Extent() == 1) {
+ Handle(SALOME_InteractiveObject) IO = aList.First();
+ myMesh = SMESH::GetMeshByIO(IO);
+ SMESH::GetNameOfSelectedIObjects(selMgr, aMeshName);
+ if (aMeshName.isEmpty()) aMeshName = " ";
+ else aMeshName = aMeshName.trimmed();
+ }
+ else {
+ myMesh = SMESH::SMESH_Mesh::_nil();
+ }
+
+ myArgs->myInBrowserObject->setText(aMeshName);
+
+ // Out mesh name default value
+ myArgs->myOutMeshNameLineEdit->setText(aMeshName + "_Uniform_R");
+
+ // Output med file default value
+ // Construct it from Input mesh name and working directory
+ //if (myArgs->myOutMedFileChk->isChecked()) {
+ if (aMeshName.isEmpty()) {
+ myArgs->mySelectOutMedFileLineEdit->setText("");
+ }
+ else {
+ QString aWorkingDir = myAdvOpt->workingDirectoryLineEdit->text().trimmed();
+ QFileInfo aFileInfo (QDir(aWorkingDir), aMeshName + QString("_Uniform_R.med"));
+ for (int ii = 1; aFileInfo.exists(); ii++) {
+ QString anUniqueName = QString("%1_Uniform_R_%2.med").arg(aMeshName).arg(ii);
+ aFileInfo.setFile(QDir(aWorkingDir), anUniqueName);
+ }
+ myArgs->mySelectOutMedFileLineEdit->setText(aFileInfo.absoluteFilePath());
+ }
+ //}
+
+ // Check data
+ if (!aMeshName.isEmpty())
+ CheckCase(false);
+}
+
+void SMESHGUI_HomardAdaptDlg::SetFileName()
+{
+ // Input med file
+ QString fileName0 = myArgs->mySelectInMedFileLineEdit->text().trimmed();
+ QString fileName = SMESH_HOMARD_QT_COMMUN::PushNomFichier(false, QString("med"));
+ //SUIT_OverrideCursor aWaitCursor;
+ if (fileName.isEmpty()) {
+ fileName = fileName0;
+ if (fileName.isEmpty()) return;
+ }
+ QFileInfo aFileInInfo (fileName);
+ fileName = aFileInInfo.absoluteFilePath();
+ myArgs->mySelectInMedFileLineEdit->setText(fileName);
+
+ // Out mesh name default value
+ QString aMeshName = SMESH_HOMARD_QT_COMMUN::LireNomMaillage(fileName);
+ myArgs->myOutMeshNameLineEdit->setText(aMeshName + "_Uniform_R");
+
+ // Output med file default value
+ // Construct it from Input med file name and path
+ //if (myArgs->myOutMedFileChk->isChecked()) {
+ std::string fname = fileName.toStdString();
+ size_t lastdot = fname.find_last_of(".");
+ if (lastdot != std::string::npos)
+ fname = fname.substr(0, lastdot);
+ QString fileNameOut = fname.c_str();
+ QFileInfo aFileInfo (fileNameOut + QString("_Uniform_R.med"));
+ for (int ii = 1; aFileInfo.exists(); ii++) {
+ QString anUniqueName = QString("%1_Uniform_R_%2.med").arg(fileNameOut).arg(ii);
+ aFileInfo.setFile(anUniqueName);
+ }
+ myArgs->mySelectOutMedFileLineEdit->setText(aFileInfo.absoluteFilePath());
+ //}
+
+ // Check data
+ CheckCase(false);
+}
+
+// ------------------------------------------------------------------------
+void SMESHGUI_HomardAdaptDlg::SetBoundaryNo()
+{
+ myArgs->GBBoundaryC->setVisible(0);
+ myArgs->GBBoundaryN->setVisible(0);
+ adjustSize();
+}
+
+// ------------------------------------------------------------------------
+void SMESHGUI_HomardAdaptDlg::SetBoundaryCAO()
+{
+ if (CheckCase(true)) {
+ myArgs->GBBoundaryC->setVisible(1);
+ myArgs->GBBoundaryN->setVisible(0);
+ resize(600, 550);
+ //adjustSize();
+ }
+ else {
+ myArgs->RBBoundaryNo->click();
+ }
+}
+// ------------------------------------------------------------------------
+void SMESHGUI_HomardAdaptDlg::SetBoundaryNonCAO()
+{
+ myArgs->GBBoundaryC->setVisible(0);
+ myArgs->GBBoundaryN->setVisible(1);
+ int aH = 550;
+ if (myArgs->GBBoundaryD->isVisible()) aH += 50;
+ if (myArgs->GBBoundaryA->isVisible()) aH += 150;
+ resize(600, aH);
+ //adjustSize();
+}
+// ------------------------------------------------------------------------
+void SMESHGUI_HomardAdaptDlg::AddBoundaryCAO(QString newBoundary)
+// ------------------------------------------------------------------------
+{
+ myArgs->CBBoundaryCAO->insertItem(0,newBoundary);
+ myArgs->CBBoundaryCAO->setCurrentIndex(0);
+}
+// ------------------------------------------------------------------------
+void SMESHGUI_HomardAdaptDlg::PushBoundaryCAONew()
+// ------------------------------------------------------------------------
+{
+ SMESH_CreateBoundaryCAO *BoundaryDlg = new SMESH_CreateBoundaryCAO
+ (this, true, SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen), "Case_1", "");
+ BoundaryDlg->show();
+}
+// ------------------------------------------------------------------------
+void SMESHGUI_HomardAdaptDlg::PushBoundaryCAOEdit()
+// ------------------------------------------------------------------------
+{
+ if (myArgs->CBBoundaryCAO->currentText() == QString("")) return;
+ SMESH_EditBoundaryCAO *BoundaryDlg = new SMESH_EditBoundaryCAO
+ (this, true, SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen),
+ "Case_1", myArgs->CBBoundaryCAO->currentText());
+ BoundaryDlg->show();
+}
+
+// ------------------------------------------------------------------------
+void SMESHGUI_HomardAdaptDlg::PushBoundaryCAOHelp()
+{
+ SMESH::ShowHelpFile(QString("homard_create_boundary.html#cao-boundary"));
+}
+
+// ------------------------------------------------------------------------
+void SMESHGUI_HomardAdaptDlg::SetBoundaryD()
+{
+ MESSAGE("Debut de SetBoundaryD ");
+ if (myArgs->CBBoundaryD->isChecked()) {
+ bool bOK = CheckCase(true);
+ if (bOK) {
+ myArgs->GBBoundaryD->setVisible(1);
+ }
+ else {
+ myArgs->GBBoundaryD->setVisible(0);
+ myArgs->CBBoundaryD->setChecked(0);
+ myArgs->CBBoundaryD->setCheckState(Qt::Unchecked);
+ }
+ }
+ else {
+ myArgs->GBBoundaryD->setVisible(0);
+ }
+
+ //myArgs->mySelectInMedFileLineEdit->setReadOnly(true);
+ //myArgs->mySelectInMedFileButton->hide();
+
+ int aH = 550;
+ if (myArgs->GBBoundaryD->isVisible()) aH += 50;
+ if (myArgs->GBBoundaryA->isVisible()) aH += 150;
+ resize(600, aH);
+ //adjustSize();
+}
+// ------------------------------------------------------------------------
+void SMESHGUI_HomardAdaptDlg::AddBoundaryDi(QString newBoundary)
+// ------------------------------------------------------------------------
+{
+ myArgs->CBBoundaryDi->insertItem(0,newBoundary);
+ myArgs->CBBoundaryDi->setCurrentIndex(0);
+}
+// ------------------------------------------------------------------------
+void SMESHGUI_HomardAdaptDlg::PushBoundaryDiNew()
+// ------------------------------------------------------------------------
+{
+ SMESH_CreateBoundaryDi *BoundaryDlg = new SMESH_CreateBoundaryDi(this, true,
+ SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen), "Case_1", "");
+ BoundaryDlg->show();
+}
+// ------------------------------------------------------------------------
+void SMESHGUI_HomardAdaptDlg::PushBoundaryDiEdit()
+// ------------------------------------------------------------------------
+{
+ if (myArgs->CBBoundaryDi->currentText() == QString("")) return;
+ SMESH_EditBoundaryDi *BoundaryDlg = new SMESH_EditBoundaryDi
+ (this, true, SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen),
+ "Case_1", myArgs->CBBoundaryDi->currentText());
+ BoundaryDlg->show();
+}
+
+// ------------------------------------------------------------------------
+void SMESHGUI_HomardAdaptDlg::PushBoundaryDiHelp()
+{
+ SMESH::ShowHelpFile(QString("homard_create_boundary.html#discrete-boundary"));
+}
+
+// ------------------------------------------------------------------------
+void SMESHGUI_HomardAdaptDlg::SetBoundaryA()
+{
+ MESSAGE("Debut de SetBoundaryA ");
+ if (myArgs->CBBoundaryA->isChecked()) {
+ bool bOK = CheckCase(true);
+ if (bOK) {
+ myArgs->GBBoundaryA->setVisible(1);
+ }
+ else {
+ myArgs->GBBoundaryA->setVisible(0);
+ myArgs->CBBoundaryA->setChecked(0);
+ myArgs->CBBoundaryA->setCheckState(Qt::Unchecked);
+ }
+ }
+ else {
+ myArgs->GBBoundaryA->setVisible(0);
+ }
+
+ //myArgs->mySelectInMedFileLineEdit->setReadOnly(true);
+ //myArgs->mySelectInMedFileButton->hide();
+
+ int aH = 550;
+ if (myArgs->GBBoundaryD->isVisible()) aH += 50;
+ if (myArgs->GBBoundaryA->isVisible()) aH += 150;
+ resize(600, aH);
+ //adjustSize();
+}
+// ------------------------------------------------------------------------
+void SMESHGUI_HomardAdaptDlg::AddBoundaryAn(QString newBoundary)
+// ------------------------------------------------------------------------
+{
+ MESSAGE("Debut de AddBoundaryAn ");
+// Ajout d'une nouvelle colonne
+ int nbcol = myArgs->TWBoundary->columnCount();
+// MESSAGE("nbcol " << nbcol);
+ nbcol += 1 ;
+ myArgs->TWBoundary->setColumnCount ( nbcol ) ;
+ QTableWidgetItem *__colItem = new QTableWidgetItem();
+ __colItem->setText(tr(newBoundary.toStdString().c_str()));
+ myArgs->TWBoundary->setHorizontalHeaderItem(nbcol-1, __colItem);
+/* TWBoundary->horizontalHeaderItem(nbcol-1)->setFlags( Qt::ItemIsSelectable|Qt::ItemIsEnabled );*/
+// Chaque case est a cocher
+ int nbrow = myArgs->TWBoundary->rowCount();
+// MESSAGE("nbrow " << nbrow);
+ for ( int i = 0; i < nbrow; i++ )
+ {
+ myArgs->TWBoundary->setItem( i, nbcol-1, new QTableWidgetItem( QString ("") ) );
+ myArgs->TWBoundary->item( i, nbcol-1 )->setFlags( 0 );
+ myArgs->TWBoundary->item( i, nbcol-1 )->setFlags( Qt::ItemIsUserCheckable|Qt::ItemIsEnabled );
+ myArgs->TWBoundary->item( i, nbcol-1 )->setCheckState( Qt::Unchecked );
+ }
+ myArgs->TWBoundary->resizeColumnToContents(nbcol-1);
+// TWBoundary->resizeRowsToContents();
+// MESSAGE("Fin de AddBoundaryAn ");
+}
+// ------------------------------------------------------------------------
+void SMESHGUI_HomardAdaptDlg::PushBoundaryAnNew()
+// ------------------------------------------------------------------------
+{
+ SMESH_CreateBoundaryAn *BoundaryDlg = new SMESH_CreateBoundaryAn
+ (this, true, SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen), "Case_1");
+ BoundaryDlg->show();
+}
+// ------------------------------------------------------------------------
+void SMESHGUI_HomardAdaptDlg::PushBoundaryAnEdit()
+// ------------------------------------------------------------------------
+{
+ QString nom="";
+ int nbcol = myArgs->TWBoundary->columnCount();
+ for ( int i = 1; i < nbcol; i++ ) {
+ QTableWidgetItem *__colItem = new QTableWidgetItem();
+ __colItem = myArgs->TWBoundary->horizontalHeaderItem(i);
+ nom = QString(__colItem->text()) ;
+ MESSAGE("nom "<show();
+ }
+ }
+}
+// ------------------------------------------------------------------------
+void SMESHGUI_HomardAdaptDlg::PushBoundaryAnHelp()
+// ------------------------------------------------------------------------
+{
+ SMESH::ShowHelpFile(QString("homard_create_boundary.html#analytical-boundary"));
+}
+
+//=================================================================================
+// function : SMESHGUI_HomardAdaptArguments()
+// purpose :
+//=================================================================================
+SMESHGUI_HomardAdaptArguments::SMESHGUI_HomardAdaptArguments(QWidget* parent)
+ : QWidget(parent)
+{
+ setupUi();
+}
+
+SMESHGUI_HomardAdaptArguments::~SMESHGUI_HomardAdaptArguments()
+{
+}
+
+void SMESHGUI_HomardAdaptArguments::setupUi()
+{
+ // Mesh in
+ QGroupBox* aMeshIn = new QGroupBox( tr( "MeshIn" ), this );
+ myInMedFileRadio = new QRadioButton( tr( "MEDFile" ), aMeshIn );
+ myInBrowserRadio = new QRadioButton( tr( "Browser" ), aMeshIn );
+ myInBrowserObject = new QLineEdit( aMeshIn );
+ mySelectInMedFileButton = new QPushButton("...", aMeshIn);
+ mySelectInMedFileLineEdit = new QLineEdit( aMeshIn );
+
+ QGridLayout* meshIn = new QGridLayout( aMeshIn );
+
+ meshIn->setMargin( 9 );
+ meshIn->setSpacing( 6 );
+ meshIn->addWidget( myInMedFileRadio, 0, 0, 1, 1 );
+ meshIn->addWidget( myInBrowserRadio, 0, 1, 1, 1 );
+ meshIn->addWidget( mySelectInMedFileButton, 1, 0, 1, 1 );
+ meshIn->addWidget( mySelectInMedFileLineEdit, 1, 1, 1, 2 );
+ meshIn->addWidget( myInBrowserObject, 0, 2, 1, 1 );
+
+ myInMeshGroup = new QButtonGroup( this );
+ myInMeshGroup->addButton( myInMedFileRadio, 0 );
+ myInMeshGroup->addButton( myInBrowserRadio, 1 );
+
+ // Mesh out
+ QGroupBox* aMeshOut = new QGroupBox( tr( "MeshOut" ), this );
+ QLabel* meshName = new QLabel(tr("MeshName"), aMeshOut);
+ QSpacerItem* secondHspacer = new QSpacerItem(100, 30);
+ myOutMeshNameLineEdit = new QLineEdit(aMeshOut);
+ myOutMedFileChk = new QCheckBox(tr("MEDFile"), aMeshOut);
+ mySelectOutMedFileButton = new QPushButton("...", aMeshOut);
+ mySelectOutMedFileLineEdit = new QLineEdit(aMeshOut);
+ myOutPublishChk = new QCheckBox(tr("Publish_MG_ADAPT"), aMeshOut);
+
+ QGridLayout* meshOut = new QGridLayout( aMeshOut );
+
+ meshOut->setMargin( 9 );
+ meshOut->setSpacing( 6 );
+ meshOut->addWidget( meshName, 0, 0, 1,1 );
+ meshOut->addItem( secondHspacer, 0, 1, 1, 1 );
+ meshOut->addWidget( myOutMeshNameLineEdit, 0, 2,1,1);
+ meshOut->addWidget( myOutMedFileChk, 1, 0,1,1 );
+ meshOut->addWidget( mySelectOutMedFileButton, 1, 1,1,1 );
+ meshOut->addWidget( mySelectOutMedFileLineEdit, 1, 2,1,1);
+ meshOut->addWidget( myOutPublishChk, 2, 0,1,1 );
+
+ // Conformity type
+ QGroupBox *GBTypeConf = new QGroupBox(tr("Conformity type"), this);
+ RBConforme = new QRadioButton(tr("Conformal"), GBTypeConf);
+ RBNonConforme = new QRadioButton(tr("Non conformal"), GBTypeConf);
+ RBConforme->setChecked(true);
+
+ QHBoxLayout *hboxLayout2 = new QHBoxLayout(GBTypeConf);
+ hboxLayout2->setSpacing(6);
+ hboxLayout2->setContentsMargins(9, 9, 9, 9);
+ hboxLayout2->addWidget(RBConforme);
+ hboxLayout2->addWidget(RBNonConforme);
+
+ // Boundary type
+ GBTypeBoun = new QGroupBox(tr("Boundary type"), this);
+
+ RBBoundaryNo = new QRadioButton(tr("No boundary"), GBTypeBoun);
+ RBBoundaryCAO = new QRadioButton(tr("CAO"), GBTypeBoun);
+ RBBoundaryNonCAO = new QRadioButton(tr("Non CAO"), GBTypeBoun);
+ RBBoundaryNo->setChecked(true);
+
+ // CAO
+ GBBoundaryC = new QGroupBox(tr("CAO"), GBTypeBoun);
+ /*
+ QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Fixed);
+ sizePolicy1.setHorizontalStretch(0);
+ sizePolicy1.setVerticalStretch(0);
+ sizePolicy1.setHeightForWidth(GBBoundaryC->sizePolicy().hasHeightForWidth());
+ GBBoundaryC->setSizePolicy(sizePolicy1);
+ */
+ GBBoundaryC->setMinimumSize(QSize(450, 50));
+
+ CBBoundaryCAO = new QComboBox(GBBoundaryC);
+ CBBoundaryCAO->setSizeAdjustPolicy(QComboBox::AdjustToContents);
+
+ PBBoundaryCAONew = new QPushButton(tr("New"), GBBoundaryC);
+ PBBoundaryCAOEdit = new QPushButton(tr("Edit"), GBBoundaryC);
+ PBBoundaryCAOHelp = new QPushButton(tr("Help"), GBBoundaryC);
+
+ PBBoundaryCAONew->setAutoDefault(false);
+ PBBoundaryCAOEdit->setAutoDefault(false);
+ PBBoundaryCAOHelp->setAutoDefault(false);
+
+ QGridLayout* gridLayout2 = new QGridLayout(GBBoundaryC);
+ gridLayout2->setSpacing(6);
+ gridLayout2->setContentsMargins(9, 9, 9, 9);
+ gridLayout2->addWidget(CBBoundaryCAO, 0, 0, 1, 1);
+ QSpacerItem* spacerItem3 = new QSpacerItem(40, 13, QSizePolicy::Fixed, QSizePolicy::Minimum);
+ gridLayout2->addItem(spacerItem3, 0, 1, 1, 1);
+ gridLayout2->addWidget(PBBoundaryCAONew, 0, 2, 1, 1);
+ gridLayout2->addWidget(PBBoundaryCAOEdit, 0, 3, 1, 1);
+ gridLayout2->addWidget(PBBoundaryCAOHelp, 0, 4, 1, 1);
+ gridLayout2->setRowMinimumHeight(0, 80);
+
+ // Non CAO (discrete / analytical)
+ GBBoundaryN = new QGroupBox(tr("Non CAO"), GBTypeBoun);
+ GBBoundaryN->setMinimumSize(QSize(450, 80));
+
+ CBBoundaryD = new QCheckBox(tr("Discrete boundary"), GBBoundaryN);
+ CBBoundaryA = new QCheckBox(tr("Analytical boundary"), GBBoundaryN);
+
+ // discrete
+ GBBoundaryD = new QGroupBox(tr("Discrete boundary"), GBBoundaryN);
+ //sizePolicy1.setHeightForWidth(GBBoundaryD->sizePolicy().hasHeightForWidth());
+ //GBBoundaryD->setSizePolicy(sizePolicy1);
+ QGridLayout* gridLayoutD = new QGridLayout(GBBoundaryD);
+ gridLayoutD->setSpacing(6);
+ gridLayoutD->setContentsMargins(9, 9, 9, 9);
+ CBBoundaryDi = new QComboBox(GBBoundaryD);
+ CBBoundaryDi->setSizeAdjustPolicy(QComboBox::AdjustToContents);
+
+ gridLayoutD->addWidget(CBBoundaryDi, 0, 0, 1, 1);
+
+ QSpacerItem* spacerItem5 = new QSpacerItem(40, 13, QSizePolicy::Fixed, QSizePolicy::Minimum);
+ gridLayoutD->addItem(spacerItem5, 0, 1, 1, 1);
+
+ PBBoundaryDiNew = new QPushButton(tr("New"), GBBoundaryD);
+ PBBoundaryDiEdit = new QPushButton(tr("Edit"), GBBoundaryD);
+ PBBoundaryDiHelp = new QPushButton(tr("Help"), GBBoundaryD);
+
+ PBBoundaryDiNew->setAutoDefault(false);
+ PBBoundaryDiEdit->setAutoDefault(false);
+ PBBoundaryDiHelp->setAutoDefault(false);
+
+ gridLayoutD->addWidget(PBBoundaryDiNew, 0, 2, 1, 1);
+ gridLayoutD->addWidget(PBBoundaryDiEdit, 0, 3, 1, 1);
+ gridLayoutD->addWidget(PBBoundaryDiHelp, 0, 4, 1, 1);
+
+ // analytical
+ GBBoundaryA = new QGroupBox(tr("Analytical boundary"), GBBoundaryN);
+ GBBoundaryA->setMinimumSize(QSize(548, 200));
+ formLayout = new QFormLayout(GBBoundaryA);
+ TWBoundary = new QTableWidget(GBBoundaryA);
+ if (TWBoundary->columnCount() < 1)
+ TWBoundary->setColumnCount(1);
+ QTableWidgetItem *__qtablewidgetitem = new QTableWidgetItem();
+ TWBoundary->setHorizontalHeaderItem(0, __qtablewidgetitem);
+ TWBoundary->setEditTriggers(QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked);
+ TWBoundary->setShowGrid(true);
+ TWBoundary->setRowCount(0);
+ TWBoundary->setColumnCount(1);
+
+ formLayout->setWidget(0, QFormLayout::LabelRole, TWBoundary);
+
+ QGridLayout* gridLayout1 = new QGridLayout();
+ gridLayout1->setSpacing(6);
+ gridLayout1->setContentsMargins(0, 0, 0, 0);
+
+ PBBoundaryAnNew = new QPushButton(tr("New"), GBBoundaryA);
+ PBBoundaryAnEdit = new QPushButton(tr("Edit"), GBBoundaryA);
+ PBBoundaryAnHelp = new QPushButton(tr("Help"), GBBoundaryA);
+
+ PBBoundaryAnNew->setAutoDefault(false);
+ PBBoundaryAnEdit->setAutoDefault(false);
+ PBBoundaryAnHelp->setAutoDefault(false);
+
+ gridLayout1->addWidget(PBBoundaryAnNew, 0, 0, 1, 1);
+ gridLayout1->addWidget(PBBoundaryAnEdit, 1, 0, 1, 1);
+ gridLayout1->addWidget(PBBoundaryAnHelp, 2, 0, 1, 1);
+
+ formLayout->setLayout(0, QFormLayout::FieldRole, gridLayout1);
+
+ // Boundary No Layout
+ QGridLayout* aBoundaryNoLayout = new QGridLayout(GBBoundaryN);
+ //aBoundaryNoLayout->addLayout(hboxLayout3, 0, 0);
+ aBoundaryNoLayout->addWidget(CBBoundaryD, 0, 0);
+ aBoundaryNoLayout->addWidget(CBBoundaryA, 0, 1);
+ aBoundaryNoLayout->addWidget(GBBoundaryD, 1, 0, 1, 2);
+ aBoundaryNoLayout->addWidget(GBBoundaryA, 2, 0, 1, 2);
+
+ // Boundary type Layout
+ QGridLayout* aBoundTypeLayout = new QGridLayout(GBTypeBoun);
+ aBoundTypeLayout->addWidget(RBBoundaryNo, 0, 0);
+ aBoundTypeLayout->addWidget(RBBoundaryCAO, 0, 1);
+ aBoundTypeLayout->addWidget(RBBoundaryNonCAO, 0, 2);
+
+ aBoundTypeLayout->addWidget(GBBoundaryC, 1, 0, 1, 3);
+ aBoundTypeLayout->addWidget(GBBoundaryN, 2, 0, 1, 3);
+
+ // Arguments layout
+ QGridLayout *argumentsLayout = new QGridLayout(this);
+ argumentsLayout->addWidget(aMeshIn, 0, 0, 1, 3);
+ argumentsLayout->addWidget(aMeshOut, 1, 0, 1, 3);
+ argumentsLayout->addWidget(GBTypeConf, 2, 0, 1, 3);
+ argumentsLayout->addWidget(GBTypeBoun, 3, 0, 1, 3);
+ argumentsLayout->setColumnStretch( 1, 5 );
+ argumentsLayout->setRowStretch( 4, 5 );
+
+ QTableWidgetItem *___qtablewidgetitem = TWBoundary->horizontalHeaderItem(0);
+ ___qtablewidgetitem->setText(tr("a_virer"));
+
+ // Initial state
+ myInMedFileRadio->setChecked( true );
+ modeInChanged( MedFile );
+ RBBoundaryNo->setChecked( true );
+ //SetBoundaryNo();
+
+ myOutMedFileChk->setChecked(true);
+ CBBoundaryCAO->setCurrentIndex(-1);
+ CBBoundaryDi->setCurrentIndex(-1);
+
+ // Connections
+ connect(myInMeshGroup, SIGNAL(buttonClicked(int)), this, SLOT(modeInChanged(int)));
+ connect(myOutMedFileChk, SIGNAL(stateChanged(int)), this, SLOT(onOutMedFileChk(int)));
+ connect(myOutPublishChk, SIGNAL(stateChanged(int)), this, SLOT(onOutPublishChk(int)));
+ connect(mySelectOutMedFileButton, SIGNAL(pressed()), this, SLOT(onSelectOutMedFileButton()));
+ emit updateSelection();
+}
+
+void SMESHGUI_HomardAdaptArguments::modeInChanged( int theMode )
+{
+ clear();
+ if (theMode == MedFile) {
+ mySelectInMedFileLineEdit->show();
+ mySelectInMedFileButton->show();
+ myInBrowserObject->hide();
+ }
+ else {
+ mySelectInMedFileLineEdit->hide();
+ mySelectInMedFileButton->hide();
+ myInBrowserObject->show();
+ emit updateSelection();
+ }
+}
+
+void SMESHGUI_HomardAdaptArguments::onSelectOutMedFileButton()
+{
+ // Current value
+ QString fileName0 = mySelectOutMedFileLineEdit->text().trimmed();
+
+ // Ask user for the new value
+ QString filtre = QString("Med");
+ filtre += QString(" files (*.") + QString("med") + QString(");;");
+ QString fileName = QFileDialog::getSaveFileName(this, tr("SAVE_MED"), QString(""), filtre);
+
+ // Check the new value
+ if (fileName.isEmpty()) fileName = fileName0;
+
+ QFileInfo aFileInfo (fileName);
+ mySelectOutMedFileLineEdit->setText(aFileInfo.absoluteFilePath());
+}
+
+void SMESHGUI_HomardAdaptArguments::clear()
+{
+ mySelectInMedFileLineEdit->clear();
+ myInBrowserObject->clear();
+
+ myOutMeshNameLineEdit->clear();
+ mySelectOutMedFileLineEdit->clear();
+}
+
+void SMESHGUI_HomardAdaptArguments::onOutMedFileChk(int state)
+{
+ if (state == Qt::Checked) {
+ mySelectOutMedFileButton->show();
+ mySelectOutMedFileLineEdit->show();
+ mySelectOutMedFileButton->setEnabled(true);
+ mySelectOutMedFileLineEdit->setEnabled(true);
+ }
+ else {
+ mySelectOutMedFileButton->setEnabled(false);
+ mySelectOutMedFileLineEdit->setEnabled(false);
+ myOutPublishChk->setChecked(true);
+ }
+}
+
+void SMESHGUI_HomardAdaptArguments::onOutPublishChk(int state)
+{
+ if (state == Qt::Unchecked) {
+ myOutMedFileChk->setChecked(true);
+ }
+}
+
+//////////////////////////////////////////
+// SMESHGUI_HomardAdaptAdvanced
+//////////////////////////////////////////
+
+SMESHGUI_HomardAdaptAdvanced::SMESHGUI_HomardAdaptAdvanced(QWidget* parent)
+ : QWidget(parent)
+{
+ setupWidget();
+ connect(workingDirectoryPushButton, SIGNAL(pressed()),
+ this, SLOT(onWorkingDirectoryPushButton()));
+}
+
+SMESHGUI_HomardAdaptAdvanced::~SMESHGUI_HomardAdaptAdvanced()
+{
+}
+
+void SMESHGUI_HomardAdaptAdvanced::setupWidget()
+{
+ //this->resize(337, 369);
+
+ // Logs and debug
+ logGroupBox = new QGroupBox(this);
+ QGridLayout* logGroupBoxLayout = new QGridLayout(this);
+ logGroupBoxLayout->setMargin( 9 );
+ logGroupBoxLayout->setSpacing( 6 );
+ logGroupBoxLayout->addWidget(logGroupBox, 0, 0, 1, 1);
+
+ QGridLayout* logsLayout = new QGridLayout(logGroupBox);
+ logsLayout->setMargin( 9 );
+ logsLayout->setSpacing( 6 );
+
+ // Working directory + Verbose level layout
+ QGridLayout* gridLayout = new QGridLayout();
+
+ // Working directory
+ workingDirectoryLabel = new QLabel(logGroupBox);
+ workingDirectoryLineEdit = new QLineEdit(logGroupBox);
+ workingDirectoryPushButton = new QPushButton(logGroupBox);
+
+ gridLayout->addWidget(workingDirectoryLabel, 0, 0, 1, 1);
+ gridLayout->addWidget(workingDirectoryLineEdit, 0, 1, 1, 1);
+ gridLayout->addWidget(workingDirectoryPushButton, 0, 2, 1, 1);
+
+ // Verbose level
+ verboseLevelLabel = new QLabel(logGroupBox);
+ verboseLevelSpin = new QSpinBox(logGroupBox);
+
+ gridLayout->addWidget(verboseLevelLabel, 1, 0, 1, 1);
+ gridLayout->addWidget(verboseLevelSpin, 1, 1, 1, 1);
+
+ logsLayout->addLayout(gridLayout, 0, 0, 1, 1);
+
+ // logInFileCheck + removeLogOnSuccessCheck
+ QHBoxLayout* horizontalLayout = new QHBoxLayout();
+
+ logInFileCheck = new QCheckBox(logGroupBox);
+ removeLogOnSuccessCheck = new QCheckBox(logGroupBox);
+
+ logInFileCheck->setChecked(true);
+ removeLogOnSuccessCheck->setChecked(true);
+
+ horizontalLayout->addWidget(logInFileCheck);
+ horizontalLayout->addWidget(removeLogOnSuccessCheck);
+
+ logsLayout->addLayout(horizontalLayout, 1, 0, 1, 1);
+
+ // Keep Working Files Check
+ keepWorkingFilesCheck = new QCheckBox(logGroupBox);
+ keepWorkingFilesCheck->setAutoExclusive(false);
+ keepWorkingFilesCheck->setChecked(false);
+
+ logsLayout->addWidget(keepWorkingFilesCheck, 2, 0, 1, 1);
+
+ //logsLayout->setColumnStretch( 1, 5 );
+ logsLayout->setRowStretch( 3, 5 );
+}
+
+void SMESHGUI_HomardAdaptAdvanced::onWorkingDirectoryPushButton()
+{
+ QString aWorkingDir = QFileDialog::getExistingDirectory();
+ if (!(aWorkingDir.isEmpty())) workingDirectoryLineEdit->setText(aWorkingDir);
+}
diff --git a/src/SMESHGUI/SMESHGUI_HomardAdaptDlg.h b/src/SMESHGUI/SMESHGUI_HomardAdaptDlg.h
new file mode 100644
index 000000000..63046ed36
--- /dev/null
+++ b/src/SMESHGUI/SMESHGUI_HomardAdaptDlg.h
@@ -0,0 +1,233 @@
+// Copyright (C) 2011-2021 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef SMESHGUI_HOMARDADAPTDLG_HXX
+#define SMESHGUI_HOMARDADAPTDLG_HXX
+
+#include "SMESH_SMESHGUI.hxx"
+
+#include
+#include CORBA_CLIENT_HEADER(SMESH_Homard)
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
+#include
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+class SMESHGUI_HomardAdaptArguments;
+class SMESHGUI_HomardAdaptAdvanced;
+
+//=================================================================================
+// class : SMESHGUI_HomardAdaptDlg
+// purpose :
+//=================================================================================
+class SMESHGUI_EXPORT SMESHGUI_HomardAdaptDlg : public QDialog
+{
+ Q_OBJECT
+
+ public:
+ SMESHGUI_HomardAdaptDlg(SMESHHOMARD::HOMARD_Gen_ptr theHomardGen);
+ ~SMESHGUI_HomardAdaptDlg();
+
+ void AddBoundaryCAO(QString newBoundary);
+ void AddBoundaryAn(QString newBoundary);
+ void AddBoundaryDi(QString newBoundary);
+
+ protected:
+ QString myWorkingDir;
+
+ SMESHHOMARD::HOMARD_Cas_var myCase;
+ SALOME::GenericObj_wrap< SMESHHOMARD::HOMARD_Gen > myHomardGen;
+
+ virtual void InitConnect();
+ virtual void InitBoundarys();
+
+ public slots:
+ virtual void SetFileName();
+
+ virtual void SetBoundaryNo();
+ virtual void SetBoundaryCAO();
+ virtual void SetBoundaryNonCAO();
+
+ virtual void PushBoundaryCAONew();
+ virtual void PushBoundaryCAOEdit();
+ virtual void PushBoundaryCAOHelp();
+
+ virtual void SetBoundaryD();
+ virtual void PushBoundaryDiNew();
+ virtual void PushBoundaryDiEdit();
+ virtual void PushBoundaryDiHelp();
+
+ virtual void SetBoundaryA();
+ virtual void PushBoundaryAnNew();
+ virtual void PushBoundaryAnEdit();
+ virtual void PushBoundaryAnHelp();
+
+ bool CheckCase(bool fixCase);
+
+ virtual void PushOnOK();
+ virtual bool PushOnApply();
+ virtual void PushOnHelp();
+
+ void selectionChanged();
+ void updateSelection();
+
+ private:
+ SMESHGUI_HomardAdaptArguments* myArgs;
+ SMESHGUI_HomardAdaptAdvanced* myAdvOpt;
+
+ SMESH::SMESH_Mesh_var myMesh;
+
+ QPushButton *buttonHelp;
+ QPushButton *buttonApply;
+ QPushButton *buttonOk;
+ QPushButton *buttonCancel;
+};
+
+//=================================================================================
+// class : SMESHGUI_HomardAdaptArguments
+// purpose :
+//=================================================================================
+class SMESHGUI_HomardAdaptArguments : public QWidget
+{
+ Q_OBJECT
+
+public:
+ enum ModeIn { MedFile, Browser };
+
+ SMESHGUI_HomardAdaptArguments (QWidget* parent);
+ ~SMESHGUI_HomardAdaptArguments();
+
+ void setupUi();
+
+public:
+ // Mesh In
+ QButtonGroup* myInMeshGroup;
+ QRadioButton* myInMedFileRadio;
+ QRadioButton* myInBrowserRadio;
+
+ QPushButton* mySelectInMedFileButton;
+ QLineEdit* mySelectInMedFileLineEdit; // LEFileName
+
+ QLineEdit* myInBrowserObject;
+
+ // Mesh Out
+ QLineEdit* myOutMeshNameLineEdit;
+ QCheckBox* myOutMedFileChk;
+
+ QPushButton* mySelectOutMedFileButton;
+ QLineEdit* mySelectOutMedFileLineEdit;
+
+ QCheckBox* myOutPublishChk;
+
+ // Conformity type
+ QRadioButton *RBConforme;
+ QRadioButton *RBNonConforme;
+
+ // Boundary type
+ QGroupBox *GBTypeBoun;
+ QRadioButton *RBBoundaryNo;
+ QRadioButton *RBBoundaryCAO;
+ QRadioButton *RBBoundaryNonCAO;
+ QHBoxLayout *hboxLayout3;
+ QCheckBox *CBBoundaryD;
+ QCheckBox *CBBoundaryA;
+
+ QGroupBox *GBBoundaryC; // CAO boundary
+ QPushButton *PBBoundaryCAOEdit;
+ QPushButton *PBBoundaryCAOHelp;
+ QComboBox *CBBoundaryCAO;
+ QPushButton *PBBoundaryCAONew;
+ QGroupBox *GBBoundaryN; // Non CAO boundary
+ QGroupBox *GBBoundaryD;
+ QComboBox *CBBoundaryDi;
+ QPushButton *PBBoundaryDiEdit;
+ QPushButton *PBBoundaryDiHelp;
+ QPushButton *PBBoundaryDiNew;
+ QGroupBox *GBBoundaryA;
+ QFormLayout *formLayout;
+ QTableWidget *TWBoundary;
+ QPushButton *PBBoundaryAnEdit;
+ QPushButton *PBBoundaryAnNew;
+ QPushButton *PBBoundaryAnHelp;
+
+signals:
+ void updateSelection();
+
+private slots:
+ void modeInChanged(int);
+ void clear();
+ void onOutMedFileChk(int);
+ void onOutPublishChk(int);
+ void onSelectOutMedFileButton();
+};
+
+//=================================================================================
+// class : SMESHGUI_HomardAdaptAdvanced
+// purpose :
+//=================================================================================
+class SMESHGUI_HomardAdaptAdvanced : public QWidget
+{
+ Q_OBJECT
+
+public:
+ SMESHGUI_HomardAdaptAdvanced(QWidget* = 0);
+ ~SMESHGUI_HomardAdaptAdvanced();
+
+ void setupWidget();
+
+public:
+ QGroupBox *logGroupBox;
+
+ QLabel *workingDirectoryLabel;
+ QLineEdit *workingDirectoryLineEdit;
+ QPushButton *workingDirectoryPushButton;
+
+ QLabel *verboseLevelLabel;
+ QSpinBox *verboseLevelSpin;
+
+ QCheckBox *logInFileCheck;
+ QCheckBox *removeLogOnSuccessCheck;
+
+ QCheckBox *keepWorkingFilesCheck;
+
+private slots:
+ void onWorkingDirectoryPushButton();
+};
+
+#endif // SMESHGUI_HOMARDADAPTDLG_HXX
diff --git a/src/SMESHGUI/SMESHGUI_HomardBoundaryDlg.cxx b/src/SMESHGUI/SMESHGUI_HomardBoundaryDlg.cxx
new file mode 100644
index 000000000..029a86350
--- /dev/null
+++ b/src/SMESHGUI/SMESHGUI_HomardBoundaryDlg.cxx
@@ -0,0 +1,1641 @@
+// Copyright (C) 2011-2021 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "SMESHGUI_HomardBoundaryDlg.h"
+
+#include "SMESHGUI_HomardAdaptDlg.h"
+#include "SMESHGUI_HomardListGroup.h"
+
+#include "SMESHGUI_Utils.h"
+
+#include
+#include
+
+#include "SalomeApp_Tools.h"
+#include "SMESHGUI_HomardUtils.h"
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+#include "math.h"
+#define PI 3.141592653589793
+
+using namespace std;
+
+// ----------------------------------------------------------------------------------
+SMESH_CreateBoundaryAn::SMESH_CreateBoundaryAn(SMESHGUI_HomardAdaptDlg* parent, bool modal,
+ SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
+ QString caseName) :
+/* Constructs a SMESH_CreateBoundaryAn
+ appele pour une vraie creation
+ initialise un cylindre et non une sphere
+*/
+ QDialog(0), SMESH_Ui_CreateBoundaryAn(),
+ _parent(parent),
+ _Name (""),
+ _Type(1),
+ _BoundaryAnXcentre(0), _BoundaryAnYcentre(0), _BoundaryAnZcentre(0), _BoundaryAnRayon(0),
+ _BoundaryAnXaxis(0), _BoundaryAnYaxis(0), _BoundaryAnZaxis(0),
+ _Xcentre(0), _Ycentre(0), _Zcentre(0), _Rayon(0),
+ _Xmin(0), _Xmax(0), _Xincr(0), _Ymin(0), _Ymax(0), _Yincr(0), _Zmin(0), _Zmax(0), _Zincr(0), _DMax(0),
+ _BoundaryAnXcone1(0), _BoundaryAnYcone1(0), _BoundaryAnZcone1(0), _BoundaryAnRayon1(0),
+ _BoundaryAnXcone2(0), _BoundaryAnYcone2(0), _BoundaryAnZcone2(0), _BoundaryAnRayon2(0),
+ _BoundaryAnXaxisCone(0), _BoundaryAnYaxisCone(0), _BoundaryAnZaxisCone(0),
+ _BoundaryAnXorigCone(0), _BoundaryAnYorigCone(0), _BoundaryAnZorigCone(0),
+ _BoundaryAngle(0),
+ _BoundaryAnToreXcentre(0), _BoundaryAnToreYcentre(0), _BoundaryAnToreZcentre(0),
+ _BoundaryAnToreXaxe(0), _BoundaryAnToreYaxe(0), _BoundaryAnToreZaxe(0),
+ _BoundaryAnToreRRev(0), _BoundaryAnToreRPri(0),
+ Chgt (false)
+ {
+ MESSAGE("Constructeur") ;
+ myHomardGen = SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
+ setupUi(this);
+ setModal(modal);
+
+ // Gestion des icones
+ QPixmap pix ;
+ QIcon IS ;
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ pix = resMgr->loadPixmap( "HOMARD", "spherepoint.png" );
+ IS=QIcon(pix);
+ RBSphere->setIcon(IS);
+ pix = resMgr->loadPixmap( "HOMARD", "cylinderpointvector.png" );
+ IS=QIcon(pix);
+ RBCylindre->setIcon(IS);
+ pix = resMgr->loadPixmap( "HOMARD", "cone.png" );
+ IS=QIcon(pix);
+ RBCone->setIcon(IS);
+ pix = resMgr->loadPixmap( "HOMARD", "conepointvector.png" );
+ IS=QIcon(pix);
+ RB_Def_angle->setIcon(IS);
+ pix = resMgr->loadPixmap( "HOMARD", "conedxyz.png" );
+ IS=QIcon(pix);
+ RB_Def_radius->setIcon(IS);
+ pix = resMgr->loadPixmap( "HOMARD", "toruspointvector.png" );
+ IS=QIcon(pix);
+ RBTore->setIcon(IS);
+
+ InitConnect( );
+
+ SetNewName() ;
+ InitValBoundaryAn(); // Cherche les valeurs de la boite englobante le maillage
+ InitMinMax(); // Initialise les bornes des boutons
+ SetCylinder(); // Propose un cylindre en premier choix
+ }
+
+// -------------------------------------------------------------------------------
+SMESH_CreateBoundaryAn::SMESH_CreateBoundaryAn(SMESHGUI_HomardAdaptDlg* parent,
+ SMESHHOMARD::HOMARD_Gen_var myHomardGen0,
+ QString caseName):
+ QDialog(0), SMESH_Ui_CreateBoundaryAn(),
+ _parent(parent),
+ _Name (""),
+ _Type(1),
+ _BoundaryAnXcentre(0), _BoundaryAnYcentre(0), _BoundaryAnZcentre(0), _BoundaryAnRayon(0),
+ _BoundaryAnXaxis(0), _BoundaryAnYaxis(0), _BoundaryAnZaxis(0),
+ // Pour affichage lors de l edition d une BoundaryAn sans nom de Cas
+ _Xcentre(0), _Ycentre(0), _Zcentre(0), _Rayon(0),
+ _Xmin(1), _Xmax(1), _Xincr(1), _Ymin(1), _Ymax(1), _Yincr(1), _Zmin(1), _Zmax(1), _Zincr(1), _DMax(1),
+ Chgt (false)
+ {
+ // MESSAGE("Debut de SMESH_CreateBoundaryAn")
+ myHomardGen = SMESHHOMARD::HOMARD_Gen::_duplicate(myHomardGen0);
+ setupUi(this);
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ QPixmap pix = resMgr->loadPixmap( "HOMARD", "spherepoint.png" );
+ QIcon IS=QIcon(pix);
+ RBSphere->setIcon(IS);
+ QPixmap pix2 = resMgr->loadPixmap( "HOMARD", "cylinderpointvector.png" );
+ QIcon IS2=QIcon(pix2);
+ RBCylindre->setIcon(IS2);
+ QPixmap pix3 = resMgr->loadPixmap( "HOMARD", "cone.png" );
+ QIcon IS3=QIcon(pix3);
+ RBCone->setIcon(IS3);
+ QPixmap pix4 = resMgr->loadPixmap( "HOMARD", "conepointvector.png" );
+ QIcon IS4=QIcon(pix4);
+ RB_Def_angle->setIcon(IS4);
+ QPixmap pix5 = resMgr->loadPixmap( "HOMARD", "conedxyz.png" );
+ QIcon IS5=QIcon(pix5);
+ RB_Def_radius->setIcon(IS5);
+ setModal(true);
+ InitConnect();
+ }
+
+// ------------------------------------------------------------------------
+SMESH_CreateBoundaryAn::~SMESH_CreateBoundaryAn()
+// ------------------------------------------------------------------------
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+// ------------------------------------------------------------------------
+void SMESH_CreateBoundaryAn::InitConnect()
+// ------------------------------------------------------------------------
+{
+ connect( RBCylindre, SIGNAL(clicked()) , this, SLOT(SetCylinder()) ) ;
+ connect( RBSphere, SIGNAL(clicked()) , this, SLOT(SetSphere()) ) ;
+ connect( RBCone, SIGNAL(clicked()) , this, SLOT(SetCone()) ) ;
+ connect( RB_Def_radius, SIGNAL(clicked()) , this, SLOT(SetConeR()) );
+ connect( RB_Def_angle, SIGNAL(clicked()) , this, SLOT(SetConeA()) );
+ connect( RBTore, SIGNAL(clicked()) , this, SLOT(SetTore()) ) ;
+ connect( buttonOk, SIGNAL( pressed() ), this, SLOT( PushOnOK() ) );
+ connect( buttonApply, SIGNAL( pressed() ), this, SLOT( PushOnApply() ) );
+ connect( buttonCancel, SIGNAL( pressed() ), this, SLOT( close() ) );
+ connect( buttonHelp, SIGNAL( pressed() ), this, SLOT( PushOnHelp() ) );
+}
+// ------------------------------------------------------------------------
+void SMESH_CreateBoundaryAn::InitValBoundaryAn()
+// ------------------------------------------------------------------------
+{
+ //
+ // 1. Les coordonnees extremes du maillage
+ //
+ SMESHHOMARD::HOMARD_Cas_var aCas = myHomardGen->GetCase();
+ SMESHHOMARD::extrema_var MesExtremes = aCas->GetBoundingBox();
+ int num = MesExtremes->length() ;
+ ASSERT(num == 10);
+ _Xmin=MesExtremes[0]; _Xmax=MesExtremes[1]; _Xincr=MesExtremes[2];
+ _Ymin=MesExtremes[3]; _Ymax=MesExtremes[4]; _Yincr=MesExtremes[5];
+ _Zmin=MesExtremes[6]; _Zmax=MesExtremes[7]; _Zincr=MesExtremes[8];
+ _DMax=MesExtremes[9];
+ MESSAGE ("_Xmin : " << _Xmin << " _Xmax : " << _Xmax << " _Xincr : " << _Xincr ) ;
+ MESSAGE ("_Ymin : " << _Ymin << " _Ymax : " << _Ymax << " _Yincr : " << _Yincr ) ;
+ MESSAGE ("_Zmin : " << _Zmin << " _Zmax : " << _Zmax << " _Zincr : " << _Zincr) ;
+ MESSAGE ("_DMax : " << _DMax);
+
+// 2. Caracteristiques des frontieres
+// en X
+ _Xcentre=(_Xmin + _Xmax)/2.;
+// en Y
+ _Ycentre=(_Ymin + _Ymax)/2.;
+// en Z
+ _Zcentre=(_Zmin + _Zmax)/2.;
+// Rayon
+ _Rayon= _DMax/4.;
+}
+
+// ------------------------------------------------------------------------
+void SMESH_CreateBoundaryAn::InitMinMax()
+// ------------------------------------------------------------------------
+{
+ // Cylindre
+ // . X du centre
+ SpinBox_Xcent->setValue(_Xcentre);
+ SpinBox_Xcent->setSingleStep(_Xincr);
+ // . Y du centre
+ SpinBox_Ycent->setValue(_Ycentre);
+ SpinBox_Ycent->setSingleStep(_Yincr);
+ // . Z du centre
+ SpinBox_Zcent->setValue(_Zcentre);
+ SpinBox_Zcent->setSingleStep(_Zincr);
+ // . X de l'axe
+ SpinBox_Xaxis->setValue(0.);
+ SpinBox_Xaxis->setSingleStep(0.1);
+ // . Y de l'axe
+ SpinBox_Yaxis->setValue(0.);
+ SpinBox_Yaxis->setSingleStep(0.1);
+ // . Z de l'axe
+ SpinBox_Zaxis->setValue(1.);
+ SpinBox_Zaxis->setSingleStep(0.1);
+ // . Rayon
+ SpinBox_Radius->setValue(_Rayon);
+ SpinBox_Radius->setSingleStep(_Rayon/10.);
+
+ // Sphere
+ // . X du centre
+ SpinBox_Xcentre->setValue(_Xcentre);
+ SpinBox_Xcentre->setSingleStep(_Xincr);
+ // . Y du centre
+ SpinBox_Ycentre->setValue(_Ycentre);
+ SpinBox_Ycentre->setSingleStep(_Yincr);
+ // . Z du centre
+ SpinBox_Zcentre->setValue(_Zcentre);
+ SpinBox_Zcentre->setSingleStep(_Zincr);
+ // . Rayon
+ SpinBox_Rayon->setValue(_Rayon);
+ SpinBox_Rayon->setSingleStep(_Rayon/10.);
+
+ // Cone en rayons
+ // . X des centres
+ _BoundaryAnXcone1 = _Xcentre ;
+ SpinBox_Cone_X1->setSingleStep(_Xincr);
+ _BoundaryAnXcone2 = _Xcentre ;
+ SpinBox_Cone_X2->setSingleStep(_Xincr);
+ // . Y des centres
+ _BoundaryAnYcone1 = _Ycentre ;
+ SpinBox_Cone_Y1->setSingleStep(_Yincr);
+ _BoundaryAnYcone2 = _Ycentre ;
+ SpinBox_Cone_Y2->setSingleStep(_Yincr);
+ // . Z des centres
+ _BoundaryAnZcone1 = _Zmin ;
+ SpinBox_Cone_Z1->setSingleStep(_Zincr);
+ _BoundaryAnZcone2 = _Zmax ;
+ SpinBox_Cone_Z2->setSingleStep(_Zincr);
+ // . Rayons/Angles
+ _BoundaryAnRayon1 = 0. ;
+ _BoundaryAnRayon2 = _Rayon ;
+ SpinBox_Cone_V2->setSingleStep(_Rayon/10.);
+
+ // Cone en angle
+ convertRayonAngle(1) ;
+ SpinBox_Cone_X1->setValue(_BoundaryAnXaxisCone);
+ SpinBox_Cone_Y1->setValue(_BoundaryAnYaxisCone);
+ SpinBox_Cone_Z1->setValue(_BoundaryAnZaxisCone);
+ SpinBox_Cone_V1->setValue(_BoundaryAngle);
+ SpinBox_Cone_X2->setValue(_BoundaryAnXorigCone);
+ SpinBox_Cone_Y2->setValue(_BoundaryAnYorigCone);
+ SpinBox_Cone_Z2->setValue(_BoundaryAnZorigCone);
+
+ // Tore
+ // . X du centre
+ SpinBoxToreXcent->setValue(_Xcentre);
+ SpinBoxToreXcent->setSingleStep(_Xincr);
+ // . Y du centre
+ SpinBoxToreYcent->setValue(_Ycentre);
+ SpinBoxToreYcent->setSingleStep(_Yincr);
+ // . Z du centre
+ SpinBoxToreZcent->setValue(_Zcentre);
+ SpinBoxToreZcent->setSingleStep(_Zincr);
+ // . X de l'axe
+ SpinBoxToreXaxe->setValue(0.);
+ SpinBoxToreXaxe->setSingleStep(0.1);
+ // . Y de l'axe
+ SpinBoxToreYaxe->setValue(0.);
+ SpinBoxToreYaxe->setSingleStep(0.1);
+ // . Z de l'axe
+ SpinBoxToreZaxe->setValue(1.);
+ SpinBoxToreZaxe->setSingleStep(0.1);
+ // . Rayon de revolution
+ SpinBoxToreRRev->setValue(_Rayon);
+ SpinBoxToreRRev->setSingleStep(_Rayon/10.);
+ // . Rayon primaire
+ SpinBoxToreRPri->setValue(_Rayon/3.);
+ SpinBoxToreRPri->setSingleStep(_Rayon/20.);
+}
+// ------------------------------------------------------------------------
+bool SMESH_CreateBoundaryAn::PushOnApply()
+// ------------------------------------------------------------------------
+// Appele lorsque l'un des boutons Ok ou Apply est presse
+//
+{
+ if (LEName->text().trimmed()=="")
+ {
+ QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+ QObject::tr("HOM_BOUN_NAME") );
+ return false;
+ }
+
+ switch (_Type)
+ {
+ case 1 : // il s agit d un cylindre
+ {
+ if ((_BoundaryAnXcentre != SpinBox_Xcent->value()) ||
+ (_BoundaryAnYcentre != SpinBox_Ycent->value()) ||
+ (_BoundaryAnZcentre != SpinBox_Zcent->value()) ||
+ (_BoundaryAnRayon != SpinBox_Radius->value()) ||
+ (_BoundaryAnXaxis != SpinBox_Xaxis->value()) ||
+ (_BoundaryAnYaxis != SpinBox_Yaxis->value()) ||
+ (_BoundaryAnZaxis != SpinBox_Zaxis->value()) )
+ {
+ Chgt = true;
+ _BoundaryAnXaxis= SpinBox_Xaxis->value();
+ _BoundaryAnYaxis= SpinBox_Yaxis->value();
+ _BoundaryAnZaxis= SpinBox_Zaxis->value();
+ _BoundaryAnXcentre=SpinBox_Xcent->value();
+ _BoundaryAnYcentre=SpinBox_Ycent->value();
+ _BoundaryAnZcentre=SpinBox_Zcent->value();
+ _BoundaryAnRayon=SpinBox_Radius->value();
+ }
+ break;
+ }
+
+ case 2 : // il s agit d une sphere
+ {
+ if ((_BoundaryAnXcentre != SpinBox_Xcentre->value()) ||
+ (_BoundaryAnYcentre != SpinBox_Ycentre->value()) ||
+ (_BoundaryAnZcentre != SpinBox_Zcentre->value()) ||
+ (_BoundaryAnRayon != SpinBox_Rayon->value()) )
+ {
+ Chgt = true;
+ _BoundaryAnXcentre=SpinBox_Xcentre->value();
+ _BoundaryAnYcentre=SpinBox_Ycentre->value();
+ _BoundaryAnZcentre=SpinBox_Zcentre->value();
+ _BoundaryAnRayon=SpinBox_Rayon->value();
+ }
+ break;
+ }
+
+ case 3 : // il s agit d un cone defini par un axe et un angle
+ {
+ if ((_BoundaryAnXaxisCone != SpinBox_Cone_X1->value()) ||
+ (_BoundaryAnYaxisCone != SpinBox_Cone_Y1->value()) ||
+ (_BoundaryAnZaxisCone != SpinBox_Cone_Z1->value()) ||
+ (_BoundaryAnXorigCone != SpinBox_Cone_X2->value()) ||
+ (_BoundaryAnYorigCone != SpinBox_Cone_Y2->value()) ||
+ (_BoundaryAnZorigCone != SpinBox_Cone_Z2->value()) ||
+ (_BoundaryAngle != SpinBox_Cone_V1->value()) )
+ {
+ Chgt = true;
+ _BoundaryAnXaxisCone = SpinBox_Cone_X1->value() ;
+ _BoundaryAnYaxisCone = SpinBox_Cone_Y1->value() ;
+ _BoundaryAnZaxisCone = SpinBox_Cone_Z1->value() ;
+ _BoundaryAnXorigCone = SpinBox_Cone_X2->value() ;
+ _BoundaryAnYorigCone = SpinBox_Cone_Y2->value() ;
+ _BoundaryAnZorigCone = SpinBox_Cone_Z2->value() ;
+ _BoundaryAngle = SpinBox_Cone_V1->value() ;
+ }
+ break;
+ }
+
+ case 4 : // il s agit d un cone defini par les 2 rayons
+ {
+ if ((_BoundaryAnXcone1 != SpinBox_Cone_X1->value()) ||
+ (_BoundaryAnYcone1 != SpinBox_Cone_Y1->value()) ||
+ (_BoundaryAnZcone1 != SpinBox_Cone_Z1->value()) ||
+ (_BoundaryAnRayon1 != SpinBox_Cone_V1->value()) ||
+ (_BoundaryAnXcone2 != SpinBox_Cone_X2->value()) ||
+ (_BoundaryAnYcone2 != SpinBox_Cone_Y2->value()) ||
+ (_BoundaryAnZcone2 != SpinBox_Cone_Z2->value()) ||
+ (_BoundaryAnRayon2 != SpinBox_Cone_V2->value()) )
+ {
+ Chgt = true;
+ _BoundaryAnXcone1 = SpinBox_Cone_X1->value() ;
+ _BoundaryAnYcone1 = SpinBox_Cone_Y1->value() ;
+ _BoundaryAnZcone1 = SpinBox_Cone_Z1->value() ;
+ _BoundaryAnRayon1 = SpinBox_Cone_V1->value() ;
+ _BoundaryAnXcone2 = SpinBox_Cone_X2->value() ;
+ _BoundaryAnYcone2 = SpinBox_Cone_Y2->value() ;
+ _BoundaryAnZcone2 = SpinBox_Cone_Z2->value() ;
+ _BoundaryAnRayon2 = SpinBox_Cone_V2->value() ;
+ }
+ break;
+ }
+ case 5 : // il s agit d un tore
+ {
+ if ((_BoundaryAnToreXcentre != SpinBoxToreXcent->value()) ||
+ (_BoundaryAnToreYcentre != SpinBoxToreYcent->value()) ||
+ (_BoundaryAnToreZcentre != SpinBoxToreZcent->value()) ||
+ (_BoundaryAnToreRRev != SpinBoxToreRRev->value()) ||
+ (_BoundaryAnToreRPri != SpinBoxToreRPri->value()) ||
+ (_BoundaryAnToreXaxe != SpinBoxToreXaxe->value()) ||
+ (_BoundaryAnToreYaxe != SpinBoxToreYaxe->value()) ||
+ (_BoundaryAnToreZaxe != SpinBoxToreZaxe->value()) )
+ {
+ Chgt = true;
+ _BoundaryAnToreXcentre= SpinBoxToreXcent->value();
+ _BoundaryAnToreYcentre= SpinBoxToreYcent->value();
+ _BoundaryAnToreZcentre= SpinBoxToreZcent->value();
+ _BoundaryAnToreRRev=SpinBoxToreRRev->value();
+ _BoundaryAnToreRPri=SpinBoxToreRPri->value();
+ _BoundaryAnToreXaxe=SpinBoxToreXaxe->value();
+ _BoundaryAnToreYaxe=SpinBoxToreYaxe->value();
+ _BoundaryAnToreZaxe=SpinBoxToreZaxe->value();
+ }
+ break;
+ }
+
+ }
+
+// Controles
+// L'axe pour un cylindre
+ if ( _Type == 5 )
+ {
+ double daux = _BoundaryAnXaxis*_BoundaryAnXaxis + _BoundaryAnYaxis*_BoundaryAnYaxis + _BoundaryAnZaxis*_BoundaryAnZaxis ;
+ if ( daux < 0.0000001 )
+ {
+ QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+ QObject::tr("HOM_AXE") );
+ return false;
+ }
+ }
+
+ //
+ // Création ou mise à jour de la frontière
+ //
+ bool bOK = CreateOrUpdateBoundaryAn();
+
+ //if ( bOK ) { HOMARD_UTILS::updateObjBrowser() ; }
+
+ return bOK;
+
+}
+// ---------------------------------------------------
+bool SMESH_CreateBoundaryAn::CreateOrUpdateBoundaryAn()
+//----------------------------------------------------
+// Creation de l'objet boundary
+{
+ MESSAGE("Debut de CreateOrUpdateBoundaryAn avec _Type ="<<_Type<<", _Name ="<<_Name.toStdString().c_str()<<" et LEName ="<text().trimmed().toStdString().c_str());
+//
+ if (_Name != LEName->text().trimmed())
+ {
+ _Name = LEName->text().trimmed() ;
+ try
+ {
+ switch (_Type)
+ {
+ case 1 : // il s agit d un cylindre
+ { aBoundaryAn = myHomardGen->CreateBoundaryCylinder(CORBA::string_dup(_Name.toStdString().c_str()), \
+ _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnXaxis, _BoundaryAnYaxis, _BoundaryAnZaxis, _BoundaryAnRayon );
+ break;
+ }
+ case 2 : // il s agit d une sphere
+ { aBoundaryAn = myHomardGen->CreateBoundarySphere(CORBA::string_dup(_Name.toStdString().c_str()), \
+ _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnRayon);
+ break;
+ }
+ case 3 : // il s agit d un cone defini par un axe et un angle
+ { aBoundaryAn = myHomardGen->CreateBoundaryConeA(CORBA::string_dup(_Name.toStdString().c_str()), \
+ _BoundaryAnXaxisCone, _BoundaryAnYaxisCone, _BoundaryAnZaxisCone, _BoundaryAngle, \
+ _BoundaryAnXorigCone, _BoundaryAnYorigCone, _BoundaryAnYorigCone);
+ break;
+ }
+ case 4 : // il s agit d un cone defini par les 2 rayons
+ { aBoundaryAn = myHomardGen->CreateBoundaryConeR(CORBA::string_dup(_Name.toStdString().c_str()), \
+ _BoundaryAnXcone1, _BoundaryAnYcone1, _BoundaryAnZcone1, _BoundaryAnRayon1, \
+ _BoundaryAnXcone2, _BoundaryAnYcone2, _BoundaryAnZcone2, _BoundaryAnRayon2);
+ break;
+ }
+ case 5 : // il s agit d un tore
+ { aBoundaryAn = myHomardGen->CreateBoundaryTorus(CORBA::string_dup(_Name.toStdString().c_str()), \
+ _BoundaryAnToreXcentre, _BoundaryAnToreYcentre, _BoundaryAnToreZcentre, _BoundaryAnToreXaxe, _BoundaryAnToreYaxe, _BoundaryAnToreZaxe, _BoundaryAnToreRRev, _BoundaryAnToreRPri );
+ break;
+ }
+ }
+ }
+ catch( SALOME::SALOME_Exception& S_ex )
+ {
+ QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
+ QObject::tr(CORBA::string_dup(S_ex.details.text)) );
+ return false ;
+ }
+ _parent->AddBoundaryAn(_Name);
+
+ return true;
+ }
+ else {
+ QMessageBox::warning( 0, QObject::tr("HOM_WARNING"),
+ QObject::tr("HOM_SELECT_OBJECT_4") );
+ return false ;
+ }
+ MESSAGE("Fin de CreateOrUpdateBoundaryAn");
+}
+// ------------------------------------------------------------------------
+void SMESH_CreateBoundaryAn::PushOnOK()
+// ------------------------------------------------------------------------
+{
+ if (PushOnApply()) this->close();
+}
+// ------------------------------------------------------------------------
+void SMESH_CreateBoundaryAn::PushOnHelp()
+// ------------------------------------------------------------------------
+{
+ SMESH::ShowHelpFile(QString("homard_create_boundary.html#analytical-boundary"));
+}
+
+// -----------------------------------
+void SMESH_CreateBoundaryAn::SetNewName()
+// -----------------------------------
+{
+// Recherche d'un nom par defaut qui n'existe pas encore
+
+ SMESHHOMARD::listeBoundarys_var MyObjects = myHomardGen->GetAllBoundarysName();
+ int num = 0; QString aName="";
+ while (aName=="" )
+ {
+ aName.setNum(num+1) ;
+ aName.insert(0, QString("Boun_")) ;
+ for ( int i=0; ilength(); i++)
+ {
+ if ( aName == QString(MyObjects[i]))
+ {
+ num ++ ;
+ aName = "" ;
+ break ;
+ }
+ }
+ }
+ LEName->setText(aName);
+}
+// ------------------------------------------------------------------------
+void SMESH_CreateBoundaryAn::SetCylinder()
+// ------------------------------------------------------------------------
+{
+ MESSAGE("Debut de SetCylinder")
+ gBCylindre->setVisible(1);
+ gBSphere->setVisible(0);
+ gBCone->setVisible(0);
+ gBTore->setVisible(0);
+//
+ _Type=1;
+//
+ adjustSize();
+// MESSAGE("Fin de SetCylinder")
+}
+// ------------------------------------------------------------------------
+void SMESH_CreateBoundaryAn::SetSphere()
+// ------------------------------------------------------------------------
+{
+ MESSAGE("Debut de SetSphere")
+ gBCylindre->setVisible(0);
+ gBSphere->setVisible(1);
+ gBCone->setVisible(0);
+ gBTore->setVisible(0);
+//
+ _Type=2;
+//
+ adjustSize();
+// MESSAGE("Fin de SetSphere")
+}
+// ------------------------------------------------------------------------
+void SMESH_CreateBoundaryAn::SetConeR()
+// ------------------------------------------------------------------------
+{
+ MESSAGE("Debut de SetConeR")
+//
+// Stockage et conversion des valeurs si elles ont change
+ if ((_BoundaryAnXaxisCone != SpinBox_Cone_X1->value()) ||
+ (_BoundaryAnYaxisCone != SpinBox_Cone_Y1->value()) ||
+ (_BoundaryAnZaxisCone != SpinBox_Cone_Z1->value()) ||
+ (_BoundaryAnXorigCone != SpinBox_Cone_X2->value()) ||
+ (_BoundaryAnYorigCone != SpinBox_Cone_Y2->value()) ||
+ (_BoundaryAnZorigCone != SpinBox_Cone_Z2->value()) ||
+ (_BoundaryAngle != SpinBox_Cone_V1->value()) )
+ {
+ MESSAGE("Stockage et conversion")
+ _BoundaryAnXaxisCone = SpinBox_Cone_X1->value() ;
+ _BoundaryAnYaxisCone = SpinBox_Cone_Y1->value() ;
+ _BoundaryAnZaxisCone = SpinBox_Cone_Z1->value() ;
+ _BoundaryAnXorigCone = SpinBox_Cone_X2->value() ;
+ _BoundaryAnYorigCone = SpinBox_Cone_Y2->value() ;
+ _BoundaryAnZorigCone = SpinBox_Cone_Z2->value() ;
+ _BoundaryAngle = SpinBox_Cone_V1->value() ;
+ convertRayonAngle(-1) ;
+ }
+//
+ _Type=4;
+//
+ TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X centre 1", 0));
+ SpinBox_Cone_X1->setValue(_BoundaryAnXcone1);
+ TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y centre 1", 0));
+ SpinBox_Cone_Y1->setValue(_BoundaryAnYcone1);
+ TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z centre 1", 0));
+ SpinBox_Cone_Z1->setValue(_BoundaryAnZcone1);
+//
+ TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "Radius 1", 0));
+ SpinBox_Cone_V1->setSingleStep(_Rayon/10.);
+ SpinBox_Cone_V1->setMaximum(100000.*_DMax);
+ SpinBox_Cone_V1->setValue(_BoundaryAnRayon1);
+//
+ TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X centre 2", 0));
+ SpinBox_Cone_X2->setValue(_BoundaryAnXcone2);
+ TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y centre 2", 0));
+ SpinBox_Cone_Y2->setValue(_BoundaryAnYcone2);
+ TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z centre 2", 0));
+ SpinBox_Cone_Z2->setValue(_BoundaryAnZcone2);
+//
+ TLCone_V2->setVisible(1);
+ SpinBox_Cone_V2->setVisible(1);
+ TLCone_V2->setText(QApplication::translate("CreateBoundaryAn", "Radius 2", 0));
+ SpinBox_Cone_V2->setValue(_BoundaryAnRayon2);
+//
+// MESSAGE("Fin de SetConeR")
+}
+// ------------------------------------------------------------------------
+void SMESH_CreateBoundaryAn::SetConeA()
+// ------------------------------------------------------------------------
+{
+ MESSAGE("Debut de SetConeA")
+// Stockage et conversion des valeurs si elles ont change
+ if ((_BoundaryAnXcone1 != SpinBox_Cone_X1->value()) ||
+ (_BoundaryAnYcone1 != SpinBox_Cone_Y1->value()) ||
+ (_BoundaryAnZcone1 != SpinBox_Cone_Z1->value()) ||
+ (_BoundaryAnRayon1 != SpinBox_Cone_V1->value()) ||
+ (_BoundaryAnXcone2 != SpinBox_Cone_X2->value()) ||
+ (_BoundaryAnYcone2 != SpinBox_Cone_Y2->value()) ||
+ (_BoundaryAnZcone2 != SpinBox_Cone_Z2->value()) ||
+ (_BoundaryAnRayon2 != SpinBox_Cone_V2->value()) )
+ {
+ MESSAGE("Stockage et conversion")
+ _BoundaryAnXcone1 = SpinBox_Cone_X1->value() ;
+ _BoundaryAnYcone1 = SpinBox_Cone_Y1->value() ;
+ _BoundaryAnZcone1 = SpinBox_Cone_Z1->value() ;
+ _BoundaryAnRayon1 = SpinBox_Cone_V1->value() ;
+ _BoundaryAnXcone2 = SpinBox_Cone_X2->value() ;
+ _BoundaryAnYcone2 = SpinBox_Cone_Y2->value() ;
+ _BoundaryAnZcone2 = SpinBox_Cone_Z2->value() ;
+ _BoundaryAnRayon2 = SpinBox_Cone_V2->value() ;
+ convertRayonAngle(1) ;
+ }
+//
+ _Type=3;
+//
+ TLCone_X1->setText(QApplication::translate("CreateBoundaryAn", "X axis", 0));
+ SpinBox_Cone_X1->setValue(_BoundaryAnXaxisCone);
+ TLCone_Y1->setText(QApplication::translate("CreateBoundaryAn", "Y axis", 0));
+ SpinBox_Cone_Y1->setValue(_BoundaryAnYaxisCone);
+ TLCone_Z1->setText(QApplication::translate("CreateBoundaryAn", "Z axis", 0));
+ SpinBox_Cone_Z1->setValue(_BoundaryAnZaxisCone);
+//
+ TLCone_X2->setText(QApplication::translate("CreateBoundaryAn", "X centre", 0));
+ SpinBox_Cone_X2->setValue(_BoundaryAnXorigCone);
+ TLCone_Y2->setText(QApplication::translate("CreateBoundaryAn", "Y centre", 0));
+ SpinBox_Cone_Y2->setValue(_BoundaryAnYorigCone);
+ TLCone_Z2->setText(QApplication::translate("CreateBoundaryAn", "Z centre", 0));
+ SpinBox_Cone_Z2->setValue(_BoundaryAnZorigCone);
+//
+ TLCone_V1->setText(QApplication::translate("CreateBoundaryAn", "Angle", 0));
+ SpinBox_Cone_V1->setValue(_BoundaryAngle);
+ SpinBox_Cone_V1->setSingleStep(1.);
+ SpinBox_Cone_V1->setMaximum(90.);
+//
+ TLCone_V2->setVisible(0);
+ SpinBox_Cone_V2->setVisible(0);
+// MESSAGE("Fin de SetConeA")
+}
+
+
+// ------------------------------------------------------------------------
+void SMESH_CreateBoundaryAn::SetCone()
+// ------------------------------------------------------------------------
+{
+ MESSAGE("Debut de SetCone")
+ gBCylindre->setVisible(0);
+ gBSphere->setVisible(0);
+ gBCone->setVisible(1);
+ gBTore->setVisible(0);
+//
+ if ( RB_Def_radius->isChecked() )
+ {
+ SetConeR();
+ }
+ else
+ {
+ SetConeA();
+ }
+//
+ adjustSize();
+// MESSAGE("Fin de SetCone")
+}
+// ------------------------------------------------------------------------
+void SMESH_CreateBoundaryAn::SetTore()
+// ------------------------------------------------------------------------
+{
+ MESSAGE("Debut de SetTore")
+ gBCylindre->setVisible(0);
+ gBSphere->setVisible(0);
+ gBCone->setVisible(0);
+ gBTore->setVisible(1);
+//
+ _Type=5;
+//
+ adjustSize();
+// MESSAGE("Fin de SetTore")
+}
+// ------------------------------------------------------------------------
+void SMESH_CreateBoundaryAn::convertRayonAngle(int option)
+// ------------------------------------------------------------------------
+// Conversion entre les deux formulations du cone :
+// par deux rayons ou avec un axe et un angle.
+// Voir sfcoi1 de HOMARD
+{
+ MESSAGE("Debut de convertRayonAngle, option = "<