]> SALOME platform Git repositories - plugins/hexoticplugin.git/commitdiff
Salome HOME
Merge from V6_main (04/10/2012) V7_0_0 V7_0_0rc1
authorvsr <vsr@opencascade.com>
Mon, 8 Oct 2012 13:15:17 +0000 (13:15 +0000)
committervsr <vsr@opencascade.com>
Mon, 8 Oct 2012 13:15:17 +0000 (13:15 +0000)
37 files changed:
configure.ac
doc/salome/gui/HexoticPLUGIN/Makefile.am
doc/salome/gui/HexoticPLUGIN/doxyfile_py.in
doc/salome/gui/HexoticPLUGIN/images/hexotic_basic_subdivisions_4_8.png [new file with mode: 0644]
doc/salome/gui/HexoticPLUGIN/images/hexotic_parameters.png
doc/salome/gui/HexoticPLUGIN/images/hexotic_sd_mode_1.png [new file with mode: 0644]
doc/salome/gui/HexoticPLUGIN/images/hexotic_sd_mode_2.png [new file with mode: 0644]
doc/salome/gui/HexoticPLUGIN/images/hexotic_sd_mode_3.png [new file with mode: 0644]
doc/salome/gui/HexoticPLUGIN/images/hexotic_sd_mode_4.png [new file with mode: 0644]
doc/salome/gui/HexoticPLUGIN/input/hexotic_hypo.doc
doc/salome/gui/HexoticPLUGIN/input/hexoticplugin_python_intarface.doc [deleted file]
doc/salome/gui/HexoticPLUGIN/input/hexoticplugin_python_interface.doc [new file with mode: 0644]
doc/salome/gui/HexoticPLUGIN/input/index.doc
idl/HexoticPlugin_Algorithm.idl
resources/HexoticPLUGIN.xml
src/GUI/HexoticPLUGIN_images.ts
src/GUI/HexoticPLUGIN_msg_en.ts
src/GUI/HexoticPLUGIN_msg_fr.ts
src/GUI/HexoticPluginGUI_Dlg.h [new file with mode: 0644]
src/GUI/HexoticPluginGUI_HypothesisCreator.cxx
src/GUI/HexoticPluginGUI_HypothesisCreator.h
src/GUI/HexoticPluginGUI_StdWidget.cxx [new file with mode: 0644]
src/GUI/HexoticPluginGUI_StdWidget_QTD.ui [new file with mode: 0644]
src/GUI/Makefile.am
src/GUI/resources/Makefile.am [new file with mode: 0644]
src/GUI/resources/sd_mode_1.png [new file with mode: 0644]
src/GUI/resources/sd_mode_2.png [new file with mode: 0644]
src/GUI/resources/sd_mode_3.png [new file with mode: 0644]
src/GUI/resources/sd_mode_4.png [new file with mode: 0644]
src/GUI/resources/sd_mode_geom.png [new file with mode: 0644]
src/HexoticPlugin/HexoticPLUGINDC.py
src/HexoticPlugin/HexoticPlugin_Hexotic.cxx
src/HexoticPlugin/HexoticPlugin_Hexotic.hxx
src/HexoticPlugin/HexoticPlugin_Hypothesis.cxx
src/HexoticPlugin/HexoticPlugin_Hypothesis.hxx
src/HexoticPlugin/HexoticPlugin_Hypothesis_i.cxx
src/HexoticPlugin/HexoticPlugin_Hypothesis_i.hxx

index 2a0445f1bb9e98c967f30c5756e98a1bb7f2bc6b..2677c607491dd68d0874c4e851412a43b75cda62 100644 (file)
@@ -464,6 +464,7 @@ AC_OUTPUT([ \
   src/Makefile \
   src/HexoticPlugin/Makefile \
   src/GUI/Makefile \
+  src/GUI/resources/Makefile \
   HexoticPLUGIN_version.h \
   doc/Makefile \
   doc/salome/Makefile \
index 7c980d3a9055c1b72c70e8b15f74396c6fa342cb..dd1a9881684b036049a1c9d9b13b1603243b7730 100755 (executable)
@@ -29,16 +29,15 @@ EXTRA_DIST += images input static/footer.html static/doxygen.css
 guidocdir = $(docdir)/gui/HexoticPLUGIN
 guidoc_DATA = images/head.png
 
+DOC_PYTHONPATH=$(prefix)/bin/salome:$(SMESH_ROOT_DIR)/bin/salome:$(SMESH_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(MED_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(GEOM_ROOT_DIR)/bin/salome:$(GEOM_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/bin/salome:$(KERNEL_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(OMNIORB_ROOT)/lib/python$(PYTHON_VERSION)/site-packages:$(OMNIORB_ROOT)/lib64/python$(PYTHON_VERSION)/site-packages
+DOC_SMESH_MeshersList=HexoticPLUGIN
 
-usr_docs: doxyfile
-       echo "===========================================" ;                    \
-       echo "Generating Python interface documentation";                       \
-       echo "===========================================" ;                    \
-       $(DOXYGEN) doxyfile_py                                                  \
-       echo "===========================================" ;                    \
-       echo "Generating GUI documentation" ;                                   \
-       echo "===========================================" ;                    \
-       $(DOXYGEN) doxyfile ;
+smesh.py: $(top_srcdir)/src/HexoticPlugin/HexoticPLUGINDC.py
+       @PYTHONPATH=$(DOC_PYTHONPATH):${PYTHONPATH} SMESH_MeshersList=$(DOC_SMESH_MeshersList) $(PYTHON) $(SMESH_ROOT_DIR)/bin/salome/collect_mesh_methods.py -d -o $@ HexoticPLUGIN
+
+usr_docs: doxyfile_py doxyfile smesh.py
+       @$(DOXYGEN) doxyfile_py ; \
+       $(DOXYGEN) doxyfile
 
 docs: usr_docs
 
index 3735e28a870dc9d01a5ceecc8eee34fb84f2c7f1..40dffc8ca1d013348bf11e96cb0aded88cbdb70f 100755 (executable)
@@ -96,7 +96,9 @@ EXAMPLE_RECURSIVE      = NO
 #---------------------------------------------------------------------------
 #Input related options
 #---------------------------------------------------------------------------
-INPUT             = @top_srcdir@/src/HexoticPlugin/HexoticPLUGINDC.py
+INPUT             = @top_srcdir@/src/HexoticPlugin/HexoticPLUGINDC.py \
+                    smesh.py \
+                   @SMESH_ROOT_DIR@/bin/salome/smesh_algorithm.py
 FILE_PATTERNS     = 
 IMAGE_PATH        = @srcdir@/images
 RECURSIVE         = NO
@@ -129,24 +131,24 @@ GENERATE_RTF      = NO
 #---------------------------------------------------------------------------
 CLASS_DIAGRAMS         = NO
 HIDE_UNDOC_RELATIONS   = NO
-HAVE_DOT               = NO
-CLASS_GRAPH            = NO
+HAVE_DOT               = YES
+CLASS_GRAPH            = YES
 COLLABORATION_GRAPH    = NO
 GROUP_GRAPHS           = NO
 UML_LOOK               = NO
-TEMPLATE_RELATIONS     = NO
-INCLUDE_GRAPH          = NO
-INCLUDED_BY_GRAPH      = NO
+TEMPLATE_RELATIONS     = YES
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
 CALL_GRAPH             = NO
-GRAPHICAL_HIERARCHY    = NO
-DIRECTORY_GRAPH        = NO
-DOT_IMAGE_FORMAT       = jpg
+GRAPHICAL_HIERARCHY    = YES
+DIRECTORY_GRAPH        = YES
+DOT_IMAGE_FORMAT       = png
 DOT_FONTNAME           = Arial
 DOT_PATH               = 
 DOTFILE_DIRS           = 
 MAX_DOT_GRAPH_WIDTH    = 1024
-MAX_DOT_GRAPH_HEIGHT   = 1200
-MAX_DOT_GRAPH_DEPTH    = 0
+MAX_DOT_GRAPH_HEIGHT   = 1024
+MAX_DOT_GRAPH_DEPTH    = 1000
 DOT_TRANSPARENT        = NO
 DOT_MULTI_TARGETS      = NO
 GENERATE_LEGEND        = NO
@@ -156,4 +158,4 @@ DOT_CLEANUP            = YES
 #External reference options
 #---------------------------------------------------------------------------
 GENERATE_TAGFILE  = hexoticpluginpy_doc.tag
-SEARCHENGINE           = YES
\ No newline at end of file
+SEARCHENGINE           = YES
diff --git a/doc/salome/gui/HexoticPLUGIN/images/hexotic_basic_subdivisions_4_8.png b/doc/salome/gui/HexoticPLUGIN/images/hexotic_basic_subdivisions_4_8.png
new file mode 100644 (file)
index 0000000..b4f70bf
Binary files /dev/null and b/doc/salome/gui/HexoticPLUGIN/images/hexotic_basic_subdivisions_4_8.png differ
index 40abfedd33c7d765b6d4a622f5885d86ae721fa6..c4797319884b8d9c62867110c70eeaf5e9575bc0 100644 (file)
Binary files a/doc/salome/gui/HexoticPLUGIN/images/hexotic_parameters.png and b/doc/salome/gui/HexoticPLUGIN/images/hexotic_parameters.png differ
diff --git a/doc/salome/gui/HexoticPLUGIN/images/hexotic_sd_mode_1.png b/doc/salome/gui/HexoticPLUGIN/images/hexotic_sd_mode_1.png
new file mode 100644 (file)
index 0000000..39c5078
Binary files /dev/null and b/doc/salome/gui/HexoticPLUGIN/images/hexotic_sd_mode_1.png differ
diff --git a/doc/salome/gui/HexoticPLUGIN/images/hexotic_sd_mode_2.png b/doc/salome/gui/HexoticPLUGIN/images/hexotic_sd_mode_2.png
new file mode 100644 (file)
index 0000000..78382a0
Binary files /dev/null and b/doc/salome/gui/HexoticPLUGIN/images/hexotic_sd_mode_2.png differ
diff --git a/doc/salome/gui/HexoticPLUGIN/images/hexotic_sd_mode_3.png b/doc/salome/gui/HexoticPLUGIN/images/hexotic_sd_mode_3.png
new file mode 100644 (file)
index 0000000..caa189f
Binary files /dev/null and b/doc/salome/gui/HexoticPLUGIN/images/hexotic_sd_mode_3.png differ
diff --git a/doc/salome/gui/HexoticPLUGIN/images/hexotic_sd_mode_4.png b/doc/salome/gui/HexoticPLUGIN/images/hexotic_sd_mode_4.png
new file mode 100644 (file)
index 0000000..547c07a
Binary files /dev/null and b/doc/salome/gui/HexoticPLUGIN/images/hexotic_sd_mode_4.png differ
index d42d1f827120366d9dd88aae8a5d2a09ea672806..bfed6b2e421d4cbb417b10f499c1caff267b9dca 100644 (file)
@@ -4,7 +4,7 @@
 
 \n Hexotic Parameters hypothesis works only with <b>Hexotic</b> 
 algorithm. This algorithm is a commercial software.
-\n To get a licence, visit http://www.distene.com/corp/eval-distene.html
+\n To get a licence, visit http://www.distene.com/en/corp/eval-distene.html
 
 \image html hexotic_parameters.png
 
@@ -12,12 +12,14 @@ algorithm. This algorithm is a commercial software.
 <li><b>Name</b> - allows to define the name of the hypothesis (Hexotic 
 Parameters by default).</li>
 
+<li><b>Min size</b> - allows defining the minimal size of the elements (overrides "Nb. Hexes Max Level" value).</li>
+
+<li><b>Max size</b> - allows defining the maximal size of the elements (overrides "Nb. Hexes Min Level" value).</li>
+
 <li><b>Nb. Hexes Min Level</b> - allows defining the minimal level of recursive partitioning on the initial octree cube.</li>
 
 <li><b>Nb. Hexes Max Level</b> - allows defining the maximal level of recursive partitioning on the initial octree cube.</li>
 
-<li><b>Salome Quadrangles</b> - not documented.</li>
-
 <li><b>Generate smooth meshes no ridges</b> - specifies that the mesher can ignore ridges. A ridge is a geometrical entity (a sharp edge). The resulting meshes will have better quality elements, at the price of "smoothing" out the geometry.
 </li>
 
@@ -32,8 +34,22 @@ Parameters by default).</li>
 
 <li><b>Working directory</b> - specifies the directory where the input/output files will be created.
 </li>
+
+<li><b>Verbosity</b> - specifies the verbose level to print information on meshing steps.
+</li>
+
+<li><b>Sub-domains mesh mode</b> - This option allows the user to mesh or not mesh internal subdomains (such as holes), or to mesh non-manifold domains.
+<ul>
+<li>sd 1 : meshes in inside/out mode: the internal cavities are ignored, the whole domain is meshed into a single domain;</li>
+<li>sd 2 : meshes only the internal main component. Internal holes (cavities) will not be meshed;</li>
+<li>sd 3 : meshes all cavities and generates subdomains accordingly;</li>
+<li>sd 4 : meshes non-manifold geometries as such and generates subdomains accordingly.</li>
+</ul>
+</li>
 </ul>
 
 \note If BLSURF is used as 2D algo, and if a GMF file is defined as output file (using SetGMFFile(my2Dmesh.mesh)), then Hexotic will use this file as input.
 This allows to avoid the reconstruction of the GMF file from the SMESH structure and can improve the global computation time.
+
+<br><b>See Also</b> a sample TUI Script of the \ref tui_hexotic "creation of an Hexotic mesh"
 */
diff --git a/doc/salome/gui/HexoticPLUGIN/input/hexoticplugin_python_intarface.doc b/doc/salome/gui/HexoticPLUGIN/input/hexoticplugin_python_intarface.doc
deleted file mode 100644 (file)
index cb13cae..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/*!
-
-\page hexoticplugin_python_intarface_page Python Interface
-
-Python package \ref HexoticPLUGINDC "HexoticPLUGIN" defines several classes, destined for creation of the 3D meshes.
-
-Documentation for HexoticPLUGIN package is available in linear form grouped by classes, declared in the HexoticPLUGINDC.py file.
-
-*/
diff --git a/doc/salome/gui/HexoticPLUGIN/input/hexoticplugin_python_interface.doc b/doc/salome/gui/HexoticPLUGIN/input/hexoticplugin_python_interface.doc
new file mode 100644 (file)
index 0000000..709680e
--- /dev/null
@@ -0,0 +1,214 @@
+/*!
+
+\page hexoticplugin_python_interface_page Python Interface
+
+Python package HexoticPLUGINDC defines several classes, destined for creation of the 3D meshes.
+
+Hexotic meshing plugin dynamically adds several methods to the smesh.Mesh class to create meshing algorithms.
+
+Below you can see an example of usage of the HexoticPlugin Python API for mesh generation:
+
+\anchor tui_hexotic
+
+-# \ref tui_hexotic_basic
+-# \ref tui_hexotic_sd_mode
+  -# \ref tui_hexotic_sd_mode1
+  -# \ref tui_hexotic_sd_mode2
+  -# \ref tui_hexotic_sd_mode3
+  -# \ref tui_hexotic_sd_mode4
+
+\section tui_hexotic_basic Construction of Mesh using Hexotic algorithm
+
+\code
+import geompy
+import smesh
+
+# create a sphere
+sphere = geompy.MakeSphereR(100.)
+geompy.addToStudy(sphere, "sphere")
+
+# create a mesh on the sphere
+hexoticMesh = smesh.Mesh(sphere,"sphere: BLSurf and Hexotic mesh")
+
+# create a BLSurf algorithm for faces
+BLSURF = hexoticMesh.Triangle(algo=smesh.BLSURF)
+BLSURF.SetGeometricMesh( 1 )
+
+# create a Hexotic algorithm for volumes
+HEXOTIC = hexoticMesh.Hexahedron(algo=smesh.Hexotic)
+
+# compute the mesh
+hexoticMesh.Compute()
+
+# Change the level of subdivision
+HEXOTIC.SetMinMaxHexes(4, 8)
+
+# End of script
+\endcode
+
+\image html hexotic_basic_subdivisions_4_8.png Left: Hexotic mesh without hypothesis, right: Hexotic mesh with an hypothesis defined by minl=4 and maxl=8
+
+\ref tui_hexotic "Back to top"
+
+\section tui_hexotic_sd_mode Effect of the sub-domain mode
+
+This example illustrates the sub-domain mode of Hexotic.
+
+\subsection tui_hexotic_sd_mode1 Sub-domain mode = 1
+
+\code
+import SALOMEDS
+import geompy
+import smesh
+
+# Create geometry: a box cut by a holed sphere
+Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
+Sphere_1 = geompy.MakeSphereR(75)
+Sphere_2 = geompy.MakeSphereR(25)
+geompy.TranslateDXDYDZ(Box_1, -100, -100, -100)
+Cut_1 = geompy.MakeCut(Sphere_1, Sphere_2)
+Cut_2 = geompy.MakeCut(Box_1, Cut_1)
+geompy.addToStudy( Box_1, 'Box_1' )
+geompy.addToStudy( Sphere_1, 'Sphere_1' )
+geompy.addToStudy( Sphere_2, 'Sphere_2' )
+geompy.addToStudy( Cut_1, 'Cut_1' )
+geompy.addToStudy( Cut_2, 'Cut_2' )
+
+# Create filters
+# aFilter1: elements inside small sphere
+aFilter1 = smesh.GetFilterFromCriteria([smesh.GetCriterion(smesh.VOLUME,smesh.FT_BelongToGeom,smesh.FT_Undefined,Sphere_2)])
+# aFilter2: elements inside big sphere and not inside small sphere
+aFilter2 = smesh.GetFilterFromCriteria([smesh.GetCriterion(smesh.VOLUME,smesh.FT_BelongToGeom,smesh.FT_Undefined,Sphere_1, smesh.FT_LogicalAND),
+                                        smesh.GetCriterion(smesh.VOLUME,smesh.FT_BelongToGeom,smesh.FT_Undefined,Sphere_2, smesh.FT_LogicalNOT)])
+# aFilter3: elements not inside big sphere
+aFilter3 = smesh.GetFilterFromCriteria([smesh.GetCriterion(smesh.VOLUME,smesh.FT_BelongToGeom,smesh.FT_Undefined,Sphere_1, smesh.FT_LogicalNOT)])
+
+# Create mesh of Cut_2 with sd mode 1
+print "Create mesh of Cut_2 with sd mode 1"
+Mesh_hexotic_sd1 = smesh.Mesh(Cut_2, "Mesh_hexotic_sd1")
+
+# Create the 2D algo: BlSurf with geometrical mesh
+Mesh_hexotic_sd1.Triangle(algo=smesh.BLSURF).Parameters().SetGeometricMesh( 1 )
+
+# Create the 3D algo: Hexotic with:
+# - minl = 4
+# - maxl = 8
+# - sd = 1
+Mesh_hexotic_sd1.Hexahedron(algo=smesh.Hexotic).SetMinMaxHexes(4, 8).SetHexoticSdMode( 1 )
+
+# Create the groups on filters
+g1 = Mesh_hexotic_sd1.GroupOnFilter(smesh.VOLUME, 'small sphere', aFilter1 )
+g1.SetColor( SALOMEDS.Color( 1, 0, 0 ))
+g2 = Mesh_hexotic_sd1.GroupOnFilter(smesh.VOLUME, 'big sphere - small sphere', aFilter2 )
+g2.SetColor( SALOMEDS.Color( 0, 1, 0 ))
+g3 = Mesh_hexotic_sd1.GroupOnFilter(smesh.VOLUME, 'box - big sphere', aFilter3 )
+g3.SetColor( SALOMEDS.Color( 0, 0, 1 ))
+
+# Compute
+Mesh_hexotic_sd1.Compute()
+
+# End of script
+\endcode
+
+\image html hexotic_sd_mode_1.png Hexotic mesh of a box cut by a holed sphere ( sd = 1 )
+
+\ref tui_hexotic "Back to top"
+
+\subsection tui_hexotic_sd_mode2 Sub-domain mode = 2
+
+\code
+
+# Create mesh of Cut_2 with sd mode 2
+print "Create mesh of Cut_2 with sd mode 2"
+Mesh_hexotic_sd2 = smesh.Mesh(Cut_2, "Mesh_hexotic_sd2")
+
+# Create the 2D algo: BlSurf with geometrical mesh
+Mesh_hexotic_sd2.Triangle(algo=smesh.BLSURF).Parameters().SetGeometricMesh( 1 )
+
+# Create the 3D algo: Hexotic with:
+# - minl = 4
+# - maxl = 8
+# - sd = 2
+Mesh_hexotic_sd2.Hexahedron(algo=smesh.Hexotic).SetMinMaxHexes(4, 8).SetHexoticSdMode( 2 )
+
+# Create the groups on filters
+g1 = Mesh_hexotic_sd2.GroupOnFilter(smesh.VOLUME, 'small sphere', aFilter1 )
+g1.SetColor( SALOMEDS.Color( 1, 0, 0 ))
+g2 = Mesh_hexotic_sd2.GroupOnFilter(smesh.VOLUME, 'big sphere - small sphere', aFilter2 )
+g2.SetColor( SALOMEDS.Color( 0, 1, 0 ))
+g3 = Mesh_hexotic_sd2.GroupOnFilter(smesh.VOLUME, 'box - big sphere', aFilter3 )
+g3.SetColor( SALOMEDS.Color( 0, 0, 1 ))
+
+# Compute
+Mesh_hexotic_sd2.Compute()
+
+# End of script
+\endcode
+
+\image html hexotic_sd_mode_2.png Hexotic mesh of a box cut by a holed sphere ( sd = 2 )
+
+\ref tui_hexotic "Back to top"
+
+\subsection tui_hexotic_sd_mode3 Sub-domain mode = 3
+
+\code
+
+# Create mesh of Cut_2 with sd mode 3
+print "Create mesh of Cut_2 with sd mode 3"
+Mesh_hexotic_sd3 = smesh.Mesh(Cut_2, "Mesh_hexotic_sd3")
+
+# Create the 2D algo: BlSurf with geometrical mesh
+Mesh_hexotic_sd3.Triangle(algo=smesh.BLSURF).Parameters().SetGeometricMesh( 1 )
+
+# Create the 3D algo: Hexotic with:
+# - minl = 4
+# - maxl = 8
+# - sd = 3
+Mesh_hexotic_sd3.Hexahedron(algo=smesh.Hexotic).SetMinMaxHexes(4, 8).SetHexoticSdMode( 3 )
+
+# Create the groups on filters
+g1 = Mesh_hexotic_sd3.GroupOnFilter(smesh.VOLUME, 'small sphere', aFilter1 )
+g1.SetColor( SALOMEDS.Color( 1, 0, 0 ))
+g2 = Mesh_hexotic_sd3.GroupOnFilter(smesh.VOLUME, 'big sphere - small sphere', aFilter2 )
+g2.SetColor( SALOMEDS.Color( 0, 1, 0 ))
+g3 = Mesh_hexotic_sd3.GroupOnFilter(smesh.VOLUME, 'box - big sphere', aFilter3 )
+g3.SetColor( SALOMEDS.Color( 0, 0, 1 ))
+
+# Compute
+Mesh_hexotic_sd3.Compute()
+
+# End of script
+\endcode
+
+\image html hexotic_sd_mode_3.png Hexotic mesh of a box cut by a holed sphere ( sd = 3 )
+
+\ref tui_hexotic "Back to top"
+
+\subsection tui_hexotic_sd_mode4 Sub-domain mode = 4
+
+\code
+
+# Create geometry: a box cut by a plane
+Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
+Translation_1 = geompy.MakeTranslation(Box_1, 0, 200, 0)
+Partition_1 = geompy.MakePartition([Box_1, Translation_1], [], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
+geompy.addToStudy( Box_1, 'Box_1' )
+geompy.addToStudy( Translation_1, 'Translation_1' )
+geompy.addToStudy( Partition_1, 'Partition_1' )
+
+# Create mesh of Partition_1 with sd mode 4 (default sd mode in SALOME)
+Mesh_hexotic_sd4 = smesh.Mesh(Partition_1, "Mesh_hexotic_sd4")
+Mesh_hexotic_sd4.Triangle(algo=smesh.BLSURF)
+Mesh_hexotic_sd4.Hexahedron(algo=smesh.Hexotic).SetMinMaxHexes(4, 8).SetHexoticSdMode( 4 )
+
+# Compute
+Mesh_hexotic_sd4.Compute()
+
+# End of script
+\endcode
+
+\image html hexotic_sd_mode_4.png Hexotic mesh of a box cut by a plane ( On the left, sd = 3: the internal surface is ignored ; on the right sd = 4: all sub-domains are meshed )
+
+\ref tui_hexotic "Back to top"
+
+*/
index 331bf189c7c75e10d2c85a9550104c9ea8a13ef4..ec94806faf66235fa978c725e9235b391df166ad 100644 (file)
@@ -2,18 +2,18 @@
 
 \mainpage Introduction to HexoticPLUGIN
 
-\n \b HexoticPLUGIN plugin is destined for:
+\b HexoticPLUGIN plugin is destined for:
+- Meshing 3D geometric entities.
+- Generating 3D meshes from 2D meshes, working without geometrical objects.
 
-
-<ul>
-<li>Meshing 3D geometric entities.</li>
-<li>Generating 3D meshes from 2D meshes, working without geometrical objects.</li>
-</ul>
+\note HexoticPLUGIN plugin uses DISTENE Hexotic commercial meshing
+software and requires a license at the run time (to work within the
+Mesh module).
 
 To manage parameters of the HexoticPLUGIN use \subpage hexotic_hypo_page.
 
 Also all HexoticPLUGIN functionalities are accessible via
-\subpage hexoticplugin_python_intarface_page "HexoticPLUGIN Python interface".
+\subpage hexoticplugin_python_interface_page "HexoticPLUGIN Python interface".
 
 
 */
index 66bb491e71559823a7f054870525abf275087947..293da24e8a2939b5b3d7a4dd606533a02d9232ec 100644 (file)
@@ -31,7 +31,7 @@
  * HexoticPlugin: interfaces to Hexotic related hypotheses and algorithms
  */
 module HexoticPlugin
-{
+{    
   /*!
    * HexoticPlugin_Hexotic: interface of Hexotic algorithm
    */
@@ -49,9 +49,12 @@ module HexoticPlugin
 
     void SetHexesMaxLevel(in long value);
     long GetHexesMaxLevel();
+    
+    void SetMinSize(in double value);
+    double GetMinSize();
 
-    void SetHexoticQuadrangles(in boolean value);
-    boolean GetHexoticQuadrangles();
+    void SetMaxSize(in double value);
+    double GetMaxSize();
 
     void SetHexoticIgnoreRidges(in boolean value);
     boolean GetHexoticIgnoreRidges();
@@ -59,14 +62,20 @@ module HexoticPlugin
     void SetHexoticInvalidElements(in boolean value);
     boolean GetHexoticInvalidElements();
    
-    void SetHexoticSharpAngleThreshold(in long value);
-    long GetHexoticSharpAngleThreshold();
+    void SetHexoticSharpAngleThreshold(in double value);
+    double GetHexoticSharpAngleThreshold();
    
     void SetHexoticNbProc(in long value);
     long GetHexoticNbProc();
 
     void SetHexoticWorkingDirectory(in string path) raises (SALOME::SALOME_Exception);
     string GetHexoticWorkingDirectory();
+   
+    void SetHexoticSdMode(in long value);
+    long GetHexoticSdMode();
+   
+    void SetHexoticVerbosity(in long value);
+    long GetHexoticVerbosity();
   };
 };
 
index fe30c321f40fd485451f7e188f1c5a37d92f00ae..cd4d251474d0e67d75b3513206929de3464642ff 100644 (file)
@@ -46,7 +46,7 @@
                dim="3">
       <python-wrap>
         <algo>Hexotic_3D=Hexahedron(algo=smesh.Hexotic)</algo>
-        <hypo>Hexotic_Parameters=MinMaxQuad(SetHexesMinLevel(),SetHexesMaxLevel(),SetHexoticQuadrangles())</hypo>
+        <hypo>Hexotic_Parameters=Parameters()</hypo>
       </python-wrap>
     </algorithm>
 
index e70321e86c42d1bd8fddc220b775b6ef7b2b05e2..78717e0fe961a42965ad0942102fb69d054683c7 100644 (file)
@@ -2,30 +2,50 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="en_US">
     <context>
-        <name>@default</name>
-        <message>
-            <source>ICON_DLG_Hexotic_PARAMETERS</source>
-            <translation>mesh_hypo_Hexotic.png</translation>
-        </message>
-        <message>
-            <source>ICON_DLG_Hexotic_PARAMETERS_3D</source>
-            <translation>mesh_hypo_Hexotic.png</translation>
-        </message>
-        <message>
-            <source>ICON_SMESH_TREE_ALGO_Hexotic_2D3D</source>
-            <translation>mesh_tree_algo_Hexotic.png</translation>
-        </message>
-        <message>
-            <source>ICON_SMESH_TREE_ALGO_Hexotic_3D</source>
-            <translation>mesh_tree_algo_Hexotic.png</translation>
-        </message>
-        <message>
-            <source>ICON_SMESH_TREE_HYPO_Hexotic_Parameters</source>
-            <translation>mesh_tree_hypo_Hexotic.png</translation>
-        </message>
-        <message>
-            <source>ICON_SMESH_TREE_HYPO_Hexotic_Parameters_3D</source>
-            <translation>mesh_tree_hypo_Hexotic.png</translation>
-        </message>
+    <name>@default</name>
+    <message>
+        <source>ICON_DLG_Hexotic_PARAMETERS</source>
+        <translation>mesh_hypo_Hexotic.png</translation>
+    </message>
+    <message>
+        <source>ICON_DLG_Hexotic_PARAMETERS_3D</source>
+        <translation>mesh_hypo_Hexotic.png</translation>
+    </message>
+    <message>
+        <source>ICON_SMESH_TREE_ALGO_Hexotic_2D3D</source>
+        <translation>mesh_tree_algo_Hexotic.png</translation>
+    </message>
+    <message>
+        <source>ICON_SMESH_TREE_ALGO_Hexotic_3D</source>
+        <translation>mesh_tree_algo_Hexotic.png</translation>
+    </message>
+    <message>
+        <source>ICON_SMESH_TREE_HYPO_Hexotic_Parameters</source>
+        <translation>mesh_tree_hypo_Hexotic.png</translation>
+    </message>
+    <message>
+        <source>ICON_SMESH_TREE_HYPO_Hexotic_Parameters_3D</source>
+        <translation>mesh_tree_hypo_Hexotic.png</translation>
+    </message>
+    <message>
+        <source>Hexotic_SD_MODE_GEOM</source>
+        <translation>sd_mode_geom.png</translation>
+    </message>
+    <message>
+        <source>Hexotic_SD_MODE_1_PIXMAP</source>
+        <translation>sd_mode_1.png</translation>
+    </message>
+    <message>
+        <source>Hexotic_SD_MODE_2_PIXMAP</source>
+        <translation>sd_mode_2.png</translation>
+    </message>
+    <message>
+        <source>Hexotic_SD_MODE_3_PIXMAP</source>
+        <translation>sd_mode_3.png</translation>
+    </message>
+    <message>
+        <source>Hexotic_SD_MODE_4_PIXMAP</source>
+        <translation>sd_mode_4.png</translation>
+    </message>
     </context>
 </TS>
index 362823cbf01335825086614e4035af19544f3168..e6bf808230596aaf7ad11c1d50a58c2e91e69f71 100644 (file)
         <source>Hexotic_3D_TITLE</source>
         <translation>Hypothesis Construction</translation>
     </message>
+    <message>
+        <source>Hexotic_INPUT_SIZE</source>
+        <translation>Sizes</translation>
+    </message>
+    <message>
+        <source>Hexotic_INPUT_LEVEL</source>
+        <translation>Subdivision levels</translation>
+    </message>
+    <message>
+        <source>Hexotic_MAX_SIZE</source>
+        <translation>Max size</translation>
+    </message>
+    <message>
+        <source>Hexotic_MIN_SIZE</source>
+        <translation>Min size</translation>
+    </message>
     <message>
         <source>Hexotic_HEXES_MAX_LEVEL</source>
         <translation>Nb. Hexes Max Level</translation>
         <source>Hexotic_INVALID_ELEMENTS</source>
         <translation>Authorize invalid elements</translation>
     </message>
-    <message>
-        <source>Hexotic_QUADRANGLES</source>
-        <translation>Salome Quadrangles</translation>
-    </message>
     <message>
         <source>Hexotic_SHARP_ANGLE_THRESHOLD</source>
         <translation>Sharp angle threshold in degrees</translation>
     </message>
     <message>
         <source>Hexotic_SELECT_DIR</source>
-        <translation>...</translation>
+        <translation>Select ...</translation>
+    </message>
+    <message>
+        <source>Hexotic_VERBOSITY</source>
+        <translation>Verbosity</translation>
+    </message>
+    <message>
+        <source>Hexotic_SUBDOMAIN_MESH_MODE</source>
+        <translation>Sub-domains mesh mode</translation>
+    </message>
+    <message>
+        <source>Hexotic_SD_MODE_1</source>
+        <translation>Single domain</translation>
+    </message>
+    <message>
+        <source>Hexotic_SD_MODE_2</source>
+        <translation>Cavities ignored</translation>
+    </message>
+    <message>
+        <source>Hexotic_SD_MODE_3</source>
+        <translation>Cavities meshed</translation>
+    </message>
+    <message>
+        <source>Hexotic_SD_MODE_4</source>
+        <translation>Non-manifold geometries</translation>
     </message>
 </context>
 </TS>
index 73770b5b35bb7fddac4ce9b3adc975bfb41795fb..97930c188c51d94b83a36397e7ef44f0d7870b91 100755 (executable)
         <source>Hexotic_3D_TITLE</source>
         <translation>Construction de l&apos;hypothèse</translation>
     </message>
+    <message>
+        <source>Hexotic_INPUT_SIZE</source>
+        <translation>Tailles</translation>
+    </message>
+    <message>
+        <source>Hexotic_INPUT_LEVEL</source>
+        <translation>Niveaux de subdivision</translation>
+    </message>
+    <message>
+        <source>Hexotic_MAX_SIZE</source>
+        <translation>Taille max</translation>
+    </message>
+    <message>
+        <source>Hexotic_MIN_SIZE</source>
+        <translation>Taille min</translation>
+    </message>
     <message>
         <source>Hexotic_HEXES_MAX_LEVEL</source>
         <translation>Nb. des hexagones: niveau max</translation>
     </message>
     <message>
         <source>Hexotic_SELECT_DIR</source>
-        <translation>...</translation>
+        <translation>Choisir ...</translation>
+    </message>
+    <message>
+        <source>Hexotic_VERBOSITY</source>
+        <translation>Verbosité</translation>
+    </message>
+    <message>
+        <source>Hexotic_SUBDOMAIN_MESH_MODE</source>
+        <translation>Mode de maillage des sous-domaines</translation>
+    </message>
+    <message>
+        <source>Hexotic_SD_MODE_1</source>
+        <translation>Domaine unique</translation>
+    </message>
+    <message>
+        <source>Hexotic_SD_MODE_2</source>
+        <translation>Cavités ignorées</translation>
+    </message>
+    <message>
+        <source>Hexotic_SD_MODE_3</source>
+        <translation>Cavités maillées</translation>
+    </message>
+    <message>
+        <source>Hexotic_SD_MODE_4</source>
+        <translation>Géométries "non-manifold"</translation>
     </message>
 </context>
 </TS>
diff --git a/src/GUI/HexoticPluginGUI_Dlg.h b/src/GUI/HexoticPluginGUI_Dlg.h
new file mode 100644 (file)
index 0000000..e14421b
--- /dev/null
@@ -0,0 +1,60 @@
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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.
+//
+// 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
+//
+
+// File   : DlgRef.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+
+#ifndef HEXOTICPLUGINGUI_H
+#define HEXOTICPLUGINGUI_H
+
+class QPixmap;
+
+enum {
+  SD_MODE_1,
+  SD_MODE_2,
+  SD_MODE_3,
+  SD_MODE_4
+};
+
+//////////////////////////////////////////
+// HexoticPluginGUI_StdWidget
+//////////////////////////////////////////
+
+#include "ui_HexoticPluginGUI_StdWidget_QTD.h"
+#include "HexoticPluginGUI.h"
+
+class HEXOTICPLUGIN_GUI_EXPORT HexoticPluginGUI_StdWidget : public QWidget,
+                                            public Ui::HexoticPluginGUI_StdWidget_QTD
+{
+  Q_OBJECT
+
+public:
+  HexoticPluginGUI_StdWidget( QWidget* = 0, Qt::WindowFlags = 0 );
+  ~HexoticPluginGUI_StdWidget();
+
+public slots:
+  void onDirBtnClicked();
+  void onSdModeSelected(int sdMode);
+
+public:
+  QPixmap imageSdMode;
+};
+
+
+#endif
index a1ba5a4d55ef7fc9e83e2ab201965922910a98e5..9208a04d9bd625d119f4c9fdd31be42b7095c001 100644 (file)
@@ -23,6 +23,7 @@
 // ---
 //
 #include "HexoticPluginGUI_HypothesisCreator.h"
+#include "HexoticPluginGUI_Dlg.h"
 
 #include <SMESHGUI_Utils.h>
 #include <SMESHGUI_HypothesesUtils.h>
 #include <QCheckBox>
 #include <QPushButton>
 
-enum Fineness {
-  VeryCoarse,
-  Coarse,
-  Moderate,
-  Fine,
-  VeryFine,
-  UserDefined
-};
 
 HexoticPluginGUI_HypothesisCreator::HexoticPluginGUI_HypothesisCreator( const QString& theHypType )
 : SMESHGUI_GenericHypothesisCreator( theHypType ),
@@ -63,13 +56,33 @@ HexoticPluginGUI_HypothesisCreator::~HexoticPluginGUI_HypothesisCreator()
 {
 }
 
-bool HexoticPluginGUI_HypothesisCreator::checkParams() const
+bool HexoticPluginGUI_HypothesisCreator::checkParams(QString& msg) const
 {
+  msg.clear();
   HexoticHypothesisData data_old, data_new;
   readParamsFromHypo( data_old );
   readParamsFromWidgets( data_new );
+
   bool res = storeParamsToHypo( data_new );
-  return res;
+  if ( !res ) {
+    storeParamsToHypo( data_old );
+    return res;
+  }
+
+  res = data_new.myMinSize <= data_new.myMaxSize;
+  if ( !res ) {
+    msg = tr(QString("Min size (%1) is higher than max size (%2)").arg(data_new.myMinSize).arg(data_new.myMaxSize).toStdString().c_str());
+    return res;
+  }
+
+  res = data_new.myHexesMinLevel == 0  || \
+      ( data_new.myHexesMinLevel != 0  && (data_new.myHexesMinLevel < data_new.myHexesMaxLevel) );
+  if ( !res ) {
+    msg = tr(QString("Min hexes level (%1) is higher than max hexes level (%2)").arg(data_new.myHexesMinLevel).arg(data_new.myHexesMaxLevel).toStdString().c_str());
+    return res;
+  }
+
+  return true;
 }
 
 QFrame* HexoticPluginGUI_HypothesisCreator::buildFrame()
@@ -89,87 +102,110 @@ QFrame* HexoticPluginGUI_HypothesisCreator::buildFrame()
   int row = 0;
   myName = 0;
   if( isCreation() ) {
-    l->addWidget( new QLabel( tr( "SMESH_NAME" ), GroupC1 ), row, 0, 1, 2 );
+    l->addWidget( new QLabel( tr( "SMESH_NAME" ), GroupC1 ), row, 0, 1, 1 );
     myName = new QLineEdit( GroupC1 );
-    l->addWidget( myName, row++, 2, 1, 1 );
+    l->addWidget( myName, row++, 1, 1, 2 );
     myName->setMinimumWidth( 150 );
   }
 
   HexoticPlugin::HexoticPlugin_Hypothesis_var h =
   HexoticPlugin::HexoticPlugin_Hypothesis::_narrow( initParamsHypothesis() );
   
-  l->addWidget( new QLabel( tr( "Hexotic_HEXES_MIN_LEVEL" ), GroupC1 ), row, 0, 1, 2 );
-  myHexesMinLevel = new QtxIntSpinBox( GroupC1 );
-  myHexesMinLevel->setMinimum( 3 );
-  //myHexesMinLevel->setMinimum( h->GetHexesMinLevel() );
-  myHexesMinLevel->setMaximum( 10 );
-  myHexesMinLevel->setSingleStep( 1 );
-  l->addWidget( myHexesMinLevel, row++, 2, 1, 1 );
-  
-  l->addWidget( new QLabel( tr( "Hexotic_HEXES_MAX_LEVEL" ), GroupC1 ), row, 0, 1, 2 );
-  myHexesMaxLevel = new QtxIntSpinBox( GroupC1 );
-  myHexesMaxLevel->setMinimum( 3 );
-  myHexesMaxLevel->setMaximum( 10 );
-  myHexesMaxLevel->setSingleStep( 1 );
-  l->addWidget( myHexesMaxLevel, row++, 2, 1, 1 );
-
-  myHexoticQuadrangles = new QCheckBox( tr( "Hexotic_QUADRANGLES" ), GroupC1 );
-  l->addWidget( myHexoticQuadrangles, row++, 0, 1, 3 );
-  myIs3D = true;
+  myStdWidget = new HexoticPluginGUI_StdWidget(GroupC1);
+  l->addWidget( myStdWidget, row++, 0, 1, 3 );
+  myStdWidget->onSdModeSelected(SD_MODE_4);
 
-  myHexoticIgnoreRidges = new QCheckBox( tr( "Hexotic_IGNORE_RIDGES" ), GroupC1 );
-  l->addWidget( myHexoticIgnoreRidges, row++, 0, 1, 3 );
-
-  myHexoticInvalidElements = new QCheckBox( tr( "Hexotic_INVALID_ELEMENTS" ), GroupC1 );
-  l->addWidget( myHexoticInvalidElements, row++, 0, 1, 3 );
-
-  l->addWidget( new QLabel( tr( "Hexotic_SHARP_ANGLE_THRESHOLD" ), GroupC1 ), row, 0, 1, 2 );
-  myHexoticSharpAngleThreshold = new QtxIntSpinBox( GroupC1 );
-  myHexoticSharpAngleThreshold->setMinimum( 0 );
-  myHexoticSharpAngleThreshold->setMaximum( 90 );
-  myHexoticSharpAngleThreshold->setSingleStep( 1 );
-  l->addWidget( myHexoticSharpAngleThreshold, row++, 2, 1, 1 );
-
-  l->addWidget( new QLabel( tr( "Hexotic_NB_PROC" ), GroupC1 ), row, 0, 1, 2 );
-  myHexoticNbProc = new QtxIntSpinBox( GroupC1 );
-  myHexoticNbProc->setMinimum( 1 );
-  myHexoticNbProc->setMaximum( 256 );
-  myHexoticNbProc->setSingleStep( 1 );
-  l->addWidget( myHexoticNbProc, row++, 2, 1, 1 );
-
-  l->addWidget( new QLabel( tr( "Hexotic_WORKING_DIR" ), GroupC1 ), row, 0, 1, 1 );
-  QPushButton* dirBtn = new QPushButton( tr( "Hexotic_SELECT_DIR" ), GroupC1 );
-  dirBtn->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
-  l->addWidget( dirBtn, row, 1, 1, 1 );  
-  myHexoticWorkingDir = new QLineEdit( GroupC1 );
-  l->addWidget( myHexoticWorkingDir, row++, 2, 1, 1 );
-
-  connect( dirBtn,                  SIGNAL( clicked() ),       this, SLOT( onDirBtnClicked() ) );
-  
+  myIs3D = true;
+//  resizeEvent();
   return fr;
 }
 
+//=================================================================================
+// function : resizeEvent [REDEFINED]
+// purpose  :
+//=================================================================================
+void HexoticPluginGUI_HypothesisCreator::resizeEvent(QResizeEvent */*event*/) {
+    QSize scaledSize = myStdWidget->imageSdMode.size();
+    scaledSize.scale(myStdWidget->sdModeLabel->size(), Qt::KeepAspectRatioByExpanding);
+    if (!myStdWidget->sdModeLabel->pixmap() || scaledSize != myStdWidget->sdModeLabel->pixmap()->size())
+       myStdWidget->sdModeLabel->setPixmap(myStdWidget->imageSdMode.scaled(myStdWidget->sdModeLabel->size(),
+                       Qt::KeepAspectRatio,
+                       Qt::SmoothTransformation));
+}
+
 void HexoticPluginGUI_HypothesisCreator::retrieveParams() const
 {
   HexoticHypothesisData data;
   readParamsFromHypo( data );
+  printData(data);
 
   if( myName )
     myName->setText( data.myName );
-  myHexesMinLevel->setValue( data.myHexesMinLevel );
-  myHexesMaxLevel->setValue( data.myHexesMaxLevel );
-  myHexoticSharpAngleThreshold->setValue( data.myHexoticSharpAngleThreshold );
-
-  myHexoticQuadrangles->setChecked( data.myHexoticQuadrangles );
-  myHexoticIgnoreRidges->setChecked( data.myHexoticIgnoreRidges );
-  myHexoticInvalidElements->setChecked( data.myHexoticInvalidElements );
 
-  myHexesMinLevel->setEnabled(true);
-  myHexesMaxLevel->setEnabled(true);
-  myHexoticSharpAngleThreshold->setEnabled(true);
+  myStdWidget->myMinSize->setCleared(data.myMinSize == 0);
+  if (data.myMinSize == 0)
+    myStdWidget->myMinSize->setText("");
+  else
+    myStdWidget->myMinSize->setValue( data.myMinSize );
+
+  myStdWidget->myMaxSize->setCleared(data.myMaxSize == 0);
+  if (data.myMaxSize == 0)
+    myStdWidget->myMaxSize->setText("");
+  else
+    myStdWidget->myMaxSize->setValue( data.myMaxSize );
+
+  myStdWidget->myHexesMinLevel->setCleared(data.myHexesMinLevel == 0);
+  if (data.myHexesMinLevel == 0)
+    myStdWidget->myHexesMinLevel->setText("");
+  else
+    myStdWidget->myHexesMinLevel->setValue( data.myHexesMinLevel );
+
+  myStdWidget->myHexesMaxLevel->setCleared(data.myHexesMaxLevel == 0);
+  if (data.myHexesMaxLevel == 0)
+    myStdWidget->myHexesMaxLevel->setText("");
+  else
+    myStdWidget->myHexesMaxLevel->setValue( data.myHexesMaxLevel );
+
+  myStdWidget->myHexoticIgnoreRidges->setChecked( data.myHexoticIgnoreRidges );
+  myStdWidget->myHexoticInvalidElements->setChecked( data.myHexoticInvalidElements );
   
-  myHexoticNbProc->setValue( data.myHexoticNbProc );
-  myHexoticWorkingDir->setText( data.myHexoticWorkingDir );
+  myStdWidget->myHexoticSharpAngleThreshold->setCleared(data.myHexoticSharpAngleThreshold == 0);
+  if (data.myHexoticSharpAngleThreshold == 0)
+    myStdWidget->myHexoticSharpAngleThreshold->setText("");
+  else
+    myStdWidget->myHexoticSharpAngleThreshold->setValue( data.myHexoticSharpAngleThreshold );
+
+  myStdWidget->myHexoticNbProc->setValue( data.myHexoticNbProc );
+  myStdWidget->myHexoticWorkingDir->setText( data.myHexoticWorkingDir );
+
+  myStdWidget->myHexoticVerbosity->setValue( data.myHexoticVerbosity );
+
+  myStdWidget->myHexoticSdMode->setCurrentIndex(data.myHexoticSdMode);
+
+  std::cout << "myStdWidget->myMinSize->value(): " << myStdWidget->myMinSize->value() << std::endl;
+  std::cout << "myStdWidget->myMaxSize->value(): " << myStdWidget->myMaxSize->value() << std::endl;
+  std::cout << "myStdWidget->myHexesMinLevel->value(): " << myStdWidget->myHexesMinLevel->value() << std::endl;
+  std::cout << "myStdWidget->myHexesMaxLevel->value(): " << myStdWidget->myHexesMaxLevel->value() << std::endl;
+  std::cout << "myStdWidget->myHexoticSharpAngleThreshold->value(): " << myStdWidget->myHexoticSharpAngleThreshold->value() << std::endl;
+
+}
+
+void HexoticPluginGUI_HypothesisCreator::printData( HexoticHypothesisData& data) const
+{
+  QString valStr;
+  valStr += tr("Hexotic_MIN_SIZE") + " = " + QString::number( data.myMinSize )   + "; ";
+  valStr += tr("Hexotic_MAX_SIZE") + " = " + QString::number( data.myMaxSize ) + "; ";
+  valStr += tr("Hexotic_HEXES_MIN_LEVEL") + " = " + QString::number( data.myHexesMinLevel )   + "; ";
+  valStr += tr("Hexotic_HEXES_MAX_LEVEL") + " = " + QString::number( data.myHexesMaxLevel ) + "; ";
+  valStr += tr("Hexotic_IGNORE_RIDGES")  + " = " + QString::number( data.myHexoticIgnoreRidges ) + "; ";
+  valStr += tr("Hexotic_INVALID_ELEMENTS")  + " = " + QString::number( data.myHexoticInvalidElements ) + "; ";
+  valStr += tr("Hexotic_SHARP_ANGLE_THRESHOLD") + " = " + QString::number( data.myHexoticSharpAngleThreshold ) + "; ";
+  valStr += tr("Hexotic_NB_PROC") + " = " + QString::number( data.myHexoticNbProc ) + "; ";
+  valStr += tr("Hexotic_WORKING_DIR") + " = " + data.myHexoticWorkingDir + "; ";
+  valStr += tr("Hexotic_VERBOSITY") + " = " + QString::number( data.myHexoticVerbosity ) + "; ";
+  valStr += tr("Hexotic_SD_MODE") + " = " + QString::number( data.myHexoticSdMode ) + "; ";
+
+  std::cout << "Data: " << valStr.toStdString() << std::endl;
 }
 
 QString HexoticPluginGUI_HypothesisCreator::storeParams() const
@@ -179,14 +215,19 @@ QString HexoticPluginGUI_HypothesisCreator::storeParams() const
   storeParamsToHypo( data );
 
   QString valStr;
-  valStr += tr("Hexotic_SEG_MIN_SIZE") + " = " + QString::number( data.myHexesMinLevel )   + "; ";
-  valStr += tr("Hexotic_SEG_MAX_SIZE") + " = " + QString::number( data.myHexesMaxLevel ) + "; ";
-  valStr += tr("Hexotic_QUADRANGLES")  + " = " + QString::number( data.myHexoticQuadrangles ) + "; ";
+  valStr += tr("Hexotic_MIN_SIZE") + " = " + QString::number( data.myMinSize )   + "; ";
+  valStr += tr("Hexotic_MAX_SIZE") + " = " + QString::number( data.myMaxSize ) + "; ";
+  valStr += tr("Hexotic_HEXES_MIN_LEVEL") + " = " + QString::number( data.myHexesMinLevel )   + "; ";
+  valStr += tr("Hexotic_HEXES_MAX_LEVEL") + " = " + QString::number( data.myHexesMaxLevel ) + "; ";
   valStr += tr("Hexotic_IGNORE_RIDGES")  + " = " + QString::number( data.myHexoticIgnoreRidges ) + "; ";
   valStr += tr("Hexotic_INVALID_ELEMENTS")  + " = " + QString::number( data.myHexoticInvalidElements ) + "; ";
   valStr += tr("Hexotic_SHARP_ANGLE_THRESHOLD") + " = " + QString::number( data.myHexoticSharpAngleThreshold ) + "; ";
   valStr += tr("Hexotic_NB_PROC") + " = " + QString::number( data.myHexoticNbProc ) + "; ";
   valStr += tr("Hexotic_WORKING_DIR") + " = " + data.myHexoticWorkingDir + "; ";
+  valStr += tr("Hexotic_VERBOSITY") + " = " + QString::number( data.myHexoticVerbosity) + "; ";
+  valStr += tr("Hexotic_SD_MODE") + " = " + QString::number( data.myHexoticSdMode) + "; ";
+
+//  std::cout << "Data: " << valStr.toStdString() << std::endl;
 
   return valStr;
 }
@@ -198,14 +239,17 @@ bool HexoticPluginGUI_HypothesisCreator::readParamsFromHypo( HexoticHypothesisDa
 
   HypothesisData* data = SMESH::GetHypothesisData( hypType() );
   h_data.myName = isCreation() && data ? data->Label : "";
+  h_data.myMinSize = h->GetMinSize();
+  h_data.myMaxSize = h->GetMaxSize();
   h_data.myHexesMinLevel = h->GetHexesMinLevel();
   h_data.myHexesMaxLevel = h->GetHexesMaxLevel();
-  h_data.myHexoticQuadrangles = h->GetHexoticQuadrangles();
   h_data.myHexoticIgnoreRidges = h->GetHexoticIgnoreRidges();
   h_data.myHexoticInvalidElements = h->GetHexoticInvalidElements();
   h_data.myHexoticSharpAngleThreshold = h->GetHexoticSharpAngleThreshold();
   h_data.myHexoticNbProc = h->GetHexoticNbProc();
   h_data.myHexoticWorkingDir = h->GetHexoticWorkingDirectory();
+  h_data.myHexoticVerbosity = h->GetHexoticVerbosity();
+  h_data.myHexoticSdMode = h->GetHexoticSdMode()-1;
 
   return true;
 }
@@ -216,19 +260,23 @@ bool HexoticPluginGUI_HypothesisCreator::storeParamsToHypo( const HexoticHypothe
     HexoticPlugin::HexoticPlugin_Hypothesis::_narrow( hypothesis() );
 
   bool ok = true;
+
   try
   {
     if( isCreation() )
       SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().constData() );
 
+    h->SetMinSize( h_data.myMinSize );
+    h->SetMaxSize( h_data.myMaxSize );
     h->SetHexesMinLevel( h_data.myHexesMinLevel );
     h->SetHexesMaxLevel( h_data.myHexesMaxLevel );
-    h->SetHexoticQuadrangles( h_data.myHexoticQuadrangles );
     h->SetHexoticIgnoreRidges( h_data.myHexoticIgnoreRidges );
     h->SetHexoticInvalidElements( h_data.myHexoticInvalidElements );
     h->SetHexoticSharpAngleThreshold( h_data.myHexoticSharpAngleThreshold );
     h->SetHexoticNbProc( h_data.myHexoticNbProc );
     h->SetHexoticWorkingDirectory( h_data.myHexoticWorkingDir.toLatin1().constData() );
+    h->SetHexoticVerbosity( h_data.myHexoticVerbosity );
+    h->SetHexoticSdMode( h_data.myHexoticSdMode+1 );
   }
   catch(const SALOME::SALOME_Exception& ex)
   {
@@ -240,15 +288,23 @@ bool HexoticPluginGUI_HypothesisCreator::storeParamsToHypo( const HexoticHypothe
 
 bool HexoticPluginGUI_HypothesisCreator::readParamsFromWidgets( HexoticHypothesisData& h_data ) const
 {
-  h_data.myName          = myName ? myName->text() : "";
-  h_data.myHexesMinLevel = myHexesMinLevel->value();
-  h_data.myHexesMaxLevel = myHexesMaxLevel->value();
-  h_data.myHexoticQuadrangles = myHexoticQuadrangles->isChecked();
-  h_data.myHexoticIgnoreRidges = myHexoticIgnoreRidges->isChecked();
-  h_data.myHexoticInvalidElements = myHexoticInvalidElements->isChecked();
-  h_data.myHexoticSharpAngleThreshold = myHexoticSharpAngleThreshold->value();
-  h_data.myHexoticNbProc = myHexoticNbProc->value();
-  h_data.myHexoticWorkingDir = myHexoticWorkingDir->text();
+  h_data.myName    = myName ? myName->text() : "";
+
+  h_data.myHexoticIgnoreRidges = myStdWidget->myHexoticIgnoreRidges->isChecked();
+  h_data.myHexoticInvalidElements = myStdWidget->myHexoticInvalidElements->isChecked();
+
+  h_data.myHexoticNbProc = myStdWidget->myHexoticNbProc->value();
+  h_data.myHexoticWorkingDir = myStdWidget->myHexoticWorkingDir->text();
+  h_data.myHexoticVerbosity = myStdWidget->myHexoticVerbosity->value();
+       h_data.myHexoticSdMode = myStdWidget->myHexoticSdMode->currentIndex();
+
+  h_data.myMinSize = myStdWidget->myMinSize->text().isEmpty() ? 0.0 : myStdWidget->myMinSize->value();
+  h_data.myMaxSize = myStdWidget->myMaxSize->text().isEmpty() ? 0.0 : myStdWidget->myMaxSize->value();
+  h_data.myHexesMinLevel = myStdWidget->myHexesMinLevel->text().isEmpty() ? 0 : myStdWidget->myHexesMinLevel->value();
+  h_data.myHexesMaxLevel = myStdWidget->myHexesMaxLevel->text().isEmpty() ? 0 : myStdWidget->myHexesMaxLevel->value();
+  h_data.myHexoticSharpAngleThreshold = myStdWidget->myHexoticSharpAngleThreshold->text().isEmpty() ? 0 : myStdWidget->myHexoticSharpAngleThreshold->value();
+
+  printData(h_data);
 
   return true;
 }
@@ -273,10 +329,3 @@ QString HexoticPluginGUI_HypothesisCreator::helpPage() const
 {
   return "hexotic_hypo_page.html";
 }
-
-void HexoticPluginGUI_HypothesisCreator::onDirBtnClicked()
-{
-  QString dir = SUIT_FileDlg::getExistingDirectory( dlg(), myHexoticWorkingDir->text(), QString() );
-  if ( !dir.isEmpty() )
-    myHexoticWorkingDir->setText( dir );
-}
index 21cdcd4deeda447af5cb0b77d3650970f33fe164..7757e9344a2ac6d7da2aef4367ca4ac658692314 100644 (file)
@@ -33,16 +33,20 @@ class QtxIntSpinBox;
 class QCheckBox;
 class QLineEdit;
 
+class HexoticPluginGUI_StdWidget;
+
 typedef struct
 {
   QString  myName;
   int      myHexesMinLevel, myHexesMaxLevel;
-  bool     myHexoticQuadrangles;
+  double   myMinSize, myMaxSize;
   bool     myHexoticInvalidElements;
   bool     myHexoticIgnoreRidges;
-  int      myHexoticSharpAngleThreshold;
+  double   myHexoticSharpAngleThreshold;
   int      myHexoticNbProc;
   QString  myHexoticWorkingDir;
+  int      myHexoticVerbosity;
+  int      myHexoticSdMode;
 } HexoticHypothesisData;
 
 /*!
@@ -56,7 +60,7 @@ public:
   HexoticPluginGUI_HypothesisCreator( const QString& );
   virtual ~HexoticPluginGUI_HypothesisCreator();
 
-  virtual bool checkParams() const;
+  virtual bool checkParams(QString&) const;
   virtual QString  helpPage() const;
 
 protected:
@@ -68,24 +72,18 @@ protected:
   virtual QPixmap  icon() const;
   virtual QString  type() const;
   
-protected slots:
-  void             onDirBtnClicked();
-
 private:
   bool readParamsFromHypo( HexoticHypothesisData& ) const;
   bool readParamsFromWidgets( HexoticHypothesisData& ) const;
   bool storeParamsToHypo( const HexoticHypothesisData& ) const;
+  void resizeEvent(QResizeEvent *event);
+  void printData(HexoticHypothesisData&) const;
 
 private:
- QLineEdit*       myName;
- QtxIntSpinBox*   myHexesMinLevel;
- QtxIntSpinBox*   myHexesMaxLevel;
- QCheckBox*       myHexoticQuadrangles;
- QCheckBox*       myHexoticIgnoreRidges;
- QCheckBox*       myHexoticInvalidElements;
- QtxIntSpinBox*   myHexoticSharpAngleThreshold;
- QtxIntSpinBox*   myHexoticNbProc;
- QLineEdit*       myHexoticWorkingDir;
+
+//  QWidget*           myStdGroup;
+  QLineEdit*   myName;
+  HexoticPluginGUI_StdWidget*  myStdWidget;
 
  bool             myIs3D;
 };
diff --git a/src/GUI/HexoticPluginGUI_StdWidget.cxx b/src/GUI/HexoticPluginGUI_StdWidget.cxx
new file mode 100644 (file)
index 0000000..45ee0cc
--- /dev/null
@@ -0,0 +1,95 @@
+// Copyright (C) 2007-2012  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.
+//
+// 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
+//
+
+// ---
+// File    : BLSURFPluginGUI_StdWidget.cxx
+// Authors : Gilles DAVID (OCC)
+// ---
+//
+
+#include "HexoticPluginGUI_Dlg.h"
+
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_FileDlg.h>
+#include <SalomeApp_Tools.h>
+
+//using namespace std;
+
+//////////////////////////////////////////
+// HexoticPluginGUI_StdWidget
+//////////////////////////////////////////
+
+HexoticPluginGUI_StdWidget::HexoticPluginGUI_StdWidget( QWidget* parent, Qt::WindowFlags f )
+: QWidget( parent, f )
+{
+  setupUi( this );
+
+  // Obtain precision from preferences
+  int precision = SUIT_Session::session()->resourceMgr()->integerValue( "SMESH", "length_precision", -3 );
+
+  myMinSize->setMinimum(0);
+  myMinSize->setMaximum(1e15);
+  myMinSize->setPrecision(precision);
+//  myMinSize->setSpecialValueText(" ");
+
+  myMaxSize->setMinimum(0);
+  myMaxSize->setMaximum(1e15);
+  myMaxSize->setPrecision(precision);
+//  myMaxSize->setSpecialValueText(" ");
+
+  myHexesMinLevel->setMinimum(0);
+  myHexesMinLevel->setMaximum(10);
+//  myHexesMinLevel->setSpecialValueText(" ");
+
+  myHexesMaxLevel->setMinimum(0);
+  myHexesMaxLevel->setMaximum(10);
+//  myHexesMaxLevel->setSpecialValueText(" ");
+
+  myHexoticSharpAngleThreshold->setMinimum(0);
+  myHexoticSharpAngleThreshold->setMaximum(90);
+  myHexoticSharpAngleThreshold->setPrecision(precision);
+//  myHexoticSharpAngleThreshold->setSpecialValueText(" ");
+
+  myHexoticNbProc->setMinimum( 1 );
+  myHexoticNbProc->setMaximum( 256 );
+//  myHexoticNbProc->setSingleStep( 1 );
+
+  myHexoticSdMode->setCurrentIndex(SD_MODE_4);
+
+  imageSdMode = SUIT_Session::session()->resourceMgr()->loadPixmap("HexoticPLUGIN", tr("Hexotic_SD_MODE_4_PIXMAP"));
+}
+
+HexoticPluginGUI_StdWidget::~HexoticPluginGUI_StdWidget()
+{
+}
+
+void HexoticPluginGUI_StdWidget::onDirBtnClicked()
+{
+  QString dir = SUIT_FileDlg::getExistingDirectory( this, myHexoticWorkingDir->text(), QString() );
+  if ( !dir.isEmpty() )
+         myHexoticWorkingDir->setText( dir );
+}
+
+void HexoticPluginGUI_StdWidget::onSdModeSelected(int sdMode) {
+  imageSdMode = SUIT_Session::session()->resourceMgr()->loadPixmap("HexoticPLUGIN", tr(QString("Hexotic_SD_MODE_%1_PIXMAP").arg(sdMode+1).toStdString().c_str()));
+  sdModeLabel->setPixmap(imageSdMode.scaled(sdModeLabel->size(),
+      Qt::KeepAspectRatio,
+      Qt::SmoothTransformation));
+}
diff --git a/src/GUI/HexoticPluginGUI_StdWidget_QTD.ui b/src/GUI/HexoticPluginGUI_StdWidget_QTD.ui
new file mode 100644 (file)
index 0000000..c708c4e
--- /dev/null
@@ -0,0 +1,264 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>HexoticPluginGUI_StdWidget_QTD</class>
+ <widget class="QWidget" name="HexoticPluginGUI_StdWidget_QTD">
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="margin">
+    <number>0</number>
+   </property>
+   <item row="0" column="0" colspan="2">
+    <widget class="QGroupBox" name="hexoticInputSize">
+     <property name="title">
+      <string>Hexotic_INPUT_SIZE</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_4">
+      <item row="0" column="0">
+       <widget class="QLabel" name="label">
+        <property name="text">
+         <string>Hexotic_MIN_SIZE</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="SalomeApp_DoubleSpinBox" name="myMinSize"/>
+      </item>
+      <item row="1" column="0">
+       <widget class="QLabel" name="label_2">
+        <property name="text">
+         <string>Hexotic_MAX_SIZE</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1">
+       <widget class="SalomeApp_DoubleSpinBox" name="myMaxSize"/>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="0" column="2" colspan="2">
+    <widget class="QGroupBox" name="hexoticInputLevel">
+     <property name="title">
+      <string>Hexotic_INPUT_LEVEL</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_3">
+      <item row="0" column="0">
+       <widget class="QLabel" name="label_3">
+        <property name="text">
+         <string>Hexotic_HEXES_MIN_LEVEL</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="SalomeApp_IntSpinBox" name="myHexesMinLevel"/>
+      </item>
+      <item row="1" column="0">
+       <widget class="QLabel" name="label_4">
+        <property name="text">
+         <string>Hexotic_HEXES_MAX_LEVEL</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1">
+       <widget class="SalomeApp_IntSpinBox" name="myHexesMaxLevel"/>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="1" column="0" colspan="2">
+    <widget class="QCheckBox" name="myHexoticIgnoreRidges">
+     <property name="text">
+      <string>Hexotic_IGNORE_RIDGES</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="0" colspan="2">
+    <widget class="QLabel" name="label_5">
+     <property name="text">
+      <string>Hexotic_SHARP_ANGLE_THRESHOLD</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="3">
+    <widget class="SalomeApp_DoubleSpinBox" name="myHexoticSharpAngleThreshold"/>
+   </item>
+   <item row="4" column="0">
+    <widget class="QLabel" name="label_6">
+     <property name="text">
+      <string>Hexotic_NB_PROC</string>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="3">
+    <widget class="SalomeApp_IntSpinBox" name="myHexoticNbProc"/>
+   </item>
+   <item row="5" column="0">
+    <widget class="QLabel" name="label_7">
+     <property name="text">
+      <string>Hexotic_WORKING_DIR</string>
+     </property>
+    </widget>
+   </item>
+   <item row="5" column="1" colspan="2">
+    <widget class="QPushButton" name="dirBtn">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Hexotic_SELECT_DIR</string>
+     </property>
+    </widget>
+   </item>
+   <item row="5" column="3">
+    <widget class="QLineEdit" name="myHexoticWorkingDir"/>
+   </item>
+   <item row="6" column="0">
+    <widget class="QLabel" name="label_8">
+     <property name="text">
+      <string>Hexotic_VERBOSITY</string>
+     </property>
+    </widget>
+   </item>
+   <item row="6" column="3">
+    <widget class="QSpinBox" name="myHexoticVerbosity">
+     <property name="maximum">
+      <number>2</number>
+     </property>
+     <property name="value">
+      <number>1</number>
+     </property>
+    </widget>
+   </item>
+   <item row="7" column="0" colspan="4">
+    <widget class="QGroupBox" name="groupBox">
+     <property name="title">
+      <string>Hexotic_SUBDOMAIN_MESH_MODE</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout">
+      <item>
+       <widget class="QComboBox" name="myHexoticSdMode">
+        <property name="currentIndex">
+         <number>3</number>
+        </property>
+        <property name="maxVisibleItems">
+         <number>4</number>
+        </property>
+        <item>
+         <property name="text">
+          <string>Hexotic_SD_MODE_1</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Hexotic_SD_MODE_2</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Hexotic_SD_MODE_3</string>
+         </property>
+        </item>
+        <item>
+         <property name="text">
+          <string>Hexotic_SD_MODE_4</string>
+         </property>
+        </item>
+       </widget>
+      </item>
+      <item>
+       <widget class="QLabel" name="sdModeLabel">
+        <property name="minimumSize">
+         <size>
+          <width>500</width>
+          <height>250</height>
+         </size>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>500</width>
+          <height>250</height>
+         </size>
+        </property>
+        <property name="text">
+         <string/>
+        </property>
+        <property name="scaledContents">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="1" column="2" colspan="2">
+    <widget class="QCheckBox" name="myHexoticInvalidElements">
+     <property name="text">
+      <string>Hexotic_INVALID_ELEMENTS</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>SalomeApp_DoubleSpinBox</class>
+   <extends>QLineEdit</extends>
+   <header location="global">SalomeApp_DoubleSpinBox.h</header>
+  </customwidget>
+  <customwidget>
+   <class>SalomeApp_IntSpinBox</class>
+   <extends>QLineEdit</extends>
+   <header location="global">SalomeApp_IntSpinBox.h</header>
+  </customwidget>
+ </customwidgets>
+ <tabstops>
+  <tabstop>myHexoticIgnoreRidges</tabstop>
+  <tabstop>myHexoticSharpAngleThreshold</tabstop>
+  <tabstop>myHexoticNbProc</tabstop>
+  <tabstop>dirBtn</tabstop>
+  <tabstop>myHexoticWorkingDir</tabstop>
+  <tabstop>myHexoticVerbosity</tabstop>
+  <tabstop>myHexoticSdMode</tabstop>
+ </tabstops>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>dirBtn</sender>
+   <signal>clicked()</signal>
+   <receiver>HexoticPluginGUI_StdWidget_QTD</receiver>
+   <slot>onDirBtnClicked()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>261</x>
+     <y>220</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>390</x>
+     <y>143</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>myHexoticSdMode</sender>
+   <signal>currentIndexChanged(int)</signal>
+   <receiver>HexoticPluginGUI_StdWidget_QTD</receiver>
+   <slot>onSdModeSelected(int)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>147</x>
+     <y>310</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>170</x>
+     <y>258</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <slot>onDirBtnClicked()</slot>
+  <slot>onSdModeSelected(int)</slot>
+ </slots>
+</ui>
index 2aba1301643529c930869787f63f60621856a4a6..2fb5bc0e420754cf22d37da991c55725d4d5675b 100644 (file)
 include $(top_srcdir)/adm_local/unix/make_common_starter.am
 
 # header files 
-salomeinclude_HEADERS =
+salomeinclude_HEADERS = \
+    HexoticPluginGUI.h          \
+    HexoticPluginGUI_Dlg.h    \
+    HexoticPluginGUI_HypothesisCreator.h
 
 # Libraries targets
 lib_LTLIBRARIES = libHexoticPluginGUI.la
 
 dist_libHexoticPluginGUI_la_SOURCES =          \
        HexoticPluginGUI.cxx                    \
-       HexoticPluginGUI.h                      \
-       HexoticPluginGUI_HypothesisCreator.h    \
-       HexoticPluginGUI_HypothesisCreator.cxx
+       HexoticPluginGUI_StdWidget.cxx \
+    HexoticPluginGUI_HypothesisCreator.cxx
 
 MOC_FILES = \
-       HexoticPluginGUI_HypothesisCreator_moc.cxx
+       HexoticPluginGUI_HypothesisCreator_moc.cxx \
+    HexoticPluginGUI_Dlg_moc.cxx
 
+UIC_FILES =     \
+        ui_HexoticPluginGUI_StdWidget_QTD.h
+
+BUILT_SOURCES = $(UIC_FILES)
+        
 nodist_libHexoticPluginGUI_la_SOURCES = \
        $(MOC_FILES)
 
@@ -71,3 +79,7 @@ nodist_salomeres_DATA =               \
        HexoticPLUGIN_images.qm \
        HexoticPLUGIN_msg_en.qm \
        HexoticPLUGIN_msg_fr.qm
+
+SUBDIRS = resources
+
+DIST_SUBDIRS = resources
diff --git a/src/GUI/resources/Makefile.am b/src/GUI/resources/Makefile.am
new file mode 100644 (file)
index 0000000..cb2a469
--- /dev/null
@@ -0,0 +1,34 @@
+# Copyright (C) 2007-2012  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.
+#
+# 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
+#
+
+# ---
+# File   : Makefile.am
+# Author : Gilles DAVID, EDF (gilles-g.david@edf.fr)
+# ---
+#
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+if HEXOTICPLUGIN_ENABLE_GUI
+  dist_salomeres_DATA =                \
+       sd_mode_geom.png                \
+    sd_mode_1.png           \
+    sd_mode_2.png           \
+    sd_mode_3.png           \
+    sd_mode_4.png
+endif
diff --git a/src/GUI/resources/sd_mode_1.png b/src/GUI/resources/sd_mode_1.png
new file mode 100644 (file)
index 0000000..d0cb509
Binary files /dev/null and b/src/GUI/resources/sd_mode_1.png differ
diff --git a/src/GUI/resources/sd_mode_2.png b/src/GUI/resources/sd_mode_2.png
new file mode 100644 (file)
index 0000000..4d76549
Binary files /dev/null and b/src/GUI/resources/sd_mode_2.png differ
diff --git a/src/GUI/resources/sd_mode_3.png b/src/GUI/resources/sd_mode_3.png
new file mode 100644 (file)
index 0000000..97d5fb7
Binary files /dev/null and b/src/GUI/resources/sd_mode_3.png differ
diff --git a/src/GUI/resources/sd_mode_4.png b/src/GUI/resources/sd_mode_4.png
new file mode 100644 (file)
index 0000000..ccc5940
Binary files /dev/null and b/src/GUI/resources/sd_mode_4.png differ
diff --git a/src/GUI/resources/sd_mode_geom.png b/src/GUI/resources/sd_mode_geom.png
new file mode 100644 (file)
index 0000000..9a5748b
Binary files /dev/null and b/src/GUI/resources/sd_mode_geom.png differ
index 92bdd68356298bb35b74bdaaae023bd3c7056bda..948e294716f8b55e083ad052a3eca692afe23208 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-from smesh import Mesh_Algorithm, AssureGeomPublished
+##
+# @package HexoticPLUGINDC
+# Python API for the Hexotic meshing plug-in module.
+
+from smesh_algorithm import Mesh_Algorithm
+from smesh import AssureGeomPublished
 
 # import HexoticPlugin module if possible
 noHexoticPlugin = 0
@@ -27,28 +32,78 @@ except ImportError:
     noHexoticPlugin = 1
     pass
 
+#----------------------------
+# Mesh algo type identifiers
+#----------------------------
+
+## Algorithm type: Hexotic hexahedron 3D algorithm, see Hexotic_Algorithm
 Hexotic = "Hexotic_3D"
 
+#----------------------------
+# Algorithms
+#----------------------------
 
 ## Defines a hexahedron 3D algorithm
 #
+#  It is created by calling smesh.Mesh.Hexahedron( smesh.Hexotic, geom=0 )
 class Hexotic_Algorithm(Mesh_Algorithm):
 
+    ## name of the dynamic method in smesh.Mesh class
+    #  @internal
     meshMethod = "Hexahedron"
+    ## type of algorithm used with helper function in smesh.Mesh class
+    #  @internal
     algoType   = Hexotic
+    ## doc string of the method in smesh.Mesh class
+    #  @internal
+    docHelper  = "Creates hexahedron 3D algorithm for volumes"
 
     ## Private constructor.
+    #  @param mesh parent mesh object algorithm is assigned to
+    #  @param geom geometry (shape/sub-shape) algorithm is assigned to;
+    #              if it is @c 0 (default), the algorithm is assigned to the main shape
     def __init__(self, mesh, geom=0):
         Mesh_Algorithm.__init__(self)
         if noHexoticPlugin: print "Warning: HexoticPlugin module unavailable"
         self.Create(mesh, geom, Hexotic, "libHexoticEngine.so")
+        self.params = None
         pass
 
-    ## Defines "MinMaxQuad" hypothesis to give three hexotic parameters
+    ## Defines "SetMinMaxHexes" hypothesis to give two hexotic parameters
+    #  @param min minimal level of recursive partitioning on the initial octree cube
+    #  @param max maximal level of recursive partitioning on the initial octree cube
+    #  @return hypothesis object
+    def SetMinMaxHexes(self, min=3, max=8):
+        self.Parameters().SetHexesMinLevel(min)
+        self.Parameters().SetHexesMaxLevel(max)
+        return self.Parameters()
+
+    ## Defines "SetMinMaxSize" hypothesis to give two hexotic parameters
+    #  @param min minimal element's size
+    #  @param max maximal element's size
+    #  @return hypothesis object
+    def SetMinMaxSize(self, min, max):
+        self.Parameters().SetMinSize(min)
+        self.Parameters().SetMaxSize(max)
+        return self.Parameters()
+
+    ## (OBSOLETE) Defines "MinMaxQuad" hypothesis to give three hexotic parameters
+    #  @param min minimal level of recursive partitioning on the initial octree cube
+    #  @param max maximal level of recursive partitioning on the initial octree cube
+    #  @param quad not documented
+    #  @return hypothesis object
     def MinMaxQuad(self, min=3, max=8, quad=True):
-        self.params = self.Hypothesis("Hexotic_Parameters", [], "libHexoticEngine.so",
-                                      UseExisting=0)
-        self.params.SetHexesMinLevel(min)
-        self.params.SetHexesMaxLevel(max)
-        self.params.SetHexoticQuadrangles(quad)
+        print "WARNING: Function MinMaxQuad is deprecated, use SetMinMaxHexes instead"
+        return self.SetMinMaxHexes(min, max)
+
+    ## Defines hypothesis having several parameters
+    #  @return hypothesis object
+    def Parameters(self):
+        if not self.params:
+            self.params = self.Hypothesis("Hexotic_Parameters", [],
+                                          "libHexoticEngine.so", UseExisting=0)
+            pass
         return self.params
+
+
+    pass # end of Hexotic_Algorithm class
index ceba57e252e9f47cfed7af6013815e8567874ff1..8ee7dba46e9573817fd12e5b021434c6ac02b209 100644 (file)
 #define DUMP(txt)
 #endif
 
-#include <SMESH_Gen.hxx>
-#include <SMESHDS_Mesh.hxx>
 #include <SMESHDS_GroupBase.hxx>
+#include <SMESHDS_Mesh.hxx>
 #include <SMESH_ControlsDef.hxx>
-#include <SMESH_MesherHelper.hxx>
-#include "SMESH_HypoFilter.hxx"
 #include <SMESH_File.hxx>
+#include <SMESH_Gen.hxx>
+#include <SMESH_HypoFilter.hxx>
+#include <SMESH_MesherHelper.hxx>
+#include <SMESH_subMesh.hxx>
 
 #include <list>
 #include <cstdlib>
@@ -627,7 +628,8 @@ static bool readResult(std::string         theFile,
                        SMESHDS_Mesh*       theMesh,
                        const int           nbShape,
                        const TopoDS_Shape* tabShape,
-                       double**            tabBox)
+                       double**            tabBox,
+                       const int           sdMode)
 {
   // ---------------------------------
   // Optimisation of the plugin ...
@@ -670,6 +672,7 @@ static bool readResult(std::string         theFile,
   TopoDS_Shape *tabCorner, *tabEdge;
 
   const int nbDomains = countShape( theMesh, TopAbs_SHELL );
+  MESSAGE("Nb domains in the meshed shape: " << nbDomains );
   const int holeID = -1;
 
   // tabID    = new int[nbShape];
@@ -847,7 +850,7 @@ static bool readResult(std::string         theFile,
               else {
                 shapeID = tabID[0];
               }
-              if ( shapeID != holeID )
+              if ( (sdMode == 4 && shapeID != holeID) || sdMode != 2 )
                 aHexoticElement = theMesh->AddVolume( node[0], node[3], node[2], node[1], node[4], node[7], node[6], node[5] );
               break;
             }
@@ -910,11 +913,12 @@ static bool readResult(std::string         theFile,
 //purpose  : 
 //=======================================================================
 
-static bool readResult(std::string theFile,
+static bool readResult(std::string            theFile,
 #ifdef WITH_SMESH_CANCEL_COMPUTE
-                       HexoticPlugin_Hexotic*  theAlgo,
+                       HexoticPlugin_Hexotic* theAlgo,
 #endif
-                       SMESH_MesherHelper* theHelper)
+                       SMESH_MesherHelper*    theHelper,
+                       const int              sdMode)
 {
   SMESHDS_Mesh* theMesh = theHelper->GetMeshDS();
 
@@ -1078,12 +1082,15 @@ void HexoticPlugin_Hexotic::SetParameters(const HexoticPlugin_Hypothesis* hyp) {
   if (hyp) {
     _hexesMinLevel = hyp->GetHexesMinLevel();
     _hexesMaxLevel = hyp->GetHexesMaxLevel();
-    _hexoticQuadrangles = hyp->GetHexoticQuadrangles();
+    _hexesMinSize = hyp->GetMinSize();
+    _hexesMaxSize = hyp->GetMaxSize();
     _hexoticIgnoreRidges = hyp->GetHexoticIgnoreRidges();
     _hexoticInvalidElements = hyp->GetHexoticInvalidElements();
     _hexoticSharpAngleThreshold = hyp->GetHexoticSharpAngleThreshold();
     _hexoticNbProc = hyp->GetHexoticNbProc();
     _hexoticWorkingDirectory = hyp->GetHexoticWorkingDirectory();
+    _hexoticVerbosity = hyp->GetHexoticVerbosity();
+    _hexoticSdMode = hyp->GetHexoticSdMode();
   }
   else {
     cout << std::endl;
@@ -1091,12 +1098,15 @@ void HexoticPlugin_Hexotic::SetParameters(const HexoticPlugin_Hypothesis* hyp) {
     cout << "=======" << std::endl;
     _hexesMinLevel = hyp->GetDefaultHexesMinLevel();
     _hexesMaxLevel = hyp->GetDefaultHexesMaxLevel();
-    _hexoticQuadrangles = hyp->GetDefaultHexoticQuadrangles();
+    _hexesMinSize = hyp->GetDefaultMinSize();
+    _hexesMaxSize = hyp->GetDefaultMaxSize();
     _hexoticIgnoreRidges = hyp->GetDefaultHexoticIgnoreRidges();
     _hexoticInvalidElements = hyp->GetDefaultHexoticInvalidElements();
     _hexoticSharpAngleThreshold = hyp->GetDefaultHexoticSharpAngleThreshold();
     _hexoticNbProc = hyp->GetDefaultHexoticNbProc();
     _hexoticWorkingDirectory = hyp->GetDefaultHexoticWorkingDirectory();
+    _hexoticVerbosity = hyp->GetDefaultHexoticVerbosity();
+    _hexoticSdMode = hyp->GetDefaultHexoticSdMode();
   }
 }
 
@@ -1140,30 +1150,37 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri
   cout << std::endl;
   cout << "Hexotic execution..." << std::endl;
   cout << _name << " parameters :" << std::endl;
+  cout << "    " << _name << " Verbosity = " << _hexoticVerbosity << std::endl;
   cout << "    " << _name << " Segments Min Level = " << _hexesMinLevel << std::endl;
   cout << "    " << _name << " Segments Max Level = " << _hexesMaxLevel << std::endl;
-  cout << "    " << "Salome Quadrangles : " << (_hexoticQuadrangles ? "yes":"no") << std::endl;
+  cout << "    " << _name << " Segments Min Size = " << _hexesMinSize << std::endl;
+  cout << "    " << _name << " Segments Max Size = " << _hexesMaxSize << std::endl;
   cout << "    " << "Hexotic can ignore ridges : " << (_hexoticIgnoreRidges ? "yes":"no") << std::endl;
   cout << "    " << "Hexotic authorize invalide elements : " << ( _hexoticInvalidElements ? "yes":"no") << std::endl;
   cout << "    " << _name << " Sharp angle threshold = " << _hexoticSharpAngleThreshold << " degrees" << std::endl;
   cout << "    " << _name << " Number of threads = " << _hexoticNbProc << std::endl;
   cout << "    " << _name << " Working directory = \"" << _hexoticWorkingDirectory << "\"" << std::endl;
+  cout << "    " << _name << " Sub. Dom mode = " << _hexoticSdMode << std::endl;
 
   TCollection_AsciiString run_Hexotic( "hexotic" );
 
   TCollection_AsciiString minl = " -minl ", maxl = " -maxl ", angle = " -ra ";
+  TCollection_AsciiString mins = " -mins ", maxs = " -maxs ";
   TCollection_AsciiString in   = " -in ",   out  = " -out ";
   TCollection_AsciiString ignoreRidges = " -nr ", invalideElements = " -inv ";
   TCollection_AsciiString subdom = " -sd ", sharp = " -sharp ";
   TCollection_AsciiString proc = " -nproc ";
+  TCollection_AsciiString verb = " -v ";
 
-  TCollection_AsciiString minLevel, maxLevel, sharpAngle, mode, subdivision, nbproc;
+  TCollection_AsciiString minLevel, maxLevel, minSize, maxSize, sharpAngle, mode, nbproc, verbosity;
   minLevel = _hexesMinLevel;
   maxLevel = _hexesMaxLevel;
+  minSize = _hexesMinSize;
+  maxSize = _hexesMaxSize;
   sharpAngle = _hexoticSharpAngleThreshold;
-  mode = 4;
-  subdivision = 3;
+  mode = _hexoticSdMode;
   nbproc = _hexoticNbProc;
+  verbosity = _hexoticVerbosity;
 
   if (_hexoticIgnoreRidges)
     run_Hexotic +=  ignoreRidges;
@@ -1171,12 +1188,25 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri
   if (_hexoticInvalidElements)
     run_Hexotic +=  invalideElements;
 
-  run_Hexotic += angle + sharpAngle + minl + minLevel + maxl + maxLevel + in + Hexotic_In + out + Hexotic_Out;
+  if (_hexesMinSize > 0)
+    run_Hexotic +=  mins + minSize;
+
+  if (_hexesMaxSize > 0)
+    run_Hexotic +=  maxs + maxSize;
+
+  if (_hexesMinLevel > 0)
+    run_Hexotic +=  minl + minLevel;
+
+  if (_hexesMaxLevel > 0)
+    run_Hexotic +=  maxl + maxLevel;
+
+  if (_hexoticSharpAngleThreshold > 0)
+    run_Hexotic +=  angle + sharpAngle;
+
+  run_Hexotic += in + Hexotic_In + out + Hexotic_Out;
   run_Hexotic += subdom + mode;
   run_Hexotic += proc + nbproc;
-  //     run_Hexotic += subdom + mode + invalideElements;
-  //     run_Hexotic += subdom + mode + ignoreRidges;
-  //     run_Hexotic += subdom + mode + sharp + subdivision;
+  run_Hexotic += verb + verbosity;
 
   return run_Hexotic.ToCString();
 }
@@ -1289,7 +1319,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh&          theMesh,
     
 
     std::string run_Hexotic = getHexoticCommand(Hexotic_In, Hexotic_Out);
-    run_Hexotic += std::string(" 1>") + aLogFileName.ToCString();  // dump into file
+    run_Hexotic += std::string(" 1 > ") + aLogFileName.ToCString();  // dump into file
 
     cout << std::endl;
     cout << "Hexotic command : " << run_Hexotic << std::endl;
@@ -1323,7 +1353,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh&          theMesh,
 #ifdef WITH_SMESH_CANCEL_COMPUTE
                        this,
 #endif
-                       meshDS, _nbShape, tabShape, tabBox );
+                       meshDS, _nbShape, tabShape, tabBox, _hexoticSdMode );
       if(Ok)
         hexahedraMessage = "success";
       else
@@ -1393,7 +1423,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHel
   Hexotic_Out = aTmpDir + "Hexotic_Out.mesh";
 
   std::string run_Hexotic = getHexoticCommand(Hexotic_In, Hexotic_Out);
-  run_Hexotic += std::string(" 1>") + aLogFileName.ToCString();  // dump into file
+  run_Hexotic += std::string(" 1 > ") + aLogFileName.ToCString();  // dump into file
 
   cout << std::endl;
   cout << "Hexotic command : " << run_Hexotic << std::endl;
@@ -1426,7 +1456,7 @@ bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh & aMesh, SMESH_MesherHelper* aHel
 #ifdef WITH_SMESH_CANCEL_COMPUTE
                      this,
 #endif
-                     aHelper );
+                     aHelper, _hexoticSdMode );
     if(Ok)
       hexahedraMessage = "success";
     else
index 893c0e0c1c1414aeb0c89f8ddabd981c043ee4de..dae3a5b1ebc1c9a9a1bc3e65c94d8ea9bbba5c30 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "HexoticPlugin_Defs.hxx"
 
-#include "SMESH_3D_Algo.hxx"
+#include "SMESH_Algo.hxx"
 #include "SMESH_Mesh.hxx"
 #include "Utils_SALOME_Exception.hxx"
 
@@ -82,13 +82,16 @@ private:
   int  _nbShape;
   int  _hexesMinLevel;
   int  _hexesMaxLevel;
-  bool _hexoticQuadrangles;
+  double _hexesMinSize;
+  double _hexesMaxSize;
   bool _hexoticIgnoreRidges;
   bool _hexoticInvalidElements;
   bool _hexoticFilesKept;
   int  _hexoticSharpAngleThreshold;
   int  _hexoticNbProc;
   std::string  _hexoticWorkingDirectory;
+  int _hexoticVerbosity;
+  int _hexoticSdMode;
   SMDS_MeshNode** _tabNode;
   
 #ifdef WITH_BLSURFPLUGIN
index 8f8c83dc05bad391f15b76a9a7a1e56f2f2befa2..29a828be11d86c77e3aa6ebcd366ba620de25a6e 100644 (file)
@@ -37,12 +37,15 @@ HexoticPlugin_Hypothesis::HexoticPlugin_Hypothesis (int hypId, int studyId,
   : SMESH_Hypothesis(hypId, studyId, gen),
     _hexesMinLevel( GetDefaultHexesMinLevel() ),
     _hexesMaxLevel( GetDefaultHexesMaxLevel() ),
-    _hexoticQuadrangles( GetDefaultHexoticQuadrangles() ),
+    _minSize( GetDefaultMinSize() ),
+    _maxSize( GetDefaultMaxSize() ),
     _hexoticIgnoreRidges( GetDefaultHexoticIgnoreRidges() ),
     _hexoticInvalidElements( GetDefaultHexoticInvalidElements() ), 
     _hexoticSharpAngleThreshold( GetDefaultHexoticSharpAngleThreshold() ),
     _hexoticNbProc( GetDefaultHexoticNbProc() ),
-    _hexoticWorkingDirectory( GetDefaultHexoticWorkingDirectory() )
+    _hexoticWorkingDirectory( GetDefaultHexoticWorkingDirectory() ),
+    _hexoticSdMode(GetDefaultHexoticSdMode()),
+    _hexoticVerbosity(GetDefaultHexoticVerbosity())
 {
   MESSAGE("HexoticPlugin_Hypothesis::HexoticPlugin_Hypothesis");
   _name = "Hexotic_Parameters";
@@ -69,9 +72,16 @@ void HexoticPlugin_Hypothesis::SetHexesMaxLevel(int theVal) {
   }
 }
 
-void HexoticPlugin_Hypothesis::SetHexoticQuadrangles(bool theVal) {
-  if (theVal != _hexoticQuadrangles) {
-    _hexoticQuadrangles = theVal;
+void HexoticPlugin_Hypothesis::SetMinSize(double theVal) {
+  if (theVal != _minSize) {
+         _minSize = theVal;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+void HexoticPlugin_Hypothesis::SetMaxSize(double theVal) {
+  if (theVal != _maxSize) {
+         _maxSize = theVal;
     NotifySubMeshesHypothesisModification();
   }
 }
@@ -90,7 +100,7 @@ void HexoticPlugin_Hypothesis::SetHexoticInvalidElements(bool theVal) {
   }
 }
 
-void HexoticPlugin_Hypothesis::SetHexoticSharpAngleThreshold(int theVal) {
+void HexoticPlugin_Hypothesis::SetHexoticSharpAngleThreshold(double theVal) {
   if (theVal != _hexoticSharpAngleThreshold) {
     _hexoticSharpAngleThreshold = theVal;
     NotifySubMeshesHypothesisModification();
@@ -112,6 +122,20 @@ void HexoticPlugin_Hypothesis::SetHexoticWorkingDirectory(const std::string& pat
   }
 }
 
+void HexoticPlugin_Hypothesis::SetHexoticSdMode(int theVal) {
+  if (theVal != _hexoticSdMode) {
+         _hexoticSdMode = theVal;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+void HexoticPlugin_Hypothesis::SetHexoticVerbosity(int theVal) {
+  if (theVal != _hexoticVerbosity) {
+    _hexoticVerbosity = theVal;
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
 //=============================================================================
 /*!
  *  
@@ -119,25 +143,20 @@ void HexoticPlugin_Hypothesis::SetHexoticWorkingDirectory(const std::string& pat
 //=============================================================================
 std::ostream& HexoticPlugin_Hypothesis::SaveTo(std::ostream& save)
 {
-  /*save << _hexesMinLevel << " " << _hexesMaxLevel;
-  save << " " << (int)_hexoticQuadrangles;
-  save << " " << (int)_hexoticIgnoreRidges;
-  save << " " << (int)_hexoticInvalidElements;
-  save << " " << _hexoticSharpAngleThreshold;
-  std::cout <<std::endl;
-  std::cout << "save : " << save << std::endl;
-  std::cout << std::endl;*/
-
   //explicit outputs for future code compatibility of saved .hdf
   //save without any whitespaces!
+  int dummy = -1;
   save<<"hexesMinLevel="<<_hexesMinLevel<<";"; 
   save<<"hexesMaxLevel="<<_hexesMaxLevel<<";";
-  save<<"hexoticQuadrangles="<<(int)_hexoticQuadrangles<<";";
   save<<"hexoticIgnoreRidges="<<(int)_hexoticIgnoreRidges<<";";
   save<<"hexoticInvalidElements="<<(int)_hexoticInvalidElements<<";";
   save<<"hexoticSharpAngleThreshold="<<_hexoticSharpAngleThreshold<<";";
   save<<"hexoticNbProc="<<_hexoticNbProc<<";";
   save<<"hexoticWorkingDirectory="<<_hexoticWorkingDirectory<<";";
+  save<<"minSize="<<_minSize<<";";
+  save<<"maxSize="<<_maxSize<<";";
+  save<<"hexoticSdMode="<<_hexoticSdMode<<";";
+  save<<"hexoticVerbosity="<<_hexoticVerbosity<<";";
   return save;
 }
 
@@ -171,12 +190,16 @@ std::istream& HexoticPlugin_Hypothesis::LoadFrom(std::istream& load)
 
       if (str3=="hexesMinLevel") _hexesMinLevel = atoi(str4.c_str());
       if (str3=="hexesMaxLevel") _hexesMaxLevel = atoi(str4.c_str());
-      if (str3=="hexoticQuadrangles") _hexoticQuadrangles = (bool) atoi(str4.c_str());
+      if (str3=="hexoticQuadrangles") {}
       if (str3=="hexoticIgnoreRidges") _hexoticIgnoreRidges = (bool) atoi(str4.c_str());
       if (str3=="hexoticInvalidElements") _hexoticInvalidElements = (bool) atoi(str4.c_str());
-      if (str3=="hexoticSharpAngleThreshold") _hexoticSharpAngleThreshold = atoi(str4.c_str());
+      if (str3=="hexoticSharpAngleThreshold") _hexoticSharpAngleThreshold = atof(str4.c_str());
       if (str3=="hexoticNbProc") _hexoticNbProc = atoi(str4.c_str());
       if (str3=="hexoticWorkingDirectory") _hexoticWorkingDirectory = str4;
+      if (str3=="minSize") _minSize = atof(str4.c_str());
+      if (str3=="maxSize") _maxSize = atof(str4.c_str());
+      if (str3=="hexoticSdMode") _hexoticSdMode = atoi(str4.c_str());
+      if (str3=="hexoticVerbosity") _hexoticVerbosity = atoi(str4.c_str());
    }
    return load;
 }
@@ -239,9 +262,14 @@ int HexoticPlugin_Hypothesis::GetDefaultHexesMaxLevel()
   return 10;
 }
 
-bool HexoticPlugin_Hypothesis::GetDefaultHexoticQuadrangles()
+double HexoticPlugin_Hypothesis::GetDefaultMinSize()
 {
-  return true;
+  return 0.0;
+}
+
+double HexoticPlugin_Hypothesis::GetDefaultMaxSize()
+{
+  return 0.0;
 }
 
 bool HexoticPlugin_Hypothesis::GetDefaultHexoticIgnoreRidges()
@@ -254,14 +282,14 @@ bool HexoticPlugin_Hypothesis::GetDefaultHexoticInvalidElements()
   return false;
 }
 
-int HexoticPlugin_Hypothesis::GetDefaultHexoticSharpAngleThreshold()
+double HexoticPlugin_Hypothesis::GetDefaultHexoticSharpAngleThreshold()
 {
-  return 60;
+  return 60.0;
 }
 
 int HexoticPlugin_Hypothesis::GetDefaultHexoticNbProc()
 {
-  return 1;
+  return 4;
 }
 
 std::string HexoticPlugin_Hypothesis::GetDefaultHexoticWorkingDirectory()
@@ -281,3 +309,15 @@ std::string HexoticPlugin_Hypothesis::GetDefaultHexoticWorkingDirectory()
   }
   return aTmpDir.ToCString();
 }
+
+int HexoticPlugin_Hypothesis::GetDefaultHexoticSdMode()
+{
+  return 4;
+}
+
+int HexoticPlugin_Hypothesis::GetDefaultHexoticVerbosity()
+{
+  return 1;
+}
+
+
index b3c0f441cccb16118e390a8e0ba4056952d0bed8..430284e37e3ed15c849078c3a05cd874a724b336 100644 (file)
@@ -45,8 +45,11 @@ public:
   void SetHexesMaxLevel(int theVal);
   int GetHexesMaxLevel() const { return _hexesMaxLevel; }
 
-  void SetHexoticQuadrangles(bool theVal);
-  bool GetHexoticQuadrangles() const { return _hexoticQuadrangles; }
+  void SetMinSize(double theVal);
+  double GetMinSize() const { return _minSize; }
+
+  void SetMaxSize(double theVal);
+  double GetMaxSize() const { return _maxSize; }
 
   void SetHexoticIgnoreRidges(bool theVal);
   bool GetHexoticIgnoreRidges() const { return _hexoticIgnoreRidges; }
@@ -54,8 +57,8 @@ public:
   void SetHexoticInvalidElements(bool theVal);
   bool GetHexoticInvalidElements() const { return _hexoticInvalidElements; }
    
-  void SetHexoticSharpAngleThreshold(int theVal);
-  int GetHexoticSharpAngleThreshold() const { return _hexoticSharpAngleThreshold; }
+  void SetHexoticSharpAngleThreshold(double theVal);
+  double GetHexoticSharpAngleThreshold() const { return _hexoticSharpAngleThreshold; }
    
   void SetHexoticNbProc(int theVal);
   int GetHexoticNbProc() const { return _hexoticNbProc; }
@@ -63,16 +66,25 @@ public:
   void SetHexoticWorkingDirectory(const std::string& path);
   std::string GetHexoticWorkingDirectory() const { return _hexoticWorkingDirectory; }
 
+  void SetHexoticSdMode(int theVal);
+  int GetHexoticSdMode() const { return _hexoticSdMode; }
+
+  void SetHexoticVerbosity(int theVal);
+  int GetHexoticVerbosity() const { return _hexoticVerbosity; }
+
   // the parameters default values 
 
   static int GetDefaultHexesMinLevel();
   static int GetDefaultHexesMaxLevel();
-  static bool GetDefaultHexoticQuadrangles();
+  static double GetDefaultMinSize();
+  static double GetDefaultMaxSize();
   static bool GetDefaultHexoticIgnoreRidges();
   static bool GetDefaultHexoticInvalidElements();
-  static int GetDefaultHexoticSharpAngleThreshold();
+  static double GetDefaultHexoticSharpAngleThreshold();
   static int GetDefaultHexoticNbProc();
   static std::string GetDefaultHexoticWorkingDirectory();
+  static int GetDefaultHexoticSdMode();
+  static int GetDefaultHexoticVerbosity();
 
   // Persistence
   virtual std::ostream& SaveTo(std::ostream& save);
@@ -95,13 +107,16 @@ public:
   virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
 
 private:
-  int  _hexesMinLevel;
-  int  _hexesMaxLevel;
-  bool _hexoticQuadrangles;
-  bool _hexoticIgnoreRidges;
-  bool _hexoticInvalidElements;
-  int  _hexoticSharpAngleThreshold;
-  int  _hexoticNbProc;
+  int    _hexesMinLevel;
+  int    _hexesMaxLevel;
+  double _minSize;
+  double _maxSize;
+  bool   _hexoticIgnoreRidges;
+  bool   _hexoticInvalidElements;
+  double _hexoticSharpAngleThreshold;
+  int    _hexoticNbProc;
+  int    _hexoticSdMode;
+  int    _hexoticVerbosity;
   std::string _hexoticWorkingDirectory ;
 };
 
index 19a85bbe92dbbc2c81204e531c9b7acd5b734820..60f091c43a3b118cbf7ff84962266ed5737a2679 100644 (file)
@@ -66,12 +66,15 @@ HexoticPlugin_Hypothesis_i::~HexoticPlugin_Hypothesis_i()
 /*!
  *  HexoticPlugin_Hypothesis_i::SetHexesMinLevel
  *  HexoticPlugin_Hypothesis_i::SetHexesMaxLevel
- *  HexoticPlugin_Hypothesis_i::SetHexoticQuadrangles
+ *  HexoticPlugin_Hypothesis_i::SetMinSize
+ *  HexoticPlugin_Hypothesis_i::SetMaxSize
  *  HexoticPlugin_Hypothesis_i::SetHexoticIgnoreRidges
  *  HexoticPlugin_Hypothesis_i::SetHexoticInvalidElements
  *  HexoticPlugin_Hypothesis_i::SetHexoticSharpAngleThreshold
  *  HexoticPlugin_Hypothesis_i::SetHexoticNbProc 
  *  HexoticPlugin_Hypothesis_i::SetHexoticWorkingDirectory 
+ *  HexoticPlugin_Hypothesis_i::SetHexoticSdMode
+ *  HexoticPlugin_Hypothesis_i::SetVerbosity
  */
 //=============================================================================
 
@@ -79,56 +82,80 @@ void HexoticPlugin_Hypothesis_i::SetHexesMinLevel (CORBA::Long theValue)
 {
   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexesMinLevel");
   ASSERT(myBaseImpl);
+  CORBA::Long oldValue = GetHexesMinLevel();
   this->GetImpl()->SetHexesMinLevel(theValue);
-  SMESH::TPythonDump() << _this() << ".SetHexesMinLevel( " << theValue << " )";
+  if (theValue != oldValue)
+    SMESH::TPythonDump() << _this() << ".SetHexesMinLevel( " << theValue << " )";
 }
 
 void HexoticPlugin_Hypothesis_i::SetHexesMaxLevel (CORBA::Long theValue)
 {
   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexesMaxLevel");
   ASSERT(myBaseImpl);
+  CORBA::Long oldValue = GetHexesMaxLevel();
   this->GetImpl()->SetHexesMaxLevel(theValue);
-  SMESH::TPythonDump() << _this() << ".SetHexesMaxLevel( " << theValue << " )";
+  if (theValue != oldValue)
+    SMESH::TPythonDump() << _this() << ".SetHexesMaxLevel( " << theValue << " )";
 }
 
-void HexoticPlugin_Hypothesis_i::SetHexoticQuadrangles (CORBA::Boolean theValue)
+void HexoticPlugin_Hypothesis_i::SetMinSize (CORBA::Double theValue)
 {
-  // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticQuadrangles");
+  // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexesMaxLevel");
+  ASSERT(myBaseImpl);
+  CORBA::Double oldValue = GetMinSize();
+  this->GetImpl()->SetMinSize(theValue);
+  if (theValue != oldValue)
+    SMESH::TPythonDump() << _this() << ".SetMinSize( " << theValue << " )";
+}
+
+void HexoticPlugin_Hypothesis_i::SetMaxSize (CORBA::Double theValue)
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexesMaxLevel");
   ASSERT(myBaseImpl);
-  this->GetImpl()->SetHexoticQuadrangles(theValue);
-  SMESH::TPythonDump() << _this() << ".SetHexoticQuadrangles( " << theValue << " )";
+  CORBA::Double oldValue = GetMaxSize();
+  this->GetImpl()->SetMaxSize(theValue);
+  if (theValue != oldValue)
+    SMESH::TPythonDump() << _this() << ".SetMaxSize( " << theValue << " )";
 }
 
 void HexoticPlugin_Hypothesis_i::SetHexoticIgnoreRidges (CORBA::Boolean theValue)
 {
   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticIgnoreRidges");
   ASSERT(myBaseImpl);
+  CORBA::Boolean oldValue = GetHexoticIgnoreRidges();
   this->GetImpl()->SetHexoticIgnoreRidges(theValue);
-  SMESH::TPythonDump() << _this() << ".SetHexoticIgnoreRidges( " << theValue << " )";
+  if (theValue != oldValue)
+    SMESH::TPythonDump() << _this() << ".SetHexoticIgnoreRidges( " << theValue << " )";
 }
 
 void HexoticPlugin_Hypothesis_i::SetHexoticInvalidElements (CORBA::Boolean theValue)
 {
   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticInvalidElements");
   ASSERT(myBaseImpl);
+  CORBA::Boolean oldValue = GetHexoticInvalidElements();
   this->GetImpl()->SetHexoticInvalidElements(theValue);
-  SMESH::TPythonDump() << _this() << ".SetHexoticInvalidElements( " << theValue << " )";
+  if (theValue != oldValue)
+    SMESH::TPythonDump() << _this() << ".SetHexoticInvalidElements( " << theValue << " )";
 }
 
-void HexoticPlugin_Hypothesis_i::SetHexoticSharpAngleThreshold (CORBA::Long theValue)
+void HexoticPlugin_Hypothesis_i::SetHexoticSharpAngleThreshold (CORBA::Double theValue)
 {
   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticSharpAngleThreshold");
   ASSERT(myBaseImpl);
+  CORBA::Double oldValue = GetHexoticSharpAngleThreshold();
   this->GetImpl()->SetHexoticSharpAngleThreshold(theValue);
-  SMESH::TPythonDump() << _this() << ".SetHexoticSharpAngleThreshold( " << theValue << " )";
+  if (theValue != oldValue)
+    SMESH::TPythonDump() << _this() << ".SetHexoticSharpAngleThreshold( " << theValue << " )";
 }
 
 void HexoticPlugin_Hypothesis_i::SetHexoticNbProc (CORBA::Long theValue)
 {
   // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticNbProc");
   ASSERT(myBaseImpl);
+  CORBA::Long oldValue = GetHexoticNbProc();
   this->GetImpl()->SetHexoticNbProc(theValue);
-  SMESH::TPythonDump() << _this() << ".SetHexoticNbProc( " << theValue << " )";
+  if (theValue != oldValue)
+    SMESH::TPythonDump() << _this() << ".SetHexoticNbProc( " << theValue << " )";
 }
 
 void HexoticPlugin_Hypothesis_i::SetHexoticWorkingDirectory(const char* path) throw ( SALOME::SALOME_Exception )
@@ -136,7 +163,13 @@ void HexoticPlugin_Hypothesis_i::SetHexoticWorkingDirectory(const char* path) th
   if (!path )
     THROW_SALOME_CORBA_EXCEPTION( "Null working directory",SALOME::BAD_PARAM );
 
+  ASSERT(myBaseImpl);
   string file(path);
+  string oldValue(GetHexoticWorkingDirectory());
+  bool doDump = false;
+  if (oldValue != file)
+    doDump = true;
+
   const char lastChar = *file.rbegin();
 #ifdef WIN32
   if ( lastChar != '\\' ) file += '\\';
@@ -146,21 +179,44 @@ void HexoticPlugin_Hypothesis_i::SetHexoticWorkingDirectory(const char* path) th
   file += "Hexotic_In.mesh";
   SMESH_Mesh_i::PrepareForWriting (file.c_str());
 
-  ASSERT(myBaseImpl);
   this->GetImpl()->SetHexoticWorkingDirectory(path);
-  SMESH::TPythonDump() << _this() << ".SetHexoticWorkingDirectory( '" << path << "' )";
+  if (doDump)
+    SMESH::TPythonDump() << _this() << ".SetHexoticWorkingDirectory( '" << path << "' )";
+}
+
+void HexoticPlugin_Hypothesis_i::SetHexoticSdMode (CORBA::Long theValue)
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticSdMode");
+  ASSERT(myBaseImpl);
+  CORBA::Long oldValue = GetHexoticSdMode();
+  this->GetImpl()->SetHexoticSdMode(theValue);
+  if (theValue != oldValue)
+    SMESH::TPythonDump() << _this() << ".SetHexoticSdMode( " << theValue << " )";
+}
+
+void HexoticPlugin_Hypothesis_i::SetHexoticVerbosity (CORBA::Long theValue)
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::SetVerbosity");
+  ASSERT(myBaseImpl);
+  CORBA::Long oldValue = GetHexoticVerbosity();
+  this->GetImpl()->SetHexoticVerbosity(theValue);
+  if (theValue != oldValue)
+    SMESH::TPythonDump() << _this() << ".SetHexoticVerbosity( " << theValue << " )";
 }
 
 //=============================================================================
 /*!
  *  HexoticPlugin_Hypothesis_i::GetHexesMinLevel
  *  HexoticPlugin_Hypothesis_i::GetHexesMaxLevel
- *  HexoticPlugin_Hypothesis_i::GetHexoticQuadrangles
+ *  HexoticPlugin_Hypothesis_i::GetMinSize
+ *  HexoticPlugin_Hypothesis_i::GetMaxSize
  *  HexoticPlugin_Hypothesis_i::GetHexoticIgnoreRidges
  *  HexoticPlugin_Hypothesis_i::GetHexoticInvalidElements
  *  HexoticPlugin_Hypothesis_i::GetHexoticSharpAngleThreshold 
  *  HexoticPlugin_Hypothesis_i::GetHexoticNbProc 
  *  HexoticPlugin_Hypothesis_i::GetHexoticWorkingDirectory 
+ *  HexoticPlugin_Hypothesis_i::GetHexoticSdMode
+ *  HexoticPlugin_Hypothesis_i::GetVerbosity
  */
 //=============================================================================
 
@@ -178,11 +234,18 @@ CORBA::Long HexoticPlugin_Hypothesis_i::GetHexesMaxLevel()
   return this->GetImpl()->GetHexesMaxLevel();
 }
 
-CORBA::Boolean HexoticPlugin_Hypothesis_i::GetHexoticQuadrangles()
+CORBA::Double HexoticPlugin_Hypothesis_i::GetMinSize()
 {
-  // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticQuadrangles");
+  // MESSAGE("HexoticPlugin_Hypothesis_i::GetMinSize");
   ASSERT(myBaseImpl);
-  return this->GetImpl()->GetHexoticQuadrangles();
+  return this->GetImpl()->GetMinSize();
+}
+
+CORBA::Double HexoticPlugin_Hypothesis_i::GetMaxSize()
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::GetMaxSize");
+  ASSERT(myBaseImpl);
+  return this->GetImpl()->GetMaxSize();
 }
 
 CORBA::Boolean HexoticPlugin_Hypothesis_i::GetHexoticIgnoreRidges()
@@ -199,7 +262,7 @@ CORBA::Boolean HexoticPlugin_Hypothesis_i::GetHexoticInvalidElements()
   return this->GetImpl()->GetHexoticInvalidElements();
 }
 
-CORBA::Long HexoticPlugin_Hypothesis_i::GetHexoticSharpAngleThreshold()
+CORBA::Double HexoticPlugin_Hypothesis_i::GetHexoticSharpAngleThreshold()
 {
   // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticSharpAngleThreshold");
   ASSERT(myBaseImpl);
@@ -219,6 +282,20 @@ char* HexoticPlugin_Hypothesis_i::GetHexoticWorkingDirectory()
   return CORBA::string_dup( this->GetImpl()->GetHexoticWorkingDirectory().c_str() );
 }
 
+CORBA::Long HexoticPlugin_Hypothesis_i::GetHexoticSdMode ()
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticSdMode");
+  ASSERT(myBaseImpl);
+  return this->GetImpl()->GetHexoticSdMode();
+}
+
+CORBA::Long HexoticPlugin_Hypothesis_i::GetHexoticVerbosity()
+{
+  // MESSAGE("HexoticPlugin_Hypothesis_i::GetVerbosity");
+  ASSERT(myBaseImpl);
+  return this->GetImpl()->GetHexoticVerbosity();
+}
+
 //=============================================================================
 /*!
  *  HexoticPlugin_Hypothesis_i::GetImpl
index a6377be63d46a5b4547a297a3a4126e1474f1dbf..601348445a07e6ed6ae96fce2f3a52635c9b5d54 100644 (file)
@@ -54,8 +54,11 @@ class HEXOTICPLUGIN_EXPORT HexoticPlugin_Hypothesis_i:
   void SetHexesMaxLevel(CORBA::Long theVal);
   CORBA::Long GetHexesMaxLevel();
 
-  void SetHexoticQuadrangles(CORBA::Boolean theVal);
-  CORBA::Boolean GetHexoticQuadrangles();
+  void SetMinSize(CORBA::Double theVal);
+  CORBA::Double GetMinSize();
+
+  void SetMaxSize(CORBA::Double theVal);
+  CORBA::Double GetMaxSize();
 
   void SetHexoticIgnoreRidges(CORBA::Boolean theVal);
   CORBA::Boolean GetHexoticIgnoreRidges();
@@ -63,8 +66,8 @@ class HEXOTICPLUGIN_EXPORT HexoticPlugin_Hypothesis_i:
   void SetHexoticInvalidElements(CORBA::Boolean theVal);
   CORBA::Boolean GetHexoticInvalidElements();
   
-  void SetHexoticSharpAngleThreshold(CORBA::Long theVal);
-  CORBA::Long GetHexoticSharpAngleThreshold();
+  void SetHexoticSharpAngleThreshold(CORBA::Double theVal);
+  CORBA::Double GetHexoticSharpAngleThreshold();
   
   void SetHexoticNbProc(CORBA::Long theVal);
   CORBA::Long GetHexoticNbProc();
@@ -72,6 +75,12 @@ class HEXOTICPLUGIN_EXPORT HexoticPlugin_Hypothesis_i:
   void SetHexoticWorkingDirectory(const char* path) throw ( SALOME::SALOME_Exception );
   char* GetHexoticWorkingDirectory();
 
+  void SetHexoticSdMode(CORBA::Long value);
+  CORBA::Long GetHexoticSdMode();
+
+  void SetHexoticVerbosity(CORBA::Long theVal);
+  CORBA::Long GetHexoticVerbosity();
+
   // Get implementation
   ::HexoticPlugin_Hypothesis* GetImpl();