Salome HOME
Merge from V6_main (04/10/2012) V7_0_0 V7_0_0rc1
authorvsr <vsr@opencascade.com>
Mon, 8 Oct 2012 14:05:59 +0000 (14:05 +0000)
committervsr <vsr@opencascade.com>
Mon, 8 Oct 2012 14:05:59 +0000 (14:05 +0000)
106 files changed:
idl/Document.idl
idl/Edge.idl
idl/Hexa.idl
idl/Quad.idl
idl/Vertex.idl
internal_doc/index.html
src/HEXABLOCK/HexCylinder.cxx
src/HEXABLOCK/HexDocument_Xml.cxx
src/HEXABLOCK/HexEdge.cxx
src/HEXABLOCK/HexEdge.hxx
src/HEXABLOCK/HexElements.cxx
src/HEXABLOCK/HexElements_bis.cxx
src/HEXABLOCK/HexElements_grid.cxx
src/HEXABLOCK/HexElements_piq.cxx
src/HEXABLOCK/HexElements_ter.cxx
src/HEXABLOCK/HexEltBase.cxx
src/HEXABLOCK/HexEltBase.hxx
src/HEXABLOCK/HexHexa.cxx
src/HEXABLOCK/HexPipe.cxx
src/HEXABLOCK/HexQuad.cxx
src/HEXABLOCK/HexQuad.hxx
src/HEXABLOCK/hexa_base.hxx
src/HEXABLOCKGUI/CutEdge_QTD.ui
src/HEXABLOCKGUI/Cylinder_QTD.ui
src/HEXABLOCKGUI/Disconnect_QTD.ui
src/HEXABLOCKGUI/EdgeAssoc_QTD.ui
src/HEXABLOCKGUI/Edge_QTD.ui
src/HEXABLOCKGUI/Group_QTD.ui
src/HEXABLOCKGUI/HEXABLOCKGUI.cxx
src/HEXABLOCKGUI/HEXABLOCKGUI.hxx
src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.cxx
src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.hxx
src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentGraphicView.cxx
src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentGraphicView.hxx
src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.cxx
src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.hxx
src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx
src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.hxx
src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.cxx
src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.hxx
src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentSelectionModel.cxx
src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentSelectionModel.hxx
src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.cxx
src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.hxx
src/HEXABLOCKGUI/HEXABLOCKGUI_Trace.cxx
src/HEXABLOCKGUI/Hexa_QTD.ui
src/HEXABLOCKGUI/JoinQuad_QTD.ui
src/HEXABLOCKGUI/Law_QTD.ui
src/HEXABLOCKGUI/MakeCartesian_QTD.ui
src/HEXABLOCKGUI/MakeCylinder_QTD.ui
src/HEXABLOCKGUI/MakeCylinders_QTD.ui
src/HEXABLOCKGUI/MakeCylindrical_QTD.ui
src/HEXABLOCKGUI/MakeGrid_QTD.ui
src/HEXABLOCKGUI/MakeHemiSphere_QTD.ui
src/HEXABLOCKGUI/MakePipe_QTD.ui
src/HEXABLOCKGUI/MakePipes_QTD.ui
src/HEXABLOCKGUI/MakeRind_QTD.ui
src/HEXABLOCKGUI/MakeSpherical_QTD.ui
src/HEXABLOCKGUI/MakeTranslation_QTD.ui
src/HEXABLOCKGUI/MergeEdges_QTD.ui
src/HEXABLOCKGUI/MergeVertices_QTD.ui
src/HEXABLOCKGUI/Merge_QTD.ui
src/HEXABLOCKGUI/MyBasicGUI_PointDlg.cxx
src/HEXABLOCKGUI/MyBasicGUI_PointDlg.hxx
src/HEXABLOCKGUI/MyGEOMBase_Helper.hxx
src/HEXABLOCKGUI/MyGEOMBase_Skeleton.cxx
src/HEXABLOCKGUI/MyGEOMBase_Skeleton.hxx
src/HEXABLOCKGUI/Pipe_QTD.ui
src/HEXABLOCKGUI/PrismQuad_QTD.ui
src/HEXABLOCKGUI/Propagation_QTD.ui
src/HEXABLOCKGUI/QuadAssoc_QTD.ui
src/HEXABLOCKGUI/QuadRevolution_QTD.ui
src/HEXABLOCKGUI/Quad_QTD.ui
src/HEXABLOCKGUI/RemoveHexa_QTD.ui
src/HEXABLOCKGUI/ReplaceHexa_QTD.ui
src/HEXABLOCKGUI/Symmetry_QTD.ui
src/HEXABLOCKGUI/Transformation_QTD.ui
src/HEXABLOCKGUI/Vector_QTD.ui
src/HEXABLOCKGUI/Vertex_QTD.ui
src/HEXABLOCK_I/HEXABLOCK.cxx
src/HEXABLOCK_I/HexDocument_impl.cxx
src/HEXABLOCK_I/HexDocument_impl.hxx
src/HEXABLOCK_I/HexEdge_impl.cxx
src/HEXABLOCK_I/HexEdge_impl.hxx
src/HEXABLOCK_I/HexHexa_impl.cxx
src/HEXABLOCK_I/HexHexa_impl.hxx
src/HEXABLOCK_I/HexQuad_impl.cxx
src/HEXABLOCK_I/HexQuad_impl.hxx
src/HEXABLOCK_I/HexVertex_impl.cxx
src/HEXABLOCK_I/HexVertex_impl.hxx
src/TEST_PY/INTER_3_CYLINDRE.py [deleted file]
src/TEST_PY/Makefile.am
src/TEST_PY/TUYAU_COURBE.py [deleted file]
src/TEST_PY/Test_HEXABLOCK.py [deleted file]
src/TEST_PY/bielle.py [deleted file]
src/TEST_PY/bielle_variante.py [deleted file]
src/TEST_PY/bride.py [deleted file]
src/TEST_PY/foo.py [new file with mode: 0644]
src/TEST_PY/recettes/cuve.py
src/TEST_PY/test_BIELLE_bad_assoc.py [deleted file]
src/TEST_PY/test_BIELLE_no_assoc.py [deleted file]
src/TEST_PY/test_HEXABLOCK.py [deleted file]
src/TEST_PY/test_INTER_3_CYLINDRE_no_assoc.py [deleted file]
src/TEST_PY/test_TUYAU_COURBE_no_assoc.py [deleted file]
src/TEST_PY/test_TUYAU_COURBE_weird_assoc.py [deleted file]
src/TEST_PY/test_distrib.py [deleted file]

index 39de1e22e8d1c5cab17ed4871fa1105ba2ec128c..ae3eed6ffafdc1e4c4e4305127669d9234ad9dd0 100755 (executable)
@@ -167,11 +167,11 @@ module HEXABLOCK_ORB
     Vector addVectorVertices( in Vertex v1, in Vertex v2 )
         raises (SALOME::SALOME_Exception);
 
-//     long countVector()
-//         raises (SALOME::SALOME_Exception);
-// 
-//     Vector getVector( in long i )
-//         raises (SALOME::SALOME_Exception);
+    long countVector()
+         raises (SALOME::SALOME_Exception);
+
+    Vector getVector( in long i )
+           raises (SALOME::SALOME_Exception);
 
 
     /*!
@@ -180,11 +180,11 @@ module HEXABLOCK_ORB
     Cylinder addCylinder( in Vertex base, in Vector direction, in double radius, in double height )
         raises (SALOME::SALOME_Exception);
 
-//     long countCylinder()
-//         raises (SALOME::SALOME_Exception);
-// 
-//     Cylinder getCylinder( in long i )
-//         raises (SALOME::SALOME_Exception);
+    long countCylinder()
+         raises (SALOME::SALOME_Exception);
+    Cylinder getCylinder( in long i )
+             raises (SALOME::SALOME_Exception);
 
 
     /*!
@@ -195,11 +195,11 @@ module HEXABLOCK_ORB
                   in double height )
         raises (SALOME::SALOME_Exception);
 
-//     long countPipe()
-//         raises (SALOME::SALOME_Exception);
-// 
-//     Pipe getPipe( in long i )
-//         raises (SALOME::SALOME_Exception);
+     long countPipe()
+          raises (SALOME::SALOME_Exception);
+     Pipe getPipe( in long i )
+          raises (SALOME::SALOME_Exception);
 
 
     /*!
index 292d4ed89291bfe00be6a935ff2831f7d1a19f4e..6b2ef6c2d90cb80752c25d689e320360f64845f9 100755 (executable)
@@ -72,7 +72,10 @@ module HEXABLOCK_ORB
 //     void removeAssociation()
 //             raises (SALOME::SALOME_Exception);
 
-     void setScalar( in double val ) //CS_NOT_SPEC
+     void setColor (in double val)
+       raises (SALOME::SALOME_Exception);
+
+     void setScalar( in double val ) //CS_NOT_SPEC --> To delete
        raises (SALOME::SALOME_Exception);
 
   };
index a50704c6188cbb07d63de9243a9b6c4ef2217a5a..bbd845239987583a0ba2478ba0a5faefc8df52b5 100755 (executable)
@@ -43,7 +43,10 @@ module HEXABLOCK_ORB
         Edge getEdge( in long n ) raises(SALOME::SALOME_Exception);
         Vertex getVertex( in long n ) raises(SALOME::SALOME_Exception);
 
-       void setScalar( in double val ) //CS_NOT_SPEC
+        void setColor (in double value)
+             raises (SALOME::SALOME_Exception);
+
+       void setScalar( in double val ) //CS_NOT_SPEC --> To delete
                raises (SALOME::SALOME_Exception);
     };
 
index 1248023695e4b8635c75d0f6bd464218e4a16d33..b182cd268c0741e6437e03c881d4bf9e84ceedbd 100755 (executable)
@@ -63,7 +63,10 @@ module HEXABLOCK_ORB
 //       void removeAssociation()
 //           raises (SALOME::SALOME_Exception);
 
-      void setScalar( in double val ) //CS_NOT_SPEC
+      void setColor (in double value)
+           raises (SALOME::SALOME_Exception);
+
+      void setScalar( in double val ) //CS_NOT_SPEC --> To delete
        raises (SALOME::SALOME_Exception);
 
   };
index e10c9933fcbe20e4a4fc02794633b99783335985..b1ee130943f6098f9f3d0c3df6f9a2990f15c98a 100755 (executable)
@@ -56,7 +56,10 @@ module HEXABLOCK_ORB
         void clearAssociation()
             raises (SALOME::SALOME_Exception);
 
-       void setScalar( in double val ) //CS_NOT_SPEC
+        void setColor (in double value)
+             raises (SALOME::SALOME_Exception);
+
+       void setScalar( in double val ) //CS_NOT_SPEC --> To delete
                raises (SALOME::SALOME_Exception);
 
     };
index 90be5235eb517c0385ff634387b844b11603f913..5a9f598235d3d63b6ef83e93c2524f9fe8880586 100755 (executable)
 <!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
-<html><head>\r
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
-<meta name="Generator" content="Microsoft Word 97">\r
-<meta name="GENERATOR" content="Mozilla/4.7 [fr] (WinNT; I) [Netscape]">\r
-<meta name="Author" content="Alain Buhsing">\r
-<meta name="Classification" content="Logiciel scientifique.">\r
-<meta name="Description" content="Description du logiciel Moïra">\r
-<meta name="KeyWords" content="Environnement de développement, Logiciel scientifique"><title>Projet HEXABLOCK</title></head>\r
-<body>\r
-&nbsp;\r
-<table cols="2" width="100%">\r
-<tbody>\r
-<tr>\r
-<td><img src="logo-cs.gif" alt="Simply Moira" style="width: 145px; height: 84px;"></td>\r
-<td>&nbsp;</td>\r
-</tr>\r
-</tbody>\r
-</table>\r
-<center><a name="DebutPage"></a>\r
-<br>\r
-<big><big><b><font size="+3"><big><big>HexaBlock</big></big></font></b></big></big><b><font size="+3"><br>\r
-<br>\r
-<small>Bibliothèque de formes</small><br><small><small><br>Documentation interne du moteur</small></small><br>\r
-</font></b></center>\r
-<blockquote><i><span style="font-weight: bold;"></span><br>\r
-Ce document constitue la documentation interne du composant HEXABLOCK.<br>Ce\r
-document fait partie des sources du projet et&nbsp;est géré en\r
-configuration Pour le mettre à jour, utiliser kompozer, disponible sur\r
-Linux<br>\r
-<br>\r
-</i></blockquote>\r
-<hr width="100%">\r
-<p><img src="blue-ball.gif" alt="o" height="12" width="12"><b> Table of contents :</b>\r
-<br>\r
-&nbsp;\r
-</p>\r
-<center>\r
-<table style="width: 677px; height: 108px;">\r
-<tbody>\r
-<tr>\r
-<td>\r
-<dt><img src="green-ball.gif" alt="o" height="12" width="12"> &nbsp; <a href="#Partie_1">Partie&nbsp;1 : Prévisualisation des éléments créés</a></dt>\r
-</td>\r
-</tr>\r
-<tr>\r
-<td>\r
-<dt><img src="green-ball.gif" alt="o" height="12" width="12"> &nbsp;&nbsp;<a href="#Partie_2">Partie 2 : Nouvelles fonctions de construction</a></dt><ul><li><a href="#Partie_2">Création d'hexaèdres</a></li><li><a href="#Partie_2.2">Génération d'hexaèdres par révolution</a></li><li><a href="#Partie_2.3">Substitution d'hexaèdres</a></li></ul>\r
-</td>\r
-</tr>\r
-<tr>\r
-<td><img src="green-ball.gif" alt="o" height="12" width="12"> &nbsp; <a href="#Partie_3">Partie 3 : Bibliothèques de formes</a></td>\r
-</tr>\r
-\r
-\r
-<tr><td><img src="green-ball.gif" alt="o" height="12" width="12"> &nbsp; <a href="#Partie_4">Partie 4 : Evolution des associations</a></td></tr></tbody>\r
-</table>\r
-</center>\r
-<p><img src="blue-ball.gif" alt="o" height="12" width="12"><b> See also :</b></p><center>\r
-<table style="width: 677px; height: 60px;">\r
-<tbody>\r
-<tr>\r
-<td>\r
-<dt><img src="green-ball.gif" alt="o" height="12" width="12"> &nbsp;&nbsp;<a href="LastNews.html"><span style="text-decoration: underline;">Last news</span></a></dt>\r
-</td>\r
-</tr>\r
-<tr><td><img src="green-ball.gif" alt="o" height="12" width="12"> &nbsp; Last last News : Voir les <a href="#Partie_3">nouvelles formes </a><br> </td></tr><tr><td><img src="green-ball.gif" alt="o" height="12" width="12"> &nbsp; Précisions sur las <a href="AssoLines.html">associations par lignes</a></td></tr><tr>\r
-<td>\r
-<dt><img src="green-ball.gif" alt="o" height="12" width="12"> &nbsp;&nbsp;<a href="Questions.html"><span style="text-decoration: underline;">Frequently asked questions</span></a></dt>\r
-</td>\r
-</tr><tr><td><img src="green-ball.gif" alt="o" height="12" width="12"> &nbsp;&nbsp;<a href="Bugs.html">Maintenance</a></td></tr>\r
-\r
-\r
-\r
-</tbody>\r
-</table>\r
-</center>\r
-<p></p>\r
-<hr width="100%">\r
-<p><a name="Partie_1"></a></p>\r
-<p><big><img src="blue-ball.gif" alt="o" height="12" width="12"><b><font size="+1"><big> Partie 1 : prévisualisation des éléments créés</big></font></b></big></p>Pour\r
-que SALOME puisse prévisualiser le "document" en cours de modivication,\r
-il est nécessaire&nbsp;de créer une copie de l'original. L'évolution\r
-majeure du moteur &nbsp;consiste à implémenter une fonction de\r
-copie.&nbsp; <br><br>Ce qui revient à ajouter dans la classe Document la méthode suivante :<br><br>\r
-<table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">\r
-<tbody>\r
-<tr>\r
-<td>Document* copyDocument ();\r
-</td>\r
-</tr>\r
-</tbody>\r
-</table>\r
-<br>La valeur rendue est le document copié.<br>Les éléments copiés sont les éléments\r
-intrinsèques du document : vertices, edges, quadrangles, hexaèdres,\r
-lois. Qui sont aussi ceux sauvegardés dans un texte XML. On ne stocke\r
-pas les éléments intermédiaires de construction (grilles, vecteurs,\r
-etc...).<br><br>Cette règle pourra être remise en cause si l'application interactive a besoin d'autres informations.<br><br>La copie se déroule ainsi :<br><ul><li>Chaque élément dispose d'un champ (nommé <span style="font-weight: bold;">clone</span>) qui permet de mémoriser l'adresse du dernier élément copié à partir de cet élément dans le cadre de la copie de document.</li><li>Copier&nbsp;les\r
-éléments de bas niveau (les vertices) : méthode&nbsp;<span style="font-weight: bold;">Vertex::duplicate(Document* cible)</span>. Cette méthode ne rend pas de pointeur ; elle crée un clone du sommet courant et le mémorise sur le champ <span style="font-weight: bold;">clone</span> de la classe <span style="font-weight: bold;">Vertex</span>.</li><li>Copier&nbsp; les éléments présents de plus haut niveau dans l'ordre (edges, quads, hexas) : méthode virtuelle <span style="font-weight: bold;">EltBase::duplicate ()</span></li><ul><li>Si\r
-un élément utilise n éléments de plus bas niveau, sa copie utilise les\r
-copies des éléments utilisés. Il est aisé de retrouver la copie car on\r
-en a stocké l'adresse.</li><li>Détail\r
-: la méthode duplicate n'a pas besoin d'argument de type Document* elle\r
-reprend le document cible des éléments de plus bas niveau..</li></ul><li>Copier les lois</li></ul>Les associations sont copiées lors de la copie de chaque élément.<br><br><br>\r
-<a href="#DebutPage">Retour au début</a>\r
-<hr width="100%">\r
-<p><a name="Partie_2"></a></p>\r
-<p><big><img src="blue-ball.gif" alt="o" height="12" width="12"></big><b><font size="+1"><big>\r
-&nbsp;Partie 2 : Nouvelles fonctions de construction</big></font></b></p><p><big><img src="green-ball.gif" style="width: 12px; height: 12px;" alt="o"></big><b><font size="+1"><big> 2.1 Création d'Hexaèdres</big></font></b></p>\r
-<p class="MsoNormal" style="text-align: left;" align="left">Il s'agit de construire un hexaèdre à partir de quadrangles déjà créés dans le\r
-modèle de blocs. Cet hexaèdre est produit à partir des 4 cas suivants :</p>\r
-\r
-<ul style="margin-top: 0cm;" type="disc"><li class="MsoNormal" style="text-align: left;">à partir de 2 quadrangles reliés ou pas,</li><li class="MsoNormal" style="text-align: left;">à partir de 3 quadrangles tous reliés,</li><li class="MsoNormal" style="text-align: left;">à partir de 4 quadrangles tous reliés,</li><li class="MsoNormal" style="text-align: left;">à partir de 5 quadrangles tous reliés.</li></ul>Les points d'entrée sont naturellement :<br><br>\r
-\r
-<span style="font-size: 11pt; font-family: Garamond;"></span>\r
-<table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">\r
-<tbody>\r
-<tr>\r
-<td>Hexa* <a href="#addHexa2Quads">addHexa2Quads</a> (Quad* q1,&nbsp;Quad* q2);<br>Hexa* <a href="#addHexa3Quads">addHexa3Quads</a> (Quad* q1,&nbsp;Quad* q2, Quad* q3);<br>Hexa* <a href="#addHexa4Quads">addHexa4Quads</a> (Quad* q1,&nbsp;Quad* q2, Quad* q3,&nbsp;Quad* q4);<br>Hexa* <a href="#addHexa5Quads">addHexa5Quads</a> (Quad* q1,&nbsp;Quad* q2, Quad* q3,&nbsp;Quad* q4,&nbsp;Quad* q5);</td>\r
-</tr>\r
-</tbody>\r
-</table><p>Chacun des cas amène une discussion. La démarche est la suivante :&nbsp;</p><ul><li>Les quadrangles passés en argument dans un ordre quelconque.</li><li>Un\r
-analyseur d'intersections (classe&nbsp;<span style="font-weight: bold;">AnaQuads</span>,\r
-définie dans\r
-HexAnaQuads.hxx) détermine les arêtes communes aux n quadrangles passés\r
-en argument. et mémorise ces informations qui seront transmises aux\r
-fonctions internes, afin de ne pas répêter ces calculs d'intersection.</li><li>En fonction du nombre d'arêtes communes à chaque quadrangle, on se ramène à 7 cas.&nbsp;</li><li>Si le nombre d'arêtes communes est insuffisant, le cas est rejeté.</li><li>On nomme ces cas en se servant de la nomenclature des faces dans le projet : (A, B, C, D, E,F)</li></ul>Remarques :<br><ul><li>Les quadrangles passés en arguments sont considérés comme planaires, il n'y a pas de contrôle d'arguments en entrée à ce niveau</li><li>Ils\r
-sont sensés générer des quadrangles planaires et non croisés. Par\r
-exemple pour addHexaQuadsACD() : il n'y a pas de contrôle de planéité\r
-de la face B.&nbsp;</li></ul><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">Rappel&nbsp; :&nbsp; formalisation des Hexaèdres/Quadrangles/Vertex</span><br><br><a name="RappelNotations"></a><br>Pour rappel :<br><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">\r
-<tbody>\r
-<tr>\r
-<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r
-//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; z=0&nbsp;&nbsp; z=1&nbsp;&nbsp;\r
-y=0&nbsp;&nbsp; y=1&nbsp;&nbsp; x=0&nbsp; x=1<br>enum EnumHQuad&nbsp;&nbsp; {Q_A,&nbsp; Q_B,&nbsp; Q_C,&nbsp; Q_D,&nbsp; Q_E, Q_F,&nbsp; HQ_MAXI};<br></td>\r
-</tr>\r
-</tbody>\r
-</table><br>La face A est opposée à B, C est opposée à D, E à F. La\r
-position des faces&nbsp; A, C, E normales à Oz, Oy, Ox est purement\r
-théorique. Elle améliore la visualisation. Les orientations sont en\r
-fait&nbsp; interchangeables. On peut intervertir les couples (C,D) et\r
-(E,F), on peut intervertir A et B, C et D, E et F, l'essentiel est\r
-d'avoir une cohérence&nbsp; avec les autres dénominations d'edges (ac,\r
-af, ad ...) ou de&nbsp;sommets (ace, acf, adf ...) &nbsp;et les\r
-conventions de départ.<br><br>L'arête située entre la face X et la face Y est notée xy. Un sommet situé entre les 3 faces X, Y Z est noté xyz :<br><br><table style="font-family: monospace; width: 500px; text-align: left; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="width: 50%;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6=bde&nbsp; +----bd-----+ bdf=7<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r
-/|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /|<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; be |&nbsp;&nbsp; <big><span style="font-weight: bold;">B</span></big>&nbsp;&nbsp;&nbsp; bf |<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&nbsp; |<br>&nbsp;&nbsp;&nbsp; 4=bce +----bc-----+...|...bcf=5<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; de&nbsp;&nbsp;&nbsp;&nbsp; <big><big style="font-weight: bold;">D</big></big> |&nbsp;&nbsp; df<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r
-| <big><span style="font-weight: bold;">E</span></big> |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | <big style="font-weight: bold;">F</big>\r
-|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r
-z<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ce&nbsp;&nbsp; |\r
-<span style="font-weight: bold;"><big>C</big>&nbsp;</span>&nbsp;&nbsp;&nbsp; cf&nbsp;\r
-|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r
-^<br>&nbsp; 2=ade...|...+----ad-|---+ adf=3&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp; y<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r
-|&nbsp; /&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;\r
-/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r
-|&nbsp; /<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |\r
-ae&nbsp;&nbsp;&nbsp; <big><span style="font-weight: bold;">A</span></big>&nbsp;&nbsp; |\r
-af&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r
-| /<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r
-|/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r
-|/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r
-|/<br>&nbsp;&nbsp;&nbsp; 0=ace +----ac-----+ acf=1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +-----&gt;&nbsp;x<br>&nbsp;&nbsp; <br><br></td>\r
-</tr>\r
-</tbody>\r
-</table><br><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">La classe AnaQuads</span><br><br>Cette\r
-classe analyse les relations topologiques existant entre plusieurs\r
-quandrangles. Un objet de ce type est créé au début de chaque fonction\r
-addHexaXQuads.<br><br>Le constructeur est :<br><br>\r
-\r
-<span style="font-size: 11pt; font-family: Garamond;"></span>\r
-<table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">\r
-<tbody>\r
-<tr>\r
-<td>AnaQuads (Quad* q1, Quad* q2, Quad* q3=NULL, Quad* q4=NULL, Quad* q5=NULL);<br></td>\r
-</tr>\r
-</tbody>\r
-</table><br>Les champs affectés lors de la construction de l'objet :<br><br><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td>MawQuads </td><td>Constante égale à 5 5</td></tr><tr><td>int&nbsp;&nbsp;&nbsp; nbr_quads;</td><td>Nombre de quadrangles</td></tr><tr><td>int&nbsp;&nbsp;&nbsp; nbr_aretes;</td><td>Nombre total d'arêtes</td></tr><tr><td>Quad*&nbsp; tab_quads&nbsp; [i];</td><td>Le ième quadrangle passé en argument </td></tr><tr><td>int&nbsp;&nbsp;&nbsp; inter_nbre [i];</td><td>Nombre d'intersections du ième quadrangle</td></tr><tr><td>int&nbsp;&nbsp;&nbsp; inter_edge [i][j];</td><td>Nro d'arête de i intersectant le jème quadrangle</td></tr><tr><td>int&nbsp;&nbsp;&nbsp; inter_quad [i][j];</td><td>Nro de quadrangle présent sur la jème arete du iéme quad</td></tr></tbody></table><br><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">La classe Cramer</span><br><br>Cette\r
-classe résout un système linéaire de n équations &nbsp;à n inconnues.\r
-Quand n est "petit", n&lt;10. Peut être réutilisée sur un autre projet.\r
-<br>Implémentation : HexCramer.hxx.<br>Test unitaire : test_cramer dans test_hexa1.cxx<br><br><br>\r
-\r
-<span style="font-size: 11pt; font-family: Garamond;"></span>\r
-<table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">\r
-<tbody>\r
-<tr>\r
-<td>int test_cramer (int nbargs, cpchar tabargs[])<br>{<br>&nbsp;&nbsp; double matrice [] = { 2, 7, 1,&nbsp; &nbsp; 0, 3, 0,&nbsp; &nbsp; 1, 9, 5 };<br>&nbsp;&nbsp; double second_membre&nbsp; [] = { 1, 1, 1 };<br>&nbsp;&nbsp; Hex::Real3&nbsp; solution;<br>&nbsp;&nbsp; <span style="font-weight: bold;">Hex::Cramer system(3)</span>; &nbsp; // On dimensionne le système de Cramer à la construction<br><br>&nbsp;&nbsp; int ier = <span style="font-weight: bold;">system.resoudre</span> (matrice, second_membre, solution);<br><br>&nbsp;&nbsp;\r
-cout &lt;&lt; " Solution&nbsp; = (" &lt;&lt; solution[0] &lt;&lt; ", "\r
-&lt;&lt; solution[1] &lt;&lt; ", " &lt;&lt; solution[2] <br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&lt;&lt; "), ier = " &lt;&lt; ier &lt;&lt; endl;<br>&nbsp;\r
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\r
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Pour vérifier : <br>&nbsp;&nbsp; Hex::Real3 produit;<br>&nbsp;&nbsp; <span style="font-weight: bold;">system.multiply</span> (solution, produit);<br>&nbsp;&nbsp;\r
-cout &lt;&lt; " Produit&nbsp;= (" &lt;&lt; produit[0] &lt;&lt; ", "\r
-&lt;&lt; produit[1] &lt;&lt; ", " &lt;&lt; produit[2] <br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&lt;&lt; ")" &nbsp;&lt;&lt; endl;<br>&nbsp;&nbsp; return HOK;<br>}<br></td>\r
-</tr>\r
-</tbody>\r
-</table><br><br><br><a name="addHexa2Quads"></a><br><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">Création d'un hexaèdre avec deux quadrangles :&nbsp;</span>&nbsp;<ul><li>La classe AnaQuads ne détecte aucune arête commune : appel à addHexaQuadsAB</li><li>La classe AnaQuads&nbsp; détecte&nbsp;une arête commune : appel à addHexaQuadsAC</li></ul><table style="text-align: left; width: 90%;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="vertical-align: middle; text-align: center;"><p><img src="Quads_AB.png" style="width: 282px; height: 226px;" alt="En diedre"></p></td><td style="vertical-align: middle; text-align: center;"><img src="Quads_AC.png" style="width: 278px; height: 223px;" alt="Vis a vis"></td></tr><tr><td style="vertical-align: middle;">addHexa2Quads avec 2 quadrangles&nbsp; non reliés. <br>Fonction : addHexaQuadsAB</td><td style="vertical-align: middle;">addHexa2Quads avec 2 quadrangles&nbsp;&nbsp; reliés. <br>Fonction : addHexaQuadsAC</td></tr></tbody></table><p><span style="font-weight: bold;"></span></p><p><span style="font-weight: bold;">addHexaQuadAB</span> :</p>Les huits sommets sont présents, il manque quatre arêtes verticales ce, cf, df, de.<br>La\r
-difficuté consiste à faire correspondre deux à deux les quatre sommets\r
-de chaque quadrangle sans que les arêtes ne se croisent. La situation\r
-est analogue à <span style="font-weight: bold;">mergeQuads</span> ou <span style="font-weight: bold;">joinQuads</span>, sauf que dans ces cas, on passe\r
-en argument quatre vertex pour déterminer dans ambiguité les sommets\r
-correspondants deux à deux. On a choisi ici\r
-d'automatiser l'association :<br><ul><li>il\r
-existe huit combinaisons permettant d'associer deux à deux les 4\r
-sommets de 2 quadrangles : décalage de 0 à 3 dans un sens puis dans\r
-l'autre. </li><li>Pour chaque combinaison, on calcule la longueur totale des 4 arêtes créées.</li><li>On retient la combinaison qui mène à une longueur minimale.</li></ul>Une fois la combinaison optimale établie :<br><ul><li>Création\r
-des 4 arêtes verticales en fonction des combinaisons, stockées dans un\r
-tableau tedge[4]. Le premier vertex fourni est celui de la face A. </li><li>Création des 4 quadrangles verticaux.</li><li>Création de l'hexaèdre.</li></ul>Pour créer le&nbsp;i-ème quadrangle vertical : <br><ul><li>l'arête verticale de gauche e_left = tedge[i]</li><li>l'arête verticale de droite e_left = tedge[(i+1) modulo 4]</li><li>l'arête\r
-horizontale basse s'obtient grâce à la fonction Quad::findEdge (v1,\r
-v2). On recherche dans le quadrangle A l'arête dont les 2 sommets sont\r
-les extrémités amont des arêtes e_left et e_right, qui par construction\r
-appartiennent au quadrangle A.</li><li>idem pour&nbsp; l'arête haute ; sauf que ce sont les extrémités aval.</li></ul> <p><span style="font-weight: bold;">addHexaQuadAC</span> :</p><p>Deux\r
-faces présentes A et C, une arête commune ac. Il manque deux sommets\r
-bde et bdf à partir desquels on construit les arêtes manquantes bd,\r
-be, de, bf, df.&nbsp;<br>On doit s'assurer de la planéité des quadrangles créés. </p><p>La\r
-solution n'est pas unique. Il existe une infinité de sommets pouvant\r
-définir un hexaèdre &nbsp;conforme. On se contente ici d'en choisir une\r
-et de démontrer que l'objet créé est conforme.&nbsp;</p><p>Le point bde (resp bdf) est construit en\r
-sommant les vecteurs ac et ce (resp&nbsp;af et cf), ce qui revient à\r
-définir un parallélogramme. On assure ainsi sa présence dans le plan E\r
-(resp. F). Les faces créées E et F sont donc planaires.</p><p>Pour démontrer la planéité de la face B :<br></p><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">\r
-<tbody>\r
-<tr>\r
-<td><ol><li>(ae , af)&nbsp; coplanaires (donnée)</li><li>be = ae (construction d'un parallèlogramme)</li><li>df = af &nbsp;(idem)</li><li>(1), (2), (3) =&gt; (be, bf) coplanaires </li></ol></td>\r
-</tr>\r
-</tbody>\r
-</table><br>On procéderait de la même manière pour établir que la face D est plane.<br><br>La fonction s'écrit ainsi :<br><ul><li>q_a est le premier quadrangle fourni, q_c le second</li><li>L'edge e_ac est défini qrâce à la strucrure AnaQuads</li><li>On effectue un calcul analogue aux deux extrémités s (amont et aval) de e_ac :</li><ul><li>vx1 = extrémité étudiée de e_ac, vx2 l'autre</li><li>vxa\r
-= sommet adjacent de vx1 sur&nbsp; la face A, différent de vx2. Il est\r
-obtenu en prenant le sommet opposé à vx2 sur la face A. L'indice de vxa\r
-dans qa vaut vx2+2 modulo 4.</li><li>de même, vxc = sommet adjacent de vx1 sur la face&nbsp; C.</li><li>Calcul des coordonnées&nbsp;et&nbsp; création du vertex tv_bdx[s] (x représente la choix entre e et f).</li><li>Création des deux arêtes manquantes&nbsp;te_bx[s] et te_dx[s]</li><li>Création&nbsp;du quadrangle latéral tq_ef [s]</li></ul><li>Création de l'arête e_bd à partir des deux vertices de&nbsp; tv_bdx</li><li>Création\r
-du quadrangle D à partir de te_dx[], e_ef, te_dx[1] et de l'arête\r
-opposée à e_ac dans A (fonction Quad::getOpposedEdge(e,n)</li><li>Création du quadrangle B à partir de te_bx[], e_ef, te_bx[1] et de\r
-l'arête opposée à e_ac dans C (fonction Quad::getOpposedEdge(e,n)</li><li>Création de l'hexaèdre</li></ul><p><a name="addHexa3Quads"></a></p><p><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">Création d'un hexaèdre avec trois quadrangles :&nbsp;</span>&nbsp;</p><ul><li>La\r
-classe AnaQuads&nbsp; détecte deux arêtes communes : appel à\r
-addHexaQuadsACD. La face A sera celle qui possède deux arêtes communes,\r
-la face C la suivante, D la derniére.</li><li>La classe AnaQuads&nbsp;\r
-détecte trois arêtes communes : appel à addHexaQuadsACE. Ce cas est\r
-symétrique, la face A sera la première de la liste, C la seconde.</li></ul><p></p><br><table style="text-align: left; width: 90%;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="vertical-align: middle; text-align: center;"><p><img src="Quads_ACD.png" style="width: 282px; height: 226px;" alt="En diedre"></p></td><td style="vertical-align: middle; text-align: center;"><img src="Quads_ACE.png" style="width: 278px; height: 223px;" alt="Trièdre"></td></tr><tr><td style="vertical-align: middle;">addHexa2Quads avec 3 quadrangles&nbsp;disposés en U. <br>Fonction : addHexaQuadsACD</td><td style="vertical-align: middle;">addHexa2Quads avec&nbsp; quadrangles disposés&nbsp; en trièdre<br>Fonction : addHexaQuadsACE</td></tr></tbody></table><p><br></p><p><span style="font-weight: bold;">addHexaQuadACD</span> :</p><p>Tous les sommets sont présents. Il reste à créer :</p><ul><li>Les arêtes be et bf&nbsp;</li><li>Les quadrangles E, B, F en déterminant les arêtes qui les constituent. </li></ul><p>La difficulté est d'identifier clairement les arêtes et les sommets à partir des quadrangles existant :&nbsp;</p><ul><li>q_a est le quadrangle qui possède deux arêtes communes, q_b et q_c les suivants.</li><li>On exploite les indices d'edges communs fournis par <span style="font-weight: bold;">AnaQuads</span>. Rappelons que dans un quadrangle le ième edge est adjacent aux edges i-1 et i+1 et opposé à l'edge i+2.</li><li>e_ac et e_ad sont les intersections de q_a avec q_c et q_d. (nommés ici mais non utilisés dans le programme)</li><li>e_bc est l'arête opposée à e_ac dans q_c,&nbsp;&nbsp;e_bd est l'arête opposée à e_ad dans q_d.</li><li>e_ae\r
-est l'arête suivante de e_ac dans q_a, e_af &nbsp;l'arête précédente.\r
-Ce choix arbitraire&nbsp; détermine les autres dénominations.</li><li>e_ce est l'arête adjacente de e_ac dans q_c qui a un sommet commun (v_ace) avec e_ae.</li><li>e_de est l'arête adjacente de e_ac dans q_d qui a un sommet commun (v_ade) avec e_ae.</li><li>v_acf est le sommet commun à e_af et e_cf</li><li>v_adf est le sommet commun à e_af et e_df</li><li>Création de l'arete e_be &nbsp;à paertir de e_bce et v_bde, puis de l'arête e_bf,</li><li>Créations des quadrangles q_b, q_e, q_f</li><li>Création de l'hexaèdre.</li></ul><p></p><p><span style="font-weight: bold;">addHexaQuadACE</span> :</p><p>Il\r
-est nécessaire de créer le sommet v_bdf. Il est l'intersection des\r
-plans (B, D, F). Chaque plan est défini par trois points présents sur\r
-les autres quadrangles :</p><ul><li>Le plan B est défini par les sommets bcd, bce, bcf . Son vecteur normal norm_b est le produit vectoriel&nbsp;de bc par be.</li><li>Le plan D est défini par les sommets adf, ade, adb. Son vecteur normal norm_d&nbsp; est le produit vectoriel&nbsp;de ac par ae.</li><li>Le\r
-plan F est défini par les sommets adf, acf, bcf.&nbsp; Son vecteur\r
-normal norm_f&nbsp; est le produit vectoriel&nbsp;de ae par ec.</li></ul><p>Soit un plan P défini par un point A et un vecteur normal N. Un point M appartient à P si le produit scalaire N.AM est nul</p><p>On obtient le système d'équations <br></p><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">\r
-<tbody>\r
-<tr>\r
-<td><ol><li>(bdf,bce) . norm_b = 0</li><li>(bdf,ade) . norm_d = 0</li><li>(bdf,acf) . norm_f = 0</li></ol></td>\r
-</tr>\r
-</tbody>\r
-</table>Equivalent à :&nbsp;<br><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">\r
-<tbody>\r
-<tr>\r
-<td><ol><li>&nbsp; &nbsp;norme_b[0]*X + norme_b[1]*Y + norme_b[2]*Z = prod_scalaire (v_bce, norm_b)</li><li>&nbsp;&nbsp; norme_d[0]*X + norme_d[1]*Y + norme_d[2]*Z =&nbsp;prod_scalaire (v_ade, norm_d)</li><li>&nbsp;&nbsp; norme_f[0]*X + norme_f[1]*Y + norme_f[2]*Z =&nbsp;prod_scalaire (v_acf, norm_f)</li></ol></td>\r
-</tr>\r
-</tbody>\r
-</table><br>Ce système de 3 équations à trois inconnues est résolu par la méthode de <span style="font-weight: bold;">Cramer</span> au moyen d'une classe du même nom défini dans le nouveau fichier <span style="font-weight: bold;">HexCramer.hxx.</span> Notons qu'un test unitaire de la classe Cramer existe dans le fichier test_quads.cxx<br style="font-weight: bold;"><p>Une fois le système résolu ; s'il n'est pas régulier on retourne un vecteur nul, la suite est aisée :</p><ul><li>Création du vertex s_bdf à partir des coordonnées calculées</li><li>Détermination\r
-des sommets opposés s_be, s_bcf, s_adf en utilisant la méthode\r
-Edge::commonVertex (edge) sur les arêtes dèja déterminées.</li><li>Création des 3 arêtes manquantes e_bd, e_bf, e_df</li><li>Création des quadrangles manquants q_b, q_d, q_f.</li><li>Création de l'hexaèdre.</li></ul><p><a name="addHexa4Quads"></a></p><p><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">Création d'un hexaèdre avec quatre quadrangles :&nbsp;</span>&nbsp;</p><ul><li>La classe AnaQuads&nbsp;\r
-détecte trois arêtes communes : appel à addHexaQuadsACDE.&nbsp;La face A sera la première trouvée qui en possède trois,\r
-la face E la suivante à trois arêtes,C et D lles deux autres faces à deux arêtes communes.</li><li>La classe AnaQuads&nbsp; détecte quatre arêtes communes : appel à\r
-addHexaQuadsABCD.&nbsp;Ce\r
-cas est\r
-symétrique chaque face possède deux arêtes. La face A sera la première\r
-de la liste, C et D&nbsp;les deux faces sécantes à A, B la dernière.</li></ul><table style="text-align: left; width: 90%;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="vertical-align: middle; text-align: center;"><p><img src="Quads_ABCD.png" style="width: 282px; height: 226px;" alt="En tunnel"></p></td><td style="vertical-align: middle; text-align: center;"><img src="Quads_ACDE.png" style="width: 278px; height: 223px;" alt="En but"></td></tr><tr><td style="vertical-align: middle;">addHexa2Quads avec 4 quadrangles&nbsp; disposés en tunnel. <br>Fonction : addHexaQuadsABCD</td><td style="vertical-align: middle;">addHexa2Quads avec 4 quadrangles&nbsp;disposés en fauteuil. <br>Fonction : addHexaQuadsACDE</td></tr></tbody></table><p><span style="font-weight: bold;">addHexaQuadABCD</span> :</p><p>Le\r
-rôle des quadrangles passés en&nbsp;arguments est symétrique On nommera q_a\r
-le premier trouvé, q_c le premier qui intersecte q_a, q_c le second et\r
-q_d celui qui n'intersecte pas q_a.</p><p>Tous les sommets et arêtes sont présents. Il suffit de créer les deux quadrangles E et F:</p><p>Les problèmes de détermination des variables se traitent comme dans <span style="font-weight: bold;">addHexaQuadABC</span></p><p><span style="font-weight: bold;">addHexaQuadACDE</span> :</p><p>Le rôle de q_a et qc est symétrique. Ils ont chacun trois arêtes communes avec les autres. q_e et q_f n'en ont que 2.</p><p>Tous les sommets sont présents. Il suffit de créer l'arête e_bf et les deux quadrangles B et F:</p><p>Les edges se déterminent aisément grâce aux indices d'intersection fournis par <span style="font-weight: bold;">AnaQuads</span>. Il suffit<small><small><small><small> </small></small></small></small>de prendre l'opposé. On utilise la propriété de la classe Quad : l'indice d'une arête opposée à l'arête i vaut i+2.</p><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td>&nbsp;&nbsp; int&nbsp;&nbsp; nc_ac = strquads.inter_edge[pos_c][pos_a]; // Nro dans&nbsp; q_c de e_ac<br>&nbsp;&nbsp; int&nbsp;&nbsp; nc_ce = strquads.inter_edge[pos_c][pos_e]; // Nro dans&nbsp; q_c de e_ce<br>&nbsp;&nbsp; int&nbsp;&nbsp; nd_ad = strquads.inter_edge[pos_d][pos_a]; // Nro dans&nbsp; q_d de e_ad<br>&nbsp;&nbsp; int&nbsp;&nbsp; nd_de = strquads.inter_edge[pos_d][pos_e]; // Nro dans&nbsp; q_d de e_de<br>&nbsp;&nbsp; int&nbsp;&nbsp; ne_ae = strquads.inter_edge[pos_e][pos_a]; // Nro dans&nbsp; q_e de e_ae<br><br>&nbsp;&nbsp; Edge* e_af&nbsp; = q_a-&gt;getEdge ((na_ac + 3) MODULO QUAD4);<br>&nbsp;&nbsp; Edge* e_bc&nbsp; = q_c-&gt;getEdge ((nc_ac + 2) MODULO QUAD4);<br>&nbsp;&nbsp; Edge* e_cf&nbsp; = q_c-&gt;getEdge ((nc_ce + 2) MODULO QUAD4);<br>&nbsp;&nbsp; Edge* e_bd&nbsp; = q_d-&gt;getEdge ((nd_ad + 2) MODULO QUAD4);<br>&nbsp;&nbsp; Edge* e_df&nbsp; = q_d-&gt;getEdge ((nd_de + 2) MODULO QUAD4);<br>&nbsp;&nbsp; Edge* e_be&nbsp; = q_e-&gt;getEdge ((ne_ae + 2) MODULO QUAD4);<br><br>&nbsp;&nbsp; Vertex* v_bcf = e_cf-&gt;opposedVertex (e_cf-&gt;commonVertex (e_af));<br>&nbsp;&nbsp; Vertex* v_bdf = e_df-&gt;opposedVertex (e_df-&gt;commonVertex (e_af));</td>\r
-</tr>\r
-</tbody>\r
-</table><p><a name="addHexa5Quads"></a></p><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">Création d'un hexaèdre avec cinq quadrangles :&nbsp;</span> <br><br>Il n'y a pas besoin de dissocier plusieurs cas, le travail est réalisé directement dans la méthode <span style="font-weight: bold;">addHexa5Quads</span>().<br><p style="text-align: center;"><img src="Quads_5.png" style="width: 278px; height: 223px;" alt="En but"></p>Ce cas est assez simple : c'est un hexaèdre auquel il manque la face que l'on convient de nommer B.<br><ul><li>La face q_a est celle qui possède 4 intersections.</li><li>Une\r
-fois son indice qbase déterminé dans AnaQuads, on boucle sur les 4\r
-quadrangles sécants à q_a et on obtient l'arête opposée t_edge[i] et le\r
-quadrangle associé tquad[i]. Les quadrangles q_c, g_d, q_e, q_f se\r
-retrouvent dans le tableau tquad dans un ordre exploitable, le problème\r
-étant symétrique.</li><li>On construit qb à partir des t_edge[i] donnés dans\r
-cet odre :&nbsp; q_b&nbsp; = new Quad (tedge[0], tedge[1], tedge[2],\r
-tedge[3]);</li><li>Enfin l'hexaèdre : hexa = new Hexa (q_a, q_b, tquad[0], tquad[2], tquad[1], tquad[3])</li></ul><p><a href="index.html#DebutPage">Retour au début</a></p><a name="Partie_2.2"></a><p><big><img src="green-ball.gif" style="width: 12px; height: 12px;" alt="o"></big><b><font size="+1"><big> 2.2 Génération d'Hexaèdres par révolution</big></font></b></p><p>Le pont d'entrée dans la classe Document est :<br>\r
-\r
-<span style="font-size: 11pt; font-family: Garamond;"></span>\r
-</p><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">\r
-<tbody>\r
-<tr>\r
-<td>Elements* revolutionQuads (Quads&amp; start, Vertex* center, Vector* axis, vector&lt;double&gt;&amp; angles);<br></td>\r
-</tr>\r
-</tbody>\r
-</table><br>Avec :<br><ul><li><span style="font-weight: bold;">start</span> est la liste des quadrangles de départ. Ils doivent constituer une surface libre. Rappelons que le type <span style="font-weight: bold;">Quads</span> est équivalent à <span style="font-weight: bold;">vector&lt;Quad*&gt;</span></li><li><span style="font-weight: bold;">center</span> et <span style="font-weight: bold;">axis</span> sont respectivement le centre et l'axe de la rotation</li><li>le vecteur <span style="font-weight: bold;">angles</span> définit pour chaque incrément l'angle de la rotation.</li></ul><br><br><br><table style="text-align: left; width: 90%;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="vertical-align: middle; text-align: center;"><p><img src="QuadRevolution1.png" style="width: 282px; height: 226px;" alt="En diedre"></p></td><td style="vertical-align: middle; text-align: center;"><img src="QuadRevolution2.png" style="width: 278px; height: 223px;" alt="Trièdre"></td></tr><tr><td style="vertical-align: middle;">Avant la revolution : on a coloré les quadrangles à déplacer, ainsi que l'axe de rotation.</td><td style="vertical-align: middle;">Résultat de&nbsp; la revolution.</td><td style="vertical-align: middle;"></td></tr></tbody></table><br><p><a href="index.html#DebutPage">Retour au début</a></p><a name="Partie_2.3"></a><p><big><img src="green-ball.gif" style="width: 12px; height: 12px;" alt="o"></big><b><font size="+1"><big> 2.3 Substitution d'Hexaèdres</big></font></b></p><p>Il\r
-s'agit de remplacer un hexaèdre ou des hexaèdres par une autre série\r
-d'hexaaaèdres. Pour pouvoir effectuer ce remplacement, cette autre\r
-série d'hexaèdres doit vérifier des conditions de collage de faces.<br>\r
-\r
-<span style="font-size: 11pt; font-family: Garamond;"></span>\r
-</p><br><br><table style="text-align: left; width: 90%;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="vertical-align: middle; text-align: center;"><p><img src="ReplaceBefore.gif" style="width: 282px; height: 226px;" alt="En diedre"></p></td><td style="vertical-align: middle; text-align: center;"><img src="ReplaceResult.gif" style="width: 278px; height: 223px;" alt="Trièdre"></td></tr><tr><td style="vertical-align: middle; text-align: center;">Exemple\r
-: remplacement des 3 hexaèdres jaunes centraux par 3 fois 5 nouveaux\r
-hexaèdres qui sont construits par extrusion des 5 quadrangles marrons\r
-(le motif).</td><td style="vertical-align: middle; text-align: center;">Résultat du remplacement.&nbsp;</td></tr></tbody></table><br><br>La signature de la fonction est la suivante :<br><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">\r
-<tbody>\r
-<tr>\r
-<td>Elements* Document::revolutionQuads (Hexas&amp; pattern, Vertex* p1,&nbsp;Vertex* c1, <br>&nbsp;\r
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\r
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Vertex*\r
-p2,&nbsp;Vertex* c2,&nbsp;Vertex* p3,&nbsp;Vertex* c3);<br></td>\r
-</tr>\r
-</tbody>\r
-</table><br>Avec :<br><ul><li><span style="font-weight: bold;">pattern </span>est la liste des hexaèdres&nbsp; à extruder.<span style="font-weight: bold;"></span></li><li><span style="font-weight: bold;">c1, c2 </span>et&nbsp;<span style="font-weight: bold;">c3</span>\r
-définissent le quadrangle "cible" QB. Soit QA la face opposée à QB. A\r
-partir de cette face, on définit l'ensemble des n hexaèdres liés par\r
-les faces "opposées" &nbsp;(QAi, QBi).&nbsp;</li><li><span style="font-weight: bold;">p1, p2 </span>et <span style="font-weight: bold;">p3</span> sont les vertices du pattern qui seront associés resperctivement à c1, c2 et c3.&nbsp;&nbsp;</li></ul><p></p><p style="font-weight: bold;"><big>Conditions :&nbsp;</big></p><ul><li>Le pattern doit avoir exactement&nbsp;4 faces latérales externes, que l'on appellera pqc, pqd, pqe, pqf. </li><li>Les\r
-faces"transversales" inférieure et supérieure doivent être\r
-superposables : le motif des quadrangles qui constituent ces faces doit\r
-être identique.</li><li>c1,c2 et c3 sont sur une face externe.</li></ul><p></p><p>Pour désigner les faces d'un hexaèdres, on utilise les&nbsp; <a href="#RappelNotations">notations habituelles</a> définies plus haut.</p><p><big><span style="font-weight: bold;">Conventions et orientations</span></big> : </p><ul><li>Les\r
-3 vertices de départ du pattern définissent deux edges : pe_ac (sens\r
-Ox) et pe_ae (sens oy) et 3 vertices pv_aed, pv_ace, pv_acf.&nbsp;\r
-pv_ace est celui des 3 vertices qui est commun aux deux edges, pv_ade\r
-la première des extrémités. </li><li>Les&nbsp;4 faces latérales externes du pattern sont notées pq_c, pq_d, pq_e, pq_f.</li><li>Les\r
-3 vertices cibles définissent un quadrangle cq_b , deux edges&nbsp;\r
-&nbsp;ce_bc (Ox) et ce_be (Oy) et 3 vertices cv_bed, cv_bce et cv_bcf.&nbsp; Comme pour le pattern.</li></ul><br><p><a href="index.html#DebutPage">Retour au début</a>\r
-</p><hr width="100%">\r
-<p><a name="Partie_3"></a></p>\r
-<p><img src="blue-ball.gif" alt="o" height="12" width="12"><b><font size="+1">\r
-&nbsp;<big>Partie 3 : Bibliothèque de formes</big></font></b></p><p>Cette biblothèque est constituée de quatre nouvelles formes :<br></p><ul><li>La demi-sphère trouée&nbsp;</li><li>Le huitième de sphère trouée</li><li>La demi-écorce trouée</li><li>Le huitième d'écorce trouée&nbsp;</li></ul><p>Ces formes sont implémentées (et traduites ....) de la façon suivante :</p><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">\r
-<tbody>\r
-<tr>\r
-<td><span style="font-family: monospace;">Elements* makeSphere (Vertex* center, </span><span style="font-family: monospace;">Vector* vx, Vector* vz,</span><span style="font-family: monospace;"> <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; double radius,&nbsp;</span><span style="font-family: monospace;">double radhole, </span><span style="font-family: monospace;"><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Vertex*\r
-plorig,&nbsp;</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int\r
-nrad, int nang, int nhaut);</span><span style="font-family: monospace;"></span><span style="font-family: monospace;"></span><br></td>\r
-</tr>\r
-<tr><td><span style="font-family: monospace;">Elements* makePartSphere (Vertex* center, </span><span style="font-family: monospace;"></span><span style="font-family: monospace;">Vector* vx, Vector* vz,</span><span style="font-family: monospace;"> </span><span style="font-family: monospace;"><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;double&nbsp; radius, </span><span style="font-family: monospace;"></span><span style="font-family: monospace;">double radhole</span><span style="font-family: monospace;">,</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vertex*\r
-plorig,&nbsp;</span><span style="font-family: monospace;">double angle,</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int\r
-nrad, int nang, int nhaut);</span></td></tr><tr><td><span style="font-family: monospace;">Elements* makeRind (Vertex* center, </span><span style="font-family: monospace;"></span><span style="font-family: monospace;">Vector* vx, Vector* vz,</span><span style="font-family: monospace;"> </span><span style="font-family: monospace;"><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;double&nbsp; radius, double radint, </span><span style="font-family: monospace;"></span><span style="font-family: monospace;">double radhole</span><span style="font-family: monospace;">,</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vertex*\r
-plorig,&nbsp;</span><span style="font-family: monospace;"></span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int\r
-nrad, int nang, int nhaut);</span></td></tr><tr><td><span style="font-family: monospace;">Elements* makePartRind (Vertex* center, </span><span style="font-family: monospace;"></span><span style="font-family: monospace;">Vector* vx, Vector* vz,</span><span style="font-family: monospace;"> <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-family: monospace;">double&nbsp; radius, double radint, </span><span style="font-family: monospace;"></span><span style="font-family: monospace;">double radhole</span><span style="font-family: monospace;">,</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vertex*\r
-plorig, </span><span style="font-family: monospace;">double angle,</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int\r
-nrad, int nang, int nhaut);</span></td></tr></tbody>\r
-</table><br>Remarques :<br><ul><li>Le plan sécant ne passe pas\r
-forcément par le centre de la sphère. Il définit le demi-espace dans\r
-lequel se situe l'objet à dessiner. Il peut même être disjoint de la\r
-sphère. S'il est "en dessous", la sphère est entièrement dessinée, s'il\r
-est "au dessus", l'objet sera vide.&nbsp;&nbsp;</li></ul><p><big><img src="green-ball.gif" style="width: 12px; height: 12px;" alt="o"></big><b><font size="+1"><big>&nbsp;3.1&nbsp; <span style="font-family: Terminal;"></span> Aspect visuel (exemples)</big></font></b></p><br>Conditions<br><table style="text-align: left; width: 90%;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="vertical-align: middle; text-align: center;"><p><img src="HemiSphere.png" style="width: 282px; height: 226px;" alt="Demi Sphere trouee"></p></td><td style="vertical-align: middle; text-align: center;"><img src="PartSphere.png" style="width: 278px; height: 223px;" alt="Huitième de sphère"></td></tr><tr><td style="vertical-align: middle; text-align: center;">Demi-Sphère trouée (makeSphere ())</td><td style="vertical-align: middle; text-align: center;">Huitième de sphère trouée (makePartSphere ())</td></tr><tr><td style="vertical-align: middle; text-align: center;"><p><img src="Rind.png" style="width: 282px; height: 226px;" alt="Ecorce trouée">&nbsp;&nbsp; &nbsp;</p></td><td style="vertical-align: middle; text-align: center;"><p><img src="PartRind.png" style="width: 282px; height: 226px;" alt="Huitième d'ecorce"> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;</p></td></tr><tr><td style="text-align: center;" valign="middle">Demi écorce trouée (makeRind ())</td><td style="text-align: center;" valign="middle">Huitième d'écorce trouée (makePartRind ())</td></tr></tbody></table><p><big><img src="green-ball.gif" style="width: 12px; height: 12px;" alt="o"></big><b><font size="+1"><big>&nbsp;3.1&nbsp; <span style="font-family: Terminal;"></span> Im</big></font></b><b><font size="+1"><big>plémentation</big></font></b></p><p>Toutes ces fonctions publiques appellent une seule fonction&nbsp; de la classe <span style="font-weight: bold;">Elements :</span></p><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">\r
-<tbody>\r
-\r
-<tr><td><span style="font-family: monospace;">int makeRind (EnumGrid type, Vertex* center, </span><span style="font-family: monospace;"></span><span style="font-family: monospace;">Vector* vx, Vector* vz,</span><span style="font-family: monospace;"> <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-family: monospace;">double&nbsp; radius, double radint, </span><span style="font-family: monospace;"></span><span style="font-family: monospace;">double radhole</span><span style="font-family: monospace;">,</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vertex*\r
-plorig, </span><span style="font-family: monospace;">double angle,</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int\r
-nrad, int nang, int nhaut);</span></td></tr></tbody>\r
-</table><br>Une fonction <span style="font-weight: bold;">controlRind() </span>vérifie\r
-la cohérence des arguments passés en entrée et calcule les deux extrema\r
-de l'angle d'élévation phi (voir chapitre suivant).<br>Une boucle à triple indice sur (nrad, nang, nhaut) calcule les coordonnées des sommets par appel de la fonction <span style="font-weight: bold;">getCylPoint (nx,ny,nz, px,py,pz)</span>.<br>Ce\r
-calcul se fait sur une sphère de centre O et d'axe Oz, dont les\r
-hexaedres sont comptés à partir de l'axe Ox de façon à remplir le\r
-secteur angulaire theta.. Les coordonnées sont ensuite replacées dans\r
-les coordonnes utilisateur grâce à la fonction <span style="font-weight: bold;">transfoVertices</span>(). Edges, quadrangles et hexaèdres sont ensuites assemblés grâce à &nbsp;la fonction <span style="font-weight: bold;">fillGrid</span>().<br><br><p><big><img src="green-ball.gif" style="width: 12px; height: 12px;" alt="o"></big><b><font size="+1"><big>&nbsp;3.2 Détermination de l'angle d'élévation (phi) <span style="font-family: Terminal;"></span>&nbsp;</big></font></b></p>L'angle\r
-d'azimuth theta (longitude) est défini explicitement par l'utilisateur.\r
-L'angle d'élévation phi est délimité par la position du&nbsp; plan\r
-horizontal et par le diamètre du trou. &nbsp;Soit :<br><ul><li>Une sphère de centre O et de rayon R.</li><li>La phère est traversée par un trou cylindrique de rayon r.</li><li>Un plan défini par son vecteur normal n (vertical sur la figure qui suit) et un point A</li></ul><p style="text-align: center;"><img src="Sphere.gif" style="width: 373px; height: 311px;" alt="Sphere"></p>A partir de ces éléments de base, on&nbsp; définit<small><small><small><small><small><small> </small></small></small></small></small></small>:<br><ul><li>Le point H, projection orhogonale du centre O de la sphere sur le plan (A,n)</li><li>L'angle alpha défini par le centre O et le cylindre : sin (alpha) = &nbsp;r/R</li><li>L'angle beta délimité&nbsp; par l'horizontale et l'intersection du plan (A,n) et de la sphère.&nbsp;</li><ul><li>sin (beta) = OH/R</li><li>et OH = OA.n/|n| &nbsp;(produit scalaire de OA par le vecteur unitaire associé à n).</li></ul></ul>L'angle d'élévation&nbsp; phi &nbsp;est encadré par les valeurs suivantes : <ul><li>max (alpha-pi/2, beta) &lt;= phi &lt;= pi/2 - alpha</li></ul><br><p><a href="index.html#DebutPage">Retour au début</a>\r
-</p><hr width="100%">\r
-<p><a name="Partie_4"></a></p>\r
-<p><img src="blue-ball.gif" alt="o" height="12" width="12"><b><font size="+1">\r
-&nbsp;<big>Partie 4 : Evolution des associations</big></font></b></p><p class="MsoNormal">Cette tâche est composée de 3 évolutions, au sujet de\r
-l'association, qui sont décrites ci-après.</p><p><big><img src="green-ball.gif" style="width: 12px; height: 12px;" alt="o"></big><b><font size="+1"><big> 4.1 Nouveaux objets <span style="font-family: Terminal;"></span>&nbsp;</big></font></b></p>\r
-\r
-<p class="MsoNormal">Il s'agissait d'ajouter de nouveaux objets\r
-intermédiaires de travail, comme le vecteur ou le cylindre :</p>\r
-\r
-<ul style="margin-top: 0cm;" type="square"><li class="MsoNormal" style="">le\r
-     cercle défini par&nbsp;un\r
-      centre, un\r
-      rayon et une\r
-      normale,</li><li class="MsoNormal" style="">la\r
-     sphère définie par&nbsp;un\r
-      centre et&nbsp;un\r
-      rayon.<br></li></ul>Il était p aussi&nbsp;associer&nbsp;\r
-les objets intermédiaires aux objets géométriques venant du\r
-composant GEOM de SALOME :<br><ul style="margin-top: 0cm;" type="square"><li class="MsoNormal" style="">un\r
-     cercle,</li><li class="MsoNormal" style="">une\r
-     sphère,</li><li class="MsoNormal" style="">un\r
-     cylindre.</li></ul> <p><big><img src="green-ball.gif" style="width: 12px; height: 12px;" alt="o"></big><b><font size="+1"><big> 4.2 Associations prédéfinies <span style="font-family: Terminal;"></span>&nbsp;</big></font></b></p><p class="MsoNormal">La deuxième évolution consiste à améliorer les associations\r
-des modèles de blocs prédéfinis en calculant automatiquement des associations\r
-implicites, les fonctions concernées sont les suivantes:</p>\r
-\r
-<ul style="margin-top: 0cm;" type="square"><li class="MsoNormal" style="">ajouter\r
-     une grille cylindrique .</li><li class="MsoNormal" style="">ajouter\r
-     une grille sphérique.</li><li class="MsoNormal" style="">ajouter\r
-     un cylindre, un tuyau.</li><li class="MsoNormal" style="">ajouter\r
-     l&#8217;intersection de 2 cylindres ou de 2 tuyaux.</li><li class="MsoNormal" style="">faire\r
-     de même pour toutes les nouvelles fonctions : ecorces et portions de sphères.</li></ul>\r
-\r
-<p class="MsoNormal">Pour chaque arête (sphérique) concernée, on associera un arc de cercle.</p><p class="MsoNormal">Il est inutile d'associer les faces, SMESH est capable de mailler si les arêtes sont associées.</p><p class="MsoNormal"><big><span style="font-weight: bold;">Implémentation</span></big>&nbsp;</p><p class="MsoNormal">Rappelons que l'objet&nbsp;Shape de HexaBlock est constitué :</p><ul><li>D'une chaine de caractère (b_rep) qui permet de décrire toute forme de GEOM</li><li>De deux paramètres <span style="font-style: italic;">debut</span> et <span style="font-style: italic;">fin</span> compris entre 0 et 1 permettant de délimiter la ligne décrite par la b-rep quand c'en est une</li></ul><p class="MsoNormal">Deux opérations sont nécessaires&nbsp; :</p><ol><li>&nbsp;créer un cercle au moyen de GEOM,</li><li>découper ce cercle en arcs de cercle qui seront associés aux arêtes concernées.</li></ol><p class="MsoNormal"><span style="font-weight: bold;">Opération 1 </span>:\r
-Le cercle à créer est en fait un arc de cercle orienté de 360\r
-degrés.&nbsp; Il est en effet nécessaire de définir une origine. GEOM\r
-permet de&nbsp;générer finir un tel\r
-cercle, à partir duquel HexaBlock définira des arcs au moyen des\r
-paramètres <span style="font-style: italic;">debut</span> et <span style="font-style: italic;">fin</span> des shapes :</p><p class="MsoNormal">Cette action est assurée par la fonction <span style="font-weight: bold;">geom_create_circle</span>\r
-qui génère la brep du cercle à partir de son&nbsp;centre, de son rayon,\r
-de son vecteur normal, du&nbsp; vecteur Ox qui permet de définir son\r
-origine.</p><br><span style="font-weight: bold;"></span><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">\r
-<tbody>\r
-\r
-<tr><td><span style="font-family: monospace;"></span><span style="font-family: monospace;"></span><span style="font-family: monospace;">void <span style="font-weight: bold;">geom_create_circle</span> (double* centre, double rayon, Vector* normale,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r
-double* ox, string&amp; brep)<br>{<br>&nbsp;&nbsp; gp_Pnt gp_center (centre [dir_x], centre [dir_y], centre [dir_z]);<br>&nbsp;&nbsp;\r
-gp_Vec gp_ox&nbsp;&nbsp;&nbsp;&nbsp; (ox&nbsp;&nbsp;&nbsp;&nbsp;\r
-[dir_x], ox&nbsp;&nbsp;&nbsp;&nbsp; [dir_y], ox&nbsp;&nbsp;&nbsp;&nbsp;\r
-[dir_z]);<br>&nbsp;&nbsp; gp_Vec gp_norm&nbsp;&nbsp; (normale-&gt;getDx(), normale-&gt;getDy(), normale-&gt;getDz());<br><br>&nbsp;&nbsp; <span style="font-weight: bold;">gp_Ax2</span>&nbsp; gp_axes (gp_center, gp_norm, gp_ox);<br>&nbsp;&nbsp; <span style="font-weight: bold;">gp_Circ</span> gp_circ (gp_axes,&nbsp;&nbsp; rayon);<br><br>&nbsp;&nbsp; TopoDS_Edge&nbsp;&nbsp;&nbsp; geom_circ = <span style="font-weight: bold;">BRepBuilderAPI_MakeEdge</span>(gp_circ).Edge();<br>&nbsp;&nbsp; ostringstream&nbsp; stream_shape;<br>&nbsp;&nbsp; <span style="font-weight: bold;">BRepTools::Write</span>(geom_circ, stream_shape);<br><br>&nbsp;&nbsp; brep = stream_shape.str();<br>}</span><span style="font-family: monospace;"></span></td></tr></tbody>\r
-</table><br>GEOM permet de définir un tel cercle (calsse <span style="font-style: italic;">gp_Circ</span>)&nbsp; à partir d'un systemes d'axes 2D (classe <span style="font-style: italic;">gp_Ax2</span> ) &nbsp;et d'un rayon. Ce cercle esr ensuite transformé en forme&nbsp;<span style="font-style: italic;">TopoDS_Shape</span> qui est l'objet GEOM que l'on maniplule habituellement losque l'on procède aux associations. Plus précisément en <span style="font-style: italic;">TopoDS_Edge</span> &nbsp;au moyen de&nbsp;<span style="font-style: italic;">BRepBuilderAPI_MakeEdge</span><span style="font-family: monospace;"></span>. Enfin l'objet est&nbsp; transformé en chaine de caractères de format Brep via <span style="font-style: italic;">ostringstream</span>.<br><br><span style="font-weight: bold;">Opération 2 </span>:\r
-On dispose d'une b-rep&nbsp; décrivant un arc de cercle de 360 degrés.\r
-Il est aisé de définir proportionnellement pour chacun des edges\r
-constituant la ligne associée à la portion de cercle les paramètres\r
-début et fin par rapport aux angles de départ et d'arrivée de chaque\r
-arc. Cette opération fut d'ailleurs réalisée lors de la préservarion\r
-des associations lors d'un "cut". On réutilisera donc la fonction <span style="font-style: italic;">Elements::cutAssociation(...) </span>moyennant quelques aménagements.<br><p class="MsoNormal"></p><p><big><img src="green-ball.gif" style="width: 12px; height: 12px;" alt="o"></big><b><font size="+1"><big> 4.3&nbsp;Propagation des associations <span style="font-family: Terminal;"></span>&nbsp;</big></font></b></p><p class="MsoNormal"><br>La troisième évolution consiste à améliorer la propagation\r
-automatique des associations, les fonctions concernées sont les suivantes:</p>\r
-\r
-<ul style="margin-top: 0cm;" type="disc"><li class="MsoNormal" style="">fusionner\r
-     ou déconnecter des sommets, des arêtes, des quadrangles :</li><ul style="margin-top: 0cm;" type="circle"><li class="MsoNormal" style="">s&#8217;il\r
-      y a des associations, ne pas les perdre,</li></ul><li class="MsoNormal" style="">prismer\r
-     un ou des quadrangles :</li><ul style="margin-top: 0cm;" type="circle"><li class="MsoNormal" style="">s&#8217;il\r
-      y a des associations dans la direction de l&#8217;extrusion, les propager,</li></ul><li class="MsoNormal" style="">ajouter\r
-     des hexaèdres par translation, par rotation, par homothétie ou par\r
-     symétries :</li><ul style="margin-top: 0cm;" type="circle"><li class="MsoNormal" style="">si\r
-      les hexaèdres sources ont une association, alors les propager,</li></ul><li class="MsoNormal" style="">faire\r
-     de même pour la fonction «révolution» du lot 2.</li></ul>\r
-\r
-<p class="MsoNormal"><o:p></o:p></p>\r
-\r
-<p class="MsoNormal">Ces trois évolutions seront implémentées dans le moteur.\r
-Seule le première évolution (création de sphères ou cercles) sera implémentée\r
-dans la partie interactive. </p><br><br><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight: bold;">Implémentation :</span><br><br><br>En\r
-ce qui concerne les associations propagées par les transformations, la\r
-fonction de base de l'implémentation est transfo_brep. <br>Cette fonction reprend la matrice du modèle de blocs et l'applique à la shape décrite par la brep.<br><br><table style="text-align: left; margin-left: auto; margin-right: auto; width: 859px; height: 65px;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="width: 80%;"><span style="font-family: monospace;">// ====================================================== transfo_brep<br>void transfo_brep (string&amp; brep, Matrix* matrice, string&amp; trep)<br>{<br>&nbsp;&nbsp; BRep_Builder&nbsp; builder;<br>&nbsp;&nbsp; TopoDS_Shape&nbsp; shape_orig;<br>&nbsp;&nbsp; ostringstream stream_shape;<br>&nbsp;&nbsp; gp_Trsf&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; transfo;<br><br>&nbsp;&nbsp;\r
-double&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r
-a11,a12,a13,a14, a21,a22,a23,a24, a31,a32,a33,a34;<br>&nbsp;&nbsp; matrice-&gt;getCoeff (a11,a12,a13,a14, a21,a22,a23,a24, a31,a32,a33,a34);<br>&nbsp;&nbsp; transfo.SetValues (a11,a12,a13,a14, a21,a22,a23,a24, a31,a32,a33,a34, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r
-Epsil2, Epsil2);<br><br>&nbsp;&nbsp; istringstream stream_brep (brep);<br>&nbsp;&nbsp; BRepTools::Read&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (shape_orig, stream_brep, builder);<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; BRepBuilderAPI_Transform brep_transfo (shape_orig, transfo, Standard_True);<br>&nbsp;&nbsp; TopoDS_Shape result = brep_transfo.Shape();<br><br>&nbsp;&nbsp; BRepTools::Write (result, stream_shape);<br>&nbsp;&nbsp; trep = stream_shape.str();<br>}<br></span><span style="font-family: monospace;"></span></td></tr></tbody></table><br><br>Pour la fonction de prismQuads, on utilise une variante simplifiée : <br><br><table style="text-align: left; margin-left: auto; margin-right: auto; width: 859px; height: 65px;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="width: 80%;"><span style="font-family: monospace;">// ====================================================== translate_brep<br>void translate_brep (string&amp; brep, double dir[], string&amp; trep)<br>{<br>&nbsp;&nbsp; gp_Trsf&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; transfo;<br>&nbsp;&nbsp; BRep_Builder&nbsp; builder;<br>&nbsp;&nbsp; TopoDS_Shape&nbsp; orig;<br>&nbsp;&nbsp; ostringstream stream_shape;<br><br>&nbsp;&nbsp;\r
-gp_Vec&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r
-vecteur&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (dir [dir_x], dir [dir_y],\r
-dir [dir_z]);<br>&nbsp;&nbsp; transfo.SetTranslation&nbsp;&nbsp;&nbsp; (vecteur);<br>&nbsp;&nbsp; istringstream stream_brep (brep);<br>&nbsp;&nbsp; BRepTools::Read&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (orig, stream_brep, builder);<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; TopLoc_Location&nbsp; loc_orig&nbsp;&nbsp; = orig.Location();<br>&nbsp;&nbsp; gp_Trsf&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; trans_orig = loc_orig.Transformation();<br>&nbsp;&nbsp; TopLoc_Location&nbsp; loc_result (transfo * trans_orig);<br>&nbsp;&nbsp; TopoDS_Shape&nbsp;&nbsp;&nbsp;&nbsp; result = orig.Located (loc_result);<br><br>&nbsp;&nbsp; BRepTools::Write (result, stream_shape);<br>&nbsp;&nbsp; trep = stream_shape.str();<br>}<br></span><span style="font-family: monospace;"></span></td></tr></tbody></table><br><br>Pour la fonction de prismQuads, on utilise une variante simplifiée : <br><br><br><br><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight: bold;">Propagation des associations pour les transformations :</span><span style="font-weight: bold;"></span><br><br><br>L'exemple donné est makeScale <br><br><table style="text-align: left; margin-left: auto; margin-right: auto; width: 859px; height: 65px;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="width: 80%;"><span style="font-family: monospace;"># ======================================================= make_grid</span><br style="font-family: monospace;"><span style="font-family: monospace;">def make_grid (doc) :</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; ori&nbsp; = doc.addVertex ( 0, 0, 0)</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; vz&nbsp;&nbsp; = doc.addVector ( 0, 0, 1)</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; vx&nbsp;&nbsp; = doc.addVector ( 1 ,0, 0)</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; dr = 1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; da = 360</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; dl = 1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; nr = 1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; na = 6</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; nl = 1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; grid = doc.makeCylindrical (ori, vx,vz, dr,da,dl, nr,na,nl, False)</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; return grid</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"># ======================================================= test_scale</span><br style="font-family: monospace;"><span style="font-family: monospace;">def test_scale () :</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; doc&nbsp; = hexablock.addDocument()</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; grid = make_grid (doc)</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; dest&nbsp;&nbsp; = doc.addVertex (15, 0, 0)</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; grid2&nbsp; = doc.makeScale (grid, dest, 0.5)</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; return doc</span></td></tr></tbody></table><br><br><table style="width: 859px; height: 65px; text-align: left; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="width: 80%;"><img style="width: 701px; height: 568px;" alt="transfo" src="transfo.png"></td></tr></tbody></table><br><br><br><br><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight: bold;">Propagation des associations pour la fonction prism</span><span style="font-weight: bold;">Quads</span><br><br>Pour la fonction prismQuads :<br><br><br><table style="text-align: left; margin-left: auto; margin-right: auto; width: 737px; height: 297px;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="width: 80%;"><span style="font-family: monospace;"># ========================================================== test_prism</span><br style="font-family: monospace;"><span style="font-family: monospace;">def test_prism () :</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; doc&nbsp; = hexablock.addDocument()</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; nr = 1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; na = 6</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; nl = 1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; grid = make_grid (doc, nr, na, nl)</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; liste = [ ]</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; for nx in range (nr) :</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for ny in range (na) :</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cell = grid.getQuadIJ (nx, ny, nl)</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; liste.append (cell);</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; axis = doc.addVector (1, 1, 1);</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; bloc = doc.prismQuads&nbsp; (liste, axis, 3)</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; return doc</span></td></tr></tbody></table><br><br><span style="font-weight: bold;"></span><table style="text-align: left; margin-left: auto; margin-right: auto; font-family: monospace; width: 909px; height: 535px;" border="1" cellpadding="2" cellspacing="2">\r
-<tbody>\r
-\r
-<tr><td><span style="font-family: monospace;"></span><span style="font-family: monospace;"></span><span style="font-family: monospace;"><br><br><br><br><br></span><div style="text-align: center;"><span style="font-family: monospace;"><img style="width: 498px; height: 403px;" alt="Prisme" src="prism.png"></span><br><span style="font-family: monospace;"></span></div><span style="font-family: monospace;"><br><br><br></span><span style="font-family: monospace;"></span></td></tr></tbody>\r
-</table><br><br><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">Propagation des associations pour la fonction revolutionQuads</span><br><br>Pour la fonction revolutionQuads <br><br><br><table style="text-align: left; margin-left: auto; margin-right: auto; width: 737px; height: 297px;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="width: 80%;"><span style="font-family: monospace;"># ========================================================== test_revolution<br>def test_revolution () :<br>&nbsp;&nbsp;&nbsp; doc&nbsp; = hexablock.addDocument()<br>&nbsp;&nbsp;&nbsp; nr = 1<br>&nbsp;&nbsp;&nbsp; na = 6<br>&nbsp;&nbsp;&nbsp; nl = 1<br>&nbsp;&nbsp;&nbsp; grid = make_grid (doc, nr, na, nl)<br><br>&nbsp;&nbsp;&nbsp; liste = [ ]<br>&nbsp;&nbsp;&nbsp; for nx in range (nr) :<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for ny in range (na) :<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cell = grid.getQuadIJ (nx, ny, nl)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print " ... cell = ", cell<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; liste.append (cell);<br></span>ss<br><br><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; center = doc.addVertex (0, -10, 0);<br>&nbsp;&nbsp;&nbsp; axis&nbsp;&nbsp; = doc.addVector (1, 0, 0);<br>&nbsp;&nbsp;&nbsp; angles = [5, 10, 15, 20, 30, 20, 15, 10, 5 ]<br></span>ss<br><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; bloc = doc.revolutionQuads&nbsp; (liste, center, axis, angles);<br>&nbsp;&nbsp;&nbsp; return doc<br></span><span style="font-family: monospace;"></span></td></tr></tbody></table><br><br><table style="width: 734px; height: 484px; text-align: left; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="width: 80%;"><img style="width: 474px; height: 383px;" alt="Macaroni" src="macaroni.png" align="middle"></td></tr></tbody></table><br><p><a href="index.html#DebutPage">Retour au début</a></p>\r
-<hr width="100%">\r
-<p><br></p><br><p><br>\r
-&nbsp;\r
-<br>\r
-&nbsp;\r
-<br>\r
-&nbsp;\r
-<br>\r
-&nbsp;\r
-<br>\r
-&nbsp;\r
-</p>\r
+<html><head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta name="Generator" content="Microsoft Word 97">
+<meta name="GENERATOR" content="Mozilla/4.7 [fr] (WinNT; I) [Netscape]">
+<meta name="Author" content="Alain Buhsing">
+<meta name="Classification" content="Logiciel scientifique.">
+<meta name="Description" content="Description du logiciel Moïra">
+<meta name="KeyWords" content="Environnement de développement, Logiciel scientifique"><title>Projet HEXABLOCK</title></head>
+<body>
+&nbsp;
+<table cols="2" width="100%">
+<tbody>
+<tr>
+<td><img src="logo-cs.gif" alt="Simply Moira" style="width: 145px; height: 84px;"></td>
+<td>&nbsp;</td>
+</tr>
+</tbody>
+</table>
+<center><a name="DebutPage"></a>
+<br>
+<big><big><b><font size="+3"><big><big>HexaBlock</big></big></font></b></big></big><b><font size="+3"><br>
+<br>
+<small>Bibliothèque de formes</small><br><small><small><br>Documentation interne du moteur</small></small><br>
+</font></b></center>
+<blockquote><i><span style="font-weight: bold;"></span><br>
+Ce document constitue la documentation interne du composant HEXABLOCK.<br>Ce
+document fait partie des sources du projet et&nbsp;est géré en
+configuration Pour le mettre à jour, utiliser kompozer, disponible sur
+Linux<br>
+<br>
+</i></blockquote>
+<hr width="100%">
+<p><img src="blue-ball.gif" alt="o" height="12" width="12"><b> Table of contents :</b>
+<br>
+&nbsp;
+</p>
+<center>
+<table style="width: 677px; height: 108px;">
+<tbody>
+<tr>
+<td>
+<dt><img src="green-ball.gif" alt="o" height="12" width="12"> &nbsp; <a href="#Partie_1">Partie&nbsp;1 : Prévisualisation des éléments créés</a></dt>
+</td>
+</tr>
+<tr>
+<td>
+<dt><img src="green-ball.gif" alt="o" height="12" width="12"> &nbsp;&nbsp;<a href="#Partie_2">Partie 2 : Nouvelles fonctions de construction</a></dt><ul><li><a href="#Partie_2">Création d'hexaèdres</a></li><li><a href="#Partie_2.2">Génération d'hexaèdres par révolution</a></li><li><a href="#Partie_2.3">Substitution d'hexaèdres</a></li></ul>
+</td>
+</tr>
+<tr>
+<td><img src="green-ball.gif" alt="o" height="12" width="12"> &nbsp; <a href="#Partie_3">Partie 3 : Bibliothèques de formes</a></td>
+</tr>
+
+
+<tr><td><img src="green-ball.gif" alt="o" height="12" width="12"> &nbsp; <a href="#Partie_4">Partie 4 : Evolution des associations</a></td></tr></tbody>
+</table>
+</center>
+<p><img src="blue-ball.gif" alt="o" height="12" width="12"><b> See also :</b></p><center>
+<table style="width: 677px; height: 60px;">
+<tbody>
+<tr>
+<td>
+<dt><img src="green-ball.gif" alt="o" height="12" width="12"> &nbsp;&nbsp;<a href="LastNews.html"><span style="text-decoration: underline;">Last news</span></a></dt>
+</td>
+</tr>
+<tr><td><img src="green-ball.gif" alt="o" height="12" width="12"> &nbsp; Last last News : Voir les <a href="#Partie_3">nouvelles formes </a><br> </td></tr><tr><td><img src="green-ball.gif" alt="o" height="12" width="12"> &nbsp; Précisions sur las <a href="AssoLines.html">associations par lignes</a></td></tr><tr>
+<td>
+<dt><img src="green-ball.gif" alt="o" height="12" width="12"> &nbsp;&nbsp;<a href="Questions.html"><span style="text-decoration: underline;">Frequently asked questions</span></a></dt>
+</td>
+</tr><tr><td><img src="green-ball.gif" alt="o" height="12" width="12"> &nbsp;&nbsp;<a href="Bugs.html">Maintenance</a></td></tr>
+
+
+
+</tbody>
+</table>
+</center>
+<p></p>
+<hr width="100%">
+<p><a name="Partie_1"></a></p>
+<p><big><img src="blue-ball.gif" alt="o" height="12" width="12"><b><font size="+1"><big> Partie 1 : prévisualisation des éléments créés</big></font></b></big></p>Pour
+que SALOME puisse prévisualiser le "document" en cours de modivication,
+il est nécessaire&nbsp;de créer une copie de l'original. L'évolution
+majeure du moteur &nbsp;consiste à implémenter une fonction de
+copie.&nbsp; <br><br>Ce qui revient à ajouter dans la classe Document la méthode suivante :<br><br>
+<table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">
+<tbody>
+<tr>
+<td>Document* copyDocument ();
+</td>
+</tr>
+</tbody>
+</table>
+<br>La valeur rendue est le document copié.<br>Les éléments copiés sont les éléments
+intrinsèques du document : vertices, edges, quadrangles, hexaèdres,
+lois. Qui sont aussi ceux sauvegardés dans un texte XML. On ne stocke
+pas les éléments intermédiaires de construction (grilles, vecteurs,
+etc...).<br><br>Cette rège pourra être remise en cause si l'application interactive a besoin d'autres informations.<br><br>La copie se déroule ainsi :<br><ul><li>Chaque élément dispose d'un champ (nommé <span style="font-weight: bold;">clone</span>) qui permet de mémoriser l'adresse du dernier élément copié à partir de cet élément dans le cadre de la copie de document.</li><li>Copier&nbsp;les
+éléments de bas niveau (les vertices) : méthode&nbsp;<span style="font-weight: bold;">Vertex::duplicate(Document* cible)</span>. Cette méthode ne rend pas de pointeur ; elle crée un clone du sommet courant et le mémorise sur le champ <span style="font-weight: bold;">clone</span> de la classe <span style="font-weight: bold;">Vertex</span>.</li><li>Copier&nbsp; les éléments présents de plus haut niveau dans l'ordre (edges, quads, hexas) : méthode virtuelle <span style="font-weight: bold;">EltBase::duplicate ()</span></li><ul><li>Si
+un élément utilise n éléments de plus bas niveau, sa copie utilise les
+copies des éléments utilisés. Il est aisé de retrouver la copie car on
+en a stocké l'adresse.</li><li>Détail
+: la méthode duplicate n'a pas besoin d'argument de type Document* elle
+reprend le document cible des éléments de plus bas niveau..</li></ul><li>Copier les lois</li></ul>Les associations sont copiées lors de la copie de chaque élément.<br><br><br>
+<a href="#DebutPage">Retour au début</a>
+<hr width="100%">
+<p><a name="Partie_2"></a></p>
+<p><big><img src="blue-ball.gif" alt="o" height="12" width="12"></big><b><font size="+1"><big>
+&nbsp;Partie 2 : Nouvelles fonctions de construction</big></font></b></p><p><big><img src="green-ball.gif" style="width: 12px; height: 12px;" alt="o"></big><b><font size="+1"><big> 2.1 Création d'Hexaèdres</big></font></b></p>
+<p class="MsoNormal" style="text-align: left;" align="left">Il s'agit de construire un hexaèdre à partir de quadrangles déjà créés dans le
+modèle de blocs. Cet hexaèdre est produit à partir des 4 cas suivants :</p>
+
+<ul style="margin-top: 0cm;" type="disc"><li class="MsoNormal" style="text-align: left;">à partir de 2 quadrangles reliés ou pas,</li><li class="MsoNormal" style="text-align: left;">à partir de 3 quadrangles tous reliés,</li><li class="MsoNormal" style="text-align: left;">à partir de 4 quadrangles tous reliés,</li><li class="MsoNormal" style="text-align: left;">à partir de 5 quadrangles tous reliés.</li></ul>Les points d'entrée sont naturellement :<br><br>
+
+<span style="font-size: 11pt; font-family: Garamond;"></span>
+<table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">
+<tbody>
+<tr>
+<td>Hexa* <a href="#addHexa2Quads">addHexa2Quads</a> (Quad* q1,&nbsp;Quad* q2);<br>Hexa* <a href="#addHexa3Quads">addHexa3Quads</a> (Quad* q1,&nbsp;Quad* q2, Quad* q3);<br>Hexa* <a href="#addHexa4Quads">addHexa4Quads</a> (Quad* q1,&nbsp;Quad* q2, Quad* q3,&nbsp;Quad* q4);<br>Hexa* <a href="#addHexa5Quads">addHexa5Quads</a> (Quad* q1,&nbsp;Quad* q2, Quad* q3,&nbsp;Quad* q4,&nbsp;Quad* q5);</td>
+</tr>
+</tbody>
+</table><p>Chacun des cas amène une discussion. La démarche est la suivante :&nbsp;</p><ul><li>Les quadrangles passés en argument dans un ordre quelconque.</li><li>Un
+analyseur d'intersections (classe&nbsp;<span style="font-weight: bold;">AnaQuads</span>,
+définie dans
+HexAnaQuads.hxx) détermine les arêtes communes aux n quadrangles passés
+en argument. et mémorise ces informations qui seront transmises aux
+fonctions internes, afin de ne pas répêter ces calculs d'intersection.</li><li>En fonction du nombre d'arêtes communes à chaque quadrangle, on se ramène à 7 cas.&nbsp;</li><li>Si le nombre d'arêtes communes est insuffisant, le cas est rejeté.</li><li>On nomme ces cas en se servant de la nomenclature des faces dans le projet : (A, B, C, D, E,F)</li></ul>Remarques :<br><ul><li>Les quadrangles passés en arguments sont considérés comme planaires, il n'y a pas de contrôle d'arguments en entrée à ce niveau</li><li>Ils
+sont sensés générer des quadrangles planaires et non croisés. Par
+exemple pour addHexaQuadsACD() : il n'y a pas de contrôle de planéité
+de la face B.&nbsp;</li></ul><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">Rappel&nbsp; :&nbsp; formalisation des Hexaèdres/Quadrangles/Vertex</span><br><br><a name="RappelNotations"></a><br>Pour rappel :<br><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">
+<tbody>
+<tr>
+<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; z=0&nbsp;&nbsp; z=1&nbsp;&nbsp;
+y=0&nbsp;&nbsp; y=1&nbsp;&nbsp; x=0&nbsp; x=1<br>enum EnumHQuad&nbsp;&nbsp; {Q_A,&nbsp; Q_B,&nbsp; Q_C,&nbsp; Q_D,&nbsp; Q_E, Q_F,&nbsp; HQ_MAXI};<br></td>
+</tr>
+</tbody>
+</table><br>La face A est opposée à B, C est opposée à D, E à F. La
+position des faces&nbsp; A, C, E normales à Oz, Oy, Ox est purement
+théorique. Elle améliore la visualisation. Les orientations sont en
+fait&nbsp; interchangeables. On peut intervertir les couples (C,D) et
+(E,F), on peut intervertir A et B, C et D, E et F, l'essentiel est
+d'avoir une cohérence&nbsp; avec les autres dénominations d'edges (ac,
+af, ad ...) ou de&nbsp;sommets (ace, acf, adf ...) &nbsp;et les
+conventions de départ.<br><br>L'arête située la face X et la face Y est notée xy. Un sommet situé entre les 3 faces X, Y Z est noté xyz :<br><br><table style="font-family: monospace; width: 500px; text-align: left; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="width: 50%;"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6=bde&nbsp; +----bd-----+ bdf=7<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+/|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /|<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; be |&nbsp;&nbsp; <span style="font-weight: bold;">B</span>&nbsp;&nbsp;&nbsp; bf |<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&nbsp; |<br>&nbsp;&nbsp;&nbsp; 4=bce +----bc-----+...|...bcf=5<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; de&nbsp;&nbsp;&nbsp;&nbsp; <big style="font-weight: bold;">D</big> |&nbsp;&nbsp; df<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+| <span style="font-weight: bold;">E</span> |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | F
+|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+z<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ce&nbsp;&nbsp; |
+<span style="font-weight: bold;">C&nbsp;</span>&nbsp;&nbsp;&nbsp; cf&nbsp;
+|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+^<br>&nbsp; 2=ade...|...+----ad-|---+ adf=3&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp; y<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+|&nbsp; /&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;
+/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+|&nbsp; /<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
+ae&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">A</span>&nbsp;&nbsp; |
+af&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+| /<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+|/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+|/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+|/<br>&nbsp;&nbsp;&nbsp; 0=ace +----ac-----+ acf=1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +-----&gt;&nbsp;x<br>&nbsp;&nbsp; <br><br></td>
+</tr>
+</tbody>
+</table><br><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">La classe AnaQuads</span><br><br>Cette
+classe analyse les relations topologiques existant entre plusieurs
+quandrangles. Un objet de ce type est créé au début de chaque fonction
+addHexaXQuads.<br><br>Le constructeur est :<br><br>
+
+<span style="font-size: 11pt; font-family: Garamond;"></span>
+<table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">
+<tbody>
+<tr>
+<td>AnaQuads (Quad* q1, Quad* q2, Quad* q3=NULL, Quad* q4=NULL, Quad* q5=NULL);<br></td>
+</tr>
+</tbody>
+</table><br>Les champs affectés lors de la construction de l'objet :<br><br><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td>MawQuads </td><td>Constante égale à 5 5</td></tr><tr><td>int&nbsp;&nbsp;&nbsp; nbr_quads;</td><td>Nombre de quadrangles</td></tr><tr><td>int&nbsp;&nbsp;&nbsp; nbr_aretes;</td><td>Nombre total d'arêtes</td></tr><tr><td>Quad*&nbsp; tab_quads&nbsp; [i];</td><td>Le ième quadrangle passé en argument </td></tr><tr><td>int&nbsp;&nbsp;&nbsp; inter_nbre [i];</td><td>Nombre d'intersections du ième quadrangle</td></tr><tr><td>int&nbsp;&nbsp;&nbsp; inter_edge [i][j];</td><td>Nro d'arête de i intersectant le jème quadrangle</td></tr><tr><td>int&nbsp;&nbsp;&nbsp; inter_quad [i][j];</td><td>Nro de quadrangle présent sur la jème arete du iéme quad</td></tr></tbody></table><br><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">La classe Cramer</span><br><br>Cette
+classe résout un système linéaire de n équations &nbsp;à n inconnues.
+Quand n est "petit", n&lt;10. Peut être réutilisée sur un autre projet.
+<br>Implémentation : HexCramer.hxx.<br>Test unitaire : test_cramer dans test_hexa1.cxx<br><br><br>
+
+<span style="font-size: 11pt; font-family: Garamond;"></span>
+<table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">
+<tbody>
+<tr>
+<td>int test_cramer (int nbargs, cpchar tabargs[])<br>{<br>&nbsp;&nbsp; double matrice [] = { 2, 7, 1,&nbsp; &nbsp; 0, 3, 0,&nbsp; &nbsp; 1, 9, 5 };<br>&nbsp;&nbsp; double second_membre&nbsp; [] = { 1, 1, 1 };<br>&nbsp;&nbsp; Hex::Real3&nbsp; solution;<br>&nbsp;&nbsp; <span style="font-weight: bold;">Hex::Cramer system(3)</span>; &nbsp; // On dimensionne le système de Cramer à la construction<br><br>&nbsp;&nbsp; int ier = <span style="font-weight: bold;">system.resoudre</span> (matrice, second_membre, solution);<br><br>&nbsp;&nbsp;
+cout &lt;&lt; " Solution&nbsp; = (" &lt;&lt; solution[0] &lt;&lt; ", "
+&lt;&lt; solution[1] &lt;&lt; ", " &lt;&lt; solution[2] <br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&lt;&lt; "), ier = " &lt;&lt; ier &lt;&lt; endl;<br>&nbsp;
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Pour vérifier : <br>&nbsp;&nbsp; Hex::Real3 produit;<br>&nbsp;&nbsp; <span style="font-weight: bold;">system.multiply</span> (solution, produit);<br>&nbsp;&nbsp;
+cout &lt;&lt; " Produit&nbsp;= (" &lt;&lt; produit[0] &lt;&lt; ", "
+&lt;&lt; produit[1] &lt;&lt; ", " &lt;&lt; produit[2] <br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&lt;&lt; ")" &nbsp;&lt;&lt; endl;<br>&nbsp;&nbsp; return HOK;<br>}<br></td>
+</tr>
+</tbody>
+</table><br><br><br><a name="addHexa2Quads"></a><br><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">Création d'un hexaèdre avec deux quadrangles :&nbsp;</span>&nbsp;<ul><li>La classe AnaQuads ne détecte aucune arête commune : appel à addHexaQuadsAB</li><li>La classe AnaQuads&nbsp; détecte&nbsp;une arête commune : appel à addHexaQuadsAC</li></ul><table style="text-align: left; width: 90%;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="vertical-align: middle; text-align: center;"><p><img src="Quads_AB.png" style="width: 282px; height: 226px;" alt="En diedre"></p></td><td style="vertical-align: middle; text-align: center;"><img src="Quads_AC.png" style="width: 278px; height: 223px;" alt="Vis a vis"></td></tr><tr><td style="vertical-align: middle;">addHexa2Quads avec 2 quadrangles&nbsp; non reliés. <br>Fonction : addHexaQuadsAB</td><td style="vertical-align: middle;">addHexa2Quads avec 2 quadrangles&nbsp;&nbsp; reliés. <br>Fonction : addHexaQuadsAC</td></tr></tbody></table><p><span style="font-weight: bold;"></span></p><p><span style="font-weight: bold;">addHexaQuadAB</span> :</p>Les huits sommets sont présents, il manque quatre arêtes verticales ce, cf, df, de.<br>La
+difficuté consiste à faire correspondre deux à deux les quatre sommets
+de chaque quadrangle sans que les arêtes ne se croisent. La situation
+est analogue à <span style="font-weight: bold;">mergeQuads</span> ou <span style="font-weight: bold;">joinQuads</span>, sauf que dans ces cas, on passe
+en argument quatre vertex pour déterminer dans ambiguité les sommets
+correspondants deux à deux. On a choisi ici
+d'automatiser l'association :<br><ul><li>il
+existe huit combinaisons permettant d'associer deux à deux les 4
+sommets de 2 quadrangles : décalage de 0 à 3 dans un sens puis dans
+l'autre. </li><li>Pour chaque combinaison, on calcule la longueur totale des 4 arêtes créées.</li><li>On retient la combinaison qui mène à une longueur minimale.</li></ul>Une fois la combinaison optimale établie :<br><ul><li>Création
+des 4 arêtes verticales en fonction des combinaisons, stockées dans tu
+tableau tedge[4]. Le premier vertex fourni est celui de la face A. </li><li>Création des 4 quadrangles verticaux.</li><li>Création de l'hexaèdre.</li></ul>Pour créer le&nbsp;i-ème quadrangle vertical : <br><ul><li>l'arête verticale de gauche e_left = tedge[i]</li><li>l'arête verticale de droite e_left = tedge[(i+1) modulo 4]</li><li>l'arête
+horizontale basse s'obtient grâce à la fonction Quad::findEdge (v1,
+v2). On recherche dans le quadrangle A l'arête dont les 2 sommets sont
+les extrémités amont des arêtes e_left et e_right, qui par construction
+appartiennent au quadrangle A.</li><li>idem pour&nbsp; l'arête haute ; sauf que ce sont les extrémités aval.</li></ul> <p><span style="font-weight: bold;">addHexaQuadAC</span> :</p><p>Deux
+faces présentes A et C, une arête commune ac. Il manque deux sommets
+bde et bdf à partir des quels on construit les arêtes manquantes bd,
+be, de, bf, df.&nbsp;<br>On doit s'assurer de ma planéité des quadrangles créés. </p><p>La
+solution n'est pas unique. Il existe une infinité de sommets pouvant
+définir un hexaèdre &nbsp;conforme. On se contente ici d'en choisir une
+et de démontrer que l'objet créé est conforme.&nbsp;</p><p>Le point bde (resp bdf) est construit en
+sommant les vecteurs ac et ce (resp&nbsp;af et cf), ce qui revient à
+définir un parallélogramme. On assure ainsi sa présence dans le plan E
+(resp. F). Les faces créées E et F sont donc planaires.</p><p>Pour démontrer la planéité de la face B :<br></p><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">
+<tbody>
+<tr>
+<td><ol><li>(ae , af)&nbsp; coplanaires (donnée)</li><li>be = ae (construction d'un parallèlogramme)</li><li>df = af &nbsp;(idem)</li><li>(1), (2), (3) =&gt; (be, bf) coplanaires </li></ol></td>
+</tr>
+</tbody>
+</table><br>On procéderait de la même manière pour établir que la face D est plane.<br><br>La fonction s'écrit ainsi :<br><ul><li>q_a est le premier quadrangle fourni, q_c le second</li><li>L'edge e_ac est défini qrâce à la strucrure AnaQuads</li><li>On effectue un calcul analogue aux deux extrémités s (amont et aval) de e_ac :</li><ul><li>vx1 = extrémité étudiée de e_ac, vx2 l'autre</li><li>vxa
+= sommet adjacent de vx1 sur&nbsp; la face A, différent de vx2. Il est
+obtenu en prenant le sommet opposé à vx2 sur la face A. L'indice de vxa
+dans qa vaut vx2+2 modulo 4.</li><li>de même, vxc = sommet adjacent de vx1 sur la face&nbsp; C.</li><li>Calcul des coordonnées&nbsp;et&nbsp; création du vertex tv_bdx[s] (x représente la choix entre e et f).</li><li>Création des deux arêtes manquantes&nbsp;te_bx[s] et te_dx[s]</li><li>Création des du quadrangle latéral tq_ef [s]</li></ul><li>Création de l'arête e_bd à partir dses deux vertices de&nbsp; tv_bdx</li><li>Création
+du quadrangle D à partir de te_dx[], e_ef, te_dx[1] et de l'arête
+opposée à e_ac dans A (fonction Quad::getOpposedEdge(e,n)</li><li>Création du quadrangle B à partir de te_bx[], e_ef, te_bx[1] et de
+l'arête opposée à e_ac dans C (fonction Quad::getOpposedEdge(e,n)</li><li>Création de l'hexaèdre</li></ul><p><a name="addHexa3Quads"></a></p><p><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">Création d'un hexaèdre avec trois quadrangles :&nbsp;</span>&nbsp;</p><ul><li>La
+classe AnaQuads&nbsp; détecte deux arêtes communes : appel à
+addHexaQuadsACD. La face A sera celle qui possède deux arêtes communes,
+la face C la suivante, D la derniére.</li><li>La classe AnaQuads&nbsp;
+détecte trois arêtes communes : appel à addHexaQuadsACE. Ce cas est
+symétrique, la face A sera la première de la liste, C la seconde.</li></ul><p></p><br><table style="text-align: left; width: 90%;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="vertical-align: middle; text-align: center;"><p><img src="Quads_ACD.png" style="width: 282px; height: 226px;" alt="En diedre"></p></td><td style="vertical-align: middle; text-align: center;"><img src="Quads_ACE.png" style="width: 278px; height: 223px;" alt="Trièdre"></td></tr><tr><td style="vertical-align: middle;">addHexa2Quads avec 3 quadrangles&nbsp;disposés en U. <br>Fonction : addHexaQuadsACD</td><td style="vertical-align: middle;">addHexa2Quads avec&nbsp; quadrangles disposés&nbsp; en trièdre<br>Fonction : addHexaQuadsACE</td></tr></tbody></table><p><br></p><p><span style="font-weight: bold;">addHexaQuadACD</span> :</p><p>Tous les sommets sont présents. Il reste à créer :</p><ul><li>Les arêtes be et bf&nbsp;</li><li>Les quadrangles E, B, F en déterminant les arêtes qui les constituent. </li></ul><p>La difficulté est d'identifier clairement les arêtes et les sommets à partir des quadrangles existant :&nbsp;</p><ul><li>q_a est le quadrangle qui possède deux arêtes communes, q_b et q_c les suivants.</li><li>On exploite les indices d'edges communs fournis par <span style="font-weight: bold;">AnaQuads</span>. Rappelons que dans un quadrangle le ième edge est adjacent aux edges i-1 et i+1 et opposé à l'edge i+2.</li><li>e_ac et e_ad sont les intersections de q_a avec q_c et q_d. (nommés ici mais non utilisés dans le programme)</li><li>e_bc est l'arête opposée à e_ac dans q_c,&nbsp;&nbsp;e_bd est l'arête opposée à e_ad dans q_d.</li><li>e_ae
+est l'arête suivante de e_ac dans q_a, e_af &nbsp;l'arête précédente.
+Ce choix arbitraire&nbsp; détermine les autres dénominations.</li><li>e_ce est l'arête adjacente de e_ac dans q_c qui a un sommet commun (v_ace) avec e_ae.</li><li>e_de est l'arête adjacente de e_ac dans q_d qui a un sommet commun (v_ade) avec e_ae.</li><li>v_acf est le sommet commun à e_af et e_cf</li><li>v_adf est le sommet commun à e_af et e_df</li><li>Création de l'arete e_be &nbsp;à paertir de e_bce et v_bde, puis de l'arête e_bf,</li><li>Créations des quadrangles q_b, q_e, q_f</li><li>Création de l'hexaèdre.</li></ul><p></p><p><span style="font-weight: bold;">addHexaQuadACE</span> :</p><p>Il
+est nécessaire de créer le sommet v_bdf. Il est l'intersection des
+plans (B, D, F). Chaque plan est défini par trois points présents sur
+les autres quadrangles :</p><ul><li>Le plan B est défini par les sommets bcd, bce, bcf . Son vecteur normal norm_b est le produit vectoriel&nbsp;de bc par be.</li><li>Le plan D est défini par les sommets adf, ade, adb. Son vecteur normal norm_d&nbsp; est le produit vectoriel&nbsp;de ac par ae.</li><li>Le
+plan F est défini par les sommets adf, acf, bcf.&nbsp; Son vecteur
+normal norm_f&nbsp; est le produit vectoriel&nbsp;de ae par ec.</li></ul><p>Soit un plan P défini par un point A et un vecteur normal N. Un point M appartient à P si le produit scalaire N.AM est nul</p><p>On obtient le système d'équations <br></p><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">
+<tbody>
+<tr>
+<td><ol><li>(bdf,bce) . norm_b = 0</li><li>(bdf,ade) . norm_d = 0</li><li>(bdf,acf) . norm_f = 0</li></ol></td>
+</tr>
+</tbody>
+</table>Equivalent à :&nbsp;<br><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">
+<tbody>
+<tr>
+<td><ol><li>&nbsp; &nbsp;norme_b[0]*X + norme_b[1]*Y + norme_b[2]*Z = prod_scalaire (v_bce, norm_b)</li><li>&nbsp;&nbsp; norme_d[0]*X + norme_d[1]*Y + norme_d[2]*Z =&nbsp;prod_scalaire (v_ade, norm_d)</li><li>&nbsp;&nbsp; norme_f[0]*X + norme_f[1]*Y + norme_f[2]*Z =&nbsp;prod_scalaire (v_acf, norm_f)</li></ol></td>
+</tr>
+</tbody>
+</table><br>Ce système de 3 équations à trois inconnues est résolu par la méthode de <span style="font-weight: bold;">Cramer</span> au moyen d'une classe du même nom défini dans le nouveau fichier <span style="font-weight: bold;">HexCramer.hxx.</span> Notons qu'un test unitaire de la classe Cramer existe dans le fichier test_quads.cxx<br style="font-weight: bold;"><p>Une fois le système résolu ; s'il n'est pas régulier on retourne un vecteur nul, la suite est aisée :</p><ul><li>Création du vertex s_bdf à partir des coordonnées calculées</li><li>Détermination
+des sommets opposés s_be, s_bcf, s_adf en utilisant la méthode
+Edge::commonVertex (edge) sur les arêtes dèja déterminées.</li><li>Création des 3 arêtes manquantes e_bd, e_bf, e_df</li><li>Création des quadrangles manquants q_b, q_d, q_f.</li><li>Création de l'hexaèdre.</li></ul><p><a name="addHexa4Quads"></a></p><p><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">Création d'un hexaèdre avec quatre quadrangles :&nbsp;</span>&nbsp;</p><ul><li>La classe AnaQuads&nbsp;
+détecte trois arêtes communes : appel à addHexaQuadsACDE.&nbsp;La face A sera la première trouvée qui en possède trois,
+la face E la suivante à trois arêtes,C et D lles deux autres faces à deux arêtes communes.</li><li>La classe AnaQuads&nbsp; détecte quatre arêtes communes : appel à
+addHexaQuadsABCD.&nbsp;Ce
+cas est
+symétrique chaque face possède deux arêtes. La face A sera la première
+de la liste, C et D&nbsp;les deux faces sécantes à A, B la dernière.</li></ul><table style="text-align: left; width: 90%;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="vertical-align: middle; text-align: center;"><p><img src="Quads_ABCD.png" style="width: 282px; height: 226px;" alt="En tunnel"></p></td><td style="vertical-align: middle; text-align: center;"><img src="Quads_ACDE.png" style="width: 278px; height: 223px;" alt="En but"></td></tr><tr><td style="vertical-align: middle;">addHexa2Quads avec 4 quadrangles&nbsp; disposés en tunnel. <br>Fonction : addHexaQuadsABCD</td><td style="vertical-align: middle;">addHexa2Quads avec 4 quadrangles&nbsp;disposés en fauteuil. <br>Fonction : addHexaQuadsACDE</td></tr></tbody></table><p><span style="font-weight: bold;">addHexaQuadABCD</span> :</p><p>Le
+rôle des quadrangles passés en&nbsp;arguments est symétrique On nommera q_a
+le premier trouvé, q_c le premier qui intersecte q_a, q_c le second et
+q_d celui qui n'intersecte pas q_a.</p><p>Tous les sommets et arêtes sont présents. Il suffit de créer les deux quadrangles E et F:</p><p>Les problèmes de détermination des variables se traiotent comme dans <span style="font-weight: bold;">addHexaQuadABC</span></p><p><span style="font-weight: bold;">addHexaQuadACDE</span> :</p><p>Le rôle de q_a et qc est symétrique. Ils ont chacun trois arêtes communes avec les autres. q_e et q_f n'en ont que 2.</p><p>Tous les sommets sont présents. Il suffit de créer l'arête e_bf et les deux quasrangles B et F:</p><p>Les edges se déterminent aisément grâce aux indices d'interection fournis par <span style="font-weight: bold;">AnaQuads</span>. Il suffiit de prendre l'opposé :<span style="font-family: monospace;">et à la propriété de la classe Quad : l'indice d'une arête opposée à l'arête i vaut i+2.</span></p><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td>&nbsp;&nbsp; int&nbsp;&nbsp; nc_ac = strquads.inter_edge[pos_c][pos_a]; // Nro dans&nbsp; q_c de e_ac<br>&nbsp;&nbsp; int&nbsp;&nbsp; nc_ce = strquads.inter_edge[pos_c][pos_e]; // Nro dans&nbsp; q_c de e_ce<br>&nbsp;&nbsp; int&nbsp;&nbsp; nd_ad = strquads.inter_edge[pos_d][pos_a]; // Nro dans&nbsp; q_d de e_ad<br>&nbsp;&nbsp; int&nbsp;&nbsp; nd_de = strquads.inter_edge[pos_d][pos_e]; // Nro dans&nbsp; q_d de e_de<br>&nbsp;&nbsp; int&nbsp;&nbsp; ne_ae = strquads.inter_edge[pos_e][pos_a]; // Nro dans&nbsp; q_e de e_ae<br><br>&nbsp;&nbsp; Edge* e_af&nbsp; = q_a-&gt;getEdge ((na_ac + 3) MODULO QUAD4);<br>&nbsp;&nbsp; Edge* e_bc&nbsp; = q_c-&gt;getEdge ((nc_ac + 2) MODULO QUAD4);<br>&nbsp;&nbsp; Edge* e_cf&nbsp; = q_c-&gt;getEdge ((nc_ce + 2) MODULO QUAD4);<br>&nbsp;&nbsp; Edge* e_bd&nbsp; = q_d-&gt;getEdge ((nd_ad + 2) MODULO QUAD4);<br>&nbsp;&nbsp; Edge* e_df&nbsp; = q_d-&gt;getEdge ((nd_de + 2) MODULO QUAD4);<br>&nbsp;&nbsp; Edge* e_be&nbsp; = q_e-&gt;getEdge ((ne_ae + 2) MODULO QUAD4);<br><br>&nbsp;&nbsp; Vertex* v_bcf = e_cf-&gt;opposedVertex (e_cf-&gt;commonVertex (e_af));<br>&nbsp;&nbsp; Vertex* v_bdf = e_df-&gt;opposedVertex (e_df-&gt;commonVertex (e_af));</td>
+</tr>
+</tbody>
+</table><p><a name="addHexa5Quads"></a></p><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">Création d'un hexaèdre avec cinq quadrangles :&nbsp;</span> <br><br>Il n'y a pas besoin de dissocier plusieurs cas, le travail est réalisé directement dans la méthode <span style="font-weight: bold;">addHexa5Quads</span>().<br><p style="text-align: center;"><img src="Quads_5.png" style="width: 278px; height: 223px;" alt="En but"></p>Ce cas est assez simple : c'est un hexaèdre auquel il manque la face que l'on convient de nommer B.<br><ul><li>La face q_a est celle qui possède 4 intersections.</li><li>Une
+fois son indice qbase déterminé dans AnaQuads, on boucle sur les 4
+quadrangles sécants à q_a et on obtient l'arête opposée t_edge[i] et le
+quadrangle associé tquad[i]. Les quadrangles q_c, g_d, q_e, q_f se
+retrouvent dans le tableau tquad dans un ordre exploitable, le problème
+étant symétrique.</li><li>On construit qb à partir des t_edge[i] donnés dans
+cet odre :&nbsp; q_b&nbsp; = new Quad (tedge[0], tedge[1], tedge[2],
+tedge[3]);</li><li>Enfin l'hexaèdre : hexa = new Hexa (q_a, q_b, tquad[0], tquad[2], tquad[1], tquad[3])</li></ul><p><a href="index.html#DebutPage">Retour au début</a></p><a name="Partie_2.2"></a><p><big><img src="green-ball.gif" style="width: 12px; height: 12px;" alt="o"></big><b><font size="+1"><big> 2.2 Génération d'Hexaèdres par révolution</big></font></b></p><p>Le pont d'entrée dans la classe Document est :<br>
+
+<span style="font-size: 11pt; font-family: Garamond;"></span>
+</p><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">
+<tbody>
+<tr>
+<td>Elements* revolutionQuads (Quads&amp; start, Vertex* center, Vector* axis, vector&lt;double&gt;&amp; angles);<br></td>
+</tr>
+</tbody>
+</table><br>Avec :<br><ul><li><span style="font-weight: bold;">start</span> est la liste des quadrangles de départ. Ils doivent costituer une surface libre.Rappelons que le type <span style="font-weight: bold;">Quads</span> est équivalent à <span style="font-weight: bold;">vector&lt;Quad*&gt;</span></li><li><span style="font-weight: bold;">center</span> et <span style="font-weight: bold;">axis</span> sont respecttivement le centre et l'axe de la rotation</li><li>le vecteur <span style="font-weight: bold;">angles</span> définit pour chaque incrément l'angle de la rotation.</li></ul><br><br><br><table style="text-align: left; width: 90%;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="vertical-align: middle; text-align: center;"><p><img src="QuadRevolution1.png" style="width: 282px; height: 226px;" alt="En diedre"></p></td><td style="vertical-align: middle; text-align: center;"><img src="QuadRevolution2.png" style="width: 278px; height: 223px;" alt="Trièdre"></td></tr><tr><td style="vertical-align: middle;">Avant la revolution : on a coloré les quadrangles à déplacer, ainsi que l'axe de rotation.</td><td style="vertical-align: middle;">Résultat de&nbsp; la revolution.</td><td style="vertical-align: middle;"></td></tr></tbody></table><br><p><a href="index.html#DebutPage">Retour au début</a></p><a name="Partie_2.3"></a><p><big><img src="green-ball.gif" style="width: 12px; height: 12px;" alt="o"></big><b><font size="+1"><big> 2.3 Substitution d'Hexaèdres</big></font></b></p><p>Il
+s'agit de remplacer un hexaèdre ou des hexaèdres par une autre série
+d'hexaaaèdres. Pour pouvoir effectuer ce remplacement, cette autre
+série d'hexaèdres doit vérifier des conditions de collage de faces.<br>
+
+<span style="font-size: 11pt; font-family: Garamond;"></span>
+</p><br><br><table style="text-align: left; width: 90%;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="vertical-align: middle; text-align: center;"><p><img src="ReplaceBefore.gif" style="width: 282px; height: 226px;" alt="En diedre"></p></td><td style="vertical-align: middle; text-align: center;"><img src="ReplaceResult.gif" style="width: 278px; height: 223px;" alt="Trièdre"></td></tr><tr><td style="vertical-align: middle; text-align: center;">Exemple
+: remplacement des 3 hexaèdres jaunes centraux par 3 fois 5 nouveaux
+hexaèdres qui sont construits par extrusion des 5 quadrangles marrons
+(le motif).</td><td style="vertical-align: middle; text-align: center;">Résultat du remplacement.&nbsp;</td></tr></tbody></table><br><br>La signature de la fonction est la suivante :<br><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">
+<tbody>
+<tr>
+<td>Elements* Document::revolutionQuads (Hexas&amp; pattern, Vertex* p1,&nbsp;Vertex* c1, <br>&nbsp;
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Vertex*
+p2,&nbsp;Vertex* c2,&nbsp;Vertex* p3,&nbsp;Vertex* c3);<br></td>
+</tr>
+</tbody>
+</table><br>Avec :<br><ul><li><span style="font-weight: bold;">pattern </span>est la liste des hexaèdres&nbsp; à extruder.<span style="font-weight: bold;"></span></li><li><span style="font-weight: bold;">c1, c2 </span>et&nbsp;<span style="font-weight: bold;">c3</span>
+définissent le quadrangle "cible" QB. Soit QA la face opposée à QB. A
+partir de cette face, on définit l'ensemble des n hexaèdres liés par
+les faces "opposées" &nbsp;(QAi, QBi).&nbsp;</li><li><span style="font-weight: bold;">p1, p2 </span>et <span style="font-weight: bold;">p3</span> sont les vertices du pattern qui seront associés resperctivement à c1, c2 et c3.&nbsp;&nbsp;</li></ul><p></p><p style="font-weight: bold;"><big>Conditions :&nbsp;</big></p><ul><li>Le pattern doit avoir exactement&nbsp;4 faces latérales externes, que l'on appellera pqc, pqd, pqe, pqf. </li><li>Les
+faces"transversales" inférieure et supérieure et doivent être
+superposables : le motif des quadrangles qui constituent ces faces doit
+être identique.</li><li>c1,c2 et c3 sont sur une face externe</li></ul><p></p><p>Pour désigner les faces d'un hexaèdres, on utilise les&nbsp; <a href="#RappelNotations">notations habituelles</a> définies plus haut.</p><p><big><span style="font-weight: bold;">Conventions et orientations</span></big> : </p><ul><li>Les
+3 vertices de départ du pattern définissent deux edges : pe_ac (sens
+Ox) et pe_ae (sens oy) et 3 vertices pv_aed, pv_ace, pv_acf.&nbsp;
+pv_ace est celui des 3 vertices qui est commun aux deux edges, pv_ade
+la première des extrémités. </li><li>Les&nbsp;4 faces latérales externes du pattern sont notées pq_c, pq_d, pq_e, pq_f.</li><li>Les
+3 vertices cibles définissent un quadrangle cq_b , deux edges&nbsp;
+&nbsp;ce_bc (Ox) et ce_be (Oy) et 3 vertices cv_bed, cv_bce et cv_bcf.
+définis comme pout le pattern.</li></ul><br>&nbsp; (A suivre ...)<p></p><p></p><p><br> </p><p><a href="index.html#DebutPage">Retour au début</a>
+</p><hr width="100%">
+<p><a name="Partie_3"></a></p>
+<p><img src="blue-ball.gif" alt="o" height="12" width="12"><b><font size="+1">
+&nbsp;<big>Partie 3 : Bibliothèque de formes</big></font></b></p><p>Cette biblothèque est constituée de quatre nouvelles formes :<br></p><ul><li>La demi-sphère trouée&nbsp;</li><li>Le huitième de sphère trouée</li><li>La demi-écorce trouée</li><li>Le huitième d'écorce trouée&nbsp;</li></ul><p>Ces formes sont implémentées (et traduites ....) de la façon suivante :</p><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">
+<tbody>
+<tr>
+<td><span style="font-family: monospace;">Elements* makeSphere (Vertex* center, </span><span style="font-family: monospace;">Vector* vx, Vector* vz,</span><span style="font-family: monospace;"> <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; double radius,&nbsp;</span><span style="font-family: monospace;">double radhole, </span><span style="font-family: monospace;"><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Vertex*
+plorig,&nbsp;</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int
+nrad, int nang, int nhaut);</span><span style="font-family: monospace;"></span><span style="font-family: monospace;"></span><br></td>
+</tr>
+<tr><td><span style="font-family: monospace;">Elements* makePartSphere (Vertex* center, </span><span style="font-family: monospace;"></span><span style="font-family: monospace;">Vector* vx, Vector* vz,</span><span style="font-family: monospace;"> </span><span style="font-family: monospace;"><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;double&nbsp; radius, </span><span style="font-family: monospace;"></span><span style="font-family: monospace;">double radhole</span><span style="font-family: monospace;">,</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vertex*
+plorig,&nbsp;</span><span style="font-family: monospace;">double angle,</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int
+nrad, int nang, int nhaut);</span></td></tr><tr><td><span style="font-family: monospace;">Elements* makeRind (Vertex* center, </span><span style="font-family: monospace;"></span><span style="font-family: monospace;">Vector* vx, Vector* vz,</span><span style="font-family: monospace;"> </span><span style="font-family: monospace;"><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;double&nbsp; radius, double radint, </span><span style="font-family: monospace;"></span><span style="font-family: monospace;">double radhole</span><span style="font-family: monospace;">,</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vertex*
+plorig,&nbsp;</span><span style="font-family: monospace;"></span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int
+nrad, int nang, int nhaut);</span></td></tr><tr><td><span style="font-family: monospace;">Elements* makePartRind (Vertex* center, </span><span style="font-family: monospace;"></span><span style="font-family: monospace;">Vector* vx, Vector* vz,</span><span style="font-family: monospace;"> <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-family: monospace;">double&nbsp; radius, double radint, </span><span style="font-family: monospace;"></span><span style="font-family: monospace;">double radhole</span><span style="font-family: monospace;">,</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vertex*
+plorig, </span><span style="font-family: monospace;">double angle,</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int
+nrad, int nang, int nhaut);</span></td></tr></tbody>
+</table><br>Remarques :<br><ul><li>Le plan sécant ne passe pas
+forcément par le centre de la sphère. Il définit le demi-espace dans
+lequel se situe l'objet à dessiner.Il peut même être disjoint de la
+sphère. S'il est "en dessous", la sphère est entièrement dessinée, s'il
+est "au dessus", l'objet sera vide.&nbsp;&nbsp;</li></ul><br><p><big><img src="green-ball.gif" style="width: 12px; height: 12px;" alt="o"></big><b><font size="+1"><big>&nbsp;3.1&nbsp; <span style="font-family: Terminal;"></span> Aspect visuel (exemples)</big></font></b></p><br>Conditions<br><table style="text-align: left; width: 90%;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="vertical-align: middle; text-align: center;"><p><img src="HemiSphere.png" style="width: 282px; height: 226px;" alt="Demi Sphere trouee"></p></td><td style="vertical-align: middle; text-align: center;"><img src="PartSphere.png" style="width: 278px; height: 223px;" alt="Huitième de sphère"></td></tr><tr><td style="vertical-align: middle; text-align: center;">Demi-Sphère trouée (makeSphere ())</td><td style="vertical-align: middle; text-align: center;">Huitième de sphère trouée (makePartSphere ())</td></tr><tr><td style="vertical-align: middle; text-align: center;"><p><img src="Rind.png" style="width: 282px; height: 226px;" alt="Ecorce trouée">&nbsp;&nbsp; &nbsp;</p></td><td style="vertical-align: middle; text-align: center;"><p><img src="PartRind.png" style="width: 282px; height: 226px;" alt="Huitième d'ecorce"> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;</p></td></tr><tr><td style="text-align: center;" valign="middle">Demi écorce trouée (makeRind ())</td><td style="text-align: center;" valign="middle">Huitième d'écorce trouée (makePartRind ())</td></tr></tbody></table><p><big><img src="green-ball.gif" style="width: 12px; height: 12px;" alt="o"></big><b><font size="+1"><big>&nbsp;3.1&nbsp; <span style="font-family: Terminal;"></span> Im</big></font></b><b><font size="+1"><big>plémentation</big></font></b></p><p>Toutes ces fonctions publiques appellent une seule fonction&nbsp; de la classe <span style="font-weight: bold;">Elements :</span></p><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">
+<tbody>
+
+<tr><td><span style="font-family: monospace;">int makeRind (EnumGrid type, Vertex* center, </span><span style="font-family: monospace;"></span><span style="font-family: monospace;">Vector* vx, Vector* vz,</span><span style="font-family: monospace;"> <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-family: monospace;">double&nbsp; radius, double radint, </span><span style="font-family: monospace;"></span><span style="font-family: monospace;">double radhole</span><span style="font-family: monospace;">,</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vertex*
+plorig, </span><span style="font-family: monospace;">double angle,</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int
+nrad, int nang, int nhaut);</span></td></tr></tbody>
+</table><br>Une fonction <span style="font-weight: bold;">controlRind() </span>vérifie
+la cohérence des arguments passés en entrée et calcule les deux extrema
+de l'angle d'élévation phi (voir chapitre suivant).<br>Une boucle à triple indice sur (nrad, nang, nhaut) calculme les coordonnées des sommets par appel de la fonction <span style="font-weight: bold;">getCylPoint (nx,ny,nz, px,py,pz)</span>.<br>Ce
+calcul se fait sur une sphère de centre O et d'axe Oz, dont les
+hexaedres sont comptés à partir de l'axe Ox de façon à remplir le
+secteur angulaire theta.. Les coordonnées sont ensuite replacées dans
+les coordonnes utilisateur grâce à la fonction <span style="font-weight: bold;">transfoVertices</span>(). Edges, quadrangles et hexaèdres sont ensuites assemblés grâce à &nbsp;la fonction <span style="font-weight: bold;">fillGrid</span>().<br><br><p><big><img src="green-ball.gif" style="width: 12px; height: 12px;" alt="o"></big><b><font size="+1"><big>&nbsp;3.2 Détermination de l'angle d'élévation (phi) <span style="font-family: Terminal;"></span>&nbsp;</big></font></b></p>L'angle
+d'azimuth theta (longitude) est défini explicitement par l'utilisateur.
+L'angle d'élévation phi est délimité par la position du&nbsp; plan
+horizontal et par le diamètre du trou. &nbsp;Soit :<br><ul><li>Une sphère de centre O et de rayon R.</li><li>La phère est traversée par un trou cylindrique de rayon r.</li><li>Un plan défini par son vecteur normal n (vertical sur la figure qui suit) et un point A</li></ul><p style="text-align: center;"><img src="Sphere.gif" style="width: 373px; height: 311px;" alt="Sphere"></p>A partir de ces éléments de base, on&nbsp; définit<small><small><small><small><small><small> </small></small></small></small></small></small>:<br><ul><li>Le point H, projection orhogonale du centre O de la sphere sur le plan (A,n)</li><li>L'angle alpha défini par le centre O et le cylindre : sin (alpha) = &nbsp;r/R</li><li>L'angle beta délimité&nbsp; par l'horizontale et l'intersection du plan (A,n) et de la sphère.&nbsp;</li><ul><li>sin (beta) = OH/R</li><li>et OH = OA.n/|n| &nbsp;(produit scalaire de OA par le vecteur unitaire associé à n).</li></ul></ul>L'angle d'élévation&nbsp; phi &nbsp;est encadré par les valeurs suivantes : <ul><li>max (alpha-pi/2, beta) &lt;= phi &lt;= pi/2 - alpha</li></ul><br><p><a href="index.html#DebutPage">Retour au début</a>
+</p><hr width="100%">
+<p><a name="Partie_4"></a></p>
+<p><img src="blue-ball.gif" alt="o" height="12" width="12"><b><font size="+1">
+&nbsp;<big>Partie 4 : Evolution des associations</big></font></b></p><p class="MsoNormal">Cette tâche est composée de 3 évolutions, au sujet de
+l'association, qui sont décrites ci-après.</p><p><big><img src="green-ball.gif" style="width: 12px; height: 12px;" alt="o"></big><b><font size="+1"><big> 4.1 Nouveaux objets <span style="font-family: Terminal;"></span>&nbsp;</big></font></b></p>
+
+<p class="MsoNormal">Il s'agissait d'ajouter de nouveaux objets
+intermédiaires de travail, comme le vecteur ou le cylindre :</p>
+
+<ul style="margin-top: 0cm;" type="square"><li class="MsoNormal" style="">le
+     cercle défini par&nbsp;un
+      centre, un
+      rayon et une
+      normale,</li><li class="MsoNormal" style="">la
+     sphère définie par&nbsp;un
+      centre et&nbsp;un
+      rayon.<br></li></ul>Il était p aussi&nbsp;associer&nbsp;
+les objets intermédiaires aux objets géométriques venant du
+composant GEOM de SALOME :<br><ul style="margin-top: 0cm;" type="square"><li class="MsoNormal" style="">un
+     cercle,</li><li class="MsoNormal" style="">une
+     sphère,</li><li class="MsoNormal" style="">un
+     cylindre.</li></ul> <p><big><img src="green-ball.gif" style="width: 12px; height: 12px;" alt="o"></big><b><font size="+1"><big> 4.2 Associations prédéfinies <span style="font-family: Terminal;"></span>&nbsp;</big></font></b></p><p class="MsoNormal">La deuxième évolution consiste à améliorer les associations
+des modèles de blocs prédéfinis en calculant automatiquement des associations
+implicites, les fonctions concernées sont les suivantes:</p>
+
+<ul style="margin-top: 0cm;" type="square"><li class="MsoNormal" style="">ajouter
+     une grille cylindrique .</li><li class="MsoNormal" style="">ajouter
+     une grille sphérique.</li><li class="MsoNormal" style="">ajouter
+     un cylindre, un tuyau.</li><li class="MsoNormal" style="">ajouter
+     l&#8217;intersection de 2 cylindres ou de 2 tuyaux.</li><li class="MsoNormal" style="">faire
+     de même pour toutes les nouvelles fonctions : ecorces et portions de sphères.</li></ul>
+
+<p class="MsoNormal">Pour chaque arête (sphérique) concernée, on associera un arc de cercle.</p><p class="MsoNormal">Il est inutile d'associer laes faces, SMESH est capable de mailler si les arêtes sont associées.</p><p class="MsoNormal"><big><span style="font-weight: bold;">Implémentation</span></big>&nbsp;</p><p class="MsoNormal">Rappelons que l'objet&nbsp;Shape de HexaBlock est constitué :</p><ul><li>D'une chaine de caractère (b_rep) qui permet de décrire toute forme de GEOM</li><li>De deux paramètres <span style="font-style: italic;">debut</span> et <span style="font-style: italic;">fin</span> compris entre 0 et 1 permettant de délimiter la ligne décrite par la b-rep quand c'en est une</li></ul><p class="MsoNormal">Deux opérations sont nécessaires&nbsp; :</p><ol><li>&nbsp;créer un cercle au moyen de GEOM,</li><li>découper ce cercle en arcs de cercle qui seront associés aux arêtes concernées.</li></ol><p class="MsoNormal"><span style="font-weight: bold;">Opération 1 </span>:
+Le cercle à créer est en fait un arc de cercle orienté de 360
+degrés.&nbsp; Il est en effet nécessaire de définir une origine. GEOM
+permet de&nbsp;générer finir un tel
+cercle, à partir duquel HexaBlock définira des arcs au moyen des
+paramètres <span style="font-style: italic;">debut</span> et <span style="font-style: italic;">fin</span> des shapes :</p><p class="MsoNormal">Cette action est assurée par la fonction <span style="font-weight: bold;">geom_create_circle</span>
+qui génère la brep du cercle à partir de son&nbsp;centre, de son rayon,
+de son vecteur normal, du&nbsp; vecteur Ox qui permet de définir son
+origine.</p><br><span style="font-weight: bold;"></span><table style="width: 80%; text-align: left; margin-left: auto; margin-right: auto; font-family: monospace;" border="1" cellpadding="2" cellspacing="2">
+<tbody>
+
+<tr><td><span style="font-family: monospace;"></span><span style="font-family: monospace;"></span><span style="font-family: monospace;">void <span style="font-weight: bold;">geom_create_circle</span> (double* centre, double rayon, Vector* normale,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+double* ox, string&amp; brep)<br>{<br>&nbsp;&nbsp; gp_Pnt gp_center (centre [dir_x], centre [dir_y], centre [dir_z]);<br>&nbsp;&nbsp;
+gp_Vec gp_ox&nbsp;&nbsp;&nbsp;&nbsp; (ox&nbsp;&nbsp;&nbsp;&nbsp;
+[dir_x], ox&nbsp;&nbsp;&nbsp;&nbsp; [dir_y], ox&nbsp;&nbsp;&nbsp;&nbsp;
+[dir_z]);<br>&nbsp;&nbsp; gp_Vec gp_norm&nbsp;&nbsp; (normale-&gt;getDx(), normale-&gt;getDy(), normale-&gt;getDz());<br><br>&nbsp;&nbsp; <span style="font-weight: bold;">gp_Ax2</span>&nbsp; gp_axes (gp_center, gp_norm, gp_ox);<br>&nbsp;&nbsp; <span style="font-weight: bold;">gp_Circ</span> gp_circ (gp_axes,&nbsp;&nbsp; rayon);<br><br>&nbsp;&nbsp; TopoDS_Edge&nbsp;&nbsp;&nbsp; geom_circ = <span style="font-weight: bold;">BRepBuilderAPI_MakeEdge</span>(gp_circ).Edge();<br>&nbsp;&nbsp; ostringstream&nbsp; stream_shape;<br>&nbsp;&nbsp; <span style="font-weight: bold;">BRepTools::Write</span>(geom_circ, stream_shape);<br><br>&nbsp;&nbsp; brep = stream_shape.str();<br>}</span><span style="font-family: monospace;"></span></td></tr></tbody>
+</table><br>GEOM permet de définir un tel cercle (calsse <span style="font-style: italic;">gp_Circ</span>)&nbsp; à partir d'un systemes d'axes 2D (classe <span style="font-style: italic;">gp_Ax2</span> ) &nbsp;et d'un rayon. Ce cercle esr ensuite transformé en forme&nbsp;<span style="font-style: italic;">TopoDS_Shape</span> qui est l'objet GEOM que l'on maniplule habituellement losque l'on procède aux associations. Plus précisément en <span style="font-style: italic;">TopoDS_Edge</span> &nbsp;au moyen de&nbsp;<span style="font-style: italic;">BRepBuilderAPI_MakeEdge</span><span style="font-family: monospace;"></span>. Enfin l'objet est&nbsp; transformé en chaine de caractères de format Brep via <span style="font-style: italic;">ostringstream</span>.<br><br><span style="font-weight: bold;">Opération 2 </span>:
+On dispose d'une b-rep&nbsp; décrivant un arc de cercle de 360 degrés.
+Il est aisé de définir proportionnellement pour chacun des edges
+constituant la ligne associée à la portion de cercle les paramètres
+début et fin par rapport aux angles de départ et d'arrivée de chaque
+arc. Cette opération fut d'ailleurs réalisée lors de la préservarion
+des associations lors d'un "cut". On réutilisera donc la fonction <span style="font-style: italic;">Elements::cutAssociation(...) </span>moyennant quelques aménagements.<br><p class="MsoNormal"></p><p><big><img src="green-ball.gif" style="width: 12px; height: 12px;" alt="o"></big><b><font size="+1"><big> 4.3&nbsp;Propagation des associations <span style="font-family: Terminal;"></span>&nbsp;</big></font></b></p><p class="MsoNormal"><br>La troisième évolution consiste à améliorer la propagation
+automatique des associations, les fonctions concernées sont les suivantes:</p>
+
+<ul style="margin-top: 0cm;" type="disc"><li class="MsoNormal" style="">fusionner
+     ou déconnecter des sommets, des arêtes, des quadrangles :</li><ul style="margin-top: 0cm;" type="circle"><li class="MsoNormal" style="">s&#8217;il
+      y a des associations, ne pas les perdre,</li></ul><li class="MsoNormal" style="">prismer
+     un ou des quadrangles :</li><ul style="margin-top: 0cm;" type="circle"><li class="MsoNormal" style="">s&#8217;il
+      y a des associations dans la direction de l&#8217;extrusion, les propager,</li></ul><li class="MsoNormal" style="">ajouter
+     des hexaèdres par translation, par rotation, par homothétie ou par
+     symétries :</li><ul style="margin-top: 0cm;" type="circle"><li class="MsoNormal" style="">si
+      les hexaèdres sources ont une association, alors les propager,</li></ul><li class="MsoNormal" style="">faire
+     de même pour la fonction «révolution» du lot 2.</li></ul>
+
+<p class="MsoNormal"><o:p></o:p></p>
+
+<p class="MsoNormal">Ces trois évolutions seront implémentées dans le moteur.
+Seule le première évolution (création de sphères ou cercles) sera implémentée
+dans la partie interactive. </p><br><br><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight: bold;">Implémentation :</span><br><br><br>En
+ce qui concerne les associations propagées par les transformations, la
+fonction de base de l'implémentation est transfo_brep. <br>Cette fonction reprend la matrice du modèle de blocs et l'applique à la shape décrite par la brep.<br><br><table style="text-align: left; margin-left: auto; margin-right: auto; width: 859px; height: 65px;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="width: 80%;"><span style="font-family: monospace;">// ====================================================== transfo_brep<br>void transfo_brep (string&amp; brep, Matrix* matrice, string&amp; trep)<br>{<br>&nbsp;&nbsp; BRep_Builder&nbsp; builder;<br>&nbsp;&nbsp; TopoDS_Shape&nbsp; shape_orig;<br>&nbsp;&nbsp; ostringstream stream_shape;<br>&nbsp;&nbsp; gp_Trsf&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; transfo;<br><br>&nbsp;&nbsp;
+double&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+a11,a12,a13,a14, a21,a22,a23,a24, a31,a32,a33,a34;<br>&nbsp;&nbsp; matrice-&gt;getCoeff (a11,a12,a13,a14, a21,a22,a23,a24, a31,a32,a33,a34);<br>&nbsp;&nbsp; transfo.SetValues (a11,a12,a13,a14, a21,a22,a23,a24, a31,a32,a33,a34, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+Epsil2, Epsil2);<br><br>&nbsp;&nbsp; istringstream stream_brep (brep);<br>&nbsp;&nbsp; BRepTools::Read&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (shape_orig, stream_brep, builder);<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; BRepBuilderAPI_Transform brep_transfo (shape_orig, transfo, Standard_True);<br>&nbsp;&nbsp; TopoDS_Shape result = brep_transfo.Shape();<br><br>&nbsp;&nbsp; BRepTools::Write (result, stream_shape);<br>&nbsp;&nbsp; trep = stream_shape.str();<br>}<br></span><span style="font-family: monospace;"></span></td></tr></tbody></table><br><br>Pour la fonction de prismQuads, on utilise une variante simplifiée : <br><br><table style="text-align: left; margin-left: auto; margin-right: auto; width: 859px; height: 65px;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="width: 80%;"><span style="font-family: monospace;">// ====================================================== translate_brep<br>void translate_brep (string&amp; brep, double dir[], string&amp; trep)<br>{<br>&nbsp;&nbsp; gp_Trsf&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; transfo;<br>&nbsp;&nbsp; BRep_Builder&nbsp; builder;<br>&nbsp;&nbsp; TopoDS_Shape&nbsp; orig;<br>&nbsp;&nbsp; ostringstream stream_shape;<br><br>&nbsp;&nbsp;
+gp_Vec&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+vecteur&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (dir [dir_x], dir [dir_y],
+dir [dir_z]);<br>&nbsp;&nbsp; transfo.SetTranslation&nbsp;&nbsp;&nbsp; (vecteur);<br>&nbsp;&nbsp; istringstream stream_brep (brep);<br>&nbsp;&nbsp; BRepTools::Read&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (orig, stream_brep, builder);<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; TopLoc_Location&nbsp; loc_orig&nbsp;&nbsp; = orig.Location();<br>&nbsp;&nbsp; gp_Trsf&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; trans_orig = loc_orig.Transformation();<br>&nbsp;&nbsp; TopLoc_Location&nbsp; loc_result (transfo * trans_orig);<br>&nbsp;&nbsp; TopoDS_Shape&nbsp;&nbsp;&nbsp;&nbsp; result = orig.Located (loc_result);<br><br>&nbsp;&nbsp; BRepTools::Write (result, stream_shape);<br>&nbsp;&nbsp; trep = stream_shape.str();<br>}<br></span><span style="font-family: monospace;"></span></td></tr></tbody></table><br><br>Pour la fonction de prismQuads, on utilise une variante simplifiée : <br><br><br><br><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight: bold;">Propagation des associations pour les transformations :</span><span style="font-weight: bold;"></span><br><br><br>L'exemple donné est makeScale <br><br><table style="text-align: left; margin-left: auto; margin-right: auto; width: 859px; height: 65px;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="width: 80%;"><span style="font-family: monospace;"># ======================================================= make_grid</span><br style="font-family: monospace;"><span style="font-family: monospace;">def make_grid (doc) :</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; ori&nbsp; = doc.addVertex ( 0, 0, 0)</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; vz&nbsp;&nbsp; = doc.addVector ( 0, 0, 1)</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; vx&nbsp;&nbsp; = doc.addVector ( 1 ,0, 0)</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; dr = 1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; da = 360</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; dl = 1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; nr = 1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; na = 6</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; nl = 1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; grid = doc.makeCylindrical (ori, vx,vz, dr,da,dl, nr,na,nl, False)</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; return grid</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;"># ======================================================= test_scale</span><br style="font-family: monospace;"><span style="font-family: monospace;">def test_scale () :</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; doc&nbsp; = hexablock.addDocument()</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; grid = make_grid (doc)</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; dest&nbsp;&nbsp; = doc.addVertex (15, 0, 0)</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; grid2&nbsp; = doc.makeScale (grid, dest, 0.5)</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; return doc</span></td></tr></tbody></table><br><br><table style="width: 859px; height: 65px; text-align: left; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="width: 80%;"><img style="width: 701px; height: 568px;" alt="transfo" src="transfo.png"></td></tr></tbody></table><br>ss<br><br><br><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight: bold;">Propagation des associations pour la fonction prism</span><span style="font-weight: bold;">Quads</span><br><br>Pour la fonction prismQuads :<br><br><br><br><table style="text-align: left; margin-left: auto; margin-right: auto; width: 737px; height: 297px;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="width: 80%;"><span style="font-family: monospace;"># ========================================================== test_prism</span><br style="font-family: monospace;"><span style="font-family: monospace;">def test_prism () :</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; doc&nbsp; = hexablock.addDocument()</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; nr = 1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; na = 6</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; nl = 1</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; grid = make_grid (doc, nr, na, nl)</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; liste = [ ]</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; for nx in range (nr) :</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for ny in range (na) :</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cell = grid.getQuadIJ (nx, ny, nl)</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; liste.append (cell);</span><br style="font-family: monospace;"><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; axis = doc.addVector (1, 1, 1);</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; bloc = doc.prismQuads&nbsp; (liste, axis, 3)</span><br style="font-family: monospace;"><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; return doc</span></td></tr></tbody></table><br><br><span style="font-weight: bold;"></span><table style="text-align: left; margin-left: auto; margin-right: auto; font-family: monospace; width: 909px; height: 535px;" border="1" cellpadding="2" cellspacing="2">
+<tbody>
+
+<tr><td><span style="font-family: monospace;"></span><span style="font-family: monospace;"></span><span style="font-family: monospace;"><br><br><br><br><br></span><div style="text-align: center;"><span style="font-family: monospace;"><img style="width: 498px; height: 403px;" alt="Prisme" src="prism.png"></span><br><span style="font-family: monospace;"></span></div><span style="font-family: monospace;"><br><br><br></span><span style="font-family: monospace;"></span></td></tr></tbody>
+</table><br><br><br><img src="red-ball.gif" style="width: 12px; height: 12px;" alt="o">&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">Propagation des associations pour la fonction revolutionQuads</span><br><br><br>Pour la fonction revolutionQuads <br><br><br><br><table style="text-align: left; margin-left: auto; margin-right: auto; width: 737px; height: 297px;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="width: 80%;"><span style="font-family: monospace;"># ========================================================== test_revolution<br>def test_revolution () :<br>&nbsp;&nbsp;&nbsp; doc&nbsp; = hexablock.addDocument()<br>&nbsp;&nbsp;&nbsp; nr = 1<br>&nbsp;&nbsp;&nbsp; na = 6<br>&nbsp;&nbsp;&nbsp; nl = 1<br>&nbsp;&nbsp;&nbsp; grid = make_grid (doc, nr, na, nl)<br><br>&nbsp;&nbsp;&nbsp; liste = [ ]<br>&nbsp;&nbsp;&nbsp; for nx in range (nr) :<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for ny in range (na) :<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cell = grid.getQuadIJ (nx, ny, nl)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print " ... cell = ", cell<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; liste.append (cell);<br></span>ss<br><br><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; center = doc.addVertex (0, -10, 0);<br>&nbsp;&nbsp;&nbsp; axis&nbsp;&nbsp; = doc.addVector (1, 0, 0);<br>&nbsp;&nbsp;&nbsp; angles = [5, 10, 15, 20, 30, 20, 15, 10, 5 ]<br></span>ss<br><span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; bloc = doc.revolutionQuads&nbsp; (liste, center, axis, angles);<br>&nbsp;&nbsp;&nbsp; return doc<br></span><span style="font-family: monospace;"></span></td></tr></tbody></table><br><br><br><br><table style="width: 734px; height: 484px; text-align: left; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="2"><tbody><tr><td style="width: 80%;"><img style="width: 474px; height: 383px;" alt="Macaroni" src="macaroni.png" align="middle"></td></tr></tbody></table><br><br><br><br><br><p><a href="index.html#DebutPage">Retour au début</a></p>
+<hr width="100%">
+<p><br></p><br><p><br>
+&nbsp;
+<br>
+&nbsp;
+<br>
+&nbsp;
+<br>
+&nbsp;
+<br>
+&nbsp;
+</p>
 </body></html>
\ No newline at end of file
index 9851c1286b8b75984e50c60a2310fef18db598bb..95c9e117dd5267fc6b1429f4d044608c58327bfa 100644 (file)
@@ -32,7 +32,7 @@ bool is_out (double val, double orig, double lg);
 
 // ======================================================== Constructeur
 Cylinder::Cylinder(Vertex* b, Vector* v, double r, double h)
-        : EltBase (b->dad())
+        : EltBase (b->dad(), EL_CYLINDER)
 {
     c_base   = b;
     c_dir    = v;
@@ -48,6 +48,17 @@ Cylinder::Cylinder(Vertex* b, Vector* v, double r, double h)
        HexDump (c_dir);
        cout << endl;
        }
+
+    if (c_base==NULL || c_dir==NULL || el_root==NULL)
+       setError ();
+    else 
+       {
+       double tol   = el_root->getTolerance ();
+       double norme = c_dir  ->getNorm ();
+       if (c_radius <= tol || c_height <= tol || norme <= tol)
+           setError ();
+       }
+       
 }
 // ======================================================== rdiffers
 bool rdiffers (double v1, double v2)
index 30442c8fe8f1cbb8dae3cd112c0113fa20733f68..66700f73f793d8429303a8ef94cef6ed0d442e67 100755 (executable)
@@ -64,8 +64,15 @@ int get_coords (const string& chaine, double& x, double& y)
    return HOK;
 }
 // ======================================================== parseName
-int parseName (XmlTree* node, EltBase* elt)
+int parseName (XmlTree* node, const string& nom, EltBase* elt)
 {
+   int lg    = nom.size();
+   int nroid = 0;
+   for (int nc=1 ; nc<lg ; nc++)
+       nroid = 10*nroid + nom[nc] - '0';
+   
+   elt->setId (nroid);
+
    const  string& name = node->findValue ("name");
    if (name=="")
       return HERR;
@@ -185,7 +192,7 @@ int Document::parseXml (XmlTree& xml)
        get_coords (coords, px, py, pz);
 
        Vertex*  vertex = addVertex (px, py, pz);
-       parseName (node, vertex);
+       parseName (node, nom, vertex);
        Shape*   shape  = NULL;
        if (brep != "" ) 
           {
@@ -210,7 +217,7 @@ int Document::parseXml (XmlTree& xml)
           get_names (vertices, V_TWO, tname);
           edge = new Edge (t_vertex [tname[0]], t_vertex [tname[1]]);
           t_edge [nom] = edge;
-          parseName (node, edge);
+          parseName (node, nom, edge);
           }
        else if (type=="Shape" && edge!=NULL)
           {
@@ -236,7 +243,7 @@ int Document::parseXml (XmlTree& xml)
           quad = new Quad (t_edge [tname[0]], t_edge [tname[1]],
                            t_edge [tname[2]], t_edge [tname[3]]);
           t_quad [nom] = quad;
-          parseName (node, quad);
+          parseName (node, nom, quad);
           }
        else if (type=="Shape" && quad!=NULL)
           {
@@ -259,7 +266,7 @@ int Document::parseXml (XmlTree& xml)
                                 t_quad [tname[2]], t_quad [tname[3]],
                                 t_quad [tname[4]], t_quad [tname[5]]);
        t_hexa [nom] = hexa;
-       parseName (node, hexa);
+       parseName (node, nom, hexa);
        }
 
    rubrique = xml.findChild ("ListVectors");
@@ -275,7 +282,7 @@ int Document::parseXml (XmlTree& xml)
 
        Vector* vector = addVector (px, py, pz);
        t_vector [nom] = vector;
-       parseName (node, vector);
+       parseName (node, nom, vector);
        }
 
    rubrique = xml.findChild ("ListDicretizationLaws");
index 896b0b2a106cbfab2346963a63f9a6fa1a0df464..7579acfcbb6e41b32fe8ed588eab4428d8c8c4a5 100755 (executable)
@@ -45,6 +45,19 @@ Edge::Edge (Vertex* va, Vertex* vb)
    e_law    = NULL;
    e_clone  = NULL;
 
+   if (isBad())
+      return;
+   else if (BadElement (va) || BadElement (vb))
+      {
+      setError ();
+      return;
+      }
+   else if (va == vb)
+      {
+      setError ();
+      return;
+      }
+
    majReferences ();
 }
 // ======================================================== Constructeur 2
@@ -52,6 +65,8 @@ Edge::Edge (Edge* other)
     : EltBase (other->dad(), EL_EDGE)
 {
    e_vertex [V_AMONT] = e_vertex [V_AVAL ] = NULL;
+   if (BadElement (other))
+      setError ();
 
    e_propag = NOTHING;
    e_way    = true;
index 5fdfe91aa451ca3361ad36cb1d5f0c95c1005004..56ee01861e9b9869423944b016eca2696fb3426f 100755 (executable)
@@ -38,7 +38,8 @@ public:
     virtual void replaceVertex (Vertex* old, Vertex* nouveau);
     virtual void clearAssociation  ()      { tab_assoc.clear() ; }
     virtual void setAssociation (Shape* forme);
-    int    addAssociation (Shape* forme);
+    virtual bool isAssociated ()           { return tab_assoc.size() > 0  ; }
+    virtual int  addAssociation (Shape* forme);
 
     Edge (Vertex* va, Vertex* vb);
     Edge (Edge* other);
index 9f8a68206bbacf34186db5c29097c521a4f69adf..730771f175e991eea827510aafa843f7064174f1 100755 (executable)
@@ -194,6 +194,15 @@ void Elements::resize (EnumGrid type, int nx, int ny, int nz, int nplus)
 int Elements::makeCartesianGrid (Vertex* orig, Vector* v1, Vector* v2, 
                    Vector* v3, int px, int py, int pz, int mx, int my, int mz)
 {
+   if (BadElement (orig) || BadElement(v1) || BadElement(v2) || BadElement(v3)
+                         || px<=0 || py<=0 || pz <= 0
+       || v1->getNorm () <= Epsil || v2->getNorm () <= Epsil
+       || v3->getNorm () <= Epsil)
+      {
+      setError ();
+      return HERR;
+      }
+
    resize (GR_CARTESIAN, px+mx, py+my, pz+mz);
 
    makeCartesianNodes (orig, v1, v2, v3, px, py, pz, mx, my, mz);
@@ -205,6 +214,13 @@ int Elements::makeCartesianGrid (Vertex* orig, Vector* v1, Vector* v2,
 int Elements::makeCylindricalGrid (Vertex* c, Vector* b, Vector* h, 
          double dr, double da, double dl, int nr, int na, int nl, bool fill)
 {
+   if (BadElement (c) || BadElement(b) || BadElement(h)
+       || nr<=0 || na<=0 || nl <= 0 || dr < Epsil || da < Epsil || dl < Epsil 
+       || b->getNorm () <= Epsil || h->getNorm () <= Epsil)
+      {
+      setError ();
+      return HERR;
+      }
    resize (GR_CYLINDRIC, nr, na, nl);
    cyl_closed = da >= 360.0;
    makeCylindricalNodes (c, b, h, dr, da, dl, nr, na, nl, fill);
@@ -215,12 +231,15 @@ int Elements::makeCylindricalGrid (Vertex* c, Vector* b, Vector* h,
 // ====================================================== makeSphericalGrid
 int Elements::makeSphericalGrid (Vertex* c, Vector* dv, int nb, double  k)
 {
-   resize (GR_SPHERIC, nb);
-
-   if (nb<0) 
-      return HERR;
-   else if (dv->getDx()<=ZEROR || dv->getDy()<=ZEROR || dv->getDz()<=ZEROR)
+   if (BadElement (c) || BadElement(dv) 
+       || nb<=0 || k < Epsil 
+       || dv->getDx()<=Epsil || dv->getDy()<=Epsil || dv->getDz()<=Epsil)
+      {
+      setError ();
       return HERR;
+      }
+
+   resize (GR_SPHERIC, nb);
 
    Vertex* i_node [HV_MAXI];    // Les noeuds de l'hexa englobant
    Edge*   i_edge [HE_MAXI];    // Les noeuds de l'hexa englobant
@@ -436,6 +455,7 @@ int Elements::joinQuads (Quads& orig, int nb, Vertex* v1, Vertex* v2,
           printf ("\n");
           printf (" *** joinQuads : donnees incorrectes\n");
           printf (" *** le %deme quadrangle de depart est NULL\n", nro);
+          setError ();
           return HERR;
           }
        else if (face->getNbrParents()>1)
@@ -444,7 +464,8 @@ int Elements::joinQuads (Quads& orig, int nb, Vertex* v1, Vertex* v2,
           printf (" *** joinQuads : donnees incorrectes\n");
           printf (" *** le %deme quadrangle de depart n'est pas une " 
                   "face externe\n", nro);
-          face->dump ();        
+          face->dump ();
+          setError ();
           return HERR;
           }
        orig [nro]->setMark (nro);
@@ -479,12 +500,18 @@ int Elements::joinQuads (Quads& orig, int nb, Vertex* v1, Vertex* v2,
       }
 
    if (e_orig==NULL || e_dest==NULL)
+      {
+      setError ();
       return HERR;
+      }
 
    StrOrient orient (v1, v3, v2, v4);
    int ier =  this   ->coupler (0, cible, &orient);
    if (ier!=HOK)
-       return HERR;
+      {
+      setError ();
+      return HERR;
+      }
    ier = orig[0]->coupler (cible, &orient, this);
    return ier;
 }
index 0bfc615da22c30bf847aa2c19d7e4c5b7ad14bae..77658c3a34ab19e34d7adc5e2276aafde17df0dd 100755 (executable)
@@ -43,6 +43,8 @@ void geom_create_circle (double* milieu, double rayon, double* normale,
 // ====================================================== getHexaIJK
 Hexa* Elements::getHexaIJK (int nx, int ny, int nz)
 {
+   if (isBad())
+      return NULL;
    if (nx<0 || nx>=size_hx ||  ny<0 || ny>=size_hy || nz<0 || nz>=size_hz)
       return NULL;
    else if (grid_nocart)
@@ -55,6 +57,8 @@ Hexa* Elements::getHexaIJK (int nx, int ny, int nz)
 // ====================================================== getQuadIJ
 Quad* Elements::getQuadIJ (int nx, int ny, int nz)
 {
+   if (isBad())
+      return NULL;
    if (nx<0 || nx>=size_qx ||  ny<0 || ny>=size_qy || nz<0 || nz>=size_qz)
       return NULL;
    else if (grid_nocart)
@@ -67,6 +71,8 @@ Quad* Elements::getQuadIJ (int nx, int ny, int nz)
 // ====================================================== getQuadJK
 Quad* Elements::getQuadJK (int nx, int ny, int nz)
 {
+   if (isBad())
+      return NULL;
    if (nx<0 || nx>=size_qx ||  ny<0 || ny>=size_qy || nz<0 || nz>=size_qz)
       return NULL;
    else if (grid_nocart)
@@ -79,6 +85,8 @@ Quad* Elements::getQuadJK (int nx, int ny, int nz)
 // ====================================================== getQuadIK
 Quad* Elements::getQuadIK (int nx, int ny, int nz)
 {
+   if (isBad())
+      return NULL;
    if (nx<0 || nx>=size_qx ||  ny<0 || ny>=size_qy || nz<0 || nz>=size_qz)
       return NULL;
    else if (grid_nocart)
@@ -91,6 +99,8 @@ Quad* Elements::getQuadIK (int nx, int ny, int nz)
 // ====================================================== getEdgeI
 Edge* Elements::getEdgeI (int nx, int ny, int nz)
 {
+   if (isBad())
+      return NULL;
    if (nx<0 || nx>=size_ex ||  ny<0 || ny>=size_ey || nz<0 || nz>=size_ez)
       return NULL;
    else if (grid_nocart)
@@ -103,6 +113,8 @@ Edge* Elements::getEdgeI (int nx, int ny, int nz)
 // ====================================================== getEdgeJ
 Edge* Elements::getEdgeJ (int nx, int ny, int nz)
 {
+   if (isBad())
+      return NULL;
    if (nx<0 || nx>=size_ex ||  ny<0 || ny>=size_ey || nz<0 || nz>=size_ez)
       return NULL;
    else if (grid_nocart)
@@ -115,6 +127,8 @@ Edge* Elements::getEdgeJ (int nx, int ny, int nz)
 // ====================================================== getEdgeK
 Edge* Elements::getEdgeK (int nx, int ny, int nz)
 {
+   if (isBad())
+      return NULL;
    if (nx<0 || nx>=size_ex ||  ny<0 || ny>=size_ey || nz<0 || nz>=size_ez)
       return NULL;
    else if (grid_nocart)
@@ -127,6 +141,8 @@ Edge* Elements::getEdgeK (int nx, int ny, int nz)
 // ====================================================== getVertexIJK
 Vertex* Elements::getVertexIJK (int nx, int ny, int nz)
 {
+   if (isBad())
+      return NULL;
    if (nx<0 || nx>=size_vx ||  ny<0 || ny>=size_vy || nz<0 || nz>=size_vz)
       return NULL;
    else if (grid_nocart)
@@ -196,6 +212,13 @@ void Elements::remove ()
 // ====================================================== makeCylinder
 int Elements::makeCylinder (Cylinder* cyl, Vector* vx, int nr, int na, int nl)
 {
+   if (BadElement (cyl) || BadElement (vx) ||  nr<=0 || na <=3 || nl <=0
+                        || vx->getNorm () <= Epsil)
+      {
+      setError ();
+      return HERR;
+      }
+
    Vertex* orig = cyl->getBase ();
    Vector* dir  = cyl->getDirection ();
    double  ray  = cyl->getRadius ();
@@ -212,6 +235,13 @@ int Elements::makeCylinder (Cylinder* cyl, Vector* vx, int nr, int na, int nl)
 // ====================================================== makePipe
 int Elements::makePipe (Cylinder* cyl, Vector* vx, int nr, int na, int nl)
 {
+   if (BadElement (cyl) || BadElement (vx) ||  nr<=0 || na <=3 || nl <=0
+                        || vx->getNorm () <= Epsil)
+      {
+      setError ();
+      return HERR;
+      }
+
    Vertex* orig = cyl->getBase ();
    Vector* dir  = cyl->getDirection ();
    double  ray  = cyl->getRadius ();
@@ -230,6 +260,12 @@ int Elements::makePipe (Cylinder* cyl, Vector* vx, int nr, int na, int nl)
 // ====================================================== prismQuads
 int Elements::prismQuads (Quads& tstart, Vector* dir, int nbiter)
 {
+   if (BadElement (dir) || dir->getNorm () <= Epsil || nbiter <= 0)
+      {
+      setError ();
+      return HERR;
+      }
+
    el_root->markAll (NO_USED);
    int nbcells   = tstart.size ();
    nbr_vertex    = 0;
@@ -261,8 +297,11 @@ int Elements::prismQuadsVec (Quads& tstart, Vector* dir, RealVector& tlen,
                              int mode)
 {
    int nbiter = tlen.size();
-   if (nbiter==0)
+   if (BadElement (dir) || dir->getNorm () <= Epsil || nbiter <= 0)
+      {
+      setError ();
       return HERR;
+      }
 
    el_root->markAll (NO_USED);
    int nbcells   = tstart.size ();
@@ -296,12 +335,16 @@ int Elements::prismQuadsVec (Quads& tstart, Vector* dir, RealVector& tlen,
 int Elements::revolutionQuads (Quads& start, Vertex* center, Vector* axis,
                                RealVector &angles)
 {
-   int nbiter = angles.size();
-   if (center==NULL  || axis==NULL || nbiter==0)
+   int nbiter  = angles.size();
+   int nbcells = start.size ();
+   if (BadElement (center)  || BadElement(axis) || nbiter==0 || nbcells==0
+                            || axis->getNorm () <= Epsil)
+      {
+      setError ();
       return HERR;
+      }
 
    el_root->markAll (NO_USED);
-   int nbcells   = start.size ();
    nbr_vertex    = 0;
    nbr_edges     = 0;
 
index 389b1714ec3797183c9252dc29b19ee2d419828e..5743c34163134678c46bb989c9bd27e4fe6876e0 100755 (executable)
@@ -496,6 +496,14 @@ int Elements::makeCylindricalGrid (Vertex* orig, Vector* base, Vector* haut,
                             RealVector& tdr, RealVector& tda, RealVector& tdh, 
                             bool fill)
 {
+   if (BadElement (orig) || BadElement(base) || BadElement(haut) 
+       || base->getNorm () <= Epsil || haut->getNorm () <= Epsil
+       || tdr.size () <= 0 || tda.size () <= 0 || tdh.size () <= 0)
+      {
+      setError ();
+      return HERR;
+      }
+
    int nr = tdr.size() - 1;
    int na = tda.size();
    int nl = tdh.size();
@@ -505,7 +513,7 @@ int Elements::makeCylindricalGrid (Vertex* orig, Vector* base, Vector* haut,
        angle += tda[nro];
 
    resize (GR_CYLINDRIC, nr, na, nl);
-   cyl_closed = angle >= 360.0;
+   cyl_closed = angle >= 359.9;
 
    int ier = makeBasicCylinder (tdr, tda, tdh, fill);
    if (ier!=HOK) 
index 46bf4a9ea17b05291ee0df8132cc61b6499ae07e..603d6c384a454d632ce3522dd5b702abce27e642 100755 (executable)
@@ -442,7 +442,7 @@ int Elements::replaceHexas (Quads& liste, Vertex* p1, Vertex* c1,
         replaceHexa (nh,   &pattern, pil_hexa[nh-1]);
         }
 
-    for (int nh=1 ; nh<=nbh ; nh++)
+    for (int nh=0 ; nh<=nbh ; nh++)
         pil_quad[nh]->remove ();
 
     extrudeQuad (&pattern);
index a56e79ec367f012a0a8f4f6de7bf046262a53ae7..cf1a35ef194d17407095de80c82148e32861b189 100755 (executable)
@@ -386,12 +386,13 @@ void Elements::assoSphere (Vertex* ori, Edge* t_edge[], Quad* t_quad[])
 // ====================================================== makeSphericalGrid
 int Elements::makeSphericalGrid (Vertex* c, double rayon, int nb, double  k)
 {
-   resize (GR_SPHERIC, nb);
-
-   if (nb<0) 
-      return HERR;
-   else if (rayon <=ZEROR)
+   if (nb<=0 || rayon <=Epsil || k <= Epsil || BadElement (c))
+      {
+      setError ();
       return HERR;
+      }
+
+   resize (GR_SPHERIC, nb);
 
    Vertex* i_node [HV_MAXI];    // Les noeuds de l'hexa englobant
    Edge*   i_edge [HE_MAXI];    // Les noeuds de l'hexa englobant
index d77aa8bc0412609effdc16efb19b8890bff17bf9..8f2acd4383dcd474bb8e565107a62beb9364bd27 100755 (executable)
@@ -29,22 +29,30 @@ EltBase::EltBase (Document* doc, EnumElt type)
 {
    el_root   = doc;
    el_type   = type;
-   el_id     = el_root->doc_nbr_elt [type];
+   el_id     = 0;
 
    el_next   = NULL;
    el_assoc  = NULL;
    el_status = HOK;
    el_mark   = 0;
 
-   el_root->doc_nbr_elt  [type] ++;
-   el_root->doc_last_elt [type] -> el_next = this;
-   el_root->doc_last_elt [type] = this;
+   // EL_NONE, EL_VERTEX, EL_EDGE, EL_QUAD, EL_HEXA, EL_REMOVED
+
+   if (el_root==NULL)
+      {
+      el_name  = "NoValid";
+      setError ();
+      return;
+      }
+
+   el_id    = el_root->doc_nbr_elt [el_type];
+   el_root->doc_nbr_elt  [el_type] ++;
+   el_root->doc_last_elt [el_type] -> el_next = this;
+   el_root->doc_last_elt [el_type] = this;
    el_root->setDeprecated (1);
 
-   // EL_NONE, EL_VERTEX, EL_EDGE, EL_QUAD, EL_HEXA, EL_REMOVED
    char buffer [16];
-   sprintf (buffer, "%c%04d", ABR_TYPES[el_type], el_id);
-   el_name = buffer;
+   el_name = getName (buffer);
 }
 // =================================================== Destructeur
 EltBase::~EltBase ()
@@ -139,6 +147,12 @@ void EltBase::setAssociation (Shape* forme)
    if (el_root->debug (2))
        cout << "  Vertex " << el_name << " : setAssociation" << endl;
 }
+// ========================================================= addAssociation
+int EltBase::addAssociation (Shape* forme)
+{
+   setAssociation (forme);
+   return HOK;
+}
 // ========================================================= dumpRef 
 void EltBase::dumpRef ()
 {
@@ -163,6 +177,26 @@ void EltBase::dumpRef ()
 
    printf ("\n");
 }
+// ========================================================= addAssociation
+bool EltBase::canBeAssociated ()
+{
+   bool rep =   isValid() && isHere() 
+            && (el_type==EL_VERTEX || el_type==EL_EDGE || el_type==EL_QUAD);
+   return rep;
+}
+// ========================================================= addAssociation
+void EltBase::setId (int ln)
+{
+   char buffer [16];
+   bool defname = el_name == getName (buffer);
+
+   el_id     = ln;
+   int maxid = std::max (el_root->doc_nbr_elt[el_type], ln+1);
+
+   el_root->doc_nbr_elt[el_type] = maxid;
+   if (defname) 
+      el_name = getName (buffer);
+}
 
 END_NAMESPACE_HEXA
 
index a95a290607c81e03c1389821beb664bdd64db23c..dadda0c550f2a2b430bcac3b7769c982743efad7 100755 (executable)
@@ -33,7 +33,7 @@
 
 #define GetClone(elt) ((elt)==NULL ? NULL : elt->getClone())
 #define BadElement(elt) (elt)==NULL || (elt)->isBad()
-#define ABR_TYPES  "xveqhw????"
+#define ABR_TYPES  "xveqhwgcp????"
 
 BEGIN_NAMESPACE_HEXA
 
@@ -56,12 +56,15 @@ public :
    virtual bool    isBad       ()              { return el_status!=HOK; }
 
    virtual void    setAssociation (Shape* forme);
+   virtual int     addAssociation (Shape* forme);
    virtual void    clearAssociation ()            { el_assoc = NULL  ; }
    virtual void    duplicate ()                   {}
    virtual Shape*  getAssociation ()              { return el_assoc  ; }
+   virtual bool    isAssociated ()                { return el_assoc != NULL  ; }
 
    void copyAssociation    (EltBase* orig);
    void replaceAssociation (EltBase* orig);
+   bool canBeAssociated ();
 
 public :
    virtual void replaceEdge   (Edge* old, Edge* nouveau) 
@@ -82,7 +85,7 @@ public :
    EltBase*  next ()                        { return el_next; }
    void      setNext (EltBase* suivant)     { el_next = suivant; }
    int       getId ()                       { return el_id; }
-   void      setId (int ln)                 { el_id = ln; }
+   void      setId (int ln);
    Document* dad ()                         { return el_root; }
    EnumElt   getType ()                     { return el_type; }
    bool      isHere ()                      { return el_type!=EL_REMOVED; }
index 5ababf19b910fcf194c6070a54f6cffac5edc9e8..66d72427fb4e7e2a9e8929e265b871498c6d32e4 100755 (executable)
@@ -170,11 +170,11 @@ void Hexa::controlerFaces  ()
 {
    for (int n1=0 ; n1<HQ_MAXI ; n1++) 
        {
-       if (h_quad [n1] == NULL)
+       if (BadElement (h_quad [n1]))
           {
           el_root->putError (W_H_NULL_QUAD, 
                              el_root->glob->namofHexaQuad (n1));
-          el_status = 886;
+          setError (886);
           return;
           }
        for (int n2=n1+1 ; n2<HQ_MAXI ; n2++) 
@@ -183,7 +183,7 @@ void Hexa::controlerFaces  ()
               el_root->putError (W_H_EQ_QUAD, 
                          el_root->glob->namofHexaQuad (n1), 
                          el_root->glob->namofHexaQuad (n2));
-              el_status = 888;
+              setError (888);
               }
        }
 }
@@ -192,11 +192,11 @@ void Hexa::controlerSommets  ()
 {
    for (int n1=0 ; n1<HV_MAXI ; n1++) 
        {
-       if (h_vertex [n1] == NULL)
+       if (BadElement (h_vertex [n1]))
           {
           el_root->putError (W_H_NULL_QUAD, 
                              el_root->glob->namofHexaVertex (n1));
-          el_status = 886;
+          setError (886);
           return;
           }
        for (int n2=n1+1 ; n2<HQ_MAXI ; n2++) 
@@ -205,7 +205,7 @@ void Hexa::controlerSommets  ()
               el_root->putError (W_H_EQ_QUAD, 
                          el_root->glob->namofHexaVertex (n1), 
                          el_root->glob->namofHexaVertex (n2));
-              el_status = 888;
+              setError (888);
               }
        }
 }
index f6e99a61e102a1fff998d6f5d0c9413fd8d5bb48..dbe07554b24dbd9012a3bab07b340ab4bd9f496b 100755 (executable)
@@ -31,6 +31,9 @@ Pipe::Pipe (Vertex* b, Vector* v, double ri, double re, double h)
     : Cylinder (b, v, re, h)
 {
     c_int_radius = ri;
+    if (isBad () || c_int_radius <= el_root->getTolerance () 
+                 || c_int_radius >= c_radius)
+        setError ();
 }
 // ========================================================= saveXml 
 void Pipe::saveXml  (XmlWriter* xml)
index 987f039343c1f89c17b401194942ee5a942c72cf..a075aa0e9e2d3f31e293a03ba0186da47101fc6a 100755 (executable)
@@ -45,6 +45,13 @@ Quad::Quad (Vertex* va, Vertex* vb, Vertex* vc, Vertex* vd)
        {
        q_edge [nro] = new Edge (q_vertex[nro], 
                                 q_vertex[(nro+1) MODULO QUAD4]);
+
+       if (BadElement (q_vertex [nro]) || BadElement (q_edge [nro]))
+          setError ();
+       else
+          for (int nv=nro+1 ; nv<QUAD4 ; nv++)
+              if (q_vertex[nv] == q_vertex[nro])
+                 setError ();
        }
 
    majReferences ();
@@ -64,15 +71,24 @@ Quad::Quad (Edge* ea, Edge* eb, Edge* ec, Edge* ed)
        {
        int prec = (nro+1) MODULO QUAD4; 
        Vertex* node = NULL;
-       int nc  = q_edge[nro] -> inter (q_edge[prec]);
-       if (nc>=0)
-          node = q_edge[nro]->getVertex (nc);
-       else  
-          el_status = 888;
+
+       if (BadElement (q_edge[nro]))
+          setError ();
+       else 
+          {
+          for (int nv=nro+1 ; nv<QUAD4 ; nv++)
+              if (q_edge[nv] == q_edge[nro])
+                  setError ();
+          int nc  = q_edge[nro] -> inter (q_edge[prec]);
+          if (nc>=0)
+             node = q_edge[nro]->getVertex (nc);
+          else  
+             setError (888);
+          }
        q_vertex [prec] = node;
        }
 
-   if (el_status != HOK)
+   if (isBad())
       {
       printf (" +++++++++++++++++++++++++++++++++++++++++++ \n");
       printf (" +++ Quadrangle impossible \n");
@@ -557,4 +573,11 @@ int Quad::setOrientation ()
     printf (" %s = %s\n", el_name.c_str(), t_ori [ q_orientation ]);
     return q_orientation;
 }
+// ========================================================== setAssociation
+void Quad::setAssociation (Shape* forme)
+{
+   clearAssociation ();
+   addAssociation (forme);
+}
 END_NAMESPACE_HEXA
+
index 19ee24d7c7f91e5ffdb4d6a81f3a44a385500c5c..812c03448470b95a8fba3d22f297bade5347a012 100755 (executable)
@@ -89,10 +89,14 @@ public:
     virtual void replaceEdge   (Edge*   old, Edge*   nouveau);
     virtual void replaceVertex (Vertex* old, Vertex* nouveau);
 
+    virtual void  setAssociation (Shape* forme);
+    virtual int   addAssociation (Shape* forme); 
     virtual void  clearAssociation  ()      { tab_assoc.clear() ; }
-    int   addAssociation (Shape* forme); 
+    virtual bool  isAssociated ()           { return tab_assoc.size() > 0  ; }
+
     const Shapes& getAssociations ()        { return tab_assoc ; }
 
+
     virtual void duplicate ();
     Quad* getClone ()               {  return q_clone ; }
 
index 1fe11fdf0837670706b1a7b3c7b8e95131a2b814..20e0cd0c48fb428de7485ab15dac47598badcb34 100755 (executable)
@@ -114,7 +114,7 @@ BEGIN_NAMESPACE_HEXA
 
 enum EnumCoord  { dir_x, dir_y, dir_z, DIM3 };
 enum EnumElt    { EL_NONE, EL_VERTEX, EL_EDGE, EL_QUAD, EL_HEXA, EL_VECTOR, 
-                  EL_REMOVED, EL_MAXI };
+                  EL_GRID, EL_CYLINDER, EL_PIPE, EL_REMOVED, EL_MAXI };
 
 enum EnumGroup  { HexaCell, QuadCell, EdgeCell, 
                   HexaNode, QuadNode, EdgeNode, VertexNode};
index 8511831047834ad21a6bc195b0cf0fb6e2d6f0aa..dc68957be71e3629d4720c1391bef8f957108c03 100644 (file)
   <layout class="QVBoxLayout" name="verticalLayout_2">
    <item>
     <widget class="QGroupBox" name="groupBox">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="title">
       <string>Arguments</string>
      </property>
      <layout class="QFormLayout" name="formLayout">
-      <item row="2" column="0">
+      <item row="0" column="0">
+       <widget class="QLabel" name="label">
+        <property name="text">
+         <string>Edge </string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QLineEdit" name="e_le">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</height>
+         </size>
+        </property>
+        <property name="readOnly">
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0">
        <widget class="QLabel" name="label_2">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
         </property>
        </widget>
       </item>
-      <item row="2" column="1">
+      <item row="1" column="1">
        <widget class="QSpinBox" name="nb_cut_spb">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
        </widget>
       </item>
-      <item row="1" column="1">
-       <widget class="QLineEdit" name="e_le">
-        <property name="maximumSize">
-         <size>
-          <width>127</width>
-          <height>16777215</height>
-         </size>
-        </property>
-        <property name="readOnly">
-         <bool>false</bool>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="0">
-       <widget class="QLabel" name="label">
-        <property name="text">
-         <string>Edge </string>
-        </property>
-       </widget>
-      </item>
      </layout>
     </widget>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>e_le</tabstop>
+  <tabstop>nb_cut_spb</tabstop>
+ </tabstops>
  <resources/>
  <connections/>
 </ui>
index 70562e2a97ad9ca5232f2f64fbf2edf8887b0dd4..1083be8fa3df52d409a5c04fd03549ce3fb62158 100644 (file)
@@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>247</width>
+    <width>221</width>
     <height>208</height>
    </rect>
   </property>
@@ -18,7 +18,7 @@
   </property>
   <property name="minimumSize">
    <size>
-    <width>5</width>
+    <width>0</width>
     <height>0</height>
    </size>
   </property>
       <item row="1" column="1">
        <widget class="QLineEdit" name="name_le">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
       <item row="2" column="1">
        <widget class="QLineEdit" name="vex_le">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
       </item>
       <item row="4" column="1">
        <widget class="QLineEdit" name="vec_le">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>name_le</tabstop>
+  <tabstop>vex_le</tabstop>
+  <tabstop>vec_le</tabstop>
+  <tabstop>r_spb</tabstop>
+  <tabstop>h_spb</tabstop>
+ </tabstops>
  <resources/>
  <connections/>
 </ui>
index d5dd26da9cb708ce1c475afcabd3f8f258a0c93c..0711c29c27611d214d16651360426c38e9630f45 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>282</width>
-    <height>623</height>
+    <width>270</width>
+    <height>556</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -34,7 +34,7 @@
      <property name="minimumSize">
       <size>
        <width>0</width>
-       <height>50</height>
+       <height>0</height>
       </size>
      </property>
      <property name="maximumSize">
          </size>
         </property>
         <layout class="QFormLayout" name="formLayout">
-         <property name="sizeConstraint">
-          <enum>QLayout::SetDefaultConstraint</enum>
-         </property>
-         <property name="fieldGrowthPolicy">
-          <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
-         </property>
          <item row="0" column="0">
           <widget class="QLabel" name="label_5">
            <property name="text">
          <item row="0" column="1">
           <widget class="QLineEdit" name="v_le_rb0">
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
          <item row="1" column="1">
           <widget class="QLineEdit" name="h_le_rb0">
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
          </size>
         </property>
         <layout class="QFormLayout" name="formLayout_2">
-         <property name="sizeConstraint">
-          <enum>QLayout::SetDefaultConstraint</enum>
-         </property>
-         <property name="fieldGrowthPolicy">
-          <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
-         </property>
          <item row="0" column="0">
           <widget class="QLabel" name="label_3">
            <property name="text">
          <item row="0" column="1">
           <widget class="QLineEdit" name="e_le_rb1">
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
          <item row="1" column="1">
           <widget class="QLineEdit" name="h_le_rb1">
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
          <item row="0" column="1">
           <widget class="QLineEdit" name="q_le_rb2">
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
          <item row="1" column="1">
           <widget class="QLineEdit" name="h_le_rb2">
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
         <property name="maximumSize">
          <size>
           <width>16777215</width>
-          <height>344</height>
+          <height>16777215</height>
          </size>
         </property>
         <layout class="QVBoxLayout" name="verticalLayout_4">
            <property name="maximumSize">
             <size>
              <width>16777215</width>
-             <height>131</height>
+             <height>16777215</height>
             </size>
            </property>
            <property name="title">
             <item>
              <widget class="QListWidget" name="d_edges_lw">
               <property name="sizePolicy">
-               <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+               <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
                 <horstretch>0</horstretch>
                 <verstretch>0</verstretch>
                </sizepolicy>
               <property name="maximumSize">
                <size>
                 <width>16777215</width>
-                <height>16777215</height>
+                <height>70</height>
                </size>
               </property>
              </widget>
            <property name="maximumSize">
             <size>
              <width>16777215</width>
-             <height>131</height>
+             <height>16777215</height>
             </size>
            </property>
            <property name="title">
             <item>
              <widget class="QListWidget" name="hexas_lw">
               <property name="sizePolicy">
-               <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+               <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
                 <horstretch>0</horstretch>
                 <verstretch>0</verstretch>
                </sizepolicy>
               <property name="maximumSize">
                <size>
                 <width>16777215</width>
-                <height>16777215</height>
+                <height>70</height>
                </size>
               </property>
              </widget>
      </layout>
     </widget>
    </item>
-   <item>
-    <spacer name="verticalSpacer">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>10</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
   </layout>
  </widget>
  <resources/>
   <connection>
    <sender>rb1</sender>
    <signal>clicked()</signal>
-   <receiver>widget_4</receiver>
+   <receiver>widget</receiver>
    <slot>hide()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>140</x>
-     <y>40</y>
+     <x>153</x>
+     <y>51</y>
     </hint>
     <hint type="destinationlabel">
-     <x>167</x>
-     <y>479</y>
+     <x>143</x>
+     <y>109</y>
     </hint>
    </hints>
   </connection>
   <connection>
-   <sender>rb2</sender>
+   <sender>rb0</sender>
    <signal>clicked()</signal>
-   <receiver>widget_4</receiver>
-   <slot>hide()</slot>
+   <receiver>widget</receiver>
+   <slot>show()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>291</x>
-     <y>40</y>
+     <x>61</x>
+     <y>48</y>
     </hint>
     <hint type="destinationlabel">
-     <x>167</x>
-     <y>479</y>
+     <x>76</x>
+     <y>104</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>rb3</sender>
    <signal>clicked()</signal>
-   <receiver>widget_4</receiver>
-   <slot>show()</slot>
+   <receiver>widget</receiver>
+   <slot>hide()</slot>
    <hints>
     <hint type="sourcelabel">
      <x>223</x>
     </hint>
     <hint type="destinationlabel">
      <x>167</x>
-     <y>479</y>
+     <y>120</y>
     </hint>
    </hints>
   </connection>
    </hints>
   </connection>
   <connection>
-   <sender>rb0</sender>
+   <sender>rb2</sender>
    <signal>clicked()</signal>
-   <receiver>widget_4</receiver>
+   <receiver>widget_2</receiver>
    <slot>hide()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>58</x>
-     <y>40</y>
+     <x>271</x>
+     <y>46</y>
     </hint>
     <hint type="destinationlabel">
-     <x>167</x>
-     <y>479</y>
+     <x>268</x>
+     <y>194</y>
     </hint>
    </hints>
   </connection>
   <connection>
-   <sender>rb2</sender>
+   <sender>rb1</sender>
    <signal>clicked()</signal>
-   <receiver>widget_3</receiver>
+   <receiver>widget_2</receiver>
    <slot>show()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>258</x>
-     <y>46</y>
+     <x>197</x>
+     <y>48</y>
     </hint>
     <hint type="destinationlabel">
-     <x>238</x>
-     <y>310</y>
+     <x>218</x>
+     <y>182</y>
     </hint>
    </hints>
   </connection>
   <connection>
-   <sender>rb2</sender>
+   <sender>rb0</sender>
    <signal>clicked()</signal>
    <receiver>widget_2</receiver>
    <slot>hide()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>271</x>
+     <x>94</x>
      <y>46</y>
     </hint>
     <hint type="destinationlabel">
-     <x>268</x>
-     <y>194</y>
+     <x>181</x>
+     <y>180</y>
     </hint>
    </hints>
   </connection>
   <connection>
-   <sender>rb0</sender>
+   <sender>rb2</sender>
    <signal>clicked()</signal>
    <receiver>widget_3</receiver>
-   <slot>hide()</slot>
+   <slot>show()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>41</x>
-     <y>49</y>
+     <x>258</x>
+     <y>46</y>
     </hint>
     <hint type="destinationlabel">
-     <x>73</x>
+     <x>238</x>
      <y>310</y>
     </hint>
    </hints>
   </connection>
   <connection>
-   <sender>rb1</sender>
+   <sender>rb0</sender>
    <signal>clicked()</signal>
-   <receiver>widget</receiver>
+   <receiver>widget_3</receiver>
    <slot>hide()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>153</x>
-     <y>51</y>
+     <x>41</x>
+     <y>49</y>
     </hint>
     <hint type="destinationlabel">
-     <x>143</x>
-     <y>109</y>
+     <x>73</x>
+     <y>310</y>
     </hint>
    </hints>
   </connection>
   <connection>
-   <sender>rb0</sender>
+   <sender>rb3</sender>
    <signal>clicked()</signal>
-   <receiver>widget_2</receiver>
+   <receiver>widget_3</receiver>
    <slot>hide()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>94</x>
-     <y>46</y>
+     <x>223</x>
+     <y>40</y>
     </hint>
     <hint type="destinationlabel">
-     <x>181</x>
-     <y>180</y>
+     <x>167</x>
+     <y>260</y>
     </hint>
    </hints>
   </connection>
   <connection>
-   <sender>rb0</sender>
+   <sender>rb1</sender>
    <signal>clicked()</signal>
-   <receiver>widget</receiver>
-   <slot>show()</slot>
+   <receiver>widget_3</receiver>
+   <slot>hide()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>61</x>
-     <y>48</y>
+     <x>182</x>
+     <y>38</y>
     </hint>
     <hint type="destinationlabel">
-     <x>76</x>
-     <y>104</y>
+     <x>190</x>
+     <y>310</y>
     </hint>
    </hints>
   </connection>
   <connection>
-   <sender>rb1</sender>
+   <sender>rb2</sender>
    <signal>clicked()</signal>
-   <receiver>widget_2</receiver>
-   <slot>show()</slot>
+   <receiver>widget_4</receiver>
+   <slot>hide()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>197</x>
-     <y>48</y>
+     <x>291</x>
+     <y>40</y>
     </hint>
     <hint type="destinationlabel">
-     <x>218</x>
-     <y>182</y>
+     <x>167</x>
+     <y>479</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>rb1</sender>
    <signal>clicked()</signal>
-   <receiver>widget_3</receiver>
+   <receiver>widget_4</receiver>
    <slot>hide()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>182</x>
-     <y>38</y>
+     <x>140</x>
+     <y>40</y>
     </hint>
     <hint type="destinationlabel">
-     <x>190</x>
-     <y>310</y>
+     <x>167</x>
+     <y>479</y>
     </hint>
    </hints>
   </connection>
   <connection>
-   <sender>rb3</sender>
+   <sender>rb0</sender>
    <signal>clicked()</signal>
-   <receiver>widget_3</receiver>
+   <receiver>widget_4</receiver>
    <slot>hide()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>223</x>
+     <x>58</x>
      <y>40</y>
     </hint>
     <hint type="destinationlabel">
      <x>167</x>
-     <y>260</y>
+     <y>479</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>rb3</sender>
    <signal>clicked()</signal>
-   <receiver>widget</receiver>
-   <slot>hide()</slot>
+   <receiver>widget_4</receiver>
+   <slot>show()</slot>
    <hints>
     <hint type="sourcelabel">
      <x>223</x>
     </hint>
     <hint type="destinationlabel">
      <x>167</x>
-     <y>120</y>
+     <y>479</y>
     </hint>
    </hints>
   </connection>
index f42defd67f122df8bb78535ebb0fd60896d6909e..50d4589410d5d73e27c6648d52ea9ce4913acbfd 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>309</width>
-    <height>789</height>
+    <width>260</width>
+    <height>635</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -48,8 +48,8 @@
        <rect>
         <x>0</x>
         <y>0</y>
-        <width>287</width>
-        <height>767</height>
+        <width>223</width>
+        <height>620</height>
        </rect>
       </property>
       <layout class="QVBoxLayout" name="verticalLayout_2">
          <property name="title">
           <string>Arguments</string>
          </property>
-         <layout class="QVBoxLayout" name="verticalLayout">
+         <layout class="QVBoxLayout" name="verticalLayout_5">
           <item>
            <widget class="QGroupBox" name="vertex_gb">
             <property name="enabled">
             <property name="title">
              <string>Vertex</string>
             </property>
-            <layout class="QGridLayout" name="gridLayout_4">
-             <item row="0" column="0">
-              <widget class="QLabel" name="label">
-               <property name="text">
-                <string>First : </string>
-               </property>
-              </widget>
-             </item>
-             <item row="0" column="1">
-              <widget class="QLineEdit" name="first_vex_le">
-               <property name="readOnly">
-                <bool>false</bool>
-               </property>
-              </widget>
-             </item>
-             <item row="0" column="2">
-              <spacer name="horizontalSpacer">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>78</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
+            <layout class="QHBoxLayout" name="horizontalLayout_5">
+             <item>
+              <layout class="QFormLayout" name="formLayout_2">
+               <item row="0" column="0">
+                <widget class="QLabel" name="label">
+                 <property name="text">
+                  <string>First : </string>
+                 </property>
+                </widget>
+               </item>
+               <item row="0" column="1">
+                <widget class="QLineEdit" name="first_vex_le">
+                 <property name="sizePolicy">
+                  <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+                   <horstretch>0</horstretch>
+                   <verstretch>0</verstretch>
+                  </sizepolicy>
+                 </property>
+                 <property name="readOnly">
+                  <bool>false</bool>
+                 </property>
+                </widget>
+               </item>
+              </layout>
              </item>
             </layout>
            </widget>
             <property name="title">
              <string>Edge of model</string>
             </property>
-            <layout class="QHBoxLayout" name="horizontalLayout_3">
-             <item>
-              <widget class="QLineEdit" name="single_edge_le"/>
+            <layout class="QFormLayout" name="formLayout_3">
+             <item row="0" column="0" colspan="2">
+              <widget class="QLineEdit" name="single_edge_le">
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+               <property name="maximumSize">
+                <size>
+                 <width>16777215</width>
+                 <height>58</height>
+                </size>
+               </property>
+              </widget>
              </item>
             </layout>
            </widget>
             <property name="title">
              <string>Edges of model</string>
             </property>
-            <layout class="QGridLayout" name="gridLayout_2">
-             <item row="0" column="0" rowspan="2">
-              <widget class="QListWidget" name="edges_lw"/>
+            <layout class="QVBoxLayout" name="verticalLayout_3">
+             <item>
+              <widget class="QListWidget" name="edges_lw">
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+               <property name="maximumSize">
+                <size>
+                 <width>16777215</width>
+                 <height>16777215</height>
+                </size>
+               </property>
+              </widget>
              </item>
             </layout>
            </widget>
             <property name="title">
              <string>Line of the geometry</string>
             </property>
-            <layout class="QVBoxLayout" name="verticalLayout_3">
+            <layout class="QVBoxLayout" name="verticalLayout">
              <item>
-              <layout class="QHBoxLayout" name="horizontalLayout_4">
-               <item>
+              <layout class="QFormLayout" name="formLayout_4">
+               <item row="0" column="0">
                 <widget class="QLabel" name="label_4">
                  <property name="text">
                   <string>Line : </string>
                  </property>
                 </widget>
                </item>
-               <item>
+               <item row="0" column="1">
                 <widget class="QLineEdit" name="single_line_le">
+                 <property name="sizePolicy">
+                  <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+                   <horstretch>0</horstretch>
+                   <verstretch>0</verstretch>
+                  </sizepolicy>
+                 </property>
                  <property name="readOnly">
                   <bool>false</bool>
                  </property>
               </layout>
              </item>
              <item>
-              <widget class="QListWidget" name="lines_lw"/>
+              <widget class="QListWidget" name="lines_lw">
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
+              </widget>
              </item>
              <item>
               <layout class="QHBoxLayout" name="horizontalLayout">
index ade2b3e43ef65797f6e086c79c122d313789e7ce..7615441c206189828b6ed2252c8fe2f260b4811f 100644 (file)
@@ -9,7 +9,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>294</width>
+    <width>241</width>
     <height>322</height>
    </rect>
   </property>
      <property name="title">
       <string>Arguments</string>
      </property>
-     <layout class="QFormLayout" name="formLayout_3">
-      <property name="fieldGrowthPolicy">
-       <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
-      </property>
-      <item row="2" column="0">
-       <widget class="QLabel" name="label_6">
-        <property name="text">
-         <string> Name </string>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="1">
-       <widget class="QLineEdit" name="name_le">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="maximumSize">
-         <size>
-          <width>127</width>
-          <height>16777215</height>
-         </size>
-        </property>
-        <property name="text">
-         <string/>
-        </property>
+     <layout class="QVBoxLayout" name="verticalLayout">
+      <item>
+       <widget class="QWidget" name="widget_3" native="true">
+        <layout class="QFormLayout" name="formLayout_4">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_6">
+           <property name="text">
+            <string> Name </string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QLineEdit" name="name_le">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>16777215</height>
+            </size>
+           </property>
+           <property name="text">
+            <string/>
+           </property>
+          </widget>
+         </item>
+        </layout>
        </widget>
       </item>
-      <item row="3" column="0" colspan="2">
+      <item>
        <widget class="QWidget" name="widget" native="true">
         <layout class="QFormLayout" name="formLayout">
          <item row="0" column="0">
          <item row="0" column="1">
           <widget class="QLineEdit" name="vex_le_rb1">
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
            </property>
           </widget>
          </item>
-         <item row="2" column="0">
+         <item row="1" column="0">
           <widget class="QLabel" name="label_4">
            <property name="text">
             <string>Vector</string>
            </property>
           </widget>
          </item>
-         <item row="2" column="1">
+         <item row="1" column="1">
           <widget class="QLineEdit" name="vec_le_rb1">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
         </layout>
        </widget>
       </item>
-      <item row="4" column="0" colspan="2">
+      <item>
        <widget class="QWidget" name="widget_2" native="true">
         <layout class="QFormLayout" name="formLayout_2">
          <item row="0" column="0">
          </item>
          <item row="0" column="1">
           <widget class="QLineEdit" name="v0_le_rb0">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
          </item>
          <item row="1" column="1">
           <widget class="QLineEdit" name="v1_le_rb0">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
      </layout>
     </widget>
    </item>
-   <item>
-    <spacer name="verticalSpacer">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>10</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>rb0</tabstop>
+  <tabstop>rb1</tabstop>
+  <tabstop>name_le</tabstop>
+  <tabstop>vex_le_rb1</tabstop>
+  <tabstop>vec_le_rb1</tabstop>
+  <tabstop>v0_le_rb0</tabstop>
+  <tabstop>v1_le_rb0</tabstop>
+ </tabstops>
  <resources/>
  <connections>
   <connection>
index 808e02cfad8c1593a5984c69466eea46447557d9..868bdc78ffc568189d877f54efaa1f27aeaaae25 100644 (file)
@@ -6,12 +6,12 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>298</width>
-    <height>306</height>
+    <width>194</width>
+    <height>256</height>
    </rect>
   </property>
   <property name="sizePolicy">
-   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+   <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout">
       <item>
-       <layout class="QFormLayout" name="formLayout">
-        <item row="0" column="0">
-         <widget class="QLabel" name="label">
-          <property name="text">
-           <string>name :</string>
-          </property>
-         </widget>
-        </item>
-        <item row="0" column="1">
-         <widget class="QLineEdit" name="name_le">
-          <property name="maximumSize">
-           <size>
-            <width>127</width>
-            <height>16777215</height>
-           </size>
-          </property>
-         </widget>
-        </item>
-        <item row="1" column="0">
-         <widget class="QLabel" name="label_2">
-          <property name="text">
-           <string>kind : </string>
-          </property>
-         </widget>
-        </item>
-        <item row="1" column="1">
-         <widget class="QComboBox" name="kind_cb">
-          <item>
-           <property name="text">
-            <string>Edge Cell</string>
-           </property>
-          </item>
-          <item>
+       <widget class="QFrame" name="frame">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="frameShape">
+         <enum>QFrame::StyledPanel</enum>
+        </property>
+        <property name="frameShadow">
+         <enum>QFrame::Raised</enum>
+        </property>
+        <layout class="QFormLayout" name="formLayout">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label">
            <property name="text">
-            <string>Quad Cell</string>
+            <string>name :</string>
            </property>
-          </item>
-          <item>
-           <property name="text">
-            <string>Hexa Cell</string>
-           </property>
-          </item>
-          <item>
-           <property name="text">
-            <string>Vertex Node</string>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QLineEdit" name="name_le">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
            </property>
-          </item>
-          <item>
-           <property name="text">
-            <string>Edge Node</string>
-           </property>
-          </item>
-          <item>
-           <property name="text">
-            <string>Quad Node</string>
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>16777215</height>
+            </size>
            </property>
-          </item>
-          <item>
+          </widget>
+         </item>
+         <item row="1" column="0">
+          <widget class="QLabel" name="label_2">
            <property name="text">
-            <string>Hexa Node</string>
+            <string>kind : </string>
            </property>
-          </item>
-         </widget>
-        </item>
-       </layout>
+          </widget>
+         </item>
+         <item row="1" column="1">
+          <widget class="QComboBox" name="kind_cb">
+           <item>
+            <property name="text">
+             <string>Edge Cell</string>
+            </property>
+           </item>
+           <item>
+            <property name="text">
+             <string>Quad Cell</string>
+            </property>
+           </item>
+           <item>
+            <property name="text">
+             <string>Hexa Cell</string>
+            </property>
+           </item>
+           <item>
+            <property name="text">
+             <string>Vertex Node</string>
+            </property>
+           </item>
+           <item>
+            <property name="text">
+             <string>Edge Node</string>
+            </property>
+           </item>
+           <item>
+            <property name="text">
+             <string>Quad Node</string>
+            </property>
+           </item>
+           <item>
+            <property name="text">
+             <string>Hexa Node</string>
+            </property>
+           </item>
+          </widget>
+         </item>
+        </layout>
+       </widget>
       </item>
       <item>
        <layout class="QGridLayout" name="gridLayout">
         <item row="0" column="0" rowspan="2">
-         <widget class="QListWidget" name="eltBase_lw"/>
+         <widget class="QListWidget" name="eltBase_lw">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+         </widget>
         </item>
        </layout>
       </item>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>name_le</tabstop>
+  <tabstop>eltBase_lw</tabstop>
+  <tabstop>kind_cb</tabstop>
+ </tabstops>
  <resources/>
  <connections/>
 </ui>
index 89443f877a825da9d12c81bfdcf0c8eee5787da2..4032e1b6d86cb24b11ea11765e4771629ac85a38 100755 (executable)
@@ -49,6 +49,8 @@
 #include <SVTK_ViewModel.h>
 #include <SVTK_ViewWindow.h>
 
+#include <VTKViewer_ViewModel.h>
+
 
 
 #include <SOCC_ViewModel.h>
 
 #define DW_MINIMUM_WIDTH       50
 #define DWINPUT_MINIMUM_HEIGHT 50
+#define DWINPUT_MINIMUM_WIDTH 255
 
 using namespace std;
 using namespace HEXABLOCK::GUI;
@@ -130,6 +133,7 @@ GEOM::GEOM_Gen_var               HEXABLOCKGUI::_geomEngine  = GEOM::GEOM_Gen::_n
 
 SVTK_ViewWindow*      HEXABLOCKGUI::currentVtkView = NULL;
 OCCViewer_ViewWindow* HEXABLOCKGUI::currentOccView = NULL;
+bool HEXABLOCKGUI::assocInProgress = false;
 
 HEXABLOCKGUI::HEXABLOCKGUI() :
   SalomeApp_Module( "HEXABLOCK" ), // default name
@@ -157,7 +161,9 @@ HEXABLOCKGUI::HEXABLOCKGUI() :
   _groupsSelectionModel(0),
 //   _documentCnt(0),
   _isSaved( false ),
-  _suitVM(0),//,
+  moduleActivatedOnce(false),
+  vtkViewManager(0),//,
+  occViewManager(0),
 //   _selectFromTree( false )
   _vertexDiag(0),
   _edgeDiag(0),
@@ -190,7 +196,8 @@ HEXABLOCKGUI::HEXABLOCKGUI() :
   _computeMeshDiag(0),
   _replaceHexaDiag(0),
   _quadRevolutionDiag(0),
-  _makeHemiSphereDiag(0)
+  _makeHemiSphereDiag(0),
+  currentDialog(NULL)
 {
   DEBTRACE("HEXABLOCKGUI::HEXABLOCKGUI");
 //   _studyContextMap.clear();
@@ -237,7 +244,9 @@ GEOM::GEOM_Gen_ptr HEXABLOCKGUI::InitGEOMGen( SalomeApp_Application* app,
                                               const std::string& container )
 {
   Engines::EngineComponent_var comp = app->lcc()->FindOrLoad_Component( container.c_str(), "GEOM" );
+  MESSAGE("INITINITINITINIT comp : " << comp);
   GEOM::GEOM_Gen_ptr            clr = GEOM::GEOM_Gen::_narrow(comp);
+  MESSAGE("INITINITINITINIT clr 1: " << clr);
   ASSERT(!CORBA::is_nil(clr));
   return clr;
 }
@@ -250,6 +259,7 @@ void HEXABLOCKGUI::initialize( CAM_Application* app )
 
   _hexaEngine = InitHEXABLOCKGen( dynamic_cast<SalomeApp_Application*>( app ) );
   _geomEngine = InitGEOMGen( dynamic_cast<SalomeApp_Application*>( app ) );
+  MESSAGE("INITINITINITINIT clr 2: " << _geomEngine);
 
   QWidget* aParent = application()->desktop();
   DEBTRACE(app << "  " << application() << " " << application()->desktop() << " " << aParent);
@@ -280,7 +290,6 @@ void HEXABLOCKGUI::initialize( CAM_Application* app )
   studyActivated();
   // add component to study
   if (createSComponent()) updateObjBrowser();
-
 }
 
 void HEXABLOCKGUI::viewManagers( QStringList& list ) const
@@ -294,6 +303,7 @@ void HEXABLOCKGUI::viewManagers( QStringList& list ) const
 //   list.append( SVTK_Viewer::Type() );
 }
 
+
 bool HEXABLOCKGUI::activateModule( SUIT_Study* theStudy )
 {
   DEBTRACE("HEXABLOCKGUI::activateModule");
@@ -307,9 +317,9 @@ bool HEXABLOCKGUI::activateModule( SUIT_Study* theStudy )
   else
     showAllMenus();
 
-
 //   showDockWidgets(false);
   showDockWidgets(true);
+  if (_dwInputPanel) _dwInputPanel->close();
 
 //   // import Python module that manages HEXABLOCK plugins (need to be here because SalomePyQt API uses active module)
 //   PyGILState_STATE gstate = PyGILState_Ensure();
@@ -333,6 +343,7 @@ bool HEXABLOCKGUI::activateModule( SUIT_Study* theStudy )
 //       connect( getApp(),   SIGNAL(studyClosed()), _genericGui,SLOT  (onCleanOnExit()));
 
 
+//  vtkViewManager = getApp()->getViewManager(SVTK_Viewer::Type(), true); //create the view manager if it doesn't exist
   LightApp_SelectionMgr* sm = getApp()->selectionMgr();
 
   SUIT_ViewManager* vm;
@@ -378,6 +389,9 @@ bool HEXABLOCKGUI::activateModule( SUIT_Study* theStudy )
       updateObjBrowser(); // objects can be removed
     }
 
+  if (vtkViewManager==NULL || !vtkViewManager->getViewsCount()) newDocument();
+  if (_currentGraphicView != NULL)
+         _currentGraphicView->get_SUIT_ViewWindow()->setFocus();
 
   return bOk;
 }
@@ -386,10 +400,11 @@ bool HEXABLOCKGUI::activateModule( SUIT_Study* theStudy )
 
 bool HEXABLOCKGUI::deactivateModule( SUIT_Study* theStudy )
 {
-  DEBTRACE("HEXABLOCKGUI::deactivateModule");
+  MESSAGE("HEXABLOCKGUI::deactivateModule");
 
   setMenuShown( false );
   setToolShown( false );
+  if (_dwInputPanel) _dwInputPanel->close();
   showDockWidgets( false );
 //   QtGuiContext *context = QtGuiContext::getQtCurrent();
 //   _studyContextMap[theStudy->id()] = context;
@@ -406,10 +421,16 @@ bool HEXABLOCKGUI::deactivateModule( SUIT_Study* theStudy )
     HEXABLOCKGUI::currentVtkView->SetSelectionMode( ActorSelection ); //default selectionMode in VTKView
   }
 
-//  if (HEXABLOCKGUI::currentOccView)
-//  {
-//      //getDisplayer()->globalSelection();//????     //defaut selectionMode in OccView
-//  }
+  if (HEXABLOCKGUI::currentOccView != NULL)
+  {
+         getApp()->selectionMgr()->clearSelected();
+         //defaut selectionMode in OccView
+         if (currentDialog != NULL)
+         {
+                 currentDialog->globalSelection();
+                 currentDialog->localSelection(GEOM::GEOM_Object::_nil(), TopAbs_SHAPE);
+         }
+  }
 
 
 //   if ( _patternDataSelectionModel ){
@@ -423,11 +444,11 @@ bool HEXABLOCKGUI::deactivateModule( SUIT_Study* theStudy )
 
   qDeleteAll(myOCCSelectors);
   myOCCSelectors.clear();
-  getApp()->selectionMgr()->setEnabled( true, OCCViewer_Viewer::Type() );
+  getApp()->selectionMgr()->setEnabled( false, OCCViewer_Viewer::Type() );
 
   qDeleteAll(myVTKSelectors);
   myVTKSelectors.clear();
-  getApp()->selectionMgr()->setEnabled( true, SVTK_Viewer::Type() );
+  getApp()->selectionMgr()->setEnabled( false, SVTK_Viewer::Type() );
 
   return SalomeApp_Module::deactivateModule( theStudy );
 }
@@ -484,7 +505,6 @@ bool HEXABLOCKGUI::renameObject( const QString& entry, const QString& name)
   return result;
 }
 
-
 // --- Default windows
 void HEXABLOCKGUI::windows( QMap<int, int>& theMap ) const
 {
@@ -508,8 +528,6 @@ void HEXABLOCKGUI::windows( QMap<int, int>& theMap ) const
 // }
 
 
-
-
 QString  HEXABLOCKGUI::engineIOR() const
 {
   DEBTRACE("HEXABLOCKGUI::engineIOR");
@@ -557,32 +575,37 @@ void HEXABLOCKGUI::onObjectBrowserClick(const QModelIndex& index)
 
 void HEXABLOCKGUI::onWindowActivated( SUIT_ViewWindow* svw)
 {
-  DEBTRACE("HEXABLOCKGUI::onWindowActivated");
-  OCCViewer_ViewWindow* anOccVw = dynamic_cast<OCCViewer_ViewWindow*>(svw);
+       DEBTRACE("HEXABLOCKGUI::onWindowActivated");
+       MESSAGE("HEXABLOCKGUI::onWindowActivated");
+       OCCViewer_ViewWindow* anOccVw = dynamic_cast<OCCViewer_ViewWindow*>(svw);
 
-  if ( anOccVw != NULL )
-    currentOccView = dynamic_cast<OCCViewer_ViewWindow*>(svw);
-//   OCCViewer_Viewer*     aModel = dynamic_cast<OCCViewer_Viewer*>(svw);
+       if ( anOccVw != NULL)
+       {
+               currentOccView->installEventFilter(this);
+               if (anOccVw != currentOccView)
+                       currentOccView = anOccVw;
+       }
 
-  // we want to switch automatically to the right model
-  // only VTK view
-  SVTK_ViewWindow* viewWindow = dynamic_cast<SVTK_ViewWindow*>(svw);
-  if (!viewWindow) return;
-  if (getApp()->activeModule() && getApp()->activeModule()->moduleName().compare("HEXABLOCK") != 0) //CS_TODO?
-    getApp()->activateModule("HEXABLOCK");
+       // we want to switch automatically to the right model
+       // only VTK view
+       SVTK_ViewWindow* viewWindow = dynamic_cast<SVTK_ViewWindow*>(svw);
+       if (!viewWindow) return;
 
-  switchModel( viewWindow );
-}
+       if (getApp()->activeModule() && getApp()->activeModule()->moduleName().compare("HEXABLOCK") != 0) //CS_TODO?
+               getApp()->activateModule("HEXABLOCK");
 
+       if (viewWindow != currentVtkView)
+       {
+               switchModel( viewWindow );
+               currentVtkView = viewWindow;
+       }
+}
 
 void HEXABLOCKGUI::onWindowClosed( SUIT_ViewWindow* svw)
 {
   DEBTRACE("HEXABLOCKGUI::onWindowClosed");
 }
 
-
-
-
 void HEXABLOCKGUI::onViewManagerAdded( SUIT_ViewManager*  vm)
 {
   DEBTRACE("HEXABLOCKGUI::onViewManagerAdded");
@@ -593,8 +616,8 @@ void HEXABLOCKGUI::onViewManagerAdded( SUIT_ViewManager*  vm)
 // //              this, SLOT( OnKeyPress( SUIT_ViewWindow*, QKeyEvent* ) ) );
 // //     connect( vm, SIGNAL( mousePress( SUIT_ViewWindow*, QMouseEvent* ) ),
 // //              this, SLOT( OnMousePress( SUIT_ViewWindow*, QMouseEvent* ) ) );
-// //     connect( vm, SIGNAL( mouseMove ( SUIT_ViewWindow*, QMouseEvent* ) ),
-// //              this, SLOT( OnMouseMove( SUIT_ViewWindow*, QMouseEvent* ) ) );
+//      connect( vm, SIGNAL( mouseMove ( SUIT_ViewWindow*, QMouseEvent* ) ),
+//               this, SLOT( OnMouseMove( SUIT_ViewWindow*, QMouseEvent* ) ) );
 //     LightApp_SelectionMgr* sm = getApp()->selectionMgr();
 //     myOCCSelectors.append( new GEOMGUI_OCCSelector( ((OCCViewer_ViewManager*)vm)->getOCCViewer(), sm ) );
 //
@@ -767,10 +790,16 @@ void HEXABLOCKGUI::treeContextMenu(const QPoint& aPosition)
 
          QStandardItem *item = _patternDataModel->itemFromIndex ( currentIndex );
 
-         //We don't do anything for single items having no association
+         //We don't do anything for single items
          if ( item->type() == VERTEXITEM || item->type() == EDGEITEM ||
-                         item->type() == QUADITEM || item->type() == HEXAITEM) return;
-
+                         item->type() == QUADITEM || item->type() == HEXAITEM)
+                 return;
+
+         //No associations for HEXA
+         QVariant treeVariant = currentIndex.data( HEXA_TREE_ROLE );
+         if ( !treeVariant.isValid() ) return;
+         int eltType = treeVariant.toInt();
+         if (eltType == HEXA_DIR_TREE) return;
          QMenu menu( _patternDataTreeView );
 
          //Show association(s)
@@ -794,12 +823,14 @@ void HEXABLOCKGUI::createAndFillDockWidget()
 
   //1) *********** user input panel ( contain user's edit dialog box )
   _dwInputPanel = new QDockWidget(aParent);
+//  QLayout* inputLayout = new QVBoxLayout(aParent);
+//  _dwInputPanel->setLayout(inputLayout);
 //   _dwInputPanel->setWindowFlags(Qt::FramelessWindowHint);
 //   _dwInputPanel->setWindowFlags(Qt::WindowTitleHint);
   _dwInputPanel->setVisible(false);
   _dwInputPanel->setWindowTitle("Input Panel");
 //   _dwInputPanel->setMinimumHeight(DWINPUT_MINIMUM_HEIGHT);
-  _dwInputPanel->setMinimumWidth(DW_MINIMUM_WIDTH); // --- force a minimum until display
+  _dwInputPanel->setMinimumWidth(DWINPUT_MINIMUM_WIDTH); // --- force a minimum until display
   _dwInputPanel->raise();
 
 //   _stacked = new QStackedWidget(_dwInputPanel);
@@ -892,8 +923,9 @@ void HEXABLOCKGUI::createAndFillDockWidget()
   aParent->addDockWidget( Qt::LeftDockWidgetArea, _dwInputPanel );
 
   aParent->tabifyDockWidget( _dwObjectBrowser, _dwPattern );
-  aParent->tabifyDockWidget( _dwPattern, /*_dwAssociation );
-  aParent->tabifyDockWidget( _dwAssociation, */_dwGroups );
+//  aParent->tabifyDockWidget( _dwPattern, /*_dwAssociation );
+//  aParent->tabifyDockWidget( _dwAssociation, */_dwGroups );
+  aParent->tabifyDockWidget( _dwPattern, _dwGroups );
   aParent->tabifyDockWidget( _dwGroups, _dwMesh );
 
 
@@ -907,8 +939,6 @@ void HEXABLOCKGUI::createAndFillDockWidget()
 //   connect( _dwGroups, SIGNAL( visibilityChanged(bool) ),      this, SLOT( showGroupsMenus(bool) ) );
 //   connect( _dwMesh, SIGNAL( visibilityChanged(bool) ),        this, SLOT( showMeshMenus(bool) ) );
 
-
-
   // popup menu on data tree view
  _patternDataTreeView->setContextMenuPolicy(Qt::CustomContextMenu);
   connect(_patternDataTreeView,
@@ -1537,10 +1567,10 @@ void HEXABLOCKGUI::switchModel(SUIT_ViewWindow *view)
     _meshTreeView->setModel(_meshModel);
 
     // set selections for each view
-    if ( _patternDataSelectionModel )    delete _patternDataSelectionModel;
-    if ( _patternBuilderSelectionModel ) delete _patternBuilderSelectionModel;
-    if ( _groupsSelectionModel )         delete _groupsSelectionModel;
-    if ( _meshSelectionModel )           delete _meshSelectionModel;
+//    if ( _patternDataSelectionModel )    delete _patternDataSelectionModel;
+//    if ( _patternBuilderSelectionModel ) delete _patternBuilderSelectionModel;
+//    if ( _groupsSelectionModel )         delete _groupsSelectionModel;
+//    if ( _meshSelectionModel )           delete _meshSelectionModel;
 
     _patternDataSelectionModel    = new PatternDataSelectionModel( _patternDataModel );
     _patternBuilderSelectionModel = new PatternBuilderSelectionModel( _patternBuilderModel, _patternDataSelectionModel );
@@ -1583,8 +1613,6 @@ void HEXABLOCKGUI::switchModel(SUIT_ViewWindow *view)
     connect( _meshSelectionModel, SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
                             this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
 
-
-    currentVtkView = dynamic_cast<SVTK_ViewWindow*>( _currentGraphicView->get_SUIT_ViewWindow() );
   }
 
   showPatternMenus(true);
@@ -1632,29 +1660,54 @@ void HEXABLOCKGUI::showDockWidgets(bool isVisible)
 DocumentGraphicView* HEXABLOCKGUI::newGraphicView()
 {
   MESSAGE("HEXABLOCKGUI::newGraphicView");
-  DocumentGraphicView *newGView = 0;
+  DocumentGraphicView *newGView = NULL;
   SUIT_ViewWindow *suitVW = NULL;
 
-  SUIT_ViewManager *suitVM = getApp()->getViewManager(SVTK_Viewer::Type(), true);
-  MESSAGE("suitVM->getViewsCount() => " << suitVM->getViewsCount() );
-  suitVW = suitVM->getActiveView();
-  if ( _documentView.count(suitVW) > 0)
-    suitVW = suitVM->createViewWindow();
+  //For the first time initialize occ view manager
+  if (_documentView.size() == 0)
+    {
+         occViewManager = getApp()->getViewManager( OCCViewer_Viewer::Type(), true );
+         occViewManager->getActiveView()->setClosable(false);
+         currentOccView = dynamic_cast<OCCViewer_ViewWindow*>(occViewManager->getActiveView());
+    }
 
-  if ( suitVW ){
-    suitVW->setClosable(false);
-    newGView = new DocumentGraphicView(getApp(), suitVW, application()->desktop());
-    _documentView[suitVW] = newGView;
+  vtkViewManager = getApp()->getViewManager( SVTK_Viewer::Type(), true );
+  if (_documentView.size() == 0)
+  {
+         suitVW = vtkViewManager->getActiveView();
+         suitVW->setClosable(false);
   }
+  else
+         suitVW = vtkViewManager->createViewWindow();
 
+  currentVtkView = dynamic_cast<SVTK_ViewWindow*>(suitVW);
+  currentVtkView->installEventFilter(this);
+  newGView = new DocumentGraphicView(getApp(), suitVW, application()->desktop());
+  _documentView[suitVW] = newGView;
   return newGView;
 }
 
-
-
-
-
-
+//DocumentGraphicView* HEXABLOCKGUI::newGraphicView()
+//{
+//  MESSAGE("HEXABLOCKGUI::newGraphicView");
+//  DocumentGraphicView *newGView = 0;
+//  SUIT_ViewWindow *suitVW = NULL;
+//
+//  SUIT_ViewManager *vtkViewManager = getApp()->getViewManager(SVTK_Viewer::Type(), true);
+//  MESSAGE("suitVM->getViewsCount() => " << suitVM->getViewsCount() );
+//  suitVW = suitVM->getActiveView();
+//  if ( _documentView.count(suitVW) > 0)
+//    suitVW = suitVM->createViewWindow();
+//
+//  if ( suitVW ){
+////    suitVW->setClosable(false);
+//     suitVW->setClosable(true);
+//    newGView = new DocumentGraphicView(getApp(), suitVW, application()->desktop());
+//    _documentView[suitVW] = newGView;
+//  }
+//
+//  return newGView;
+//}
 
 
 void HEXABLOCKGUI::testDocument()
@@ -1920,148 +1973,150 @@ void HEXABLOCKGUI::test_association()
 
 void HEXABLOCKGUI::newDocument()
 {
-  DEBTRACE("HEXABLOCKGUI::newDocument");
-
-  SUIT_ViewWindow *suitVW = NULL;
-//   std::stringstream name;
-//   name << "newDoc_" << ++_documentCnt;
-//   QString fileName = name.str().c_str();
-  QMainWindow *aParent = application()->desktop();
-  QWidget *central = aParent->centralWidget();
-  if (central)
-    central->setFocus();
-  else
-    DEBTRACE("No Central Widget");
-
-//   BasicGUI_PointDlg* aDlg = new BasicGUI_PointDlg( NULL, aParent );
-//   aDlg->show();
-
-  // Create Document from HEXABLOCK ENGINE
-  // WARNING : IN HEXABLOCK component,  GUI and ENGINE share the same process
-  HEXABLOCK_ORB::Document_ptr docIn = _hexaEngine->addDocument("default");
-
-  HEXA_NS::Document* doc = NULL;
-  QString            docEntry;
-
-  // looking doc impl ( c++ )
-  Document_impl* dServant = DownCast<Document_impl*>( docIn );
-  ASSERT( dServant );
-  if ( dServant) doc = dServant->GetImpl();
-
-//   doc->reorderFaces(); //CS_TEST
-
-  // looking for docEntry
-  if ( !CORBA::is_nil(docIn) ){
-    CORBA::String_var anIOR = SalomeApp_Application::orb()->object_to_string( docIn );
-    QString docIOR = anIOR.in();
-    SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
-    if ( !docIOR.isEmpty() ) {
-      _PTR(SObject) SO( study->studyDS()->FindObjectIOR( docIOR.toLatin1().constData() ) );
-      if ( SO )
-        docEntry = SO->GetID().c_str();
-    }
-  }
-
-  DEBTRACE("HEXABLOCKGUI::newDocument docEntry "<<docEntry.toStdString());
-
-
-  // Now create Document Model
-  _currentModel     = new DocumentModel( doc, docEntry, this ); //CS_TOCHECK this
-//   _currentModel->setHeaderData(0, Qt::Horizontal, tr("HELLOH0"));
-//   _currentModel->setHeaderData(1, Qt::Horizontal, tr("HELLOH1"));
-//   _currentModel->setHeaderData(0, Qt::Vertical, tr("HELLOV0"));
-  _patternDataModel    = new PatternDataModel(this);
-  _patternBuilderModel = new PatternBuilderModel(this);
-//   _associationsModel   = new AssociationsModel(this);
-  _groupsModel     = new GroupsModel(this);
-  _meshModel       = new MeshModel(this);
-
-  _patternDataModel->setSourceModel(_currentModel);
-  _patternBuilderModel->setSourceModel(_currentModel);
-//   _associationsModel->setSourceModel(_currentModel);
-  _groupsModel->setSourceModel(_currentModel);
-  _meshModel->setSourceModel(_currentModel);
-
-  // --- new Graphic view ( SVTK )
-  _currentGraphicView  = newGraphicView();
-  suitVW = _currentGraphicView->get_SUIT_ViewWindow();
-
-  // --- setting model
-  _currentGraphicView->setModel(_currentModel);
-//   _currentGraphicView->setModel(_patternDataModel);
-//   connect( _currentModel, SIGNAL(patternDataChanged() ), _currentGraphicView,  SLOT ( onPatternDatachanged() ) );
-  _patternDataTreeView->setModel(_patternDataModel);//_currentModel;
-//   _patternDataTreeView->setModel(_currentModel);//;
-  _patternBuilderTreeView->setModel(_patternBuilderModel);//_currentModel;
-//   _associationTreeView->setModel(_associationsModel);
-  _groupsTreeView->setModel(_groupsModel);
-  _meshTreeView->setModel(_meshModel);
-
-
-  // --- setting selection model
-  if ( _patternDataSelectionModel )    delete _patternDataSelectionModel;
-  if ( _patternBuilderSelectionModel ) delete _patternBuilderSelectionModel;
-  if ( _groupsSelectionModel )         delete _groupsSelectionModel;
-  if ( _meshSelectionModel )           delete _meshSelectionModel;
-
-  _patternDataSelectionModel    = new PatternDataSelectionModel(_patternDataModel);
-  _patternBuilderSelectionModel = new PatternBuilderSelectionModel( _patternBuilderModel, _patternDataSelectionModel );
-  _groupsSelectionModel         = new GroupsSelectionModel(_groupsModel);
-  _meshSelectionModel           = new MeshSelectionModel(_meshModel);
-
-  _patternDataSelectionModel->setSalomeSelectionMgr( selectionMgr() );
-//   _meshSelectionModel->setSalomeSelectionMgr( selectionMgr() );
-
-  _currentGraphicView->setSelectionModel(_patternDataSelectionModel);
-  _patternDataTreeView->setSelectionModel(_patternDataSelectionModel);
-  _patternDataTreeView->setSelectionMode(QAbstractItemView::SingleSelection); //QAbstractItemView::MultiSelection //CS_TEST
-  _patternBuilderTreeView->setSelectionModel(_patternBuilderSelectionModel);
-  _groupsTreeView->setSelectionModel(_groupsSelectionModel);
-  _meshTreeView->setSelectionModel(_meshSelectionModel);
-  _meshTreeView->setSelectionMode(QAbstractItemView::SingleSelection);
-
-  _treeViewDelegate->setDocumentModel( _currentModel );
-  _treeViewDelegate->setPatternDataSelectionModel( _patternDataSelectionModel );
-  _treeViewDelegate->setPatternBuilderSelectionModel( _patternBuilderSelectionModel );
-  _treeViewDelegate->setGroupsSelectionModel( _groupsSelectionModel/*_groupsTreeView->selectionModel()*/ );
-  _treeViewDelegate->setMeshSelectionModel( _meshSelectionModel/*_meshTreeView->selectionModel()*/ );
-
-
-  connect( _patternDataSelectionModel, SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
-                                 this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
-  connect( _patternBuilderSelectionModel, SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
-                                    this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
-  connect( _groupsSelectionModel, SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
-                            this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
-  connect( _meshSelectionModel, SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
-                          this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
-
-
-  // salome view/object browser/model management
-  _documentModels[ suitVW ] = _currentModel;
-
-//   _salomeViews[ _currentModel ] = suitVW;
-//   std::map<const QAbstractItemModel*,  SUIT_ViewWindow*> _salomeViews;
-
-  _salomeViewWindows[docEntry] = suitVW;
-  currentVtkView = dynamic_cast<SVTK_ViewWindow*>( _currentGraphicView->get_SUIT_ViewWindow() );
-  currentVtkView->raise();
-
-//   _currentGraphicView->setWindowTitle( _currentModel->getName() );
-//   currentVtkView->setWindowTitle( _currentModel->getName() );
-//   showDockWidgets(true);
-//   showPatternMenus
-//   _dwPattern->setVisible(true);
-//   _dwPattern->toggleViewAction()->setVisible(true);
-  _dwPattern->raise();
-//   testDocument();
-//   test_make_cart_grid();
-//   test_make_elmts_transform();
-  showAllMenus();
-  getApp()->updateObjectBrowser();
+       DEBTRACE("HEXABLOCKGUI::newDocument");
+
+       SUIT_ViewWindow *suitVW = NULL;
+       //   std::stringstream name;
+       //   name << "newDoc_" << ++_documentCnt;
+       //   QString fileName = name.str().c_str();
+       QMainWindow *aParent = application()->desktop();
+       QWidget *central = aParent->centralWidget();
+       if (central)
+               central->setFocus();
+       else
+               DEBTRACE("No Central Widget");
+
+       //   BasicGUI_PointDlg* aDlg = new BasicGUI_PointDlg( NULL, aParent );
+       //   aDlg->show();
+
+       // Create Document from HEXABLOCK ENGINE
+       // WARNING : IN HEXABLOCK component,  GUI and ENGINE share the same process
+       HEXABLOCK_ORB::Document_ptr docIn = _hexaEngine->addDocument("default");
+
+       HEXA_NS::Document* doc = NULL;
+       QString            docEntry;
+
+       // looking doc impl ( c++ )
+       Document_impl* dServant = DownCast<Document_impl*>( docIn );
+       ASSERT( dServant );
+       if ( dServant) doc = dServant->GetImpl();
+
+       //   doc->reorderFaces(); //CS_TEST
+
+       // looking for docEntry
+       if ( !CORBA::is_nil(docIn) ){
+               CORBA::String_var anIOR = SalomeApp_Application::orb()->object_to_string( docIn );
+               QString docIOR = anIOR.in();
+               SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+               if ( !docIOR.isEmpty() ) {
+                       _PTR(SObject) SO( study->studyDS()->FindObjectIOR( docIOR.toLatin1().constData() ) );
+                       if ( SO )
+                               docEntry = SO->GetID().c_str();
+               }
+       }
 
+       DEBTRACE("HEXABLOCKGUI::newDocument docEntry "<<docEntry.toStdString());
+
+
+       // Now create Document Model
+       _currentModel     = new DocumentModel( doc, docEntry, this ); //CS_TOCHECK this
+       //   _currentModel->setHeaderData(0, Qt::Horizontal, tr("HELLOH0"));
+       //   _currentModel->setHeaderData(1, Qt::Horizontal, tr("HELLOH1"));
+       //   _currentModel->setHeaderData(0, Qt::Vertical, tr("HELLOV0"));
+       _patternDataModel    = new PatternDataModel(this);
+       _patternBuilderModel = new PatternBuilderModel(this);
+       //   _associationsModel   = new AssociationsModel(this);
+       _groupsModel     = new GroupsModel(this);
+       _meshModel       = new MeshModel(this);
+
+       _patternDataModel->setSourceModel(_currentModel);
+       _patternBuilderModel->setSourceModel(_currentModel);
+       //   _associationsModel->setSourceModel(_currentModel);
+       _groupsModel->setSourceModel(_currentModel);
+       _meshModel->setSourceModel(_currentModel);
+
+       // --- new Graphic view ( SVTK )
+       _currentGraphicView  = newGraphicView();
+       suitVW = _currentGraphicView->get_SUIT_ViewWindow();
+
+       // --- setting model
+       _currentGraphicView->setModel(_currentModel);
+       //   _currentGraphicView->setModel(_patternDataModel);
+       //   connect( _currentModel, SIGNAL(patternDataChanged() ), _currentGraphicView,  SLOT ( onPatternDatachanged() ) );
+       _patternDataTreeView->setModel(_patternDataModel);//_currentModel;
+       //   _patternDataTreeView->setModel(_currentModel);//;
+       _patternBuilderTreeView->setModel(_patternBuilderModel);//_currentModel;
+       //   _associationTreeView->setModel(_associationsModel);
+       _groupsTreeView->setModel(_groupsModel);
+       _meshTreeView->setModel(_meshModel);
+
+
+       //  if ( _patternDataSelectionModel )    delete _patternDataSelectionModel;
+       //  if ( _patternBuilderSelectionModel ) delete _patternBuilderSelectionModel;
+       //  if ( _groupsSelectionModel )         delete _groupsSelectionModel;
+       //  if ( _meshSelectionModel )           delete _meshSelectionModel;
+
+       // --- setting selection model
+       _patternDataSelectionModel    = new PatternDataSelectionModel(_patternDataModel);
+       _patternBuilderSelectionModel = new PatternBuilderSelectionModel( _patternBuilderModel, _patternDataSelectionModel );
+       _groupsSelectionModel         = new GroupsSelectionModel(_groupsModel);
+       _meshSelectionModel           = new MeshSelectionModel(_meshModel);
+
+       _patternDataSelectionModel->setSalomeSelectionMgr( selectionMgr() );
+       //   _meshSelectionModel->setSalomeSelectionMgr( selectionMgr() );
+
+       _currentGraphicView->setSelectionModel(_patternDataSelectionModel);
+       _patternDataTreeView->setSelectionModel(_patternDataSelectionModel);
+       _patternDataTreeView->setSelectionMode(QAbstractItemView::SingleSelection); //QAbstractItemView::MultiSelection //CS_TEST
+       _patternBuilderTreeView->setSelectionModel(_patternBuilderSelectionModel);
+       _groupsTreeView->setSelectionModel(_groupsSelectionModel);
+       _meshTreeView->setSelectionModel(_meshSelectionModel);
+       _meshTreeView->setSelectionMode(QAbstractItemView::SingleSelection);
+
+       _treeViewDelegate->setDocumentModel( _currentModel );
+       _treeViewDelegate->setPatternDataSelectionModel( _patternDataSelectionModel );
+       _treeViewDelegate->setPatternBuilderSelectionModel( _patternBuilderSelectionModel );
+       _treeViewDelegate->setGroupsSelectionModel( _groupsSelectionModel/*_groupsTreeView->selectionModel()*/ );
+       _treeViewDelegate->setMeshSelectionModel( _meshSelectionModel/*_meshTreeView->selectionModel()*/ );
+
+
+       connect( _patternDataSelectionModel, SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
+                       this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
+       connect( _patternBuilderSelectionModel, SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
+                       this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
+       connect( _groupsSelectionModel, SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
+                       this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
+       connect( _meshSelectionModel, SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ),
+                       this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
+
+
+       // salome view/object browser/model management
+       _documentModels[ suitVW ] = _currentModel;
+
+       //   _salomeViews[ _currentModel ] = suitVW;
+       //   std::map<const QAbstractItemModel*,  SUIT_ViewWindow*> _salomeViews;
+
+       _salomeViewWindows[docEntry] = suitVW;
+       currentVtkView = dynamic_cast<SVTK_ViewWindow*>( _currentGraphicView->get_SUIT_ViewWindow() );
+       currentVtkView->raise();
+
+       //   _currentGraphicView->setWindowTitle( _currentModel->getName() );
+       //   currentVtkView->setWindowTitle( _currentModel->getName() );
+       //   showDockWidgets(true);
+       //   showPatternMenus
+       //   _dwPattern->setVisible(true);
+       //   _dwPattern->toggleViewAction()->setVisible(true);
+       _dwPattern->raise();
+       //   testDocument();
+       //   test_make_cart_grid();
+       //   test_make_elmts_transform();
+       showAllMenus();
+       getApp()->updateObjectBrowser();
+
+       graphicViewIsEmpty[suitVW] = true;
 }
 
+
 void HEXABLOCKGUI::slot_modelChanged(const QModelIndex &topLeft, const QModelIndex  &bottomRight)
 {
   //std::cout << "HHHHHHHHHHHHHHHHHH  Model changed." << std::endl;
@@ -2094,14 +2149,15 @@ void HEXABLOCKGUI::loadDocument( const QString &inFile )
       if (!selectedFiles.isEmpty())
         selectedFile = selectedFiles.first();
     }
-  } else {
-    selectedFile = inFile;
-  }
+  } else
+         selectedFile = inFile;
 
   if (! selectedFile.isEmpty()){
-    newDocument();
-    _currentModel->load(selectedFile);
-    renameObject( _currentModel->documentEntry(), _currentModel->getName() );
+         if (vtkViewManager==NULL || vtkViewManager->getViewsCount()==0 || !graphicViewIsEmpty[vtkViewManager->getActiveView()])
+                 newDocument();
+         _currentModel->load(selectedFile);
+         renameObject( _currentModel->documentEntry(), _currentModel->getName() );
+         graphicViewIsEmpty[vtkViewManager->getActiveView()] = false;
   }
 }
 
@@ -2123,37 +2179,51 @@ void HEXABLOCKGUI::saveDocument()
                                          filter,
                                          tr( "Save HexaBlock Document" ),
                                          false );
-  //std::cout<<"HEXABLOCKGUI::saveDocument()"<<std::endl;
   if ( !aFilename.isEmpty() ) {
-    //std::cout<<"!aFilename.isEmpty()"<<std::endl;
     _currentModel->save( aFilename );
   }
   //CS_TODO save doc
 }
 
+
 void HEXABLOCKGUI::_showDialogBox( HexaBaseDialog* diag )
 {
   MESSAGE("HEXABLOCKGUI::_showDialogBox()");
+  if (vtkViewManager == NULL || vtkViewManager->getViewsCount() == 0) return;
   if (!diag) return;
   MESSAGE("if (!diag) return;");
   if (!_dwInputPanel) return;
   MESSAGE("if (!_dwInputPanel) return;");
 
+  currentDialog = diag;
   diag->setDocumentModel(_currentModel);
   diag->setPatternDataSelectionModel(_patternDataSelectionModel);
   diag->setPatternBuilderSelectionModel(_patternBuilderSelectionModel);
   diag->setGroupsSelectionModel(_groupsSelectionModel);
-  diag->setMeshSelectionModel(_meshSelectionModel/*_meshTreeView->selectionModel()*/);
+  diag->setMeshSelectionModel(_meshSelectionModel);
 
-  QWidget* w = _dwInputPanel->widget();
-  if (w) w->hide();
+  //close the current widget
+  if (_treeViewDelegate != NULL)
+         _treeViewDelegate->closeDialog();
 
-  if ( !_dwInputPanel->isVisible() ) _dwInputPanel->setVisible(true);
-  _dwInputPanel->setWidget(diag);
-  _dwInputPanel->setWindowTitle(diag->windowTitle());
-  diag->show();
-}
+  if (_dwInputPanel->widget())
+         _dwInputPanel->widget()->close();
 
+  //Temporary for debugging EdgeAssoc Faked InfoDialog
+  if (diag == _edgeAssocDiag)
+         diag->debugEdgeAssoc = true;
+  else
+         diag->debugEdgeAssoc = false;
+
+  if (diag ==  _quadAssocDiag || diag ==  _edgeAssocDiag)
+         assocInProgress = true;
+  else
+         assocInProgress = false;
+
+  //show the dialog box in the dockwidget
+  diag->resetSizeAndShow(_dwInputPanel);
+  diag->setFocus();
+}
 
 void HEXABLOCKGUI::addVertex()
 {
@@ -2171,9 +2241,6 @@ void HEXABLOCKGUI::addEdge()
   _showDialogBox( _edgeDiag );
 }
 
-
-
-
 void HEXABLOCKGUI::addQuad()
 {
   if ( !_quadDiag ){
@@ -2383,15 +2450,26 @@ void HEXABLOCKGUI::quadRevolution() // NEW HEXA3
 void HEXABLOCKGUI::assocVertex()
 {
  MESSAGE("HEXABLOCKGUI::assocVertex()");
+ if (!_dwInputPanel) return;
  QWidget* d = dynamic_cast<SUIT_Desktop*>(_dwInputPanel->parent());
+
   if ( !_vertexAssocDiag  ){
     _vertexAssocDiag  = new VertexAssocDialog( NULL, d );
+    if (!_vertexAssocDiag) return;
   }
   _vertexAssocDiag->setDocumentModel(_currentModel);
   _vertexAssocDiag->setPatternDataSelectionModel(_patternDataSelectionModel);
+
+  //close current widget
+  if (_treeViewDelegate != NULL) _treeViewDelegate->closeDialog();
+  if (_dwInputPanel->widget()) _dwInputPanel->widget()->close();
+
+  //add the vertex assoc dialog in the dockwidget
+  if ( !_dwInputPanel->isVisible() ) _dwInputPanel->setVisible(true);
   _dwInputPanel->setWidget(_vertexAssocDiag);
   _dwInputPanel->setWindowTitle(_vertexAssocDiag->windowTitle());
-  //_vertexAssocDiag->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
+  _vertexAssocDiag->adjustSize();
+  assocInProgress = true;
   _vertexAssocDiag->show();
 }
 
@@ -2554,15 +2632,10 @@ have the default law.").arg(selected.data().toString()),
 
 void HEXABLOCKGUI::setPropagation()
 {
-  if (!_dwInputPanel) return;
-  PropagationDialog* diag = new PropagationDialog(_dwInputPanel, HexaBaseDialog::NEW_MODE);
-  diag->setDocumentModel(_currentModel);
-  diag->setMeshSelectionModel(_meshSelectionModel);
-  //diag->setValue(p);
-  diag->setFocus();
-  _dwInputPanel->setWidget(diag);
-  _dwInputPanel->setWindowTitle( diag->windowTitle() );
-  diag->clear();
+       if ( !_propagationDiag ){
+               _propagationDiag = new PropagationDialog(_dwInputPanel, HexaBaseDialog::NEW_MODE);
+       }
+       _showDialogBox( _propagationDiag );
 }
 
 
@@ -2586,7 +2659,7 @@ void HEXABLOCKGUI::clearAssociations()
 
   _currentModel->clearEltAssociations(iModel);
 
-  SUIT_MessageBox::information( 0, tr( "HEXA_INFO" ), tr( "ASSOCIATION CLEARED" ) );
+//  SUIT_MessageBox::information( 0, tr( "HEXA_INFO" ), tr( "ASSOCIATION CLEARED" ) );
 }
 
 void HEXABLOCKGUI::clearAllAssociations()
@@ -2648,7 +2721,7 @@ LightApp_SelectionMgr* HEXABLOCKGUI::selectionMgr()
   if( anApp )
     return dynamic_cast<LightApp_SelectionMgr*>( anApp->selectionMgr() );
   else
-    return 0;
+    return NULL;
 }
 
 QStringList HEXABLOCKGUI::getQuickDirList()
@@ -2678,14 +2751,6 @@ extern "C"
 }
 
 
-
-
-
-
-
-
-
-
 // void  HEXABLOCKGUI::newMesh( const std::string& meshName,
 //                                             int dim,
 //                              const std::string& container )
@@ -2802,9 +2867,9 @@ SMESH::SMESH_Gen_var SMESHGUI::GetSMESHGen()
   return myComponentSMESH;
 }*/
 
-// bool HEXABLOCKGUI::eventFilter(QObject *obj, QEvent *event)
-// {
-//     if ( event->type() == QEvent::Enter ){//QEvent::Show ){ //QEvent::KeyPress) {
+ bool HEXABLOCKGUI::eventFilter(QObject *obj, QEvent *event)
+ {
+     if ( event->type() == QEvent::Enter ){//QEvent::Show ){ //QEvent::KeyPress) {
 //         showDocumentMenus( false );
 //         showPatternMenus( false );
 //         showAssociationMenus( false );
@@ -2822,12 +2887,22 @@ SMESH::SMESH_Gen_var SMESHGUI::GetSMESHGen()
 //
 //           showMeshMenus( true );
 //         }
-//         return false;
-//     } else {
-//          // standard event processing
-//          return QObject::eventFilter(obj, event);
-//     }
-// }
+        OCCViewer_ViewWindow* occWindow = dynamic_cast<OCCViewer_ViewWindow*>(obj);
+        if ( occWindow != NULL )
+        {
+                occWindow->setFocus();
+        }
+        SVTK_ViewWindow* vtkWindow = dynamic_cast<SVTK_ViewWindow*>(obj);
+        if (vtkWindow != NULL)
+        {
+//              vtkWindow->setFocus();
+        }
+         return true;
+     } else {
+          // standard event processing
+          return QObject::eventFilter(obj, event);
+     }
+ }
 
 // try {
 // //   throw SALOME_Exception(LOCALIZED("assocVertex"));
index 68cda624547c817061b148e0bd368e4c2fadeb56..10817e9ab1ba5074f6fe6fa85d0a0a86b19bb175 100755 (executable)
@@ -144,6 +144,7 @@ public:
 
   static SVTK_ViewWindow*      currentVtkView;
   static OCCViewer_ViewWindow* currentOccView;
+  static bool assocInProgress;
 
  //HEXABLOCK::GUI::DocumentModel*
 
@@ -193,6 +194,7 @@ public slots:
 protected slots:
   void onWindowActivated( SUIT_ViewWindow* svw);
   void onWindowClosed( SUIT_ViewWindow* svw);
+//  void OnMouseMove( SUIT_ViewWindow*, QMouseEvent* );
 
   virtual void                        onViewManagerAdded( SUIT_ViewManager* );
   virtual void                        onViewManagerRemoved( SUIT_ViewManager* );
@@ -204,9 +206,10 @@ protected:
 //   virtual  CAM_DataModel* createDataModel();
   bool createSComponent();
 //   virtual bool isSelectionCompatible();
+  virtual bool eventFilter(QObject *obj, QEvent *event);
 
   void _showDialogBox( HEXABLOCK::GUI::HexaBaseDialog* diag );
-
+  HEXABLOCK::GUI::HexaBaseDialog* currentDialog;
 
 //   bool _selectFromTree;
   HEXABLOCKGUI_Resource* _myresource;
@@ -305,6 +308,7 @@ private:
   QDockWidget *_dwObjectBrowser; // Salome study
   QDockWidget *_dwInputPanel;    // user Input
 
+
   // Dialog Box ( to keep persistent values )
   HEXABLOCK::GUI::VertexDialog*                 _vertexDiag;
   HEXABLOCK::GUI::EdgeDialog*                   _edgeDiag;
@@ -432,17 +436,19 @@ private:
   HEXABLOCK::GUI::MeshSelectionModel           *_meshSelectionModel;
 
   //  SALOME   SALOME    SALOME     SALOME     SALOME     SALOME     SALOME     SALOME     SALOME     SALOME
-  SUIT_ViewManager *_suitVM;
+  SUIT_ViewManager *vtkViewManager;
+  SUIT_ViewManager *occViewManager;
   std::map<QString, SUIT_ViewWindow*>  _salomeViewWindows; //  key = entry
 
   // SALOME/QT    SALOME/QT  SALOME/QT    SALOME/QT   SALOME/QT    SALOME/QT  
   std::map<SUIT_ViewWindow*, HEXABLOCK::GUI::DocumentModel*>       _documentModels;
   std::map<SUIT_ViewWindow*, HEXABLOCK::GUI::DocumentGraphicView*> _documentView;
-
+  std::map<SUIT_ViewWindow*, bool> graphicViewIsEmpty;
 //   static std::map<HEXABLOCK::GUI::DocumentModel*,  SUIT_ViewWindow*> _salomeViews;
 
 //   int _documentCnt;
   bool _isSaved;
+  bool moduleActivatedOnce;
 
 
   void testDocument();
index dcd4f11cf7c3402130c998a9ef6a5fcbc491b1ca..195114313513931ada57eb90a6c9fe1059b5ac01 100755 (executable)
 //
 #include <iostream>
 #include <QtGui>
+#include <qpixmap.h>
+#include <qrect.h>
+#include <qstyle.h>
 
 
 #include "utilities.h"
+#include "HEXABLOCKGUI.hxx"
 
 
 #include "HEXABLOCKGUI_DocumentDelegate.hxx"
-#include "HEXABLOCKGUI_DocumentItem.hxx"
-#include "HEXABLOCKGUI_DocumentPanel.hxx"
 
 using namespace std;
 using namespace HEXABLOCK::GUI;
 
 
+//QWidget* currentEditor = NULL;
+
 DocumentDelegate::DocumentDelegate(QDockWidget *dw, QObject *parent)
     : QItemDelegate(parent),
       _dw(dw),
@@ -39,7 +43,8 @@ DocumentDelegate::DocumentDelegate(QDockWidget *dw, QObject *parent)
       _patternDataSelectionModel(0),
       _patternBuilderSelectionModel(0),
       _groupsSelectionModel(0),
-      _meshSelectionModel(0)
+      _meshSelectionModel(0),
+      _currentEditor(NULL)
 {
 //   connect( this, SIGNAL( closeEditor(QWidget *, QAbstractItemDelegate::EndEditHint) ),
 //            this, SLOT( onCloseEditor(QWidget *, QAbstractItemDelegate::EndEditHint) ) );
@@ -48,16 +53,6 @@ DocumentDelegate::DocumentDelegate(QDockWidget *dw, QObject *parent)
 }
 
 
-// void DocumentDelegate::commitEditor()
-// {
-//   MESSAGE("DocumentDelegate::commitEditor(){")
-//   MESSAGE("*  sender is: " << sender() );
-//   QWidget* editor = qobject_cast<QWidget*>(sender());
-//   emit commitData(editor);
-// //   emit closeEditor(editor);
-//   MESSAGE("}");
-// }
-
 QWidget *DocumentDelegate::createEditor( QWidget                    *parent,
                                          const QStyleOptionViewItem &option,
                                          const QModelIndex          &index ) const
@@ -67,46 +62,67 @@ QWidget *DocumentDelegate::createEditor( QWidget                    *parent,
   MESSAGE("*  _dw    is: " << _dw);
   MESSAGE("*  item   is: " << index.data(Qt::DisplayRole).toString().toStdString());
 
-  HexaBaseDialog *editor = 0;
+  //close current editor if there's one before creating a new one
+  if (_currentEditor != NULL)
+  {
+         delete _currentEditor;
+         _currentEditor = NULL;
+  }
+
+  HexaBaseDialog *editor = NULL;
+
+  if (_dw->widget()) _dw->widget()->close();
+  if ( !_dw->isVisible() ) _dw->setVisible(true);
 
   switch ( index.data(HEXA_TREE_ROLE).toInt() ){
-    case VERTEX_TREE :   editor = new VertexDialog(parent, HexaBaseDialog::UPDATE_MODE);   break;
-    case EDGE_TREE :     editor = new EdgeDialog(parent, /*HexaBaseDialog::NEW_MODE*/HexaBaseDialog::INFO_MODE);     break;
-    case QUAD_TREE :     editor = new QuadDialog(parent, HexaBaseDialog::INFO_MODE);     break;
-    case HEXA_TREE :     editor = new HexaDialog(parent, HexaBaseDialog::INFO_MODE);     break;
-    case VECTOR_TREE :   editor = new VectorDialog(parent, HexaBaseDialog::INFO_MODE);   break;
-    case CYLINDER_TREE : editor = new CylinderDialog(parent, HexaBaseDialog::INFO_MODE);   break;
-    case PIPE_TREE :     editor = new PipeDialog(parent, HexaBaseDialog::INFO_MODE);       break;
+    case VERTEX_TREE :   editor = new VertexDialog(_dw, HexaBaseDialog::UPDATE_MODE);   break;
+    case EDGE_TREE :     editor = new EdgeDialog(_dw, /*HexaBaseDialog::NEW_MODE*/HexaBaseDialog::INFO_MODE);     break;
+    case QUAD_TREE :     editor = new QuadDialog(_dw, HexaBaseDialog::INFO_MODE);     break;
+    case HEXA_TREE :     editor = new HexaDialog(_dw, HexaBaseDialog::INFO_MODE);     break;
+    case VECTOR_TREE :   editor = new VectorDialog(_dw, HexaBaseDialog::INFO_MODE);   break;
+    case CYLINDER_TREE : editor = new CylinderDialog(_dw, HexaBaseDialog::INFO_MODE);   break;
+    case PIPE_TREE :     editor = new PipeDialog(_dw, HexaBaseDialog::INFO_MODE);       break;
   //   case ELEMENTS_TREE :  break;
   //   case CROSSELEMENTS_TREE : break;
-    case GROUP_TREE       : editor = new GroupDialog(parent, HexaBaseDialog::INFO_MODE/*UPDATE_MODE*/); break;
-    case LAW_TREE         : editor = new LawDialog(parent, HexaBaseDialog::UPDATE_MODE); break;
-    case PROPAGATION_TREE : editor = new PropagationDialog(parent, HexaBaseDialog::INFO_MODE); break;
+    case GROUP_TREE       : editor = new GroupDialog(_dw, HexaBaseDialog::INFO_MODE/*UPDATE_MODE*/); break;
+    case LAW_TREE         : editor = new LawDialog(_dw, HexaBaseDialog::UPDATE_MODE); break;
+    case PROPAGATION_TREE : editor = new PropagationDialog(_dw, HexaBaseDialog::INFO_MODE); break;
   }
-  if ( editor ){
+  if ( editor != NULL ){
     if ( _documentModel )                editor->setDocumentModel( _documentModel );
-    if ( _patternDataSelectionModel )    editor->setPatternDataSelectionModel( _patternDataSelectionModel );
+    if ( _patternDataSelectionModel )
+    {
+       editor->setPatternDataSelectionModel( _patternDataSelectionModel );
+//     _patternDataSelectionModel->currentDialog = editor;
+    }
     if ( _patternBuilderSelectionModel ) editor->setPatternBuilderSelectionModel( _patternBuilderSelectionModel);
     if ( _groupsSelectionModel )         editor->setGroupsSelectionModel( _groupsSelectionModel );
     if ( _meshSelectionModel )           editor->setMeshSelectionModel( _meshSelectionModel);
 
-//     QWidget* w = _dw->widget();
-//     if (w) w->close();
-    if ( !_dw->isVisible() ) _dw->setVisible(true);
-    _dw->setWidget( editor );
-    _dw->setWindowTitle( editor->windowTitle() );
-//         connect ( editor, SIGNAL( editingFinished() ), this, SLOT ( commitEditor() ) );
-//         editor->exec();
-//     editor->show();
-//     editor->raise();
-//     editor->setFocus();
+    HEXABLOCKGUI::assocInProgress = false;
+    //show the editor in the dockwidget
+    editor->resetSizeAndShow(_dw);
   }
+  else
+         _dw->close();
 
   MESSAGE("}");
+
+  _currentEditor = editor;
   return editor;
-//   return new QLineEdit(parent);
 }
 
+//Close the current edition dialog
+void DocumentDelegate::closeDialog()
+{
+       if (_currentEditor!=NULL)
+       {
+               _currentEditor->close();
+               emit closeEditor(_currentEditor, NoHint);
+               delete _currentEditor;
+               _currentEditor = NULL;
+       }
+}
 
 void DocumentDelegate::setEditorData( QWidget *editor,
                                       const QModelIndex &index) const
@@ -118,43 +134,44 @@ void DocumentDelegate::setEditorData( QWidget *editor,
 
   switch ( index.data(HEXA_TREE_ROLE).toInt() ){
     case VERTEX_TREE : {
-      HEXA_NS::Vertex *value = index.data( HEXA_DATA_ROLE ).value< HEXA_NS::Vertex* >();
+//      HEXA_NS::Vertex *value = index.data( HEXA_DATA_ROLE ).value< HEXA_NS::Vertex* >();
+      HEXA_NS::Vertex *value = _documentModel->getHexaPtr<HEXA_NS::Vertex *>(index);
       VertexDialog *vertexEditor = static_cast<VertexDialog*>(editor);
       vertexEditor->setValue(value);
     }
     break;
     case EDGE_TREE : {
-      HEXA_NS::Edge *value = index.data( HEXA_DATA_ROLE ).value< HEXA_NS::Edge* >();
+      HEXA_NS::Edge *value = _documentModel->getHexaPtr<HEXA_NS::Edge*>(index);
       EdgeDialog *edgeEditor = static_cast<EdgeDialog*>(editor);
       edgeEditor->setValue(value);
     }
     break;
     case QUAD_TREE : {
-      HEXA_NS::Quad *value = index.data( HEXA_DATA_ROLE ).value< HEXA_NS::Quad* >();
+      HEXA_NS::Quad *value = _documentModel->getHexaPtr<HEXA_NS::Quad*>(index);
       QuadDialog *quadEditor = static_cast<QuadDialog*>(editor);
       quadEditor->setValue(value);
     }
     break;
     case HEXA_TREE : {
-      HEXA_NS::Hexa *value = index.data( HEXA_DATA_ROLE ).value< HEXA_NS::Hexa* >();
+      HEXA_NS::Hexa *value = _documentModel->getHexaPtr<HEXA_NS::Hexa*>(index);
       HexaDialog *hexaEditor = static_cast<HexaDialog*>(editor);
       hexaEditor->setValue(value);
     }
     break;
     case VECTOR_TREE : {
-      HEXA_NS::Vector *value = index.data( HEXA_DATA_ROLE ).value< HEXA_NS::Vector* >();
+      HEXA_NS::Vector *value = _documentModel->getHexaPtr<HEXA_NS::Vector*>(index);
       VectorDialog *vectorEditor = static_cast<VectorDialog*>(editor);
       vectorEditor->setValue(value);
     }
     break;
     case CYLINDER_TREE : {
-      HEXA_NS::Cylinder *value = index.data( HEXA_DATA_ROLE ).value< HEXA_NS::Cylinder* >();
+      HEXA_NS::Cylinder *value = _documentModel->getHexaPtr<HEXA_NS::Cylinder*>(index);
       CylinderDialog *cylinderEditor = static_cast<CylinderDialog*>(editor);
       cylinderEditor->setValue(value);
     }
     break;
     case PIPE_TREE : {
-      HEXA_NS::Pipe *value = index.data( HEXA_DATA_ROLE ).value< HEXA_NS::Pipe* >();
+      HEXA_NS::Pipe *value = _documentModel->getHexaPtr<HEXA_NS::Pipe*>(index);
       PipeDialog *pipeEditor= static_cast<PipeDialog*>(editor);
       pipeEditor->setValue(value);
     }
@@ -181,295 +198,35 @@ void DocumentDelegate::setEditorData( QWidget *editor,
     break;
   }
 
-//   editor->setFocus();
-//  editor->exec();
-  MESSAGE("}");
-}
-
-// void DocumentDelegate::setModelData( QWidget *editor, QAbstractItemModel *model,
-//                                      const QModelIndex &index) const
-// {
-//     cout << "//////////////////// CS_BP DocumentDelegate::setModelData BEGIN "<< editor << endl;
-// // //     QStandardItem  *item = 0;
-// // //     QItemDelegate::setModelData( editor, model,index);
-// // 
-// // //     // CS_TODO : simplification?
-// //     QSortFilterProxyModel *pmodel = dynamic_cast<QSortFilterProxyModel *>( model );
-// //     if ( pmodel ){
-// //       QStandardItemModel *smodel = dynamic_cast<QStandardItemModel *>( pmodel->sourceModel() );
-// //       if ( smodel ){
-// // //         item = smodel->itemFromIndex(index);
-// //         QItemDelegate::setModelData( editor, smodel, pmodel->mapToSource(index));
-// //       }
-// //     } else {
-// //       QStandardItemModel *smodel = dynamic_cast<QStandardItemModel *>( model );
-// //       if ( smodel ){
-// // //         item = smodel->itemFromIndex(index);
-// //         QItemDelegate::setModelData( editor, model,index);
-// //       }
-// //     }
-// //   QItemDelegate::setModelData( editor, model, index);
-//   cout << "//////////////////// CS_BP DocumentDelegate::setModelData END"<< editor << endl;    
-// 
-// }
-
-
-void DocumentDelegate::setModelData( QWidget *editor, 
-                                     QAbstractItemModel *model,
-                                     const QModelIndex &index) const
-{
-//   cout <<" XXXXXXXXXXXXXX setModelData editor => " << editor << endl;
-  MESSAGE("DocumentDelegate::setModelData(){");
-  MESSAGE("*  item   is: " << index.data(Qt::DisplayRole).toString().toStdString());
-//   HexaDialog *hexaEditor = qobject_cast<HexaDialog*>(editor);
-// //   PipeDialog *qtcast = qobject_cast<PipeDialog*>(editor);
-// //   PipeDialog *cppcast = dynamic_cast<PipeDialog*>(editor);
-// 
-//   if  ( hexaEditor ){
-//     HEXA_NS::Hexa *value  = hexaEditor->getValue();
-//     cout << "XXXXXXXXXXX DocumentDelegate::setModelData value  "<< value  << endl;
-//     model->setData( index, QVariant::fromValue( value ), HEXA_DATA_ROLE );
-//     model->setData( index, value->getName(), Qt::DisplayRole/*Qt::EditRole*/ );
-//     model->setData( index, QString::number( reinterpret_cast<intptr_t>(value) ), HEXA_ENTRY_ROLE ); 
-//   }
-//   editor->show();
-//   editor->raise();
-  
-//   cout << "AAAAAAA _dw"<< _dw<< endl;
-//   cout << "AAAAAAA _dw->widget()"<< _dw->widget() << endl;
-//   cout << "AAAAAAA isVisible"<< _dw->isVisible() << endl;
-//   cout << "AAAAAAA editor isVisible"<< editor->isVisible() << endl;
-// //   editor = new HexaDialog();
-//   _dw->setWindowTitle( "HOOOOOOOOOO" );
-//   _dw->setWidget(editor);
-//   _dw->setVisible(false);
-// //   editor->raise();
-//   _dw->raise();
-//   _dw->setVisible(true);
-//   cout << "BBBBBBB _dw"<< _dw<< endl;
-//   cout << "BBBBBBB _dw->widget()"<< _dw->widget() << endl;
-//   cout << "BBBBBBB isVisible"<< _dw->isVisible() << endl;
-//   cout << "BBBBBBB editor isVisible"<< editor->isVisible() << endl;
-  
-//               HEXA_NS::Quad *value   = quadEditor->getValue();
-//               model->setData(index, QVariant::fromValue( value ), HEXA_DATA_ROLE);
-  MESSAGE("}");
-}
-
-
-
-
-
-void DocumentDelegate::updateEditorGeometry(  QWidget *editor,
-                                              const QStyleOptionViewItem &option,
-                                              const QModelIndex &index ) const
-{
-
-  MESSAGE("DocumentDelegate::updateEditorGeometry(){");
-  MESSAGE("*  item   is: " << index.data(Qt::DisplayRole).toString().toStdString());
-//   cout << "CS_BP option.rect.size()"<<option.rect.size()<<endl;
-  MESSAGE("*  option.rect.width() is: " << option.rect.width() << option.rect.width() );
-  MESSAGE("*  option.rect.x()     is: " << option.rect.x() << option.rect.x() );
-  MESSAGE("*  option.rect.y()     is: " << option.rect.y() << option.rect.y() );
-//   editor->setGeometry(option.rect);
-  editor->show();
-//   editor->raise();
   MESSAGE("}");
 }
 
 
-
-
-
-void DocumentDelegate::setDocumentModel( DocumentModel* m )
-{
-  _documentModel = m;
-}
-
-void DocumentDelegate::setPatternDataSelectionModel( PatternDataSelectionModel* s )
-{
-  _patternDataSelectionModel = s;
-}
-
-void DocumentDelegate::setPatternBuilderSelectionModel( PatternBuilderSelectionModel* s )
-{
-  _patternBuilderSelectionModel = s;
-}
-
-void DocumentDelegate::setGroupsSelectionModel( GroupsSelectionModel* s )
-{
-  _groupsSelectionModel = s ;
-}
-
-void DocumentDelegate::setMeshSelectionModel( MeshSelectionModel* s )
-{
-  _meshSelectionModel = s;
-}
-
-
-
 bool DocumentDelegate::editorEvent ( QEvent                     *event,
                                      QAbstractItemModel         *model,
                                      const QStyleOptionViewItem &option,
                                      const QModelIndex          &index )
 {
-  MESSAGE("DocumentDelegate::editorEvent(){");
-  MESSAGE("*  item   is: " << index.data().toString().toStdString());
-  MESSAGE("*  event  is: " << event->type() );
-
-  Qt::ItemFlags flags = model->flags(index);
-  if ( flags == Qt::ItemFlags( ~Qt::ItemIsEditable ) ){
-    MESSAGE("*  you can select it ");
-  } else {
-    MESSAGE("*  you cannot select it ");
-  }
-
-
-  
-//   bool r;
-//   if ( event->type() == 3 ){
-//     r = true;
-//   } else {
-//     r = QItemDelegate::editorEvent ( event, model, option, index );
-//   }
-//   MESSAGE("*  result  is: " << r );
-//   MESSAGE("}");
-//   return r;
-
-  return QItemDelegate::editorEvent ( event, model, option, index );
+       MESSAGE("DocumentDelegate::editorEvent(){");
+       MESSAGE("*  item   is: " << index.data().toString().toStdString());
+       MESSAGE("*  event  is: " << event->type() );
+
+       Qt::ItemFlags flags = model->flags(index);
+       if ( flags == Qt::ItemFlags( ~Qt::ItemIsEditable ) ){
+               MESSAGE("*  you can select it ");
+       } else {
+               MESSAGE("*  you cannot select it ");
+       }
+
+       //return QItemDelegate::editorEvent ( event, model, option, index );
+       return false;
 }
 
-// void DocumentDelegate::onCloseEditor( QWidget *w, QAbstractItemDelegate::EndEditHint h)
-// {
-//   MESSAGE("DocumentDelegate::onCloseEditor(){");
-//   MESSAGE("}");
-// }
-// 
-// 
-// void DocumentDelegate::onCommitData ( QWidget * editor )
-// {
-//   MESSAGE("DocumentDelegate::onCommitData(){");
-//   MESSAGE("}");
-// }
-
-
-// connect( this, SIGNAL( commitData ( QWidget * ) ),
-//          this, SLOT( onCommitData ( QWidget * ) ) );
-
-
-// // virtual bool     eventFilter ( QObject * editor, QEvent * event )
-// // {
-// // //   std::cout << "eventFilter  eventFilter " << event->type() << std::endl;
-// // //   std::cout << std::endl;
-// // 
-// //  if (event->type() == QEvent::FocusOut) {
-// // //              QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
-// // //              qDebug() << "Ate key press" << keyEvent->key();
-// // //              return true;
-// // return false;
-// //          } else {
-// //               return QItemDelegate::eventFilter ( editor, event );
-// // //              return false;
-// //          }
-
-
-
-// void DocumentDelegate::setModelData( QWidget *editor, QAbstractItemModel *model,
-//                                      const QModelIndex &index) const
-// {
-//     cout << "*********************** CS_BP DocumentDelegate::setModelData BEGIN "<< editor << endl;
-//     QStandardItem  *item = 0;
-// 
-//     // CS_TODO : simplification?
-//     QSortFilterProxyModel *pmodel = dynamic_cast<QSortFilterProxyModel *>( model );
-//     if ( pmodel ){
-//       QStandardItemModel *smodel = dynamic_cast<QStandardItemModel *>( pmodel->sourceModel() );
-//       if ( smodel ){
-//         item = smodel->itemFromIndex(pmodel->mapToSource(index));
-//       }
-//     } else {
-//       QStandardItemModel *smodel = dynamic_cast<QStandardItemModel *>( model );
-//       if ( smodel ){
-//         item = smodel->itemFromIndex(index);
-//       }
-//     }
-// 
-// 
-//     if ( item ){
-// //       cout << "item " << item->type() << endl;
-//       if ( item->data().isValid() )
-//         cout << "***************   item " << item->data(Qt::DisplayRole).toString().toStdString() << endl;
-//       switch ( item->type() ){
-//         case VERTEXITEM : {
-//               VertexDialog *vertexEditor = static_cast<VertexDialog*>(editor);
-//               HEXA_NS::Vertex *value     = vertexEditor->getValue();
-//               model->setData(index, QVariant::fromValue( value ), HEXA_DATA_ROLE);
-//             }
-//             break;
-// 
-//         case EDGEITEM : {
-//               EdgeDialog *edgeEditor = static_cast<EdgeDialog*>(editor);
-//               HEXA_NS::Edge *value   = edgeEditor->getValue();
-//               model->setData(index, QVariant::fromValue( value ), HEXA_DATA_ROLE);
-//             }
-//             break;
-// 
-//         case QUADITEM : {
-//               QuadDialog *quadEditor = static_cast<QuadDialog*>(editor);
-//               HEXA_NS::Quad *value   = quadEditor->getValue();
-//               model->setData(index, QVariant::fromValue( value ), HEXA_DATA_ROLE);
-//             }
-//             break;
-// 
-//         case HEXAITEM : {
-//               HexaDialog *hexaEditor = static_cast<HexaDialog*>(editor);
-//               HEXA_NS::Hexa *value   = hexaEditor->getValue();
-//               model->setData(index, QVariant::fromValue( value ), HEXA_DATA_ROLE);
-//             }
-//             break;
-// 
-//         case VECTORITEM : {
-//               VectorDialog *vectorEditor = static_cast<VectorDialog*>(editor);
-//               HEXA_NS::Vector *value   = vectorEditor->getValue();
-//               model->setData(index, QVariant::fromValue( value ), HEXA_DATA_ROLE);
-//             }
-//             break;
-// 
-//         case CYLINDERITEM : {
-//               CylinderDialog *cylinderEditor = static_cast<CylinderDialog*>(editor);
-//               HEXA_NS::Cylinder *value   = cylinderEditor->getValue();
-//               model->setData(index, QVariant::fromValue( value ), HEXA_DATA_ROLE);
-//             }
-//         break;
-//         case PIPEITEM : {
-//               PipeDialog *pipeEditor = static_cast<PipeDialog*>(editor);
-//               HEXA_NS::Pipe *value   = pipeEditor->getValue();
-//               model->setData(index, QVariant::fromValue( value ), HEXA_DATA_ROLE);
-//             }
-//         break;
-// //         case ELEMENTSITEM : editor = new ElementsDialog(parent);   break;
-// //         case CROSSELEMENTSITEM : editor = new CrossElementsDialog(parent);   break;
-//         case GROUPITEM :{
-//               GroupDialog *groupEditor = static_cast<GroupDialog*>(editor);
-//               HEXA_NS::Group *value = groupEditor->getValue();
-//               model->setData(index, QVariant::fromValue( value ), HEXA_DATA_ROLE);
-//         }
-//         break;
-//         case LAWITEM : {
-//               LawDialog *lawEditor = static_cast<LawDialog*>(editor);
-//               HEXA_NS::Law *value = lawEditor->getValue();
-//               model->setData(index, QVariant::fromValue( value ), HEXA_DATA_ROLE);
-//         }
-//         break;
-//         case PROPAGATIONITEM : {
-//               PropagationDialog *propagationEditor = static_cast<PropagationDialog*>(editor);
-//               HEXA_NS::Propagation *value = propagationEditor->getValue();
-//               model->setData(index, QVariant::fromValue( value ), HEXA_DATA_ROLE);
-//         }
-//         break;
-// 
-//       }
-//     }
-//   editor->show();
-//   cout << "*********************** CS_BP DocumentDelegate::setModelData END "<< editor << endl;
-// }
\ No newline at end of file
+bool DocumentDelegate::eventFilter ( QObject * editor, QEvent * event )
+{
+       if ( event->type() == QEvent::FocusOut ){
+               //((QWidget*) editor->parent())->close();
+               return true;
+       }
+       return false;
+}
index f8e713cfb599926cab11e5c90b9b8f7a300763bd..27d4ff09fa1aafebcb1eb9b598c8ec8883998ade 100755 (executable)
@@ -34,6 +34,8 @@
 
 #include "HEXABLOCKGUI_DocumentModel.hxx"
 #include "HEXABLOCKGUI_DocumentSelectionModel.hxx"
+#include "HEXABLOCKGUI_DocumentItem.hxx"
+#include "HEXABLOCKGUI_DocumentPanel.hxx"
 
 namespace HEXABLOCK
 {
@@ -44,6 +46,7 @@ namespace HEXABLOCK
           Q_OBJECT
       
       public:
+          void closeDialog();
           DocumentDelegate( QDockWidget *dw, QObject *parent = 0);
 
           QWidget *createEditor( QWidget *parent,
@@ -54,32 +57,34 @@ namespace HEXABLOCK
 
           void setModelData( QWidget            *editor,
                              QAbstractItemModel *model,
-                             const QModelIndex  &index ) const;
+                             const QModelIndex  &index ) const {};
 
-          void updateEditorGeometry( QWidget *editor,
+          virtual void updateEditorGeometry( QWidget *editor,
                                      const QStyleOptionViewItem &option,
-                                     const QModelIndex &index ) const;
+                                     const QModelIndex &index ) const {};
 
-         // can be used by editor
-          void setDocumentModel( DocumentModel* m );
+          //Can be used by editor
+          void setDocumentModel( DocumentModel* m ){_documentModel = m;}
 
-          //  selection
-          void setPatternDataSelectionModel( PatternDataSelectionModel* s );
-          void setPatternBuilderSelectionModel( PatternBuilderSelectionModel* s );
-          void setGroupsSelectionModel( /*QItemSelectionModel**/ GroupsSelectionModel* s );
-          void setMeshSelectionModel( MeshSelectionModel* s );
+          //Selections
+          void setPatternDataSelectionModel( PatternDataSelectionModel* s ){_patternDataSelectionModel = s;}
+          void setPatternBuilderSelectionModel( PatternBuilderSelectionModel* s ){_patternBuilderSelectionModel = s;}
+          void setGroupsSelectionModel( GroupsSelectionModel* s ){_groupsSelectionModel = s ;}
+          void setMeshSelectionModel( MeshSelectionModel* s ){_meshSelectionModel = s;}
 
-          virtual bool editorEvent ( QEvent * event, 
-                                     QAbstractItemModel * model, 
-                                     const QStyleOptionViewItem & option, 
-                                     const QModelIndex & index );
+      protected:
+          mutable QWidget* _currentEditor;
+          virtual bool editorEvent ( QEvent * event,
+                         QAbstractItemModel * model,
+                         const QStyleOptionViewItem & option, const QModelIndex & index );
+          virtual bool         eventFilter ( QObject * editor, QEvent * event );
 
       public slots:
 //           void onCloseEditor( QWidget *, QAbstractItemDelegate::EndEditHint);
 //           void onCommitData ( QWidget * editor );
 
       private:
-          QDockWidget *_dw; // editor's container 
+          QDockWidget* _dw; // creator's container
 
           // can be used by editor
           DocumentModel*                _documentModel;
index 3486e03a95fb85490077265378f5b8bda75f086d..08ae35ae6eb2338574b20c010dbd8b6e78f32783 100755 (executable)
@@ -46,7 +46,9 @@
 #include <vtkRenderer.h>
 #include <vtkActorCollection.h>
 #include <vtkUnstructuredGrid.h>
-
+#include <vtkRenderWindowInteractor.h>
+#include <vtkSmartPointer.h>
+#include <SVTK_View.h>
 // test tutorial (sphere)
 #include <vtkPolyDataMapper.h>
 #include <vtkSphereSource.h>
 using namespace std;
 using namespace HEXABLOCK::GUI;
 
-
 Document_Actor::Document_Actor( HEXA_NS::Document* doc, const QString& entry ):
   SALOME_Actor(),
   _doc( doc )
@@ -326,12 +327,171 @@ Associate_Actor::Associate_Actor( HEXA_NS::Document* doc, const QString& entry)
 //   SetPointRepresentation(true);
 }
 // ===================================================== getUnstructuredGrid
+
 vtkUnstructuredGrid* Associate_Actor::getUnstructuredGrid()
 {
   vtkUnstructuredGrid* theGrid = vtkUnstructuredGrid::New();
 
   _doc->reorderFaces(); //CS_TEST
 
+  std::map<int,vtkIdType>   vtkNodeId;
+  std::map<vtkIdType, int>  hexaNodeId;
+
+  // Create points
+  vtkPoints* aPoints = vtkPoints::New();
+  int nbVertex = _doc->countVertex();
+  aPoints->SetNumberOfPoints( nbVertex );
+
+  HEXA_NS::Vertex* v = NULL;
+  int vertexId;
+  for ( int i=0; i <nbVertex; ++i ){
+    v = _doc->getVertex(i);
+    aPoints->SetPoint( i, v->getX()+6, v->getY()+6, v->getZ() );
+    vertexId = reinterpret_cast<intptr_t>(v); //v->getId();
+    vtkNodeId [ vertexId ] = i;
+    hexaNodeId[ i ] = vertexId ;
+//     vtkNodeId [ vertexId ] = i+1;
+//     hexaNodeId[ i+1 ] = vertexId ;
+  }
+
+  theGrid->SetPoints( aPoints );
+  aPoints->Delete();
+//   theGrid->SetCells( 0, 0, 0, 0, 0 );
+
+
+  // Calculate cells size
+  int nb0DElement = _doc->countVertex();
+  int nbEdge      = _doc->countEdge();
+  int nbFace      = _doc->countQuad();
+  int nbVolume    = _doc->countHexa();
+
+  vtkIdType aCellsSize =  2*nb0DElement + 3*nbEdge + ( 4 + 1 )*nbFace + ( 8 + 1 )*nbVolume;
+  vtkIdType aNbCells   =  nb0DElement + nbEdge + nbFace + nbVolume;
+
+  // Create cells
+  vtkCellArray* aConnectivity = vtkCellArray::New();
+  aConnectivity->Allocate( aCellsSize, 0 );
+
+  vtkUnsignedCharArray* aCellTypesArray = vtkUnsignedCharArray::New();
+  aCellTypesArray->SetNumberOfComponents( 1 );
+  aCellTypesArray->Allocate( aNbCells * aCellTypesArray->GetNumberOfComponents() );
+
+  vtkIdList *anIdList = vtkIdList::New();
+  vtkIdType iVtkElem = 0;
+//   vtkIdType iVtkElem = 1; //CS_TEST
+  int       iHexaElem;
+
+  // VERTEX
+  for ( int i=0; i<nb0DElement; ++i ){
+    anIdList->SetNumberOfIds( 1 );
+    v = _doc->getVertex(i);
+    iHexaElem = reinterpret_cast<intptr_t>(v);//v->getId();
+    vtkElemsId[iHexaElem] = iVtkElem;
+    hexaElemsId[iVtkElem] = iHexaElem;
+    anIdList->SetId(0, vtkNodeId[iHexaElem]);
+    aConnectivity->InsertNextCell( anIdList );
+    aCellTypesArray->InsertNextValue( VTK_VERTEX );//getCellType( aType, anElem->IsPoly(), aNbNodes ) );
+    ++iVtkElem;
+  }
+
+  // EDGE
+  HEXA_NS::Edge* e = NULL;
+  HEXA_NS::Vertex* vertexElem = NULL;
+  for ( int i=0; i<nbEdge; ++i ){
+    anIdList->SetNumberOfIds( 2 );
+    e = _doc->getEdge(i);
+    iHexaElem = reinterpret_cast<intptr_t>(e); //e->getId();
+    vtkElemsId[iHexaElem] = iVtkElem;
+    hexaElemsId[iVtkElem] = iHexaElem;
+
+    for( vtkIdType j = 0; j< 2; ++j ){ //j< e->countVertex(); ++j ){
+      vertexElem = e->getVertex( j );
+      anIdList->SetId( j, vtkNodeId[ reinterpret_cast<intptr_t>(vertexElem) ] );//vertexElem->getId() ]);
+    }
+    aConnectivity->InsertNextCell( anIdList );
+    aCellTypesArray->InsertNextValue( VTK_LINE );//getCellType( aType, anElem->IsPoly(), aNbNodes ) );
+    ++iVtkElem;
+  }
+
+  // QUAD
+  HEXA_NS::Quad* q = NULL;
+  HEXA_NS::Quad* quadElem = NULL;
+  for ( int i=0; i<nbFace; ++i ){
+    anIdList->SetNumberOfIds( 4 );
+    q = _doc->getQuad(i);
+    iHexaElem = reinterpret_cast<intptr_t>(q); //q->getId();
+    vtkElemsId[iHexaElem] = iVtkElem;
+    hexaElemsId[iVtkElem] = iHexaElem;
+
+    for( vtkIdType j = 0; j< 4; ++j ){
+      vertexElem = q->getVertex( j );
+      anIdList->SetId( j, vtkNodeId[ reinterpret_cast<intptr_t>(vertexElem) ] );//vertexElem->getId() ]);
+    }
+    aConnectivity->InsertNextCell( anIdList );
+    aCellTypesArray->InsertNextValue( VTK_QUAD );//getCellType( aType, anElem->IsPoly(), aNbNodes ) );
+    ++iVtkElem;
+  }
+
+  // HEXA
+  HEXA_NS::Hexa* h = NULL;
+  HEXA_NS::Hexa* hexaElem = NULL;
+  std::map<int, int> connectivity;
+  connectivity[0] = 0;
+  connectivity[1] = 1;
+  connectivity[2] = 3;
+  connectivity[3] = 2;
+  connectivity[4] = 4;
+  connectivity[5] = 5;
+  connectivity[6] = 7;
+  connectivity[7] = 6;
+  for ( int i=0; i<nbVolume; ++i ){
+    anIdList->SetNumberOfIds( 8 );
+    h = _doc->getHexa(i);
+    iHexaElem = reinterpret_cast<intptr_t>(h); //q->getId();
+    vtkElemsId[iHexaElem] = iVtkElem;
+    hexaElemsId[iVtkElem] = iHexaElem;
+
+    for( vtkIdType j = 0; j< 8; ++j ){
+      vertexElem = h->getVertex( j );// );
+      anIdList->SetId( connectivity[j], vtkNodeId[ reinterpret_cast<intptr_t>(vertexElem) ]);//vertexElem->getId() ]);
+    }
+    aConnectivity->InsertNextCell( anIdList );
+    aCellTypesArray->InsertNextValue( VTK_HEXAHEDRON );
+    ++iVtkElem;
+  }
+
+
+// 0        1      2     3        4     5      6      7
+// V_ACE, V_ACF, V_ADE, V_ADF, V_BCE, V_BCF, V_BDE, V_BDF,
+//
+// 0        1     3      2        4    5      7      6
+
+  // Insert cells in grid
+  VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+  aCellLocationsArray->SetNumberOfComponents( 1 );
+  aCellLocationsArray->SetNumberOfTuples( aNbCells );
+//   std::cout << "aNbCells =>" << aNbCells << std::endl;
+
+  aConnectivity->InitTraversal();
+  for( vtkIdType idType = 0, *pts, npts; aConnectivity->GetNextCell( npts, pts ); idType++ ){
+    aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
+  }
+  theGrid->SetCells( aCellTypesArray, aCellLocationsArray,aConnectivity );
+
+  aCellLocationsArray->Delete();
+  aCellTypesArray->Delete();
+  aConnectivity->Delete();
+  anIdList->Delete();
+  //std::cout << "theGrid->GetNumberOfCells()" << theGrid->GetNumberOfCells() << std::endl;
+
+  return theGrid;
+}
+/*
+{
+  vtkUnstructuredGrid* theGrid = vtkUnstructuredGrid::New();
+
+  _doc->reorderFaces(); //CS_TEST
+
   std::map<int,vtkIdType>   vtkNodeId;
   std::map<vtkIdType, int>  hexaNodeId;
  
@@ -355,7 +515,7 @@ vtkUnstructuredGrid* Associate_Actor::getUnstructuredGrid()
   int vertexId;
   for ( int i=0; i <nbVertex; ++i ){
     v = _doc->getVertex(i);
-    aPoints->SetPoint( i, v->getX(), v->getY(), v->getZ() );
+    aPoints->SetPoint( i, v->getX() + 1, v->getY() + 1, v->getZ() );
     vertexId = reinterpret_cast<intptr_t>(v); //v->getId();
     vtkNodeId [ vertexId ] = i;
     hexaNodeId[ i ] = vertexId ;
@@ -388,8 +548,8 @@ vtkUnstructuredGrid* Associate_Actor::getUnstructuredGrid()
   // VERTEX
   for ( int i=0; i<nb0DElement; ++i ){
     anIdList->SetNumberOfIds( 1 );
- // v = _doc->getVertex(i);        // Abu 
-    v = tab_vertex [i];
+    v = _doc->getVertex(i);        // Abu
+    // v = tab_vertex [i];
     iHexaElem = reinterpret_cast<intptr_t>(v);//v->getId();
     vtkElemsId[iHexaElem] = iVtkElem;
     hexaElemsId[iVtkElem] = iHexaElem;
@@ -445,6 +605,7 @@ vtkUnstructuredGrid* Associate_Actor::getUnstructuredGrid()
 
   return theGrid;
 }
+*/
 // =============================================================== Abu : Fin
 
 
@@ -454,7 +615,8 @@ DocumentGraphicView::DocumentGraphicView( LightApp_Application* app, SUIT_ViewWi
       _suitView( suitView ),
       _documentActor( 0 ),
       _associateActor (NULL), // Abu
-      _currentChanged( false )
+      _currentChanged( false ),
+      firstUpdate(true)
 {
 //   MESSAGE("DocumentGraphicView::DocumentGraphicView() app"<<app);
 //   MESSAGE("DocumentGraphicView::DocumentGraphicView() suitView"<<suitView);
@@ -502,6 +664,7 @@ void DocumentGraphicView::update()
   _documentActor  = new Document_Actor( theDocumentImpl, theDocumentEntry );
   theVTKViewWindow->AddActor( _documentActor );
  
+  QString autreDocentry  = "essai";
                                  // -------------------- Abu debut 
   if (HEXA_NS::special_option())
      {
@@ -510,15 +673,30 @@ void DocumentGraphicView::update()
         theVTKViewWindow->RemoveActor( _associateActor );
         _associateActor->Delete();
         }
-     _associateActor = new Associate_Actor( theDocumentImpl, theDocumentEntry );
+  //   _associateActor = new Associate_Actor( theDocumentImpl, theDocumentEntry );
+     _associateActor = new Associate_Actor( theDocumentImpl, autreDocentry );
      theVTKViewWindow->AddActor( _associateActor );
      }
                                  // -------------------- Abu fin
 
   // display HEXABLOCK document model
+//  vtkSmartPointer<hexablockInteractorStyle> style = vtkSmartPointer<hexablockInteractorStyle>::New();
+//  theVTKViewWindow->GetInteractor()->PushInteractorStyle(style);
+//  style->SetCurrentRenderer(theVTKViewWindow->getRenderer());
+
+//  theVTKViewWindow->SetInteractionStyle(0);
+//  theVTKViewWindow->SetDynamicPreSelection (true);
   theVTKViewWindow->getRenderer()->Render();
   theVTKViewWindow->Repaint();
-  theVTKViewWindow->onFitAll();
+  if (firstUpdate)
+  {
+         theVTKViewWindow->onFitAll();
+         firstUpdate = false;
+  }
+//  theVTKViewWindow->GetInteractorStyle()->HighlightProp(_documentActor);
+//  theVTKViewWindow->getView()->SetPreselectionProp(0., 1., 0., 2.);
+//  theVTKViewWindow->getView()->SetTransparency(_documentActor->getIO(), 0.2);
+
   // myVTKViewWindow->SetSelectionMode( ActorSelection );
   // theVTKViewWindow->SetSelectionMode( NodeSelection );
   // myVTKViewWindow->SetSelectionMode( FaceSelection );
index 9e2bd3da0fd8b35fb2f34f12a6afcce7f54d8e48..b0e648df8dd769e7e08e1cb1b7dcd8eb206c2a87 100755 (executable)
 // #include <SVTK_ViewWindow.h>
 #include <SUIT_ViewWindow.h>
 #include <SALOME_Actor.h>
-
-
-
-
-
-
-
+#include <SVTK_InteractorStyle.h>
 #include <QAbstractItemView>
 #include <QMap>
 
@@ -45,7 +39,9 @@
 #include <HexEdge.hxx>
 #include <HexHexa.hxx>
 #include <HexDocument.hxx>
-
+#include <vtkInteractorStyleTrackballCamera.h>
+#include <SVTK_RenderWindowInteractor.h>
+#include <vtkActor2D.h>
 
 // class LightApp_Displayer;
 // class SalomeApp_Application;
@@ -68,6 +64,21 @@ namespace HEXABLOCK
 
     namespace GUI
     {
+               class hexablockInteractorStyle : public SVTK_InteractorStyle
+               {
+               public:
+                       hexablockInteractorStyle() {};
+                       virtual ~hexablockInteractorStyle() {};
+
+               public:
+                       static hexablockInteractorStyle* New()
+                       {
+                               return new hexablockInteractorStyle;
+                       };
+                       virtual void HighlightActor2D(vtkActor2D* actor2D) {std::cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HIGHLIGHT PROP 2D%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << std::endl;};
+                       virtual void HighlightProp(vtkProp* prop) {std::cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HIGHLIGHT PROP %%%%%%%%%%%%%%%%%%%%%%%%%%%%" << std::endl;};
+                       virtual void HighlightProp3D(vtkProp3D* prop3D) {std::cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HIGHLIGHT PROP 3D%%%%%%%%%%%%%%%%%%%%%%%%%%%%" << std::endl;};
+               };
 
         class Document_Actor : public SALOME_Actor
         {
@@ -162,6 +173,7 @@ namespace HEXABLOCK
             Document_Actor  *_documentActor;
             Associate_Actor *_associateActor;
             bool _currentChanged;
+            bool firstUpdate;
         };
     }
 }
index 7016d470447314e6a097779e18c06697ad3856bb..4b616ff53382392537176e870a699106c489012f 100755 (executable)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-
 #include "HEXABLOCKGUI_DocumentItem.hxx"
 #include "HexShape.hxx"
 
 #include <inttypes.h>
 
-/*
-#include <QVariant>*/
-
-
-//#define _DEVDEBUG_
-
-
 using namespace std;
 using namespace HEXABLOCK::GUI;
 
-
-// ----------------------- VERTEX
-
-VertexItem::VertexItem( HEXA_NS::Vertex* hexaVertex ):
-  QStandardItem(),
-  _hexaVertex( hexaVertex )
-{
-//   char pName[12];
-  QString name = _hexaVertex->getName(/*pName*/);
-//   QString docEntry = model()->invisibleRootItem()->data(HEXA_ENTRY_ROLE).toString();
-  setText(name);
-//   setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled );//Qt::ItemIsEditable);
-  setData( VERTEX_TREE, HEXA_TREE_ROLE );
-  setData( QString::number( reinterpret_cast<intptr_t>(_hexaVertex) ), HEXA_ENTRY_ROLE ); //_hexaVertex->dad()
-
-  HEXA_NS::Shape* assoc = hexaVertex->getAssociation();
-  if ( assoc ){
-    QString entry = QString(assoc->ident.c_str());
-    setData( entry + ";" , HEXA_ASSOC_ENTRY_ROLE );
-  }
-}
-
-int VertexItem::type() const
-{
-  return VERTEXITEM;
-}
-
-
-
-QVariant VertexItem::data( int role ) const
-{
-       if ( role == HEXA_DATA_ROLE ){
-               return QVariant::fromValue( _hexaVertex );
-       } else if (role == Qt::ForegroundRole ) {
-               HEXA_NS::Shape* assoc = _hexaVertex->getAssociation();
-               if ( assoc )
-                       return QColor(Qt::darkGreen);
-               else
-                       return QColor(Qt::black);
-       } else {
-               return QStandardItem::data( role );
+// ElementItem --------------------------------------------------
+ElementItem::ElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole):
+QStandardItem()
+{
+       m_DocElt = docElement;
+       m_type   = ttype;
+
+       if (m_DocElt != NULL)
+               setText(m_DocElt->getName());
+       setData( treeRole,    HEXA_TREE_ROLE );
+       setData( entry,       HEXA_DOC_ENTRY_ROLE);
+       setData( IDptr(),     HEXA_ENTRY_ROLE );
+
+       //Init assocs entry
+       if (m_DocElt!=NULL && m_DocElt->isAssociated())
+       {
+               QString entry;
+               if (m_type == VERTEXITEM) //Vertex
+               {
+                       HEXA_NS::Shape* assoc = m_DocElt->getAssociation();
+                       if ( assoc ){
+                               entry = QString(assoc->ident.c_str());
+                               setData( entry + ";" , HEXA_ASSOC_ENTRY_ROLE );
+                       }
+               }
+               else if (m_type == EDGEITEM)
+               {
+                       QString entries;
+                       const HEXA_NS::Shapes& assocs = ((HEXA_NS::Edge*)m_DocElt)->getAssociations();
+                       for( HEXA_NS::Shapes::const_iterator anAssoc = assocs.begin(); anAssoc != assocs.end(); ++anAssoc ){
+                               entry = (*anAssoc)->ident.c_str();
+                               entries += entry + ";";
+                       }
+                       if ( !entries.isEmpty() )
+                               setData( entries, HEXA_ASSOC_ENTRY_ROLE );
+               }
+               else if (m_type == QUADITEM)
+               {
+                       QString entries;
+                       const HEXA_NS::Shapes& assocs = ((HEXA_NS::Quad*)m_DocElt)->getAssociations();
+                       for( HEXA_NS::Shapes::const_iterator anAssoc = assocs.begin(); anAssoc != assocs.end(); ++anAssoc ){
+                               entry = (*anAssoc)->ident.c_str();
+                               entries += entry + ";";
+                       }
+                       if ( !entries.isEmpty() )
+                               setData( entries, HEXA_ASSOC_ENTRY_ROLE );
+               }
        }
 }
 
-void VertexItem::setData ( const QVariant & value, int role )
-{
-    if ( role == HEXA_DATA_ROLE ){
-      _hexaVertex = value.value<HEXA_NS::Vertex*>();
-      emitDataChanged ();
-    } else {
-//       std::cout << " VertexItem::setData( " << role << ", "<< value.toString().toStdString() << " )" <<std::endl;
-      QStandardItem::setData ( value, role );
-    }
-}
-
-
-
-// ----------------------- EDGE
-EdgeItem::EdgeItem( HEXA_NS::Edge* hexaEdge ):
-  QStandardItem(),
-  _hexaEdge( hexaEdge )
-{
-//   char pName[12];
-//   QString name = _hexaEdge->getName(pName);
-  QString name = _hexaEdge->getName();
-//   std::cout << "EdgeItem name : "<<  name.toStdString() << std::endl;
-  setText(name);
-  setData( EDGE_TREE, HEXA_TREE_ROLE );
-  setData( QString::number( reinterpret_cast<intptr_t>(_hexaEdge) ), HEXA_ENTRY_ROLE );
-
-  QString entries, entry;
-  const HEXA_NS::Shapes& assocs = hexaEdge->getAssociations();
-  for( HEXA_NS::Shapes::const_iterator anAssoc = assocs.begin(); anAssoc != assocs.end(); ++anAssoc ){
-    entry = (*anAssoc)->ident.c_str();
-    entries += entry + ";";
-  }
-  if ( !entries.isEmpty() )
-    setData( entries, HEXA_ASSOC_ENTRY_ROLE );
 
-}
-
-
-int EdgeItem::type() const
-{
-  return EDGEITEM;
-}
+//ElementItem::ElementItem( HEXA_NS::EltBase* docElement, HexaType ttype, HexaTreeRole treeRole):
+//QStandardItem()
+//{
+//     m_DocElt = docElement;
+//     m_type   = ttype;
+//
+//     if (m_DocElt != NULL)
+//             setText(m_DocElt->getName());
+//     setData( treeRole,    HEXA_TREE_ROLE );
+//     setData( IDptr(),     HEXA_ENTRY_ROLE );
+//
+////   if (m_DocElt->isAssociated())
+////           setData(  "Y" ,     HEXA_ASSOC_ENTRY_ROLE );
+//}
 
-QVariant EdgeItem::data( int role ) const
+//---------------------------------------------------------------
+QVariant ElementItem::data( int role ) const
 {
        if ( role == HEXA_DATA_ROLE ){
-               return QVariant::fromValue( _hexaEdge );
-       } else if (role == Qt::ForegroundRole ) {
-               const HEXA_NS::Shapes& assocs = _hexaEdge->getAssociations();
-               if ( assocs.size()>0 )
-                       return QColor(Qt::darkGreen);
-               else
-                       return QColor(Qt::black);
-       } else {
-               return QStandardItem::data( role );
+               switch(m_type)
+               {
+               case VERTEXITEM: return QVariant::fromValue( (HEXA_NS::Vertex*)m_DocElt );
+               case EDGEITEM: return QVariant::fromValue( (HEXA_NS::Edge*)m_DocElt );
+               case QUADITEM: return QVariant::fromValue( (HEXA_NS::Quad*)m_DocElt );
+               case HEXAITEM: return QVariant::fromValue( (HEXA_NS::Hexa*)m_DocElt );
+               case VECTORITEM: return QVariant::fromValue( (HEXA_NS::Vector*)m_DocElt );
+               case CYLINDERITEM: return QVariant::fromValue( (HEXA_NS::Cylinder*)m_DocElt );
+               case PIPEITEM: return QVariant::fromValue( (HEXA_NS::Pipe*)m_DocElt );
+               case ELEMENTSITEM: return QVariant::fromValue( (HEXA_NS::Elements*)m_DocElt );
+               case CROSSELEMENTSITEM: return QVariant::fromValue( (HEXA_NS::CrossElements*)m_DocElt );
+               default: return QVariant::fromValue( m_DocElt );
+               }
        }
-}
 
-void EdgeItem::setData ( const QVariant & value, int role )
-{
-    if ( role == HEXA_DATA_ROLE ){
-      _hexaEdge = value.value<HEXA_NS::Edge*>();
-      emitDataChanged ();
-    } else {
-      QStandardItem::setData ( value, role );
-    }
-}
-
-
-
-
-// ----------------------- QUAD
-QuadItem::QuadItem( HEXA_NS::Quad* hexaQuad ):
-  QStandardItem(),
-  _hexaQuad( hexaQuad )
-{
-//   char pName[12];
-  QString name = _hexaQuad->getName(/*pName*/);
-  setText(name);
-  setData( QUAD_TREE, HEXA_TREE_ROLE );
-  setData( QString::number(reinterpret_cast<intptr_t>(_hexaQuad)), HEXA_ENTRY_ROLE );
-
-  QString entries, entry;
-  const HEXA_NS::Shapes& assocs = hexaQuad->getAssociations();
-  for( HEXA_NS::Shapes::const_iterator anAssoc = assocs.begin(); anAssoc != assocs.end(); ++anAssoc ){
-    entry = (*anAssoc)->ident.c_str();
-    entries += entry + ";";
-  }
-  if ( !entries.isEmpty() )
-    setData( entries, HEXA_ASSOC_ENTRY_ROLE );
-}
-
-
-int QuadItem::type() const
-{
-  return QUADITEM;
-}
-
-QVariant QuadItem::data( int role ) const
-{
-       if ( role == HEXA_DATA_ROLE ){
-               return QVariant::fromValue( _hexaQuad );
-       } else if ( role == Qt::ForegroundRole ) {
-               const HEXA_NS::Shapes& assocs = _hexaQuad->getAssociations();
-               if ( assocs.size()>0 )
+       if (role == Qt::ForegroundRole ) {
+               if ( m_DocElt->isAssociated() )
                        return QColor(Qt::darkGreen);
                else
                        return QColor(Qt::black);
-       } else {
-               return QStandardItem::data( role );
        }
+       return QStandardItem::data( role );
 }
 
-void QuadItem::setData ( const QVariant & value, int role )
-{
-    if ( role == HEXA_DATA_ROLE ){
-      _hexaQuad = value.value<HEXA_NS::Quad*>();
-      emitDataChanged ();
-    } else {
-      QStandardItem::setData ( value, role );
-    }
-}
-
-
-
-
-
-// ----------------------- HEXA
-
-HexaItem::HexaItem( HEXA_NS::Hexa* hexaHexa ):
-  QStandardItem(),
-  _hexaHexa( hexaHexa )
-{
-//   char pName[12];
-  QString name = _hexaHexa->getName(/*pName*/);
-  setText(name);
-  setData( HEXA_TREE, HEXA_TREE_ROLE );
-  setData( QString::number( reinterpret_cast<intptr_t>(_hexaHexa)), HEXA_ENTRY_ROLE );
-}
-
-
-int HexaItem::type() const
-{
-  return HEXAITEM;
-}
-
-QVariant HexaItem::data( int role ) const
+//---------------------------------------------------------------
+void ElementItem::setData ( const QVariant& valcont, int role )
 {
        if ( role == HEXA_DATA_ROLE ){
-               return QVariant::fromValue( _hexaHexa );
-       }
-       else if ( role == Qt::ForegroundRole ) {
-               return QColor(Qt::black);
-       }
-       else {
-               return QStandardItem::data( role );
-       }
-}
-
-void HexaItem::setData ( const QVariant & value, int role )
-{
-    if ( role == HEXA_DATA_ROLE ){
-      _hexaHexa = value.value<HEXA_NS::Hexa*>();
-      emitDataChanged ();
-    } else {
-      QStandardItem::setData ( value, role );
-    }
-}
+               m_DocElt = valcont.value<HEXA_NS::EltBase*>();
+               emitDataChanged ();
 
-
-
-
-
-// ----------------------- VECTOR
-VectorItem::VectorItem( HEXA_NS::Vector* hexaVector ):
-  QStandardItem(),
-  _hexaVector( hexaVector )
-{
-//   char pName[12];
-  QString name = _hexaVector->getName(/*pName*/);
-  setText(name);
-  setData( VECTOR_TREE, HEXA_TREE_ROLE );
-  setData( QString::number(reinterpret_cast<intptr_t>(_hexaVector)), HEXA_ENTRY_ROLE );
-}
-
-int VectorItem::type() const
-{
-  return VECTORITEM;
-}
-
-QVariant VectorItem::data( int role ) const 
-{ 
-    if ( role == HEXA_DATA_ROLE ){
-      return QVariant::fromValue( _hexaVector );
-    } else {
-      return QStandardItem::data( role );
-    }
-}
-
-void VectorItem::setData ( const QVariant & value, int role )
-{
-    if ( role == HEXA_DATA_ROLE ){
-      _hexaVector = value.value<HEXA_NS::Vector*>();
-      emitDataChanged ();
-    } else {
-      QStandardItem::setData ( value, role );
-    }
-}
-
-
-
-
-// ----------------------- CYLINDER
-CylinderItem::CylinderItem( HEXA_NS::Cylinder* hexaCylinder):
-  QStandardItem(),
-  _hexaCylinder( hexaCylinder )
-{
-//   char pName[12];
-  QString name = _hexaCylinder->getName(/*pName*/);
-  setText(name);
-  setData( CYLINDER_TREE, HEXA_TREE_ROLE );
-  setData( QString::number(reinterpret_cast<intptr_t>(_hexaCylinder)), HEXA_ENTRY_ROLE );
-}
-
-int CylinderItem::type() const
-{
-  return CYLINDERITEM;
-}
-
-QVariant CylinderItem::data( int role ) const 
-{ 
-    if ( role == HEXA_DATA_ROLE ){
-      return QVariant::fromValue( _hexaCylinder );
-    } else {
-      return QStandardItem::data( role );
-    }
-}
-
-void CylinderItem::setData ( const QVariant & value, int role )
-{
-    if ( role == HEXA_DATA_ROLE ){
-      _hexaCylinder = value.value<HEXA_NS::Cylinder*>();
-      emitDataChanged ();
-    } else {
-      QStandardItem::setData ( value, role );
-    }
+       } else {
+               QStandardItem::setData ( valcont, role );
+       }
 }
+//---------------------------------------------------------------
+int ElementItem::type () const {return m_type;}
+//---------------------------------------------------------------
+bool ElementItem::isAssoc () const {return m_DocElt->isAssociated();}
+//---------------------------------------------------------------
+QString ElementItem::IDptr() const {  return QString::number( reinterpret_cast<intptr_t>(m_DocElt) ); }
 
 
-
-
-// ----------------------- PIPE
-PipeItem::PipeItem( HEXA_NS::Pipe* hexaPipe ):
-  QStandardItem(),
-  _hexaPipe( hexaPipe )
+// ----------------------- VERTEX (DATA)
+VertexItem::VertexItem( HEXA_NS::Vertex* hexaVertex, QString entry):
+               GraphicElementItem(hexaVertex, entry, VERTEXITEM, VERTEX_TREE)
 {
-//   char pName[12];
-  QString name = _hexaPipe->getName(/*pName*/);
-  setText(name);
-  setData( PIPE_TREE, HEXA_TREE_ROLE );
-  setData( QString::number(reinterpret_cast<intptr_t>(_hexaPipe)), HEXA_ENTRY_ROLE );
 }
 
-int PipeItem::type() const
+// ----------------------- EDGE   (DATA)
+EdgeItem::EdgeItem( HEXA_NS::Edge* hexaEdge, QString entry ):
+               GraphicElementItem(hexaEdge, entry, EDGEITEM, EDGE_TREE)
 {
-  return PIPEITEM;
-}
-
-QVariant PipeItem::data( int role ) const 
-{ 
-    if ( role == HEXA_DATA_ROLE ){
-      return QVariant::fromValue( _hexaPipe );
-    } else {
-      return QStandardItem::data( role );
-    }
 }
 
-void PipeItem::setData ( const QVariant & value, int role )
+// ----------------------- QUAD   (DATA)
+QuadItem::QuadItem( HEXA_NS::Quad* hexaQuad, QString entry):
+               GraphicElementItem(hexaQuad, entry, QUADITEM, QUAD_TREE)
 {
-    if ( role == HEXA_DATA_ROLE ){
-      _hexaPipe = value.value<HEXA_NS::Pipe*>();
-      emitDataChanged ();
-    } else {
-      QStandardItem::setData ( value, role );
-    }
 }
 
-
-
-// ----------------------- ELEMENTS
-ElementsItem::ElementsItem( HEXA_NS::Elements* hexaElements ):
-  QStandardItem(),
-  _hexaElements( hexaElements )
+// ----------------------- HEXA   (DATA)
+HexaItem::HexaItem( HEXA_NS::Hexa* hexaHexa , QString entry):
+               GraphicElementItem(hexaHexa,entry, HEXAITEM, HEXA_TREE)
 {
-//   char pName[12];
-  QString name = _hexaElements->getName(/*pName*/);
-  setText(name);
-  setData( ELEMENTS_TREE, HEXA_TREE_ROLE );
-  setData( QString::number(reinterpret_cast<intptr_t>(_hexaElements)), HEXA_ENTRY_ROLE );
 }
 
-int ElementsItem::type() const
+// ----------------------- VECTOR   (BUILDER)
+VectorItem::VectorItem( HEXA_NS::Vector* hexaVector, QString entry ):
+               StandardElementItem(hexaVector, entry, VECTORITEM, VECTOR_TREE)
 {
-  return ELEMENTSITEM;
 }
 
-QVariant ElementsItem::data( int role ) const 
-{ 
-    if ( role == HEXA_DATA_ROLE ){
-      return QVariant::fromValue( _hexaElements );
-    } else {
-      return QStandardItem::data( role );
-    }
-}
-
-void ElementsItem::setData ( const QVariant & value, int role )
+// ----------------------- CYLINDER (BUILDER)
+CylinderItem::CylinderItem( HEXA_NS::Cylinder* hexaCylinder, QString entry):
+               StandardElementItem(hexaCylinder, entry, CYLINDERITEM, CYLINDER_TREE)
 {
-    if ( role == HEXA_DATA_ROLE ){
-      _hexaElements = value.value<HEXA_NS::Elements*>();
-      emitDataChanged ();
-    } else {
-      QStandardItem::setData ( value, role );
-    }
 }
 
-
-
-// ----------------------- CROSSELEMENTS
-CrossElementsItem::CrossElementsItem( HEXA_NS::CrossElements* hexaCrossElts ):
-  QStandardItem(),
-  _hexaCrossElts( hexaCrossElts )
+// ----------------------- PIPE     (BUILDER)
+PipeItem::PipeItem( HEXA_NS::Pipe* hexaPipe, QString entry ):
+               StandardElementItem(hexaPipe, entry, PIPEITEM, PIPE_TREE)
 {
-//   char pName[12];
-  QString name = _hexaCrossElts->getName(/*pName*/);
-  setText(name);
-  setData( CROSSELEMENTS_TREE, HEXA_TREE_ROLE );
-  setData( QString::number(reinterpret_cast<intptr_t>(_hexaCrossElts)), HEXA_ENTRY_ROLE );
 }
 
-int CrossElementsItem::type() const
+// ----------------------- ELEMENTS      (NOT USED)
+ElementsItem::ElementsItem( HEXA_NS::Elements* hexaElements, QString entry ):
+               StandardElementItem(hexaElements, entry, ELEMENTSITEM, ELEMENTS_TREE)
 {
-  return CROSSELEMENTSITEM;
 }
 
-QVariant CrossElementsItem::data( int role ) const 
-{ 
-    if ( role == HEXA_DATA_ROLE ){
-      return QVariant::fromValue( _hexaCrossElts );
-    } else {
-      return QStandardItem::data( role );
-    }
-}
-
-void CrossElementsItem::setData ( const QVariant & value, int role )
+// ----------------------- CROSSELEMENTS (NOT USED)
+CrossElementsItem::CrossElementsItem( HEXA_NS::CrossElements* hexaCrossElts, QString entry ):
+               StandardElementItem(hexaCrossElts, entry, CROSSELEMENTSITEM, CROSSELEMENTS_TREE)
 {
-    if ( role == HEXA_DATA_ROLE ){
-      _hexaCrossElts = value.value<HEXA_NS::CrossElements*>();
-      emitDataChanged ();
-    } else {
-      QStandardItem::setData ( value, role );
-    }
 }
 
-
-
 // ----------------------- GROUP
 GroupItem::GroupItem( HEXA_NS::Group* hexaGroup ):
   QStandardItem(),
@@ -459,8 +209,8 @@ int GroupItem::type() const
   return GROUPITEM;
 }
 
-QVariant GroupItem::data( int role ) const 
-{ 
+QVariant GroupItem::data( int role ) const
+{
     if ( role == HEXA_DATA_ROLE ){
       return QVariant::fromValue( _hexaGroup );
     } else {
@@ -497,8 +247,8 @@ int LawItem::type() const
   return LAWITEM;
 }
 
-QVariant LawItem::data( int role ) const 
-{ 
+QVariant LawItem::data( int role ) const
+{
     if ( role == HEXA_DATA_ROLE ){
       return QVariant::fromValue( _hexaLaw);
     } else {
@@ -536,8 +286,8 @@ int PropagationItem::type() const
   return PROPAGATIONITEM;
 }
 
-QVariant PropagationItem::data( int role ) const 
-{ 
+QVariant PropagationItem::data( int role ) const
+{
     if ( role == HEXA_DATA_ROLE ){
       return QVariant::fromValue( _hexaPropagation );
     } else {
@@ -554,3 +304,6 @@ void PropagationItem::setData ( const QVariant & value, int role )
       QStandardItem::setData ( value, role );
     }
 }
+//-------------------------------------------------
+
+
index b5a16aa456e6e095d186ee0559c834a519143887..8813de2969538daa07f4cb369f7483405f57b2d4 100755 (executable)
@@ -41,6 +41,7 @@
 #include <HexLaw.hxx>
 #include <HexPropagation.hxx>
 
+#include "vtkActor.h"
 
 
 Q_DECLARE_METATYPE( HEXA_NS::EltBase* );
@@ -67,7 +68,7 @@ namespace HEXABLOCK
 {
   namespace GUI
   {
-    enum {
+    enum HexaType {
       VERTEXITEM = QStandardItem::UserType + 1,
       EDGEITEM,
       QUADITEM,
@@ -82,7 +83,6 @@ namespace HEXABLOCK
       GROUPITEM,
       LAWITEM,
       PROPAGATIONITEM,
-
     };
 
     enum HexaTreeRole { 
@@ -129,195 +129,146 @@ namespace HEXABLOCK
 
 // QVariant::UserType
 
-    class VertexItem : public QStandardItem
+    //===================================================================================
+    class ElementItem : public QStandardItem
     {
       public:
-        VertexItem( HEXA_NS::Vertex* hexaVertex );
-        virtual int type () const;
-        virtual QVariant data ( int role ) const;
-        virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
+       ElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole);
+       ElementItem( HEXA_NS::EltBase* docElement, HexaType ttype, HexaTreeRole treeRole);
+       virtual QVariant data( int role ) const;
+       virtual void     setData ( const QVariant& valcont, int role );
+       int      type () const;
+       virtual bool     isAssoc() const;
+       virtual QString  IDptr() const;
+
       private:
-        HEXA_NS::Vertex* _hexaVertex;
+        int                m_type;
+        HEXA_NS::EltBase*  m_DocElt; // Vertex and so.
     };
+    //===================================================================================
 
-    class EdgeItem : public QStandardItem
+    class GraphicElementItem : public ElementItem
     {
       public:
-        EdgeItem( HEXA_NS::Edge* hexaEdge );
-        virtual int type () const;
-        virtual QVariant data ( int role ) const;
-        virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
+       GraphicElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole):
+               ElementItem( docElement, entry, ttype, treeRole)
+       {
+       }
+
       private:
-        HEXA_NS::Edge* _hexaEdge;
+        vtkActor* actor;
+        int       IDinActor;
     };
 
-    class QuadItem : public QStandardItem
+    class StandardElementItem : public ElementItem
     {
-      public:
-        QuadItem( HEXA_NS::Quad* hexaQuad );
-        virtual int type () const;
-        virtual QVariant data ( int role ) const;
-        virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
-      private:
-        HEXA_NS::Quad* _hexaQuad;
+       public:
+       StandardElementItem( HEXA_NS::EltBase* docElement, QString entry, HexaType ttype, HexaTreeRole treeRole):
+               ElementItem( docElement, entry, ttype, treeRole)
+       {
+       }
     };
 
-
-    class HexaItem : public QStandardItem
+    class VertexItem : public GraphicElementItem
     {
       public:
-        HexaItem( HEXA_NS::Hexa* hexaHexa );
-        virtual int type () const;
-        virtual QVariant data ( int role ) const;
-        virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
-      private:
-        HEXA_NS::Hexa* _hexaHexa;
+        VertexItem( HEXA_NS::Vertex* hexaVertex, QString entry="" );
     };
 
-
-    class VectorItem : public QStandardItem
+    class EdgeItem : public GraphicElementItem
     {
       public:
-        VectorItem( HEXA_NS::Vector* hexaVector );
-        virtual int type () const;
-        virtual QVariant data ( int role ) const;
-        virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
-      private:
-        HEXA_NS::Vector* _hexaVector;
+        EdgeItem( HEXA_NS::Edge* hexaEdge, QString entry="" );
     };
-
-
-    class CylinderItem : public QStandardItem
+    //-----------------------------------------
+    class QuadItem : public GraphicElementItem
     {
       public:
-        CylinderItem( HEXA_NS::Cylinder* hexaCyl );
-        virtual int type () const;
-        virtual QVariant data ( int role ) const;
-        virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
-      private:
-        HEXA_NS::Cylinder* _hexaCylinder;
+        QuadItem( HEXA_NS::Quad* hexaQuad, QString entry="" );
     };
+    //-----------------------------------------
 
+    class HexaItem : public GraphicElementItem
+    {
+      public:
+        HexaItem( HEXA_NS::Hexa* hexaHexa, QString entry="" );
+    };
+    //-----------------------------------------
 
-    class PipeItem : public QStandardItem
+    class VectorItem : public StandardElementItem
     {
       public:
-        PipeItem( HEXA_NS::Pipe* hexaPipe );
-        virtual int type () const;
-        virtual QVariant data ( int role ) const;
-        virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
-      private:
-        HEXA_NS::Pipe* _hexaPipe;
+        VectorItem( HEXA_NS::Vector* hexaVector, QString entry="" );
     };
+    //-----------------------------------------
 
+    class CylinderItem : public StandardElementItem
+    {
+      public:
+        CylinderItem( HEXA_NS::Cylinder* hexaCyl, QString entry="" );
+    };
+    //-----------------------------------------
 
-    class ElementsItem : public QStandardItem
+    class PipeItem : public StandardElementItem
     {
       public:
-        ElementsItem( HEXA_NS::Elements* hexaElements );
-        virtual int type () const;
-        virtual QVariant data ( int role ) const;
-        virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
-      private:
-        HEXA_NS::Elements* _hexaElements;
+        PipeItem( HEXA_NS::Pipe* hexaPipe, QString entry="" );
     };
+    //-----------------------------------------
 
-    class CrossElementsItem : public QStandardItem
+    class ElementsItem : public StandardElementItem
     {
       public:
-        CrossElementsItem( HEXA_NS::CrossElements* hexaCrossElts );
-        virtual int type () const;
-        virtual QVariant data ( int role ) const;
-        virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
-      private:
-        HEXA_NS::CrossElements* _hexaCrossElts;
+        ElementsItem( HEXA_NS::Elements* hexaElements, QString entry="" );
+    };
+    //-----------------------------------------
+    class CrossElementsItem : public StandardElementItem
+    {
+      public:
+        CrossElementsItem( HEXA_NS::CrossElements* hexaCrossElts, QString entry="" );
     };
 
 
-      
 
+    //-----------------------------------------
     class GroupItem : public QStandardItem
     {
-      public:
-        GroupItem( HEXA_NS::Group* hexaGroup );
-        virtual int type () const;
-        virtual QVariant data ( int role ) const;
-        virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
-      private:
-        HEXA_NS::Group* _hexaGroup;
+    public:
+       GroupItem( HEXA_NS::Group* hexaGroup );
+       virtual int type () const;
+       virtual QVariant data ( int role ) const;
+       virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
+    private:
+       HEXA_NS::Group* _hexaGroup;
     };
 
 
     class LawItem : public QStandardItem
     {
-      public:
-        LawItem( HEXA_NS::Law* hexaLaw );
-        virtual int type () const;
-        virtual QVariant data ( int role ) const;
-        virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
-      private:
-        HEXA_NS::Law* _hexaLaw;
+    public:
+       LawItem( HEXA_NS::Law* hexaLaw );
+       virtual int type () const;
+       virtual QVariant data ( int role ) const;
+       virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
+    private:
+       HEXA_NS::Law* _hexaLaw;
     };
 
 
     class PropagationItem : public QStandardItem
     {
-      public:
-        PropagationItem( HEXA_NS::Propagation* hexaPropagation );
-        virtual int type () const;
-        virtual QVariant data ( int role ) const;
-        virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
-      private:
-        HEXA_NS::Propagation* _hexaPropagation;
+    public:
+       PropagationItem( HEXA_NS::Propagation* hexaPropagation );
+       virtual int type () const;
+       virtual QVariant data ( int role ) const;
+       virtual void setData ( const QVariant & value, int role ); //= Qt::UserRole + 1 )
+    private:
+       HEXA_NS::Propagation* _hexaPropagation;
     };
+    //-------------------------------------------------
 
   }
 }
 
 #endif
 
-
-
-
-
-
-// The QStandardItem class provides an item for use with the QStandardItemModel class.
-// 
-// Items usually contain text, icons, or checkboxes.
-// 
-// Each item can have its own background brush which is set with the setBackground() function. The current background brush can be found with background(). The text label for each item can be rendered with its own font and brush. These are specified with the setFont() and setForeground() functions, and read with font() and foreground().
-// 
-// By default, items are enabled, editable, selectable, checkable, and can be used both as the source of a drag and drop operation and as a drop target. Each item's flags can be changed by calling setFlags(). Checkable items can be checked and unchecked with the setCheckState() function. The corresponding checkState() function indicates whether the item is currently checked.
-// 
-// You can store application-specific data in an item by calling setData().
-// 
-// Each item can have a two-dimensional table of child items. This makes it possible to build hierarchies of items. The typical hierarchy is the tree, in which case the child table is a table with a single column (a list).
-// 
-// The dimensions of the child table can be set with setRowCount() and setColumnCount(). Items can be positioned in the child table with setChild(). Get a pointer to a child item with child(). New rows and columns of children can also be inserted with insertRow() and insertColumn(), or appended with appendRow() and appendColumn(). When using the append and insert functions, the dimensions of the child table will grow as needed.
-// 
-// An existing row of children can be removed with removeRow() or takeRow(); correspondingly, a column can be removed with removeColumn() or takeColumn().
-// 
-// An item's children can be sorted by calling sortChildren().
-
-
-// Subclassing
-// 
-// When subclassing QStandardItem to provide custom items, it is possible to define new types for them so that they can be distinguished from the base class. The type() function should be reimplemented to return a new type value equal to or greater than UserType.
-// 
-// Reimplement data() and setData() if you want to perform custom handling of data queries and/or control how an item's data is represented.
-// 
-// Reimplement clone() if you want QStandardItemModel to be able to create instances of your custom item class on demand (see QStandardItemModel::setItemPrototype()).
-// 
-// Reimplement read() and write() if you want to control how items are represented in their serialized form.
-// 
-// Reimplement operator<() if you want to control the semantics of item comparison. operator<() determines the sorted order when sorting items with sortChildren() or with QStandardItemModel::sort().
-
-// QStandardItemModel model;
-//  QStandardItem *parentItem = model.invisibleRootItem();
-//  for (int i = 0; i < 4; ++i) {
-//      QStandardItem *item = new QStandardItem(QString("item %0").arg(i));
-//      parentItem->appendRow(item);
-//      parentItem = item;
-//  }
-
-//  QStandardItem *item = myStandardItemModel->itemFromIndex(index);
index 1f1d0d7ffc068cf2db663d2beba63658aee34aba..3cad03dec0c571d63adc932323b0b026890fa3bc 100755 (executable)
@@ -19,7 +19,6 @@
 
 //CS_TODO: relever les fonctions qui nécessitent updateData().
 //        addGroupElement à tester
-
 #include <algorithm>
 #include <string>
 
 #include "HexVertex.hxx"
 #include "HexShape.hxx"
 
+#include <GEOMBase.h>
+#include "HEXABLOCKGUI_SalomeTools.hxx"
+
 #include <qglobal.h>
 //#define _DEVDEBUG_
 
 
 using namespace std;
+//using namespace HEXA_NS;
 using namespace HEXABLOCK::GUI;
 
 /*****************************************************************
@@ -139,17 +142,68 @@ QString DocumentModel::getName()
   return _hexaDocument->getName();
 }
 
+HEXA_NS::EltBase* DocumentModel::getHexaPtr(const QModelIndex& iElt)
+{
+       HEXA_NS::EltBase *elt = NULL;
+       switch ( /*data(iElt, HEXA_TREE_ROLE).toInt()*/iElt.data(HEXA_TREE_ROLE).toInt() ){
+               case VERTEX_TREE : elt = getHexaPtr<HEXA_NS::Vertex*>(iElt); break;
+               case EDGE_TREE : elt = getHexaPtr<HEXA_NS::Edge*>(iElt); break;
+               case QUAD_TREE : elt = getHexaPtr<HEXA_NS::Quad*>(iElt); break;
+               case HEXA_TREE : elt = getHexaPtr<HEXA_NS::Hexa*>(iElt); break;
+               case VECTOR_TREE : elt = getHexaPtr<HEXA_NS::Vector*>(iElt); break;
+               case CYLINDER_TREE : elt = getHexaPtr<HEXA_NS::Cylinder*>(iElt); break;
+               case PIPE_TREE : elt = getHexaPtr<HEXA_NS::Pipe*>(iElt); break;
+               case ELEMENTS_TREE : elt = getHexaPtr<HEXA_NS::Elements*>(iElt); break;
+               case CROSSELEMENTS_TREE : elt = getHexaPtr<HEXA_NS::CrossElements*>(iElt); break;
+       }
+       return elt;
+}
+
+DocumentModel::GeomObj* DocumentModel::convertToGeomObj(GEOM::GeomObjPtr geomObjPtr)
+{
+       TopoDS_Shape aShape;
+       DocumentModel::GeomObj *res = NULL;
+
+       if ( geomObjPtr && GEOMBase::GetShape(geomObjPtr.get(), aShape) && !aShape.IsNull() )
+       {
+               res = new DocumentModel::GeomObj;
+               if (res == NULL) return NULL;
+               QString mainShapeEntry;
+               int     subId = -1;
+               QString brep;
+
+               if ( geomObjPtr->IsMainShape() ){
+                       mainShapeEntry = geomObjPtr->GetStudyEntry();
+                       brep =  shape2string( aShape ).c_str();
+               } else {
+                       TopoDS_Shape shape;
+                       TopoDS_Shape subshape;
+                       GEOM::GEOM_Object_var mainShape = geomObjPtr->GetMainShape();
+                       mainShapeEntry = mainShape->GetStudyEntry();
+                       // CS_TODO : à optimiser
+                       bool okShape = GEOMBase::GetShape( mainShape , shape);//,const TopAbs_ShapeEnum type = TopAbs_SHAPE );
+                       bool oksubShape = GEOMBase::GetShape( geomObjPtr.get(), subshape );//,const TopAbs_ShapeEnum type = TopAbs_SHAPE );
+                       if ( okShape && oksubShape ){
+                               brep =  shape2string( subshape ).c_str();
+                               subId = GEOMBase::GetIndex( subshape, shape );
+                       }
+               }
+               res->name  = GEOMBase::GetName( geomObjPtr.get() );
+               res->entry = mainShapeEntry;
+               res->subid = QString::number(subId);
+               res->brep  = brep;
+               res->start = 0.;
+               res->end   = 1.;
+       }
+
+       return res;
+}
+
+
 void DocumentModel::load( const QString& xmlFileName ) // Fill Data
 {
   MESSAGE("HEXABLOCKGUI::load()  => "<<xmlFileName.toStdString());
-  //   QString tmp = xmlFileName.section('.', 0, 0); //CS_BP bof
-  // _hexaDocument->setFile( tmp.toLocal8Bit().constData() );
-  // _hexaDocument->loadXml();
-  //std::cout << "AAAAAAAAAA name ->" << _hexaDocument->getName() << std::endl;
-  //   _hexaDocument->loadXml(tmp.toLocal8Bit().constData() );
   _hexaDocument->loadXml(xmlFileName.toLocal8Bit().constData() );
-  //std::cout << "BBBBBBBBB  name ->" << _hexaDocument->getName() << std::endl;
-  //std::cout << "DocumentModel::load ->" << tmp.toStdString() << std::endl;
   clearAll();
 
   fillData();
@@ -158,9 +212,6 @@ void DocumentModel::load( const QString& xmlFileName ) // Fill Data
   fillGroups();
   fillMesh();
 
-//   tmp = "/tmp/load.vtk";
-//   //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
-
   emit patternDataChanged();
 
   // BUILDER, ASSOCIATION, GROUPS, ... CS_TODO _fillBuilderFrom( _hexaDocument );
@@ -169,27 +220,16 @@ void DocumentModel::load( const QString& xmlFileName ) // Fill Data
 void DocumentModel::save( const QString& xmlFileName )
 {
   MESSAGE("HEXABLOCKGUI::save()  => "<<xmlFileName.toStdString());
-  //std::cout << "DocumentModel::save ->" << xmlFileName.toStdString() << std::endl;
-  //std::cout << "DocumentModel::save _hexaDocument->" << _hexaDocument << std::endl;
-//   QString noSuffix = xmlFileName.section('.', 0, 0);
-  //std::cout << "DocumentModel::save ->" << noSuffix.toStdString() << std::endl;
-  //_hexaDocument->setFile( noSuffix.toLocal8Bit().constData() );   // Abu
-  //_hexaDocument->saveFile();   // Abu
-//   _hexaDocument->save( noSuffix.toLocal8Bit().constData() );
   _hexaDocument->save( xmlFileName.toLocal8Bit().constData() );
 }
 
 void DocumentModel::updateData()
 {
-  //std::cout<<"DocumentModel::updateData()  begin"<<std::endl;
   clearData();
   fillData();
   clearMesh();
   fillMesh();
-  QString tmp = "/tmp/load.vtk";
-  ////_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   emit patternDataChanged();
-  //std::cout<<"DocumentModel::updateData()  end"<<std::endl;
 }
 
 void DocumentModel::clearAll() 
@@ -240,118 +280,44 @@ void DocumentModel::clearMesh()
 
 void DocumentModel::fillData()
 {
-  //std::cout<<"DocumentModel::fillData()  begin"<<std::endl;
-
-  //std::cout << "DocumentModel::fillData() _hexaDocument->" << _hexaDocument << std::endl;
-
   // DATA
   HEXA_NS::Vertex *v     = NULL;
   VertexItem      *vItem = NULL;
   for ( int i=0; i<_hexaDocument->countVertex(); ++i ){
-//     /*char pName[12];*/ std::string name;
-//     HEXA_NS::Shape *aShape = NULL;
-//     QString         shapeIDs;
-
     v = _hexaDocument->getVertex(i);
-//     name   = v->getName(/*pName*/);
-//     aShape = v->getAssociation();
-
-    vItem = new VertexItem(v);
-    vItem->setData( _entry, HEXA_DOC_ENTRY_ROLE );
-//     if ( aShape ){
-//       shapeIDs = aShape->ident.c_str();
-//       shapeIDs += ";";
-//       vItem->setData( QVariant::fromValue(shapeIDs), HEXA_ASSOC_ENTRY_ROLE );
-//     }
+
+    vItem = new VertexItem(v, _entry);
     _vertexDirItem->appendRow(vItem);
-//     std::cout<<name<<":"<< shapeIDs.toStdString() <<std::endl;
-
-    //CS_TEST
-//     HEXA_NS::Shape* s = v->getAssociation();
-//     std::cout<<"assoc->"<<s<<std::endl;
-//     if (s){
-//       QList<QStandardItem *>  assocItems;
-//       assocItems << new QStandardItem(s->ident.c_str()); 
-//       std::cout<<"assoc id =>"<<s->ident<<std::endl;
-//       vItem->appendColumn(assocItems);
-//     }
-// 
-    //CS_TEST
-//     _vertexDirItem->setEditable( false );//CS_TEST
   }
 
   HEXA_NS::Edge *e     = NULL;
   EdgeItem      *eItem = NULL;
   for ( int i=0; i<_hexaDocument->countEdge(); ++i ){
-//     /*char pName[12]; */std::string name;
-//     HEXA_NS::Shapes shapeList;
-//     QString         shapeIDs;
-
     e = _hexaDocument->getEdge(i);
-//     name      = e->getName(pName);
-//     shapeList = e->getAssociations();
-
-    eItem = new EdgeItem(e);
-    eItem->setData( _entry, HEXA_DOC_ENTRY_ROLE );
-
-//     std::cout << "shapeList.size() => " << shapeList.size() << std::endl;
-// 
-//     if ( !shapeList.empty() ){
-//       for ( HEXA_NS::Shapes::const_iterator aShape = shapeList.begin();
-//             aShape != shapeList.end();
-//             ++aShape ){
-//         shapeIDs += (*aShape)->ident.c_str();
-//         shapeIDs += ";";
-//       }
-//       eItem->setData( QVariant::fromValue(shapeIDs), HEXA_ASSOC_ENTRY_ROLE );
-//     }
+    eItem = new EdgeItem(e, _entry);
     _edgeDirItem->appendRow(eItem);
-//     std::cout<<name<<":"<< shapeIDs.toStdString() <<std::endl;
   }
 
   HEXA_NS::Quad *q     = NULL;
   QuadItem      *qItem = NULL;
   for ( int i=0; i<_hexaDocument->countQuad(); ++i ){
-//     char pName[12]; std::string name;
-//     HEXA_NS::Shapes shapeList;
-//     QString         shapeIDs;
-
     q = _hexaDocument->getQuad(i);
-//     name      = q->getName(pName);
-//     shapeList = q->getAssociations();
-
-    qItem = new QuadItem(q);
-    qItem->setData( _entry, HEXA_DOC_ENTRY_ROLE );
-//     if ( !shapeList.empty() ){
-//       for ( HEXA_NS::Shapes::const_iterator aShape = shapeList.begin();
-//             aShape != shapeList.end();
-//             ++aShape ){
-//         shapeIDs += (*aShape)->ident.c_str();
-//         shapeIDs += ";";
-//       }
-//       eItem->setData( QVariant::fromValue(shapeIDs), HEXA_ASSOC_ENTRY_ROLE );
-//     }
+    qItem = new QuadItem(q, _entry);
     _quadDirItem->appendRow(qItem);
-//     std::cout<<name<<":"<< shapeIDs.toStdString() <<std::endl;
   }
 
   HEXA_NS::Hexa *h     = NULL;
   HexaItem      *hItem = NULL;
   for ( int i=0; i<_hexaDocument->countHexa(); ++i ){
     h = _hexaDocument->getHexa(i);
-    hItem = new HexaItem(h);
-    hItem->setData( _entry, HEXA_DOC_ENTRY_ROLE );
+    hItem = new HexaItem(h, _entry);
     _hexaDirItem->appendRow(hItem);
   }
-
-  //std::cout<<"DocumentModel::fillData()  end"<<std::endl;
 }
 
 
 void DocumentModel::fillBuilder() 
 {
-  //std::cout<<"DocumentModel::fillBuilder()  begin"<<std::endl;
-
   HEXA_NS::Vector *v     = NULL;
   VectorItem      *vItem = NULL;
   for ( int i=0; i<_hexaDocument->countVector(); ++i ){
@@ -365,7 +331,7 @@ void DocumentModel::fillBuilder()
   CylinderItem      *cItem = NULL;
   for ( int i=0; i<_hexaDocument->countCylinder(); ++i ){
     c = _hexaDocument->getCylinder(i);
-    cItem = new CylinderItem(c);
+    cItem = new CylinderItem(c, _entry);
     _cylinderDirItem->appendRow(cItem);
   }
 
@@ -376,40 +342,50 @@ void DocumentModel::fillBuilder()
     p = _hexaDocument->getPipe(i);
     pItem = new PipeItem(p);
     _pipeDirItem->appendRow(pItem);
-
-  } 
-//   _elementsDirItem     CS_TODO : no elements
-//   HEXA_NS::Elements *e     = NULL;
-//   ElementsItem      *eItem = NULL;
-//   for ( int i=0; i<_hexaDocument->countElements(); ++i ){
-//     e = _hexaDocument->getElements(i);
-//     eItem = new ElementsItem(e);
-//     _elementsDirItem->appendRow(eItem);
-//   }
-
-//   _crossElementsDirItem
-//   HEXA_NS::CrossElements *c = NULL;
-//   CrossElementsItem      *cItem = NULL;
-//   for ( int i=0; i<_hexaDocument->countCrossElements(); ++i ){
-//     c = _hexaDocument->getCrossElements(i);
-//     cItem = new CrossElementsItem(c);
-//     _crossElementsDirItem->appendRow(cItem);
-//   }
-
+  }
 }
-
 void DocumentModel::fillAssociation()
 {
 
 }
 
+//------------------------------------------- NEW ITEMS
+//void DocumentModel::fillGroups()
+//{
+//  HEXA_NS::Group *g     = NULL;
+//  GroupItem      *gItem = NULL;
+//  for ( int i=0; i<_hexaDocument->countGroup(); ++i ){
+//    g = _hexaDocument->getGroup(i);
+//    gItem = new GroupItem(g, _entry);
+//    _groupDirItem->appendRow(gItem);
+//  }
+//}
+//
+//void DocumentModel::fillMesh()
+//{
+//  HEXA_NS::Law *l     = NULL;
+//  LawItem      *lItem = NULL;
+//  for ( int i=0; i<_hexaDocument->countLaw(); ++i ){
+//    l = _hexaDocument->getLaw(i);
+//    lItem = new LawItem(l);
+//    _lawDirItem->appendRow(lItem);
+//  }
+//
+//  HEXA_NS::Propagation *p     = NULL;
+//  PropagationItem      *pItem = NULL;
+//  for ( int i=0; i<_hexaDocument->countPropagation(); ++i ){
+//    p = _hexaDocument->getPropagation(i);
+//    pItem = new PropagationItem(p, _entry);
+//    pItem->setText(QString("Propagation%1").arg(i) );
+//    _propagationDirItem->appendRow(pItem);
+//  }
+//}
+//----------------------------------------------- END NEW ITEMS
+
 void DocumentModel::fillGroups()
 {
-  //std::cout<<"DocumentModel::fillGroups()  begin"<<std::endl;
-//   _groupDirItem
   HEXA_NS::Group *g     = NULL;
   GroupItem      *gItem = NULL;
-  //std::cout<<"countGroup => "<< _hexaDocument->countGroup() << std::endl;
   for ( int i=0; i<_hexaDocument->countGroup(); ++i ){
     g = _hexaDocument->getGroup(i);
     //std::cout<<"getGroup => "<< i << std::endl;
@@ -417,7 +393,6 @@ void DocumentModel::fillGroups()
     gItem->setData( _entry, HEXA_DOC_ENTRY_ROLE );
     _groupDirItem->appendRow(gItem);
   } 
-  //std::cout<<"DocumentModel::fillGroups()  end"<<std::endl;
 }
 
 void DocumentModel::fillMesh()
@@ -425,10 +400,8 @@ void DocumentModel::fillMesh()
   //   _lawDirItem
   HEXA_NS::Law *l     = NULL;
   LawItem      *lItem = NULL;
-  //std::cout<<"countLaw => "<< _hexaDocument->countLaw() << std::endl;
   for ( int i=0; i<_hexaDocument->countLaw(); ++i ){
     l = _hexaDocument->getLaw(i);
-    //std::cout<<"getLaw => "<< i << std::endl;
     lItem = new LawItem(l);
     _lawDirItem->appendRow(lItem);
   }
@@ -436,10 +409,8 @@ void DocumentModel::fillMesh()
   //   _propagationDirItem
   HEXA_NS::Propagation *p     = NULL;
   PropagationItem      *pItem = NULL;
-  //std::cout<<"countPropagation => "<< _hexaDocument->countPropagation() << std::endl;
   for ( int i=0; i<_hexaDocument->countPropagation(); ++i ){
     p = _hexaDocument->getPropagation(i);
-//     std::cout<<"getPropagation => "<< i << std::endl;
     pItem = new PropagationItem(p);
     pItem->setText(QString("Propagation%1").arg(i) );
     pItem->setData( _entry, HEXA_DOC_ENTRY_ROLE );
@@ -447,62 +418,16 @@ void DocumentModel::fillMesh()
   }
 }
 
-// Qt::ItemFlags DocumentModel::flags(const QModelIndex &index) const
-// {
-//   Qt::ItemFlags flags;
-// 
-//   if (!index.isValid()){
-//       std::cout<<"!index.isValid()"<<std::endl;
-//       return Qt::ItemIsEnabled;
-//   }
-// 
-//   QStandardItem *item = itemFromIndex ( index );
-// 
-//   if ( (item->type() == VERTEXITEM) && (_vertexItemFlags != Qt::NoItemFlags) ){
-//     flags = _vertexItemFlags;
-//   } else if ( (item->type() == EDGEITEM) && (_edgeItemFlags != Qt::NoItemFlags) ){
-//     flags = _edgeItemFlags;
-//   } else if ( (item->type() == QUADITEM) && (_quadItemFlags != Qt::NoItemFlags) ){
-//     flags = _quadItemFlags;
-//   } else if ( (item->type() == HEXAITEM) && (_hexaItemFlags != Qt::NoItemFlags) ){
-//     flags = _hexaItemFlags;
-//   } else if ( (item->type() == VECTORITEM) && (_vectorItemFlags != Qt::NoItemFlags) ){
-//     flags = _vectorItemFlags;
-//   } else if ( (item->type() == CYLINDERITEM) && (_cylinderItemFlags != Qt::NoItemFlags) ){
-//     flags = _cylinderItemFlags;
-//   } else if ( (item->type() == PIPEITEM ) && (_pipeItemFlags != Qt::NoItemFlags) ){
-//     flags = _pipeItemFlags;
-//   } else if ( (item->type() == ELEMENTSITEM) && (_elementsItemFlags != Qt::NoItemFlags) ){
-//     flags = _elementsItemFlags;
-//   } else if ( (item->type() == CROSSELEMENTSITEM) && (_crossElementsItemFlags != Qt::NoItemFlags) ){
-//     flags = _crossElementsItemFlags;
-//   } else if ( (item->type() == GROUPITEM) && (_groupItemFlags != Qt::NoItemFlags) ){
-//     flags = _groupItemFlags;
-//   } else if ( (item->type() == LAWITEM ) && (_lawItemFlags != Qt::NoItemFlags) ){
-//     flags = _lawItemFlags;
-//   } else if ( (item->type() == PROPAGATIONITEM ) && (_propagationItemFlags != Qt::NoItemFlags) ){
-//     flags = _propagationItemFlags;
-//   } else {
-//     flags = item->flags();
-//   }
-// 
-//   return flags;
-// }
+HEXA_NS::Hexa* DocumentModel::getQuadHexa(HEXA_NS::Quad* quad)
+{
+       HEXA_NS::Hexa* hexa;
+       for ( int i=0; i<_hexaDocument->countHexa(); ++i ){
+               hexa = _hexaDocument->getHexa(i);
+               if (hexa->findQuad(quad) > -1) return hexa;
+       }
+       return NULL;
+}
 
-// Qt::ItemFlags DocumentModel::flags(const QModelIndex &index) const
-// {
-//   Qt::ItemFlags flags;
-// 
-//   if (!index.isValid()) return Qt::ItemIsEnabled;
-//   QStandardItem *item = itemFromIndex ( index );
-//   if ( _disallowEdition ){
-//     flags = Qt::ItemFlags( ~Qt::ItemIsEditable );
-//   } else {
-//     flags = item->flags();
-//   }
-// 
-//   return flags;
-// }
 
 Qt::ItemFlags DocumentModel::flags(const QModelIndex &index) const
 {
@@ -531,25 +456,6 @@ void DocumentModel::disallowEdition()
   MESSAGE("}");
 }
 
-// disallowEdition
-// void DocumentModel::allowAllSelection()
-// {
-//   _vertexItemFlags = Qt::NoItemFlags;
-//   _edgeItemFlags   = Qt::NoItemFlags;
-//   _quadItemFlags   = Qt::NoItemFlags;
-//   _hexaItemFlags   = Qt::NoItemFlags;
-// 
-//   _vectorItemFlags   = Qt::NoItemFlags;
-//   _cylinderItemFlags = Qt::NoItemFlags;
-//   _pipeItemFlags     = Qt::NoItemFlags;
-//   _elementsItemFlags      = Qt::NoItemFlags;
-//   _crossElementsItemFlags = Qt::NoItemFlags;
-// 
-//   _groupItemFlags = Qt::NoItemFlags;
-//   _lawItemFlags   = Qt::NoItemFlags;
-//   _propagationItemFlags = Qt::NoItemFlags;
-// }
-
 void DocumentModel::allowDataSelectionOnly()
 {
   _vertexItemFlags = Qt::ItemFlags( ~Qt::ItemIsEditable );
@@ -568,30 +474,8 @@ void DocumentModel::allowDataSelectionOnly()
   _propagationItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
 }
 
-// void DocumentModel::allowVertexSelectionOnly()
-// {
-//     std::cout << "allowVertexSelectionOnly() allowVertexSelectionOnly() allowVertexSelectionOnly() "<< std::endl;
-//     _vertexItemFlags = Qt::ItemFlags( ~Qt::ItemIsEditable);
-//     _edgeItemFlags   = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-//     _quadItemFlags   = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-//     _hexaItemFlags   = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-// 
-//     _vectorItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-//     _cylinderItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-//     _pipeItemFlags     = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-//     _elementsItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-//     _crossElementsItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-// 
-//     _groupItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-//     _lawItemFlags   = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-//     _propagationItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-// 
-// //     emit layoutChanged();
-// }
-
 void DocumentModel::allowVertexSelectionOnly()
 {
-    //std::cout << "allowVertexSelectionOnly() allowVertexSelectionOnly() allowVertexSelectionOnly() "<< std::endl;
     _vertexItemFlags = Qt::ItemFlags( ~Qt::ItemIsEditable);
     _edgeItemFlags   = Qt::ItemFlags( ~Qt::ItemIsEditable );
     _quadItemFlags   = Qt::ItemFlags( ~Qt::ItemIsEditable );
@@ -612,7 +496,6 @@ void DocumentModel::allowVertexSelectionOnly()
 
 void DocumentModel::allowEdgeSelectionOnly()
 {
-  //std::cout << "allowEdgeSelectionOnly() allowEdgeSelectionOnly() allowEdgeSelectionOnly() "<< std::endl;
   _vertexItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
   _edgeItemFlags   = Qt::ItemFlags( ~Qt::ItemIsEditable );
   _quadItemFlags   = Qt::ItemFlags( ~Qt::ItemIsEnabled );
@@ -631,7 +514,6 @@ void DocumentModel::allowEdgeSelectionOnly()
 
 void DocumentModel::allowQuadSelectionOnly()
 {
-  //std::cout << "allowQuadSelectionOnly() allowQuadSelectionOnly() allowQuadSelectionOnly() "<< std::endl;
   _vertexItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
   _edgeItemFlags   = Qt::ItemFlags( ~Qt::ItemIsEnabled );
   _quadItemFlags = Qt::ItemFlags( ~Qt::ItemIsEditable );
@@ -668,7 +550,6 @@ void DocumentModel::allowHexaSelectionOnly()
 
 void DocumentModel::allowVectorSelectionOnly()
 {
-  //std::cout << "allowVectorSelectionOnly() allowVectorSelectionOnly() allowVectorSelectionOnly() "<< std::endl;
   _vertexItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
   _edgeItemFlags   = Qt::ItemFlags( ~Qt::ItemIsEnabled );
   _quadItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
@@ -721,28 +602,8 @@ void DocumentModel::allowPipeSelectionOnly()
   _propagationItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
 }
 
-/*
-void DocumentModel::allowPipeItemFlags()
-{
-  _vertexItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-  _edgeItemFlags   = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-  _quadItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-  _hexaItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-
-  _vectorItemFlags   = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-  _cylinderItemFlags = Qt::ItemFlags( ~Qt::ItemIsEditable );
-  _pipeItemFlags     = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-  _elementsItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-  _crossElementsItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-
-  _groupItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-  _lawItemFlags   = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-  _propagationItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
-}*/
-
 void DocumentModel::allowElementsSelectionOnly()
 {
-  //std::cout << "allowElementsSelectionOnly() allowElementsSelectionOnly() allowElementsSelectionOnly() "<< std::endl;
   _vertexItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
   _edgeItemFlags   = Qt::ItemFlags( ~Qt::ItemIsEnabled );
   _quadItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
@@ -795,65 +656,37 @@ void DocumentModel::allowLawSelectionOnly()
   _propagationItemFlags = Qt::ItemFlags( ~Qt::ItemIsEnabled );
 }
 
+
 void DocumentModel::setName( const QModelIndex& iElt, const QString& name )
 {
-  HEXA_NS::EltBase *elt = NULL;
-
-  switch ( data(iElt, HEXA_TREE_ROLE).toInt() ){
-  case VERTEX_TREE : elt = iElt.data( HEXA_DATA_ROLE ).value< HEXA_NS::Vertex* >(); break;
-  case EDGE_TREE : elt = iElt.data( HEXA_DATA_ROLE ).value< HEXA_NS::Edge* >(); break;
-  case QUAD_TREE : elt = iElt.data( HEXA_DATA_ROLE ).value< HEXA_NS::Quad* >(); break;
-  case HEXA_TREE : elt = iElt.data( HEXA_DATA_ROLE ).value< HEXA_NS::Hexa* >(); break;
-  case VECTOR_TREE : elt = iElt.data( HEXA_DATA_ROLE ).value< HEXA_NS::Vector* >(); break;
-  case CYLINDER_TREE : elt = iElt.data( HEXA_DATA_ROLE ).value< HEXA_NS::Cylinder* >(); break;
-  case PIPE_TREE : elt = iElt.data( HEXA_DATA_ROLE ).value< HEXA_NS::Pipe* >(); break;
-  case ELEMENTS_TREE : elt = iElt.data( HEXA_DATA_ROLE ).value< HEXA_NS::Elements* >(); break;
-  case CROSSELEMENTS_TREE : elt = iElt.data( HEXA_DATA_ROLE ).value< HEXA_NS::CrossElements* >(); break;
-  case GROUP_TREE :
-    { 
-      HEXA_NS::Group* grp = iElt.data( HEXA_DATA_ROLE ).value< HEXA_NS::Group* >();
-      grp->setName( name.toLatin1().data() );
-      break;
-    }
-  case LAW_TREE :
-    {
-      HEXA_NS::Law* l = iElt.data( HEXA_DATA_ROLE ).value< HEXA_NS::Law* >();
-      l->setName( name.toLatin1().data() );
-      break;
-    }
-//   case PROPAGATION_TREE : elt = iElt.data( HEXA_DATA_ROLE ).value< HEXA_NS::Propagation* >(); break;
-  }
+       HEXA_NS::EltBase *elt = NULL;
 
-  if ( elt != NULL ) elt->setName( name.toStdString() );
+       switch ( data(iElt, HEXA_TREE_ROLE).toInt() ){
+       case GROUP_TREE :
+       {
+               HEXA_NS::Group* grp = iElt.data( HEXA_DATA_ROLE ).value< HEXA_NS::Group* >();
+               grp->setName( name.toLatin1().data() );
+               break;
+       }
+       case LAW_TREE :
+       {
+               HEXA_NS::Law* l = iElt.data( HEXA_DATA_ROLE ).value< HEXA_NS::Law* >();
+               l->setName( name.toLatin1().data() );
+               break;
+       }
+       //   case PROPAGATION_TREE : elt = iElt.data( HEXA_DATA_ROLE ).value< HEXA_NS::Propagation* >(); break;
+       default: elt = getHexaPtr(iElt);
+       }
+
+       if ( elt != NULL ) elt->setName( name.toStdString() );
+       setData( iElt, name );
 
-  setData( iElt, name );
 }
 
 bool DocumentModel::clearEltAssociations( const QModelIndex& iElt )
 {
   bool isOk = false;
-  HEXA_NS::EltBase *elt = NULL;
-
-  switch ( data(iElt, HEXA_TREE_ROLE).toInt() ){
-  case VERTEX_TREE :
-    { 
-      elt = iElt.data( HEXA_DATA_ROLE ).value< HEXA_NS::Vertex* >(); 
-      //std::cout<<"VERTEX_TREE:"<<std::endl;
-      break;
-    }
-  case EDGE_TREE :
-    {
-      elt = iElt.data( HEXA_DATA_ROLE ).value< HEXA_NS::Edge* >();
-      //std::cout<<"EDGE_TREE :"<<std::endl;
-      break;
-    }
-  case QUAD_TREE :
-    {
-      elt = iElt.data( HEXA_DATA_ROLE ).value< HEXA_NS::Quad* >();
-      //std::cout<<"QUAD_TREE :"<<std::endl;
-      break;
-    }
-  }
+  HEXA_NS::EltBase *elt = getHexaPtr(iElt);
 
   if ( elt != NULL ){
     elt->clearAssociation();
@@ -866,18 +699,12 @@ bool DocumentModel::clearEltAssociations( const QModelIndex& iElt )
 
 QModelIndex DocumentModel::addVertex( double x, double y, double z )
 {
-  //std::cout << "DocumentModel::addVertex() _hexaDocument->" << _hexaDocument << std::endl;
   QModelIndex vertexIndex;
 
   HEXA_NS::Vertex* hv = _hexaDocument->addVertex(x, y, z);
   if ( hv->isValid() ){
-    VertexItem* v = new VertexItem(hv);
-    v->setData( _entry, HEXA_DOC_ENTRY_ROLE );
+    VertexItem* v = new VertexItem(hv, _entry);
     _vertexDirItem->appendRow(v);
-//     v->appendRow( new QStandardItem("titi") );
-//     QList<QStandardItem*> l;
-//     l << new QStandardItem("toto");
-//     v->appendColumn( l );
     vertexIndex = v->index();
     emit patternDataChanged();
   } else {
@@ -891,19 +718,16 @@ QModelIndex DocumentModel::addEdgeVertices (const QModelIndex &i_v0, const QMode
 {
   QModelIndex edgeIndex;
 
-  HEXA_NS::Vertex* hv0 = data(i_v0, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hv1 = data(i_v1, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Vertex* hv0 = getHexaPtr<HEXA_NS::Vertex*>(i_v0);
+  HEXA_NS::Vertex* hv1 = getHexaPtr<HEXA_NS::Vertex*>(i_v1);
 
   HEXA_NS::Edge* he = _hexaDocument->addEdge( hv0, hv1 );
 
   if ( he->isValid() ){
-    EdgeItem* e = new EdgeItem(he);
-    e->setData( _entry, HEXA_DOC_ENTRY_ROLE );
+    EdgeItem* e = new EdgeItem(he, _entry);
     _edgeDirItem->appendRow(e);
     edgeIndex = e->index();
     emit patternDataChanged();
-    QString tmp = "/tmp/addEdgeVertices.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete he;
   }
@@ -914,22 +738,31 @@ QModelIndex DocumentModel::addEdgeVector( const QModelIndex &i_v, const QModelIn
 {
   QModelIndex edgeIndex;
 
-  HEXA_NS::Vertex* hv   = data(i_v, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector* hvec = data(i_vec, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Vertex* hv   = getHexaPtr<HEXA_NS::Vertex*>(i_v);
+  HEXA_NS::Vector* hvec = getHexaPtr<HEXA_NS::Vector*>(i_vec);
+
+  if (!hv || !hvec) return edgeIndex;
 
   HEXA_NS::Edge* he = _hexaDocument->addEdge( hv, hvec );
+  if (!he) return edgeIndex;
+  HEXA_NS::Vertex* hv2 = he->getAval(); //the new vertex resulting from the creation of the edge
+  if (!hv2) return edgeIndex;
 
+  //ADD the elements in the treeview
   if ( he->isValid() ){
-    EdgeItem* e = new EdgeItem(he);
-    e->setData( _entry, HEXA_DOC_ENTRY_ROLE );
+       //The Edge
+    EdgeItem* e = new EdgeItem(he, _entry);
     _edgeDirItem->appendRow(e);
+
+    //The Vertex
+    VertexItem* v = new VertexItem(hv2, _entry);
+    _vertexDirItem->appendRow(v);
+
     edgeIndex = e->index();
     emit patternDataChanged();
-    QString tmp = "/tmp/addEdgeVector.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
-  } else {
+  } else
     delete he;
-  }
+
   return edgeIndex;
 }
 
@@ -938,30 +771,18 @@ QModelIndex DocumentModel::addQuadVertices( const QModelIndex &i_v0, const QMode
 { //CS_TODO : gestion erreur
   QModelIndex quadIndex;
 
-//   QStandardItem *item_v0 = itemFromIndex(i_v0);
-//   QStandardItem *item_v1 = itemFromIndex(i_v1);
-//   QStandardItem *item_v2 = itemFromIndex(i_v2);
-//   QStandardItem *item_v3 = itemFromIndex(i_v3);
-
-//   HASSERT( item_v0->type() == item_v1->type() 
-//         == item_v2->type() == item_v3->type()
-//         == VERTEXITEM );
-
-  HEXA_NS::Vertex* hv0 = data(i_v0, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hv1 = data(i_v1, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hv2 = data(i_v2, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hv3 = data(i_v3, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Vertex* hv0 = getHexaPtr<HEXA_NS::Vertex*>(i_v0);
+  HEXA_NS::Vertex* hv1 = getHexaPtr<HEXA_NS::Vertex*>(i_v1);
+  HEXA_NS::Vertex* hv2 = getHexaPtr<HEXA_NS::Vertex*>(i_v2);
+  HEXA_NS::Vertex* hv3 = getHexaPtr<HEXA_NS::Vertex*>(i_v3);
 
   if ( hv0 and hv1 and hv2 and hv3 ){
     HEXA_NS::Quad* hq = _hexaDocument->addQuadVertices( hv0, hv1, hv2, hv3 );
     if ( hq->isValid() ){
-      QuadItem* q = new QuadItem(hq);
-      q->setData( _entry, HEXA_DOC_ENTRY_ROLE );
+      QuadItem* q = new QuadItem(hq, _entry);
       _quadDirItem->appendRow(q);
       quadIndex = q->index();
       emit patternDataChanged();
-      QString tmp = "/tmp/addQuadVertices.vtk";
-      //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
     } else {
       delete hq;
     }
@@ -974,21 +795,18 @@ QModelIndex DocumentModel::addQuadEdges( const QModelIndex &e0, const QModelInde
 { //CS_TODO
   QModelIndex quadIndex;
 
-  HEXA_NS::Edge* he0 = data(e0, HEXA_DATA_ROLE).value<HEXA_NS::Edge *>();
-  HEXA_NS::Edge* he1 = data(e1, HEXA_DATA_ROLE).value<HEXA_NS::Edge *>();
-  HEXA_NS::Edge* he2 = data(e2, HEXA_DATA_ROLE).value<HEXA_NS::Edge *>();
-  HEXA_NS::Edge* he3 = data(e3, HEXA_DATA_ROLE).value<HEXA_NS::Edge *>();
+  HEXA_NS::Edge* he0 = getHexaPtr<HEXA_NS::Edge*>(e0);
+  HEXA_NS::Edge* he1 = getHexaPtr<HEXA_NS::Edge*>(e1);
+  HEXA_NS::Edge* he2 = getHexaPtr<HEXA_NS::Edge*>(e2);
+  HEXA_NS::Edge* he3 = getHexaPtr<HEXA_NS::Edge*>(e3);
 
   if ( he0 and he1 and he2 and he3 ){
-    HEXA_NS::Quad* hq = _hexaDocument->addQuad( he0, he1, he2, he3 );    
+    HEXA_NS::Quad* hq = _hexaDocument->addQuad( he0, he1, he2, he3 );
     if ( hq->isValid() ){
-      QuadItem* q = new QuadItem(hq);
-      q->setData( _entry, HEXA_DOC_ENTRY_ROLE );
+      QuadItem* q = new QuadItem(hq, _entry);
       _quadDirItem->appendRow(q);
       quadIndex = q->index();
       emit patternDataChanged();
-      QString tmp = "/tmp/addQuadEdges.vtk";
-      //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
     } else {
       delete hq;
     }
@@ -1004,26 +822,23 @@ QModelIndex DocumentModel::addHexaVertices(
 { 
   QModelIndex iHexa;
 
-  HEXA_NS::Vertex* hv0 = data(iv0, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hv1 = data(iv1, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hv2 = data(iv2, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hv3 = data(iv3, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hv4 = data(iv4, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hv5 = data(iv5, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hv6 = data(iv6, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hv7 = data(iv7, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Vertex* hv0 = getHexaPtr<HEXA_NS::Vertex*>(iv0);
+  HEXA_NS::Vertex* hv1 = getHexaPtr<HEXA_NS::Vertex*>(iv1);
+  HEXA_NS::Vertex* hv2 = getHexaPtr<HEXA_NS::Vertex*>(iv2);
+  HEXA_NS::Vertex* hv3 = getHexaPtr<HEXA_NS::Vertex*>(iv3);
+  HEXA_NS::Vertex* hv4 = getHexaPtr<HEXA_NS::Vertex*>(iv4);
+  HEXA_NS::Vertex* hv5 = getHexaPtr<HEXA_NS::Vertex*>(iv5);
+  HEXA_NS::Vertex* hv6 = getHexaPtr<HEXA_NS::Vertex*>(iv6);
+  HEXA_NS::Vertex* hv7 = getHexaPtr<HEXA_NS::Vertex*>(iv7);
 
   HEXA_NS::Hexa* hh = _hexaDocument->addHexaVertices( hv0, hv1, hv2, hv3,
                                                       hv4, hv5, hv6, hv7 );
 
   if ( hh->isValid() ){
-    HexaItem* h = new HexaItem(hh);
-    h->setData( _entry, HEXA_DOC_ENTRY_ROLE );
+    HexaItem* h = new HexaItem(hh, _entry);
     _hexaDirItem->appendRow(h);
     iHexa = h->index();
     emit patternDataChanged();
-    QString tmp = "/tmp/addHexaVertices.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hh;
   }
@@ -1036,32 +851,22 @@ QModelIndex DocumentModel::addHexaQuad( const QModelIndex &i_q0, const QModelInd
 { //CS_TODO : gestion erreur
   QModelIndex hexaIndex;
 
-//   QStandardItem *item_v0 = itemFromIndex(i_q0);
-//   QStandardItem *item_v1 = itemFromIndex(i_q1);
-//   QStandardItem *item_v2 = itemFromIndex(i_q2);
-//   QStandardItem *item_v3 = itemFromIndex(i_q3);
-//   QStandardItem *item_v4 = itemFromIndex(i_q4);
-//   QStandardItem *item_v5 = itemFromIndex(i_q5);
-  HEXA_NS::Quad* hq0 = data(i_q0, HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
-  HEXA_NS::Quad* hq1 = data(i_q1, HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
-  HEXA_NS::Quad* hq2 = data(i_q2, HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
-  HEXA_NS::Quad* hq3 = data(i_q3, HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
-  HEXA_NS::Quad* hq4 = data(i_q4, HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
-  HEXA_NS::Quad* hq5 = data(i_q5, HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
+  HEXA_NS::Quad* hq0 = getHexaPtr<HEXA_NS::Quad*>(i_q0);
+  HEXA_NS::Quad* hq1 = getHexaPtr<HEXA_NS::Quad*>(i_q1);
+  HEXA_NS::Quad* hq2 = getHexaPtr<HEXA_NS::Quad*>(i_q2);
+  HEXA_NS::Quad* hq3 = getHexaPtr<HEXA_NS::Quad*>(i_q3);
+  HEXA_NS::Quad* hq4 = getHexaPtr<HEXA_NS::Quad*>(i_q4);
+  HEXA_NS::Quad* hq5 = getHexaPtr<HEXA_NS::Quad*>(i_q5);
 
   HEXA_NS::Hexa* hh = _hexaDocument->addHexa( hq0, hq1, hq2, hq3, hq4, hq5 );
 
   if ( hh->isValid() ){
-    HexaItem* h = new HexaItem(hh);
-    h->setData( _entry, HEXA_DOC_ENTRY_ROLE );
+    HexaItem* h = new HexaItem(hh, _entry);
     _hexaDirItem->appendRow(h);
     hexaIndex = h->index();
     emit patternDataChanged();
-    QString tmp = "/tmp/addHexaQuad.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
-  } else {
+  } else
     delete hh;
-  }
 
   return hexaIndex;
 }
@@ -1073,36 +878,31 @@ QModelIndex DocumentModel::addHexaQuads( const QModelIndexList &iquads)
   HEXA_NS::Hexa* hh = NULL;
   HEXA_NS::Quad* hq0, *hq1, *hq2, *hq3, *hq4, *hq5 = NULL;
 
-  hq0 = data( iquads.value(0), HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
-  hq1 = data( iquads.value(1), HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
-  hq2 = data( iquads.value(2), HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
-  hq3 = data( iquads.value(3), HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
-  hq4 = data( iquads.value(4), HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
-  hq5 = data( iquads.value(5), HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
-
-  if ( hq0 && hq1 ){
-      hh = _hexaDocument->addHexa2Quads( hq0, hq1);
-  } else if ( hq0 && hq1 && hq2){
-      hh = _hexaDocument->addHexa3Quads( hq0, hq1, hq2 );
-  } else if ( hq0 && hq1 && hq2 && hq3 ){
-      hh = _hexaDocument->addHexa4Quads( hq0, hq1, hq2, hq3 );
-  } else if ( hq0 && hq1 && hq2 && hq3 && hq4 ){
-      hh = _hexaDocument->addHexa5Quads( hq0, hq1, hq2, hq3, hq4 );
-  } else if ( hq0 && hq1 && hq2 && hq3 && hq4 && hq5 ){
-      hh = _hexaDocument->addHexa( hq0, hq1, hq2, hq3, hq4, hq5 );
-  }
+  hq0 = getHexaPtr<HEXA_NS::Quad*>(iquads.value(0));
+  hq1 = getHexaPtr<HEXA_NS::Quad*>(iquads.value(1));
+  hq2 = getHexaPtr<HEXA_NS::Quad*>(iquads.value(2));
+  hq3 = getHexaPtr<HEXA_NS::Quad*>(iquads.value(3));
+  hq4 = getHexaPtr<HEXA_NS::Quad*>(iquads.value(4));
+  hq5 = getHexaPtr<HEXA_NS::Quad*>(iquads.value(5));
+
+  if ( hq0 && hq1 && hq2 && hq3 && hq4 && hq5 )
+         hh = _hexaDocument->addHexa( hq0, hq1, hq2, hq3, hq4, hq5 );
+  else if ( hq0 && hq1 && hq2 && hq3 && hq4 )
+         hh = _hexaDocument->addHexa5Quads( hq0, hq1, hq2, hq3, hq4 );
+  else if ( hq0 && hq1 && hq2 && hq3 )
+         hh = _hexaDocument->addHexa4Quads( hq0, hq1, hq2, hq3 );
+  else if ( hq0 && hq1 && hq2)
+         hh = _hexaDocument->addHexa3Quads( hq0, hq1, hq2 );
+  else if ( hq0 && hq1 )
+         hh = _hexaDocument->addHexa2Quads( hq0, hq1);
 
   if ( hh && hh->isValid() ){
-    HexaItem* h = new HexaItem(hh);
-    h->setData( _entry, HEXA_DOC_ENTRY_ROLE );
-    _hexaDirItem->appendRow(h);
-    hexaIndex = h->index();
-    emit patternDataChanged();
-    QString tmp = "/tmp/addHexaQuads.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
-  } else {
+       updateData();
+       unsigned int nbRows = _hexaDirItem->rowCount();
+       if (nbRows > 0)
+               hexaIndex = _hexaDirItem->child(nbRows-1)->index();
+  } else
     delete hh;
-  }
 
   return hexaIndex;
 }
@@ -1111,28 +911,17 @@ QModelIndex DocumentModel::addHexaQuads( const QModelIndexList &iquads)
 //         raises (SALOME::SALOME_Exception);
 QModelIndex DocumentModel::addVector( double dx, double dy, double dz )
 {
-  //std::cout << "DocumentModel::addVector" << std::endl;
   QModelIndex vectorIndex;
 
   HEXA_NS::Vector* hv = _hexaDocument->addVector(dx, dy, dz);
 
   if ( hv->isValid() ){
-    //std::cout << "hv->isValid()" << std::endl;
     VectorItem* v = new VectorItem(hv);
     _vectorDirItem->appendRow(v);
     vectorIndex = v->index();
-//     QStandardItem *toto = new QStandardItem("Toto");
-//     std::cout << "before" << std::endl;
-//     _vectorDirItem->appendRow(toto);
-//     std::cout << "after" << std::endl;
-//     vectorIndex = toto->index();
-    QString tmp = "/tmp/addVector.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
 
-  } else {
-    //std::cout << "delete hv" << std::endl;
+  } else
     delete hv;
-  }
 
   return vectorIndex;
 }
@@ -1141,8 +930,8 @@ QModelIndex DocumentModel::addVectorVertices( const QModelIndex &iv0, const QMod
 {
   QModelIndex iVec;
 
-  HEXA_NS::Vertex* hv0 = data(iv0, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hv1 = data(iv1, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Vertex* hv0 = getHexaPtr<HEXA_NS::Vertex*>(iv0);
+  HEXA_NS::Vertex* hv1 = getHexaPtr<HEXA_NS::Vertex*>(iv1);
 
   HEXA_NS::Vector* hvec = _hexaDocument->addVectorVertices( hv0, hv1 );
 
@@ -1150,8 +939,6 @@ QModelIndex DocumentModel::addVectorVertices( const QModelIndex &iv0, const QMod
     VectorItem* vec = new VectorItem(hvec);
     _vectorDirItem->appendRow(vec);
     iVec = vec->index();
-    QString tmp = "/tmp/addVectorVertices.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hvec;
   }
@@ -1163,8 +950,8 @@ QModelIndex DocumentModel::addCylinder( const QModelIndex &iv, const QModelIndex
 {
   QModelIndex iCyl;
 
-  HEXA_NS::Vertex* hv   = data(iv, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector* hvec = data(ivec, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Vertex* hv   = getHexaPtr<HEXA_NS::Vertex*>(iv);
+  HEXA_NS::Vector* hvec = getHexaPtr<HEXA_NS::Vector*>(ivec);
 
   HEXA_NS::Cylinder* hcyl = _hexaDocument->addCylinder( hv, hvec, r, h );
 
@@ -1172,8 +959,6 @@ QModelIndex DocumentModel::addCylinder( const QModelIndex &iv, const QModelIndex
     CylinderItem* cyl = new CylinderItem(hcyl);
     _cylinderDirItem->appendRow(cyl);
     iCyl = cyl->index();
-    QString tmp = "/tmp/addCylinder.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hcyl;
   }
@@ -1185,8 +970,8 @@ QModelIndex DocumentModel::addPipe( const QModelIndex &iv, const QModelIndex &iv
 {
   QModelIndex iPipe;
 
-  HEXA_NS::Vertex* hv   = data(iv, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector* hvec = data(ivec, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Vertex* hv   = getHexaPtr<HEXA_NS::Vertex*>(iv);
+  HEXA_NS::Vector* hvec = getHexaPtr<HEXA_NS::Vector*>(ivec);
 
   HEXA_NS::Pipe* hPipe = _hexaDocument->addPipe( hv, hvec, ri, re, h );
 
@@ -1194,8 +979,6 @@ QModelIndex DocumentModel::addPipe( const QModelIndex &iv, const QModelIndex &iv
     PipeItem* pipe = new PipeItem(hPipe);
     _pipeDirItem->appendRow(pipe);
     iPipe = pipe->index();
-    QString tmp = "/tmp/addPipe.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hPipe;
   }
@@ -1210,32 +993,22 @@ QModelIndex DocumentModel::makeCartesian( const QModelIndex& i_pt,
   QModelIndex eltsIndex;
   //std::cout<<"makeCartesian begin"<<std::endl; 
 
-  HEXA_NS::Vertex* hpt    = data(i_pt,    HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector* hvec_x = data(i_vec_x, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
-  HEXA_NS::Vector* hvec_y = data(i_vec_y, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
-  HEXA_NS::Vector* hvec_z = data(i_vec_z, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
-
-  //std::cout<<"hpt "<<hpt<<std::endl; 
-  //std::cout<<"hvec_x "<<hvec_x<<std::endl; 
-  //std::cout<<"hvec_y "<<hvec_y<<std::endl; 
-  //std::cout<<"hvec_z "<<hvec_z<<std::endl; 
+  HEXA_NS::Vertex* hpt    = getHexaPtr<HEXA_NS::Vertex*>(i_pt);
+  HEXA_NS::Vector* hvec_x = getHexaPtr<HEXA_NS::Vector*>(i_vec_x);
+  HEXA_NS::Vector* hvec_y = getHexaPtr<HEXA_NS::Vector*>(i_vec_y);
+  HEXA_NS::Vector* hvec_z = getHexaPtr<HEXA_NS::Vector*>(i_vec_z);
 
   HEXA_NS::Elements* new_helts = _hexaDocument->makeCartesian( hpt,
                                                                hvec_x, hvec_y, hvec_z,
                                                                nx, ny, nz );
 
   if ( new_helts->isValid() ){
-    //std::cout<<"makeCartesian OK!!!"<<std::endl; 
     updateData(); //CS_TODO more or less?
     ElementsItem* eltsItem = new ElementsItem(new_helts);
     _elementsDirItem->appendRow(eltsItem);
     eltsIndex = eltsItem->index();
-    QString tmp = "/tmp/makeCartesian1.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
-  } else {
-    //std::cout<<"makeCartesian KO!!!"<<std::endl; 
+  } else
     delete new_helts;
-  }
 
   return eltsIndex;
 }
@@ -1246,8 +1019,8 @@ QModelIndex DocumentModel::makeCartesian( const QModelIndex& ivex,
 {
   QModelIndex iElts;
 
-  HEXA_NS::Vertex* hVex = data(ivex, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector* hVec = data(ivec, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Vertex* hVex = getHexaPtr<HEXA_NS::Vertex*>(ivex);
+  HEXA_NS::Vector* hVec = getHexaPtr<HEXA_NS::Vector*>(ivec);
 
   HEXA_NS::Elements* hElts = _hexaDocument->makeCartesian( hVex,
                                                            hVec,
@@ -1257,8 +1030,6 @@ QModelIndex DocumentModel::makeCartesian( const QModelIndex& ivex,
     ElementsItem* elts = new ElementsItem(hElts);
     _elementsDirItem->appendRow(elts);
     iElts = elts->index();
-    QString tmp = "/tmp/makeCartesian2.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hElts;
   }
@@ -1281,9 +1052,9 @@ QModelIndex DocumentModel::makeCylindrical( const QModelIndex& i_pt,
 
   QModelIndex eltsIndex;
 
-  HEXA_NS::Vertex* hpt = data(i_pt, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector* hvec_x = data(i_vec_x, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
-  HEXA_NS::Vector* hvec_z = data(i_vec_z, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Vertex* hpt    = getHexaPtr<HEXA_NS::Vertex*>(i_pt);
+  HEXA_NS::Vector* hvec_x = getHexaPtr<HEXA_NS::Vector*>(i_vec_x);
+  HEXA_NS::Vector* hvec_z = getHexaPtr<HEXA_NS::Vector*>(i_vec_z);
 
   HEXA_NS::Elements* new_helts = _hexaDocument->makeCylindrical( hpt, hvec_x, hvec_z, dr, da, dl, nr, na, nl, fill );
 
@@ -1292,8 +1063,6 @@ QModelIndex DocumentModel::makeCylindrical( const QModelIndex& i_pt,
     ElementsItem* eltsItem = new ElementsItem(new_helts);
     _elementsDirItem->appendRow(eltsItem);
     eltsIndex = eltsItem->index();
-    QString tmp = "/tmp/makeCylindrical.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete new_helts;
   }
@@ -1308,25 +1077,20 @@ QModelIndex DocumentModel::makeCylindricals(
 {
   QModelIndex eltsIndex;
 
-  HEXA_NS::Vertex* hcenter = data( icenter, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector* hbase   = data( ibase,   HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
-  HEXA_NS::Vector* hheight = data( iheight, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Vertex* hcenter = getHexaPtr<HEXA_NS::Vertex*>(icenter);
+  HEXA_NS::Vector* hbase   =getHexaPtr<HEXA_NS::Vector*>(ibase);
+  HEXA_NS::Vector* hheight = getHexaPtr<HEXA_NS::Vector*>(iheight);
 
 //   HEXA_NS::Elements* helts;
   std::vector<double> r = radius.toVector().toStdVector();
   std::vector<double> a = angles.toVector().toStdVector();
   std::vector<double> h = heights.toVector().toStdVector();
 
-  HEXA_NS::Elements* helts = _hexaDocument->makeCylindricals( 
+  HEXA_NS::Elements* helts = _hexaDocument->makeCylindricals(
              hcenter, hbase, hheight,
              r, a, h,
              fill );
 
-//   HEXA_NS::Elements* helts = _hexaDocument->makeCylindricals( 
-//              hcenter, hbase, hheight,
-//              radius.toVector().toStdVector(), angles.toVector().toStdVector(), heights.toVector().toStdVector(),
-//              fill );
-
   if ( helts->isValid() ){
     updateData(); //CS_TODO  more or less?
     ElementsItem* eltsItem = new ElementsItem(helts);
@@ -1335,7 +1099,6 @@ QModelIndex DocumentModel::makeCylindricals(
   } else {
     delete helts;
   }
-
   return eltsIndex;
 }
 
@@ -1343,8 +1106,8 @@ QModelIndex DocumentModel::makeSpherical( const QModelIndex& iv, const QModelInd
 {
   QModelIndex iElts;
 
-  HEXA_NS::Vertex* hv   = data(iv, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector* hvec = data(ivec, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Vertex* hv   = getHexaPtr<HEXA_NS::Vertex*>(iv);
+  HEXA_NS::Vector* hvec = getHexaPtr<HEXA_NS::Vector*>(ivec);
 
   HEXA_NS::Elements* hElts = _hexaDocument->makeSpherical( hv, hvec, nb, k );
 
@@ -1353,8 +1116,6 @@ QModelIndex DocumentModel::makeSpherical( const QModelIndex& iv, const QModelInd
     ElementsItem* elts = new ElementsItem(hElts);
     _elementsDirItem->appendRow(elts);
     iElts = elts->index();
-    QString tmp = "/tmp/makeSpherical.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hElts;
   }
@@ -1366,7 +1127,7 @@ QModelIndex DocumentModel::makeSpherical( const QModelIndex& icenter, double rad
 {
   QModelIndex iElts;
 
-  HEXA_NS::Vertex* hcenter = data(icenter, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Vertex* hcenter = getHexaPtr<HEXA_NS::Vertex*>(icenter);
 
   HEXA_NS::Elements* helts = _hexaDocument->makeSpherical( hcenter, radius, nb, k );
 
@@ -1375,8 +1136,6 @@ QModelIndex DocumentModel::makeSpherical( const QModelIndex& icenter, double rad
     ElementsItem* eltsItem = new ElementsItem(helts);
     _elementsDirItem->appendRow(eltsItem);
     iElts = eltsItem->index();
-//     QString tmp = "/tmp/makeSpherical.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete helts;
   }
@@ -1389,8 +1148,8 @@ QModelIndex DocumentModel::makeCylinder( const QModelIndex& icyl, const QModelIn
 {
   QModelIndex iElts;
 
-  HEXA_NS::Cylinder* hcyl = data(icyl, HEXA_DATA_ROLE).value<HEXA_NS::Cylinder *>();
-  HEXA_NS::Vector* hvec   = data(ivec, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Cylinder* hcyl = getHexaPtr<HEXA_NS::Cylinder*>(icyl);
+  HEXA_NS::Vector* hvec   = getHexaPtr<HEXA_NS::Vector*>(ivec);
 
   HEXA_NS::Elements* hElts = _hexaDocument->makeCylinder( hcyl, hvec, nr, na, nl );
   if ( hElts->isValid() ){
@@ -1398,8 +1157,6 @@ QModelIndex DocumentModel::makeCylinder( const QModelIndex& icyl, const QModelIn
     ElementsItem* elts = new ElementsItem(hElts);
     _elementsDirItem->appendRow(elts);
     iElts = elts->index();
-    QString tmp = "/tmp/makeCylinder.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hElts;
   }
@@ -1412,8 +1169,8 @@ QModelIndex DocumentModel::makePipe( const QModelIndex& ipipe, const QModelIndex
 { 
   QModelIndex iElts;
 
-  HEXA_NS::Pipe*   hPipe  = data(ipipe, HEXA_DATA_ROLE).value<HEXA_NS::Pipe *>();
-  HEXA_NS::Vector* hVecx  = data(ivecx, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Pipe*   hPipe  = getHexaPtr<HEXA_NS::Pipe*>(ipipe);
+  HEXA_NS::Vector* hVecx  = getHexaPtr<HEXA_NS::Vector*>(ivecx);
 
   HEXA_NS::Elements* hElts = _hexaDocument->makePipe( hPipe, hVecx, nr, na, nl );
 
@@ -1422,8 +1179,6 @@ QModelIndex DocumentModel::makePipe( const QModelIndex& ipipe, const QModelIndex
     ElementsItem* elts = new ElementsItem(hElts);
     _elementsDirItem->appendRow(elts);
     iElts = elts->index();
-    QString tmp = "/tmp/makePipe.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hElts;
   }
@@ -1435,8 +1190,8 @@ QModelIndex DocumentModel::makeCylinders(const QModelIndex& icyl1, const QModelI
 { //CS_TODO
   QModelIndex iCrossElts;
   
-  HEXA_NS::Cylinder* hCyl1  = data(icyl1, HEXA_DATA_ROLE).value<HEXA_NS::Cylinder *>();
-  HEXA_NS::Cylinder* hCyl2  = data(icyl2, HEXA_DATA_ROLE).value<HEXA_NS::Cylinder *>();
+  HEXA_NS::Cylinder* hCyl1  = getHexaPtr<HEXA_NS::Cylinder*>(icyl1);
+  HEXA_NS::Cylinder* hCyl2  = getHexaPtr<HEXA_NS::Cylinder*>(icyl2);
 
   HEXA_NS::CrossElements* hCrossElts = _hexaDocument->makeCylinders( hCyl1, hCyl2 );
   
@@ -1445,8 +1200,6 @@ QModelIndex DocumentModel::makeCylinders(const QModelIndex& icyl1, const QModelI
     ElementsItem* crossElts = new ElementsItem(hCrossElts);
     _crossElementsDirItem->appendRow(crossElts);
     iCrossElts = crossElts->index();    
-    QString tmp = "/tmp/makeCylinders.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hCrossElts;
   }
@@ -1459,48 +1212,8 @@ QModelIndex DocumentModel::makePipes( const QModelIndex& ipipe1, const QModelInd
 { 
   QModelIndex iCrossElts;
   
-  HEXA_NS::Pipe* hPipe1  = data(ipipe1, HEXA_DATA_ROLE).value<HEXA_NS::Pipe *>();
-  HEXA_NS::Pipe* hPipe2  = data(ipipe2, HEXA_DATA_ROLE).value<HEXA_NS::Pipe *>();
-
-
-//   MESSAGE("DocumentModel::makePipes( "<< ipipe1.data().toString().toStdString() << ","<< ipipe2.data().toString().toStdString() );
-// 
-//   HEXA_NS::Vertex* b1 = hPipe1->getBase();
-//   HEXA_NS::Vector* d1 = hPipe1->getDirection();
-//   MESSAGE("pipe1 vertex is  " << b1->getName()
-//                               <<"("<< b1->getX()
-//                               <<","<< b1->getY()
-//                               <<","<< b1->getZ()<<")"
-//           );
-//   MESSAGE("pipe1 vector is  " << d1->getName()
-//                               <<"("<< d1->getDx()
-//                               <<","<< d1->getDy()
-//                               <<","<< d1->getDz()<<")"
-//           );
-//   MESSAGE("pipe1 ir is  " << hPipe1->getInternalRadius());
-//   MESSAGE("pipe1 er is  " << hPipe1->getRadius());
-//   MESSAGE("pipe1 h  is  " << hPipe1->getHeight());
-// 
-// 
-//   HEXA_NS::Vertex* b2 = hPipe2->getBase();
-//   HEXA_NS::Vector* d2 = hPipe2->getDirection();
-//   MESSAGE("pipe2 vertex is  " << b2->getName()
-//                               <<"("<< b2->getX()
-//                               <<","<< b2->getY()
-//                               <<","<< b2->getZ()<<")"
-//           );
-//   MESSAGE("pipe2 vector is  " << d2->getName()
-//                               <<"("<< d2->getDx()
-//                               <<","<< d2->getDy()
-//                               <<","<< d2->getDz()<<")"
-//           );
-//   MESSAGE("pipe2 vertex is  " << hPipe2->getBase()->getName() );
-//   MESSAGE("pipe2 vector is  " << hPipe2->getDirection()->getName());
-//   MESSAGE("pipe2 ir is  " << hPipe2->getInternalRadius());
-//   MESSAGE("pipe2 er is  " << hPipe2->getRadius());
-//   MESSAGE("pipe2 h  is  " << hPipe2->getHeight());
-
-
+  HEXA_NS::Pipe* hPipe1  = getHexaPtr<HEXA_NS::Pipe*>(ipipe1);
+  HEXA_NS::Pipe* hPipe2  = getHexaPtr<HEXA_NS::Pipe*>(ipipe2);
 
   HEXA_NS::CrossElements* hCrossElts = _hexaDocument->makePipes( hPipe1, hPipe2 );
   
@@ -1526,12 +1239,12 @@ QModelIndex DocumentModel::makeRind( const QModelIndex& icenter,
 {
   QModelIndex iElts;
 
-  HEXA_NS::Vertex* hcenter = data(icenter, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector* hvecx   = data(ivecx, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
-  HEXA_NS::Vector* hvecz   = data(ivecz, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
-  HEXA_NS::Vertex* hplorig = data(iplorig, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Vertex* hcenter = getHexaPtr<HEXA_NS::Vertex*>(icenter);
+  HEXA_NS::Vector* hvecx   = getHexaPtr<HEXA_NS::Vector*>(ivecx);
+  HEXA_NS::Vector* hvecz   = getHexaPtr<HEXA_NS::Vector*>(ivecz);
+  HEXA_NS::Vertex* hplorig = getHexaPtr<HEXA_NS::Vertex*>(iplorig);
 
-  HEXA_NS::Elements* hElts = _hexaDocument->makeRind( hcenter, 
+  HEXA_NS::Elements* hElts = _hexaDocument->makeRind( hcenter,
                             hvecx, hvecz,
                             radext, radint, radhole,
                             hplorig,
@@ -1557,12 +1270,12 @@ QModelIndex DocumentModel::makePartRind( const QModelIndex& icenter,
 {
   QModelIndex iElts;
 
-  HEXA_NS::Vertex* hcenter = data(icenter, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector* hvecx   = data(ivecx, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
-  HEXA_NS::Vector* hvecz   = data(ivecz, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
-  HEXA_NS::Vertex* hplorig = data(iplorig, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Vertex* hcenter = getHexaPtr<HEXA_NS::Vertex*>(icenter);
+  HEXA_NS::Vector* hvecx   = getHexaPtr<HEXA_NS::Vector*>(ivecx);
+  HEXA_NS::Vector* hvecz   = getHexaPtr<HEXA_NS::Vector*>(ivecz);
+  HEXA_NS::Vertex* hplorig = getHexaPtr<HEXA_NS::Vertex*>(iplorig);
 
-  HEXA_NS::Elements* hElts = _hexaDocument->makePartRind( hcenter, 
+  HEXA_NS::Elements* hElts = _hexaDocument->makePartRind( hcenter,
                             hvecx, hvecz,
                             radext, radint, radhole,
                             hplorig, angle,
@@ -1588,12 +1301,12 @@ QModelIndex DocumentModel::makeSphere( const QModelIndex& icenter,
 {
   QModelIndex iElts;
 
-  HEXA_NS::Vertex* hcenter = data(icenter, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector* hvecx   = data(ivecx, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
-  HEXA_NS::Vector* hvecz   = data(ivecz, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
-  HEXA_NS::Vertex* hplorig = data(iplorig, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Vertex* hcenter = getHexaPtr<HEXA_NS::Vertex*>(icenter);
+  HEXA_NS::Vector* hvecx   = getHexaPtr<HEXA_NS::Vector*>(ivecx);
+  HEXA_NS::Vector* hvecz   = getHexaPtr<HEXA_NS::Vector*>(ivecz);
+  HEXA_NS::Vertex* hplorig = getHexaPtr<HEXA_NS::Vertex*>(iplorig);
 
-  HEXA_NS::Elements* hElts = _hexaDocument->makeSphere( hcenter, 
+  HEXA_NS::Elements* hElts = _hexaDocument->makeSphere( hcenter,
                                                 hvecx, hvecz, 
                                                 radius, radhole,
                                                 hplorig, 
@@ -1619,10 +1332,10 @@ QModelIndex DocumentModel::makePartSphere( const QModelIndex& icenter,
 {
   QModelIndex iElts;
 
-  HEXA_NS::Vertex* hcenter = data(icenter, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector* hvecx   = data(ivecx, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
-  HEXA_NS::Vector* hvecz   = data(ivecz, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
-  HEXA_NS::Vertex* hplorig = data(iplorig, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Vertex* hcenter = getHexaPtr<HEXA_NS::Vertex*>(icenter);
+  HEXA_NS::Vector* hvecx   = getHexaPtr<HEXA_NS::Vector*>(ivecx);
+  HEXA_NS::Vector* hvecz   = getHexaPtr<HEXA_NS::Vector*>(ivecz);
+  HEXA_NS::Vertex* hplorig = getHexaPtr<HEXA_NS::Vertex*>(iplorig);
 
   HEXA_NS::Elements* hElts = _hexaDocument->makePartSphere( hcenter,
                                                 hvecx, hvecz,
@@ -1648,15 +1361,9 @@ bool DocumentModel::updateVertex( const QModelIndex& ivertex, double x, double y
 {
   bool ret = false;
 
-//   cout << "DocumentModel::updateVertex" << ivertex.data().toString().toStdString() << endl;
-//   cout << "DocumentModel::updateVertex" << ivertex.data(HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>() << endl;
-//   cout << "DocumentModel::updateVertex" << ivertex.data(HEXA_TREE_ROLE).toString().toStdString() << endl;
-//   cout << "DocumentModel::updateVertex" << ivertex.data(HEXA_DOC_ENTRY_ROLE).toString().toStdString() << endl;
+  //HEXA_NS::Vertex* hVertex = ivertex.data(HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>(); //CS_TODO?  pareil pour toutes les autres méthodes du modèle?
+  HEXA_NS::Vertex* hVertex = getHexaPtr<HEXA_NS::Vertex*>(ivertex);
 
-//   HEXA_NS::Vertex* hVertex = data(ivertex, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hVertex = ivertex.data(HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>(); //CS_TODO?  pareil pour toutes les autres méthodes du modèle?
-
-  cout << "DocumentModel::updateVertex hVertex = " << hVertex << endl;
   if ( hVertex ){
 //     hVertex->setName( name.toStdString() );
     hVertex->setX ( x );
@@ -1672,13 +1379,12 @@ bool DocumentModel::updateVertex( const QModelIndex& ivertex, double x, double y
 bool DocumentModel::removeHexa( const QModelIndex& ihexa )
 {
   bool ret = false;
-  HEXA_NS::Hexa* hHexa = data(ihexa, HEXA_DATA_ROLE).value<HEXA_NS::Hexa *>();
+  HEXA_NS::Hexa* hHexa = getHexaPtr<HEXA_NS::Hexa*>(ihexa);
+
 
   int r = _hexaDocument->removeHexa( hHexa );
   if ( r == HOK ){
     updateData();
-    QString tmp = "/tmp/removeHexa.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
     ret = true;
   } else if ( r == HERR ){    
     ret = false;
@@ -1690,14 +1396,12 @@ bool DocumentModel::removeHexa( const QModelIndex& ihexa )
 bool DocumentModel::removeConnectedHexa( const QModelIndex& ihexa )
 {
   bool ret = false;
-  HEXA_NS::Hexa* hHexa = data(ihexa, HEXA_DATA_ROLE).value<HEXA_NS::Hexa *>();
+  HEXA_NS::Hexa* hHexa = getHexaPtr<HEXA_NS::Hexa*>(ihexa);
   
   int r = _hexaDocument->removeConnectedHexa( hHexa );
   
   if ( r == HOK ){    
     updateData();
-    QString tmp = "/tmp/removeConnectedHexa.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
     ret = true;
   } else if ( r == HERR ){    
     ret = false;
@@ -1710,8 +1414,8 @@ QModelIndex DocumentModel::prismQuad( const QModelIndex& iquad, const QModelInde
 { 
   QModelIndex iElts;
 
-  HEXA_NS::Quad*   hQuad = data(iquad, HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
-  HEXA_NS::Vector* hVect = data(ivec, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Quad*   hQuad = getHexaPtr<HEXA_NS::Quad*>(iquad);
+  HEXA_NS::Vector* hVect = getHexaPtr<HEXA_NS::Vector*>(ivec);
 
   HEXA_NS::Elements* hElts = _hexaDocument->prismQuad( hQuad, hVect, nb );
 
@@ -1720,8 +1424,6 @@ QModelIndex DocumentModel::prismQuad( const QModelIndex& iquad, const QModelInde
     ElementsItem* elts = new ElementsItem(hElts);
     _elementsDirItem->appendRow(elts);
     iElts = elts->index();
-    QString tmp = "/tmp/prismQuad.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hElts;
   }
@@ -1736,10 +1438,10 @@ QModelIndex DocumentModel::prismQuads( const QModelIndexList& iquads, const QMod
   HEXA_NS::Quads   hQuads;
   HEXA_NS::Quad*   hQuad = NULL;
   foreach( const QModelIndex& iquad, iquads ){
-    hQuad = data( iquad, HEXA_DATA_ROLE ).value<HEXA_NS::Quad *>();
+    hQuad = getHexaPtr<HEXA_NS::Quad*>(iquad);
     hQuads.push_back( hQuad );
   }
-  HEXA_NS::Vector* hVect = data(ivec, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Vector* hVect = getHexaPtr<HEXA_NS::Vector*>(ivec);
 
   HEXA_NS::Elements* hElts = _hexaDocument->prismQuads( hQuads, hVect, nb );
   if ( hElts->isValid() ){
@@ -1747,14 +1449,36 @@ QModelIndex DocumentModel::prismQuads( const QModelIndexList& iquads, const QMod
     ElementsItem* elts = new ElementsItem(hElts);
     _elementsDirItem->appendRow(elts);
     iElts = elts->index();
-    QString tmp = "/tmp/prismQuads.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hElts;
   }
   return iElts;
 }
 
+QModelIndex DocumentModel::prismQuads( const QModelIndexList& iquads, const QModelIndex& ivec, std::vector<double> layersSize, int nb)
+{
+       QModelIndex iElts;
+
+        HEXA_NS::Quads   hQuads;
+         HEXA_NS::Quad*   hQuad = NULL;
+         foreach( const QModelIndex& iquad, iquads ){
+           hQuad = getHexaPtr<HEXA_NS::Quad*>(iquad);
+           hQuads.push_back( hQuad );
+         }
+         HEXA_NS::Vector* hVect = getHexaPtr<HEXA_NS::Vector*>(ivec);
+
+       HEXA_NS::Elements* hElts = _hexaDocument->prismQuadsVec( hQuads, hVect, layersSize, nb );
+       if ( hElts->isValid() ){
+               updateData(); //CS_TODO more or less?
+               ElementsItem* elts = new ElementsItem(hElts);
+               _elementsDirItem->appendRow(elts);
+               iElts = elts->index();
+       } else {
+               delete hElts;
+       }
+       return iElts;
+}
+
 //
 QModelIndex DocumentModel::joinQuad(
       const QModelIndex& iquadstart, const QModelIndex& iquaddest,
@@ -1764,13 +1488,13 @@ QModelIndex DocumentModel::joinQuad(
 {
   QModelIndex iElts;
 
-  HEXA_NS::Quad*   hQuadStart  = data(iquadstart, HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
-  HEXA_NS::Quad*   hQuadDest   = data(iquaddest, HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
+  HEXA_NS::Quad*   hQuadStart  = getHexaPtr<HEXA_NS::Quad*>(iquadstart);
+  HEXA_NS::Quad*   hQuadDest   = getHexaPtr<HEXA_NS::Quad*>(iquaddest);
 
-  HEXA_NS::Vertex* hVertex0 = data(iv0, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hVertex1 = data(iv1, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hVertex2 = data(iv2, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hVertex3 = data(iv3, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Vertex* hVertex0 = getHexaPtr<HEXA_NS::Vertex*>(iv0);
+  HEXA_NS::Vertex* hVertex1 = getHexaPtr<HEXA_NS::Vertex*>(iv1);
+  HEXA_NS::Vertex* hVertex2 = getHexaPtr<HEXA_NS::Vertex*>(iv2);
+  HEXA_NS::Vertex* hVertex3 = getHexaPtr<HEXA_NS::Vertex*>(iv3);
 
   HEXA_NS::Elements* hElts = _hexaDocument->joinQuad( hQuadStart, hQuadDest,
                         hVertex0,  hVertex1,  hVertex2,  hVertex3, nb );
@@ -1780,8 +1504,6 @@ QModelIndex DocumentModel::joinQuad(
     ElementsItem* elts = new ElementsItem(hElts);
     _elementsDirItem->appendRow(elts);
     iElts = elts->index();
-    QString tmp = "/tmp/joinQuad.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hElts;
   }
@@ -1806,10 +1528,10 @@ QModelIndex DocumentModel::joinQuads(
   }
   HEXA_NS::Quad*   hQuadDest = data( iquaddest, HEXA_DATA_ROLE ).value<HEXA_NS::Quad *>();
 
-  HEXA_NS::Vertex* hVertex0 = data(iv0, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hVertex1 = data(iv1, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hVertex2 = data(iv2, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hVertex3 = data(iv3, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Vertex* hVertex0 = getHexaPtr<HEXA_NS::Vertex*>(iv0);
+  HEXA_NS::Vertex* hVertex1 = getHexaPtr<HEXA_NS::Vertex*>(iv1);
+  HEXA_NS::Vertex* hVertex2 = getHexaPtr<HEXA_NS::Vertex*>(iv2);
+  HEXA_NS::Vertex* hVertex3 = getHexaPtr<HEXA_NS::Vertex*>(iv3);
 
   HEXA_NS::Elements* hElts = _hexaDocument->joinQuads(
                         hQuadsStart, hQuadDest,
@@ -1821,8 +1543,6 @@ QModelIndex DocumentModel::joinQuads(
     ElementsItem* elts = new ElementsItem(hElts);
     _elementsDirItem->appendRow(elts);
     iElts = elts->index();
-    QString tmp = "/tmp/joinQuads.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hElts;
   }
@@ -1834,18 +1554,14 @@ bool DocumentModel::mergeVertices( const QModelIndex &iv0, const QModelIndex &iv
 {
   bool ret = false;
 
-  HEXA_NS::Vertex* hv0 = data(iv0, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hv1 = data(iv1, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Vertex* hv0 = getHexaPtr<HEXA_NS::Vertex*>(iv0);
+  HEXA_NS::Vertex* hv1 = getHexaPtr<HEXA_NS::Vertex*>(iv1);
 
   int r = _hexaDocument->mergeVertices( hv0, hv1 );
   if ( r == HOK ){
     updateData(); //CS_TODO more or less?
-    //std::cout << "DocumentModel:: mergeVertices => OK " << std::endl;
-    QString tmp = "/tmp/mergeVertices.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
     ret = true;
   } else if ( r == HERR ){
-    //std::cout << "DocumentModel:: mergeVertices => KO " << std::endl;
     ret = false;
   }
 
@@ -1858,18 +1574,16 @@ bool DocumentModel::mergeEdges( const QModelIndex &ie0, const QModelIndex &ie1,
 {
   bool ret = false;
 
-  HEXA_NS::Edge* he0 = data(ie0, HEXA_DATA_ROLE).value<HEXA_NS::Edge *>();
-  HEXA_NS::Edge* he1 = data(ie1, HEXA_DATA_ROLE).value<HEXA_NS::Edge *>();
+  HEXA_NS::Edge* he0 = getHexaPtr<HEXA_NS::Edge*>(ie0);
+  HEXA_NS::Edge* he1 = getHexaPtr<HEXA_NS::Edge*>(ie1);
 
-  HEXA_NS::Vertex* hv0 = data(iv0, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hv1 = data(iv1, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Vertex* hv0 = getHexaPtr<HEXA_NS::Vertex*>(iv0);
+  HEXA_NS::Vertex* hv1 = getHexaPtr<HEXA_NS::Vertex*>(iv1);
 
   int r = _hexaDocument->mergeEdges( he0, he1, hv0, hv1 ); 
   if ( r == HOK ){
     updateData();
     ret = true;
-    QString tmp = "/tmp/mergeEdges.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else if ( r == HERR ){
     ret = false;
   }
@@ -1886,17 +1600,15 @@ bool DocumentModel::mergeQuads( const QModelIndex& iquad0, const QModelIndex& iq
   HEXA_NS::Quad* hquad0 = data(iquad0, HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
   HEXA_NS::Quad* hquad1 = data(iquad1, HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
 
-  HEXA_NS::Vertex* hv0 = data(iv0, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hv1 = data(iv1, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hv2 = data(iv2, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hv3 = data(iv3, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Vertex* hv0 = getHexaPtr<HEXA_NS::Vertex*>(iv0);
+  HEXA_NS::Vertex* hv1 = getHexaPtr<HEXA_NS::Vertex*>(iv1);
+  HEXA_NS::Vertex* hv2 = getHexaPtr<HEXA_NS::Vertex*>(iv2);
+  HEXA_NS::Vertex* hv3 = getHexaPtr<HEXA_NS::Vertex*>(iv3);
 
   int r = _hexaDocument->mergeQuads( hquad0, hquad1, hv0, hv1, hv2, hv3 );
   if ( r == HOK ){
     updateData();
     ret = true;
-    QString tmp = "/tmp/mergeQuads.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else if ( r == HERR ){
     ret = false;
   }
@@ -1909,8 +1621,8 @@ QModelIndex DocumentModel::disconnectVertex( const QModelIndex& ihexa, const QMo
 {
   QModelIndex iElts;
 
-  HEXA_NS::Hexa*   hHexa   = data( ihexa, HEXA_DATA_ROLE ).value<HEXA_NS::Hexa *>();
-  HEXA_NS::Vertex* hVertex = data( ivertex, HEXA_DATA_ROLE ).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Hexa*   hHexa   = getHexaPtr<HEXA_NS::Hexa*>(ihexa);
+  HEXA_NS::Vertex* hVertex = getHexaPtr<HEXA_NS::Vertex*>(ivertex);
 
   HEXA_NS::Elements* hElts = _hexaDocument->disconnectVertex( hHexa, hVertex );
 
@@ -1919,8 +1631,6 @@ QModelIndex DocumentModel::disconnectVertex( const QModelIndex& ihexa, const QMo
     ElementsItem* elts = new ElementsItem(hElts);
     _elementsDirItem->appendRow(elts);
     iElts = elts->index();
-    QString tmp = "/tmp/disconnectVertex.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hElts;
   }
@@ -1932,8 +1642,8 @@ QModelIndex DocumentModel::disconnectEdge( const QModelIndex& ihexa, const QMode
 {
   QModelIndex iElts;
 
-  HEXA_NS::Hexa* hHexa = data( ihexa, HEXA_DATA_ROLE ).value<HEXA_NS::Hexa *>();
-  HEXA_NS::Edge* hEdge = data( iedge, HEXA_DATA_ROLE ).value<HEXA_NS::Edge *>();
+  HEXA_NS::Hexa* hHexa = getHexaPtr<HEXA_NS::Hexa*>(ihexa);
+  HEXA_NS::Edge* hEdge = getHexaPtr<HEXA_NS::Edge*>(iedge);
 
   HEXA_NS::Elements* hElts = _hexaDocument->disconnectEdge( hHexa, hEdge );
 
@@ -1942,8 +1652,6 @@ QModelIndex DocumentModel::disconnectEdge( const QModelIndex& ihexa, const QMode
     ElementsItem* elts = new ElementsItem(hElts);
     _elementsDirItem->appendRow(elts);
     iElts = elts->index();
-    QString tmp = "/tmp/disconnectEdge.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hElts;
   }
@@ -1962,14 +1670,14 @@ QModelIndex DocumentModel::disconnectEdges( const QModelIndexList& ihexas, const
   //Construction de la liste des edges
   HEXA_NS::Edge* hedge = NULL;
   foreach( const QModelIndex& iedge, iedges ){
-    hedge = data( iedge, HEXA_DATA_ROLE ).value<HEXA_NS::Edge *>();
+    hedge = getHexaPtr<HEXA_NS::Edge*>(iedge);
     hEdges.push_back( hedge );
   }
 
   //Construction de la liste des hexas
   HEXA_NS::Hexa* hhexa = NULL;
   foreach( const QModelIndex& ihexa, ihexas ){
-    hhexa = data( ihexa, HEXA_DATA_ROLE ).value<HEXA_NS::Hexa *>();
+    hhexa = getHexaPtr<HEXA_NS::Hexa*>(ihexa);
     hHexas.push_back( hhexa );
   }
 
@@ -1981,8 +1689,6 @@ QModelIndex DocumentModel::disconnectEdges( const QModelIndexList& ihexas, const
     ElementsItem* elts = new ElementsItem(hElts);
     _elementsDirItem->appendRow(elts);
     iElts = elts->index();
-    QString tmp = "/tmp/disconnectEdges.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hElts;
   }
@@ -1995,8 +1701,8 @@ QModelIndex DocumentModel::disconnectQuad( const QModelIndex& ihexa, const QMode
 {
   QModelIndex iElts;
 
-  HEXA_NS::Hexa* hHexa = data( ihexa, HEXA_DATA_ROLE ).value<HEXA_NS::Hexa *>();
-  HEXA_NS::Quad* hQuad = data( iquad, HEXA_DATA_ROLE ).value<HEXA_NS::Quad *>();
+  HEXA_NS::Hexa* hHexa = getHexaPtr<HEXA_NS::Hexa*>(ihexa);
+  HEXA_NS::Quad* hQuad = getHexaPtr<HEXA_NS::Quad*>(iquad);
 
   HEXA_NS::Elements* hElts = _hexaDocument->disconnectQuad( hHexa, hQuad );
 
@@ -2005,8 +1711,6 @@ QModelIndex DocumentModel::disconnectQuad( const QModelIndex& ihexa, const QMode
     ElementsItem* elts = new ElementsItem(hElts);
     _elementsDirItem->appendRow(elts);
     iElts = elts->index();
-    QString tmp = "/tmp/disconnectQuad.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hElts;
   }
@@ -2020,7 +1724,7 @@ QModelIndex DocumentModel::cutEdge( const QModelIndex &i_e0, int nbcuts )
 {
   QModelIndex iElts;
 
-  HEXA_NS::Edge* he0 = data(i_e0, HEXA_DATA_ROLE).value<HEXA_NS::Edge *>();
+  HEXA_NS::Edge* he0 = getHexaPtr<HEXA_NS::Edge*>(i_e0);
   HEXA_NS::Elements* helts = _hexaDocument->cut( he0, nbcuts );
 
   if ( helts->isValid() ){
@@ -2028,8 +1732,6 @@ QModelIndex DocumentModel::cutEdge( const QModelIndex &i_e0, int nbcuts )
     ElementsItem* elts = new ElementsItem(helts);
     _elementsDirItem->appendRow(elts);
     iElts = elts->index();
-    QString tmp = "/tmp/cutEdge.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete helts;
   }
@@ -2046,8 +1748,8 @@ QModelIndex DocumentModel::makeTranslation( const QModelIndex& ielts, const QMod
 {
   QModelIndex iElts;
 
-  HEXA_NS::Elements* hElts = data(ielts, HEXA_DATA_ROLE).value<HEXA_NS::Elements *>();
-  HEXA_NS::Vector*   hVec  = data(ivec, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Elements* hElts = getHexaPtr<HEXA_NS::Elements*>(ielts);
+  HEXA_NS::Vector*   hVec  = getHexaPtr<HEXA_NS::Vector*>(ivec);
 
   HEXA_NS::Elements* hNewElts = _hexaDocument->makeTranslation( hElts, hVec );
 
@@ -2056,8 +1758,6 @@ QModelIndex DocumentModel::makeTranslation( const QModelIndex& ielts, const QMod
     ElementsItem* eltsItem = new ElementsItem(hNewElts);
     _elementsDirItem->appendRow(eltsItem);
     iElts = eltsItem->index();
-    QString tmp = "/tmp/makeTranslation.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hNewElts;
   }
@@ -2071,8 +1771,8 @@ QModelIndex DocumentModel::makeScale( const QModelIndex& ielts, const QModelInde
 {
   QModelIndex iElts;
 
-  HEXA_NS::Elements* hElts = data(ielts, HEXA_DATA_ROLE).value<HEXA_NS::Elements *>();
-  HEXA_NS::Vertex*   hVex  = data(ivex, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Elements* hElts = getHexaPtr<HEXA_NS::Elements*>(ielts);
+  HEXA_NS::Vertex*   hVex  = getHexaPtr<HEXA_NS::Vertex*>(ivex);
 
   HEXA_NS::Elements* hNewElts = _hexaDocument->makeScale( hElts, hVex, k );
 
@@ -2081,8 +1781,6 @@ QModelIndex DocumentModel::makeScale( const QModelIndex& ielts, const QModelInde
     ElementsItem* eltsItem = new ElementsItem(hNewElts);
     _elementsDirItem->appendRow(eltsItem);
     iElts = eltsItem->index();
-    QString tmp = "/tmp/makeScale.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hNewElts;
   }
@@ -2098,9 +1796,9 @@ QModelIndex DocumentModel::makeRotation( const QModelIndex& ielts,
 {
   QModelIndex iElts;
 
-  HEXA_NS::Elements* hElts = data(ielts, HEXA_DATA_ROLE).value<HEXA_NS::Elements *>();
-  HEXA_NS::Vertex*   hVex  = data(iv, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector*   hVec  = data(ivec, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Elements* hElts = getHexaPtr<HEXA_NS::Elements*>(ielts);
+  HEXA_NS::Vertex*   hVex  = getHexaPtr<HEXA_NS::Vertex*>(iv);
+  HEXA_NS::Vector*   hVec  = getHexaPtr<HEXA_NS::Vector*>(ivec);
 
   HEXA_NS::Elements* hNewElts = _hexaDocument->makeRotation( hElts, hVex, hVec, angle );
 
@@ -2109,8 +1807,6 @@ QModelIndex DocumentModel::makeRotation( const QModelIndex& ielts,
     ElementsItem* eltsItem = new ElementsItem(hNewElts);
     _elementsDirItem->appendRow(eltsItem);
     iElts = eltsItem->index();
-    QString tmp = "/tmp/makeRotation.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hNewElts;
   }
@@ -2123,8 +1819,8 @@ QModelIndex DocumentModel::makeSymmetryPoint( const QModelIndex& ielts, const QM
 {
   QModelIndex iElts;
 
-  HEXA_NS::Elements* hElts = data(ielts, HEXA_DATA_ROLE).value<HEXA_NS::Elements *>();
-  HEXA_NS::Vertex*   hVex  = data(iv, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>(); 
+  HEXA_NS::Elements* hElts = getHexaPtr<HEXA_NS::Elements*>(ielts);
+  HEXA_NS::Vertex*   hVex  = getHexaPtr<HEXA_NS::Vertex*>(iv);
 
   HEXA_NS::Elements* hNewElts = _hexaDocument->makeSymmetryPoint (hElts, hVex);
 
@@ -2133,8 +1829,6 @@ QModelIndex DocumentModel::makeSymmetryPoint( const QModelIndex& ielts, const QM
     ElementsItem* eltsItem = new ElementsItem(hNewElts);
     _elementsDirItem->appendRow(eltsItem);
     iElts = eltsItem->index();
-    QString tmp = "/tmp/makeSymmetryPoint.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hNewElts;
   }
@@ -2149,9 +1843,10 @@ QModelIndex DocumentModel::makeSymmetryLine( const QModelIndex& ielts,
 {
   QModelIndex iElts;
 
-  HEXA_NS::Elements* hElts = data(ielts, HEXA_DATA_ROLE).value<HEXA_NS::Elements *>();
-  HEXA_NS::Vertex*   hVex  = data(iv, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector*   hVec  = data(ivec, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Elements* hElts = getHexaPtr<HEXA_NS::Elements*>(ielts);
+  HEXA_NS::Vertex*   hVex  = getHexaPtr<HEXA_NS::Vertex*>(iv);
+  HEXA_NS::Vector*   hVec  = getHexaPtr<HEXA_NS::Vector*>(ivec);
+
 
   HEXA_NS::Elements* hNewElts = _hexaDocument->makeSymmetryLine( hElts, hVex, hVec );
 
@@ -2160,8 +1855,6 @@ QModelIndex DocumentModel::makeSymmetryLine( const QModelIndex& ielts,
     ElementsItem* eltsItem = new ElementsItem(hNewElts);
     _elementsDirItem->appendRow(eltsItem);
     iElts = eltsItem->index();
-    QString tmp = "/tmp/makeSymmetryLine.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hNewElts;
   }
@@ -2174,9 +1867,9 @@ QModelIndex DocumentModel::makeSymmetryPlane( const QModelIndex& ielts, const QM
 {
   QModelIndex iElts;
 
-  HEXA_NS::Elements* hElts = data(ielts, HEXA_DATA_ROLE).value<HEXA_NS::Elements *>();
-  HEXA_NS::Vertex*   hVex  = data(iv, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector*   hVec  = data(ivec, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Elements* hElts = getHexaPtr<HEXA_NS::Elements*>(ielts);
+  HEXA_NS::Vertex*   hVex  = getHexaPtr<HEXA_NS::Vertex*>(iv);
+  HEXA_NS::Vector*   hVec  = getHexaPtr<HEXA_NS::Vector*>(ivec);
 
   HEXA_NS::Elements* hNewElts = _hexaDocument->makeSymmetryPlane( hElts, hVex, hVec );
 
@@ -2185,8 +1878,6 @@ QModelIndex DocumentModel::makeSymmetryPlane( const QModelIndex& ielts, const QM
     ElementsItem* eltsItem = new ElementsItem(hNewElts);
     _elementsDirItem->appendRow(eltsItem);
     iElts = eltsItem->index();
-    QString tmp = "/tmp/makeSymmetryPlane.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else {
     delete hNewElts;
   }
@@ -2199,15 +1890,13 @@ bool DocumentModel::performTranslation( const QModelIndex& ielts, const QModelIn
 {
   bool ret = false;
 
-  HEXA_NS::Elements* hElts = data(ielts, HEXA_DATA_ROLE).value<HEXA_NS::Elements *>();
-  HEXA_NS::Vector*   hVec  = data(ivec, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Elements* hElts = getHexaPtr<HEXA_NS::Elements*>(ielts);
+  HEXA_NS::Vector*   hVec  = getHexaPtr<HEXA_NS::Vector*>(ivec);
 
   int r = _hexaDocument->performTranslation (hElts, hVec);
   if ( r == HOK ){
     updateData();
     ret = true;
-    QString tmp = "/tmp/performTranslation.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else if ( r == HERR ){
     ret = false;
   }
@@ -2221,15 +1910,13 @@ bool DocumentModel::performScale( const QModelIndex& ielts, const QModelIndex& i
 {
   bool ret = false;
 
-  HEXA_NS::Elements* hElts = data(ielts, HEXA_DATA_ROLE).value<HEXA_NS::Elements *>();
-  HEXA_NS::Vertex*   hVex  = data(ivex, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Elements* hElts = getHexaPtr<HEXA_NS::Elements*>(ielts);
+  HEXA_NS::Vertex*   hVex  = getHexaPtr<HEXA_NS::Vertex*>(ivex);
 
   int r = _hexaDocument->performScale (hElts, hVex, k);
   if ( r == HOK ){
     updateData();
     ret = true;
-    QString tmp = "/tmp/performScale.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else if ( r == HERR ){
     ret = false;
   }
@@ -2242,16 +1929,14 @@ bool DocumentModel::performRotation( const QModelIndex& ielts, const QModelIndex
 {
   bool ret = false;
 
-  HEXA_NS::Elements* hElts = data(ielts, HEXA_DATA_ROLE).value<HEXA_NS::Elements *>();
-  HEXA_NS::Vertex*   hVex  = data(ivex, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector*   hVec  = data(ivec, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Elements* hElts = getHexaPtr<HEXA_NS::Elements*>(ielts);
+  HEXA_NS::Vertex*   hVex  = getHexaPtr<HEXA_NS::Vertex*>(ivex);
+  HEXA_NS::Vector*   hVec  = getHexaPtr<HEXA_NS::Vector*>(ivec);
 
   int r = _hexaDocument-> performRotation( hElts, hVex, hVec, angle );
   if ( r == HOK ){
     updateData();
     ret = true;
-    QString tmp = "/tmp/performRotation.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else if ( r == HERR ){
     ret = false;
   }
@@ -2265,15 +1950,13 @@ bool DocumentModel::performSymmetryPoint( const QModelIndex& ielts, const QModel
 {
   bool ret = false;
 
-  HEXA_NS::Elements* hElts = data(ielts, HEXA_DATA_ROLE).value<HEXA_NS::Elements *>();
-  HEXA_NS::Vertex*   hVex  = data(ivex, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Elements* hElts = getHexaPtr<HEXA_NS::Elements*>(ielts);
+  HEXA_NS::Vertex*   hVex  = getHexaPtr<HEXA_NS::Vertex*>(ivex);
 
   int r = _hexaDocument->performSymmetryPoint( hElts, hVex );
   if ( r == HOK ){
     updateData();
     ret = true;
-    QString tmp = "/tmp/performSymmetryPoint.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else if ( r == HERR ){
     ret = false;
   }
@@ -2286,16 +1969,14 @@ bool DocumentModel::performSymmetryLine( const QModelIndex& ielts, const QModelI
 {
   bool ret = false;
 
-  HEXA_NS::Elements* hElts = data(ielts, HEXA_DATA_ROLE).value<HEXA_NS::Elements *>();
-  HEXA_NS::Vertex*   hVex  = data(ivex, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector*   hVec  = data(ivec, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Elements* hElts = getHexaPtr<HEXA_NS::Elements*>(ielts);
+  HEXA_NS::Vertex*   hVex  = getHexaPtr<HEXA_NS::Vertex*>(ivex);
+  HEXA_NS::Vector*   hVec  = getHexaPtr<HEXA_NS::Vector*>(ivec);
 
   int r = _hexaDocument->performSymmetryLine( hElts, hVex, hVec );
   if ( r == HOK ){
     updateData();
     ret = true;
-    QString tmp = "/tmp/performSymmetryLine.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else if ( r == HERR ){
     ret = false;
   }
@@ -2310,16 +1991,14 @@ bool DocumentModel::performSymmetryPlane( const QModelIndex& ielts,
 {
   bool ret = false;
 
-  HEXA_NS::Elements* hElts = data(ielts, HEXA_DATA_ROLE).value<HEXA_NS::Elements *>();
-  HEXA_NS::Vertex*   hVex  = data(ivex, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector*   hVec  = data(ivec, HEXA_DATA_ROLE).value<HEXA_NS::Vector *>();
+  HEXA_NS::Elements* hElts = getHexaPtr<HEXA_NS::Elements*>(ielts);
+  HEXA_NS::Vertex*   hVex  = getHexaPtr<HEXA_NS::Vertex*>(ivex);
+  HEXA_NS::Vector*   hVec  = getHexaPtr<HEXA_NS::Vector*>(ivec);
 
   int r = _hexaDocument->performSymmetryPlane( hElts, hVex, hVec );
   if ( r == HOK ){
     updateData();
     ret = true;
-    QString tmp = "/tmp/performSymmetryPlane.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else if ( r == HERR ){
     ret = false;
   }
@@ -2340,8 +2019,8 @@ QModelIndex DocumentModel::revolutionQuads( const QModelIndexList& istartquads,
     hquad = data( iquad, HEXA_DATA_ROLE ).value<HEXA_NS::Quad*>();
     hstartquads.push_back( hquad );
   }
-  HEXA_NS::Vertex* hcenter = data( icenter,  HEXA_DATA_ROLE ).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vector* haxis   = data( ivecaxis, HEXA_DATA_ROLE ).value<HEXA_NS::Vector *>();
+  HEXA_NS::Vertex* hcenter = getHexaPtr<HEXA_NS::Vertex*>(icenter);
+  HEXA_NS::Vector* haxis   = getHexaPtr<HEXA_NS::Vector*>(ivecaxis);
   std::vector<double> hangles = angles.toVector().toStdVector();
 
   HEXA_NS::Elements* helts = _hexaDocument->revolutionQuads( hstartquads, hcenter, haxis, hangles );
@@ -2365,17 +2044,17 @@ QModelIndex DocumentModel::replace( const QModelIndexList& iquadsPattern,
 {
   QModelIndex ielts;
 
-  HEXA_NS::Vertex* hp1 = data(ip1, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hc1 = data(ic1, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hp2 = data(ip2, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hc2 = data(ic2, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hp3 = data(ip3, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
-  HEXA_NS::Vertex* hc3 = data(ic3, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+  HEXA_NS::Vertex* hp1 = getHexaPtr<HEXA_NS::Vertex*>(ip1);
+  HEXA_NS::Vertex* hc1 = getHexaPtr<HEXA_NS::Vertex*>(ic1);
+  HEXA_NS::Vertex* hp2 = getHexaPtr<HEXA_NS::Vertex*>(ip2);
+  HEXA_NS::Vertex* hc2 = getHexaPtr<HEXA_NS::Vertex*>(ic2);
+  HEXA_NS::Vertex* hp3 = getHexaPtr<HEXA_NS::Vertex*>(ip3);
+  HEXA_NS::Vertex* hc3 = getHexaPtr<HEXA_NS::Vertex*>(ic3);
 
   HEXA_NS::Quads   hquads;
   HEXA_NS::Quad*   hquad = NULL;
   foreach( const QModelIndex& iquad, iquadsPattern ){
-    hquad = data( iquad, HEXA_DATA_ROLE ).value<HEXA_NS::Quad*>();
+    hquad = getHexaPtr<HEXA_NS::Quad*>(iquad);
     hquads.push_back( hquad );
   }
 
@@ -2409,13 +2088,13 @@ void DocumentModel::addAssociation( const QModelIndex& iElt, const DocumentModel
   QString currentAssoc, newAssoc;
 
   if ( data(iElt, HEXA_TREE_ROLE) == VERTEX_TREE ){
-    HEXA_NS::Vertex* hVex = data(iElt, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+    HEXA_NS::Vertex* hVex = getHexaPtr<HEXA_NS::Vertex*>(iElt);
     hVex->setAssociation( assoc );
   } else if ( data(iElt, HEXA_TREE_ROLE) == EDGE_TREE ){
-    HEXA_NS::Edge*   hEdge = data(iElt, HEXA_DATA_ROLE).value<HEXA_NS::Edge *>();
+    HEXA_NS::Edge*   hEdge = getHexaPtr<HEXA_NS::Edge*>(iElt);
     hEdge->addAssociation( assoc );
   } else if ( data(iElt, HEXA_TREE_ROLE) == QUAD_TREE ){
-    HEXA_NS::Quad*   hQuad  = data(iElt, HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
+    HEXA_NS::Quad*   hQuad  = getHexaPtr<HEXA_NS::Quad*>(iElt);
     hQuad->addAssociation( assoc );
   }
 
@@ -2426,29 +2105,7 @@ void DocumentModel::addAssociation( const QModelIndex& iElt, const DocumentModel
     newAssoc = assocIn.entry + "," + assocIn.subid + ";";
   }
 
-  //std::cout << "addAssociation() newAssoc =>"  << newAssoc.toStdString()  << std::endl;
   setData( iElt, QVariant::fromValue(newAssoc), HEXA_ASSOC_ENTRY_ROLE );
-
-  // tree view : 
-/*
-  QList<QStandardItem *>  assocItems;
-  QStandardItem *aAssocItem = NULL;
-
-  QStandardItem *item = NULL;
-
-  aAssocItem = new QStandardItem(assocIn.name);
-  aAssocItem->setData( assocIn.entry + "," + assocIn.subid, HEXA_ENTRY_ROLE );
-
-
-  assocItems << aAssocItem;
-  item = itemFromIndex(iElt);
-  item->appendColumn(assocItems);
-//     appendColumn(assocItems);
-//     item->appendRow( assocItems );
-//     item->appendRow( new QStandardItem(assocIn.name) );
-  if ( item->columnCount() > columnCount() )
-    setColumnCount( columnCount()+1 );
-*/
 }
 
 
@@ -2461,7 +2118,8 @@ QList<DocumentModel::GeomObj> DocumentModel::getAssociations( const QModelIndex&
   //std::cout << "getAssociations() start"  << std::endl;
   if ( data(iElt, HEXA_TREE_ROLE) == VERTEX_TREE ){
     MESSAGE("*  of a Vertex");
-    HEXA_NS::Vertex* hVex = data(iElt, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+//    HEXA_NS::Vertex* hVex = data(iElt, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>();
+    HEXA_NS::Vertex *hVex = getHexaPtr<HEXA_NS::Vertex *>(iElt);
     HEXA_NS::Shape* hShape = hVex->getAssociation();
     QStringList shapeID;
     if ( hShape != NULL ){
@@ -2485,7 +2143,7 @@ QList<DocumentModel::GeomObj> DocumentModel::getAssociations( const QModelIndex&
     }
   } else if ( data(iElt, HEXA_TREE_ROLE) == EDGE_TREE ){
     MESSAGE("*  of an Edge");
-    HEXA_NS::Edge*   hEdge = data(iElt, HEXA_DATA_ROLE).value<HEXA_NS::Edge *>();
+    HEXA_NS::Edge*   hEdge = getHexaPtr<HEXA_NS::Edge *>(iElt);
     HEXA_NS::Shapes  hShapes = hEdge->getAssociations();
     QStringList shapeID;
     for ( HEXA_NS::Shapes::iterator it = hShapes.begin(); it != hShapes.end(); ++it){
@@ -2513,7 +2171,7 @@ QList<DocumentModel::GeomObj> DocumentModel::getAssociations( const QModelIndex&
     }
   } else if ( data(iElt, HEXA_TREE_ROLE) == QUAD_TREE ){
     MESSAGE("*  of a Quad");
-    HEXA_NS::Quad*   hQuad  = data(iElt, HEXA_DATA_ROLE).value<HEXA_NS::Quad *>();
+    HEXA_NS::Quad*   hQuad  = getHexaPtr<HEXA_NS::Quad*>(iElt);
     HEXA_NS::Shapes  hShapes = hQuad->getAssociations();
     QStringList shapeID;
     for ( HEXA_NS::Shapes::iterator it = hShapes.begin(); it != hShapes.end(); ++it){
@@ -2564,7 +2222,7 @@ bool DocumentModel::associateOpenedLine( const QModelIndexList& iedges,
 
     HEXA_NS::Edge* hedge = NULL;
     foreach( const QModelIndex& iedge, iedges ){
-        hedge = data( iedge, HEXA_DATA_ROLE ).value<HEXA_NS::Edge *>();
+        hedge = getHexaPtr<HEXA_NS::Edge*>(iedge);
         if ( mstart == NULL ){
             mstart = hedge;
             MESSAGE("*    mstart" << iedge.data().toString().toStdString() );
@@ -2602,16 +2260,6 @@ bool DocumentModel::associateOpenedLine( const QModelIndexList& iedges,
 
     int r = _hexaDocument->associateOpenedLine( mstart, mline,
                                                 gstart, pstart, gline, pend );
-//     HEXA_NS::Edge *e0     = _hexaDocument->getEdge(0);
-//     HEXA_NS::Edge *e1     = _hexaDocument->getEdge(1);
-//     HEXA_NS::Shapes  mstartAssoc = e0->getAssociations();
-//     HEXA_NS::Shapes  mlineAssoc  = e1->getAssociations();
-//     HEXA_NS::Shapes  mstartAssoc = mstart->getAssociations();
-//     HEXA_NS::Shapes  mlineAssoc= mline[0]->getAssociations();
-//     std::cout << "DocumentModel:: associateOpenedLine : mstartAssoc.size() => " << mstartAssoc.size() << std::endl;
-// std::cout << "DocumentModel:: associateOpenedLine : mstartAssoc[0]->ident=> " << mstartAssoc[0]->ident << std::endl;
-//     std::cout << "DocumentModel:: associateOpenedLine : mlineAssoc[0]->ident => " << mlineAssoc[0]->ident << std::endl;
-
     if ( r == HOK ){
         updateData();
         MESSAGE("*    DocumentModel:: associateOpenedLine() => OK ");
@@ -2632,7 +2280,7 @@ bool DocumentModel::associateClosedLine( const  QModelIndex& ivertex,
 {
     MESSAGE("DocumentModel::associateClosedLine() ");
     bool ret = false;
-    HEXA_NS::Vertex* mfirst = data( ivertex, HEXA_DATA_ROLE ).value<HEXA_NS::Vertex *>();
+    HEXA_NS::Vertex* mfirst = getHexaPtr<HEXA_NS::Vertex*>(ivertex);
     HEXA_NS::Edge*   mstart = NULL;
     HEXA_NS::Edges   mline;
     HEXA_NS::Shape*  gstart = NULL;
@@ -2642,7 +2290,7 @@ bool DocumentModel::associateClosedLine( const  QModelIndex& ivertex,
 
     HEXA_NS::Edge* hedge = NULL;
     foreach( const QModelIndex& iedge, iedges ){
-        hedge = data( iedge, HEXA_DATA_ROLE ).value<HEXA_NS::Edge *>();
+        hedge = getHexaPtr<HEXA_NS::Edge*>(iedge);
         if ( mstart == NULL ){
             mstart = hedge;
             MESSAGE("*    mstart" << iedge.data().toString().toStdString() );
@@ -2680,10 +2328,8 @@ bool DocumentModel::associateClosedLine( const  QModelIndex& ivertex,
                                                 gstart, pstart, inv, gline );
     if ( r == HOK ){
         updateData();
-        //std::cout << "DocumentModel:: associateClosedLine => OK " << std::endl;
         ret = true;
     } else if ( r == HERR ){
-        //std::cout << "DocumentModel:: associateClosedLine => ERR " << std::endl;
         ret = false;
     }
     return ret;
@@ -2701,8 +2347,6 @@ QModelIndex DocumentModel::addGroup( const QString& name, Group kind )
   groupItem->setData( _entry, HEXA_DOC_ENTRY_ROLE );
   _groupDirItem->appendRow(groupItem);
   iGroup = groupItem->index();
-  QString tmp = "/tmp/addGroup.vtk";
-  //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
 
   return iGroup;
 }
@@ -2718,13 +2362,17 @@ bool DocumentModel::removeGroup( const QModelIndex& igrp )
   if ( r == HOK ){
     removeRow( igrp.row(), igrp.parent());
     ret = true;
-    QString tmp = "/tmp/removeGroup.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else if ( r == HERR ){
     ret = false;
   }
   return ret;
 }
+/*
+QModelIndex* DocumentModel::found(eltBase)
+{
+       TODO_JMD
+}
+*/
 
 QModelIndexList DocumentModel::getGroupElements( const QModelIndex& iGroup, DocumentModel::Group& kind ) const
 {
@@ -2738,7 +2386,6 @@ QModelIndexList DocumentModel::getGroupElements( const QModelIndex& iGroup, Docu
   HEXA_NS::EltBase* eltBase = NULL;
   for ( int nr = 0; nr < g->countElement(); ++nr ){
     eltBase = g->getElement( nr );
-    //std::cout<< "eltBase"<< eltBase << std::endl;
     kind = g->getKind();
     switch ( kind ){
       case HEXA_NS::HexaCell: case HEXA_NS::HexaNode: q = QVariant::fromValue( (HEXA_NS::Hexa *)eltBase ); break;
@@ -2767,8 +2414,6 @@ void DocumentModel::setGroupName( const QModelIndex& igrp, const QString& name )
     setData(igrp, QVariant::fromValue( name ) );
   }
 
-  QString tmp = "/tmp/setGroupName.vtk";
-  //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
 }
 
 bool DocumentModel::addGroupElement( const QModelIndex& igrp, const QModelIndex& ielt )
@@ -2777,26 +2422,20 @@ bool DocumentModel::addGroupElement( const QModelIndex& igrp, const QModelIndex&
 
   bool addOk = false;
   HEXA_NS::Group*   hGroup = data(igrp, HEXA_DATA_ROLE).value<HEXA_NS::Group *>();
-  HEXA_NS::EltBase* hElt   = NULL; 
+  HEXA_NS::EltBase* hElt   = NULL;
   switch ( hGroup->getKind() ){
-  case HEXA_NS::HexaCell: case HEXA_NS::HexaNode: hElt = data(ielt, HEXA_DATA_ROLE).value<HEXA_NS::Hexa *>(); break;
-  case HEXA_NS::QuadCell: case HEXA_NS::QuadNode: hElt = data(ielt, HEXA_DATA_ROLE).value<HEXA_NS::Quad *>(); break;
-  case HEXA_NS::EdgeCell: case HEXA_NS::EdgeNode: hElt = data(ielt, HEXA_DATA_ROLE).value<HEXA_NS::Edge *>(); break;
-  case HEXA_NS::VertexNode: hElt = data(ielt, HEXA_DATA_ROLE).value<HEXA_NS::Vertex *>(); break;
+  case HEXA_NS::HexaCell: case HEXA_NS::HexaNode: hElt = getHexaPtr<HEXA_NS::Hexa*>(ielt); break;
+  case HEXA_NS::QuadCell: case HEXA_NS::QuadNode: hElt = getHexaPtr<HEXA_NS::Quad*>(ielt); break;
+  case HEXA_NS::EdgeCell: case HEXA_NS::EdgeNode: hElt = getHexaPtr<HEXA_NS::Edge*>(ielt); break;
+  case HEXA_NS::VertexNode: hElt = getHexaPtr<HEXA_NS::Vertex*>(ielt); break;
   }
 
-  //std::cout << "hGroup" << hGroup << std::endl;
-  //std::cout << "hElt"   << hElt   << std::endl;
-
   int res = HERR;   
   if ( hGroup and hElt )
     res = hGroup->addElement( hElt );
 
   if ( res == HOK ) addOk = true;
 
-//   QString tmp = "/tmp/addGroupElement.vtk";
-  //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
-
   return addOk;
 }
 
@@ -2805,10 +2444,11 @@ bool DocumentModel::removeGroupElement( const QModelIndex& igrp, int nro )
   HEXA_NS::Group* hGroup = data(igrp, HEXA_DATA_ROLE).value<HEXA_NS::Group *>();
 
   if ( hGroup )
-    hGroup->removeElement( nro );
-
-  QString tmp = "/tmp/removeGroupElement.vtk";
-  //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
+  {
+    if (hGroup->removeElement( nro ) == HOK)
+       return true;
+  }
+  return false;
 }
 
 bool DocumentModel::clearGroupElement( const QModelIndex& igrp )
@@ -2816,10 +2456,11 @@ bool DocumentModel::clearGroupElement( const QModelIndex& igrp )
   HEXA_NS::Group* hGroup = data(igrp, HEXA_DATA_ROLE).value<HEXA_NS::Group *>();
 
   if ( hGroup )
+  {
     hGroup->clearElement();
-
-  QString tmp = "/tmp/clearGroupElement.vtk";
-  //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
+    return true;
+  }
+  return false;
 }
 
 // ************  LAWS  ************
@@ -2834,8 +2475,6 @@ QModelIndex DocumentModel::addLaw( const QString& name, int nbnodes )
   LawItem* lawItem = new LawItem(hLaw);
   _lawDirItem->appendRow(lawItem);
   iLaw = lawItem->index();
-  QString tmp = "/tmp/addLaw.vtk";
-  //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
 
   return iLaw;
 }
@@ -2854,8 +2493,6 @@ bool DocumentModel::setLaw( const QModelIndex& ilaw, int nbnodes, double coeff,
     hLaw->setKind(type);
   }
 
-  QString tmp = "/tmp/setLaw.vtk";
-  //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   return ret;
 }
 
@@ -2869,8 +2506,6 @@ bool  DocumentModel::removeLaw( const QModelIndex& ilaw )
   if ( r == HOK ){
     removeRow( ilaw.row(),  ilaw.parent());
     ret = true;
-    QString tmp = "/tmp/removeLaw.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else if ( r == HERR ){
     ret = false;
   }
@@ -2889,8 +2524,6 @@ bool DocumentModel::setPropagation( const QModelIndex& iPropagation, const QMode
 
   if ( r == HOK ){
     ret = true;
-    QString tmp = "/tmp/setPropagation.vtk";
-    //_hexaDocument->saveVtk( tmp.toLocal8Bit().constData() );
   } else if ( r == HERR ){
     ret = false;
   }
@@ -2931,20 +2564,6 @@ QString DocumentModel::documentEntry()
   return _entry;
 }
 
-// QModelIndex DocumentModel::indexBy( int role, const QString& value )
-// {
-//   QModelIndex eltIndex; // element (vertex, edge, quad) of model
-//   QModelIndexList theIndexes = match( index(0, 0),
-//                                       role,
-//                                       value,
-//                                       1,
-//                                       Qt::MatchRecursive | Qt::MatchContains );//Qt::MatchFixedString );
-//   if ( theIndexes.count()>0 )
-//     eltIndex = theIndexes[0] ;
-//   return eltIndex;
-// }
-
-
 // 8.3 Boite: éditer une loi  CS_TODO
 // (idem création)
 
@@ -2992,14 +2611,6 @@ Qt::ItemFlags PatternDataModel::flags(const QModelIndex &index) const
   if ( m != NULL ){
     flags = m->flags( mapToSource(index) );
   }
-
-//   if ( flags == Qt::ItemFlags( ~Qt::ItemIsEditable ) ){
-//     MESSAGE("*  you can select "<< index.data().toString().toStdString() );
-//   } else {
-//     MESSAGE("*  you cannot select  "<< index.data().toString().toStdString() );
-//   }
-
-//   MESSAGE("}");
   return flags;
 }
 
@@ -3013,105 +2624,6 @@ QVariant PatternDataModel::headerData ( int section, Qt::Orientation orientation
   }
 }
 
-// QModelIndex PatternDataModel::addVertex( double x, double y, double z )
-// {
-//   QModelIndex vertexIndex;
-//   DocumentModel *m = dynamic_cast<DocumentModel *>( sourceModel() );
-//   if ( m != NULL ){
-//     QModelIndex sourceIndex = m->addVertex( x, y, z );
-//     vertexIndex = mapFromSource(sourceIndex);
-//   }
-//   return vertexIndex;
-// }
-// 
-// void PatternDataModel::updateVertex(const QModelIndex& i_v)
-// {
-//     std::cout << "PatternDataModel::updateVertex()" << std::endl;
-//     VertexItem *item_v = dynamic_cast<VertexItem*>(itemFromIndex(i_v));
-//     DocumentModel *m = dynamic_cast<DocumentModel *>( sourceModel() );
-// 
-//     if (item_v != NULL)
-//     {
-//         std::cout << "updateVertex() : OK" << std::endl;
-//         m->updateView(item_v);
-// 
-//     }
-//     else
-//     {
-//         std::cout << "updateVertex() : NOT OK" << std::endl;
-// 
-//     }
-// }
-// 
-// 
-// QModelIndex PatternDataModel::addQuad( const QModelIndex &i_v0, const QModelIndex &i_v1,
-//                                        const QModelIndex &i_v2, const QModelIndex &i_v3 )
-// {
-//   QModelIndex quadIndex;
-//   DocumentModel *m = dynamic_cast<DocumentModel *>( sourceModel() );
-//   if ( m != NULL ){
-//     QModelIndex sourceIndex = m->addQuad( mapToSource(i_v0), mapToSource(i_v1),
-//                                           mapToSource(i_v2), mapToSource(i_v3) );
-//     quadIndex = mapFromSource(sourceIndex);
-//   }
-//   return quadIndex;
-// }
-// 
-// 
-// 
-// QModelIndex PatternDataModel::addHexaFromQuad( const QModelIndex &i_q0, const QModelIndex &i_q1, const QModelIndex &i_q2,
-//                                                const QModelIndex &i_q3, const QModelIndex &i_q4, const QModelIndex &i_q5 )
-// {
-//   QModelIndex hexaIndex;
-//   DocumentModel *m = dynamic_cast<DocumentModel *>( sourceModel() );
-//   if ( m != NULL ){
-//     QModelIndex sourceIndex = m->addHexaFromQuad( mapToSource(i_q0), mapToSource(i_q1), mapToSource(i_q2),
-//                                                   mapToSource(i_q3), mapToSource(i_q4), mapToSource(i_q5) );
-//     hexaIndex = mapFromSource(sourceIndex);
-//   }
-//   return hexaIndex;
-// }
-// 
-// 
-// 
-// 
-// 
-// 
-// bool PatternDataModel::mergeVertices( const QModelIndex &i_v0, const QModelIndex &i_v1 )
-// {
-//   bool ret = false;
-//   DocumentModel *m = dynamic_cast<DocumentModel *>( sourceModel() );
-//   if ( m != NULL ){
-//     ret = m->mergeVertices( mapToSource(i_v0), mapToSource(i_v1) );
-//   }
-//   return ret;
-// }
-// 
-// bool PatternDataModel::mergeEdges( const QModelIndex &i_e0, const QModelIndex &i_e1,
-//                                    const QModelIndex &i_v0, const QModelIndex &i_v1 )
-// {
-//   bool ret = false;
-//   DocumentModel *m = dynamic_cast<DocumentModel *>( sourceModel() );
-//   if ( m != NULL ){
-//     ret = m->mergeEdges( mapToSource(i_e0), mapToSource(i_e1),
-//                          mapToSource(i_v0), mapToSource(i_v1) );
-//   }
-//   return ret;
-// }
-// 
-// QModelIndex PatternDataModel::cutEdge( const QModelIndex &i_e0, int nbcuts )
-// {
-//   QModelIndex elementsIndex;
-//   DocumentModel *m = dynamic_cast<DocumentModel *>( sourceModel() );
-//   if ( m != NULL ){
-//     QModelIndex sourceElementsIndex = m->cutEdge( mapToSource(i_e0), nbcuts );
-//     std::cout << " sourceElementsIndex.isValid() => " << sourceElementsIndex.isValid() << std::endl;
-//     elementsIndex = mapFromSource(sourceElementsIndex);
-//     std::cout << " elementsIndex.isValid() => " << elementsIndex.isValid() << std::endl;
-//   }
-//   return elementsIndex;
-// }
-
 
 QStandardItem* PatternDataModel::itemFromIndex ( const QModelIndex & index ) const
 {
@@ -3170,40 +2682,6 @@ QStandardItem* PatternBuilderModel::itemFromIndex ( const QModelIndex & index )
   return item;
 }
 
-// QModelIndex PatternBuilderModel::addVector( double dx, double dy, double dz )
-// {
-//   std::cout << "PatternBuilderModel::addVector" << std::endl;
-//   QModelIndex vectorIndex;
-// 
-//   DocumentModel *m = dynamic_cast<DocumentModel *>( sourceModel() );
-//   if ( m != NULL ){
-//     std::cout << "PatternBuilderModel::addVector m != NULL " << std::endl;
-//     QModelIndex sourceIndex = m->addVector( dx, dy, dz );
-//     vectorIndex = mapFromSource(sourceIndex);
-//   }
-//   return vectorIndex;
-// }
-// 
-// 
-// QModelIndex PatternBuilderModel::makeCartesian( const QModelIndex& i_pt,
-//                                    const QModelIndex& i_vec_x, const QModelIndex& i_vec_y, const QModelIndex& i_vec_z,
-//                                    long nx, long ny, long nz)
-// {
-//   std::cout << " PatternBuilderModel::makeCartesian()"<< std::endl;
-//   QModelIndex elementsIndex;
-//   DocumentModel *m = dynamic_cast<DocumentModel *>( sourceModel() );
-//   if ( m != NULL ){
-//     QModelIndex sourceElementsIndex = m->makeCartesian( 
-//                     mapToSource(i_pt),
-//                     mapToSource(i_vec_x), mapToSource(i_vec_y), mapToSource(i_vec_z),
-//                     nx, ny, nz );
-//     std::cout << " sourceElementsIndex.isValid() => " << sourceElementsIndex.isValid() << std::endl;
-//     elementsIndex = mapFromSource(sourceElementsIndex);
-//     std::cout << " elementsIndex.isValid() => " << elementsIndex.isValid() << std::endl;
-//   }
-//   return elementsIndex;
-// }
-
 AssociationsModel::AssociationsModel( QObject * parent ) :
   QSortFilterProxyModel( parent )
 {
@@ -3219,7 +2697,6 @@ AssociationsModel::~AssociationsModel()
 
 Qt::ItemFlags AssociationsModel::flags(const QModelIndex &index) const
 {
-//   std::cout<<"AssociationsModel::flags()"<<std::endl;
   Qt::ItemFlags flags;
 
   DocumentModel *m = dynamic_cast<DocumentModel *>( sourceModel() );
@@ -3263,22 +2740,12 @@ GroupsModel::~GroupsModel()
 
 Qt::ItemFlags GroupsModel::flags(const QModelIndex &index) const
 {
-//   MESSAGE("GroupsModel::flags() "<< index.data().toString().toStdString() );
   Qt::ItemFlags flags;
 
   DocumentModel *m = dynamic_cast<DocumentModel *>( sourceModel() );
   if ( m != NULL ){
-//     MESSAGE("*  ( m != NULL ) "<< index.data().toString().toStdString() );
     flags = m->flags( mapToSource(index) );
-  } else {
-//     MESSAGE("*  ( m is NULL ) "<< index.data().toString().toStdString() );
-  }
-//   if ( flags == Qt::ItemFlags( ~Qt::ItemIsEditable ) ){
-//     MESSAGE("*  flags == Qt::ItemFlags( ~Qt::ItemIsEditable ) "<< index.data().toString().toStdString() );
-//   } else {
-//     MESSAGE("*  flags is not Qt::ItemFlags( ~Qt::ItemIsEditable ) "<< index.data().toString().toStdString() );
-//   }
-//   MESSAGE("}");
+  }
   return flags;
 }
 
@@ -3326,22 +2793,12 @@ MeshModel::~MeshModel()
 
 Qt::ItemFlags MeshModel::flags(const QModelIndex &index) const
 {
-//   MESSAGE("MeshModel::flags() "<< index.data().toString().toStdString() );
   Qt::ItemFlags flags;
 
   DocumentModel *m = dynamic_cast<DocumentModel *>( sourceModel() );
   if ( m != NULL ){
-//     MESSAGE("*  ( m != NULL ) "<< index.data().toString().toStdString() );
     flags = m->flags( mapToSource(index) );
-  } else {
-//     MESSAGE("*  ( m is NULL ) "<< index.data().toString().toStdString() );
-  }
-//   if ( flags == Qt::ItemFlags( ~Qt::ItemIsEditable ) ){
-//     MESSAGE("*  you can select "<< index.data().toString().toStdString() );
-//   } else {
-//     MESSAGE("*  you cannot select  "<< index.data().toString().toStdString() );
-//   }
-//   MESSAGE("}");
+  }
   return flags;
 }
 
index a16a47900c97f6ab8834767ac255ec30f6f36078..20b322766fddf49a5eccde8f79793c936de00dff 100755 (executable)
@@ -25,6 +25,8 @@
 #include <QStandardItemModel>
 #include <QSortFilterProxyModel>
 
+#include "GEOM_GenericObjPtr.h"
+
 #include "HEXABLOCKGUI_DocumentItem.hxx"
 #include "HexDocument.hxx"
 
@@ -65,7 +67,7 @@ namespace HEXABLOCK
         QString getName();
         void load( const QString& xmlFileName );
         void save( const QString& xmlFileName );
-
+        struct GeomObj* convertToGeomObj(GEOM::GeomObjPtr geomObjPtr);
         void updateData();
 
         void clearAll();
@@ -104,8 +106,19 @@ namespace HEXABLOCK
         void allowLawSelectionOnly();
 
 
+        HEXA_NS::EltBase* getHexaPtr(const QModelIndex& iElt);
+        template<typename T>
+        T getHexaPtr(QModelIndex iElt)
+        {
+               if (iElt.isValid())
+                       return iElt.data( HEXA_DATA_ROLE ).value< T >();
+
+               return NULL;
+        }
+
         void setName( const QModelIndex& iElt, const QString& name );
         bool clearEltAssociations( const QModelIndex& iElt );
+        HEXA_NS::Hexa* getQuadHexa(HEXA_NS::Quad* quad);
 
         //  ************  BUILD HEXABLOCK MODEL ************
         QModelIndex addVertex( double x, double y, double z );
@@ -213,7 +226,7 @@ namespace HEXABLOCK
         //
         QModelIndex prismQuad( const QModelIndex& quad, const QModelIndex& dv, int nb);
         QModelIndex prismQuads( const QModelIndexList& quads, const QModelIndex& dv, int nb);
-
+        QModelIndex prismQuads( const QModelIndexList& quads, const QModelIndex& dv, std::vector<double>, int nb=0);
 
         //
         QModelIndex joinQuad( const QModelIndex& start_q, const QModelIndex& dest_q,
@@ -240,7 +253,7 @@ namespace HEXABLOCK
         QModelIndex disconnectVertex( const QModelIndex& h, const QModelIndex& v );
         QModelIndex disconnectEdge( const QModelIndex& h, const QModelIndex& e );
         QModelIndex disconnectQuad( const QModelIndex& h, const QModelIndex& q );
-       QModelIndex disconnectEdges( const QModelIndexList& h, const QModelIndexList& e );
+        QModelIndex disconnectEdges( const QModelIndexList& h, const QModelIndexList& e );
 
         //
         QModelIndex cutEdge( const QModelIndex &e, int nbcuts );
index 91c790c46548e0be701e4da1004236cfc9027e2d..27203c10926f2dc62641e4bee225cb2347d275ae 100755 (executable)
@@ -57,6 +57,7 @@
 #include "SVTK_Selection.h"
 #include <SVTK_ViewModel.h>
 #include <VTKViewer_ViewModel.h>
+#include <SVTK_View.h>
 
 #include <SUIT_ResourceMgr.h>
 
 #include "GEOMBase.h"
 #include "GEOM_Operation.h"
 
-
+#define BUTTON_BOX_MIN_WIDTH 5
 #define VERTEX_COORD_MIN -1000000
 #define VERTEX_COORD_MAX  1000000
+#define SPINBOX_ANGLE_MAX 360
+#define SPINBOX_DOUBLE_MAX 1000000000
+#define SPINBOX_POSITIVE_DOUBLE_MIN 0
+#define NB_DECIMALS 6
 
 
 using namespace std;
@@ -91,7 +96,9 @@ public:
 
        QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
                        const QModelIndex &index) const{
-               return new QDoubleSpinBox( parent );
+               QDoubleSpinBox *sb = new QDoubleSpinBox( parent );
+               sb->setDecimals(NB_DECIMALS);
+               return sb;
        }
 };
 
@@ -103,8 +110,9 @@ public:
        QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
                        const QModelIndex &index) const{
                QDoubleSpinBox *sb = new QDoubleSpinBox( parent );
-               sb->setMinimum(0);
-               sb->setMaximum(360);
+               sb->setMinimum(SPINBOX_POSITIVE_DOUBLE_MIN);
+               sb->setMaximum(SPINBOX_ANGLE_MAX);
+               sb->setDecimals(NB_DECIMALS);
                return sb;
        }
 };
@@ -118,14 +126,14 @@ public:
        QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
                        const QModelIndex &index) const{
                QDoubleSpinBox *sb = new QDoubleSpinBox( parent );
-               sb->setMinimum(0);
+               sb->setMinimum(SPINBOX_POSITIVE_DOUBLE_MIN);
                /////// sb->setMaximum(1000000000000000); //10e15   Abu : Pb en 32 bits
-               sb->setMaximum(1000000000);       //10e9
+               sb->setMaximum(SPINBOX_DOUBLE_MAX);       //10e9
+               sb->setDecimals(NB_DECIMALS);
                return sb;
        }
 };
 
-
 // ======================================================== Constructeur
 HexaBaseDialog::HexaBaseDialog( QWidget * parent, Mode editmode, Qt::WindowFlags f ):
                                                                //   _model(0),
@@ -144,10 +152,12 @@ HexaBaseDialog::HexaBaseDialog( QWidget * parent, Mode editmode, Qt::WindowFlags
                                                                  _vtkVm(0),
                                                                  _occVm(0),
                                                                  _currentObj(0),
+                                                                 currentOCCSelectionMode(TopAbs_SHAPE),
                                                                  _expectedSelection(-1),
                                                                  _selectionMutex( false ),
                                                                  // _applyCloseButton(0),
-                                                                 _applyButton(0)
+                                                                 _applyButton(0),
+                                                                 debugEdgeAssoc(false)
 {
        MESSAGE("HexaBaseDialog::HexaBaseDialog() dynamic_cast<SUIT_Desktop*>(parent->parent()) =>" << dynamic_cast<SUIT_Desktop*>(parent->parent()) );
        _strHexaWidgetType[VERTEX_TREE] = tr( "VERTEX" );
@@ -164,16 +174,74 @@ HexaBaseDialog::HexaBaseDialog( QWidget * parent, Mode editmode, Qt::WindowFlags
        _strHexaWidgetType[GROUP_TREE]      = tr( "GROUP" );
        _strHexaWidgetType[LAW_TREE]        = tr( "LAW" );
        _strHexaWidgetType[PROPAGATION_TREE]= tr( "PROPAGATION" );
+}
+
+QModelIndexList HexaBaseDialog::getIndexList(QListWidget* itemsList)
+{
+       QModelIndexList iItems;
+       QModelIndex     iItem;
+       QListWidgetItem* item = NULL;
+       const PatternDataModel*    patternDataModel = dynamic_cast<const PatternDataModel*>( _patternDataSelectionModel->model() );
+       if (patternDataModel == NULL) return iItems;
+
+       unsigned int nbItems = itemsList->count();
+       for ( int r = 0; r < nbItems; ++r){
+               item = itemsList->item(r);
+               iItem = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value<QModelIndex>() );
+               iItems << iItem;
+       }
+       return iItems;
+}
+
+
+// ============================================================= lockSizeToSizeHint
+void HexaBaseDialog::lockSizeToSizeHint()
+{
+       setMaximumHeight(sizeHint().height());
+       setMaximumWidth(sizeHint().width());
+//     setMinimumHeight(sizeHint().height());
+//     setMinimumWidth(sizeHint().width());
+}
+
+// ============================================================= unlockSizeModification
+void HexaBaseDialog::unlockSizeModification()
+{
+       setMaximumHeight(MAX_HEIGHT);
+       setMaximumWidth(MAX_WIDTH);
+//     setMinimumHeight(MIN_HEIGHT);
+//     setMinimumWidth(MIN_WIDTH);
+}
+
+// ============================================================= resetSizeAndShow
+void HexaBaseDialog::resetSizeAndShow(QDockWidget* parent)
+{
+       //force the dialog to fit its contain
+       lockSizeToSizeHint();
+
+       //set the dialog in the dockwidget
+       parent->setWidget(this);
+       parent->setWindowTitle(windowTitle());
+       parent->setVisible(true);
+       show();
+
+       unlockSizeModification();
+}
+
 
+// ============================================================= onCurrentSelectionChanged
+void HexaBaseDialog::onCurrentSelectionChanged()
+{
+       highlightSelectedAssocs();
 }
 
-// ============================================================= Destructeur
-HexaBaseDialog::~HexaBaseDialog()
+
+// ============================================================= setFocusToNextField
+//Sets focus to the next field of the current object
+void HexaBaseDialog::setFocusToNextField()
 {
-       //   _mgr->clearSelectionCache();
-       //   _mgr->clearSelected();
-       //   globalSelection();
-       //   erasePreview();
+       activateWindow ();
+       _highlightWidget(_currentObj, Qt::white);
+       if (!debugEdgeAssoc) focusNextPrevChild(true);
 }
 
 // ============================================================== _initButtonBox
@@ -184,7 +252,7 @@ QGroupBox* HexaBaseDialog::_initButtonBox( Mode editmode )
 
        //QDialogButtonBox* buttonBox = new QDialogButtonBox(this);
        QGroupBox* buttonBox = new QGroupBox();
-       buttonBox->setMinimumWidth(5);
+       buttonBox->setMinimumWidth(BUTTON_BOX_MIN_WIDTH);
        buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
        //buttonBox->setOrientation(Qt::Horizontal);
        QHBoxLayout* buttonsHLayout = new QHBoxLayout();
@@ -205,7 +273,7 @@ QGroupBox* HexaBaseDialog::_initButtonBox( Mode editmode )
        //buttonsHLayout->addButton( _applyCloseButton );
        buttonBox->setLayout(buttonsHLayout);
        layout()->addWidget(buttonBox);
-
+       buttonBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
        return buttonBox;
 }
 
@@ -222,10 +290,9 @@ void HexaBaseDialog::_initViewManager()
 {
        SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
        _mgr   = dynamic_cast<LightApp_SelectionMgr*>( anApp->selectionMgr() );
-       _vtkVm = anApp->getViewManager( SVTK_Viewer::Type(),      true );
        _occVm = anApp->getViewManager( OCCViewer_Viewer::Type(), true );
+       _vtkVm = anApp->getViewManager( SVTK_Viewer::Type(),      true );
        SUIT_ViewManager* activeVm = anApp->activeViewManager();
-
        onWindowActivated ( activeVm );
 }
 
@@ -245,7 +312,7 @@ bool HexaBaseDialog::apply()
                // select and highlight in vtk view the result
                _selectAndHighlight( iNew );
                // reinitialization
-               _currentObj = NULL;
+//             _currentObj = NULL;
        }
        return applied;
 }
@@ -260,13 +327,34 @@ bool HexaBaseDialog::apply()
 //  }
 //}
 
+void HexaBaseDialog::clearVTKSelection()
+{
+       if (HEXABLOCKGUI::currentVtkView == NULL) return;
+       HEXABLOCKGUI::currentVtkView->unHighlightAll();
+       _disallowSelection();
+}
+
+void HexaBaseDialog::clearOCCSelection()
+{
+       if (HEXABLOCKGUI::selectionMgr() == NULL || HEXABLOCKGUI::currentOccView == NULL) return;
+       HEXABLOCKGUI::selectionMgr()->clearSelected();
+       globalSelection();
+       localSelection(GEOM::GEOM_Object::_nil(), TopAbs_SHAPE);
+}
+
 // ============================================================== close
 void HexaBaseDialog::close()
 {
-       _currentObj = NULL;
-       _disallowSelection();
-       //resize(300, 350);
-       QDialog::close();
+//     _currentObj = NULL;
+
+       //Clear VTK selection
+       clearVTKSelection();
+
+       //Clear OCC selection
+       clearOCCSelection();
+
+       //Close the dialog box
+       if (parentWidget()) parentWidget()->close();
 }
 
 // ============================================================== onHelpRequested
@@ -290,7 +378,32 @@ void HexaBaseDialog::onHelpRequested()
                                arg( app->resourceMgr()->stringValue( "ExternalBrowser", platform ) ).arg( _helpFileName ),
                                QObject::tr( "BUT_OK" ) );
        }
+}
+
+// ============================================================== highlightSelectedAssocs
+void HexaBaseDialog::highlightSelectedAssocs()
+{
+       if (!_patternDataSelectionModel || !HEXABLOCKGUI::selectionMgr()) return;
+       HEXABLOCKGUI::selectionMgr()->clearSelected();
+
+       //highlight vtk selected elts
+       QModelIndexList vtkAssocs = getAssocsVTK();
+       if (!vtkAssocs.isEmpty()) _patternDataSelectionModel->highlightVTKElts(vtkAssocs);
+
+       //highlight geom selected elts
+       QMultiMap<QString, int> geomAssocs = getAssocsGEOM();
+       if (geomAssocs.size() > 0) _patternDataSelectionModel->_highlightGEOM(geomAssocs);
+}
 
+// ============================================================== getObjectViewType
+HexaBaseDialog::ViewType HexaBaseDialog::getObjectViewType(QObject* obj)
+{
+       if (obj == NULL) return NONE;
+       QVariant v  = obj->property("HexaWidgetType");
+       if ( v.isValid() ) return VTK;
+       v = obj->property("GeomWidgetType");
+       if ( v.isValid() ) return OCC;
+       return NONE;
 }
 
 // ============================================================== _selectAndHighlight
@@ -301,7 +414,6 @@ void HexaBaseDialog::_selectAndHighlight( const QModelIndex& i )
        setFocus();
 }
 
-
 // ============================================================== _allowSelection
 void HexaBaseDialog::_allowSelection()
 {
@@ -325,24 +437,30 @@ void HexaBaseDialog::_disallowSelection()
        MESSAGE("}");
 }
 
+void HexaBaseDialog::setOCCSelectionMode(TopAbs_ShapeEnum mode)
+{
+       if (HEXABLOCKGUI::selectionMgr() != NULL)
+       {
+               HEXABLOCKGUI::selectionMgr()->clearSelected();
+               globalSelection();
+               localSelection(GEOM::GEOM_Object::_nil(), mode);
+               currentOCCSelectionMode = mode;
+       }
+}
 
 // ============================================================== _allowVTKSelection
 bool HexaBaseDialog::_allowVTKSelection( QObject* obj )
 {
-       MESSAGE("HexaBaseDialog::_allowModelSelection(){");
+
+       MESSAGE("HexaBaseDialog::_allowVTKSelection(){");
        if ( !_patternDataSelectionModel ) return false;
        bool isOk = false;
 
-       HexaWidgetType wType;
+//     MESSAGE("*  HEXABLOCKGUI::currentVtkView->raise()");
+//     HEXABLOCKGUI::currentVtkView->raise();
+//     HEXABLOCKGUI::currentVtkView->setFocus();
        QVariant v  = obj->property("HexaWidgetType");
-       if ( !v.isValid() ) {
-               MESSAGE("*  no HexaWidgetType property");
-               return false;
-       }
-       MESSAGE("*  HEXABLOCKGUI::currentVtkView->raise()");
-       HEXABLOCKGUI::currentVtkView->raise();
-       //   HEXABLOCKGUI::currentVtkView->setFocus();
-       wType = v.value<HexaWidgetType>();
+       HexaWidgetType wType = v.value<HexaWidgetType>();
        MESSAGE("*  HexaWidgetType property is " << wType );
 
        switch (wType){
@@ -372,43 +490,29 @@ bool HexaBaseDialog::_allowVTKSelection( QObject* obj )
        return isOk;
 }
 
+void HexaBaseDialog::refreshConnects()
+{
+       hide();
+       show();
+}
+
 // ============================================================== _allowOCCSelection
 bool HexaBaseDialog::_allowOCCSelection( QObject* obj )
 {
        MESSAGE("HexaBaseDialog::_allowOCCCSelection(){");
-       if ( !HEXABLOCKGUI::currentOccView ) return false;
-
-       //We do not allow occ selection when the occ viewer is not activated
-       SUIT_ViewWindow* window = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
-       bool isOCC = (window && window->getViewManager()->getType() == OCCViewer_Viewer::Type());
-       if (!isOCC) return false;
-
+       if ( HEXABLOCKGUI::currentOccView == NULL) return false;
 
-       GeomWidgetType wType;
-       QVariant v = obj->property("GeomWidgetType");
-       if ( !v.isValid() ) {
-               MESSAGE("*  no GeomWidgetType property");
-               return false;
-       }
-       MESSAGE("*  HEXABLOCKGUI::currentOccView->raise()");
-       HEXABLOCKGUI::currentOccView->raise();
-       wType = v.value<GeomWidgetType>();
-       MESSAGE("*  GeomWidgetType property is " << wType );
-       MESSAGE("*  TopAbs_VERTEX           is " << TopAbs_VERTEX );
-       MESSAGE("*  TopAbs_EDGE             is " << TopAbs_EDGE );
-       MESSAGE("*  TopAbs_FACE             is " << TopAbs_FACE );
-
-       globalSelection(); // close local contexts, if any
-       localSelection(GEOM::GEOM_Object::_nil(), wType/*TopAbs_EDGE*/);
+       QVariant v  = obj->property("GeomWidgetType");
+       GeomWidgetType wType = v.value<GeomWidgetType>();
+       setOCCSelectionMode(wType);
        return true;
 }
 
-
 // ============================================================== _getSelector
 QItemSelectionModel* HexaBaseDialog::_getSelector( QObject* obj )
 {
        QItemSelectionModel* selector = NULL;
-       MESSAGE("HexaBaseDialog::getSelector(){");
+       MESSAGE("HexaBaseDialog::_getSelector(){");
 
        QString objectName = obj->objectName();
        QString className = obj->metaObject()->className();
@@ -429,19 +533,15 @@ QItemSelectionModel* HexaBaseDialog::_getSelector( QObject* obj )
        case VERTEX_TREE:
        case EDGE_TREE:
        case QUAD_TREE:
-       case HEXA_TREE:
-               selector = _patternDataSelectionModel; break;
+       case HEXA_TREE: selector = _patternDataSelectionModel; break;
        case VECTOR_TREE:
        case CYLINDER_TREE:
        case PIPE_TREE:
        case ELEMENTS_TREE:
-       case CROSSELEMENTS_TREE:
-               selector = _patternBuilderSelectionModel; break;
-       case GROUP_TREE:
-               selector = _groupsSelectionModel; break;
+       case CROSSELEMENTS_TREE: selector = _patternBuilderSelectionModel; break;
+       case GROUP_TREE: selector = _groupsSelectionModel; break;
        case LAW_TREE:
-       case PROPAGATION_TREE:
-               selector = _meshSelectionModel; break;
+       case PROPAGATION_TREE: selector = _meshSelectionModel; break;
        default : MESSAGE("NOT YET");
        }
        MESSAGE("}");
@@ -450,7 +550,10 @@ QItemSelectionModel* HexaBaseDialog::_getSelector( QObject* obj )
 
 
 // ============================================================== _onSelectionChanged
-
+/*
+ * Puts elements selected in the model (treeview) in the corresponding
+ * line edit widget (the one that has the focus) of the current dialog box.
+ */
 bool HexaBaseDialog::_onSelectionChanged( const QItemSelection& sel, QLineEdit*  le )
 {
        MESSAGE("HexaBaseDialog::_onSelectionChanged(const QItemSelection& sel, QLineEdit*  le)");
@@ -472,20 +575,28 @@ bool HexaBaseDialog::_onSelectionChanged( const QItemSelection& sel, QLineEdit*
                MESSAGE("*  bad selection : " << selType << " is not  " << wType );
                SUIT_MessageBox::information( 0,
                                tr("HEXA_INFO"),
-                               tr("%1: Bad type selected\nPlease select a %2.").arg(windowTitle()).arg( _strHexaWidgetType[wType]) );
+                               tr("%1: Bad type selected\nPlease select a %2.").arg(windowTitle()).arg(_strHexaWidgetType[wType]));
                return false;
        }
 
        //fill the lineEdit if selection is OK
-       le->setText( selected.data().toString() );// name
+       le->setText( selected.data().toString() );// namee
        le->setProperty("QModelIndex",  QVariant::fromValue(selected) );
        _index[le] = selected;
+
+       QLineEdit* lineEdit = dynamic_cast<QLineEdit*>(_currentObj);
+       if (selected.isValid() && lineEdit != NULL)
+               setFocusToNextField();
+
        MESSAGE("}");
        return true;
 }
 
-
 // ============================================================== _onSelectionChanged
+/*
+ * Puts elements selected in the model (treeview) in the corresponding list widget
+ * of the current dialog box.
+ */
 bool HexaBaseDialog::_onSelectionChanged( const QItemSelection& sel, QListWidget* lw )
 {
        MESSAGE("HexaBaseDialog::_onSelectionChanged( const QItemSelection& sel, QListWidget* lw )");
@@ -520,6 +631,7 @@ bool HexaBaseDialog::_onSelectionChanged( const QItemSelection& sel, QListWidget
                if ( twice.count() == 0 ){
                        item = new QListWidgetItem( selName );
                        item->setData(  LW_QMODELINDEX_ROLE, QVariant::fromValue<QModelIndex>(isel) );
+                       item->setData(LW_DATA_ROLE, isel.data(HEXA_DATA_ROLE));
                        lw->addItem(item);
                        updateButtonBox();
                }
@@ -528,52 +640,11 @@ bool HexaBaseDialog::_onSelectionChanged( const QItemSelection& sel, QListWidget
        return true;
 }
 
-// ============================================================== onCurrentSelectionChanged
-void HexaBaseDialog::onCurrentSelectionChanged()
-{
-}
-
-
-// ============================================================== setDocumentModel
-void HexaBaseDialog::setDocumentModel(DocumentModel* m)
-{
-       _documentModel = m;
-}
-
-// ============================================================== clear
-void HexaBaseDialog::clear()
-{
-}
-
-
-// ============================================================== setPatternDataSelectionModel
-void HexaBaseDialog::setPatternDataSelectionModel(PatternDataSelectionModel* s)
-{
-       _patternDataSelectionModel = s;
-}
-
-
-// ============================================================== setPatternBuilderSelectionModel
-void HexaBaseDialog::setPatternBuilderSelectionModel(PatternBuilderSelectionModel* s)
-{
-       _patternBuilderSelectionModel = s;
-}
-
-// ============================================================== setGroupsSelectionModel
-void HexaBaseDialog::setGroupsSelectionModel( GroupsSelectionModel* s )
-{
-       _groupsSelectionModel = s;
-}
-
-
-// ============================================================== setMeshSelectionModel
-void HexaBaseDialog::setMeshSelectionModel( MeshSelectionModel* s )
-{
-       _meshSelectionModel = s;
-}
-
-
 // ============================================================== onSelectionChanged
+/*
+ * Puts elements selected in the model in the corresponding widget (list widget or line edit)
+ * of the current dialog box.
+ */
 void HexaBaseDialog::onSelectionChanged( const QItemSelection& sel, const QItemSelection& unsel )
 {
        MESSAGE( "HexaBaseDialog::onSelectionChanged(){" );
@@ -585,7 +656,7 @@ void HexaBaseDialog::onSelectionChanged( const QItemSelection& sel, const QItemS
        MESSAGE( "*  _groupsSelectionModel         : " << _groupsSelectionModel );
        MESSAGE( "*  _meshSelectionModel           : " << _meshSelectionModel );
 
-
+//     highlightSelectedAssocs();
        QItemSelectionModel* selector = dynamic_cast<QItemSelectionModel*>(sender());
        MESSAGE( "*  selector           : " << selector);
 
@@ -596,14 +667,52 @@ void HexaBaseDialog::onSelectionChanged( const QItemSelection& sel, const QItemS
                MESSAGE("*  unselected : " << iunsel.data().toString().toStdString());
        }
 
-       if ( _selectionMutex )
-               return;
+       //type of the selected item
+       QModelIndexList itemsIndexes = sel.indexes();
+       if ( itemsIndexes.count() == 0 ) return;
+
+       //type from selection (first)
+       QModelIndex selected = itemsIndexes[0];
+       int selType = selected.data(HEXA_TREE_ROLE).toInt();
+
+       switch(selType){
+       case VERTEX_TREE:
+               if (currentOCCSelectionMode != TopAbs_VERTEX)
+               {
+//                     if (HEXABLOCKGUI::currentOccView != NULL) HEXABLOCKGUI::currentOccView->setFocus();
+                       setOCCSelectionMode(TopAbs_VERTEX);
+               }
+               _patternDataSelectionModel->highlightEltsWithAssocs(itemsIndexes);
+               break;
+       case EDGE_TREE:
+               if (currentOCCSelectionMode != TopAbs_EDGE)
+               {
+//                     if (HEXABLOCKGUI::currentOccView != NULL) HEXABLOCKGUI::currentOccView->setFocus();
+                       setOCCSelectionMode(TopAbs_EDGE);
+               }
+               _patternDataSelectionModel->highlightEltsWithAssocs(itemsIndexes);
+               break;
+       case QUAD_TREE:
+               if (currentOCCSelectionMode != TopAbs_FACE)
+               {
+//                     if (HEXABLOCKGUI::currentOccView != NULL) HEXABLOCKGUI::currentOccView->setFocus();
+                       setOCCSelectionMode(TopAbs_FACE);
+               }
+               _patternDataSelectionModel->highlightEltsWithAssocs(itemsIndexes);
+               break;
+       case HEXA_TREE:
+               _patternDataSelectionModel->highlightEltsWithAssocs(itemsIndexes);
+               break;
+       }
+
+       if ( _selectionMutex ) return;
 
 
        bool selOk = false;
-       QLineEdit*   aLineEdit   = 0;
-       QListWidget* aListWidget = 0;
+       QLineEdit*   aLineEdit   = NULL;
+       QListWidget* aListWidget = NULL;
        aLineEdit = dynamic_cast<QLineEdit*>(_currentObj);
+
        if ( aLineEdit){ //fill the lineedit with selection
                selOk = _onSelectionChanged( sel, aLineEdit );
        }
@@ -619,44 +728,6 @@ void HexaBaseDialog::onSelectionChanged( const QItemSelection& sel, const QItemS
        MESSAGE("}");
 }
 
-// ============================================================== onWindowActivated
-void HexaBaseDialog::onWindowActivated( SUIT_ViewManager* vm )
-{
-}
-
-// ============================================================== hideEvent
-void HexaBaseDialog::hideEvent ( QHideEvent * event )
-{
-       MESSAGE("HexaBaseDialog::hideEvent(){");
-       QString className = metaObject()->className();
-       MESSAGE( "*  I am                          : " << className.toStdString() );
-
-       if ( _patternDataSelectionModel )
-               disconnect( _patternDataSelectionModel, SIGNAL( selectionChanged ( const QItemSelection &, const QItemSelection &) ),
-                               this,                         SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
-       if ( _patternBuilderSelectionModel )
-               disconnect( _patternBuilderSelectionModel, SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ),
-                               this,                            SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
-       if ( _groupsSelectionModel )
-               disconnect( _groupsSelectionModel, SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ),
-                               this,                    SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
-       if ( _meshSelectionModel )
-               disconnect( _meshSelectionModel, SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ),
-                               this,                SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
-       //   if ( _mgr )
-       //     disconnect( _mgr, 0/*SIGNAL(currentSelectionChanged())*/, this, 0/*SLOT(onCurrentSelectionChanged())*/ );
-       disconnect( HEXABLOCKGUI::selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(onCurrentSelectionChanged()) );
-       if ( _vtkVm )
-               disconnect( _vtkVm, SIGNAL( activated(SUIT_ViewManager*) ), this, SLOT( onWindowActivated(SUIT_ViewManager*) ) );
-       if ( _occVm )
-               disconnect( _occVm, SIGNAL( activated(SUIT_ViewManager*) ), this, SLOT( onWindowActivated(SUIT_ViewManager*) ) );
-
-       _documentModel->allowEdition();
-
-       QDialog::hideEvent( event );
-       MESSAGE("}");
-}
-
 // ============================================================== showEvent
 void HexaBaseDialog::showEvent( QShowEvent * event )
 {
@@ -664,6 +735,7 @@ void HexaBaseDialog::showEvent( QShowEvent * event )
        QString className = metaObject()->className();
        MESSAGE( "*  I am                          : " << className.toStdString() );
 
+
        if ( _editMode == INFO_MODE ){
                _documentModel->allowEdition();
        } else {
@@ -690,25 +762,51 @@ void HexaBaseDialog::showEvent( QShowEvent * event )
                connect( _meshSelectionModel, SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ),
                                this,                SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
        }
-       if ( _mgr )
-               connect( _mgr, SIGNAL(currentSelectionChanged()), this, SLOT(onCurrentSelectionChanged()) );
 
-       if ( _vtkVm )
-               connect( _vtkVm, SIGNAL( activated(SUIT_ViewManager*) ), this, SLOT( onWindowActivated(SUIT_ViewManager*) ) );
-       if ( _occVm )
-               connect( _occVm, SIGNAL( activated(SUIT_ViewManager*) ), this, SLOT( onWindowActivated(SUIT_ViewManager*) ) );
+       connect( HEXABLOCKGUI::selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(onCurrentSelectionChanged()) );
+       connect( _vtkVm, SIGNAL( activated(SUIT_ViewManager*) ), this, SLOT( onWindowActivated(SUIT_ViewManager*) ) );
+       connect( _occVm, SIGNAL( activated(SUIT_ViewManager*) ), this, SLOT( onWindowActivated(SUIT_ViewManager*) ) );
 
        QDialog::showEvent ( event );
        MESSAGE("}");
 }
 
 
+// ============================================================== hideEvent
+void HexaBaseDialog::hideEvent ( QHideEvent * event )
+{
+       MESSAGE("HexaBaseDialog::hideEvent(){");
+       QString className = metaObject()->className();
+       MESSAGE( "*  I am                          : " << className.toStdString() );
+
+       if ( _patternDataSelectionModel!=NULL )
+               disconnect( _patternDataSelectionModel, SIGNAL( selectionChanged ( const QItemSelection &, const QItemSelection &) ),
+                               this,                         SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
+       if ( _patternBuilderSelectionModel!=NULL )
+               disconnect( _patternBuilderSelectionModel, SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ),
+                               this,                            SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
+       if ( _groupsSelectionModel!=NULL )
+               disconnect( _groupsSelectionModel, SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ),
+                               this,                    SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
+       if ( _meshSelectionModel!=NULL)
+               disconnect( _meshSelectionModel, SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ),
+                               this,                SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
+       disconnect(  HEXABLOCKGUI::selectionMgr() , SIGNAL(currentSelectionChanged()), this, SLOT(onCurrentSelectionChanged()) );
+       disconnect( _vtkVm, SIGNAL( activated(SUIT_ViewManager*) ), this, SLOT( onWindowActivated(SUIT_ViewManager*) ) );
+       disconnect( _occVm, SIGNAL( activated(SUIT_ViewManager*) ), this, SLOT( onWindowActivated(SUIT_ViewManager*) ) );
+
+       _documentModel->allowEdition();
+
+       QDialog::hideEvent( event );
+       MESSAGE("}");
+}
 
 // ============================================================== updateButtonBox
 void HexaBaseDialog::updateButtonBox()
 {
 }
 
+// ============================================================== updateButtonBox
 void HexaBaseDialog::updateName()
 {
        if (!_documentModel) return;
@@ -731,6 +829,10 @@ void HexaBaseDialog::updateName()
 
 
 // ============================================================== selectElementOfModel
+
+/*Selects in the model (treeview) elements selected in a listwidget,
+ *  or an element in a line edit.*/
+
 void HexaBaseDialog::selectElementOfModel()
 {
        MESSAGE("HexaBaseDialog::selectElementOfModel()");
@@ -745,35 +847,77 @@ void HexaBaseDialog::selectElementOfModel()
        QModelIndex index;
        _patternDataSelectionModel->clearSelection();
        foreach ( QListWidgetItem *item, sel ){
-               MESSAGE( "*  selecting the element : " << index.data().toString().toStdString() );
-               index = item->data(LW_QMODELINDEX_ROLE).value<QModelIndex>();
+//             index = item->data(LW_QMODELINDEX_ROLE).value<QModelIndex>(); //unsafe
+               index = _patternDataSelectionModel->indexBy(HEXA_DATA_ROLE, item->data(LW_DATA_ROLE));
                if ( index.isValid() )
+               {
+                       MESSAGE( "*  selecting the element : " << index.data().toString().toStdString() );
                        _patternDataSelectionModel->select( index, QItemSelectionModel::Select );
+               }
        }
        _selectionMutex = false;
 
        MESSAGE("}");
 }
 
+// ============================================================== _isLineOrListWidget
+/*
+ * Return true is the widget is a line or a list
+ * false otherwise.
+ */
+bool HexaBaseDialog::_isLineOrListWidget(QObject *widget)
+{
+       if (widget == NULL) return false;
+
+       QLineEdit       *lineEdit = dynamic_cast<QLineEdit*>(widget);
+       QListWidget *listWidget = dynamic_cast<QListWidget*>(widget);
+       return (lineEdit != NULL) || (listWidget != NULL);
+
+}//_isLineOrListWidget
+
+
+// ============================================================== _highlightWidget
+/*
+ * Highlight the given widget with the given color.
+ */
+void HexaBaseDialog::_highlightWidget(QObject *obj, Qt::GlobalColor clr)
+{
+       if (!_isLineOrListWidget(obj)) return;
+
+       QWidget *widget = dynamic_cast<QWidget*>(obj); //sure it's not NULL (_isLineOrListWidget(obj))
+       QPalette palette1 = widget->palette();
+       palette1.setColor(widget->backgroundRole(), clr);
+       widget->setPalette(palette1);
+
+}//_highlightWidget
+
+
+// ============================================================== _updateCurrentObject
+void HexaBaseDialog::_updateCurrentObject(QObject* obj)
+{
+       _highlightWidget(_currentObj, Qt::white);
+       _currentObj = obj;
+       _highlightWidget(obj, Qt::yellow);
+}
+
+
 // ============================================================== eventFilter
+/*
+ * Handles events from the treeview and the dialog boxes.
+ */
 bool HexaBaseDialog::eventFilter(QObject *obj, QEvent *event)
 {
+//     highlightSelectedAssocs();
        QLineEdit       *lineEdit = dynamic_cast<QLineEdit*>(obj);
        QListWidget *listWidget = dynamic_cast<QListWidget*>(obj);
        HexaBaseDialog  *dialog = dynamic_cast<HexaBaseDialog*>(obj);
 
-       if ( event->type() == QEvent::FocusIn ){
-               QString className  = obj->metaObject()->className();
-               QString objectName = obj->objectName();
-               MESSAGE("QEvent::FocusIn : I am "<< objectName.toStdString() );
-               MESSAGE("QEvent::FocusIn : I am "<< className.toStdString() );
-
-               // Highlight the input widget
-               if ( lineEdit || listWidget ){
-                       QWidget* w = dynamic_cast<QWidget*>(obj);
-                       QPalette palette1 = w->palette();
-                       palette1.setColor(w->backgroundRole(), Qt::yellow);
-                       w->setPalette(palette1);
+       if ( event->type() == QEvent::KeyPress )
+       {
+               if ( ((QKeyEvent*)event)->key() == Qt::Key_Return)
+               {
+                       setFocusToNextField();
+                       return true;
                }
        }
 
@@ -782,58 +926,77 @@ bool HexaBaseDialog::eventFilter(QObject *obj, QEvent *event)
                QString objectName = obj->objectName();
                MESSAGE("QEvent::FocusOut : I am "<< objectName.toStdString() );
                MESSAGE("QEvent::FocusOut : I am "<< className.toStdString() );
-
-               // UnHighlight the input widget
-               if ( lineEdit || listWidget ){
-                       QWidget* w = dynamic_cast<QWidget*>(obj);
-                       QPalette palette1 = w->palette();
-                       palette1.setColor(w->backgroundRole(), Qt::white);
-                       w->setPalette(palette1);
-               }
        }
 
-       if ( event->type() != QEvent::FocusIn ){ //QEvent::KeyPress) {
-               return false;
-               //              return QObject::eventFilter(obj, event);
+       if ( event->type() == QEvent::FocusIn ){
+               QString className  = obj->metaObject()->className();
+               QString objectName = obj->objectName();
+               MESSAGE("QEvent::FocusIn : I am "<< objectName.toStdString() );
+               MESSAGE("QEvent::FocusIn : I am "<< className.toStdString() );
+
        }
+       else return false;
+
 
        MESSAGE("HexaBaseDialog::eventFilter{");
        MESSAGE("*  QEvent::FocusIn");
 
        /* ON FOCUS ON A WIDGET*/
+
        QVariant v;
        QModelIndex index;
 
-
        QItemSelectionModel *selector = 0;
-       _allowVTKSelection( obj );
+
+       //vtk selection
+       if (getObjectViewType(obj) == VTK)
+               _allowVTKSelection( obj );
 
        //geom selection
-       _allowOCCSelection( obj );
+       if (getObjectViewType(obj) == OCC)
+               _allowOCCSelection( obj );
+
+       //If the widget is a geom line edit highlight its content in the occ view
+       if (lineEdit != NULL && _patternDataSelectionModel != NULL &&
+                       getObjectViewType(obj) == OCC && !lineEdit->text().isEmpty())
+       {
+               //highlight element in the OCC View
+               QMultiMap<QString, int> geomElts;
+               DocumentModel::GeomObj geomObj;
+               QVariant v = lineEdit->property("GeomObj");
+               if ( v.isValid() )
+               {
+                       geomObj = v.value<DocumentModel::GeomObj>();
+                       geomElts.insert( geomObj.entry, geomObj.subid.toInt() );
+               }
+               _patternDataSelectionModel->_highlightGEOM(geomElts);
+       }
 
        //Depending of focused widget type, get the right selector for it
        selector = _getSelector( obj );
-       if ( !selector ) return false;
+       if ( selector == NULL )
+       {
+               _updateCurrentObject(obj);
+               return false;
+       }
 
-       // Highlight the input widget
-       if ( _currentObj != obj && (lineEdit || listWidget) ){
+       if ( _currentObj != obj && (lineEdit || listWidget) )
                selector->clearSelection();
-       }
-       _currentObj = obj;
 
+       _updateCurrentObject(obj);
 
        //If there is a current selection fill the widget with it
        if ( selector->hasSelection() ){
-               QItemSelection currentSelection  = selector->selection();
-               bool selOk = false;
-               if ( lineEdit ){ //element can be from lineEdit
-                       selOk = _onSelectionChanged( currentSelection, lineEdit );
-               } else if ( listWidget ){
-                       selOk = _onSelectionChanged( currentSelection, listWidget );
-               }
-               if ( !selOk &&  ( lineEdit || listWidget ) ){
-                       selector->clearSelection();
-               }
+//             QItemSelection currentSelection  = selector->selection();
+//             bool selOk = false;
+//             if ( lineEdit ){ //element can be from lineEdit
+//                     selOk = _onSelectionChanged( currentSelection, lineEdit );
+//             } else if ( listWidget ){
+//                     selOk = _onSelectionChanged( currentSelection, listWidget );
+//             }
+//             if ( !selOk &&  ( lineEdit || listWidget ) ){
+//                     selector->clearSelection();
+//             }
 
        } else { //If the widget contains an hexa element, select it in model/view
                if ( lineEdit ){ //element can be from lineEdit
@@ -857,7 +1020,6 @@ bool HexaBaseDialog::eventFilter(QObject *obj, QEvent *event)
                        _selectionMutex = false;
                }
 
-
                if ( dialog ){ //element can be from a dialog box
                        MESSAGE("*  on Dialog");
                        v = dialog->property("QModelIndex");
@@ -874,7 +1036,7 @@ bool HexaBaseDialog::eventFilter(QObject *obj, QEvent *event)
                }
 
        }
-       MESSAGE("}");
+       MESSAGE("eventFilter}");
        return false;
 }
 
@@ -916,7 +1078,7 @@ void VertexDialog::_initInputWidget( Mode editmode )
        name_le->setProperty( "HexaWidgetType",  QVariant::fromValue(VERTEX_TREE) );
        name_le->installEventFilter(this);
 
-       connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()));
+       //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()));
 }
 
 // ============================================================== clear
@@ -960,12 +1122,14 @@ HEXA_NS::Vertex* VertexDialog::getValue()
 // ============================================================== apply
 bool VertexDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        if ( !_documentModel ) return false;
        if ( !_patternDataSelectionModel ) return false;
        const PatternDataModel* patternDataModel = dynamic_cast<const PatternDataModel*>( _patternDataSelectionModel->model() );
        if ( !patternDataModel ) return false;
-       _currentObj = NULL;
 
        bool isOk = false;
 
@@ -1013,16 +1177,16 @@ EdgeDialog::EdgeDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ):
        setupUi( this );
        _initWidget(editmode);
 
-       rb0->setFocusProxy( v0_le_rb0 );
-       rb1->setFocusProxy( vex_le_rb1 );
-       rb0->click();
+//     rb0->setFocusProxy( v0_le_rb0 );
+//     rb1->setFocusProxy( vex_le_rb1 );
 
        if  ( editmode == INFO_MODE ){
                setWindowTitle( tr("Edge Information") );
                rb1->hide();
        }
-}
 
+       rb0->click();
+}
 
 
 // ============================================================== Destructeur
@@ -1057,7 +1221,13 @@ void EdgeDialog::_initInputWidget( Mode editmode )
        vex_le_rb1->installEventFilter(this);
        vec_le_rb1->installEventFilter(this);
 
-       connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()) );
+       v0_le_rb0->setReadOnly(true);
+       v1_le_rb0->setReadOnly(true);
+       vex_le_rb1->setReadOnly(true);
+       vec_le_rb1->setReadOnly(true);
+
+       //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()) );
+
 }
 
 
@@ -1078,6 +1248,9 @@ void EdgeDialog::setValue(HEXA_NS::Edge* e)
 {
        HEXA_NS::Vertex* v0 = e->getVertex(0);
        HEXA_NS::Vertex* v1 = e->getVertex(1);
+//     HEXA_NS::EltBase* e0 = e;
+//     HEXA_NS::EltBase* v0 = e->getVertex(0);
+//     HEXA_NS::EltBase* v1 = e->getVertex(1);
 
        name_le->setText( e->getName() );
        v0_le_rb0->setText( v0->getName() );
@@ -1105,6 +1278,9 @@ HEXA_NS::Edge* EdgeDialog::getValue()
 // ============================================================== apply
 bool EdgeDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        //if ( !_documentModel ) return;
        if ( !_patternDataSelectionModel )    return false;
@@ -1113,7 +1289,6 @@ bool EdgeDialog::apply(QModelIndex& result)
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternDataModel ) return false;
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        QModelIndex iEdge;
 
@@ -1157,8 +1332,8 @@ QuadDialog::QuadDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ):
        _helpFileName = "gui_quadrangle.html";
        setupUi( this );
        _initWidget(editmode);
-       rb0->setFocusProxy( v0_le_rb0 );
-       rb1->setFocusProxy( e0_le_rb1 );
+//     rb0->setFocusProxy( v0_le_rb0 );
+//     rb1->setFocusProxy( e0_le_rb1 );
        rb0->click();
 
        if  ( editmode == INFO_MODE ){
@@ -1212,7 +1387,17 @@ void QuadDialog::_initInputWidget( Mode editmode )
        e2_le_rb1->installEventFilter(this);
        e3_le_rb1->installEventFilter(this);
 
-       connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()) );
+       v0_le_rb0->setReadOnly(true);
+       v1_le_rb0->setReadOnly(true);
+       v2_le_rb0->setReadOnly(true);
+       v3_le_rb0->setReadOnly(true);
+
+       e0_le_rb1->setReadOnly(true);
+       e1_le_rb1->setReadOnly(true);
+       e2_le_rb1->setReadOnly(true);
+       e3_le_rb1->setReadOnly(true);
+
+       //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()) );
 }
 
 
@@ -1304,12 +1489,14 @@ HEXA_NS::Quad* QuadDialog::getValue()
 // ============================================================== apply
 bool QuadDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        //if ( !_documentModel ) return;
        if ( !_patternDataSelectionModel ) return false;
        const PatternDataModel* patternDataModel = dynamic_cast<const PatternDataModel*>( _patternDataSelectionModel->model() );
        if ( !patternDataModel ) return false;
-       _currentObj = NULL;
 
        QModelIndex iQuad;
 
@@ -1368,8 +1555,8 @@ HexaDialog::HexaDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ):
        _helpFileName = "gui_hexahedron.html";
        setupUi( this );
        _initWidget(editmode);
-       quads_rb->setFocusProxy( quads_lw );
-       vertices_rb->setFocusProxy( vertices_lw );
+//     quads_rb->setFocusProxy( quads_lw );
+//     vertices_rb->setFocusProxy( vertices_lw );
        quads_rb->click();
        //   quads_rb->setFocus();
 
@@ -1413,7 +1600,7 @@ void HexaDialog::_initInputWidget( Mode editmode )
                connect(delVertexShortcut, SIGNAL(activated()), this, SLOT(deleteVertexItem()));
        }
        // edit name
-       connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()) );
+       //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()) );
        // highlight item on model view (VTK) from listwidget
        connect( quads_lw,    SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()) );
        connect( vertices_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()) );
@@ -1427,6 +1614,46 @@ void HexaDialog::clear()
        vertices_lw->clear();
 }
 
+// ============================================================== getAssocsVTK
+/*
+ * Returns elements currently associated to vtk
+ */
+QModelIndexList HexaDialog::getAssocsVTK()
+{
+       QModelIndexList assocs;
+       QModelIndex iQuad, iVertex;
+       QListWidgetItem* item = NULL;
+
+       if (quads_rb->isChecked())
+       {
+               //ListWidget content
+               const PatternDataModel* patternDataModel = dynamic_cast<const PatternDataModel*>( _patternDataSelectionModel->model() );
+               if ( !patternDataModel ) return assocs;
+               for ( int r = 0; r < quads_lw->count(); ++r ){
+                       item = quads_lw->item(r);
+                       iQuad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value<QModelIndex>() );
+                       if ( iQuad.isValid() )
+                               assocs << iQuad;
+               }
+               return assocs;
+       }
+       else if (vertices_rb->isChecked())
+       {
+               //ListWidget content
+               const PatternDataModel* patternDataModel = dynamic_cast<const PatternDataModel*>( _patternDataSelectionModel->model() );
+               if ( !patternDataModel ) return assocs;
+               for ( int r = 0; r < vertices_lw->count(); ++r ){
+                       item = vertices_lw->item(r);
+                       iVertex = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value<QModelIndex>() );
+                       if ( iVertex.isValid() )
+                               assocs << iVertex;
+               }
+               return assocs;
+       }
+       else return assocs;
+}
+
+
 // ============================================================== updateButtonBox
 void HexaDialog::updateButtonBox()
 {
@@ -1533,12 +1760,14 @@ HEXA_NS::Hexa* HexaDialog::getValue()
 // ============================================================== apply
 bool HexaDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        if ( !_documentModel ) return false;
        if ( !_patternDataSelectionModel ) return false;
        const PatternDataModel* patternDataModel = dynamic_cast<const PatternDataModel*>( _patternDataSelectionModel->model() );
        if ( !patternDataModel ) return false;
-       _currentObj = NULL;
 
        QModelIndex  iHexa;
 
@@ -1595,8 +1824,8 @@ VectorDialog::VectorDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ):
        setupUi( this );
        _initWidget(editmode);
 
-       rb0->setFocusProxy( dx_spb_rb0 );
-       rb1->setFocusProxy( v0_le_rb1 );
+//     rb0->setFocusProxy( dx_spb_rb0 );
+//     rb1->setFocusProxy( v0_le_rb1 );
        rb0->click();
        //   setFocusProxy( rb0 );
 
@@ -1637,7 +1866,10 @@ void VectorDialog::_initInputWidget( Mode editmode )
                dz_spb_rb0->setReadOnly(true);
        }
 
-       connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()) );
+       v0_le_rb1->setReadOnly(true);
+       v1_le_rb1->setReadOnly(true);
+
+       //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()) );
 }
 
 // ============================================================== clear
@@ -1675,6 +1907,9 @@ HEXA_NS::Vector* VectorDialog::getValue()
 // ============================================================== apply
 bool VectorDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        if ( !_documentModel ) return false;
        if ( !_patternDataSelectionModel )  return false;
@@ -1683,7 +1918,6 @@ bool VectorDialog::apply(QModelIndex& result)
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternDataModel ) return false;
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        QModelIndex iVector;
 
@@ -1761,7 +1995,10 @@ void CylinderDialog::_initInputWidget( Mode editmode )
        vex_le->installEventFilter(this);
        vec_le->installEventFilter(this);
 
-       connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()));
+       vex_le->setReadOnly(true);
+       vec_le->setReadOnly(true);
+
+       //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()));
 }
 
 // ============================================================== clear
@@ -1811,6 +2048,9 @@ HEXA_NS::Cylinder* CylinderDialog::getValue()
 // ============================================================== apply
 bool CylinderDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        if ( !_documentModel ) return false;
        if ( !_patternDataSelectionModel ) return false;
@@ -1819,7 +2059,6 @@ bool CylinderDialog::apply(QModelIndex& result)
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternDataModel ) return false;
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        QModelIndex iCyl;
        QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le] );
@@ -1904,7 +2143,10 @@ void PipeDialog::_initInputWidget( Mode editmode )
                h_spb->setReadOnly(true);
        }
 
-       connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()));
+       vex_le->setReadOnly(true);
+       vec_le->setReadOnly(true);
+
+       //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()));
 }
 
 
@@ -1954,6 +2196,9 @@ HEXA_NS::Pipe* PipeDialog::getValue()
 // ============================================================== apply
 bool PipeDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        //if ( !_documentModel ) return;
        if ( !_patternDataSelectionModel )    return false;
@@ -1962,7 +2207,6 @@ bool PipeDialog::apply(QModelIndex& result)
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternDataModel )    return false;
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        QModelIndex iPipe;
        QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le] );
@@ -2011,9 +2255,9 @@ MakeGridDialog::MakeGridDialog( QWidget* parent, Mode editmode, Qt::WindowFlags
        _initWidget(editmode);
        rb0->click();// Default : cartesian grid
        uniform_rb->click();
-       rb0->setFocusProxy( vex_le_rb0 );
-       rb1->setFocusProxy( center_le_rb1 );
-       rb2->setFocusProxy( vex_le_rb2 );
+//     rb0->setFocusProxy( vex_le_rb0 );
+//     rb1->setFocusProxy( center_le_rb1 );
+//     rb2->setFocusProxy( vex_le_rb2 );
        //   setFocusProxy( rb0 );
 
        _helpFileName = "creategrids.html#guicartgrid";
@@ -2059,7 +2303,6 @@ void MakeGridDialog::_initInputWidget( Mode editmode )
        vex_le_rb2->setValidator( validator );
        vex_le_rb2->installEventFilter(this);
 
-
        if ( editmode != INFO_MODE ){
                //Cylindrical
                radius_lw->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(radius_lw));
@@ -2079,8 +2322,16 @@ void MakeGridDialog::_initInputWidget( Mode editmode )
                connect( del_height_pb, SIGNAL(clicked()), this, SLOT(delHeightItem()) );
        }
 
+       vex_le_rb0->setReadOnly(true);
+       vec_le_rb0->setReadOnly(true);
+       vex_le_rb2->setReadOnly(true);
+       center_le_rb1->setReadOnly(true);
+       base_le_rb1->setReadOnly(true);
+       height_le_rb1->setReadOnly(true);
+
 }
 
+
 // ============================================================== clear
 void MakeGridDialog::clear()
 {
@@ -2209,6 +2460,9 @@ void MakeGridDialog::delHeightItem()
 // ============================================================== apply
 bool MakeGridDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        //if ( !_documentModel ) return;
        if ( !_patternDataSelectionModel )    return false;
@@ -2217,7 +2471,6 @@ bool MakeGridDialog::apply(QModelIndex& result)
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternDataModel )    return false;
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        QModelIndex iNewElts;
        if ( rb0->isChecked() ){ //cartesian
@@ -2256,23 +2509,32 @@ bool MakeGridDialog::apply(QModelIndex& result)
                        }
                        if ( random_rb->isChecked() ){
                                QListWidgetItem* item = NULL;
-                               QDoubleSpinBox*   spb = NULL;
+//                             QDoubleSpinBox*   spb = NULL;
 
                                QList<double> radius;
                                QList<double> angles;
                                QList<double> heights;
 
+                               double somme = 0.;
+                               for ( int r = 0; r < angle_lw->count(); ++r){
+                                       item = angle_lw->item(r);
+                                       angles << item->data(Qt::EditRole).toDouble();
+                                       somme += item->data(Qt::EditRole).toDouble();
+                               }
+                               if (somme > 360.)
+                               {
+                                       SUIT_MessageBox::information( 0,
+                                                       tr("HEXA_INFO"),
+                                                       tr("The sum of the picked angles has to be \nless or equal than %1 degrees.").arg(360));
+                                       return false;
+                               }
+
                                for ( int r = 0; r < radius_lw->count(); ++r){
                                        item = radius_lw->item(r);
                                        //std::cout << "radius : " << item->data(Qt::EditRole).toDouble()<< std::endl;
                                        radius << item->data(Qt::EditRole).toDouble();
                                }
 
-                               for ( int r = 0; r < angle_lw->count(); ++r){
-                                       item = angle_lw->item(r);
-                                       angles << item->data(Qt::EditRole).toDouble();
-                               }
-
                                for ( int r = 0; r < height_lw->count(); ++r){
                                        item = height_lw->item(r);
                                        heights << item->data(Qt::EditRole).toDouble();
@@ -2282,7 +2544,6 @@ bool MakeGridDialog::apply(QModelIndex& result)
                                                icenter_rb1, ibase_rb1, iheight_rb1,
                                                radius, angles, heights,
                                                fill ); //NEW HEXA3
-
                        }
                }
 
@@ -2303,7 +2564,6 @@ bool MakeGridDialog::apply(QModelIndex& result)
                return false;
        }
 
-
        // to select/highlight result
        result = patternBuilderModel->mapFromSource( iNewElts );
 
@@ -2342,6 +2602,9 @@ void MakeCylinderDialog::_initInputWidget( Mode editmode )
        vec_le->setValidator( validator );
        cyl_le->installEventFilter(this);
        vec_le->installEventFilter(this);
+
+       cyl_le->setReadOnly(true);
+       vec_le->setReadOnly(true);
 }
 
 // ============================================================== clear
@@ -2355,12 +2618,14 @@ void MakeCylinderDialog::clear()
 // ============================================================== apply
 bool MakeCylinderDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        //if ( !_documentModel ) return;
        if ( !_patternBuilderSelectionModel ) return false;
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        QModelIndex iElts;
        QModelIndex icyl = patternBuilderModel->mapToSource( _index[cyl_le] );
@@ -2422,6 +2687,11 @@ void MakePipeDialog::_initInputWidget( Mode editmode )
        pipe_le->installEventFilter(this);
        vec_le->installEventFilter(this);
 
+       pipe_le->setReadOnly(true);
+       vec_le->setReadOnly(true);
+
+
+
 }
 
 // ============================================================== clear
@@ -2435,12 +2705,14 @@ void MakePipeDialog::clear()
 // ============================================================== apply
 bool MakePipeDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        //if ( !_documentModel ) return;
        if ( !_patternBuilderSelectionModel ) return false;
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        QModelIndex iElts;
        QModelIndex ipipe = patternBuilderModel->mapToSource( _index[pipe_le] );
@@ -2498,6 +2770,9 @@ void MakeCylindersDialog::_initInputWidget( Mode editmode )
 
        cyl1_le->installEventFilter(this);
        cyl2_le->installEventFilter(this);
+
+       cyl1_le->setReadOnly(true);
+       cyl2_le->setReadOnly(true);
 }
 
 // ============================================================== clear
@@ -2511,12 +2786,14 @@ void MakeCylindersDialog::clear()
 // ============================================================== apply
 bool MakeCylindersDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        //if ( !_documentModel ) return;
        if ( !_patternBuilderSelectionModel ) return false;
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        QModelIndex iCrossElts;
        QModelIndex icyl1 = patternBuilderModel->mapToSource( _index[cyl1_le] );
@@ -2572,6 +2849,9 @@ void MakePipesDialog::_initInputWidget( Mode editmode )
 
        pipe1_le->installEventFilter(this);
        pipe2_le->installEventFilter(this);
+
+       pipe1_le->setReadOnly(true);
+       pipe2_le->setReadOnly(true);
 }
 
 
@@ -2586,12 +2866,14 @@ void MakePipesDialog::clear()
 // ============================================================== apply
 bool MakePipesDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        //if ( !_documentModel ) return;
        if ( !_patternBuilderSelectionModel ) return false;
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        QModelIndex iCrossElts;
        QModelIndex ipipe1 = patternBuilderModel->mapToSource( _index[pipe1_le] );
@@ -2639,6 +2921,9 @@ void RemoveHexaDialog::_initInputWidget( Mode editmode )
        hexa_le->setProperty( "HexaWidgetType",  QVariant::fromValue(HEXA_TREE) );
        hexa_le->setValidator( validator );
        hexa_le->installEventFilter(this);
+       hexa_le->setReadOnly(true);
+
+
 }
 
 // ============================================================== clear
@@ -2651,12 +2936,14 @@ void RemoveHexaDialog::clear()
 // ============================================================== apply
 bool RemoveHexaDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        //if ( !_documentModel ) return;
        if ( !_patternDataSelectionModel ) return false;
        const PatternDataModel*    patternDataModel = dynamic_cast<const PatternDataModel*>( _patternDataSelectionModel->model() );
        if ( !patternDataModel ) return false;
-       _currentObj = NULL;
 
        QModelIndex ihexa = patternDataModel->mapToSource( _index[hexa_le] );
 
@@ -2673,6 +2960,17 @@ bool RemoveHexaDialog::apply(QModelIndex& result)
                SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT REMOVE HEXA" ) );
                return false;
        }
+
+
+       //Update the line edit
+       QVariant invalid;
+       hexa_le->setProperty("QModelIndex",  invalid );
+
+       QModelIndex invalidIndex;
+       _index[hexa_le] = invalidIndex;
+
+       clear();
+
        return true;
 }
 
@@ -2687,7 +2985,10 @@ PrismQuadDialog::PrismQuadDialog( QWidget* parent, Mode editmode, Qt::WindowFlag
        _helpFileName = "gui_prism_join_quad.html#prism-quadrangles";
        setupUi( this );
        _initWidget(editmode);
-       setFocusProxy( quads_lw );
+//     setFocusProxy( quads_lw );
+//     connect( regular_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) );
+//     connect( irregular_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) );
+       regular_rb->click();
 }
 
 
@@ -2696,6 +2997,28 @@ PrismQuadDialog::~PrismQuadDialog()
 {
 }
 
+// ============================================================== getAssocsVTK
+/*
+ * Returns elements currently associated to vtk
+ */
+QModelIndexList PrismQuadDialog::getAssocsVTK()
+{
+       QModelIndexList assocs;
+       QModelIndex iQuad;
+       QListWidgetItem* item = NULL;
+
+       //ListWidget content
+       const PatternDataModel* patternDataModel = dynamic_cast<const PatternDataModel*>( _patternDataSelectionModel->model() );
+       if ( !patternDataModel ) return assocs;
+       for ( int r = 0; r < quads_lw->count(); ++r ){
+               item = quads_lw->item(r);
+               iQuad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value<QModelIndex>() );
+               if ( iQuad.isValid() )
+                       assocs << iQuad;
+       }
+       return assocs;
+}
+
 
 // ============================================================== _initInputWidget
 void PrismQuadDialog::_initInputWidget( Mode editmode )
@@ -2720,7 +3043,13 @@ void PrismQuadDialog::_initInputWidget( Mode editmode )
                connect( delQuadShortcut, SIGNAL(activated()), this, SLOT(removeQuad()) );
        }
 
+       vec_le->setReadOnly(true);
+
        connect( quads_lw,    SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()) );
+       height_lw->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(height_lw));
+       height_lw->setEditTriggers(QAbstractItemView::DoubleClicked);
+       connect( add_height_pb, SIGNAL(clicked()), this, SLOT(addHeightItem()) );
+       connect( del_height_pb, SIGNAL(clicked()), this, SLOT(delHeightItem()) );
 }
 
 // ============================================================== clear
@@ -2749,10 +3078,38 @@ void PrismQuadDialog::removeQuad()
 //     quads_lw->clear();
 // }
 
+// ============================================================== addHeightItem
+void PrismQuadDialog::addHeightItem()
+{
+       QListWidgetItem* previousItem = height_lw->currentItem();
+       QListWidgetItem* newItem      = new QListWidgetItem();
+
+       double defaultValue = 0.;
+       if ( previousItem )
+               defaultValue = previousItem->data(Qt::EditRole).toDouble();
+
+       newItem->setData(  Qt::EditRole, QVariant(defaultValue) );
+       newItem->setFlags( newItem->flags () | Qt::ItemIsEditable);
+       height_lw->addItem(newItem);
+
+//     updateButtonBox();
+}
+
+// ============================================================== delHeightItem
+void PrismQuadDialog::delHeightItem()
+{
+       delete height_lw->currentItem();
+//     updateButtonBox();
+}
+
+
 
 // ============================================================== apply
 bool PrismQuadDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        //if ( !_documentModel ) return;
        if ( !_patternDataSelectionModel )    return false;
@@ -2761,26 +3118,39 @@ bool PrismQuadDialog::apply(QModelIndex& result)
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternDataModel )    return false;
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        /////
-       QModelIndexList iquads;
-       QModelIndex     iquad;
-       QListWidgetItem* item = NULL;
-       for ( int r = 0; r < quads_lw->count(); ++r){
-               item = quads_lw->item(r);
-               iquad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value<QModelIndex>() );
-               iquads << iquad;
-       }
+       QModelIndexList iquads = getIndexList(quads_lw);
        QModelIndex ivec  = patternBuilderModel->mapToSource( _index[vec_le] );
 
        QModelIndex iElts;
        if ( ivec.isValid() ){
-               int nb = nb_spb->value();
-               if ( iquads.count() == 1 ){
-                       iElts = _documentModel->prismQuad( iquads[0], ivec, nb );
-               } else if ( iquads.count() > 1 ){
-                       iElts = _documentModel->prismQuads( iquads, ivec, nb );
+               if (regular_rb->isChecked())
+               {
+                       int nb = nb_spb->value();
+                       if ( iquads.count() == 1 ){
+                               iElts = _documentModel->prismQuad( iquads[0], ivec, nb );
+                       } else if ( iquads.count() > 1 ){
+                               iElts = _documentModel->prismQuads( iquads, ivec, nb );
+                       }
+               }
+               else //irregular_rb is checked
+               {
+                       QVector<double> heights;
+                       QListWidgetItem* item = NULL;
+                       unsigned int nbItems = height_lw->count();
+
+                       for ( int r = 0; r < nbItems; ++r){
+                               item = height_lw->item(r);
+                               heights << item->data(Qt::EditRole).toDouble();
+                       }
+                       if (iquads.count() == 0 || heights.size() == 0)
+                       {
+                               SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ),
+                                               tr( "Parameters are invalid!" ) );
+                               return false;
+                       }
+                       iElts = _documentModel->prismQuads( iquads, ivec, heights.toStdVector()/*, nb*/ );
                }
        }
 
@@ -2813,6 +3183,28 @@ JoinQuadDialog::~JoinQuadDialog()
 {
 }
 
+// ============================================================== getAssocsVTK
+/*
+ * Returns elements currently associated to vtk
+ */
+QModelIndexList JoinQuadDialog::getAssocsVTK()
+{
+       QModelIndexList assocs;
+       QModelIndex iQuad;
+       QListWidgetItem* item = NULL;
+
+       //ListWidget content
+       const PatternDataModel* patternDataModel = dynamic_cast<const PatternDataModel*>( _patternDataSelectionModel->model() );
+       if ( !patternDataModel ) return assocs;
+       for ( int r = 0; r < quads_lw->count(); ++r ){
+               item = quads_lw->item(r);
+//             iQuad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value<QModelIndex>() ); //unsafe
+               iQuad = _patternDataSelectionModel->indexBy(HEXA_DATA_ROLE, item->data(LW_DATA_ROLE));
+               if ( iQuad.isValid() ) assocs << iQuad;
+       }
+       return assocs;
+}
+
 // ============================================================== _initInputWidget
 void JoinQuadDialog::_initInputWidget( Mode editmode )
 {
@@ -2847,6 +3239,15 @@ void JoinQuadDialog::_initInputWidget( Mode editmode )
                delQuadShortcut->setContext( Qt::WidgetShortcut );
                connect( delQuadShortcut,   SIGNAL(activated()), this, SLOT(removeQuad()) );
        }
+
+       vex0_le->setReadOnly(true);
+       vex1_le->setReadOnly(true);
+       vex2_le->setReadOnly(true);
+       vex3_le->setReadOnly(true);
+       quad_dest_le->setReadOnly(true);
+
+       _currentObj = quads_lw;
+
        connect( quads_lw,    SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()) );
 }
 
@@ -2858,7 +3259,6 @@ void JoinQuadDialog::clear()
        vex0_le->clear();
        vex2_le->clear();
 
-
        quad_dest_le->clear();
        vex1_le->clear();
        vex3_le->clear();
@@ -2888,6 +3288,9 @@ void JoinQuadDialog::removeQuad()
 // ============================================================== apply
 bool JoinQuadDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        //if ( !_documentModel ) return;
        if ( !_patternDataSelectionModel )    return false;
@@ -2896,7 +3299,6 @@ bool JoinQuadDialog::apply(QModelIndex& result)
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternDataModel )    return false;
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        /////
        QModelIndexList iquads;
@@ -2959,9 +3361,9 @@ MergeDialog::MergeDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f )
 {
        setupUi( this );
        _initWidget(editmode);
-       rb0->setFocusProxy( v0_le_rb0 );
-       rb1->setFocusProxy( e0_le_rb1 );
-       rb2->setFocusProxy( q0_le_rb2 );
+//     rb0->setFocusProxy( v0_le_rb0 );
+//     rb1->setFocusProxy( e0_le_rb1 );
+//     rb2->setFocusProxy( q0_le_rb2 );
        //   setFocusProxy( rb0 );
        rb0->click();
 
@@ -3027,6 +3429,23 @@ void MergeDialog::_initInputWidget( Mode editmode )
        v3_le_rb2->installEventFilter(this);
        q0_le_rb2->installEventFilter(this);
        q1_le_rb2->installEventFilter(this);
+
+       v0_le_rb0->setReadOnly(true);
+       v1_le_rb0->setReadOnly(true);
+
+       v0_le_rb1->setReadOnly(true);
+       v1_le_rb1->setReadOnly(true);
+       e0_le_rb1->setReadOnly(true);
+       e1_le_rb1->setReadOnly(true);
+
+       v0_le_rb2->setReadOnly(true);
+       v1_le_rb2->setReadOnly(true);
+       v2_le_rb2->setReadOnly(true);
+       v3_le_rb2->setReadOnly(true);
+       q0_le_rb2->setReadOnly(true);
+       q1_le_rb2->setReadOnly(true);
+
+
 }
 
 
@@ -3063,11 +3482,13 @@ void MergeDialog::updateHelpFileName()
 // ============================================================== apply
 bool MergeDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        if ( !_patternDataSelectionModel ) return false;
        const PatternDataModel*    patternDataModel = dynamic_cast<const PatternDataModel*>( _patternDataSelectionModel->model() );
        if ( !patternDataModel ) return false;
-       _currentObj = NULL;
 
        bool merged = false;
 
@@ -3129,10 +3550,10 @@ DisconnectDialog::DisconnectDialog( QWidget* parent, Mode editmode, Qt::WindowFl
 {
        setupUi( this );
        _initWidget(editmode);
-       rb0->setFocusProxy( v_le_rb0 );
-       rb1->setFocusProxy( e_le_rb1 );
-       rb2->setFocusProxy( q_le_rb2 );
-       rb3->setFocusProxy( d_edges_lw);
+//     rb0->setFocusProxy( v_le_rb0 );
+//     rb1->setFocusProxy( e_le_rb1 );
+//     rb2->setFocusProxy( q_le_rb2 );
+//     rb3->setFocusProxy( d_edges_lw);
        rb0->click();
        //   setFocusProxy( rb0 );
 
@@ -3193,6 +3614,15 @@ void DisconnectDialog::_initInputWidget( Mode editmode )
        delEdgeShortcut->setContext( Qt::WidgetShortcut );
        delHexaShortcut->setContext( Qt::WidgetShortcut );
 
+       v_le_rb0->setReadOnly(true);
+       h_le_rb0->setReadOnly(true);
+
+       e_le_rb1->setReadOnly(true);
+       h_le_rb1->setReadOnly(true);
+
+       q_le_rb2->setReadOnly(true);
+       h_le_rb2->setReadOnly(true);
+
        connect( d_edges_lw,   SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()) );
        connect( hexas_lw,   SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()) );
        connect( delEdgeShortcut, SIGNAL(activated()), this, SLOT(deleteEdgeItem()) );
@@ -3245,6 +3675,9 @@ void DisconnectDialog::updateHelpFileName()
 // ============================================================== apply
 bool DisconnectDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
 
        if ( !_patternDataSelectionModel )    return false;
@@ -3253,7 +3686,6 @@ bool DisconnectDialog::apply(QModelIndex& result)
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternDataModel )    return false;
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        QModelIndex iElts;
 
@@ -3349,6 +3781,8 @@ void CutEdgeDialog::_initInputWidget( Mode editmode )
        e_le->setProperty( "HexaWidgetType",  QVariant::fromValue(EDGE_TREE) );
        e_le->setValidator( validator );
        e_le->installEventFilter(this);
+
+       e_le->setReadOnly(true);
 }
 
 // ============================================================== clear
@@ -3361,6 +3795,9 @@ void CutEdgeDialog::clear()
 // ============================================================== apply
 bool CutEdgeDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        //if ( !_documentModel ) return;
        if ( !_patternDataSelectionModel )    return false;
@@ -3369,7 +3806,6 @@ bool CutEdgeDialog::apply(QModelIndex& result)
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternDataModel )    return false;
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        int nbCut = nb_cut_spb->value();
        QModelIndex iedge = patternDataModel->mapToSource( _index[e_le] );
@@ -3389,9 +3825,6 @@ bool CutEdgeDialog::apply(QModelIndex& result)
        return true;
 }
 
-
-
-
 // // ------------------------- MakeTransformationDialog ----------------------------------
 
 // ============================================================== Constructeur
@@ -3401,10 +3834,10 @@ MakeTransformationDialog::MakeTransformationDialog( QWidget* parent, Mode editmo
 {
        setupUi( this );
        _initWidget(editmode);
-       rb0->setFocusProxy( elts_le_rb0 );
-       rb1->setFocusProxy( elts_le_rb1 );
-       rb2->setFocusProxy( elts_le_rb2 );
-       setFocusProxy( rb0 );
+//     rb0->setFocusProxy( elts_le_rb0 );
+//     rb1->setFocusProxy( elts_le_rb1 );
+//     rb2->setFocusProxy( elts_le_rb2 );
+//     setFocusProxy( rb0 );
        rb0->click();
 
        _helpFileName = "gui_make_elmts.html#make-elements-by-translation";
@@ -3452,6 +3885,16 @@ void MakeTransformationDialog::_initInputWidget( Mode editmode )
        vec_le_rb2->installEventFilter(this);
        elts_le_rb2->installEventFilter(this);
 
+       vec_le_rb0->setReadOnly(true);
+       elts_le_rb0->setReadOnly(true);
+
+       vex_le_rb1->setReadOnly(true);
+       elts_le_rb1->setReadOnly(true);
+
+       vex_le_rb2->setReadOnly(true);
+       vec_le_rb2->setReadOnly(true);
+       elts_le_rb2->setReadOnly(true);
+
 }
 
 // ============================================================== clear
@@ -3482,6 +3925,9 @@ void MakeTransformationDialog::updateHelpFileName()
 // ============================================================== apply
 bool MakeTransformationDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        if ( !_patternDataSelectionModel )    return false;
        if ( !_patternBuilderSelectionModel ) return false;
@@ -3489,7 +3935,6 @@ bool MakeTransformationDialog::apply(QModelIndex& result)
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternDataModel )    return false;
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        QModelIndex iNewElts;
 
@@ -3532,8 +3977,6 @@ bool MakeTransformationDialog::apply(QModelIndex& result)
        return true;
 }
 
-
-
 // // ------------------------- MakeSymmetryDialog ----------------------------------
 
 // ============================================================== Constructeur
@@ -3543,9 +3986,9 @@ MakeSymmetryDialog::MakeSymmetryDialog( QWidget* parent, Mode editmode, Qt::Wind
 {
        setupUi( this );
        _initWidget(editmode);
-       rb0->setFocusProxy( elts_le_rb0 );
-       rb1->setFocusProxy( elts_le_rb1 );
-       rb2->setFocusProxy( elts_le_rb2 );
+//     rb0->setFocusProxy( elts_le_rb0 );
+//     rb1->setFocusProxy( elts_le_rb1 );
+//     rb2->setFocusProxy( elts_le_rb2 );
        rb0->click();
        //     setFocusProxy( rb0 );
 
@@ -3555,7 +3998,6 @@ MakeSymmetryDialog::MakeSymmetryDialog( QWidget* parent, Mode editmode, Qt::Wind
        connect( rb2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) );
 }
 
-
 // ============================================================== Destructeur
 MakeSymmetryDialog::~MakeSymmetryDialog()
 {
@@ -3598,6 +4040,14 @@ void MakeSymmetryDialog::_initInputWidget( Mode editmode )
        vec_le_rb2->installEventFilter(this);
        elts_le_rb2->installEventFilter(this);
 
+       vex_le_rb0->setReadOnly(true);
+       elts_le_rb0->setReadOnly(true);
+       vex_le_rb1->setReadOnly(true);
+       vec_le_rb1->setReadOnly(true);
+       elts_le_rb1->setReadOnly(true);
+       vex_le_rb2->setReadOnly(true);
+       vec_le_rb2->setReadOnly(true);
+       elts_le_rb2->setReadOnly(true);
 }
 
 // ============================================================== clear
@@ -3615,7 +4065,6 @@ void MakeSymmetryDialog::clear()
        elts_le_rb2->clear();
 }
 
-
 // ============================================================== updateHelpFileName
 void MakeSymmetryDialog::updateHelpFileName()
 {
@@ -3628,10 +4077,12 @@ void MakeSymmetryDialog::updateHelpFileName()
        }
 }
 
-
 // ============================================================== apply
 bool MakeSymmetryDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        if ( !_patternDataSelectionModel )    return false;
        if ( !_patternBuilderSelectionModel ) return false;
@@ -3639,18 +4090,18 @@ bool MakeSymmetryDialog::apply(QModelIndex& result)
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternDataModel )    return false;
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        QModelIndex iNewElts;
 
        if ( rb0->isChecked() ){
                QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb0] );
-               QModelIndex  ivex = patternBuilderModel->mapToSource( _index[vex_le_rb0] );
+               QModelIndex  ivex = patternDataModel->mapToSource( _index[vex_le_rb0] );
 
                if ( ielts.isValid()
                                && ivex.isValid() )
                        iNewElts = _documentModel->makeSymmetryPoint( ielts, ivex );
 
+
        } else if ( rb1->isChecked() ){
                QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb1] );
                QModelIndex  ivex = patternDataModel->mapToSource( _index[vex_le_rb1] );
@@ -3682,12 +4133,7 @@ bool MakeSymmetryDialog::apply(QModelIndex& result)
        return true;
 }
 
-
-
-
-
 // // ------------------------- PerformTransformationDialog ----------------------------------
-
 // ============================================================== Constructeur
 
 PerformTransformationDialog::PerformTransformationDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ):
@@ -3695,9 +4141,9 @@ PerformTransformationDialog::PerformTransformationDialog( QWidget* parent, Mode
 {
        setupUi( this );
        _initWidget(editmode);
-       rb0->setFocusProxy( elts_le_rb0 );
-       rb1->setFocusProxy( elts_le_rb1 );
-       rb2->setFocusProxy( elts_le_rb2 );
+//     rb0->setFocusProxy( elts_le_rb0 );
+//     rb1->setFocusProxy( elts_le_rb1 );
+//     rb2->setFocusProxy( elts_le_rb2 );
        //   setFocusProxy( rb0 );
        rb0->click();
 
@@ -3707,7 +4153,6 @@ PerformTransformationDialog::PerformTransformationDialog( QWidget* parent, Mode
        connect( rb2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) );
 }
 
-
 // ============================================================== Destructeur
 PerformTransformationDialog::~PerformTransformationDialog()
 {
@@ -3744,6 +4189,14 @@ void PerformTransformationDialog::_initInputWidget( Mode editmode )
        vec_le_rb2->installEventFilter(this);
        elts_le_rb2->installEventFilter(this);
 
+       vec_le_rb0->setReadOnly(true);
+       elts_le_rb0->setReadOnly(true);
+       vex_le_rb1->setReadOnly(true);
+       elts_le_rb1->setReadOnly(true);
+       vex_le_rb2->setReadOnly(true);
+       vec_le_rb2->setReadOnly(true);
+       elts_le_rb2->setReadOnly(true);
+
 }
 
 // ============================================================== clear
@@ -3770,6 +4223,9 @@ void PerformTransformationDialog::updateHelpFileName()
 // ============================================================== apply
 bool PerformTransformationDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        if ( !_patternDataSelectionModel )    return false;
        if ( !_patternBuilderSelectionModel ) return false;
@@ -3777,7 +4233,6 @@ bool PerformTransformationDialog::apply(QModelIndex& result)
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternDataModel )    return false;
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        bool performed = false;
 
@@ -3820,9 +4275,6 @@ bool PerformTransformationDialog::apply(QModelIndex& result)
 }
 
 
-
-
-
 // // ------------------------- PerformSymmetryDialog ----------------------------------
 
 // ============================================================== Constructeur
@@ -3832,9 +4284,9 @@ PerformSymmetryDialog::PerformSymmetryDialog( QWidget* parent, Mode editmode, Qt
 {
        setupUi( this );
        _initWidget( editmode );
-       rb0->setFocusProxy( elts_le_rb0 );
-       rb1->setFocusProxy( elts_le_rb1 );
-       rb2->setFocusProxy( elts_le_rb2 );
+//     rb0->setFocusProxy( elts_le_rb0 );
+//     rb1->setFocusProxy( elts_le_rb1 );
+//     rb2->setFocusProxy( elts_le_rb2 );
        //   setFocusProxy( rb0 );
        rb0->click();
 
@@ -3883,6 +4335,15 @@ void PerformSymmetryDialog::_initInputWidget( Mode editmode )
        vec_le_rb2->installEventFilter(this);
        elts_le_rb2->installEventFilter(this);
 
+       vex_le_rb0->setReadOnly(true);
+       elts_le_rb0->setReadOnly(true);
+       vex_le_rb1->setReadOnly(true);
+       vec_le_rb1->setReadOnly(true);
+       elts_le_rb1->setReadOnly(true);
+       vex_le_rb2->setReadOnly(true);
+       vec_le_rb2->setReadOnly(true);
+       elts_le_rb2->setReadOnly(true);
+
 }
 
 // ============================================================== clear
@@ -3908,6 +4369,9 @@ void PerformSymmetryDialog::updateHelpFileName()
 // ============================================================== apply
 bool PerformSymmetryDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        if ( !_patternDataSelectionModel )    return false;
        if ( !_patternBuilderSelectionModel ) return false;
@@ -3915,7 +4379,6 @@ bool PerformSymmetryDialog::apply(QModelIndex& result)
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternDataModel )    return false;
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        bool performed = false;
 
@@ -3969,7 +4432,7 @@ EdgeAssocDialog::EdgeAssocDialog( QWidget* parent, Mode editmode, Qt::WindowFlag
        setupUi( this );
        _initWidget(editmode);
        _initViewManager();
-       setFocusProxy( edges_lw );
+//     setFocusProxy( edges_lw );
 
        myLine.nullify();
 
@@ -4015,18 +4478,122 @@ void EdgeAssocDialog::_initInputWidget( Mode editmode )
 
 
        QShortcut* delEdgeShortcut = new QShortcut(QKeySequence(/*Qt::Key_Delete*/Qt::Key_X), edges_lw);
-       QShortcut* delLineShortcut = new QShortcut(QKeySequence(Qt::Key_X), lines_lw);
+       QShortcut* delLineShortcut = new QShortcut(QKeySequence(/*Qt::Key_Delete*/Qt::Key_X), lines_lw);
        delLineShortcut->setContext( Qt::WidgetWithChildrenShortcut );
        delEdgeShortcut->setContext( Qt::WidgetWithChildrenShortcut );
 
        pend_spb->setValue(1.);
 
+       first_vex_le->setReadOnly(true);
+       single_edge_le->setReadOnly(true);
+       single_line_le->setReadOnly(true);
+
        connect( delEdgeShortcut, SIGNAL(activated()), this, SLOT(deleteEdgeItem()) );
        connect( delLineShortcut, SIGNAL(activated()), this, SLOT(deleteLineItem()) );
        connect( pstart_spb, SIGNAL(valueChanged(double)), this, SLOT( pstartChanged(double)) );
        connect( pend_spb,   SIGNAL(valueChanged(double)), this, SLOT( pendChanged(double)) );
        connect( edges_lw,   SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()) );
+       connect( lines_lw,   SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfGeom()) );
+       connect( single_rb,   SIGNAL(clicked()), this, SLOT( highlightSelectedAssocs()) );
+       connect( multiple_rb,   SIGNAL(clicked()), this, SLOT(highlightSelectedAssocs()) );
+}
+
+
+// ============================================================== getAssocsVTK
+/*
+ * Returns elements currently being associated in vtk side
+ */
+QModelIndexList EdgeAssocDialog::getAssocsVTK()
+{
+       QModelIndexList assocs;
+       QModelIndex iEdge;
+       QListWidgetItem* item = NULL;
+
+       if (single_rb->isChecked())
+       {
+               //LineEdit content
+               QVariant v = single_edge_le->property("QModelIndex");
+               if ( !v.isValid() )
+                       return assocs;
+               assocs << v.value<QModelIndex>();
+               return assocs;
+       }
+       else if (multiple_rb->isChecked())
+       {
+               //ListWidget content
+               const PatternDataModel* patternDataModel = dynamic_cast<const PatternDataModel*>( _patternDataSelectionModel->model() );
+               if ( !patternDataModel ) return assocs;
+               for ( int r = 0; r < edges_lw->count(); ++r){
+                       item = edges_lw->item(r);
+                       iEdge = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value<QModelIndex>() );
+                       if ( iEdge.isValid() )
+                               assocs << iEdge;
+               }
+               return assocs;
+       }
+       else return assocs;
+}
+
+// ============================================================== getAssocsGEOM
+/*
+ * Returns elements currently being associated in geom side
+ */
+QMultiMap<QString, int> EdgeAssocDialog::getAssocsGEOM()
+{
+       QMultiMap<QString, int> assocs;
+       QListWidgetItem* item = NULL;
+       DocumentModel::GeomObj geomObj;
+
+       if (single_rb->isChecked())
+       {
+               //LineEdit content
+               QVariant v = single_line_le->property("GeomObj");
+               if ( !v.isValid() ) return assocs;
+               geomObj = v.value<DocumentModel::GeomObj>();
+               assocs.insert( geomObj.entry, geomObj.subid.toInt() );
+               return assocs;
+       }
+       else if (multiple_rb->isChecked())
+       {
+               //ListWidget content
+               unsigned int nbEdges = lines_lw->count();
+               for ( int r = 0; r < nbEdges; ++r){
+                       item = lines_lw->item(r);
+                       geomObj = item->data(LW_ASSOC_ROLE).value<DocumentModel::GeomObj>();
+                       assocs.insert( geomObj.entry, geomObj.subid.toInt() );
+               }
+               return assocs;
+       }
+       else return assocs;
+}
+
+// ============================================================== selectElementOfGeom
+
+/*Highlight in the OCC view selected elements in a listwidget,
+ *  or an element in a line edit.*/
+
+void EdgeAssocDialog::selectElementOfGeom()
+{
+       MESSAGE("HexaBaseDialog::selectElementOfGeom()");
 
+       QListWidget* currentListWidget = dynamic_cast<QListWidget*>( sender() );
+       if ( !currentListWidget ) return;
+
+       _selectionMutex = true;
+
+       QMultiMap<QString, int> geomElts;
+       DocumentModel::GeomObj geomObj;
+       QList<QListWidgetItem *> sel = currentListWidget->selectedItems();
+       foreach ( QListWidgetItem *item, sel ){
+               geomObj = item->data(LW_ASSOC_ROLE).value<DocumentModel::GeomObj>();
+               geomElts.insert( geomObj.entry, geomObj.subid.toInt() );
+       }
+       _selectionMutex = false;
+
+       //highlight geom selected elts
+       if (geomElts.size() > 0) _patternDataSelectionModel->_highlightGEOM(geomElts);
+
+       MESSAGE("}");
 }
 
 // ============================================================== clear
@@ -4062,11 +4629,28 @@ void EdgeAssocDialog::setGeomEngine( GEOM::GEOM_Gen_var geomEngine )
 void EdgeAssocDialog::onWindowActivated(SUIT_ViewManager* vm)
 {
        SUIT_ViewWindow* v = vm->getActiveView();
+
        QString vmType = vm->getType();
        if ( (vmType == SVTK_Viewer::Type()) || (vmType == VTKViewer_Viewer::Type()) ){
-               edges_lw->setFocus();
-       } else if ( vmType == OCCViewer_Viewer::Type() ){
-               lines_lw->setFocus();
+
+               if (single_rb->isChecked())
+                       single_edge_le->setFocus();
+               else if (multiple_rb->isChecked())
+               {
+                       if (close_cb->isChecked())
+                               first_vex_le->setFocus();
+                       else
+                               edges_lw->setFocus();
+               }
+       }
+       else if ( vmType == OCCViewer_Viewer::Type() ){
+               globalSelection(); // close local contexts, if any
+               localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+
+               if (single_rb->isChecked())
+                       single_line_le->setFocus();
+               else if (multiple_rb->isChecked())
+                       lines_lw->setFocus();
        }
 }
 
@@ -4127,138 +4711,90 @@ void EdgeAssocDialog::pendChanged( double val )
 // ============================================================== onCurrentSelectionChanged
 void EdgeAssocDialog::onCurrentSelectionChanged()
 {
-       if ( !isVisible() ) return;
+       if ( !isVisible() )
+       {
+               highlightSelectedAssocs();
+               return;
+       }
 
        SUIT_ViewWindow* window = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
        SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
 
        bool isOCC = (window && window->getViewManager()->getType() == OCCViewer_Viewer::Type());
-       //   bool isVTK = (window && window->getViewManager()->getType() == SVTK_Viewer::Type());
-
-       if (!isOCC) return;
-
+       if (!isOCC || !_documentModel)
+       {
+               highlightSelectedAssocs();
+               return;
+       }
 
        GEOM::GeomObjPtr aSelectedObject = getSelected(TopAbs_EDGE);
-       TopoDS_Shape aShape;
-
-       if ( !(aSelectedObject && GEOMBase::GetShape(aSelectedObject.get(), aShape) && !aShape.IsNull()) )
+       DocumentModel::GeomObj * aLine = _documentModel->convertToGeomObj(aSelectedObject);
+       if ( aLine == NULL )
+       {
+               highlightSelectedAssocs();
                return;
+       }
 
        if (single_rb->isChecked()) {
-               QString aName = GEOMBase::GetName(aSelectedObject.get());
-               single_line_le->setText(aName);
+               single_line_le->setText(aLine->name);
+               single_line_le->setProperty("GeomObj", QVariant::fromValue<DocumentModel::GeomObj>(*aLine));
                myLine = aSelectedObject;
+               setFocusToNextField();
        }
        else if( multiple_rb->isChecked() ) {
-
-               DocumentModel::GeomObj aLine;
-               QListWidgetItem* item = NULL;
-               QString mainShapeEntry;
-               int     subId = -1;
-               QString brep;
-
-               if ( aSelectedObject->IsMainShape() ){
-                       mainShapeEntry = aSelectedObject->GetStudyEntry();
-                       brep =  shape2string( aShape ).c_str();
-               } else {
-                       TopoDS_Shape shape;
-                       TopoDS_Shape subshape;
-                       GEOM::GEOM_Object_var mainShape = aSelectedObject->GetMainShape();
-                       mainShapeEntry = mainShape->GetStudyEntry();
-                       // CS_TODO : à optimiser
-                       bool okShape = GEOMBase::GetShape( mainShape , shape);//,const TopAbs_ShapeEnum type = TopAbs_SHAPE );
-                       bool oksubShape = GEOMBase::GetShape( aSelectedObject.get(), subshape );//,const TopAbs_ShapeEnum type = TopAbs_SHAPE );
-                       if ( okShape && oksubShape ){
-                               brep =  shape2string( subshape ).c_str();
-                               subId = GEOMBase::GetIndex( subshape, shape );
-                       }
+               QList<QListWidgetItem *> twice = lines_lw->findItems( aLine->name, Qt::MatchExactly);
+               if ( twice.count() == 0 ){
+                       QListWidgetItem* item  = new QListWidgetItem( aLine->name );
+                       item->setData(  LW_ASSOC_ROLE, QVariant::fromValue<DocumentModel::GeomObj>(*aLine) );
+                       item->setData(  LW_GEOM_OBJ_ROLE, QVariant::fromValue<GEOM::GeomObjPtr>(aSelectedObject) );
+                       lines_lw->addItem(item);
                }
-               aLine.name  = GEOMBase::GetName( aSelectedObject.get() );
-               aLine.entry = mainShapeEntry;
-               aLine.subid = QString::number(subId);
-               aLine.brep  = brep;
-               aLine.start = 0.;
-               aLine.end   = 1.;
-
-               item  = new QListWidgetItem( aLine.name );
-               item->setData(  LW_ASSOC_ROLE, QVariant::fromValue<DocumentModel::GeomObj>(aLine) );
-               item->setData(  LW_GEOM_OBJ_ROLE, QVariant::fromValue<GEOM::GeomObjPtr>(aSelectedObject) );
-               lines_lw->addItem(item);
        }
+       highlightSelectedAssocs();
 }
 
-
 // ============================================================== apply
 bool EdgeAssocDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        bool assocOk = false;
 
+       highlightSelectedAssocs();
        if ( !_patternDataSelectionModel ) return false;
        const PatternDataModel* patternDataModel = dynamic_cast<const PatternDataModel*>( _patternDataSelectionModel->model() );
        if ( !patternDataModel ) return false;
-       _currentObj = NULL;
-
-       QListWidgetItem* item = NULL;
+       if (!_documentModel) return false;
 
        QModelIndex     iEdge;
        QModelIndexList iEdges;
+       QListWidgetItem* item = NULL;
        QList<DocumentModel::GeomObj> assocs;
        DocumentModel::GeomObj aLine;
+       DocumentModel::GeomObj *aLinePtr;
 
        if (single_rb->isChecked()){ //Single edge and/or line association
 
-               QString mainShapeEntry;
-               int     subId = -1;
-               QString brep;
                GEOM::GeomObjPtr aSelectedObject = myLine;
-               TopoDS_Shape aShape;
-
-               if ( aSelectedObject && GEOMBase::GetShape(aSelectedObject.get(), aShape) && !aShape.IsNull() ){
-                       if ( aSelectedObject->IsMainShape() ){
-                               mainShapeEntry = aSelectedObject->GetStudyEntry();
-                               brep =  shape2string( aShape ).c_str();
-                       }
-                       else {
-                               TopoDS_Shape shape;
-                               TopoDS_Shape subshape;
-                               GEOM::GEOM_Object_var mainShape = aSelectedObject->GetMainShape();
-                               mainShapeEntry = mainShape->GetStudyEntry();
-                               // CS_TODO : à optimiser
-                               bool okShape = GEOMBase::GetShape( mainShape , shape);//,const TopAbs_ShapeEnum type = TopAbs_SHAPE );
-                               bool oksubShape = GEOMBase::GetShape( aSelectedObject.get(), subshape );//,const TopAbs_ShapeEnum type = TopAbs_SHAPE );
-                               if ( okShape && oksubShape ){
-                                       brep =  shape2string( subshape ).c_str();
-                                       subId = GEOMBase::GetIndex( subshape, shape );
-                               }
-                       }
-                       aLine.name  = GEOMBase::GetName( aSelectedObject.get() );
-                       aLine.entry = mainShapeEntry;
-                       aLine.subid = QString::number(subId);
-                       aLine.brep  = brep;
-                       aLine.start = pstart_spb->value();
-                       aLine.end   = pend_spb->value();
-                       iEdge = patternDataModel->mapToSource( _index[single_edge_le] );
-                       if (!iEdge.isValid()) return false;
-                       _documentModel->addAssociation(iEdge, aLine);
-                       assocOk = true;
-               }
+               aLinePtr = _documentModel->convertToGeomObj(aSelectedObject);
+               aLinePtr->start = pstart_spb->value();
+               aLinePtr->end   = pend_spb->value();
+               iEdge = patternDataModel->mapToSource( _index[single_edge_le] );
+               if (!iEdge.isValid()) return false;
+               _documentModel->addAssociation(iEdge, *aLinePtr);
+               assocOk = true;
        }
        else { //Multiple edge and/or line association
 
                // edges
-               for ( int r = 0; r < edges_lw->count(); ++r){
-                       item = edges_lw->item(r);
-                       iEdge = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value<QModelIndex>() );
-                       if ( iEdge.isValid() )
-                               iEdges << iEdge;
-               }
+               iEdges = getIndexList(edges_lw);
 
                // lines
-               for ( int r = 0; r < lines_lw->count(); ++r){
+               for (int r = 0; r < lines_lw->count(); ++r){
                        item = lines_lw->item(r);
                        aLine = item->data(LW_ASSOC_ROLE).value<DocumentModel::GeomObj>();
-                       //std::cout << " line added : " << aLine.name.toStdString() << std::endl;
                        MESSAGE(" assocs => " << aLine.name.toStdString() );
                        MESSAGE(" assocs => " << aLine.brep.toStdString() );
                        assocs << aLine;
@@ -4266,30 +4802,25 @@ bool EdgeAssocDialog::apply(QModelIndex& result)
 
                if ( close_cb->isChecked() ){ //closed line
                        QModelIndex iFirstVertex = patternDataModel->mapToSource( _index[first_vex_le] );
-                       // if (inverse_cb->isChecked())
-                       //      assocOk = _documentModel->associateClosedLine( iFirstVertex, iEdges, assocs, pstart_spb->value(), true );
-                       // else
-                       assocOk = _documentModel->associateClosedLine( iFirstVertex, iEdges, assocs, pstart_spb->value() );
-               } else {
+                       bool inv = inverse_cb->isChecked();
+                       assocOk = _documentModel->associateClosedLine( iFirstVertex, iEdges, assocs, pstart_spb->value(), inv );
+               } else
                        //opened line
                        assocOk = _documentModel->associateOpenedLine( iEdges, assocs, pstart_spb->value(), pend_spb->value() );
-               }
        }
 
        if ( !assocOk ){
                SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE EDGE ASSOCIATION" ) );
+               highlightSelectedAssocs();
                return false;
        }
 
+       highlightSelectedAssocs();
        return true;
 }
 
-
-
-// // ------------------------- QuadAssocDialog ----------------------------------
-
+// ------------------------- QuadAssocDialog ----------------------------------
 // ============================================================== Constructeur
-
 QuadAssocDialog::QuadAssocDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ):
                                                                HexaBaseDialog(parent, editmode, f)
 {
@@ -4297,7 +4828,7 @@ QuadAssocDialog::QuadAssocDialog( QWidget* parent, Mode editmode, Qt::WindowFlag
        setupUi( this );
        _initWidget(editmode);
        _initViewManager();
-       setFocusProxy( quad_le );
+//     setFocusProxy( quad_le );
 }
 
 // ============================================================== Destructeur
@@ -4324,10 +4855,77 @@ void QuadAssocDialog::_initInputWidget( Mode editmode )
        _delFaceShortcut = new QShortcut( QKeySequence(Qt::Key_X/*Qt::Key_Delete*/), faces_lw );
        _delFaceShortcut->setContext( Qt::WidgetShortcut );
 
+       quad_le->setReadOnly(true);
+
        connect( _delFaceShortcut, SIGNAL(activated()), this, SLOT(deleteFaceItem()) );
+       connect( faces_lw,   SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfGeom()) );
+}
+
+// ============================================================== getAssocsVTK
+/*
+ * Returns elements currently being associated in vtk side
+ */
+QModelIndexList QuadAssocDialog::getAssocsVTK()
+{
+       QModelIndexList assocs;
+       QModelIndex iQuad;
+
+       //LineEdit content
+       QVariant v = quad_le->property("QModelIndex");
+       if ( !v.isValid() )
+               return assocs;
+       assocs << v.value<QModelIndex>();
+       return assocs;
+}
+
+// ============================================================== getAssocsGEOM
+/*
+ * Returns elements currently being associated in geom side
+ */
+QMultiMap<QString, int> QuadAssocDialog::getAssocsGEOM()
+{
+       QMultiMap<QString, int> assocs;
+       QListWidgetItem* item = NULL;
+       DocumentModel::GeomObj geomObj;
+
+       //ListWidget content
+       unsigned int nbFaces = faces_lw->count();
+       for ( int r = 0; r < nbFaces; ++r){
+               item = faces_lw->item(r);
+               geomObj = item->data(LW_ASSOC_ROLE).value<DocumentModel::GeomObj>();
+               assocs.insert( geomObj.entry, geomObj.subid.toInt() );
+       }
+       return assocs;
+}
+
+// ============================================================== selectElementOfGeom
+/*Highlight in the OCC view selected elements in a listwidget,
+ *  or an element in a line edit.*/
+
+void QuadAssocDialog::selectElementOfGeom()
+{
+       MESSAGE("HexaBaseDialog::selectElementOfGeom()");
+
+       QListWidget* currentListWidget = dynamic_cast<QListWidget*>( sender() );
+       if ( !currentListWidget ) return;
+
+       _selectionMutex = true;
+
+       QMultiMap<QString, int> geomElts;
+       DocumentModel::GeomObj geomObj;
+       QList<QListWidgetItem *> sel = currentListWidget->selectedItems();
+       foreach ( QListWidgetItem *item, sel ){
+               geomObj = item->data(LW_ASSOC_ROLE).value<DocumentModel::GeomObj>();
+               geomElts.insert( geomObj.entry, geomObj.subid.toInt() );
+       }
+       _selectionMutex = false;
+
+       //highlight geom selected elts
+       if (geomElts.size() > 0) _patternDataSelectionModel->_highlightGEOM(geomElts);
+
+       MESSAGE("}");
 }
 
-// ============================================================== clear
 void QuadAssocDialog::clear()
 {
        quad_le->clear();
@@ -4337,66 +4935,54 @@ void QuadAssocDialog::clear()
 // ============================================================== onCurrentSelectionChanged
 void QuadAssocDialog::onCurrentSelectionChanged()
 {
-
-       if ( !isVisible() ) return;
+       if ( !isVisible() )
+       {
+               highlightSelectedAssocs();
+               return;
+       }
 
        SUIT_ViewWindow* window = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
        SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
 
        bool isOCC = (window && window->getViewManager()->getType() == OCCViewer_Viewer::Type());
        //   bool isVTK = (window && window->getViewManager()->getType() == SVTK_Viewer::Type());
-
-       if (!isOCC) return;
+       if (!isOCC || !_documentModel)
+       {
+//             if (HEXABLOCKGUI::currentOccView != NULL) HEXABLOCKGUI::currentOccView->setFocus();
+               highlightSelectedAssocs();
+               return;
+       }
 
        GEOM::GeomObjPtr aSelectedObject = getSelected(TopAbs_FACE);
-       TopoDS_Shape aShape;
-
-       if ( aSelectedObject && GEOMBase::GetShape(aSelectedObject.get(), aShape) && !aShape.IsNull() ){
-               DocumentModel::GeomObj aFace;
-               QListWidgetItem* item = NULL;
-               QString mainShapeEntry;
-               int     subId = -1;
-               QString brep;
+       DocumentModel::GeomObj* aFace = _documentModel->convertToGeomObj(aSelectedObject);
+       if (aFace == NULL)
+       {
+               highlightSelectedAssocs();
+               return;
+       }
 
-               if ( aSelectedObject->IsMainShape() ){
-                       mainShapeEntry = aSelectedObject->GetStudyEntry();
-                       brep =  shape2string( aShape ).c_str();
-               } else {
-                       TopoDS_Shape shape;
-                       TopoDS_Shape subshape;
-                       GEOM::GEOM_Object_var mainShape = aSelectedObject->GetMainShape();
-                       mainShapeEntry = mainShape->GetStudyEntry();
-                       // CS_TODO : à optimiser
-                       bool okShape = GEOMBase::GetShape( mainShape , shape);//,const TopAbs_ShapeEnum type = TopAbs_SHAPE );
-                       bool oksubShape = GEOMBase::GetShape( aSelectedObject.get(), subshape );//,const TopAbs_ShapeEnum type = TopAbs_SHAPE );
-                       if ( okShape && oksubShape ){
-                               brep =  shape2string( subshape ).c_str();
-                               subId = GEOMBase::GetIndex( subshape, shape );
-                       }
-               }
-               aFace.name  = GEOMBase::GetName( aSelectedObject.get() );
-               aFace.entry = mainShapeEntry;
-               aFace.subid = QString::number(subId);
-               aFace.brep  = brep;
-               aFace.start = 0.;
-               aFace.end   = 1.;
-
-               item  = new QListWidgetItem( aFace.name );
-               item->setData(  LW_ASSOC_ROLE, QVariant::fromValue<DocumentModel::GeomObj>(aFace) );
+       QList<QListWidgetItem *> twice = faces_lw->findItems( aFace->name, Qt::MatchExactly);
+       if ( twice.count() == 0 ){
+               QListWidgetItem* item = new QListWidgetItem( aFace->name );
+               item->setData(  LW_ASSOC_ROLE, QVariant::fromValue<DocumentModel::GeomObj>(*aFace) );
                faces_lw->addItem(item);
                //     faces_lw->setCurrentRow( faces_lw->count() - 1 );
        }
 
+       highlightSelectedAssocs();
 }
 
 // ============================================================== onWindowActivated
 void QuadAssocDialog::onWindowActivated(SUIT_ViewManager* vm)
 {
        SUIT_ViewWindow* v = vm->getActiveView();
-       QString     vmType = vm->getType();
-       if ( (vmType == SVTK_Viewer::Type()) || (vmType == VTKViewer_Viewer::Type()) ){
+
+       QString vmType = vm->getType();
+       if ( (vmType == SVTK_Viewer::Type()) || (vmType == VTKViewer_Viewer::Type()) )
                quad_le->setFocus();
-       } else if ( vmType == OCCViewer_Viewer::Type() ){
+       else if ( vmType == OCCViewer_Viewer::Type() ){
+               globalSelection(); // close local contexts, if any
+               localSelection(GEOM::GEOM_Object::_nil(), TopAbs_FACE);
                faces_lw->setFocus();
        }
 }
@@ -4411,12 +4997,15 @@ void QuadAssocDialog::deleteFaceItem()
 // ============================================================== apply
 bool QuadAssocDialog::apply(QModelIndex& result)
 {
+       highlightSelectedAssocs();
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        //if ( !_documentModel ) return;
        if ( !_patternDataSelectionModel ) return false;
        const PatternDataModel* patternDataModel = dynamic_cast<const PatternDataModel*>( _patternDataSelectionModel->model() );
        if ( !patternDataModel )           return false;
-       _currentObj = NULL;
 
        // quad
        QModelIndex iQuad = patternDataModel->mapToSource( _index[quad_le] );
@@ -4432,6 +5021,7 @@ bool QuadAssocDialog::apply(QModelIndex& result)
 
        result = patternDataModel->mapFromSource(iQuad);
 
+       highlightSelectedAssocs();
        return true;
 }
 
@@ -4464,6 +5054,25 @@ GroupDialog::~GroupDialog()
 {
 }
 
+// ============================================================== getAssocsVTK
+/*
+ * Returns elements currently being associated in vtk side
+ */
+QModelIndexList GroupDialog::getAssocsVTK()
+{
+       QModelIndexList assocs;
+       QModelIndex iItem;
+       QListWidgetItem* item = NULL;
+       //ListWidget content
+       const PatternDataModel* patternDataModel = dynamic_cast<const PatternDataModel*>( _patternDataSelectionModel->model() );
+       if ( !patternDataModel ) return assocs;
+       for ( int r = 0; r < eltBase_lw->count(); ++r){
+               item = eltBase_lw->item(r);
+               iItem = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value<QModelIndex>() );
+               if ( iItem.isValid() ) assocs << iItem;
+       }
+       return assocs;
+}
 
 // ============================================================== _initInputWidget
 void GroupDialog::_initInputWidget( Mode editmode )
@@ -4513,11 +5122,25 @@ void GroupDialog::onKindChanged(int index)
        //   onKind
        MESSAGE("GroupDialog::onKindChanged(" << index << ") ");
        switch ( kind_cb->itemData(index).toInt() ){
-       case HEXA_NS::HexaCell: case HEXA_NS::HexaNode: eltBase_lw->setProperty("HexaWidgetType", QVariant::fromValue(HEXA_TREE)); MESSAGE("====>HEXA_TREE"); break;
-       case HEXA_NS::QuadCell: case HEXA_NS::QuadNode: eltBase_lw->setProperty("HexaWidgetType", QVariant::fromValue(QUAD_TREE)); MESSAGE("====>QUAD_TREE"); break;
-       case HEXA_NS::EdgeCell: case HEXA_NS::EdgeNode: eltBase_lw->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); MESSAGE("====>EDGE_TREE"); break;
-       case HEXA_NS::VertexNode: eltBase_lw->setProperty("HexaWidgetType", QVariant::fromValue(VERTEX_TREE)); MESSAGE("====>VERTEX_TREE"); break;
-       default:Q_ASSERT( false );
+       case HEXA_NS::HexaCell:
+               case HEXA_NS::HexaNode:
+                       eltBase_lw->setProperty("HexaWidgetType", QVariant::fromValue(HEXA_TREE));
+                       break;
+
+       case HEXA_NS::QuadCell:
+               case HEXA_NS::QuadNode:
+                       eltBase_lw->setProperty("HexaWidgetType", QVariant::fromValue(QUAD_TREE));
+                       break;
+
+       case HEXA_NS::EdgeCell:
+               case HEXA_NS::EdgeNode: eltBase_lw->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE));
+               break;
+
+       case HEXA_NS::VertexNode:
+               eltBase_lw->setProperty("HexaWidgetType", QVariant::fromValue(VERTEX_TREE));
+               break;
+
+       default:Q_ASSERT(false);
        }
        eltBase_lw->clear();
        eltBase_lw->setFocus();
@@ -4554,7 +5177,7 @@ void GroupDialog::setValue(HEXA_NS::Group* g)
                case HEXA_NS::HexaCell: case HEXA_NS::HexaNode: v = QVariant::fromValue( (HEXA_NS::Hexa *)eltBase ); break;
                case HEXA_NS::QuadCell: case HEXA_NS::QuadNode: v = QVariant::fromValue( (HEXA_NS::Quad *)eltBase ); break;
                case HEXA_NS::EdgeCell: case HEXA_NS::EdgeNode: v = QVariant::fromValue( (HEXA_NS::Edge *)eltBase ); break;
-               case HEXA_NS::VertexNode:                       v = QVariant::fromValue( (HEXA_NS::Vertex *)eltBase ); break;
+               case HEXA_NS::VertexNode: v = QVariant::fromValue( (HEXA_NS::Vertex *)eltBase ); break;
                }
                iEltBase  = _patternDataSelectionModel->indexBy( HEXA_DATA_ROLE, v);
                if ( iEltBase.isValid() ){
@@ -4590,6 +5213,9 @@ void GroupDialog::removeEltBase()
 // ============================================================== apply
 bool GroupDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
 
        if ( !_documentModel ) return false;
@@ -4597,7 +5223,6 @@ bool GroupDialog::apply(QModelIndex& result)
        if ( !_groupsSelectionModel )      return false;
        const PatternDataModel* patternDataModel = dynamic_cast<const PatternDataModel*>( _patternDataSelectionModel->model() );
        const GroupsModel*      groupsModel = dynamic_cast<const GroupsModel*>( _groupsSelectionModel->model() );
-       _currentObj = NULL;
 
        QString               grpName = name_le->text();
        DocumentModel::Group  grpKind = static_cast<DocumentModel::Group>( kind_cb->itemData( kind_cb->currentIndex() ).toInt());
@@ -4726,11 +5351,13 @@ HEXA_NS::Law* LawDialog::getValue()
 // ============================================================== apply
 bool LawDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        if ( !_documentModel ) return false;
        if ( !_meshSelectionModel ) return false;
 
-       _currentObj = NULL;
        const MeshModel* meshModel = dynamic_cast<const MeshModel*>( _meshSelectionModel->model() );
 
        QString lawName = name_le->text();
@@ -4788,7 +5415,7 @@ PropagationDialog::PropagationDialog( QWidget* parent, Mode editmode, Qt::Window
        setupUi( this );
        _initWidget(editmode);
        //   setFocusProxy( law_le );
-       setFocusProxy( propagations_lw );
+//     setFocusProxy( propagations_lw );
 
        if ( editmode == INFO_MODE ){
                setWindowTitle( tr("Propagation Information") );
@@ -4830,6 +5457,8 @@ void PropagationDialog::_initInputWidget( Mode editmode )
        QShortcut* delPropagationShortcut = new QShortcut(QKeySequence(/*Qt::Key_Delete*/Qt::Key_X/*Qt::Key_Alt*//*Qt::Key_Space*/), propagations_lw);
        delPropagationShortcut->setContext( Qt::WidgetShortcut );
 
+       law_le->setReadOnly(true);
+
        connect( delPropagationShortcut, SIGNAL(activated()), this, SLOT(deletePropagationItem()) );
        connect( propagations_lw,   SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()) );
 }
@@ -4859,7 +5488,6 @@ void PropagationDialog::setValue(HEXA_NS::Propagation* p)
        QModelIndex ip = _meshSelectionModel->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(p) );
        setProperty( "QModelIndex",  QVariant::fromValue<QModelIndex>(ip) );
 
-
        // law on propagation
        if ( l != NULL ){
                law_le->setText( l->getName() );
@@ -4873,6 +5501,38 @@ void PropagationDialog::setValue(HEXA_NS::Propagation* p)
        _value = p;
 }
 
+// ============================================================== selectElementOfModel
+
+/*Selects in the model (treeview) elements selected in a listwidget,
+ *  or an element in a line edit.*/
+
+void PropagationDialog::selectElementOfModel()
+{
+       MESSAGE("HexaBaseDialog::selectElementOfModel()");
+       if (!_meshSelectionModel) return;
+
+       QListWidget* currentListWidget = dynamic_cast<QListWidget*>( sender() );
+       if ( !currentListWidget ) return;
+
+       _selectionMutex = true;
+
+       QList<QListWidgetItem *> sel = currentListWidget->selectedItems();
+       QModelIndex index;
+       _meshSelectionModel->clearSelection();
+       foreach ( QListWidgetItem *item, sel ){
+               index = item->data(LW_QMODELINDEX_ROLE).value<QModelIndex>();
+               if ( index.isValid() )
+               {
+                       MESSAGE( "*  selecting the element : " << index.data().toString().toStdString() );
+                       _meshSelectionModel->select( index, QItemSelectionModel::Select );
+               }
+       }
+       _selectionMutex = false;
+
+       MESSAGE("}");
+}
+
+
 // ============================================================== getValue
 HEXA_NS::Propagation* PropagationDialog::getValue()
 {
@@ -4883,11 +5543,13 @@ HEXA_NS::Propagation* PropagationDialog::getValue()
 // ============================================================== apply
 bool PropagationDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        bool isOk = false;
        SUIT_OverrideCursor wc;
        if ( !_documentModel ) return false;
        if ( !_meshSelectionModel ) return false;
-       _currentObj = NULL;
 
        const MeshModel* meshModel = dynamic_cast<const MeshModel*>( _meshSelectionModel->model() );
        bool way = way_cb->isChecked();
@@ -4993,6 +5655,9 @@ void ComputeMeshDialog::clear()
 // ============================================================== apply
 bool ComputeMeshDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
 
        QString command = QString("import hexablock ; %1 = hexablock.mesh(\"%2\", \"%1\", %3, \"%4\")")
@@ -5048,7 +5713,7 @@ ReplaceHexaDialog::ReplaceHexaDialog( QWidget* parent, Mode editmode, Qt::Window
        _helpFileName = "gui_replace_hexa.html";
        setupUi( this );
        _initWidget(editmode);
-       setFocusProxy( quads_lw );
+//     setFocusProxy( quads_lw );
 }
 
 // ============================================================== Destructeur
@@ -5056,6 +5721,28 @@ ReplaceHexaDialog::~ReplaceHexaDialog()
 {
 }
 
+// ============================================================== getAssocsVTK
+/*
+ * Returns elements currently associated to vtk
+ */
+QModelIndexList ReplaceHexaDialog::getAssocsVTK()
+{
+       QModelIndexList assocs;
+       QModelIndex iQuad;
+       QListWidgetItem* item = NULL;
+
+       //ListWidget content
+       const PatternDataModel* patternDataModel = dynamic_cast<const PatternDataModel*>( _patternDataSelectionModel->model() );
+       if ( !patternDataModel ) return assocs;
+       for ( int r = 0; r < quads_lw->count(); ++r ){
+               item = quads_lw->item(r);
+//             iQuad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value<QModelIndex>() ); //unsafe
+               iQuad = _patternDataSelectionModel->indexBy(HEXA_DATA_ROLE, item->data(LW_DATA_ROLE));
+               if ( iQuad.isValid() ) assocs << iQuad;
+       }
+       return assocs;
+}
+
 // ============================================================== _initInputWidget
 void ReplaceHexaDialog::_initInputWidget( Mode editmode )
 {
@@ -5073,6 +5760,7 @@ void ReplaceHexaDialog::_initInputWidget( Mode editmode )
        p2_le->setProperty( "HexaWidgetType",  QVariant::fromValue(VERTEX_TREE) );
        p3_le->setProperty( "HexaWidgetType",  QVariant::fromValue(VERTEX_TREE) );
 
+       name_le->installEventFilter(this);
        c1_le->installEventFilter(this);
        c2_le->installEventFilter(this);
        c3_le->installEventFilter(this);
@@ -5092,6 +5780,14 @@ void ReplaceHexaDialog::_initInputWidget( Mode editmode )
                connect( quads_lw, SIGNAL(currentRowChanged(int)), this, SLOT(updateButtonBox(int)) );
        }
 
+       c1_le->setReadOnly(true);
+       c2_le->setReadOnly(true);
+       c3_le->setReadOnly(true);
+
+       p1_le->setReadOnly(true);
+       p2_le->setReadOnly(true);
+       p3_le->setReadOnly(true);
+
        connect(quads_lw,    SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()));
 }
 
@@ -5124,6 +5820,9 @@ void ReplaceHexaDialog::deleteQuadItem()
 // ============================================================== apply
 bool ReplaceHexaDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        if ( !_documentModel ) return false;
        if ( !_patternDataSelectionModel ) return false;
@@ -5132,7 +5831,6 @@ bool ReplaceHexaDialog::apply(QModelIndex& result)
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternDataModel )    return false;
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        QModelIndex ielts; //result
 
@@ -5177,6 +5875,13 @@ bool ReplaceHexaDialog::apply(QModelIndex& result)
 
        result = patternBuilderModel->mapFromSource(ielts);
 
+       //update the list (indexes)
+       for ( int r = 0; r < quads_lw->count(); ++r ){
+               item = quads_lw->item(r);
+               iquad = _patternDataSelectionModel->indexBy(HEXA_DATA_ROLE, item->data(LW_DATA_ROLE));
+               item->setData(  LW_QMODELINDEX_ROLE, QVariant::fromValue<QModelIndex>(iquad) );
+       }
+
        return true;
 }
 
@@ -5193,7 +5898,29 @@ QuadRevolutionDialog::QuadRevolutionDialog( QWidget* parent, Mode editmode, Qt::
        _helpFileName = "gui_quad_revolution.html";
        setupUi( this );
        _initWidget(editmode);
-       setFocusProxy( quads_lw );
+//     setFocusProxy( quads_lw );
+}
+
+// ============================================================== getAssocsVTK
+/*
+ * Returns elements currently associated to vtk
+ */
+QModelIndexList QuadRevolutionDialog::getAssocsVTK()
+{
+       QModelIndexList assocs;
+       QModelIndex iQuad;
+       QListWidgetItem* item = NULL;
+
+       //ListWidget content
+       const PatternDataModel* patternDataModel = dynamic_cast<const PatternDataModel*>( _patternDataSelectionModel->model() );
+       if ( !patternDataModel ) return assocs;
+       for ( int r = 0; r < quads_lw->count(); ++r ){
+               item = quads_lw->item(r);
+               iQuad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value<QModelIndex>() );
+               if ( iQuad.isValid() )
+                       assocs << iQuad;
+       }
+       return assocs;
 }
 
 // ============================================================== Destructeur
@@ -5218,6 +5945,7 @@ void QuadRevolutionDialog::_initInputWidget( Mode editmode )
        axis_vec_le->setValidator( validator );
        //   quads_lw->setValidator( validator );
 
+       name_le->installEventFilter(this);
        center_pt_le->installEventFilter(this);
        axis_vec_le->installEventFilter(this);
        quads_lw->installEventFilter(this);
@@ -5234,6 +5962,9 @@ void QuadRevolutionDialog::_initInputWidget( Mode editmode )
                //     connect(clear_pb, SIGNAL(clicked()), this, SLOT(clearQuads()));
        }
 
+       center_pt_le->setReadOnly(true);
+       axis_vec_le->setReadOnly(true);
+
        connect(quads_lw,    SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()));
 }
 
@@ -5293,6 +6024,9 @@ void QuadRevolutionDialog::delQuadItem()
 // ============================================================== apply
 bool QuadRevolutionDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        if ( !_documentModel ) return false;
        if ( !_patternDataSelectionModel )    return false;
@@ -5301,7 +6035,6 @@ bool QuadRevolutionDialog::apply(QModelIndex& result)
        const PatternBuilderModel* patternBuilderModel = dynamic_cast<const PatternBuilderModel*>( _patternBuilderSelectionModel->model() );
        if ( !patternDataModel )    return false;
        if ( !patternBuilderModel ) return false;
-       _currentObj = NULL;
 
        QModelIndex ielts; //result
        QListWidgetItem* item = NULL;
@@ -5345,7 +6078,7 @@ bool QuadRevolutionDialog::apply(QModelIndex& result)
 
 
 
-// ------------------------- QuadRevolutionDialog ----------------------------------
+// ------------------------- MakeHemiSphereDialog ----------------------------------
 
 // ============================================================== Constructeur
 
@@ -5384,11 +6117,18 @@ void MakeHemiSphereDialog::_initInputWidget( Mode editmode )
        radial_vec_le->setValidator( validator );
 
 
+       name_le->installEventFilter(this);
        sphere_center_le->installEventFilter(this);
        cross_pt_le->installEventFilter(this);
        hole_axis_le->installEventFilter(this);
        cross_vec_le->installEventFilter(this);
        radial_vec_le->installEventFilter(this);
+
+       sphere_center_le->setReadOnly(true);
+       cross_pt_le->setReadOnly(true);
+       hole_axis_le->setReadOnly(true);
+       cross_vec_le->setReadOnly(true);
+       radial_vec_le->setReadOnly(true);
 }
 
 // ============================================================== clear
@@ -5399,6 +6139,9 @@ void MakeHemiSphereDialog::clear()
 // ============================================================== apply
 bool MakeHemiSphereDialog::apply(QModelIndex& result)
 {
+       if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+       _currentObj = NULL;
+
        SUIT_OverrideCursor wc;
        if ( !_documentModel ) return false;
        if ( !_patternBuilderSelectionModel ) return false;
@@ -5407,7 +6150,6 @@ bool MakeHemiSphereDialog::apply(QModelIndex& result)
        const PatternDataModel* patternDataModel = dynamic_cast<const PatternDataModel*>( _patternDataSelectionModel->model() );
        if ( !patternBuilderModel ) return false;
        if ( !patternDataModel )    return false;
-       _currentObj = NULL;
 
        QModelIndex iElts;
        QModelIndex icenter = patternDataModel->mapToSource( _index[sphere_center_le] );
@@ -5504,6 +6246,9 @@ bool MakeHemiSphereDialog::apply(QModelIndex& result)
 //
 // bool MakeRindDialog::apply(QModelIndex& result)
 // {
+//      if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white);
+//      _currentObj = NULL;
+//
 //   SUIT_OverrideCursor wc;
 //   if ( !_documentModel ) return false;
 //   if ( !_patternBuilderSelectionModel ) return false;
index b59b2e35a120a5558384432df3d97857e1284279..9ecc17451e4320ae2ae7693de596d647ae952f01 100755 (executable)
 #endif
 
 
+#define MAX_WIDTH 16777215
+#define MAX_HEIGHT 16777215
+#define MIN_WIDTH 0
+#define MIN_HEIGHT 0
 
 #include <QShortcut>
+#include <QDockWidget>
 
 #include "ui_Vertex_QTD.h"
 #include "ui_Quad_QTD.h"
@@ -86,8 +91,6 @@
 
 #include "klinkitemselectionmodel.hxx"
 
-
-
 Q_DECLARE_METATYPE(QModelIndex);
 Q_DECLARE_METATYPE(HEXABLOCK::GUI::DocumentModel::GeomObj);
 Q_DECLARE_METATYPE(GEOM::GeomObjPtr);
@@ -110,6 +113,12 @@ namespace HEXABLOCK
             UPDATE_MODE
           };
 
+          enum ViewType {
+                 VTK,
+                 OCC,
+                 NONE
+          };
+
           // define input widget type => usefull for selection
           typedef HexaTreeRole  HexaWidgetType;
           typedef TopAbs_ShapeEnum/*int */GeomWidgetType; //CS_TODO
@@ -120,23 +129,50 @@ namespace HEXABLOCK
           enum {
             LW_QMODELINDEX_ROLE = Qt::UserRole + 1,
             LW_ASSOC_ROLE,
-            LW_GEOM_OBJ_ROLE
+            LW_GEOM_OBJ_ROLE,
+            LW_DATA_ROLE
           };
 
           HexaBaseDialog( QWidget * parent = 0, Mode editmode = NEW_MODE, Qt::WindowFlags f = 0 );
-          virtual ~HexaBaseDialog();
+          virtual ~HexaBaseDialog(){};
 
           // clear all input widget
-          virtual void clear();
+          virtual void clear(){};
+          ViewType getObjectViewType(QObject* obj);
 
           //  model
-          virtual void setDocumentModel( DocumentModel* m );
+          virtual void setDocumentModel( DocumentModel* m ){ _documentModel = m;}
 
           //  selection
-          virtual void setPatternDataSelectionModel( PatternDataSelectionModel* s );
-          virtual void setPatternBuilderSelectionModel( PatternBuilderSelectionModel* s );
-          virtual void setGroupsSelectionModel( GroupsSelectionModel* s );
-          virtual void setMeshSelectionModel( MeshSelectionModel* s );
+          virtual void setPatternDataSelectionModel( PatternDataSelectionModel* s )
+          { _patternDataSelectionModel = s;}
+
+          virtual void setPatternBuilderSelectionModel( PatternBuilderSelectionModel* s )
+          { _patternBuilderSelectionModel = s; }
+
+          virtual void setGroupsSelectionModel( GroupsSelectionModel* s )
+          { _groupsSelectionModel = s; }
+
+          virtual void setMeshSelectionModel( MeshSelectionModel* s )
+          { _meshSelectionModel = s; }
+
+          void resetSizeAndShow(QDockWidget* parent);
+          void lockSizeToSizeHint();
+          void unlockSizeModification();
+          virtual QModelIndexList getAssocsVTK()
+          {
+               QModelIndexList assocs;
+               return assocs;
+          }
+          virtual QMultiMap<QString, int> getAssocsGEOM()
+          {
+                 QMultiMap<QString, int> assocs;
+                 return assocs;
+          }
+          void clearVTKSelection();
+          void clearOCCSelection();
+
+          bool debugEdgeAssoc; //Temporary
 
         public slots:
           //virtual void accept();
@@ -144,7 +180,6 @@ namespace HEXABLOCK
           virtual void close();
           virtual void onHelpRequested();
 
-
         protected:
           virtual bool eventFilter(QObject *obj, QEvent *event);
           virtual void hideEvent ( QHideEvent * event );
@@ -154,16 +189,17 @@ namespace HEXABLOCK
           virtual void _initInputWidget( Mode editmode )=0; //must be implemented on inherited dialog box
           virtual QGroupBox*  _initButtonBox( Mode editmode );
           void _initWidget( Mode editmode ); // call _initInputWidget() & _initButtonBox()
+          QModelIndexList getIndexList(QListWidget* itemsList);
 
           void _initViewManager();
 
-
           void _allowSelection();
           void _disallowSelection();
           QItemSelectionModel* _allowSelection( HexaWidgetType wtype );
 
           bool _allowVTKSelection( QObject* obj );
           bool _allowOCCSelection( QObject* obj );
+          void setOCCSelectionMode(TopAbs_ShapeEnum mode);
           QItemSelectionModel* _getSelector( QObject* obj );
 
 
@@ -172,6 +208,9 @@ namespace HEXABLOCK
 
           void _selectAndHighlight( const QModelIndex& i );
 
+          void _highlightWidget(QObject* obj, Qt::GlobalColor clr);
+
+          void setFocusToNextField();
 
           Mode _editMode;
 
@@ -200,13 +239,21 @@ namespace HEXABLOCK
 
           QString  _helpFileName;
 
+        private:
+          bool _isLineOrListWidget(QObject*);
+          void _updateCurrentObject(QObject*);
+          TopAbs_ShapeEnum currentOCCSelectionMode;
+          void refreshConnects();
+
+
         protected slots:
           virtual void onSelectionChanged(  const QItemSelection& sel, const QItemSelection& unsel ); //from qt model/view selectionManager
           virtual void onCurrentSelectionChanged();//from salome selectionManager
-          virtual void onWindowActivated( SUIT_ViewManager* vm );
+          virtual void onWindowActivated(SUIT_ViewManager*){};
           virtual void updateButtonBox();
           void updateName();
-          void selectElementOfModel();
+          virtual void selectElementOfModel();
+          void highlightSelectedAssocs();
 
     };
 
@@ -306,6 +353,7 @@ namespace HEXABLOCK
         virtual ~HexaDialog();
 
         void clear();
+        virtual QModelIndexList getAssocsVTK();
 
         void setValue(HEXA_NS::Hexa* v);
         HEXA_NS::Hexa* getValue();
@@ -553,8 +601,8 @@ namespace HEXABLOCK
       public:
         PrismQuadDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
         virtual ~PrismQuadDialog();
-
         void clear();
+        virtual QModelIndexList getAssocsVTK();
 
       public slots:
         virtual bool apply(QModelIndex& result);
@@ -562,6 +610,10 @@ namespace HEXABLOCK
       protected:
         void _initInputWidget( Mode editmode );
 
+      protected slots:
+               void addHeightItem();
+        void delHeightItem();
+
       private slots:
         void addQuad();
         void removeQuad();
@@ -579,6 +631,7 @@ namespace HEXABLOCK
         virtual ~JoinQuadDialog();
 
         void clear();
+        virtual QModelIndexList getAssocsVTK();
 
       public slots:
         virtual bool apply(QModelIndex& result);
@@ -766,6 +819,8 @@ namespace HEXABLOCK
         EdgeAssocDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
         virtual ~EdgeAssocDialog();
         void clear();
+        virtual QModelIndexList getAssocsVTK();
+        virtual QMultiMap<QString, int> getAssocsGEOM();
 
         void setGeomEngine( GEOM::GEOM_Gen_var geomEngine );
 
@@ -783,6 +838,7 @@ namespace HEXABLOCK
         virtual void onCurrentSelectionChanged();
 //         void onSelectionChanged(  const QItemSelection& sel, const QItemSelection& unsel );
         virtual void onWindowActivated(SUIT_ViewManager*);
+        virtual void selectElementOfGeom();
 
         void deleteEdgeItem();
         void deleteLineItem();
@@ -792,6 +848,7 @@ namespace HEXABLOCK
         void pendChanged( double val );
 
       private:
+//        QModelIndexList currentAssocList;
         // Preview in GEOM
 //         GEOM::GeomObjPtr    _firstLine;
 //         GEOM::GeomObjPtr    _lastLine;
@@ -812,6 +869,8 @@ namespace HEXABLOCK
         QuadAssocDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
         virtual ~QuadAssocDialog();
         void clear();
+        virtual QModelIndexList getAssocsVTK();
+        virtual QMultiMap<QString, int> getAssocsGEOM();
 
       public slots:
         virtual bool apply(QModelIndex& result);
@@ -825,6 +884,7 @@ namespace HEXABLOCK
         virtual void onCurrentSelectionChanged();
         virtual void onWindowActivated(SUIT_ViewManager*);
         void deleteFaceItem();
+        virtual void selectElementOfGeom();
 
       private:
         QList<DocumentModel::GeomObj> _assocs;
@@ -844,6 +904,7 @@ namespace HEXABLOCK
         GroupDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
         virtual ~GroupDialog();
         void clear();
+        virtual QModelIndexList getAssocsVTK();
 
         void setValue(HEXA_NS::Group* v);
         HEXA_NS::Group* getValue();
@@ -916,6 +977,7 @@ namespace HEXABLOCK
       protected slots:
         void updateHelpFileName();
         void deletePropagationItem();
+        virtual void selectElementOfModel();
 
       private:
         HEXA_NS::Propagation *_value;
@@ -962,6 +1024,8 @@ namespace HEXABLOCK
         ReplaceHexaDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
         virtual ~ReplaceHexaDialog();
         void clear();
+        virtual QModelIndexList getAssocsVTK();
+
 
       public slots:
         virtual bool apply(QModelIndex& result);
@@ -990,6 +1054,7 @@ namespace HEXABLOCK
         QuadRevolutionDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 );
         virtual ~QuadRevolutionDialog();
         void clear();
+        virtual QModelIndexList getAssocsVTK();
 
       public slots:
         virtual bool apply(QModelIndex& result);
index 393c908c62fc4f7929f8da88ab6df211afb6f748..5627b29316525df60f212eb408594ae94281665e 100755 (executable)
@@ -41,6 +41,7 @@
 #include <SUIT_Selector.h>
 #include <SUIT_Desktop.h>
 #include <SUIT_ViewManager.h>
+#include <SVTK_View.h>
 
 
 #include "HEXABLOCKGUI_SalomeTools.hxx"
@@ -92,6 +93,7 @@ MyGEOMBase_Helper( SUIT_Session::session()->activeApplication()->desktop() ),
 _theModelSelectionChanged(false),
 _theVtkSelectionChanged(false),
 _theGeomSelectionChanged(false),
+salomeNothingSelected(true),
 _selectionFilter(-1),
 _salomeSelectionMgr(0)
 {
@@ -102,7 +104,6 @@ _salomeSelectionMgr(0)
 
 }
 
-
 PatternDataSelectionModel::~PatternDataSelectionModel()
 {
   disconnect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
@@ -115,7 +116,6 @@ PatternDataSelectionModel::~PatternDataSelectionModel()
   disconnect( HEXABLOCKGUI::selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( salomeSelectionChanged() ) );
 }
 
-
 void PatternDataSelectionModel::setVertexSelection()
 {
   MESSAGE("PatternDataSelectionModel::setVertexSelection(){");
@@ -150,7 +150,8 @@ void PatternDataSelectionModel::setQuadSelection()
 void PatternDataSelectionModel::setHexaSelection()
 {
   MESSAGE("PatternDataSelectionModel::setHexaSelection(){");
-  SetSelectionMode(VolumeSelection);
+//  SetSelectionMode(VolumeSelection);
+  SetSelectionMode(FaceSelection); //temporary for hexa selection debug
   _selectionFilter = HEXA_TREE;
   MESSAGE("}");
 }
@@ -159,6 +160,7 @@ void PatternDataSelectionModel::setHexaSelection()
 void PatternDataSelectionModel::setAllSelection()
 {
   MESSAGE("PatternDataSelectionModel::setAllSelection(){");
+  SetSelectionMode(ActorSelection);
   _selectionFilter = -1;
   MESSAGE("}");
 }
@@ -206,11 +208,11 @@ void PatternDataSelectionModel::setSalomeSelectionMgr( LightApp_SelectionMgr* mg
 void  PatternDataSelectionModel::SetSelectionMode(Selection_Mode theMode)
 {
   MESSAGE("PatternDataSelectionModel::SetSelectionMode(){");
-  SVTK_ViewWindow* aVTKViewWindow = _getVTKViewWindow();
+//  SVTK_ViewWindow* aVTKViewWindow = _getVTKViewWindow();
 //   aViewWindow->clearFilters();
 //   _salomeSelectionMgr->clearFilters();
-  if ( aVTKViewWindow )
-    aVTKViewWindow->SetSelectionMode( theMode );
+  if ( _getVTKViewWindow() != NULL )
+         _getVTKViewWindow()->SetSelectionMode( theMode );
   MESSAGE("}");
 }
 
@@ -236,49 +238,64 @@ void PatternDataSelectionModel::onCurrentChanged( const QModelIndex & current, c
   MESSAGE("PatternDataSelectionModel::onCurrentChanged(){");
   MESSAGE("*  current  : " << current.data().toString().toStdString());
   MESSAGE("*  previous : " << previous.data().toString().toStdString());
+
+  //Setting the selection mode of the selected item from the treeview
+  _setVTKSelectionMode( current);
+
 //   _selectSalome( current, true );
 //   _selectSalome( previous, false );
   MESSAGE("}");
 }
 
-
+void PatternDataSelectionModel::highlightEltsWithAssocs(const QModelIndexList& elts)
+{
+       try {
+//             if ( HEXABLOCKGUI::selectionMgr() != NULL) HEXABLOCKGUI::selectionMgr()->clearSelected();
+               highlightVTKElts(elts);
+               for( QModelIndexList::const_iterator i_index = elts.begin(); i_index != elts.end(); ++i_index ){
+                       //            _selectVTK( *i_index );
+                       _highlightGEOM( *i_index );
+               }
+       } catch ( ... ) {
+               MESSAGE("Unknown exception was cought !!!");
+       }
+}
 
 void PatternDataSelectionModel::onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected )
 {
-  MESSAGE("PatternDataSelectionModel::onSelectionChanged(){");
-  foreach( const QModelIndex& isel, selected.indexes() ){
-    MESSAGE("*  selected : " << isel.data().toString().toStdString());
-  }
-  foreach( const QModelIndex& iunsel, deselected.indexes() ){
-    MESSAGE("*  unselected : " << iunsel.data().toString().toStdString());
-  }
-
-  _theModelSelectionChanged = true;
-  try {
-    if ( _salomeSelectionMgr == NULL ) return;
-//     if ( !_theVtkSelectionChanged and  !_theGeomSelectionChanged ) return;
-
-    _salomeSelectionMgr->clearSelected();
-    //   erasePreview(true);
-    QModelIndexList indexes = selected.indexes();
-    for( QModelIndexList::const_iterator i_index = indexes.begin(); i_index != indexes.end(); ++i_index ){
-  //     std::cout << "entry selected" << i_index->data( HEXA_ENTRY_ROLE ).toString().toStdString() << std::endl;
-      if ( !_theVtkSelectionChanged )  _selectVTK( *i_index );
-      if ( !_theGeomSelectionChanged ) _highlightGEOM( *i_index );
-    }
-    // CS_BP todo SALOMEGUI_Swig.cxx:370
-    //   indexes = deselected.indexes();
-    //   for( QModelIndexList::const_iterator i_index = indexes.begin(); i_index != indexes.end(); ++i_index )
-    //     _unselectSalome( *i_index);
-  } catch ( ... ) {
-    MESSAGE("Unknown exception was cought !!!");
-  }
-  _theModelSelectionChanged = false;
-
-  MESSAGE("}");
+//  MESSAGE("PatternDataSelectionModel::onSelectionChanged(){");
+//  foreach( const QModelIndex& isel, selected.indexes() ){
+//    MESSAGE("*  selected : " << isel.data().toString().toStdString());
+//  }
+//  foreach( const QModelIndex& iunsel, deselected.indexes() ){
+//    MESSAGE("*  unselected : " << iunsel.data().toString().toStdString());
+//  }
+
+//  _theModelSelectionChanged = true;
+//  try {
+//    if ( _salomeSelectionMgr == NULL ) return;
+////     if ( !_theVtkSelectionChanged and  !_theGeomSelectionChanged ) return;
+//
+//    _salomeSelectionMgr->clearSelected();
+//    //   erasePreview(true);
+//    QModelIndexList indexes = selected.indexes();
+//    for( QModelIndexList::const_iterator i_index = indexes.begin(); i_index != indexes.end(); ++i_index ){
+//  //     std::cout << "entry selected" << i_index->data( HEXA_ENTRY_ROLE ).toString().toStdString() << std::endl;
+//      if ( !_theVtkSelectionChanged )  _selectVTK( *i_index );
+//      if ( !_theGeomSelectionChanged ) _highlightGEOM( *i_index );
+//    }
+//    // CS_BP todo SALOMEGUI_Swig.cxx:370
+//    //   indexes = deselected.indexes();
+//    //   for( QModelIndexList::const_iterator i_index = indexes.begin(); i_index != indexes.end(); ++i_index )
+//    //     _unselectSalome( *i_index);
+//  } catch ( ... ) {
+//    MESSAGE("Unknown exception was cought !!!");
+//  }
+//  _theModelSelectionChanged = false;
+
+//  MESSAGE("}");
 }
 
-
 void PatternDataSelectionModel::salomeSelectionChanged()
 {
   MESSAGE("PatternDataSelectionModel::salomeSelectionChanged(){");
@@ -291,11 +308,13 @@ void PatternDataSelectionModel::salomeSelectionChanged()
     _salomeSelectionMgr->selectedObjects( salomeSelected, NULL, false );
     if ( salomeSelected.IsEmpty() ){
       MESSAGE("*  salomeSelected.IsEmpty()");
+      salomeNothingSelected = true;
       clearSelection();
       return;
     }
 
     Handle(SALOME_InteractiveObject) anIObject;
+
     SALOME_ListIteratorOfListIO it(salomeSelected);
     for( ; it.More(); it.Next()){
       anIObject = it.Value(); //anIObject->getName()
@@ -308,23 +327,149 @@ void PatternDataSelectionModel::salomeSelectionChanged()
         MESSAGE("*  OK : selection from GEOM");
       }
     }
+    salomeNothingSelected = false;
   } catch ( ... ) {
     MESSAGE("*  Unknown exception was cought !!!");
   }
   MESSAGE("}");
 }
 
+QModelIndex PatternDataSelectionModel::_geomSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject )
+{
+  MESSAGE("PatternDataSelectionModel::_geomSelectionChanged(){");
+  QModelIndexList assocsIndexes;// elements of the model which is associated to the geom object and that is to be selected
+  QModelIndex assocIndex;
+
+  if (HEXABLOCKGUI::assocInProgress) return assocIndex;
+  bool fromGEOM = ( strcmp("GEOM", anIObject->getComponentDataType()) == 0 );
+  if ( !fromGEOM ) return assocIndex;
+  if (!_salomeSelectionMgr) return assocIndex;
+
+  QString aName;
+  GEOM::GEOM_Object_var aGeomObj = GEOMBase::ConvertIOinGEOMObject( anIObject );
+
+  int anIndex = -1;
+  if ( GEOMBase::IsShape(aGeomObj) ){
+    aName = GEOMBase::GetName(aGeomObj);
+    TColStd_IndexedMapOfInteger anIndexes;
+    _salomeSelectionMgr->GetIndexes(anIObject, anIndexes);
+    if ( anIndexes.Extent() == 1 )
+      anIndex = anIndexes(1);
+      QString aGeomObjStudyEntry = aGeomObj->GetStudyEntry();
+      QString aGeomObjModelEntry = aGeomObjStudyEntry + "," + QString::number(anIndex) + ";";
+      assocsIndexes = _indexListOf( aGeomObjModelEntry, HEXA_ASSOC_ENTRY_ROLE );
+      if ( !_theModelSelectionChanged && assocsIndexes.count()>0 && assocsIndexes[0].isValid() ){ // select in model
+         _theGeomSelectionChanged = true;
+         setCurrentIndex( assocsIndexes[0], QItemSelectionModel::Clear );  //CS_TEST
+         setCurrentIndex( assocsIndexes[0], QItemSelectionModel::SelectCurrent );
+         _theGeomSelectionChanged = false;
+      } else {
+        clearSelection();
+      }
+    }
+
+  MESSAGE("}");
+
+  if (assocsIndexes.count() > 0)
+  {
+//       HEXABLOCKGUI::currentVtkView->setFocus();
+         highlightVTKElts(assocsIndexes);
+         return assocsIndexes[0];
+  }
+  return assocIndex;
+}
+
+QModelIndex PatternDataSelectionModel::_vtkSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject )
+{
+  MESSAGE("PatternDataSelectionModel::_vtkSelectionChanged(){");
+  QModelIndex anIOIndex;// // the element of the model which is associated to the Interactive object and that is to be selected
+
+  bool fromVTK  = ( strcmp("HEXABLOCK", anIObject->getComponentDataType()) == 0 );
+  if ( !fromVTK ) return anIOIndex;
+
+  SVTK_ViewWindow* currentVTKViewWindow = _getVTKViewWindow();
+  if ( !currentVTKViewWindow )  return anIOIndex;
+  if ( !anIObject->hasEntry() ) return anIOIndex;
+
+  QString anIOEntry = anIObject->getEntry();
+  Document_Actor *anDocActor = NULL;
+  int anhexaElemsId;
+
+  QString aText = "";
+  if ( GetNameOfSelectedElements( currentVTKViewWindow, anIObject, aText ) <= 0 ) return anIOIndex;
+  anDocActor = dynamic_cast<Document_Actor*>( findActorByEntry( currentVTKViewWindow, anIOEntry.toLatin1() ) );
+  if ( !anDocActor ) return anIOIndex;
+  anhexaElemsId = anDocActor->hexaElemsId[ aText.toInt() ];
+  anIOEntry = QString::number( anhexaElemsId );
+  anIOIndex = _indexOf( anIOEntry, HEXA_ENTRY_ROLE );
+
+  if ( !_theModelSelectionChanged && anIOIndex.isValid() ){ // select in model
+    _theVtkSelectionChanged = true;
+
+    //Temporary Debug for hexa selection -----------------------------------------------------------------
+    if (getSelectionFilter() == HEXA_TREE)
+    {
+       DocumentModel               *docModel = NULL;
+       const QSortFilterProxyModel *pModel   = dynamic_cast<const QSortFilterProxyModel *>( model() );
+
+       if ( pModel != NULL){
+               docModel = dynamic_cast<DocumentModel*>( pModel->sourceModel() );
+               if ( docModel != NULL && anIOIndex.isValid())
+               {
+                       //get the selected quad
+                       HEXA_NS::Quad* quad = docModel->getHexaPtr<HEXA_NS::Quad*>(anIOIndex);
+                       if (quad != NULL)
+                       {
+                               //get the hexa the quad belongs to
+                               HEXA_NS::Hexa* hexa = docModel->getQuadHexa(quad);
+                               if (hexa != NULL) //convert the hexa to a QModelIndex so we can select it in the model
+                                       anIOIndex = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(hexa));
+                               else
+                               {
+                                       SUIT_MessageBox::critical( 0,
+                                                                       tr("HexaBlock"),
+                                                                       tr("The Hexahedron This quad belongs to has been deleted!"));
+                                       return anIOIndex;
+                               }
+                       }
+               }
+       }
+    }//end if HEXA_TREE------------------------------------------------------------------------------------
+
+    setCurrentIndex( anIOIndex, QItemSelectionModel::Clear );
+    setCurrentIndex( anIOIndex, QItemSelectionModel::SelectCurrent );
+    _theVtkSelectionChanged = false;
+  } else {
+    clearSelection();
+  }
+
+//  if (anIOIndex.isValid())
+//       _selectVTK(anIOIndex);
+
+//  if (anIOIndex.isValid())
+//  {
+//       QModelIndexList l;
+//       l << anIOIndex;
+//       highlightVTKElts(l);
+//       _highlightGEOM(anIOIndex); // JMD test à faire
+//  }
+  MESSAGE("}");
+  return anIOIndex;
+}
+
+
 SVTK_ViewWindow* PatternDataSelectionModel::_getVTKViewWindow()
 {
-  SVTK_ViewWindow* aVtkView = HEXABLOCKGUI::currentVtkView;
-  return aVtkView;
+//  SVTK_ViewWindow* aVtkView = HEXABLOCKGUI::currentVtkView;
+  return HEXABLOCKGUI::currentVtkView;
 }
 
 
 OCCViewer_ViewWindow*  PatternDataSelectionModel::_getOCCViewWindow()
 {
-  OCCViewer_ViewWindow* aOccView = HEXABLOCKGUI::currentOccView;
-  return aOccView;
+//  OCCViewer_ViewWindow* aOccView = HEXABLOCKGUI::currentOccView;
+//  MESSAGE(" dans OCCViewer" << aOccView);
+  return HEXABLOCKGUI::currentOccView;
 }
 
 
@@ -344,26 +489,41 @@ QModelIndex PatternDataSelectionModel::_indexOf( const QString& anEntry, int rol
 }
 
 
-void PatternDataSelectionModel::_setVTKSelectionMode( const QModelIndex& eltIndex, SVTK_ViewWindow* vtkViewWindow )
+QModelIndexList PatternDataSelectionModel::_indexListOf( const QString& anEntry, int role )
+{
+  QModelIndexList theIndexes; // element (vertex, edge, quad) of model
+  const QAbstractItemModel* theModel = model();
+  if ( !theModel ) return theIndexes;
+  theIndexes = theModel->match( theModel->index(0, 0),
+                                          role,
+                                          anEntry,
+                                          -1,
+                                          Qt::MatchRecursive | Qt::MatchContains );//Qt::MatchFixedString );
+  return theIndexes;
+}
+
+
+void PatternDataSelectionModel::_setVTKSelectionMode( const QModelIndex& eltIndex )
 {
-  MESSAGE("PatternDataSelectionModel::_setVTKSelectionMode( "<< eltIndex.data().toString().toStdString() << " ," << vtkViewWindow << " )");
+  MESSAGE("PatternDataSelectionModel::_setVTKSelectionMode( "<< eltIndex.data().toString().toStdString() << " )");
   QVariant treeVariant = eltIndex.data( HEXA_TREE_ROLE );
   if ( !treeVariant.isValid() ) return;
   int eltType = treeVariant.toInt();
 
-  if ( (_selectionFilter != -1) and ( _selectionFilter != eltType ) ) return;
+//  if ( (_selectionFilter != -1) and ( _selectionFilter != eltType ) ) return;
+  if ( _selectionFilter == eltType ) return;
 
   switch ( eltType ){
     case VERTEX_TREE :
-    case VERTEX_DIR_TREE : vtkViewWindow->SetSelectionMode(NodeSelection); MESSAGE("VERTEX"); break;
+    case VERTEX_DIR_TREE : setVertexSelection(); MESSAGE("VERTEX"); break;
     case EDGE_TREE :
-    case EDGE_DIR_TREE :   vtkViewWindow->SetSelectionMode(EdgeSelection); MESSAGE("EDGE");     break;
+    case EDGE_DIR_TREE :   setEdgeSelection(); MESSAGE("EDGE");     break;
     case QUAD_TREE :
-    case QUAD_DIR_TREE :   vtkViewWindow->SetSelectionMode(FaceSelection); MESSAGE("QUAD");     break;
+    case QUAD_DIR_TREE :   setQuadSelection(); MESSAGE("QUAD");     break;
     case HEXA_TREE :
-    case HEXA_DIR_TREE :   vtkViewWindow->SetSelectionMode(VolumeSelection); MESSAGE("HEXA");   break;
+    case HEXA_DIR_TREE :   setHexaSelection();  MESSAGE("HEXA");   break;
     case PROPAGATION_TREE :
-    case PROPAGATION_DIR_TREE :   vtkViewWindow->SetSelectionMode(EdgeSelection); MESSAGE("PROPAGATION");   break;
+    case PROPAGATION_DIR_TREE :   setEdgeSelection(); MESSAGE("PROPAGATION");   break;
 //  CellSelection,
 //  EdgeOfCellSelection,
 //  VolumeSelection,
@@ -372,7 +532,6 @@ void PatternDataSelectionModel::_setVTKSelectionMode( const QModelIndex& eltInde
 }
 
 
-
 void PatternDataSelectionModel::highlightVTKElts( const QModelIndexList& elts )
 {
        if (!elts.size()) return;
@@ -385,9 +544,11 @@ void PatternDataSelectionModel::highlightVTKElts( const QModelIndexList& elts )
        // document selection
        Document_Actor* docActor = NULL;
        Handle(SALOME_InteractiveObject) docIO;
+//     Handle(SALOME_InteractiveObject) docIO2; //JMD
 
        // element highlight
        TColStd_MapOfInteger aMap;
+//     TColStd_MapOfInteger aMap2;
        QList<int>::const_iterator anIter;
        int vtkElemsId;
 
@@ -406,20 +567,77 @@ void PatternDataSelectionModel::highlightVTKElts( const QModelIndexList& elts )
        docActor = dynamic_cast<Document_Actor*>( findActorByEntry( currentVTKViewWindow, docEntry.toLatin1() ) );
        if ( docActor == NULL) return;
 
+
        //   // Set selection mode in VTK view
-//     currentVTKViewWindow->SetSelectionMode(EdgeSelection);
+//     currentVTKViewWindow->SetSelectionMode(VolumeSelection);
        docIO = docActor->getIO();
 
+
+
+//     QString autreDocentry  = "toti";
+//     Associate_Actor* associateActor = dynamic_cast<Associate_Actor*>( findActorByEntry( currentVTKViewWindow, autreDocentry.toLatin1() ) );
+//     docIO2 = associateActor->getIO();
+
        // Highlight in vtk view the element from document
-       QString edgeEntry;
+       //bool rr = true;
+
+       QString eltEntry;
        foreach( const QModelIndex& iElt, elts ){
-               edgeEntry = iElt.data( HEXA_ENTRY_ROLE ).toString();
-               vtkElemsId = docActor->vtkElemsId[ edgeEntry.toInt() ];
+               eltEntry = iElt.data( HEXA_ENTRY_ROLE ).toString();
+               vtkElemsId = docActor->vtkElemsId[ eltEntry.toInt() ];
                if ( vtkElemsId > 0 ) aMap.Add( vtkElemsId );
+//             if (rr) {
+//               if ( vtkElemsId > 0 ) aMap.Add( vtkElemsId );
+//             }
+//             else
+//             {
+//               if ( vtkElemsId > 0 ) aMap2.Add( vtkElemsId );
+//             }
+//             rr = ! rr;
        }
 
-       selector->AddOrRemoveIndex( docIO, aMap, false );
+       selector->AddOrRemoveIndex( docIO, aMap, false ); //true
+//     selector->RemoveIObject(docActor);
        currentVTKViewWindow->highlight( docIO, true, true );
+//     Document_Actor* docActor = NULL;
+//             QVariant docEntryVariant    = selected.data( HEXA_DOC_ENTRY_ROLE );
+//             if ( docEntryVariant.isValid() ){
+//                     QString docEntry = docEntryVariant.toString();
+//                     docActor = dynamic_cast<Document_Actor*>( findActorByEntry( HEXABLOCKGUI::currentVtkView, docEntry.toLatin1() ) );
+//                     if ( docActor != NULL) HEXABLOCKGUI::currentVtkView->getView()->highlight( docActor->getIO(), false,  false );
+//             }
+//     currentVTKViewWindow->getView()->SetColor(docIO, QColor("blue"));
+
+
+//     selector->AddOrRemoveIndex( docIO2, aMap2, false );
+//     currentVTKViewWindow->highlight( docIO2, true, true );
+}
+
+//SUIT_ViewManager* PatternDataSelectionModel::initOccViewManager()
+//{
+//  SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+//  SUIT_ViewManager* occVm = anApp->getViewManager( OCCViewer_Viewer::Type(), true );
+//  SVTK_ViewWindow* viewWindow = dynamic_cast<SVTK_ViewWindow*>(svw);
+//  return viewWindow;
+//}
+SUIT_ViewWindow* PatternDataSelectionModel::initOccViewManager()
+{
+ SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+ SUIT_ViewManager* occVm = anApp->getViewManager( OCCViewer_Viewer::Type(), true );
+
+ QVector<SUIT_ViewWindow*> viewS = occVm->getViews ();
+
+ int nb = viewS.count();
+
+ MESSAGE("????HexaBaseDialog::initOccView number of : " << nb);
+
+ if (nb == 1)
+ {
+   MESSAGE(" OK     ????HexaBaseDialog::initOccView number of : " << nb);
+   return viewS.first();
+ }
+
+ return NULL;
 }
 
 // 1 vertex -> 1 point
@@ -428,17 +646,28 @@ void PatternDataSelectionModel::highlightVTKElts( const QModelIndexList& elts )
 void PatternDataSelectionModel::_highlightGEOM( const QMultiMap<QString, int>&  entrySubIDs )
 {
   MESSAGE("PatternDataSelectionModel::_highlightGEOM( const QMultiMap<QString, int>&  entrySubIDs ){");
+  MESSAGE("debut    entry => "<< entrySubIDs.count());
 
   OCCViewer_ViewWindow*  occView = _getOCCViewWindow();
-  if ( occView == NULL ) return;
-  SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>( occView->getViewManager()->getViewModel() ); 
+  if ( occView == NULL ) {
+//     occView =  (OCCViewer_ViewWindow*)initOccViewManager();
+//     if ( occView == NULL )
+         return;
+  }
+  MESSAGE("step 1    occView=> " << occView);
+
+  MESSAGE("step 1    entry => ");
+  SOCC_Viewer* soccViewer = dynamic_cast<SOCC_Viewer*>( occView->getViewManager()->getViewModel() );
   if (!soccViewer) return;
+  MESSAGE("step 2    entry => ");
   _PTR(Study) aStudy = GetActiveStudyDocument();
   if (!aStudy) return;
+  MESSAGE("step 3    entry => ");
 
   CORBA::Object_var     aCorbaObj = CORBA::Object::_nil();
   GEOM::GEOM_Object_var aGeomObj  = GEOM::GEOM_Object::_nil();
   erasePreview(true);
+  MESSAGE("Avant    entry => "<< entrySubIDs.count());
   foreach ( QString entry, entrySubIDs.keys() ){
     _PTR(SObject) aSChild = aStudy->FindObjectID( entry.toStdString() );
     MESSAGE("*    entry => "<< entry.toStdString());
@@ -452,7 +681,7 @@ void PatternDataSelectionModel::_highlightGEOM( const QMultiMap<QString, int>&
         MESSAGE("*  !aSh.IsNull() ");
         TColStd_IndexedMapOfInteger anIndexes;
         foreach ( int subid, entrySubIDs.values(entry) ){
-          if ( subid != -1 ) 
+          if ( subid != -1 )
             anIndexes.Add( subid );
         }
         if ( anIndexes.Extent() > 0 ){ // if it's a sub-shape
@@ -486,18 +715,21 @@ void PatternDataSelectionModel::_highlightGEOM( const QModelIndex & anEltIndex )
   const QSortFilterProxyModel *pModel   = dynamic_cast<const QSortFilterProxyModel *>( model() );
 
   if ( !pModel ) return;
-  docModel = dynamic_cast<DocumentModel*>( pModel->sourceModel() ); 
+  docModel = dynamic_cast<DocumentModel*>( pModel->sourceModel() );
   if ( !docModel ) return;
   assocs = docModel->getAssociations( pModel->mapToSource(anEltIndex) );
   foreach( const DocumentModel::GeomObj& anAssoc, assocs )
-    assocEntrySubIDs.insert( anAssoc.entry, anAssoc.subid.toInt() );
+  {
+//       MESSAGE("              dedans " << anAssoc.entry.toStdString());
+//       MESSAGE("                   + " << anAssoc.subid.toInt());
+         assocEntrySubIDs.insert( anAssoc.entry, anAssoc.subid.toInt() );
 
+  }
   _highlightGEOM( assocEntrySubIDs );
   MESSAGE("}");
 }
 
 
-
 void PatternDataSelectionModel::_selectVTK( const QModelIndex& eltIndex )
 {
   MESSAGE("PatternDataSelectionModel::_selectVTK( "<< eltIndex.data().toString().toStdString() << ")");
@@ -539,7 +771,7 @@ void PatternDataSelectionModel::_selectVTK( const QModelIndex& eltIndex )
   if ( docActor == NULL ) return;
 
   // Set selection mode in VTK view
-  _setVTKSelectionMode( eltIndex, currentVTKViewWindow );
+  //_setVTKSelectionMode( eltIndex, currentVTKViewWindow );
 
 // if ( _salomeSelectionMgr == NULL ) return;
 //   _salomeSelectionMgr->selectedObjects( aList );
@@ -547,8 +779,8 @@ void PatternDataSelectionModel::_selectVTK( const QModelIndex& eltIndex )
 //   aList.Append(docIO);
 //   _salomeSelectionMgr->setSelectedObjects( aList, true );//false );//true ); //CS_BP false?
   docIO = docActor->getIO();
-  // Highlight in vtk view the element from document 
+
+  // Highlight in vtk view the element from document
   vtkElemsId = docActor->vtkElemsId[ eltEntry.toInt() ];// get vtk ids from actor
   if ( vtkElemsId > 0 ) // CS_BP ?: erreur si 1er elt == vertex (0,0,0)
     aMap.Add( vtkElemsId );
@@ -561,106 +793,6 @@ void PatternDataSelectionModel::_selectVTK( const QModelIndex& eltIndex )
   MESSAGE("}");
 }
 
-QModelIndex PatternDataSelectionModel::_geomSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject )
-{
-  MESSAGE("PatternDataSelectionModel::_geomSelectionChanged(){");
-  QModelIndex eltIndex;// the element of the model which is associated to the geom object and that is to be selected
-
-  bool fromGEOM = ( strcmp("GEOM", anIObject->getComponentDataType()) == 0 );
-  if ( !fromGEOM ) return eltIndex;
-  if (!_salomeSelectionMgr) return eltIndex;
-
-  QString aName;
-  GEOM::GEOM_Object_var aGeomObj = GEOMBase::ConvertIOinGEOMObject( anIObject );
-
-  int anIndex = -1;
-  if ( GEOMBase::IsShape(aGeomObj) ){
-    aName = GEOMBase::GetName(aGeomObj);
-    TColStd_IndexedMapOfInteger anIndexes;
-    _salomeSelectionMgr->GetIndexes(anIObject, anIndexes);
-    if ( anIndexes.Extent() == 1 )
-      anIndex = anIndexes(1);
-      QString aGeomObjStudyEntry = aGeomObj->GetStudyEntry();
-      QString aGeomObjModelEntry = aGeomObjStudyEntry + "," + QString::number(anIndex) + ";";
-      eltIndex = _indexOf( aGeomObjModelEntry, HEXA_ASSOC_ENTRY_ROLE );
-      if ( !_theModelSelectionChanged && eltIndex.isValid() ){ // select in model
-        _theGeomSelectionChanged = true;
-        //       select( newIndex, QItemSelectionModel::ClearAndSelect );
-        //       select( newIndex, QItemSelectionModel::SelectCurrent );
-//         setCurrentIndex( eltIndex, QItemSelectionModel::SelectCurrent );
-        setCurrentIndex( eltIndex, QItemSelectionModel::Clear );  //CS_TEST
-        setCurrentIndex( eltIndex, QItemSelectionModel::SelectCurrent );
-        _theGeomSelectionChanged = false;
-
-      } else {
-        clearSelection();
-      }
-    }
-
-  MESSAGE("}");
-  return eltIndex;
-}
-
-QModelIndex PatternDataSelectionModel::_vtkSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject )
-{
-  MESSAGE("PatternDataSelectionModel::_vtkSelectionChanged(){");
-  QModelIndex anIOIndex;// // the element of the model which is associated to the Interactive object and that is to be selected
-
-  bool fromVTK  = ( strcmp("HEXABLOCK", anIObject->getComponentDataType()) == 0 );
-  if ( !fromVTK ) return anIOIndex;
-  SVTK_ViewWindow* currentVTKViewWindow = _getVTKViewWindow();
-  if ( !currentVTKViewWindow )  return anIOIndex;
-  if ( !anIObject->hasEntry() ) return anIOIndex;
-  
-  QString anIOEntry = anIObject->getEntry();
-  Document_Actor *anDocActor = NULL;
-  int anhexaElemsId;
-
-  QString aText = "";
-  if ( GetNameOfSelectedElements( currentVTKViewWindow, anIObject, aText ) <= 0 ) return anIOIndex;
-  anDocActor = dynamic_cast<Document_Actor*>( findActorByEntry( currentVTKViewWindow, anIOEntry.toLatin1() ) );
-  if ( !anDocActor ) return anIOIndex;
-  anhexaElemsId = anDocActor->hexaElemsId[ aText.toInt() ];
-  anIOEntry = QString::number( anhexaElemsId );
-  anIOIndex = _indexOf( anIOEntry, HEXA_ENTRY_ROLE );
-
-  if ( !_theModelSelectionChanged && anIOIndex.isValid() ){ // select in model
-    _theVtkSelectionChanged = true;
-//     select( anIOIndex, QItemSelectionModel::Clear );
-//     select( anIOIndex, QItemSelectionModel::Select );
-//     select( anIOIndex, QItemSelectionModel::ClearAndSelect );
-//     select( anIOIndex, QItemSelectionModel::SelectCurrent );
-//     setCurrentIndex( anIOIndex, QItemSelectionModel::SelectCurrent );
-//     setCurrentIndex( anIOIndex, QItemSelectionModel::SelectCurrent );
-//     setCurrentIndex( anIOIndex, QItemSelectionModel::ClearAndSelect );
-//     setCurrentIndex( anIOIndex, QItemSelectionModel::ClearAndSelect );
-    setCurrentIndex( anIOIndex, QItemSelectionModel::Clear );
-    setCurrentIndex( anIOIndex, QItemSelectionModel::SelectCurrent );
-    _theVtkSelectionChanged = false;
-  } else {
-    clearSelection();
-  }
-
-//  if (anIOIndex.isValid())
-//       _selectVTK(anIOIndex);
-
-  if (anIOIndex.isValid())
-  {
-         QModelIndexList l;
-         l << anIOIndex;
-         highlightVTKElts(l);
-  }
-
-  MESSAGE("}");
-  return anIOIndex;
-}
-
-
-
-
-
-
-
 GroupsSelectionModel::GroupsSelectionModel( QAbstractItemModel * model ):
 QItemSelectionModel( model )
 {
@@ -670,7 +802,6 @@ QItemSelectionModel( model )
            this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ) );
 }
 
-
 GroupsSelectionModel::~GroupsSelectionModel()
 {
   disconnect( this, SIGNAL( currentChanged( const QModelIndex &, const QModelIndex & ) ),
@@ -700,15 +831,15 @@ QModelIndex GroupsSelectionModel::indexBy( int role, const QVariant& var )
 
 SVTK_ViewWindow* GroupsSelectionModel::_getVTKViewWindow()
 {
-  SVTK_ViewWindow* aVtkView = HEXABLOCKGUI::currentVtkView;
-  return aVtkView;
+//  SVTK_ViewWindow* aVtkView = HEXABLOCKGUI::currentVtkView;
+  return HEXABLOCKGUI::currentVtkView;
 }
 
 
 void GroupsSelectionModel::_highlightGroups( const QModelIndex& eltIndex )
 {
   const GroupsModel* m = dynamic_cast<const GroupsModel *>( model() );
-  
+
 // ---- VTK ----
   if ( m == NULL ) return;
   SVTK_ViewWindow* currentVTKViewWindow = _getVTKViewWindow();
@@ -728,7 +859,7 @@ void GroupsSelectionModel::_highlightGroups( const QModelIndex& eltIndex )
   int vtkElemsId;
 
 
-  
+
   // debut ** data from model
   int     eltType;
   QString docEntry;
@@ -736,7 +867,7 @@ void GroupsSelectionModel::_highlightGroups( const QModelIndex& eltIndex )
   QVariant treeVariant        = eltIndex.data( HEXA_TREE_ROLE );
   QVariant docEntryVariant    = eltIndex.data( HEXA_DOC_ENTRY_ROLE );
 
-  if ( !treeVariant.isValid() || !docEntryVariant.isValid() ){ 
+  if ( !treeVariant.isValid() || !docEntryVariant.isValid() ){
     //INFOS("data from model not valid");
     return;
   }
@@ -779,86 +910,6 @@ void GroupsSelectionModel::_highlightGroups( const QModelIndex& eltIndex )
 
 }
 
-/*
-void GroupsSelectionModel::_highlightAssoc( const QModelIndex& eltIndex )
-{
-  const GroupsModel* m = dynamic_cast<const GroupsModel *>( model() );
-  
-// ---- VTK ----
-  if ( m == NULL ) return;
-  SVTK_ViewWindow* currentVTKViewWindow = _getVTKViewWindow();
-  if ( currentVTKViewWindow == NULL ) return;
-  SVTK_Selector* selector = currentVTKViewWindow->GetSelector();
-  if ( selector == NULL ) return;
-
-// ----  vtkActor
-  // document selection
-  Document_Actor* docActor = NULL;
-  Handle(SALOME_InteractiveObject) docIO;
-  SALOME_ListIO aList;
-
-  // element highlight
-  TColStd_MapOfInteger aMap;
-  QList<int>::const_iterator anIter;
-  int vtkElemsId;
-
-
-  
-  // debut ** data from model
-  int     eltType;
-  QString docEntry;
-
-  QVariant treeVariant        = eltIndex.data( HEXA_TREE_ROLE );
-  QVariant docEntryVariant    = eltIndex.data( HEXA_DOC_ENTRY_ROLE );
-
-  if ( !treeVariant.isValid() || !docEntryVariant.isValid() ){ 
-    //INFOS("data from model not valid");
-    return;
-  }
-
-  eltType  = treeVariant.toInt();
-  docEntry = docEntryVariant.toString();
- ){
-    //INFOS("bad element typ
-  if ( eltType != GROUP_TREE ){
-    //INFOS("bad element type : not a group item" << eltType );
-    return;
-  }
-  // fin ** data from model
-
-  // Select the document in Salome
-  docActor = dynamic_cast<Document_Actor*>( findActorByEntry( currentVTKViewWindow, docEntry.toLatin1() ) );
-  if ( docActor == NULL) return;
-  docIO = docActor->getIO();
-
-  // Highlight in vtk view the element from document
-  DocumentModel::Group kind;
-  QModelIndexList iElements = m->getGroupElements( eltIndex, kind );
-
-  // Set selection mode in VTK view
-/*
-  switch (kind){
-  case HEXA_NS::HexaCell: case HEXA_NS::HexaNode: currentVTKViewWindow->SetSelectionMode(VolumeSelection); break;
-  case HEXA_NS::QuadCell: case HEXA_NS::QuadNode: currentVTKViewWindow->SetSelectionMode(FaceSelection);   break;
-  case HEXA_NS::EdgeCell: case HEXA_NS::EdgeNode: currentVTKViewWindow->SetSelectionMode(EdgeSelection);   break;
-  case HEXA_NS::VertexNode: currentVTKViewWindow->SetSelectionMode(NodeSelection); break;
-  }---/
-
-  QString eltEntry;
-  foreach( const QModelIndex& iElt, iElements ){
-    eltEntry = iElt.data( HEXA_ENTRY_ROLE ).toString();
-    vtkElemsId = docActor->vtkElemsId[ eltEntry.toInt() ];
-    if() 
-      if ( vtkElemsId > 0 ) aMap.Add( vtkElemsId );
-  }
-
-  selector->AddOrRemoveIndex( docIO, aMap, false );
-  currentVTKViewWindow->highlight( docIO, true, true );
-
-}*/
-
-
-
 void GroupsSelectionModel::onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected )
 {
   MESSAGE("GroupsSelectionModel::onSelectionChanged");
@@ -882,12 +933,6 @@ void GroupsSelectionModel::onSelectionChanged( const QItemSelection & selected,
 
 }
 
-
-
-
-
-
-
 MeshSelectionModel::MeshSelectionModel( QAbstractItemModel * model ):
 QItemSelectionModel( model )
 {
@@ -926,8 +971,8 @@ QModelIndex MeshSelectionModel::indexBy( int role, const QVariant& var )
 
 SVTK_ViewWindow* MeshSelectionModel::_getVTKViewWindow()
 {
-  SVTK_ViewWindow* aVtkView = HEXABLOCKGUI::currentVtkView;
-  return aVtkView;
+//  SVTK_ViewWindow* aVtkView = HEXABLOCKGUI::currentVtkView;
+  return HEXABLOCKGUI::currentVtkView;
 }
 
 
@@ -957,7 +1002,7 @@ void MeshSelectionModel::_highlightPropagation( const QModelIndex& eltIndex )
   QVariant treeVariant        = eltIndex.data( HEXA_TREE_ROLE );
   QVariant docEntryVariant    = eltIndex.data( HEXA_DOC_ENTRY_ROLE );
 
-  if ( !treeVariant.isValid() || !docEntryVariant.isValid() ){ 
+  if ( !treeVariant.isValid() || !docEntryVariant.isValid() ){
     //INFOS("data from model not valid");
     return;
   }
@@ -975,10 +1020,10 @@ void MeshSelectionModel::_highlightPropagation( const QModelIndex& eltIndex )
   if ( docActor == NULL) return;
 
 //   // Set selection mode in VTK view
-  currentVTKViewWindow->SetSelectionMode(EdgeSelection); 
+  currentVTKViewWindow->SetSelectionMode(EdgeSelection);
   docIO = docActor->getIO();
-  // Highlight in vtk view the element from document 
+
+  // Highlight in vtk view the element from document
   QModelIndexList iEdges = m->getPropagation( eltIndex );
 
   QString edgeEntry;
@@ -1018,8 +1063,6 @@ void MeshSelectionModel::onSelectionChanged( const QItemSelection & selected, co
 }
 
 
-
-
 // //=================================================================================
 // // function : activateSelection
 // // purpose  : Activate selection in accordance with myEditCurrentArgument
index 43019310c40a65c4fa70819434a91e6de0782510..e2ee8b055bd31dca8b3617366bcbe4dda61fa0ae 100755 (executable)
@@ -21,7 +21,6 @@
 #define _HEXABLOCKGUI_DOCUMENTSELECTIONMODEL_HXX_
 
 #include <QItemSelectionModel>
-
 #include <LightApp_SelectionMgr.h>
 
 #include <SVTK_ViewWindow.h>
@@ -69,14 +68,22 @@ namespace HEXABLOCK
         void setHexaSelection();
         void setAllSelection();
         void highlightVTKElts( const QModelIndexList& elts );
+        void highlightEltsWithAssocs(const QModelIndexList& elts);
+        void _highlightGEOM( const QMultiMap<QString, int>&  entrySubIDs );
+        void _highlightGEOM( const QModelIndex & index );
 
-        // 
         QModelIndex  indexBy( int role, const QString&  value );
         QModelIndex  indexBy( int role, const QVariant& var );
+        int getSelectionFilter() const { return _selectionFilter;}
 
         //Salome
         void setSalomeSelectionMgr( LightApp_SelectionMgr* mgr );
         void SetSelectionMode( Selection_Mode theMode );
+        QModelIndex _geomSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject );
+        QModelIndex _vtkSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject );
+
+
+        bool salomeNothingSelected;
 
       protected slots:
         void onCurrentChanged( const QModelIndex & current, const QModelIndex & previous );
@@ -88,21 +95,19 @@ namespace HEXABLOCK
         OCCViewer_ViewWindow*  _getOCCViewWindow();
 
         QModelIndex _indexOf( const QString& anIOEntry, int role );
-        void _setVTKSelectionMode( const QModelIndex& eltIndex, SVTK_ViewWindow* vtkViewWindow );
-        void _highlightGEOM( const QMultiMap<QString, int>&  entrySubIDs );
-        void _highlightGEOM( const QModelIndex & index );
+        QModelIndexList _indexListOf( const QString& anEntry, int role );
+        void _setVTKSelectionMode( const QModelIndex& eltIndex );
         void _selectVTK( const QModelIndex & index );
+        SUIT_ViewWindow* initOccViewManager();
 
-        QModelIndex _geomSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject );
-        QModelIndex _vtkSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject );
 
         LightApp_SelectionMgr* _salomeSelectionMgr;
         int                    _selectionFilter;
 
+
         bool _theModelSelectionChanged;
         bool _theVtkSelectionChanged;
         bool _theGeomSelectionChanged;
-
     };
 
 
index d046bce2066ac30090333b5d0bb50dd89aa207a3..aef9246882819d56becc00b37956215f55f4c8be 100644 (file)
@@ -270,16 +270,21 @@ int GetNameOfSelectedElements( SVTK_ViewWindow *theWindow,
                                QString& theName )
 {
     SVTK_Selector* theSelector = theWindow->GetSelector();
+
     theName = "";
+
     TColStd_IndexedMapOfInteger aMapIndex;
     theSelector->GetIndex(theIO,aMapIndex);
 
     typedef std::set<int> TIdContainer;
+
     std::set<int> anIdContainer;
+
     for( int i = 1; i <= aMapIndex.Extent(); i++)
       anIdContainer.insert(aMapIndex(i));
 
     std::set<int>::const_iterator anIter = anIdContainer.begin();
+
     for( ; anIter != anIdContainer.end(); anIter++)
       theName += QString(" %1").arg(*anIter);
 
index 71738ccd5dbb32549f1c6eca6ea8366d28b8b470..9b64ae7baf38bf547ed32f44a4a54305cf2a28e3 100644 (file)
@@ -46,11 +46,15 @@ namespace HEXABLOCK
 
   SALOME_Actor* findActorByEntry( SVTK_ViewWindow *theVtkViewWindow, const char* theEntry );
   _PTR(Study)   GetActiveStudyDocument();
+
   CORBA::Object_var corbaObj( _PTR(SObject) theSO );
+
   CORBA::Object_var corbaObj( const Handle(SALOME_InteractiveObject)& theIO );
+
   int GetNameOfSelectedElements( SVTK_ViewWindow *theWindow,/* SVTK_Selector* theSelector,*/
                                  const Handle(SALOME_InteractiveObject)& theIO,
                                  QString& theName );
+
   std::string shape2string( const TopoDS_Shape& aShape );
 
 
index 9b7a2e192522082c72d7359b7a2528c569ba52d6..c8b563e9e23cc0c14ddc7be4b8c8014264618cdd 100755 (executable)
 
 #include "HEXABLOCKGUI_Trace.hxx"
 
-
 #ifdef WNT
 #include <process.h>
 #define getpid _getpid
 #else
+#include <sys/types.h>
 #include <unistd.h>
 #endif
 
index 85f2389dc14b99898e618ba1ef8305658ccce3c8..5b1e818fba8084b21ba52e70c5db656e99ff1476 100755 (executable)
@@ -6,12 +6,12 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>217</width>
-    <height>387</height>
+    <width>215</width>
+    <height>412</height>
    </rect>
   </property>
   <property name="sizePolicy">
-   <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+   <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
    <string>Hexahedron Construction</string>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout">
-   <property name="sizeConstraint">
-    <enum>QLayout::SetMinimumSize</enum>
-   </property>
    <item>
     <widget class="QGroupBox" name="groupBox_3">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="title">
       <string>Result Name</string>
      </property>
-     <layout class="QFormLayout" name="formLayout_2">
+     <layout class="QFormLayout" name="formLayout">
       <item row="0" column="0">
        <widget class="QLabel" name="label_15">
         <property name="text">
       <item row="0" column="1">
        <widget class="QLineEdit" name="name_le">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
@@ -66,7 +69,7 @@
      <property name="title">
       <string>Hexa</string>
      </property>
-     <layout class="QHBoxLayout" name="horizontalLayout_5">
+     <layout class="QHBoxLayout" name="horizontalLayout">
       <item>
        <widget class="QRadioButton" name="quads_rb">
         <property name="sizePolicy">
    </item>
    <item>
     <widget class="QGroupBox" name="groupBox">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="title">
       <string>Arguments</string>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_2">
       <item>
        <widget class="QListWidget" name="quads_lw">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="toolTip">
          <string>Select a quad</string>
         </property>
       </item>
       <item>
        <widget class="QListWidget" name="vertices_lw">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="toolTip">
          <string>Select a vertex</string>
         </property>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>name_le</tabstop>
+  <tabstop>quads_lw</tabstop>
+  <tabstop>vertices_lw</tabstop>
+  <tabstop>quads_rb</tabstop>
+  <tabstop>vertices_rb</tabstop>
+ </tabstops>
  <resources/>
  <connections>
   <connection>
    <sender>quads_rb</sender>
    <signal>clicked()</signal>
-   <receiver>quads_lw</receiver>
-   <slot>show()</slot>
+   <receiver>vertices_lw</receiver>
+   <slot>hide()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>74</x>
+     <x>95</x>
      <y>45</y>
     </hint>
     <hint type="destinationlabel">
-     <x>135</x>
-     <y>220</y>
+     <x>173</x>
+     <y>435</y>
     </hint>
    </hints>
   </connection>
   <connection>
    <sender>quads_rb</sender>
    <signal>clicked()</signal>
-   <receiver>vertices_lw</receiver>
-   <slot>hide()</slot>
+   <receiver>quads_lw</receiver>
+   <slot>show()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>95</x>
+     <x>74</x>
      <y>45</y>
     </hint>
     <hint type="destinationlabel">
-     <x>173</x>
-     <y>435</y>
+     <x>135</x>
+     <y>220</y>
     </hint>
    </hints>
   </connection>
index bdd0f8d83396c8bb287fdbb036c6ee74573eee27..da20b114a2285a06c86df623f4e1055729ab30fa 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>256</width>
-    <height>440</height>
+    <width>259</width>
+    <height>543</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -17,7 +17,7 @@
    <item>
     <widget class="QGroupBox" name="groupBox_8">
      <property name="sizePolicy">
-      <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
+      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      <property name="title">
       <string>From</string>
      </property>
-     <layout class="QFormLayout" name="formLayout_3">
-      <item row="0" column="0" colspan="2">
+     <layout class="QVBoxLayout" name="verticalLayout_2">
+      <item>
        <widget class="QGroupBox" name="groupBox_5">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+         <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
          <string>Quadrangle(s)</string>
         </property>
         <layout class="QGridLayout" name="gridLayout_4">
-         <item row="0" column="0" rowspan="2">
-          <widget class="QListWidget" name="quads_lw">
+         <item row="0" column="0">
+          <widget class="QListWidget" name="quads_lw"/>
+         </item>
+        </layout>
+       </widget>
+      </item>
+      <item>
+       <widget class="QWidget" name="widget" native="true">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <layout class="QFormLayout" name="formLayout_3">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_3">
+           <property name="text">
+            <string>Point a</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QLineEdit" name="vex0_le">
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Expanding">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
-           <property name="toolTip">
-            <string extracomment="select quad"/>
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>16777215</height>
+            </size>
+           </property>
+           <property name="readOnly">
+            <bool>false</bool>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="0">
+          <widget class="QLabel" name="label_4">
+           <property name="text">
+            <string>Point b</string>
            </property>
-           <property name="statusTip">
-            <string/>
+          </widget>
+         </item>
+         <item row="1" column="1">
+          <widget class="QLineEdit" name="vex2_le">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
            </property>
-           <property name="whatsThis">
-            <string/>
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>16777215</height>
+            </size>
            </property>
-           <property name="selectionMode">
-            <enum>QAbstractItemView::MultiSelection</enum>
+           <property name="readOnly">
+            <bool>false</bool>
            </property>
           </widget>
          </item>
         </layout>
        </widget>
       </item>
-      <item row="1" column="0">
-       <widget class="QLabel" name="label_3">
-        <property name="text">
-         <string>Point a</string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="1">
-       <widget class="QLineEdit" name="vex0_le">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="maximumSize">
-         <size>
-          <width>127</width>
-          <height>16777215</height>
-         </size>
-        </property>
-        <property name="readOnly">
-         <bool>false</bool>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="0">
-       <widget class="QLabel" name="label_4">
-        <property name="text">
-         <string>Point b</string>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="1">
-       <widget class="QLineEdit" name="vex2_le">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="maximumSize">
-         <size>
-          <width>127</width>
-          <height>16777215</height>
-         </size>
-        </property>
-        <property name="readOnly">
-         <bool>false</bool>
-        </property>
-       </widget>
-      </item>
      </layout>
     </widget>
    </item>
       <item row="0" column="1">
        <widget class="QLineEdit" name="quad_dest_le">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
       <item row="1" column="1">
        <widget class="QLineEdit" name="vex1_le">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
       <item row="2" column="1">
        <widget class="QLineEdit" name="vex3_le">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
       <item row="0" column="1">
        <widget class="QSpinBox" name="nb_spb">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>vex0_le</tabstop>
+  <tabstop>vex2_le</tabstop>
+  <tabstop>quad_dest_le</tabstop>
+  <tabstop>vex1_le</tabstop>
+  <tabstop>vex3_le</tabstop>
+  <tabstop>nb_spb</tabstop>
+ </tabstops>
  <resources/>
  <connections/>
 </ui>
index 5e33574ef6843ce4d208943856a56f6feeb4853d..1f9dbd1f8f3e10bbb2aec918a5d276afdfe11418 100644 (file)
       </item>
       <item row="0" column="1">
        <widget class="QLineEdit" name="name_le">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
       </item>
       <item row="3" column="1">
        <widget class="QComboBox" name="kind_cb">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <item>
          <property name="text">
           <string>Uniform</string>
index 6ebaeea3c9f3302784a9e27a2433e994df93936f..78953b6be16e6e4ba1c598b60a0b4099a0ae83e0 100644 (file)
@@ -6,12 +6,12 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>232</width>
-    <height>540</height>
+    <width>219</width>
+    <height>500</height>
    </rect>
   </property>
   <property name="sizePolicy">
-   <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
@@ -21,7 +21,7 @@
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_2">
    <property name="sizeConstraint">
-    <enum>QLayout::SetMinimumSize</enum>
+    <enum>QLayout::SetDefaultConstraint</enum>
    </property>
    <item>
     <widget class="QGroupBox" name="groupBox_6">
      <layout class="QVBoxLayout" name="verticalLayout">
       <item>
        <widget class="QWidget" name="widget_3" native="true">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <layout class="QFormLayout" name="formLayout">
-         <property name="labelAlignment">
-          <set>Qt::AlignJustify|Qt::AlignVCenter</set>
+         <property name="fieldGrowthPolicy">
+          <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
          </property>
          <item row="0" column="0">
           <widget class="QLabel" name="label_8">
          </item>
          <item row="0" column="1">
           <widget class="QLineEdit" name="vex_le_rb0">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
              <width>16777215</width>
          </item>
          <item row="1" column="1">
           <widget class="QLineEdit" name="vec_le_rb0">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
              <width>16777215</width>
            </property>
           </widget>
          </item>
-         <item row="2" column="0" colspan="2">
-          <layout class="QFormLayout" name="formLayout_3">
-           <property name="labelAlignment">
+         <item row="2" column="0">
+          <widget class="QLabel" name="label_12">
+           <property name="text">
+            <string>n (x)</string>
+           </property>
+           <property name="alignment">
             <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
            </property>
-           <property name="formAlignment">
-            <set>Qt::AlignJustify|Qt::AlignTop</set>
-           </property>
-           <property name="topMargin">
-            <number>8</number>
-           </property>
-           <item row="0" column="0">
-            <widget class="QLabel" name="label_12">
-             <property name="text">
-              <string>n (x)</string>
-             </property>
-             <property name="alignment">
-              <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
-             </property>
-            </widget>
-           </item>
-           <item row="0" column="1">
-            <widget class="QSpinBox" name="nx_spb_rb0">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="maximum">
-              <number>1000000</number>
-             </property>
-             <property name="value">
-              <number>1</number>
-             </property>
-            </widget>
-           </item>
-           <item row="2" column="1">
-            <widget class="QSpinBox" name="ny_spb_rb0">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="maximum">
-              <number>1000000</number>
-             </property>
-             <property name="value">
-              <number>1</number>
-             </property>
-            </widget>
-           </item>
-           <item row="4" column="1">
-            <widget class="QSpinBox" name="nz_spb_rb0">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="maximum">
-              <number>1000000</number>
-             </property>
-             <property name="value">
-              <number>1</number>
-             </property>
-            </widget>
-           </item>
-           <item row="2" column="0">
-            <widget class="QLabel" name="label_13">
-             <property name="text">
-              <string>n (y)</string>
-             </property>
-            </widget>
-           </item>
-           <item row="4" column="0">
-            <widget class="QLabel" name="label_14">
-             <property name="text">
-              <string>n (z)</string>
-             </property>
-            </widget>
-           </item>
-          </layout>
+          </widget>
+         </item>
+         <item row="2" column="1">
+          <widget class="QSpinBox" name="nx_spb_rb0">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="maximum">
+            <number>1000000</number>
+           </property>
+           <property name="value">
+            <number>1</number>
+           </property>
+          </widget>
+         </item>
+         <item row="3" column="0">
+          <widget class="QLabel" name="label_13">
+           <property name="text">
+            <string>n (y)</string>
+           </property>
+          </widget>
+         </item>
+         <item row="3" column="1">
+          <widget class="QSpinBox" name="ny_spb_rb0">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="maximum">
+            <number>1000000</number>
+           </property>
+           <property name="value">
+            <number>1</number>
+           </property>
+          </widget>
+         </item>
+         <item row="4" column="0">
+          <widget class="QLabel" name="label_14">
+           <property name="text">
+            <string>n (z)</string>
+           </property>
+          </widget>
+         </item>
+         <item row="4" column="1">
+          <widget class="QSpinBox" name="nz_spb_rb0">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="maximum">
+            <number>1000000</number>
+           </property>
+           <property name="value">
+            <number>1</number>
+           </property>
+          </widget>
          </item>
         </layout>
        </widget>
       </item>
       <item>
        <widget class="QWidget" name="widget_2" native="true">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <layout class="QFormLayout" name="formLayout_2">
-         <property name="labelAlignment">
-          <set>Qt::AlignJustify|Qt::AlignVCenter</set>
-         </property>
          <item row="0" column="0">
           <widget class="QLabel" name="label">
            <property name="text">
          </item>
          <item row="0" column="1">
           <widget class="QLineEdit" name="vex_le_rb1">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
              <width>16777215</width>
          </item>
          <item row="1" column="1">
           <widget class="QLineEdit" name="vec_x_le_rb1">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
              <width>16777215</width>
          </item>
          <item row="2" column="1">
           <widget class="QLineEdit" name="vec_y_le_rb1">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
              <width>16777215</width>
          </item>
          <item row="3" column="1">
           <widget class="QLineEdit" name="vec_z_le_rb1">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
              <width>16777215</width>
            </property>
           </widget>
          </item>
-         <item row="4" column="0" colspan="2">
-          <layout class="QFormLayout" name="formLayout_4">
-           <property name="labelAlignment">
-            <set>Qt::AlignJustify|Qt::AlignVCenter</set>
-           </property>
-           <property name="topMargin">
-            <number>8</number>
-           </property>
-           <item row="0" column="0">
-            <widget class="QLabel" name="label_5">
-             <property name="text">
-              <string>n (x)</string>
-             </property>
-            </widget>
-           </item>
-           <item row="0" column="1">
-            <widget class="QSpinBox" name="nx_spb_rb1">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="maximum">
-              <number>1000000</number>
-             </property>
-             <property name="value">
-              <number>1</number>
-             </property>
-            </widget>
-           </item>
-           <item row="2" column="1">
-            <widget class="QSpinBox" name="ny_spb_rb1">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="maximum">
-              <number>1000000</number>
-             </property>
-             <property name="value">
-              <number>1</number>
-             </property>
-            </widget>
-           </item>
-           <item row="4" column="1">
-            <widget class="QSpinBox" name="nz_spb_rb1">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="maximum">
-              <number>1000000</number>
-             </property>
-             <property name="value">
-              <number>1</number>
-             </property>
-            </widget>
-           </item>
-           <item row="2" column="0">
-            <widget class="QLabel" name="label_6">
-             <property name="text">
-              <string>n (y)</string>
-             </property>
-            </widget>
-           </item>
-           <item row="4" column="0">
-            <widget class="QLabel" name="label_7">
-             <property name="text">
-              <string>n (z)</string>
-             </property>
-            </widget>
-           </item>
-          </layout>
+         <item row="4" column="0">
+          <widget class="QLabel" name="label_5">
+           <property name="text">
+            <string>n (x)</string>
+           </property>
+          </widget>
+         </item>
+         <item row="4" column="1">
+          <widget class="QSpinBox" name="nx_spb_rb1">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="maximum">
+            <number>1000000</number>
+           </property>
+           <property name="value">
+            <number>1</number>
+           </property>
+          </widget>
+         </item>
+         <item row="5" column="0">
+          <widget class="QLabel" name="label_6">
+           <property name="text">
+            <string>n (y)</string>
+           </property>
+          </widget>
+         </item>
+         <item row="5" column="1">
+          <widget class="QSpinBox" name="ny_spb_rb1">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="maximum">
+            <number>1000000</number>
+           </property>
+           <property name="value">
+            <number>1</number>
+           </property>
+          </widget>
+         </item>
+         <item row="6" column="0">
+          <widget class="QLabel" name="label_7">
+           <property name="text">
+            <string>n (z)</string>
+           </property>
+          </widget>
+         </item>
+         <item row="6" column="1">
+          <widget class="QSpinBox" name="nz_spb_rb1">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="maximum">
+            <number>1000000</number>
+           </property>
+           <property name="value">
+            <number>1</number>
+           </property>
+          </widget>
          </item>
         </layout>
        </widget>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>rb0</tabstop>
+  <tabstop>rb1</tabstop>
+  <tabstop>vex_le_rb0</tabstop>
+  <tabstop>vec_le_rb0</tabstop>
+  <tabstop>vex_le_rb1</tabstop>
+  <tabstop>vec_x_le_rb1</tabstop>
+  <tabstop>vec_y_le_rb1</tabstop>
+  <tabstop>vec_z_le_rb1</tabstop>
+  <tabstop>nx_spb_rb0</tabstop>
+  <tabstop>ny_spb_rb0</tabstop>
+  <tabstop>nz_spb_rb0</tabstop>
+  <tabstop>nx_spb_rb1</tabstop>
+  <tabstop>ny_spb_rb1</tabstop>
+  <tabstop>nz_spb_rb1</tabstop>
+ </tabstops>
  <resources/>
  <connections>
   <connection>
index 1d6861ebb11c56aa600c4ce66adfdfe4449199d6..d940909d2a6b3aa9e24b2078c426020ad4762ca2 100644 (file)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>190</width>
-    <height>238</height>
+    <height>196</height>
    </rect>
   </property>
   <property name="sizePolicy">
       </item>
       <item row="0" column="1">
        <widget class="QLineEdit" name="cyl_le">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
       </item>
       <item row="1" column="1">
        <widget class="QLineEdit" name="vec_le">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
         </property>
        </widget>
       </item>
-      <item row="5" column="1">
+      <item row="2" column="0">
+       <widget class="QLabel" name="label_3">
+        <property name="text">
+         <string>n (radial)</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="1">
        <widget class="QSpinBox" name="nr_spb">
         <property name="maximum">
          <number>1000000</number>
         </property>
        </widget>
       </item>
-      <item row="5" column="0">
-       <widget class="QLabel" name="label_3">
-        <property name="text">
-         <string>n (radial)</string>
-        </property>
-       </widget>
-      </item>
-      <item row="8" column="0">
-       <widget class="QLabel" name="label_5">
+      <item row="3" column="0">
+       <widget class="QLabel" name="label_4">
         <property name="text">
-         <string>n (heigth)</string>
+         <string>n (angular)</string>
         </property>
        </widget>
       </item>
-      <item row="6" column="1">
+      <item row="3" column="1">
        <widget class="QSpinBox" name="na_spb">
         <property name="maximum">
          <number>1000000</number>
         </property>
        </widget>
       </item>
-      <item row="8" column="1">
+      <item row="4" column="0">
+       <widget class="QLabel" name="label_5">
+        <property name="text">
+         <string>n (heigth)</string>
+        </property>
+       </widget>
+      </item>
+      <item row="4" column="1">
        <widget class="QSpinBox" name="nl_spb">
         <property name="maximum">
          <number>1000000</number>
         </property>
        </widget>
       </item>
-      <item row="6" column="0">
-       <widget class="QLabel" name="label_4">
-        <property name="text">
-         <string>n (angular)</string>
-        </property>
-       </widget>
-      </item>
      </layout>
     </widget>
    </item>
index 38c0d4ba611875215d67a435a79380cc65625829..7d4fc63ad7d26b35afe40d6cc9f283e5f204a3c8 100644 (file)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>212</width>
-    <height>104</height>
+    <height>106</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -26,9 +26,6 @@
       <string>Arguments</string>
      </property>
      <layout class="QFormLayout" name="formLayout">
-      <property name="fieldGrowthPolicy">
-       <enum>QFormLayout::ExpandingFieldsGrow</enum>
-      </property>
       <item row="0" column="0">
        <widget class="QLabel" name="label">
         <property name="text">
       </item>
       <item row="0" column="1">
        <widget class="QLineEdit" name="cyl1_le">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
       </item>
       <item row="1" column="1">
        <widget class="QLineEdit" name="cyl2_le">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
index 1e384345419f27a5d92a120bb157b2ce2419a699..9007a795527c1ed34c3808d70107809c0695f2e6 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>245</width>
-    <height>464</height>
+    <width>223</width>
+    <height>428</height>
    </rect>
   </property>
   <property name="sizePolicy">
   <layout class="QVBoxLayout" name="verticalLayout_3">
    <item>
     <widget class="QGroupBox" name="groupBox">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="title">
       <string>Arguments</string>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_4">
       <item>
        <widget class="QGroupBox" name="groupBox_4">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="title">
          <string/>
         </property>
-        <layout class="QVBoxLayout" name="verticalLayout_2">
-         <item>
-          <layout class="QHBoxLayout" name="horizontalLayout">
-           <item>
-            <widget class="QLabel" name="label">
-             <property name="text">
-              <string>Vertex </string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QLineEdit" name="pt_le">
-             <property name="maximumSize">
-              <size>
-               <width>127</width>
-               <height>16777215</height>
-              </size>
-             </property>
-             <property name="readOnly">
-              <bool>false</bool>
-             </property>
-            </widget>
-           </item>
-          </layout>
+        <layout class="QFormLayout" name="formLayout">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label">
+           <property name="text">
+            <string>Vertex </string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QLineEdit" name="pt_le">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>16777215</height>
+            </size>
+           </property>
+           <property name="readOnly">
+            <bool>false</bool>
+           </property>
+          </widget>
          </item>
         </layout>
        </widget>
       </item>
       <item>
        <widget class="QGroupBox" name="groupBox_3">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="title">
          <string/>
         </property>
-        <layout class="QVBoxLayout" name="verticalLayout">
-         <item>
-          <layout class="QHBoxLayout" name="horizontalLayout_2">
-           <item>
-            <widget class="QLabel" name="label_2">
-             <property name="text">
-              <string>Vector(x)</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QLineEdit" name="vec_x_le">
-             <property name="maximumSize">
-              <size>
-               <width>127</width>
-               <height>16777215</height>
-              </size>
-             </property>
-             <property name="readOnly">
-              <bool>false</bool>
-             </property>
-            </widget>
-           </item>
-          </layout>
+        <layout class="QFormLayout" name="formLayout_4">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_2">
+           <property name="text">
+            <string>Vector(x)</string>
+           </property>
+          </widget>
          </item>
-         <item>
-          <layout class="QHBoxLayout" name="horizontalLayout_4">
-           <item>
-            <widget class="QLabel" name="label_4">
-             <property name="text">
-              <string>Vector(z)</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QLineEdit" name="vec_z_le">
-             <property name="maximumSize">
-              <size>
-               <width>127</width>
-               <height>16777215</height>
-              </size>
-             </property>
-             <property name="readOnly">
-              <bool>false</bool>
-             </property>
-            </widget>
-           </item>
-          </layout>
+         <item row="0" column="1">
+          <widget class="QLineEdit" name="vec_x_le">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>16777215</height>
+            </size>
+           </property>
+           <property name="readOnly">
+            <bool>false</bool>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="0">
+          <widget class="QLabel" name="label_4">
+           <property name="text">
+            <string>Vector(z)</string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="1">
+          <widget class="QLineEdit" name="vec_z_le">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>16777215</height>
+            </size>
+           </property>
+           <property name="readOnly">
+            <bool>false</bool>
+           </property>
+          </widget>
          </item>
         </layout>
        </widget>
       </item>
       <item>
        <widget class="QGroupBox" name="groupBox_2">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="title">
          <string/>
         </property>
            </property>
           </widget>
          </item>
-         <item row="2" column="1">
+         <item row="1" column="0">
+          <widget class="QLabel" name="label_6">
+           <property name="text">
+            <string>da:</string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="1">
           <widget class="QDoubleSpinBox" name="da_spb">
            <property name="decimals">
             <number>6</number>
            </property>
           </widget>
          </item>
-         <item row="4" column="1">
+         <item row="2" column="0">
+          <widget class="QLabel" name="label_7">
+           <property name="text">
+            <string>dl:</string>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="1">
           <widget class="QDoubleSpinBox" name="dl_spb">
            <property name="decimals">
             <number>6</number>
            </property>
           </widget>
          </item>
-         <item row="2" column="0">
-          <widget class="QLabel" name="label_6">
-           <property name="text">
-            <string>da:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="4" column="0">
-          <widget class="QLabel" name="label_7">
-           <property name="text">
-            <string>dl:</string>
-           </property>
-          </widget>
-         </item>
         </layout>
        </widget>
       </item>
       <item>
        <widget class="QGroupBox" name="groupBox_5">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="title">
          <string/>
         </property>
            </property>
           </widget>
          </item>
-         <item row="2" column="1">
-          <widget class="QSpinBox" name="na_spb">
-           <property name="maximum">
-            <number>1000000</number>
-           </property>
-           <property name="value">
-            <number>6</number>
+         <item row="1" column="0">
+          <widget class="QLabel" name="label_9">
+           <property name="text">
+            <string>na:</string>
            </property>
           </widget>
          </item>
-         <item row="4" column="1">
-          <widget class="QSpinBox" name="nl_spb">
+         <item row="1" column="1">
+          <widget class="QSpinBox" name="na_spb">
            <property name="maximum">
             <number>1000000</number>
            </property>
            <property name="value">
-            <number>10</number>
+            <number>6</number>
            </property>
           </widget>
          </item>
          <item row="2" column="0">
-          <widget class="QLabel" name="label_9">
+          <widget class="QLabel" name="label_10">
            <property name="text">
-            <string>na:</string>
+            <string>nl:</string>
            </property>
           </widget>
          </item>
-         <item row="4" column="0">
-          <widget class="QLabel" name="label_10">
-           <property name="text">
-            <string>nl:</string>
+         <item row="2" column="1">
+          <widget class="QSpinBox" name="nl_spb">
+           <property name="maximum">
+            <number>1000000</number>
+           </property>
+           <property name="value">
+            <number>10</number>
            </property>
           </widget>
          </item>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>pt_le</tabstop>
+  <tabstop>vec_x_le</tabstop>
+  <tabstop>vec_z_le</tabstop>
+  <tabstop>dr_spb</tabstop>
+  <tabstop>da_spb</tabstop>
+  <tabstop>dl_spb</tabstop>
+  <tabstop>nr_spb</tabstop>
+  <tabstop>na_spb</tabstop>
+  <tabstop>nl_spb</tabstop>
+  <tabstop>fill_cb</tabstop>
+ </tabstops>
  <resources/>
  <connections/>
 </ui>
index f10ed72e6f5706d4196b035b947582a47bb90bdb..2f0aec6d97dfc2a4c1201cf84345b1ef499d13d2 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>338</width>
-    <height>1042</height>
+    <width>276</width>
+    <height>1083</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -18,7 +18,7 @@
   </property>
   <property name="minimumSize">
    <size>
-    <width>5</width>
+    <width>276</width>
     <height>0</height>
    </size>
   </property>
@@ -65,9 +65,9 @@
       <property name="geometry">
        <rect>
         <x>0</x>
-        <y>-82</y>
-        <width>301</width>
-        <height>1231</height>
+        <y>0</y>
+        <width>254</width>
+        <height>1061</height>
        </rect>
       </property>
       <layout class="QGridLayout" name="gridLayout">
              </size>
             </property>
             <layout class="QFormLayout" name="formLayout">
-             <property name="sizeConstraint">
-              <enum>QLayout::SetDefaultConstraint</enum>
-             </property>
-             <property name="fieldGrowthPolicy">
-              <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
-             </property>
              <item row="0" column="0">
               <widget class="QLabel" name="label_8">
                <property name="text">
              </item>
              <item row="0" column="1">
               <widget class="QLineEdit" name="vex_le_rb0">
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
                <property name="maximumSize">
                 <size>
-                 <width>127</width>
+                 <width>16777215</width>
                  <height>16777215</height>
                 </size>
                </property>
              </item>
              <item row="1" column="1">
               <widget class="QLineEdit" name="vec_le_rb0">
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
                <property name="maximumSize">
                 <size>
-                 <width>127</width>
+                 <width>16777215</width>
                  <height>16777215</height>
                 </size>
                </property>
           <item>
            <widget class="QWidget" name="cylindrical_widget" native="true">
             <property name="sizePolicy">
-             <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+             <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
               <horstretch>0</horstretch>
               <verstretch>0</verstretch>
              </sizepolicy>
              <item row="1" column="0">
               <widget class="QGroupBox" name="groupBox_3">
                <property name="sizePolicy">
-                <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+                <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
                  <horstretch>0</horstretch>
                  <verstretch>0</verstretch>
                 </sizepolicy>
                 <item row="1" column="0" colspan="2">
                  <widget class="QTabWidget" name="random_param_w">
                   <property name="sizePolicy">
-                   <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
+                   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
                     <horstretch>0</horstretch>
                     <verstretch>0</verstretch>
                    </sizepolicy>
                      </widget>
                     </item>
                     <item row="0" column="1" rowspan="4">
-                     <widget class="QListWidget" name="radius_lw"/>
+                     <widget class="QListWidget" name="radius_lw">
+                      <property name="sizePolicy">
+                       <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+                        <horstretch>0</horstretch>
+                        <verstretch>0</verstretch>
+                       </sizepolicy>
+                      </property>
+                     </widget>
                     </item>
                     <item row="1" column="0">
                      <widget class="QPushButton" name="del_radius_pb">
                 <item row="2" column="0" colspan="2">
                  <widget class="QWidget" name="uniform_param_w" native="true">
                   <property name="sizePolicy">
-                   <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
+                   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
                     <horstretch>0</horstretch>
                     <verstretch>0</verstretch>
                    </sizepolicy>
                    <item>
                     <widget class="QGroupBox" name="groupBox_6">
                      <property name="sizePolicy">
-                      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+                      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
                        <horstretch>0</horstretch>
                        <verstretch>0</verstretch>
                       </sizepolicy>
                         </property>
                        </widget>
                       </item>
-                      <item row="2" column="1">
+                      <item row="1" column="0">
+                       <widget class="QLabel" name="label_10">
+                        <property name="text">
+                         <string>count : </string>
+                        </property>
+                       </widget>
+                      </item>
+                      <item row="1" column="1">
                        <widget class="QSpinBox" name="nr_spb_rb1">
                         <property name="minimum">
                          <number>1</number>
                         </property>
                        </widget>
                       </item>
-                      <item row="2" column="0">
-                       <widget class="QLabel" name="label_10">
-                        <property name="text">
-                         <string>count : </string>
-                        </property>
-                       </widget>
-                      </item>
                      </layout>
                     </widget>
                    </item>
                    <item>
                     <widget class="QGroupBox" name="groupBox_8">
                      <property name="sizePolicy">
-                      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+                      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
                        <horstretch>0</horstretch>
                        <verstretch>0</verstretch>
                       </sizepolicy>
                         </property>
                        </widget>
                       </item>
-                      <item row="2" column="1">
+                      <item row="1" column="0">
+                       <widget class="QLabel" name="label_11">
+                        <property name="text">
+                         <string>count : </string>
+                        </property>
+                       </widget>
+                      </item>
+                      <item row="1" column="1">
                        <widget class="QSpinBox" name="na_spb_rb1">
                         <property name="minimum">
                          <number>3</number>
                         </property>
                        </widget>
                       </item>
-                      <item row="2" column="0">
-                       <widget class="QLabel" name="label_11">
-                        <property name="text">
-                         <string>count : </string>
-                        </property>
-                       </widget>
-                      </item>
                      </layout>
                     </widget>
                    </item>
                    <item>
                     <widget class="QGroupBox" name="groupBox_7">
                      <property name="sizePolicy">
-                      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+                      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
                        <horstretch>0</horstretch>
                        <verstretch>0</verstretch>
                       </sizepolicy>
                         </property>
                        </widget>
                       </item>
-                      <item row="2" column="1">
+                      <item row="1" column="0">
+                       <widget class="QLabel" name="label_15">
+                        <property name="text">
+                         <string>count : </string>
+                        </property>
+                       </widget>
+                      </item>
+                      <item row="1" column="1">
                        <widget class="QSpinBox" name="nl_spb_rb1">
                         <property name="minimum">
                          <number>1</number>
                         </property>
                        </widget>
                       </item>
-                      <item row="2" column="0">
-                       <widget class="QLabel" name="label_15">
-                        <property name="text">
-                         <string>count : </string>
-                        </property>
-                       </widget>
-                      </item>
                      </layout>
                     </widget>
                    </item>
                   </property>
                  </widget>
                 </item>
-                <item row="4" column="0">
-                 <spacer name="verticalSpacer_5">
-                  <property name="orientation">
-                   <enum>Qt::Vertical</enum>
-                  </property>
-                  <property name="sizeHint" stdset="0">
-                   <size>
-                    <width>20</width>
-                    <height>20</height>
-                   </size>
-                  </property>
-                 </spacer>
-                </item>
                </layout>
               </widget>
              </item>
                 <string>Cylinder</string>
                </property>
                <layout class="QFormLayout" name="formLayout_4">
-                <property name="sizeConstraint">
-                 <enum>QLayout::SetDefaultConstraint</enum>
-                </property>
-                <property name="fieldGrowthPolicy">
-                 <enum>QFormLayout::ExpandingFieldsGrow</enum>
-                </property>
-                <item row="1" column="0">
+                <item row="0" column="0">
                  <widget class="QLabel" name="label">
                   <property name="text">
                    <string>center </string>
                   </property>
                  </widget>
                 </item>
-                <item row="1" column="1">
+                <item row="0" column="1">
                  <widget class="QLineEdit" name="center_le_rb1">
+                  <property name="sizePolicy">
+                   <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+                    <horstretch>0</horstretch>
+                    <verstretch>0</verstretch>
+                   </sizepolicy>
+                  </property>
                   <property name="maximumSize">
                    <size>
-                    <width>127</width>
+                    <width>16777215</width>
                     <height>16777215</height>
                    </size>
                   </property>
                   </property>
                  </widget>
                 </item>
-                <item row="2" column="0">
+                <item row="1" column="0">
                  <widget class="QLabel" name="label_2">
                   <property name="text">
                    <string>base</string>
                   </property>
                  </widget>
                 </item>
-                <item row="2" column="1">
+                <item row="1" column="1">
                  <widget class="QLineEdit" name="base_le_rb1">
                   <property name="maximumSize">
                    <size>
-                    <width>127</width>
+                    <width>16777215</width>
                     <height>16777215</height>
                    </size>
                   </property>
                   </property>
                  </widget>
                 </item>
-                <item row="3" column="0">
+                <item row="2" column="0">
                  <widget class="QLabel" name="label_4">
                   <property name="text">
                    <string>vector</string>
                   </property>
                  </widget>
                 </item>
-                <item row="3" column="1">
+                <item row="2" column="1">
                  <widget class="QLineEdit" name="height_le_rb1">
                   <property name="maximumSize">
                    <size>
-                    <width>127</width>
+                    <width>16777215</width>
                     <height>16777215</height>
                    </size>
                   </property>
              </item>
              <item row="0" column="1">
               <widget class="QLineEdit" name="vex_le_rb2">
+               <property name="sizePolicy">
+                <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+                 <horstretch>0</horstretch>
+                 <verstretch>0</verstretch>
+                </sizepolicy>
+               </property>
                <property name="maximumSize">
                 <size>
-                 <width>127</width>
+                 <width>16777215</width>
                  <height>16777215</height>
                 </size>
                </property>
              <item row="1" column="1">
               <widget class="QDoubleSpinBox" name="radius_spb_rb2">
                <property name="sizePolicy">
-                <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
                  <horstretch>0</horstretch>
                  <verstretch>0</verstretch>
                 </sizepolicy>
              <item row="2" column="1">
               <widget class="QSpinBox" name="nb_spb_rb2">
                <property name="sizePolicy">
-                <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
                  <horstretch>0</horstretch>
                  <verstretch>0</verstretch>
                 </sizepolicy>
              <item row="3" column="1">
               <widget class="QDoubleSpinBox" name="k_spb_rb2">
                <property name="sizePolicy">
-                <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
                  <horstretch>0</horstretch>
                  <verstretch>0</verstretch>
                 </sizepolicy>
             </layout>
            </widget>
           </item>
+          <item>
+           <spacer name="verticalSpacer_4">
+            <property name="orientation">
+             <enum>Qt::Vertical</enum>
+            </property>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>20</width>
+              <height>40</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
          </layout>
         </widget>
        </item>
-       <item row="2" column="0">
-        <spacer name="verticalSpacer_4">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>10</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
       </layout>
      </widget>
     </widget>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>scrollArea</tabstop>
+  <tabstop>rb0</tabstop>
+  <tabstop>rb1</tabstop>
+  <tabstop>rb2</tabstop>
+  <tabstop>vex_le_rb0</tabstop>
+  <tabstop>vec_le_rb0</tabstop>
+  <tabstop>center_le_rb1</tabstop>
+  <tabstop>base_le_rb1</tabstop>
+  <tabstop>height_le_rb1</tabstop>
+  <tabstop>vex_le_rb2</tabstop>
+  <tabstop>nx_spb_rb0</tabstop>
+  <tabstop>ny_spb_rb0</tabstop>
+  <tabstop>nz_spb_rb0</tabstop>
+  <tabstop>uniform_rb</tabstop>
+  <tabstop>random_rb</tabstop>
+  <tabstop>random_param_w</tabstop>
+  <tabstop>add_radius_pb</tabstop>
+  <tabstop>del_radius_pb</tabstop>
+  <tabstop>radius_lw</tabstop>
+  <tabstop>dr_spb_rb1</tabstop>
+  <tabstop>nr_spb_rb1</tabstop>
+  <tabstop>da_spb_rb1</tabstop>
+  <tabstop>na_spb_rb1</tabstop>
+  <tabstop>dl_spb_rb1</tabstop>
+  <tabstop>nl_spb_rb1</tabstop>
+  <tabstop>fill_cb_rb1</tabstop>
+  <tabstop>radius_spb_rb2</tabstop>
+  <tabstop>nb_spb_rb2</tabstop>
+  <tabstop>k_spb_rb2</tabstop>
+  <tabstop>add_angle_pb</tabstop>
+  <tabstop>add_height_pb</tabstop>
+  <tabstop>del_angle_pb</tabstop>
+  <tabstop>del_height_pb</tabstop>
+  <tabstop>height_lw</tabstop>
+  <tabstop>angle_lw</tabstop>
+ </tabstops>
  <resources/>
  <connections>
   <connection>
index 28e7897560f0e3b214ceeff3c930624479590d37..99a2e2a3f57c7b76c61fde8c2958175cfbee0b35 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>367</width>
-    <height>440</height>
+    <width>288</width>
+    <height>742</height>
    </rect>
   </property>
   <property name="sizePolicy">
     <verstretch>0</verstretch>
    </sizepolicy>
   </property>
+  <property name="minimumSize">
+   <size>
+    <width>285</width>
+    <height>0</height>
+   </size>
+  </property>
   <property name="windowTitle">
    <string>HemiSphere Construction</string>
   </property>
        <rect>
         <x>0</x>
         <y>0</y>
-        <width>330</width>
-        <height>688</height>
+        <width>266</width>
+        <height>720</height>
        </rect>
       </property>
-      <layout class="QVBoxLayout" name="verticalLayout_3">
+      <layout class="QVBoxLayout" name="verticalLayout">
        <item>
         <widget class="QGroupBox" name="groupBox_3">
          <property name="sizePolicy">
           <item row="0" column="1">
            <widget class="QLineEdit" name="name_le">
             <property name="sizePolicy">
-             <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
               <horstretch>0</horstretch>
               <verstretch>0</verstretch>
              </sizepolicy>
             </property>
             <property name="maximumSize">
              <size>
-              <width>127</width>
+              <width>16777215</width>
               <height>16777215</height>
              </size>
             </property>
@@ -93,7 +99,7 @@
             <property name="title">
              <string>Sphere</string>
             </property>
-            <layout class="QGridLayout" name="gridLayout_2">
+            <layout class="QFormLayout" name="formLayout_4">
              <item row="0" column="0">
               <widget class="QLabel" name="label">
                <property name="text">
             <property name="title">
              <string>Hole</string>
             </property>
-            <layout class="QGridLayout" name="gridLayout_3">
+            <layout class="QFormLayout" name="formLayout_2">
              <item row="0" column="0">
               <widget class="QLabel" name="label_3">
                <property name="text">
             <property name="title">
              <string>Cross section</string>
             </property>
-            <layout class="QGridLayout" name="gridLayout_6">
+            <layout class="QFormLayout" name="formLayout_3">
              <item row="0" column="0">
               <widget class="QLabel" name="label_7">
                <property name="text">
              </item>
              <item row="1" column="0">
               <widget class="QLabel" name="label_4">
-               <property name="enabled">
-                <bool>true</bool>
-               </property>
                <property name="text">
                 <string>vector</string>
                </property>
               </widget>
              </item>
              <item row="1" column="1">
-              <widget class="QLineEdit" name="cross_vec_le">
-               <property name="enabled">
-                <bool>true</bool>
-               </property>
-               <property name="sizePolicy">
-                <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
-                 <horstretch>0</horstretch>
-                 <verstretch>0</verstretch>
-                </sizepolicy>
-               </property>
-               <property name="toolTip">
-                <string extracomment="select vector "/>
-               </property>
-               <property name="statusTip">
-                <string/>
-               </property>
-               <property name="readOnly">
-                <bool>false</bool>
-               </property>
-              </widget>
+              <widget class="QLineEdit" name="cross_vec_le"/>
              </item>
             </layout>
            </widget>
             <property name="title">
              <string>Radial section</string>
             </property>
-            <layout class="QGridLayout" name="gridLayout">
+            <layout class="QFormLayout" name="formLayout_5">
              <item row="0" column="0">
               <widget class="QLabel" name="label_2">
                <property name="text">
                </property>
               </widget>
              </item>
-             <item row="2" column="0" colspan="2">
+             <item row="2" column="0">
               <widget class="QCheckBox" name="radial_partial_cb">
                <property name="text">
                 <string>partial</string>
             <property name="title">
              <string>Grid</string>
             </property>
-            <layout class="QGridLayout" name="gridLayout_4">
+            <layout class="QFormLayout" name="formLayout_6">
              <item row="0" column="0">
               <widget class="QLabel" name="label_8">
                <property name="text">
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>scrollArea</tabstop>
+  <tabstop>name_le</tabstop>
+  <tabstop>sphere_center_le</tabstop>
+  <tabstop>hole_axis_le</tabstop>
+  <tabstop>cross_pt_le</tabstop>
+  <tabstop>cross_vec_le</tabstop>
+  <tabstop>radial_vec_le</tabstop>
+  <tabstop>sphere_radext_spb</tabstop>
+  <tabstop>sphere_radint_spb</tabstop>
+  <tabstop>sphere_rind_cb</tabstop>
+  <tabstop>hole_rad_spb</tabstop>
+  <tabstop>radial_angle_spb</tabstop>
+  <tabstop>radial_partial_cb</tabstop>
+  <tabstop>ngrid_rad_spb</tabstop>
+  <tabstop>ngrid_ang_spb</tabstop>
+  <tabstop>ngrid_height_spb</tabstop>
+ </tabstops>
  <resources/>
  <connections>
   <connection>
     </hint>
    </hints>
   </connection>
-  <connection>
-   <sender>hole_axis_le</sender>
-   <signal>textChanged(QString)</signal>
-   <receiver>cross_vec_le</receiver>
-   <slot>setText(QString)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>198</x>
-     <y>265</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>198</x>
-     <y>390</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>cross_vec_le</sender>
-   <signal>textChanged(QString)</signal>
-   <receiver>hole_axis_le</receiver>
-   <slot>setText(QString)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>198</x>
-     <y>390</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>198</x>
-     <y>265</y>
-    </hint>
-   </hints>
-  </connection>
   <connection>
    <sender>sphere_rind_cb</sender>
    <signal>toggled(bool)</signal>
index b2b5b9a0d5c276ac08cf20845a459606de0d1217..ae4834cbf8ceb8faa9cf10f87f9bca1d846d3d38 100644 (file)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>195</width>
-    <height>220</height>
+    <height>196</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -38,9 +38,6 @@
       <string>Arguments</string>
      </property>
      <layout class="QFormLayout" name="formLayout">
-      <property name="fieldGrowthPolicy">
-       <enum>QFormLayout::ExpandingFieldsGrow</enum>
-      </property>
       <item row="0" column="0">
        <widget class="QLabel" name="label">
         <property name="text">
       </item>
       <item row="0" column="1">
        <widget class="QLineEdit" name="pipe_le">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
         </property>
        </widget>
       </item>
-      <item row="5" column="0">
+      <item row="1" column="1">
+       <widget class="QLineEdit" name="vec_le">
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</height>
+         </size>
+        </property>
+        <property name="readOnly">
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="0">
        <widget class="QLabel" name="label_3">
         <property name="text">
          <string>n (radial)</string>
         </property>
        </widget>
       </item>
-      <item row="5" column="1">
+      <item row="2" column="1">
        <widget class="QSpinBox" name="nr_spb">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
         </property>
        </widget>
       </item>
-      <item row="6" column="0">
+      <item row="3" column="0">
        <widget class="QLabel" name="label_4">
         <property name="text">
          <string>n (angular)</string>
         </property>
        </widget>
       </item>
-      <item row="6" column="1">
+      <item row="3" column="1">
        <widget class="QSpinBox" name="na_spb">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
         </property>
        </widget>
       </item>
-      <item row="8" column="0">
+      <item row="4" column="0">
        <widget class="QLabel" name="label_5">
         <property name="text">
          <string>n (heigth)</string>
         </property>
        </widget>
       </item>
-      <item row="8" column="1">
+      <item row="4" column="1">
        <widget class="QSpinBox" name="nl_spb">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
         </property>
        </widget>
       </item>
-      <item row="1" column="1">
-       <widget class="QLineEdit" name="vec_le">
-        <property name="maximumSize">
-         <size>
-          <width>127</width>
-          <height>16777215</height>
-         </size>
-        </property>
-        <property name="readOnly">
-         <bool>false</bool>
-        </property>
-       </widget>
-      </item>
      </layout>
     </widget>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>pipe_le</tabstop>
+  <tabstop>vec_le</tabstop>
+  <tabstop>nr_spb</tabstop>
+  <tabstop>na_spb</tabstop>
+  <tabstop>nl_spb</tabstop>
+ </tabstops>
  <resources/>
  <connections/>
 </ui>
index 40d7a7eb45ed952afc1a50ce266d5b763ed25d9a..90fb7a8095c5d9cd1aa86d633ff9e071813ee4ab 100644 (file)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>190</width>
-    <height>104</height>
+    <height>106</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -26,9 +26,6 @@
       <string>Arguments</string>
      </property>
      <layout class="QFormLayout" name="formLayout">
-      <property name="fieldGrowthPolicy">
-       <enum>QFormLayout::ExpandingFieldsGrow</enum>
-      </property>
       <item row="0" column="0">
        <widget class="QLabel" name="label">
         <property name="text">
       </item>
       <item row="0" column="1">
        <widget class="QLineEdit" name="pipe1_le">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
@@ -60,7 +63,7 @@
        <widget class="QLineEdit" name="pipe2_le">
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
index 524e77584b8eeff632c9040235c3a4c386720418..19797aaafbc847877cb4a85c337f328d9911a56a 100644 (file)
@@ -6,16 +6,28 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>324</width>
-    <height>440</height>
+    <width>272</width>
+    <height>464</height>
    </rect>
   </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
   <property name="windowTitle">
    <string>Rind Construction</string>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout">
    <item>
     <widget class="QGroupBox" name="groupBox_3">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="title">
       <string>Result Name</string>
      </property>
       <item row="0" column="1">
        <widget class="QLineEdit" name="name_le">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
    </item>
    <item>
     <widget class="QGroupBox" name="groupBox">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="title">
       <string>Arguments</string>
      </property>
-     <layout class="QGridLayout" name="gridLayout">
-      <item row="0" column="0" colspan="2">
+     <layout class="QFormLayout" name="formLayout">
+      <item row="0" column="0">
        <widget class="QLabel" name="label">
         <property name="text">
          <string>center</string>
         </property>
        </widget>
       </item>
-      <item row="0" column="2">
+      <item row="0" column="1">
        <widget class="QLineEdit" name="center_le">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="readOnly">
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0">
+       <widget class="QLabel" name="label_2">
+        <property name="text">
+         <string>vx</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1">
+       <widget class="QLineEdit" name="vx_le">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
        </widget>
       </item>
-      <item row="3" column="2">
+      <item row="2" column="0">
+       <widget class="QLabel" name="label_3">
+        <property name="text">
+         <string>vz</string>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="1">
        <widget class="QLineEdit" name="vz_le">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
        </widget>
       </item>
-      <item row="4" column="0" colspan="2">
+      <item row="3" column="0">
        <widget class="QLabel" name="label_4">
         <property name="text">
          <string>radext</string>
         </property>
        </widget>
       </item>
-      <item row="4" column="2">
+      <item row="3" column="1">
        <widget class="QDoubleSpinBox" name="radext_spb">
         <property name="decimals">
          <number>6</number>
         </property>
        </widget>
       </item>
-      <item row="5" column="0" colspan="2">
+      <item row="4" column="0">
        <widget class="QLabel" name="label_5">
         <property name="text">
          <string>radint</string>
         </property>
        </widget>
       </item>
-      <item row="5" column="2">
+      <item row="4" column="1">
        <widget class="QDoubleSpinBox" name="radint_spb">
         <property name="decimals">
          <number>6</number>
         </property>
        </widget>
       </item>
-      <item row="6" column="0" colspan="2">
+      <item row="5" column="0">
        <widget class="QLabel" name="label_6">
         <property name="text">
          <string>radhole</string>
         </property>
        </widget>
       </item>
-      <item row="6" column="2">
+      <item row="5" column="1">
        <widget class="QDoubleSpinBox" name="radhole_spb">
         <property name="decimals">
          <number>6</number>
         </property>
        </widget>
       </item>
-      <item row="7" column="0" colspan="2">
+      <item row="6" column="0">
        <widget class="QLabel" name="label_7">
         <property name="text">
          <string>plorig</string>
         </property>
        </widget>
       </item>
-      <item row="7" column="2">
+      <item row="6" column="1">
        <widget class="QLineEdit" name="plorig_le">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
        </widget>
       </item>
-      <item row="8" column="0" colspan="2">
+      <item row="7" column="0">
        <widget class="QLabel" name="label_8">
         <property name="text">
          <string>nrad</string>
         </property>
        </widget>
       </item>
-      <item row="8" column="2">
+      <item row="7" column="1">
        <widget class="QSpinBox" name="nrad_spb">
         <property name="maximum">
          <number>1000000</number>
         </property>
        </widget>
       </item>
-      <item row="9" column="0" colspan="2">
+      <item row="8" column="0">
        <widget class="QLabel" name="label_9">
         <property name="text">
          <string>nang</string>
         </property>
        </widget>
       </item>
-      <item row="9" column="2">
+      <item row="8" column="1">
        <widget class="QSpinBox" name="nang_spb">
         <property name="maximum">
          <number>1000000</number>
         </property>
        </widget>
       </item>
-      <item row="10" column="0" colspan="2">
+      <item row="9" column="0">
        <widget class="QLabel" name="label_10">
         <property name="text">
          <string>nhaut</string>
         </property>
        </widget>
       </item>
-      <item row="10" column="2">
+      <item row="9" column="1">
        <widget class="QSpinBox" name="nhaut_spb">
         <property name="maximum">
          <number>1000000</number>
         </property>
        </widget>
       </item>
-      <item row="11" column="0">
+      <item row="10" column="0">
        <widget class="QLabel" name="angle_label">
         <property name="enabled">
          <bool>false</bool>
         </property>
        </widget>
       </item>
-      <item row="11" column="2">
+      <item row="10" column="1">
        <widget class="QDoubleSpinBox" name="angle_spb">
         <property name="enabled">
          <bool>false</bool>
         </property>
        </widget>
       </item>
-      <item row="1" column="0">
-       <widget class="QLabel" name="label_2">
-        <property name="text">
-         <string>vx</string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="2">
-       <widget class="QLineEdit" name="vx_le">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="readOnly">
-         <bool>false</bool>
-        </property>
-       </widget>
-      </item>
-      <item row="3" column="0">
-       <widget class="QLabel" name="label_3">
-        <property name="text">
-         <string>vz</string>
-        </property>
-       </widget>
-      </item>
-      <item row="11" column="3">
+      <item row="11" column="1">
        <widget class="QCheckBox" name="partial_cb">
         <property name="text">
          <string>Partial</string>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>name_le</tabstop>
+  <tabstop>center_le</tabstop>
+  <tabstop>vx_le</tabstop>
+  <tabstop>vz_le</tabstop>
+  <tabstop>plorig_le</tabstop>
+  <tabstop>radext_spb</tabstop>
+  <tabstop>radint_spb</tabstop>
+  <tabstop>radhole_spb</tabstop>
+  <tabstop>nrad_spb</tabstop>
+  <tabstop>nang_spb</tabstop>
+  <tabstop>nhaut_spb</tabstop>
+  <tabstop>angle_spb</tabstop>
+  <tabstop>partial_cb</tabstop>
+ </tabstops>
  <resources/>
  <connections>
   <connection>
index 4564b4ae0d0f7911e827e78dde5436c19232c750..3b4a2d31e4035d273c6e5cdc452ce43fcbacee6d 100644 (file)
@@ -6,16 +6,28 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>267</width>
-    <height>217</height>
+    <width>241</width>
+    <height>184</height>
    </rect>
   </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
   <property name="windowTitle">
    <string>Sphere Construction</string>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_3">
    <item>
     <widget class="QGroupBox" name="groupBox">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="title">
       <string>Arguments</string>
      </property>
       </item>
       <item row="0" column="1">
        <widget class="QLineEdit" name="vex_le">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
       </item>
       <item row="1" column="1">
        <widget class="QLineEdit" name="vec_le">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
         </property>
        </widget>
       </item>
-      <item row="6" column="1">
-       <widget class="QDoubleSpinBox" name="k_spb">
-        <property name="decimals">
-         <number>6</number>
-        </property>
-        <property name="maximum">
-         <double>1000000000.000000000000000</double>
-        </property>
-        <property name="value">
-         <double>1.000000000000000</double>
+      <item row="2" column="0">
+       <widget class="QLabel" name="label_3">
+        <property name="text">
+         <string>nb</string>
         </property>
        </widget>
       </item>
-      <item row="5" column="1">
+      <item row="2" column="1">
        <widget class="QSpinBox" name="nb_spb">
         <property name="maximum">
          <number>1000000</number>
         </property>
        </widget>
       </item>
-      <item row="6" column="0">
+      <item row="3" column="0">
        <widget class="QLabel" name="label_4">
         <property name="text">
          <string>k</string>
         </property>
        </widget>
       </item>
-      <item row="5" column="0">
-       <widget class="QLabel" name="label_3">
-        <property name="text">
-         <string>nb</string>
+      <item row="3" column="1">
+       <widget class="QDoubleSpinBox" name="k_spb">
+        <property name="decimals">
+         <number>6</number>
+        </property>
+        <property name="maximum">
+         <double>1000000000.000000000000000</double>
+        </property>
+        <property name="value">
+         <double>1.000000000000000</double>
         </property>
        </widget>
       </item>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>vex_le</tabstop>
+  <tabstop>vec_le</tabstop>
+  <tabstop>nb_spb</tabstop>
+  <tabstop>k_spb</tabstop>
+ </tabstops>
  <resources/>
  <connections/>
 </ui>
index 46d24b4e21582af4143d2c66f8272f1ecaf2ee87..9603b407f98dbf604010400b8c82647840caf81c 100644 (file)
@@ -6,34 +6,45 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>355</width>
-    <height>295</height>
+    <width>270</width>
+    <height>195</height>
    </rect>
   </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
   <property name="windowTitle">
    <string>Translation Operation</string>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout">
    <item>
     <widget class="QGroupBox" name="groupBox">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="title">
       <string>Translate</string>
      </property>
-     <layout class="QFormLayout" name="formLayout">
-      <item row="0" column="0">
-       <layout class="QHBoxLayout" name="horizontalLayout">
-        <item>
-         <widget class="QLabel" name="label">
-          <property name="text">
-           <string>Elements : </string>
-          </property>
-         </widget>
-        </item>
-        <item>
+     <layout class="QVBoxLayout" name="verticalLayout_2">
+      <item>
+       <layout class="QFormLayout" name="formLayout">
+        <item row="1" column="1">
          <widget class="QLineEdit" name="elt_le">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
           <property name="maximumSize">
            <size>
-            <width>127</width>
+            <width>16777215</width>
             <height>16777215</height>
            </size>
           </property>
           </property>
          </widget>
         </item>
-       </layout>
-      </item>
-      <item row="1" column="0">
-       <layout class="QHBoxLayout" name="horizontalLayout_2">
-        <item>
+        <item row="2" column="0">
          <widget class="QLabel" name="label_2">
           <property name="text">
            <string>Vector : </string>
           </property>
          </widget>
         </item>
-        <item>
+        <item row="2" column="1">
          <widget class="QLineEdit" name="vec_le">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
           <property name="maximumSize">
            <size>
-            <width>127</width>
+            <width>16777215</width>
             <height>16777215</height>
            </size>
           </property>
           </property>
          </widget>
         </item>
+        <item row="1" column="0">
+         <widget class="QLabel" name="label">
+          <property name="text">
+           <string>Elements : </string>
+          </property>
+         </widget>
+        </item>
        </layout>
       </item>
-      <item row="2" column="0">
+      <item>
        <spacer name="verticalSpacer">
         <property name="orientation">
          <enum>Qt::Vertical</enum>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>elt_le</tabstop>
+  <tabstop>vec_le</tabstop>
+  <tabstop>buttonBox</tabstop>
+ </tabstops>
  <resources/>
  <connections>
   <connection>
index 38ecb87a05e3dc456e61193cff84cc7f6628d93e..b505f6629919fcb74b81bc611e78d9541cde5434 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>400</width>
-    <height>431</height>
+    <width>215</width>
+    <height>184</height>
    </rect>
   </property>
   <property name="windowTitle">
   <layout class="QVBoxLayout" name="verticalLayout_2">
    <item>
     <widget class="QGroupBox" name="groupBox">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="title">
       <string>MergeEdges</string>
      </property>
-     <layout class="QVBoxLayout" name="verticalLayout">
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout">
-        <item>
-         <widget class="QLabel" name="label">
-          <property name="text">
-           <string>Edge 1</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="e0_le">
-          <property name="maximumSize">
-           <size>
-            <width>127</width>
-            <height>16777215</height>
-           </size>
-          </property>
-          <property name="readOnly">
-           <bool>false</bool>
-          </property>
-         </widget>
-        </item>
-       </layout>
+     <layout class="QFormLayout" name="formLayout">
+      <item row="0" column="0">
+       <widget class="QLabel" name="label">
+        <property name="text">
+         <string>Edge 1</string>
+        </property>
+       </widget>
       </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_2">
-        <item>
-         <widget class="QLabel" name="label_2">
-          <property name="text">
-           <string>Edge 2</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="e1_le">
-          <property name="maximumSize">
-           <size>
-            <width>127</width>
-            <height>16777215</height>
-           </size>
-          </property>
-          <property name="readOnly">
-           <bool>false</bool>
-          </property>
-         </widget>
-        </item>
-       </layout>
+      <item row="0" column="1">
+       <widget class="QLineEdit" name="e0_le">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</height>
+         </size>
+        </property>
+        <property name="readOnly">
+         <bool>false</bool>
+        </property>
+       </widget>
       </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_3">
-        <item>
-         <widget class="QLabel" name="label_3">
-          <property name="text">
-           <string>Vertex 1</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="v0_le">
-          <property name="maximumSize">
-           <size>
-            <width>127</width>
-            <height>16777215</height>
-           </size>
-          </property>
-          <property name="readOnly">
-           <bool>false</bool>
-          </property>
-         </widget>
-        </item>
-       </layout>
+      <item row="2" column="1">
+       <widget class="QLineEdit" name="e1_le">
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</height>
+         </size>
+        </property>
+        <property name="readOnly">
+         <bool>false</bool>
+        </property>
+       </widget>
       </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_4">
-        <item>
-         <widget class="QLabel" name="label_4">
-          <property name="text">
-           <string>Vertex 2</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="v1_le">
-          <property name="minimumSize">
-           <size>
-            <width>127</width>
-            <height>0</height>
-           </size>
-          </property>
-          <property name="maximumSize">
-           <size>
-            <width>127</width>
-            <height>16777215</height>
-           </size>
-          </property>
-          <property name="readOnly">
-           <bool>false</bool>
-          </property>
-         </widget>
-        </item>
-       </layout>
+      <item row="4" column="1">
+       <widget class="QLineEdit" name="v0_le">
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</height>
+         </size>
+        </property>
+        <property name="readOnly">
+         <bool>false</bool>
+        </property>
+       </widget>
       </item>
-      <item>
-       <spacer name="verticalSpacer">
-        <property name="orientation">
-         <enum>Qt::Vertical</enum>
+      <item row="6" column="1">
+       <widget class="QLineEdit" name="v1_le">
+        <property name="minimumSize">
+         <size>
+          <width>127</width>
+          <height>0</height>
+         </size>
         </property>
-        <property name="sizeHint" stdset="0">
+        <property name="maximumSize">
          <size>
-          <width>20</width>
-          <height>220</height>
+          <width>16777215</width>
+          <height>16777215</height>
          </size>
         </property>
-       </spacer>
+        <property name="readOnly">
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
+      <item row="2" column="0">
+       <widget class="QLabel" name="label_2">
+        <property name="text">
+         <string>Edge 2</string>
+        </property>
+       </widget>
+      </item>
+      <item row="4" column="0">
+       <widget class="QLabel" name="label_3">
+        <property name="text">
+         <string>Vertex 1</string>
+        </property>
+       </widget>
+      </item>
+      <item row="6" column="0">
+       <widget class="QLabel" name="label_4">
+        <property name="text">
+         <string>Vertex 2</string>
+        </property>
+       </widget>
       </item>
      </layout>
     </widget>
index e256ea5576cecb667a857641158a0ff1d370fe15..1d80fddd43ba34900cb02566b38b35f97eb8132f 100644 (file)
@@ -6,10 +6,16 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>304</width>
-    <height>360</height>
+    <width>242</width>
+    <height>108</height>
    </rect>
   </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
   <property name="windowTitle">
    <string>Dialog</string>
   </property>
      <property name="title">
       <string>MergeVertices</string>
      </property>
-     <layout class="QGridLayout" name="gridLayout">
-      <item row="0" column="0">
-       <layout class="QHBoxLayout" name="horizontalLayout">
-        <item>
+     <layout class="QVBoxLayout" name="verticalLayout_2">
+      <item>
+       <layout class="QFormLayout" name="formLayout">
+        <item row="0" column="0">
          <widget class="QLabel" name="label">
           <property name="text">
            <string>Vertex 1</string>
           </property>
          </widget>
         </item>
-        <item>
+        <item row="0" column="1">
          <widget class="QLineEdit" name="v0_le">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
           <property name="maximumSize">
            <size>
-            <width>127</width>
+            <width>16777215</width>
             <height>16777215</height>
            </size>
           </property>
           </property>
          </widget>
         </item>
-       </layout>
-      </item>
-      <item row="1" column="0">
-       <layout class="QHBoxLayout" name="horizontalLayout_2">
-        <item>
+        <item row="1" column="0">
          <widget class="QLabel" name="label_2">
           <property name="text">
            <string>Vertex 2</string>
           </property>
          </widget>
         </item>
-        <item>
+        <item row="1" column="1">
          <widget class="QLineEdit" name="v1_le">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
           <property name="maximumSize">
            <size>
-            <width>127</width>
+            <width>16777215</width>
             <height>16777215</height>
            </size>
           </property>
         </item>
        </layout>
       </item>
-      <item row="2" column="0">
-       <spacer name="verticalSpacer_2">
-        <property name="orientation">
-         <enum>Qt::Vertical</enum>
-        </property>
-        <property name="sizeHint" stdset="0">
-         <size>
-          <width>261</width>
-          <height>207</height>
-         </size>
-        </property>
-       </spacer>
-      </item>
      </layout>
     </widget>
    </item>
index 0f9e932863c3c905776b071f4647fa02570374bd..45adfedcb2ecc35303925e07d1c9ab50a00fb3b9 100644 (file)
            </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
           <widget class="QLineEdit" name="v1_le_rb0">
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
           <widget class="QLineEdit" name="e0_le_rb1">
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
           <widget class="QLineEdit" name="e1_le_rb1">
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
           <widget class="QLineEdit" name="v0_le_rb1">
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
           <widget class="QLineEdit" name="v1_le_rb1">
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
       <item>
        <widget class="QWidget" name="widget_3" native="true">
         <layout class="QFormLayout" name="formLayout_3">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_7">
+           <property name="text">
+            <string>quad 1</string>
+           </property>
+          </widget>
+         </item>
          <item row="0" column="1">
           <widget class="QLineEdit" name="q0_le_rb2">
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
            </property>
           </widget>
          </item>
+         <item row="1" column="0">
+          <widget class="QLabel" name="label_8">
+           <property name="text">
+            <string>quad 2</string>
+           </property>
+          </widget>
+         </item>
          <item row="1" column="1">
           <widget class="QLineEdit" name="q1_le_rb2">
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
            </property>
           </widget>
          </item>
+         <item row="2" column="0">
+          <widget class="QLabel" name="label_9">
+           <property name="text">
+            <string>vertex 1</string>
+           </property>
+          </widget>
+         </item>
          <item row="2" column="1">
           <widget class="QLineEdit" name="v0_le_rb2">
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
            </property>
           </widget>
          </item>
-         <item row="4" column="0">
+         <item row="3" column="0">
           <widget class="QLabel" name="label_10">
            <property name="text">
             <string>vertex 2</string>
            </property>
           </widget>
          </item>
-         <item row="4" column="1">
+         <item row="3" column="1">
           <widget class="QLineEdit" name="v1_le_rb2">
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
            </property>
           </widget>
          </item>
-         <item row="5" column="0">
+         <item row="4" column="0">
           <widget class="QLabel" name="label_11">
            <property name="text">
             <string>vertex 3</string>
            </property>
           </widget>
          </item>
-         <item row="5" column="1">
+         <item row="4" column="1">
           <widget class="QLineEdit" name="v2_le_rb2">
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
            </property>
           </widget>
          </item>
-         <item row="6" column="0">
+         <item row="5" column="0">
           <widget class="QLabel" name="label_12">
            <property name="text">
             <string>vertex 4</string>
            </property>
           </widget>
          </item>
-         <item row="6" column="1">
+         <item row="5" column="1">
           <widget class="QLineEdit" name="v3_le_rb2">
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
            </property>
           </widget>
          </item>
-         <item row="0" column="0">
-          <widget class="QLabel" name="label_7">
-           <property name="text">
-            <string>quad 1</string>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="0">
-          <widget class="QLabel" name="label_8">
-           <property name="text">
-            <string>quad 2</string>
-           </property>
-          </widget>
-         </item>
-         <item row="2" column="0">
-          <widget class="QLabel" name="label_9">
-           <property name="text">
-            <string>vertex 1</string>
-           </property>
-          </widget>
-         </item>
         </layout>
        </widget>
       </item>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>rb0</tabstop>
+  <tabstop>rb1</tabstop>
+  <tabstop>rb2</tabstop>
+  <tabstop>v0_le_rb0</tabstop>
+  <tabstop>v1_le_rb0</tabstop>
+  <tabstop>e0_le_rb1</tabstop>
+  <tabstop>e1_le_rb1</tabstop>
+  <tabstop>v0_le_rb1</tabstop>
+  <tabstop>v1_le_rb1</tabstop>
+  <tabstop>q0_le_rb2</tabstop>
+  <tabstop>q1_le_rb2</tabstop>
+  <tabstop>v0_le_rb2</tabstop>
+  <tabstop>v1_le_rb2</tabstop>
+  <tabstop>v2_le_rb2</tabstop>
+  <tabstop>v3_le_rb2</tabstop>
+ </tabstops>
  <resources/>
  <connections>
   <connection>
index 327b66feff06a5459b89ef2d52ccb442205d75dc..9c0042efc145ade94ce4b108f4f7707f897d124a 100644 (file)
@@ -251,10 +251,6 @@ MyBasicGUI_PointDlg::~MyBasicGUI_PointDlg()
 {
 }
 
-
-
-
-
 //=================================================================================
 // function : Init()
 // purpose  :
@@ -314,10 +310,11 @@ void MyBasicGUI_PointDlg::Init()
   /* signals and slots connections */
   if ( myGeomGUI ){
     connect(myGeomGUI,      SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
-    connect(myGeomGUI,      SIGNAL(SignalCloseAllDialogs()),        this, SLOT(ClickOnCancel()));
+    connect(myGeomGUI,      SIGNAL(SignalCloseAllDialogs()),        this, SLOT(close()));
   }
   //connect(buttonOk(),     SIGNAL(clicked()), this, SLOT(ClickOnOk()));
   connect(buttonApply(),  SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+//  connect( closeButton, SIGNAL(clicked()), this, SLOT(close()) );
 
   connect(this,           SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
 
@@ -499,7 +496,7 @@ void MyBasicGUI_PointDlg::ClickOnOk()
 {
   setIsApplyAndClose(true);
   if (onAccept())
-    ClickOnCancel();
+    close();
 }
 
 //=================================================================================
@@ -512,7 +509,11 @@ bool MyBasicGUI_PointDlg::ClickOnApply()
     return false;
 
   initName();
-  ConstructorsClicked(getConstructorId());
+//  ConstructorsClicked(getConstructorId());
+
+  //Set selection mode to the last selected mode
+  globalSelection(); // close local contexts, if any
+  localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
 
   return true;
 }
@@ -1026,12 +1027,12 @@ void MyBasicGUI_PointDlg::updateParamCoord(bool theIsUpdate)
     GroupOnCurve->SpinBox_DX->setVisible(isParam || isLength);
     if (isParam){
       initSpinBox(GroupOnCurve->SpinBox_DX, 0., 1., 0.1, "parametric_precision");
-      GroupOnCurve->SpinBox_DX->setValue(0.5);
+//      GroupOnCurve->SpinBox_DX->setValue(0.5);
       GroupOnCurve->TextLabel3->setText(tr("GEOM_PARAMETER"));
     }
     else if (isLength){
       initSpinBox(GroupOnCurve->SpinBox_DX, COORD_MIN, COORD_MAX, step, "length_precision");
-      GroupOnCurve->SpinBox_DX->setValue(0.0);
+//      GroupOnCurve->SpinBox_DX->setValue(0);
       GroupOnCurve->TextLabel3->setText(tr("GEOM_LENGTH"));
     }
   }
@@ -1189,6 +1190,10 @@ void MyBasicGUI_PointDlg::onSelectionChanged( const QItemSelection& sel, const Q
   foreach( const QModelIndex& iunsel, unsel.indexes() ){
     MESSAGE("*  unselected : " << iunsel.data().toString().toStdString());
   }
+
+  if (_patternDataSelectionModel)
+         _patternDataSelectionModel->highlightEltsWithAssocs(sel.indexes());
+
   if ( _selectionMutex ) return;
   if ( _currentObj != mainFrame()->_vertex_le ) return;
 
@@ -1231,15 +1236,51 @@ void MyBasicGUI_PointDlg::onWindowActivated(SUIT_ViewManager* vm)
   }
 }
 
+// ============================================================== _isLineOrListWidget
+/*
+ * Return true is the widget is a line or a list
+ * false otherwise.
+ */
+bool MyBasicGUI_PointDlg::_isLineOrListWidget(QObject *widget)
+{
+       if (widget == NULL) return false;
+
+       QLineEdit       *lineEdit = dynamic_cast<QLineEdit*>(widget);
+       QListWidget *listWidget = dynamic_cast<QListWidget*>(widget);
+       return (lineEdit != NULL) || (listWidget != NULL);
+
+}//_isLineOrListWidget
+
+
+
+// ============================================================== _highlightWidget
+/*
+ * Highlight the given widget with the given color.
+ */
+void MyBasicGUI_PointDlg::_highlightWidget(QObject *obj, Qt::GlobalColor clr)
+{
+       if (!_isLineOrListWidget(obj)) return;
+
+       QWidget *widget = dynamic_cast<QWidget*>(obj); //sure it's not NULL (_isLineOrListWidget(obj))
+       QPalette palette1 = widget->palette();
+       palette1.setColor(widget->backgroundRole(), clr);
+       widget->setPalette(palette1);
+
+}//_highlightWidget
 
 
 bool MyBasicGUI_PointDlg::eventFilter(QObject *obj, QEvent *event)
 {
 
+//  if (event->type() == QEvent::FocusOut)
+//       _highlightWidget(obj, Qt::white);
+//
+//  else
   if ( (event->type() != QEvent::FocusIn)
     or (obj != mainFrame()->_vertex_le) ){
     return MyGEOMBase_Skeleton::eventFilter(obj, event);
   }
+//  _highlightWidget(obj, Qt::yellow);
 
   MESSAGE("MyBasicGUI_PointDlg::eventFilter{");
 
index ad5ac323cd7d52c805ccf1d6c03b0ac99108f78a..eaed34a319603c4030595b3fac72f91d39f8d7ed 100755 (executable)
@@ -140,8 +140,6 @@ private slots:
   void                               updateSize();
 
 
-
-
 // HEXABLOCK
 public:
   void setDocumentModel( HEXABLOCK::GUI::DocumentModel* m );
@@ -156,6 +154,8 @@ protected:
   virtual void showEvent ( QShowEvent * event );
   void _initInputWidget();
   void _initViewManager();
+  void _highlightWidget(QObject* obj, Qt::GlobalColor clr);
+  bool _isLineOrListWidget(QObject*);
 
 protected slots:
   void onSelectionChanged(  const QItemSelection& sel, const QItemSelection& unsel );
index 4bfdab26a494a56bb0a46539aeaa30e46c7169b9..ea3bac841c1d6c2ade846175a2343c3acdc44288 100644 (file)
@@ -54,6 +54,12 @@ class GEOMBASE_EXPORT MyGEOMBase_Helper
 public:
   MyGEOMBase_Helper( SUIT_Desktop* );
   virtual ~MyGEOMBase_Helper();
+  GEOM_Displayer*  getDisplayer();
+  void localSelection( const ObjectList&, const int );
+  void localSelection( GEOM::GEOM_Object_ptr, const int );
+  void globalSelection( const int = GEOM_ALLOBJECTS, const bool = false  );
+  void globalSelection( const TColStd_MapOfInteger&, const bool = false );
+  void globalSelection( const TColStd_MapOfInteger&, const QList<int>& ,const bool = false );
 
 protected:
   static GEOM::GEOM_Gen_ptr getGeomEngine();
@@ -87,12 +93,12 @@ protected:
                          const bool = true );
   void erasePreview    ( const bool = true );
 
-  void localSelection( const ObjectList&, const int );
-  void localSelection( GEOM::GEOM_Object_ptr, const int );
+//  void localSelection( const ObjectList&, const int );
+//  void localSelection( GEOM::GEOM_Object_ptr, const int );
   void activate( const int );
-  void globalSelection( const int = GEOM_ALLOBJECTS, const bool = false  );
-  void globalSelection( const TColStd_MapOfInteger&, const bool = false );
-  void globalSelection( const TColStd_MapOfInteger&, const QList<int>& ,const bool = false );
+//  void globalSelection( const int = GEOM_ALLOBJECTS, const bool = false  );
+//  void globalSelection( const TColStd_MapOfInteger&, const bool = false );
+//  void globalSelection( const TColStd_MapOfInteger&, const QList<int>& ,const bool = false );
   void updateViewer    ();
 
   void prepareSelection( const ObjectList&, const int );
@@ -172,7 +178,7 @@ protected:
   void SetIsPreview(const bool thePreview) {isPreview = thePreview;}
   bool IsPreview() {return isPreview;}
 
-  GEOM_Displayer*             getDisplayer();
+//  GEOM_Displayer*             getDisplayer();
   SUIT_Desktop*               getDesktop() const;
 
   virtual void                setIsApplyAndClose( const bool theFlag );
index b7690c9f0e6cd95c1ca1b43718246229cb1b751e..b67d1f93115b13c5794f5928a0a1f7845a13b1b6 100755 (executable)
@@ -111,10 +111,10 @@ void MyGEOMBase_Skeleton::Init()
     myGeomGUI->SetActiveDialogBox( this );
 
   /* signals and slots connections */
-  connect( buttonCancel(), SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
+  connect( buttonCancel(), SIGNAL( clicked() ), this, SLOT( close() ) );
   if ( myGeomGUI ) {
     connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
-    connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ),        this, SLOT( ClickOnCancel() ) );
+    connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ),        this, SLOT( close() ) );
   }
 
   // connect help button on a private slot that displays help information
@@ -199,13 +199,23 @@ void MyGEOMBase_Skeleton::updateAttributes( GEOM::GEOM_Object_ptr theObj,
   aStringAttrib->SetValue(aValue.c_str());
 }
 
+
+// ========================================================================== close
+// function : close()
+// purpose  : close the dockwidget
 //=================================================================================
-// function : ClickOnCancel()
-// purpose  :
-//=================================================================================
-void MyGEOMBase_Skeleton::ClickOnCancel()
+void MyGEOMBase_Skeleton::close()
 {
-  close();
+//     _currentObj = NULL;
+
+       //Clear VTK selection
+//     clearVTKSelection();
+
+       //Clear OCC selection
+//     clearOCCSelection();
+
+       //Close the dialog box
+       if (parentWidget()) parentWidget()->close();
 }
 
 //=================================================================================
index 76defa6fda636f628c51d252abcaeb0141b87a73..ebbdf7604c34ca30b0eb48c5ddcb038d33019d1c 100755 (executable)
@@ -98,8 +98,10 @@ protected:
     QButtonGroup*       myRBGroup;             //!< radio button group
     MyDlgRef_Skeleton*    myMainFrame;           //!< dialog box's mainframe widgetx
 
+public slots:
+  virtual void close();
+
 protected slots:
-    virtual void        ClickOnCancel();
     virtual void        processPreview();
     void                LineEditReturnPressed();
     void                DeactivateActiveDialog();
index cd5fa441d90986e41736970774385ef941a96993..b80ef9eec3bbb49d1341306e791082df9bda1845 100644 (file)
@@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>297</width>
+    <width>226</width>
     <height>241</height>
    </rect>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout">
    <item>
     <widget class="QGroupBox" name="groupBox">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="minimumSize">
       <size>
        <width>5</width>
       <string>Arguments</string>
      </property>
      <layout class="QFormLayout" name="formLayout">
-      <item row="3" column="0">
+      <item row="0" column="0">
+       <widget class="QLabel" name="label_6">
+        <property name="text">
+         <string> Name </string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QLineEdit" name="name_le">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</height>
+         </size>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0">
        <widget class="QLabel" name="label_5">
         <property name="text">
          <string>Point</string>
         </property>
        </widget>
       </item>
-      <item row="3" column="1">
+      <item row="1" column="1">
        <widget class="QLineEdit" name="vex_le">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
         </property>
        </widget>
       </item>
-      <item row="4" column="0">
+      <item row="2" column="0">
        <widget class="QLabel" name="label_4">
         <property name="text">
          <string>Vector</string>
         </property>
        </widget>
       </item>
-      <item row="4" column="1">
+      <item row="2" column="1">
        <widget class="QLineEdit" name="vec_le">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
         </property>
        </widget>
       </item>
-      <item row="5" column="0">
+      <item row="3" column="0">
        <widget class="QLabel" name="label">
         <property name="text">
          <string>internal radius</string>
         </property>
        </widget>
       </item>
-      <item row="5" column="1">
+      <item row="3" column="1">
        <widget class="QDoubleSpinBox" name="ir_spb">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
        </widget>
       </item>
-      <item row="6" column="0">
+      <item row="4" column="0">
        <widget class="QLabel" name="label_1">
         <property name="text">
          <string>external radius</string>
         </property>
        </widget>
       </item>
-      <item row="6" column="1">
+      <item row="4" column="1">
        <widget class="QDoubleSpinBox" name="er_spb">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
        </widget>
       </item>
-      <item row="7" column="0">
+      <item row="5" column="0">
        <widget class="QLabel" name="label_3">
         <property name="text">
          <string>height</string>
         </property>
        </widget>
       </item>
-      <item row="7" column="1">
+      <item row="5" column="1">
        <widget class="QDoubleSpinBox" name="h_spb">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
        </widget>
       </item>
-      <item row="1" column="0">
-       <widget class="QLabel" name="label_6">
-        <property name="text">
-         <string> Name </string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="1">
-       <widget class="QLineEdit" name="name_le">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="maximumSize">
-         <size>
-          <width>127</width>
-          <height>16777215</height>
-         </size>
-        </property>
-       </widget>
-      </item>
      </layout>
     </widget>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>name_le</tabstop>
+  <tabstop>vex_le</tabstop>
+  <tabstop>vec_le</tabstop>
+  <tabstop>ir_spb</tabstop>
+  <tabstop>er_spb</tabstop>
+  <tabstop>h_spb</tabstop>
+ </tabstops>
  <resources/>
  <connections/>
 </ui>
index daa9ece76d020eb5d2d57c5c4d3d7c951ddfe05b..7be90fb9bed399340628e6dbde4cdaba0d09a4d2 100644 (file)
@@ -6,12 +6,12 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>318</width>
-    <height>381</height>
+    <width>254</width>
+    <height>500</height>
    </rect>
   </property>
   <property name="sizePolicy">
-   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
     <height>0</height>
    </size>
   </property>
+  <property name="maximumSize">
+   <size>
+    <width>16777215</width>
+    <height>16777215</height>
+   </size>
+  </property>
   <property name="windowTitle">
    <string>Prism Quad(s) Operation</string>
   </property>
      <property name="title">
       <string>Arguments</string>
      </property>
-     <layout class="QVBoxLayout" name="verticalLayout">
+     <layout class="QVBoxLayout" name="verticalLayout_5">
       <item>
        <widget class="QGroupBox" name="groupBox">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>16777215</height>
+         </size>
+        </property>
         <property name="title">
          <string>Quad(s)</string>
         </property>
-        <layout class="QGridLayout" name="gridLayout">
-         <item row="0" column="0" rowspan="2">
-          <widget class="QListWidget" name="quads_lw"/>
+        <layout class="QVBoxLayout" name="verticalLayout">
+         <item>
+          <widget class="QListWidget" name="quads_lw">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+          </widget>
          </item>
         </layout>
        </widget>
       </item>
       <item>
-       <widget class="QGroupBox" name="groupBox_3">
-        <property name="title">
-         <string>Direction</string>
+       <widget class="QFrame" name="frame">
+        <property name="maximumSize">
+         <size>
+          <width>16777215</width>
+          <height>50</height>
+         </size>
+        </property>
+        <property name="frameShape">
+         <enum>QFrame::StyledPanel</enum>
+        </property>
+        <property name="frameShadow">
+         <enum>QFrame::Raised</enum>
         </property>
-        <layout class="QFormLayout" name="formLayout">
+        <layout class="QFormLayout" name="formLayout_2">
          <item row="0" column="0">
           <widget class="QLabel" name="label_4">
            <property name="text">
-            <string>Vector</string>
+            <string>Direction</string>
            </property>
           </widget>
          </item>
          <item row="0" column="1">
           <widget class="QLineEdit" name="vec_le">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
            </property>
           </widget>
          </item>
-         <item row="1" column="0">
-          <widget class="QLabel" name="label">
-           <property name="text">
-            <string>nb</string>
+        </layout>
+       </widget>
+      </item>
+      <item>
+       <widget class="QGroupBox" name="groupBox_3">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="title">
+         <string>Layer(s)</string>
+        </property>
+        <layout class="QVBoxLayout" name="verticalLayout_2">
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout">
+           <item>
+            <widget class="QRadioButton" name="regular_rb">
+             <property name="text">
+              <string>regular</string>
+             </property>
+             <property name="checked">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QRadioButton" name="irregular_rb">
+             <property name="text">
+              <string>irregular</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <widget class="QFrame" name="frame_2">
+           <property name="frameShape">
+            <enum>QFrame::StyledPanel</enum>
+           </property>
+           <property name="frameShadow">
+            <enum>QFrame::Raised</enum>
            </property>
+           <layout class="QFormLayout" name="formLayout">
+            <item row="0" column="0">
+             <widget class="QLabel" name="label">
+              <property name="text">
+               <string>nb</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="1">
+             <widget class="QSpinBox" name="nb_spb">
+              <property name="maximum">
+               <number>1000000</number>
+              </property>
+              <property name="value">
+               <number>1</number>
+              </property>
+             </widget>
+            </item>
+           </layout>
           </widget>
          </item>
-         <item row="1" column="1">
-          <widget class="QSpinBox" name="nb_spb">
-           <property name="maximum">
-            <number>1000000</number>
+         <item>
+          <widget class="QFrame" name="frame_3">
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>169</height>
+            </size>
+           </property>
+           <property name="frameShape">
+            <enum>QFrame::StyledPanel</enum>
            </property>
-           <property name="value">
-            <number>1</number>
+           <property name="frameShadow">
+            <enum>QFrame::Raised</enum>
            </property>
+           <layout class="QVBoxLayout" name="verticalLayout_3">
+            <item>
+             <widget class="QTabWidget" name="layers_height_w">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="currentIndex">
+               <number>0</number>
+              </property>
+              <widget class="QWidget" name="ext_height_tab">
+               <attribute name="title">
+                <string>height</string>
+               </attribute>
+               <layout class="QGridLayout" name="gridLayout_4">
+                <item row="0" column="0">
+                 <widget class="QPushButton" name="add_height_pb">
+                  <property name="enabled">
+                   <bool>true</bool>
+                  </property>
+                  <property name="sizePolicy">
+                   <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+                    <horstretch>0</horstretch>
+                    <verstretch>0</verstretch>
+                   </sizepolicy>
+                  </property>
+                  <property name="text">
+                   <string>+</string>
+                  </property>
+                 </widget>
+                </item>
+                <item row="0" column="1" rowspan="3">
+                 <widget class="QListWidget" name="height_lw">
+                  <property name="sizePolicy">
+                   <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+                    <horstretch>0</horstretch>
+                    <verstretch>0</verstretch>
+                   </sizepolicy>
+                  </property>
+                 </widget>
+                </item>
+                <item row="1" column="0">
+                 <widget class="QPushButton" name="del_height_pb">
+                  <property name="sizePolicy">
+                   <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+                    <horstretch>0</horstretch>
+                    <verstretch>0</verstretch>
+                   </sizepolicy>
+                  </property>
+                  <property name="text">
+                   <string>-</string>
+                  </property>
+                 </widget>
+                </item>
+                <item row="2" column="0">
+                 <spacer name="verticalSpacer_3">
+                  <property name="orientation">
+                   <enum>Qt::Vertical</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>20</width>
+                    <height>139</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+               </layout>
+              </widget>
+             </widget>
+            </item>
+           </layout>
           </widget>
          </item>
         </layout>
   </layout>
  </widget>
  <resources/>
- <connections/>
+ <connections>
+  <connection>
+   <sender>regular_rb</sender>
+   <signal>clicked()</signal>
+   <receiver>frame_3</receiver>
+   <slot>hide()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>77</x>
+     <y>231</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>126</x>
+     <y>390</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>regular_rb</sender>
+   <signal>clicked()</signal>
+   <receiver>frame_2</receiver>
+   <slot>show()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>77</x>
+     <y>231</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>126</x>
+     <y>273</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>irregular_rb</sender>
+   <signal>clicked()</signal>
+   <receiver>frame_3</receiver>
+   <slot>show()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>175</x>
+     <y>231</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>126</x>
+     <y>390</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>irregular_rb</sender>
+   <signal>clicked()</signal>
+   <receiver>frame_2</receiver>
+   <slot>hide()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>175</x>
+     <y>231</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>126</x>
+     <y>273</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
 </ui>
index d56c98ee7be3c30aea28d0766f8679f83e802837..861e900a3dbb57831a194f65b1ac8800a0ad3133 100644 (file)
@@ -11,7 +11,7 @@
    </rect>
   </property>
   <property name="sizePolicy">
-   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
   <layout class="QVBoxLayout" name="verticalLayout">
    <item>
     <widget class="QGroupBox" name="groupBox">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="title">
       <string>Arguments</string>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_2">
       <item>
        <widget class="QGroupBox" name="groupBox_2">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="maximumSize">
          <size>
           <width>16777215</width>
-          <height>131</height>
+          <height>16777215</height>
          </size>
         </property>
         <property name="title">
         </property>
         <layout class="QVBoxLayout" name="verticalLayout_3">
          <item>
-          <widget class="QListWidget" name="propagations_lw"/>
+          <widget class="QListWidget" name="propagations_lw">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+          </widget>
          </item>
         </layout>
        </widget>
       </item>
       <item>
        <widget class="QGroupBox" name="groupBox_3">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="title">
          <string>Law</string>
         </property>
         <layout class="QVBoxLayout" name="verticalLayout_4">
          <item>
           <widget class="QLineEdit" name="law_le">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>propagations_lw</tabstop>
+  <tabstop>law_le</tabstop>
+  <tabstop>way_cb</tabstop>
+  <tabstop>buttonBox</tabstop>
+ </tabstops>
  <resources/>
  <connections>
   <connection>
index e302fa9301e9adb33ea331a7035468243f26661c..43fe6df9a88ddf33b44f888bd974d7d35563f2e2 100644 (file)
@@ -6,40 +6,58 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>260</width>
-    <height>280</height>
+    <width>225</width>
+    <height>271</height>
    </rect>
   </property>
   <property name="sizePolicy">
-   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
   </property>
   <property name="minimumSize">
    <size>
-    <width>260</width>
+    <width>0</width>
     <height>0</height>
    </size>
   </property>
+  <property name="maximumSize">
+   <size>
+    <width>16777215</width>
+    <height>378</height>
+   </size>
+  </property>
   <property name="windowTitle">
    <string>Quad Association</string>
   </property>
-  <layout class="QVBoxLayout" name="verticalLayout_3">
+  <layout class="QVBoxLayout" name="verticalLayout_4">
    <item>
     <widget class="QGroupBox" name="groupBox_2">
      <property name="minimumSize">
       <size>
-       <width>5</width>
+       <width>0</width>
        <height>0</height>
       </size>
      </property>
+     <property name="maximumSize">
+      <size>
+       <width>16777215</width>
+       <height>16777215</height>
+      </size>
+     </property>
      <property name="title">
       <string>Arguments</string>
      </property>
-     <layout class="QVBoxLayout" name="verticalLayout_2">
+     <layout class="QVBoxLayout" name="verticalLayout_3">
       <item>
        <widget class="QGroupBox" name="groupBox_4">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="maximumSize">
          <size>
           <width>16777215</width>
         <property name="title">
          <string>Quad</string>
         </property>
-        <layout class="QFormLayout" name="formLayout">
-         <item row="0" column="0">
+        <layout class="QVBoxLayout" name="verticalLayout">
+         <item>
           <widget class="QLineEdit" name="quad_le">
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
         <property name="maximumSize">
          <size>
           <width>16777215</width>
-          <height>156</height>
+          <height>16777215</height>
          </size>
         </property>
         <property name="title">
          <string>Face(s)</string>
         </property>
-        <layout class="QVBoxLayout" name="verticalLayout">
+        <layout class="QVBoxLayout" name="verticalLayout_2">
          <item>
           <widget class="QListWidget" name="faces_lw">
            <property name="sizePolicy">
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>16777215</height>
+            </size>
+           </property>
           </widget>
          </item>
         </layout>
index 406af8fa5db7eb676f2b10c1a0db678e17ca42db..0f90bec2e36e77d108b0eecd7d108ccb0016045a 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>279</width>
-    <height>451</height>
+    <width>235</width>
+    <height>367</height>
    </rect>
   </property>
   <property name="minimumSize">
@@ -31,7 +31,7 @@
      <property name="title">
       <string>Result Name</string>
      </property>
-     <layout class="QFormLayout" name="formLayout_2">
+     <layout class="QFormLayout" name="formLayout">
       <item row="0" column="0">
        <widget class="QLabel" name="label_15">
         <property name="text">
       <item row="0" column="1">
        <widget class="QLineEdit" name="name_le">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
       <string>Arguments</string>
      </property>
      <layout class="QGridLayout" name="gridLayout">
-      <item row="0" column="0" colspan="2">
+      <item row="0" column="0">
        <widget class="QLabel" name="quadsLabel">
         <property name="text">
          <string>Quads : </string>
         </property>
        </widget>
       </item>
-      <item row="0" column="2" rowspan="2">
-       <widget class="QListWidget" name="quads_lw"/>
+      <item row="0" column="1">
+       <widget class="QListWidget" name="quads_lw">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
       </item>
-      <item row="2" column="0" colspan="2">
+      <item row="1" column="0">
        <widget class="QLabel" name="label_5">
         <property name="text">
          <string>Center : </string>
         </property>
        </widget>
       </item>
-      <item row="2" column="2">
+      <item row="1" column="1">
        <widget class="QLineEdit" name="center_pt_le">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
         </property>
        </widget>
       </item>
-      <item row="3" column="0" colspan="2">
+      <item row="2" column="0">
        <widget class="QLabel" name="label_4">
         <property name="text">
          <string>Axis     :</string>
         </property>
        </widget>
       </item>
-      <item row="3" column="2">
+      <item row="2" column="1">
        <widget class="QLineEdit" name="axis_vec_le">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
         </property>
        </widget>
       </item>
-      <item row="6" column="0">
+      <item row="3" column="0">
+       <widget class="QLabel" name="label">
+        <property name="text">
+         <string>Angles : </string>
+        </property>
+       </widget>
+      </item>
+      <item row="3" column="1" rowspan="4">
+       <widget class="QListWidget" name="angles_lw">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+       </widget>
+      </item>
+      <item row="4" column="0">
        <widget class="QPushButton" name="add_angle_pb">
         <property name="enabled">
          <bool>true</bool>
         </property>
        </widget>
       </item>
-      <item row="7" column="0">
+      <item row="5" column="0">
        <widget class="QPushButton" name="del_angle_pb">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
         </property>
        </widget>
       </item>
-      <item row="5" column="0">
-       <widget class="QLabel" name="label">
-        <property name="text">
-         <string>Angles : </string>
-        </property>
-       </widget>
-      </item>
-      <item row="8" column="0">
+      <item row="6" column="0">
        <spacer name="verticalSpacer">
         <property name="orientation">
          <enum>Qt::Vertical</enum>
         </property>
        </spacer>
       </item>
-      <item row="4" column="2" rowspan="5">
-       <widget class="QListWidget" name="angles_lw"/>
-      </item>
      </layout>
     </widget>
    </item>
index dd0c95fbb296439be2d03873539295e1ba280ec5..da01b21eaacfe963fcccd30a9e655d172b60a1e6 100755 (executable)
@@ -6,19 +6,19 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>255</width>
-    <height>437</height>
+    <width>216</width>
+    <height>428</height>
    </rect>
   </property>
   <property name="sizePolicy">
-   <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
   </property>
   <property name="minimumSize">
    <size>
-    <width>5</width>
+    <width>0</width>
     <height>0</height>
    </size>
   </property>
    </item>
    <item>
     <widget class="QGroupBox" name="groupBox_2">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="minimumSize">
       <size>
        <width>5</width>
      <property name="title">
       <string>Arguments</string>
      </property>
-     <layout class="QFormLayout" name="formLayout_3">
-      <item row="0" column="0">
-       <widget class="QLabel" name="label_9">
-        <property name="text">
-         <string> Name </string>
-        </property>
+     <layout class="QVBoxLayout" name="verticalLayout">
+      <item>
+       <widget class="QWidget" name="widget_3" native="true">
+        <layout class="QFormLayout" name="formLayout_3">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_9">
+           <property name="text">
+            <string> Name </string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QLineEdit" name="name_le">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>16777215</height>
+            </size>
+           </property>
+          </widget>
+         </item>
+        </layout>
        </widget>
       </item>
-      <item row="0" column="1">
-       <widget class="QLineEdit" name="name_le">
+      <item>
+       <widget class="QWidget" name="widget" native="true">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
-        <property name="maximumSize">
-         <size>
-          <width>127</width>
-          <height>16777215</height>
-         </size>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="0" colspan="2">
-       <widget class="QWidget" name="widget" native="true">
         <layout class="QFormLayout" name="formLayout">
          <item row="0" column="0">
           <widget class="QLabel" name="label">
          </item>
          <item row="0" column="1">
           <widget class="QLineEdit" name="v0_le_rb0">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
          </item>
          <item row="1" column="1">
           <widget class="QLineEdit" name="v1_le_rb0">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
          </item>
          <item row="2" column="1">
           <widget class="QLineEdit" name="v2_le_rb0">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
          </item>
          <item row="3" column="1">
           <widget class="QLineEdit" name="v3_le_rb0">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="minimumSize">
             <size>
-             <width>127</width>
+             <width>0</width>
              <height>0</height>
             </size>
            </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
         </layout>
        </widget>
       </item>
-      <item row="2" column="0" colspan="2">
+      <item>
        <widget class="QWidget" name="widget_2" native="true">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <layout class="QFormLayout" name="formLayout_2">
          <item row="0" column="0">
           <widget class="QLabel" name="label_5">
          </item>
          <item row="0" column="1">
           <widget class="QLineEdit" name="e0_le_rb1">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
          </item>
          <item row="1" column="1">
           <widget class="QLineEdit" name="e1_le_rb1">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
          </item>
          <item row="2" column="1">
           <widget class="QLineEdit" name="e2_le_rb1">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
          </item>
          <item row="3" column="1">
           <widget class="QLineEdit" name="e3_le_rb1">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="minimumSize">
             <size>
-             <width>127</width>
+             <width>0</width>
              <height>0</height>
             </size>
            </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>rb0</tabstop>
+  <tabstop>rb1</tabstop>
+  <tabstop>name_le</tabstop>
+  <tabstop>v0_le_rb0</tabstop>
+  <tabstop>v1_le_rb0</tabstop>
+  <tabstop>v2_le_rb0</tabstop>
+  <tabstop>v3_le_rb0</tabstop>
+  <tabstop>e0_le_rb1</tabstop>
+  <tabstop>e1_le_rb1</tabstop>
+  <tabstop>e2_le_rb1</tabstop>
+  <tabstop>e3_le_rb1</tabstop>
+ </tabstops>
  <resources/>
  <connections>
   <connection>
index 703a519e4f18360137273e062eb46279680c0c76..3eedee78d2f734f1176e9f72b03dd712645a8bb5 100644 (file)
       </item>
       <item row="0" column="1">
        <widget class="QLineEdit" name="hexa_le">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
index 12ac32d79bec0e6e71933d542ae0d67ffa59fecf..038cf13fdc7b8c2d767ce99a9d0d0565671f0aae 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>229</width>
-    <height>459</height>
+    <width>234</width>
+    <height>461</height>
    </rect>
   </property>
   <property name="minimumSize">
   <layout class="QVBoxLayout" name="verticalLayout">
    <item>
     <widget class="QGroupBox" name="groupBox_3">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="minimumSize">
       <size>
-       <width>5</width>
+       <width>0</width>
        <height>0</height>
       </size>
      </property>
      <property name="title">
       <string>Result Name</string>
      </property>
-     <layout class="QFormLayout" name="formLayout_2">
+     <layout class="QFormLayout" name="formLayout">
       <item row="0" column="0">
        <widget class="QLabel" name="label_15">
         <property name="text">
       <item row="0" column="1">
        <widget class="QLineEdit" name="name_le">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
           <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
         <property name="maximumSize">
          <size>
-          <width>127</width>
+          <width>16777215</width>
           <height>16777215</height>
          </size>
         </property>
    </item>
    <item>
     <widget class="QGroupBox" name="groupBox">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="minimumSize">
       <size>
-       <width>5</width>
+       <width>0</width>
        <height>0</height>
       </size>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_2">
       <item>
        <widget class="QGroupBox" name="groupBox_5">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="title">
          <string>Quad(s) source</string>
         </property>
-        <layout class="QFormLayout" name="formLayout_4">
-         <item row="0" column="0" colspan="2">
+        <layout class="QVBoxLayout" name="verticalLayout_3">
+         <item>
           <widget class="QListWidget" name="quads_lw">
-           <property name="toolTip">
-            <string>Select hexa</string>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="0">
-          <widget class="QLabel" name="label_4">
-           <property name="text">
-            <string>Point a</string>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="1">
-          <widget class="QLineEdit" name="p1_le">
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+            <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
-           <property name="toolTip">
-            <string>Select vertex</string>
-           </property>
-           <property name="text">
-            <string/>
-           </property>
-           <property name="readOnly">
-            <bool>false</bool>
-           </property>
-          </widget>
-         </item>
-         <item row="2" column="0">
-          <widget class="QLabel" name="label_5">
-           <property name="text">
-            <string>Point b</string>
-           </property>
-          </widget>
-         </item>
-         <item row="2" column="1">
-          <widget class="QLineEdit" name="p2_le">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>16777215</height>
+            </size>
            </property>
            <property name="toolTip">
-            <string>Select vertex</string>
-           </property>
-           <property name="text">
-            <string/>
-           </property>
-           <property name="readOnly">
-            <bool>false</bool>
-           </property>
-          </widget>
-         </item>
-         <item row="3" column="0">
-          <widget class="QLabel" name="label_6">
-           <property name="text">
-            <string>Point c</string>
+            <string>Select hexa</string>
            </property>
           </widget>
          </item>
-         <item row="3" column="1">
-          <widget class="QLineEdit" name="p3_le">
+         <item>
+          <widget class="QFrame" name="frame">
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
            </property>
-           <property name="toolTip">
-            <string>Select vertex</string>
+           <property name="frameShape">
+            <enum>QFrame::StyledPanel</enum>
            </property>
-           <property name="text">
-            <string/>
-           </property>
-           <property name="readOnly">
-            <bool>false</bool>
+           <property name="frameShadow">
+            <enum>QFrame::Raised</enum>
            </property>
+           <layout class="QFormLayout" name="formLayout_2">
+            <item row="0" column="0">
+             <widget class="QLabel" name="label_4">
+              <property name="text">
+               <string>Point a</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="1">
+             <widget class="QLineEdit" name="p1_le">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="toolTip">
+               <string>Select vertex</string>
+              </property>
+              <property name="text">
+               <string/>
+              </property>
+              <property name="readOnly">
+               <bool>false</bool>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="0">
+             <widget class="QLabel" name="label_5">
+              <property name="text">
+               <string>Point b</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="1">
+             <widget class="QLineEdit" name="p2_le">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="toolTip">
+               <string>Select vertex</string>
+              </property>
+              <property name="text">
+               <string/>
+              </property>
+              <property name="readOnly">
+               <bool>false</bool>
+              </property>
+             </widget>
+            </item>
+            <item row="2" column="0">
+             <widget class="QLabel" name="label_6">
+              <property name="text">
+               <string>Point c</string>
+              </property>
+             </widget>
+            </item>
+            <item row="2" column="1">
+             <widget class="QLineEdit" name="p3_le">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="toolTip">
+               <string>Select vertex</string>
+              </property>
+              <property name="text">
+               <string/>
+              </property>
+              <property name="readOnly">
+               <bool>false</bool>
+              </property>
+             </widget>
+            </item>
+           </layout>
           </widget>
          </item>
         </layout>
       </item>
       <item>
        <widget class="QGroupBox" name="groupBox_2">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="title">
          <string>Quad destination</string>
         </property>
         <layout class="QFormLayout" name="formLayout_3">
-         <property name="fieldGrowthPolicy">
-          <enum>QFormLayout::ExpandingFieldsGrow</enum>
-         </property>
          <item row="0" column="0">
           <widget class="QLabel" name="label">
            <property name="text">
          <item row="0" column="1">
           <widget class="QLineEdit" name="c1_le">
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
          <item row="1" column="1">
           <widget class="QLineEdit" name="c2_le">
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
          <item row="2" column="1">
           <widget class="QLineEdit" name="c3_le">
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>name_le</tabstop>
+  <tabstop>quads_lw</tabstop>
+  <tabstop>p1_le</tabstop>
+  <tabstop>p2_le</tabstop>
+  <tabstop>p3_le</tabstop>
+  <tabstop>c1_le</tabstop>
+  <tabstop>c2_le</tabstop>
+  <tabstop>c3_le</tabstop>
+ </tabstops>
  <resources/>
  <connections/>
 </ui>
index 391b69b6d466dcb2c96c2403a8291c9c200652b9..80e4e7f42946d7f6c9fe8a7a73c8dc27a62011f1 100644 (file)
@@ -6,12 +6,12 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>244</width>
-    <height>466</height>
+    <width>234</width>
+    <height>396</height>
    </rect>
   </property>
   <property name="sizePolicy">
-   <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
       <item>
        <widget class="QWidget" name="widget" native="true">
         <layout class="QFormLayout" name="formLayout">
-         <property name="fieldGrowthPolicy">
-          <enum>QFormLayout::ExpandingFieldsGrow</enum>
-         </property>
          <item row="0" column="0">
           <widget class="QLabel" name="label_6">
            <property name="text">
          </item>
          <item row="0" column="1">
           <widget class="QLineEdit" name="elts_le_rb0">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
           </widget>
          </item>
          <item row="1" column="1">
-          <widget class="QLineEdit" name="vex_le_rb0">
-           <property name="sizePolicy">
-            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-             <horstretch>0</horstretch>
-             <verstretch>0</verstretch>
-            </sizepolicy>
-           </property>
-           <property name="maximumSize">
-            <size>
-             <width>127</width>
-             <height>16777215</height>
-            </size>
-           </property>
-           <property name="readOnly">
-            <bool>false</bool>
-           </property>
-          </widget>
+          <widget class="QLineEdit" name="vex_le_rb0"/>
          </item>
         </layout>
        </widget>
          </item>
          <item row="0" column="1">
           <widget class="QLineEdit" name="elts_le_rb1">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
          </item>
          <item row="1" column="1">
           <widget class="QLineEdit" name="vex_le_rb1">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
            </property>
           </widget>
          </item>
-         <item row="3" column="1">
+         <item row="2" column="0">
+          <widget class="QLabel" name="label_4">
+           <property name="text">
+            <string>vector</string>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="1">
           <widget class="QLineEdit" name="vec_le_rb1">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
            </property>
           </widget>
          </item>
-         <item row="3" column="0">
-          <widget class="QLabel" name="label_4">
-           <property name="text">
-            <string>vector</string>
-           </property>
-          </widget>
-         </item>
         </layout>
        </widget>
       </item>
          </item>
          <item row="0" column="1">
           <widget class="QLineEdit" name="elts_le_rb2">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
          </item>
          <item row="1" column="1">
           <widget class="QLineEdit" name="vex_le_rb2">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
          </item>
          <item row="2" column="1">
           <widget class="QLineEdit" name="vec_le_rb2">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>rb0</tabstop>
+  <tabstop>rb1</tabstop>
+  <tabstop>rb2</tabstop>
+  <tabstop>elts_le_rb0</tabstop>
+  <tabstop>elts_le_rb1</tabstop>
+  <tabstop>vex_le_rb1</tabstop>
+  <tabstop>vec_le_rb1</tabstop>
+  <tabstop>elts_le_rb2</tabstop>
+  <tabstop>vex_le_rb2</tabstop>
+  <tabstop>vec_le_rb2</tabstop>
+ </tabstops>
  <resources/>
  <connections>
   <connection>
index 2a175b9deb5396247a61bc1326a62034cd7ee19a..93fdeb1fb0dc9134d20203a6dcfcc4a5db555065 100644 (file)
@@ -6,12 +6,12 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>312</width>
-    <height>483</height>
+    <width>239</width>
+    <height>440</height>
    </rect>
   </property>
   <property name="sizePolicy">
-   <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
@@ -21,7 +21,7 @@
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_4">
    <property name="sizeConstraint">
-    <enum>QLayout::SetMinimumSize</enum>
+    <enum>QLayout::SetDefaultConstraint</enum>
    </property>
    <item>
     <widget class="QGroupBox" name="groupBox">
@@ -95,9 +95,6 @@
       <item>
        <widget class="QWidget" name="widget" native="true">
         <layout class="QFormLayout" name="formLayout">
-         <property name="fieldGrowthPolicy">
-          <enum>QFormLayout::ExpandingFieldsGrow</enum>
-         </property>
          <item row="0" column="0">
           <widget class="QLabel" name="label_6">
            <property name="text">
           <widget class="QLineEdit" name="elts_le_rb0">
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
            </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
           <widget class="QLineEdit" name="elts_le_rb1">
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
           <widget class="QLineEdit" name="vex_le_rb1">
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
           <widget class="QLineEdit" name="elts_le_rb2">
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
           <widget class="QLineEdit" name="vex_le_rb2">
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
           <widget class="QLineEdit" name="vec_le_rb2">
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>rb0</tabstop>
+  <tabstop>rb1</tabstop>
+  <tabstop>rb2</tabstop>
+  <tabstop>elts_le_rb0</tabstop>
+  <tabstop>vec_le_rb0</tabstop>
+  <tabstop>elts_le_rb1</tabstop>
+  <tabstop>vex_le_rb1</tabstop>
+  <tabstop>elts_le_rb2</tabstop>
+  <tabstop>vex_le_rb2</tabstop>
+  <tabstop>vec_le_rb2</tabstop>
+  <tabstop>k_spb</tabstop>
+  <tabstop>angle_spb</tabstop>
+ </tabstops>
  <resources/>
  <connections>
   <connection>
index 1b9eef8c58e582e5aeff3ebf4e0ae5b8e555bf90..f09de3fd0312c4c9d5bf20eb2297aeacc44046ac 100644 (file)
@@ -6,12 +6,12 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>284</width>
-    <height>359</height>
+    <width>245</width>
+    <height>338</height>
    </rect>
   </property>
   <property name="sizePolicy">
-   <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+   <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
@@ -21,7 +21,7 @@
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_2">
    <property name="sizeConstraint">
-    <enum>QLayout::SetMinimumSize</enum>
+    <enum>QLayout::SetDefaultConstraint</enum>
    </property>
    <item>
     <widget class="QGroupBox" name="groupBox_2">
      <property name="title">
       <string>Arguments</string>
      </property>
-     <layout class="QFormLayout" name="formLayout_3">
-      <item row="0" column="0">
-       <widget class="QLabel" name="label_6">
-        <property name="text">
-         <string> Name </string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="1">
-       <widget class="QLineEdit" name="name_le">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="maximumSize">
-         <size>
-          <width>127</width>
-          <height>16777215</height>
-         </size>
-        </property>
+     <layout class="QVBoxLayout" name="verticalLayout">
+      <item>
+       <widget class="QWidget" name="widget_3" native="true">
+        <layout class="QFormLayout" name="formLayout">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_6">
+           <property name="text">
+            <string> Name </string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QLineEdit" name="name_le">
+           <property name="enabled">
+            <bool>true</bool>
+           </property>
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>16777215</height>
+            </size>
+           </property>
+          </widget>
+         </item>
+        </layout>
        </widget>
       </item>
-      <item row="1" column="0" colspan="2">
+      <item>
        <widget class="QWidget" name="widget" native="true">
-        <layout class="QFormLayout" name="formLayout">
+        <layout class="QFormLayout" name="formLayout_3">
          <item row="0" column="0">
           <widget class="QLabel" name="label">
            <property name="sizePolicy">
          <item row="0" column="1">
           <widget class="QDoubleSpinBox" name="dx_spb_rb0">
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
          </item>
          <item row="1" column="1">
           <widget class="QDoubleSpinBox" name="dy_spb_rb0">
+           <property name="enabled">
+            <bool>true</bool>
+           </property>
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
          <item row="2" column="1">
           <widget class="QDoubleSpinBox" name="dz_spb_rb0">
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
         </layout>
        </widget>
       </item>
-      <item row="2" column="0" colspan="2">
+      <item>
        <widget class="QWidget" name="widget_2" native="true">
         <layout class="QFormLayout" name="formLayout_2">
          <item row="0" column="0">
          </item>
          <item row="0" column="1">
           <widget class="QLineEdit" name="v0_le_rb1">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
          </item>
          <item row="1" column="1">
           <widget class="QLineEdit" name="v1_le_rb1">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <property name="maximumSize">
             <size>
-             <width>127</width>
+             <width>16777215</width>
              <height>16777215</height>
             </size>
            </property>
    </item>
   </layout>
  </widget>
+ <tabstops>
+  <tabstop>rb0</tabstop>
+  <tabstop>rb1</tabstop>
+  <tabstop>name_le</tabstop>
+  <tabstop>v0_le_rb1</tabstop>
+  <tabstop>v1_le_rb1</tabstop>
+  <tabstop>dx_spb_rb0</tabstop>
+  <tabstop>dy_spb_rb0</tabstop>
+  <tabstop>dz_spb_rb0</tabstop>
+ </tabstops>
  <resources/>
  <connections>
   <connection>
index 9ec0f4821e7bd53cc6d946bff5a095ba489e57d4..97270006d33672e843a644e6d4f2be0ab240579b 100755 (executable)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>260</width>
-    <height>160</height>
+    <width>210</width>
+    <height>202</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -18,7 +18,7 @@
   </property>
   <property name="minimumSize">
    <size>
-    <width>260</width>
+    <width>0</width>
     <height>0</height>
    </size>
   </property>
   <property name="windowTitle">
    <string>Vertex Construction</string>
   </property>
-  <layout class="QVBoxLayout" name="verticalLayout_2">
-   <property name="sizeConstraint">
-    <enum>QLayout::SetDefaultConstraint</enum>
-   </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
    <item>
     <widget class="QGroupBox" name="groupBox">
      <property name="title">
       <string>Arguments</string>
      </property>
-     <layout class="QFormLayout" name="formLayout">
-      <property name="fieldGrowthPolicy">
-       <enum>QFormLayout::ExpandingFieldsGrow</enum>
-      </property>
-      <item row="0" column="0">
-       <widget class="QLabel" name="label_6">
-        <property name="text">
-         <string> Name </string>
-        </property>
+     <layout class="QVBoxLayout" name="verticalLayout_2">
+      <item>
+       <widget class="QWidget" name="widget" native="true">
+        <layout class="QFormLayout" name="formLayout_2">
+         <property name="fieldGrowthPolicy">
+          <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
+         </property>
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_6">
+           <property name="text">
+            <string> Name </string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QLineEdit" name="name_le">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>16777215</height>
+            </size>
+           </property>
+          </widget>
+         </item>
+        </layout>
        </widget>
       </item>
-      <item row="0" column="1">
-       <widget class="QLineEdit" name="name_le">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="maximumSize">
-         <size>
-          <width>127</width>
-          <height>16777215</height>
-         </size>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="0">
-       <widget class="QLabel" name="label">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="text">
-         <string>x : </string>
-        </property>
-       </widget>
-      </item>
-      <item row="1" column="1">
-       <widget class="QDoubleSpinBox" name="x_spb">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="decimals">
-         <number>6</number>
-        </property>
-        <property name="maximum">
-         <double>1000000000.000000000000000</double>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="0">
-       <widget class="QLabel" name="label_2">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="text">
-         <string>y : </string>
-        </property>
-       </widget>
-      </item>
-      <item row="2" column="1">
-       <widget class="QDoubleSpinBox" name="y_spb">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="decimals">
-         <number>6</number>
-        </property>
-        <property name="maximum">
-         <double>1000000000.000000000000000</double>
-        </property>
-       </widget>
-      </item>
-      <item row="3" column="0">
-       <widget class="QLabel" name="label_3">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="text">
-         <string>z : </string>
-        </property>
-       </widget>
-      </item>
-      <item row="3" column="1">
-       <widget class="QDoubleSpinBox" name="z_spb">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="decimals">
-         <number>6</number>
-        </property>
-        <property name="maximum">
-         <double>1000000000.000000000000000</double>
-        </property>
+      <item>
+       <widget class="QWidget" name="widget_2" native="true">
+        <layout class="QFormLayout" name="formLayout">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="text">
+            <string>x : </string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QDoubleSpinBox" name="x_spb">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="decimals">
+            <number>6</number>
+           </property>
+           <property name="maximum">
+            <double>1000000000.000000000000000</double>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="0">
+          <widget class="QLabel" name="label_2">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="text">
+            <string>y : </string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="1">
+          <widget class="QDoubleSpinBox" name="y_spb">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="decimals">
+            <number>6</number>
+           </property>
+           <property name="maximum">
+            <double>1000000000.000000000000000</double>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="0">
+          <widget class="QLabel" name="label_3">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="text">
+            <string>z : </string>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="1">
+          <widget class="QDoubleSpinBox" name="z_spb">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="decimals">
+            <number>6</number>
+           </property>
+           <property name="maximum">
+            <double>1000000000.000000000000000</double>
+           </property>
+          </widget>
+         </item>
+        </layout>
+        <zorder>x_spb</zorder>
+        <zorder>label</zorder>
+        <zorder>x_spb</zorder>
+        <zorder>y_spb</zorder>
+        <zorder>label_2</zorder>
+        <zorder>z_spb</zorder>
+        <zorder>label_3</zorder>
        </widget>
       </item>
      </layout>
+     <zorder>widget</zorder>
+     <zorder>widget_2</zorder>
+     <zorder>x_spb</zorder>
+     <zorder>label</zorder>
     </widget>
    </item>
   </layout>
index 8959a5e4245777f197ee79860f802a6c7549245d..68f09ede4e6d120b23cb2be8748f2bc56ad6d3ed 100755 (executable)
@@ -21,8 +21,6 @@ using namespace std;
 
 static bool db = false;
 
-
-
 // #include <Basics_Utils.hxx>
 // 
 // #include <TDF_Tool.hxx>
@@ -747,7 +745,8 @@ char* HEXABLOCK_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
 {
    if (db) cout << " +++++++ Je suis passe par  HEXABLOCK_Gen_i::"
         << "IORToLocalPersistentID" << endl;
-   static char empty [8] = "";
+   /// static char empty [8] = "";
+   char*  empty = strdup ("");
    return empty;
 }
 // =================================================== LocalPersistentIDToIOR
index 77fb5341d191410c0ecb5e5e9f2daad47aed69d7..f9b5215a8572b6a8bf218641d7e0695643e680cb 100755 (executable)
@@ -462,17 +462,17 @@ Vector_ptr Document_impl::addVectorVertices( Vertex_ptr v0In, Vertex_ptr v1In )
 }
 
 
-// ::CORBA::Long Document_impl::countVector() throw (SALOME::SALOME_Exception)
-// {
-//   return  _document_cpp->countVector();
-// }
-// 
-// Vector_ptr Document_impl::getVector(::CORBA::Long i) throw (SALOME::SALOME_Exception)
-// {
-//   HEXA_NS::Vector* h = _document_cpp->getVector(i);
-//   Vector_impl* servantCorba = new Vector_impl(h);
-//   return servantCorba->_this();
-// }
+::CORBA::Long Document_impl::countVector() throw (SALOME::SALOME_Exception)
+{
+   return  _document_cpp->countVector();
+}
+Vector_ptr Document_impl::getVector(::CORBA::Long i) throw (SALOME::SALOME_Exception)
+{
+   HEXA_NS::Vector* h = _document_cpp->getVector(i);
+   Vector_impl* servantCorba = new Vector_impl(h);
+   return servantCorba->_this();
+}
 
 
 Cylinder_ptr Document_impl::addCylinder( Vertex_ptr baseIn, Vector_ptr directionIn,
@@ -499,18 +499,17 @@ throw (SALOME::SALOME_Exception)
   return result;
 }
 
-// ::CORBA::Long Document_impl::countCylinder() throw (SALOME::SALOME_Exception)
-// {
-//   return  _document_cpp->countCylinder();
-// }
-// 
-// 
-// Cylinder_ptr Document_impl::getCylinder(::CORBA::Long i) throw (SALOME::SALOME_Exception)
-// {
-//   HEXA_NS::Cylinder* c = _document_cpp->getCylinder(i);
-//   Cylinder_impl* servantCorba = new Cylinder_impl(c);
-//   return servantCorba->_this();
-// }
+::CORBA::Long Document_impl::countCylinder() throw (SALOME::SALOME_Exception)
+{
+   return  _document_cpp->countCylinder();
+}
+Cylinder_ptr Document_impl::getCylinder(::CORBA::Long i) throw (SALOME::SALOME_Exception)
+{
+   HEXA_NS::Cylinder* c = _document_cpp->getCylinder(i);
+   Cylinder_impl* servantCorba = new Cylinder_impl(c);
+   return servantCorba->_this();
+}
 
 
 Pipe_ptr Document_impl::addPipe( Vertex_ptr baseIn, Vector_ptr directionIn,
@@ -538,17 +537,17 @@ throw (SALOME::SALOME_Exception)
 }
 
 
-// ::CORBA::Long Document_impl::countPipe() throw (SALOME::SALOME_Exception)
-// {
-//   return  _document_cpp->countPipe();
-// }
-// 
-// Pipe_ptr Document_impl::getPipe(::CORBA::Long i) throw (SALOME::SALOME_Exception)
-// {
-//   HEXA_NS::Pipe* p = _document_cpp->getPipe(i);
-//   Pipe_impl* servantCorba = new Pipe_impl(p);
-//   return servantCorba->_this();
-// }
+::CORBA::Long Document_impl::countPipe() throw (SALOME::SALOME_Exception)
+{
+   return  _document_cpp->countPipe();
+}
+Pipe_ptr Document_impl::getPipe(::CORBA::Long i) throw (SALOME::SALOME_Exception)
+{
+   HEXA_NS::Pipe* p = _document_cpp->getPipe(i);
+   Pipe_impl* servantCorba = new Pipe_impl(p);
+   return servantCorba->_this();
+}
 
 ::CORBA::Boolean Document_impl::removeHexa(Hexa_ptr hIn) throw (SALOME::SALOME_Exception)
 {
@@ -1377,7 +1376,6 @@ Group_ptr Document_impl::addEdgeNodeGroup(const char* name) throw (SALOME::SALOM
   return result;
 }
 
-
 Group_ptr Document_impl::addVertexNodeGroup(const char* name) throw (SALOME::SALOME_Exception)
 {
   Group_ptr result = Group::_nil();
index 9e76f11219db3a062b58b6b9c30c182f47a77eb3..4f5e54af60231d37083770772b9bab5b6a078cf4 100755 (executable)
@@ -72,14 +72,14 @@ public:
   Hexa_ptr findHexa(Vertex_ptr p1, Vertex_ptr p2) throw (SALOME::SALOME_Exception);
   Vector_ptr addVector(::CORBA::Double dx, ::CORBA::Double dy, ::CORBA::Double dz) throw (SALOME::SALOME_Exception);
   Vector_ptr addVectorVertices(Vertex_ptr v1, Vertex_ptr v2) throw (SALOME::SALOME_Exception);
-//   ::CORBA::Long countVector() throw (SALOME::SALOME_Exception);
-//   Vector_ptr getVector(::CORBA::Long i) throw (SALOME::SALOME_Exception);
+::CORBA::Long countVector() throw (SALOME::SALOME_Exception);
+Vector_ptr getVector(::CORBA::Long i) throw (SALOME::SALOME_Exception);
   Cylinder_ptr addCylinder(Vertex_ptr base, Vector_ptr direction, ::CORBA::Double radius, ::CORBA::Double height) throw (SALOME::SALOME_Exception);
-//   ::CORBA::Long countCylinder() throw (SALOME::SALOME_Exception);
-//   Cylinder_ptr getCylinder(::CORBA::Long i) throw (SALOME::SALOME_Exception);
+::CORBA::Long countCylinder() throw (SALOME::SALOME_Exception);
+Cylinder_ptr getCylinder(::CORBA::Long i) throw (SALOME::SALOME_Exception);
   Pipe_ptr addPipe(Vertex_ptr base, Vector_ptr direction, ::CORBA::Double int_radius, ::CORBA::Double ext_radius, ::CORBA::Double height) throw (SALOME::SALOME_Exception);
-//   ::CORBA::Long countPipe() throw (SALOME::SALOME_Exception);
-//   Pipe_ptr getPipe(::CORBA::Long i) throw (SALOME::SALOME_Exception);
+::CORBA::Long countPipe() throw (SALOME::SALOME_Exception);
+Pipe_ptr getPipe(::CORBA::Long i) throw (SALOME::SALOME_Exception);
   ::CORBA::Boolean removeHexa(Hexa_ptr h) throw (SALOME::SALOME_Exception);
   ::CORBA::Boolean removeConnectedHexa(Hexa_ptr h) throw (SALOME::SALOME_Exception);
   Elements_ptr makeCartesian(Vertex_ptr pt, Vector_ptr vx, Vector_ptr vy, Vector_ptr vz, ::CORBA::Long nx, ::CORBA::Long ny, ::CORBA::Long nz) throw (SALOME::SALOME_Exception);
index 83fdc5748f344bc0a8f82a72b24f834873ab4004..1f4faea0aac7e30a41d674f427278f900903d370 100755 (executable)
@@ -90,8 +90,11 @@ void Edge_impl::setName(const char* name)
   _edge_cpp->setName (name);
 }
 
-
-
+void Edge_impl::setColor (::CORBA::Double val)
+     throw (SALOME::SALOME_Exception)
+{
+  _edge_cpp->setColor (val);
+}
 
 void Edge_impl::setScalar( ::CORBA::Double val )throw (SALOME::SALOME_Exception)
 {
index 7c34a44beb98bdc24a4fe1a541546415c0d4f0e0..a0c349c524f0cf708b5a649223b9e37cff34ac97 100755 (executable)
@@ -52,6 +52,7 @@ public:
   EdgeAssociations* getAssociations () //CS_NOT_SPEC
       throw (SALOME::SALOME_Exception);
 
+  void setColor (::CORBA::Double val)  throw (SALOME::SALOME_Exception);
   void setScalar( ::CORBA::Double val )throw (SALOME::SALOME_Exception);
   void dump() throw (SALOME::SALOME_Exception);
   void printName() throw (SALOME::SALOME_Exception);
index 1b5c79c2b63106b5f13ca58572c3b6bee151a70b..f11e9b048e097ad0c02bae8e40affada117eb28a 100755 (executable)
@@ -77,6 +77,12 @@ Vertex_ptr Hexa_impl::getVertex(::CORBA::Long n)
   return result;
 }
 
+void Hexa_impl::setColor (::CORBA::Double val)
+     throw (SALOME::SALOME_Exception)
+{
+  _hexa_cpp->setColor (val);
+}
+
 void Hexa_impl::setScalar( ::CORBA::Double val )throw (SALOME::SALOME_Exception)
 {
   _hexa_cpp->setScalar(val);
index 58e5964b32cf248b06db4bf13344773fa5513ff3..f82a103fef012a87debf49c1b840408a14aad3ab 100755 (executable)
@@ -39,6 +39,7 @@ public:
   Edge_ptr getEdge(::CORBA::Long n) throw (SALOME::SALOME_Exception);
   Vertex_ptr getVertex(::CORBA::Long n) throw (SALOME::SALOME_Exception);
 
+  void setColor (::CORBA::Double val)  throw (SALOME::SALOME_Exception);
   void setScalar( ::CORBA::Double val ) throw (SALOME::SALOME_Exception);
   void dump() throw (SALOME::SALOME_Exception);
   void printName() throw (SALOME::SALOME_Exception);
index 7ba12d252110b4f9a6343664b02d367d33a3f4f7..c647ecd5a732f4e28842c2d0931c3f6a91e89ee2 100755 (executable)
@@ -156,6 +156,12 @@ GEOM::ListOfGO* Quad_impl::getAssociations() //CS_NOT_SPEC
 // {
 // }
 
+void Quad_impl::setColor (::CORBA::Double val)
+     throw (SALOME::SALOME_Exception)
+{
+  _quad_cpp->setColor (val);
+}
+
 void Quad_impl::setScalar( ::CORBA::Double val )throw (SALOME::SALOME_Exception)
 {
   _quad_cpp->setScalar(val);
index c4812937842cc12c370924b7d9af07ee19652351..e0aaa8d5868c769caf650db8dd63b8fa005a57e6 100755 (executable)
@@ -48,6 +48,7 @@ public:
 
   void clearAssociation() throw (SALOME::SALOME_Exception);
 
+  void setColor (::CORBA::Double val)  throw (SALOME::SALOME_Exception);
   void setScalar( ::CORBA::Double val )throw (SALOME::SALOME_Exception);
   void dump() throw (SALOME::SALOME_Exception);
   void printName() throw (SALOME::SALOME_Exception);
index 94c578020db00146806873f263da71a650c5ffe9..dcf0030063a75bc0a7d65f7fef464d1ccfac5f0c 100755 (executable)
@@ -116,6 +116,12 @@ void Vertex_impl::clearAssociation()
 }
 
 
+void Vertex_impl::setColor (::CORBA::Double val)
+     throw (SALOME::SALOME_Exception)
+{
+  _vertex_cpp->setColor (val);
+}
+
 void Vertex_impl::setScalar( ::CORBA::Double val )throw (SALOME::SALOME_Exception)
 {
   _vertex_cpp->setScalar(val);
index 6d6da5147c2ac5292996bcb1a6c9706bf38779d0..a1cb8f40c3784400594335f28f963a193343f804 100755 (executable)
@@ -47,6 +47,7 @@ public:
   GEOM::GEOM_Object_ptr getAssociation() throw (SALOME::SALOME_Exception);
   void clearAssociation() throw (SALOME::SALOME_Exception);
 
+  void setColor (::CORBA::Double val)  throw (SALOME::SALOME_Exception);
   void setScalar( ::CORBA::Double val )throw (SALOME::SALOME_Exception);
 
   void dump() throw (SALOME::SALOME_Exception);
diff --git a/src/TEST_PY/INTER_3_CYLINDRE.py b/src/TEST_PY/INTER_3_CYLINDRE.py
deleted file mode 100755 (executable)
index 4b0c43d..0000000
+++ /dev/null
@@ -1,415 +0,0 @@
-# -*- coding: latin-1 -*-
-# Copyright (C) 2009-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
-#
-
-#===============================================
-# By Karima DEBCHI YATAGHENE Nov 2009 at CS 
-#===============================================
-
-import os
-import SALOME
-import geompy
-import smesh
-import hexablock
-import math
-
-
-
-# chemin du fichier BREP contenant la CAO
-BREP_PATH = os.path.expandvars("$HEXABLOCK_ROOT_DIR/bin/salome/tees.brep")
-#===================================================================
-#               LE MODELE:
-#===================================================================
-
-
-#=============================
-# PARAMETRES
-#=============================
-
-#=============================
-# CREATION DOCUMENT
-#=============================
-doc = hexablock.addDocument("cylindres")
-
-#=============================
-# CREATION DU MODELE
-#=============================
-CYL1 = 0
-CYL2 = 1
-
-
-S_E    = 0
-S_NE   = 1
-S_N    = 2
-S_NW   = 3
-S_W    = 4
-S_SW   = 5
-S_S    = 6
-S_SE   = 7
-S_MAXI = 8
-
-##dy = doc.addVector ( 0, 1, 0 )
-dx1 = doc.addVector( -1, 0, 0 )
-dz1 = doc.addVector( 0, 0, 1 )
-
-
-c_pte_1 = doc.addVertex ( 190., 0., 220. )
-c_grd_1 = doc.addVertex ( 300., 0., 400. )
-cyl_pte_1 = doc.addCylinder( c_pte_1 , dz1 , 20 , 360 ) #580-220
-cyl_grd_1 = doc.addCylinder( c_grd_1 , dx1 , 50 , 140 )
-cross1 = doc.makeCylinders( cyl_pte_1 , cyl_grd_1 )
-
-
-dx2 = doc.addVector( -1, 0, 0 )
-dz2 = doc.addVector( 0, 0, 1 )
-c_pte_2 = doc.addVertex( 110. , 0. , 400. )
-c_grd_2 = doc.addVertex( 0. , 0. , 0. )
-
-cyl_pte_2 = doc.addCylinder( c_pte_2 , dx2 , 50, 220 )
-cyl_grd_2 = doc.addCylinder( c_grd_2 , dz2 , 100, 800 )
-cross2    = doc.makeCylinders( cyl_pte_2, cyl_grd_2 )
-
-# Qq constantes
-coul1 = 5
-coul2 = 3
-
-# Pour les bicylindres
-xhint   = 0   # indice x pour les hexa interieurs
-xhext   = 1   # indice x pour les hexa exterieurs
-xvint   = 0   # indice x pour les vertex interieurs
-xvext   = 2   # indice x pour les vertex exterieurs
-zbas    = 0
-zhhaut1  = 5   # hauteur max quad  petit cylindre
-zhhaut2  = 3   # hauteur max quad  gros cylindre
-zvhaut1  = 6   # hauteur max vertex du petit  cylindre
-zvhaut2  = 4   # hauteur max vertex du gros  cylindre
-
-# La jointure
-hQuads = []
-for ny in range(8):
-    hQuads+=[cross2.getQuadIJ(CYL1, xhext, ny, zbas)]
-
-for ny in range(4):
-    hQuads+=[cross2.getQuadIJ(CYL1, xhint, ny, zbas)]
-
-qstart0 = cross2.getQuadIJ (CYL1, xhext, S_E, zbas)
-qtarget = cross1.getQuadIJ (CYL2, xhext, S_S, zvhaut2)
-
-vb0 = qtarget.getVertex (0)
-vb1 = qtarget.getVertex (1)
-vh0 = qstart0.getVertex (0)
-vh1 = qstart0.getVertex (1)
-
-hauteur = 3
-joint = doc.joinQuads (hQuads, qtarget, vh0,vb0, vh1,vb1, hauteur)
-
-# Elimination bout en trop
-for ny in range(8):
-    h = cross2.getHexaIJK (CYL1, xhext, ny, zhhaut1)
-    doc.removeHexa(h)
-    if ny<4:
-        h = cross2.getHexaIJK (CYL1, xhint, ny, zhhaut1)
-        doc.removeHexa(h)
-
-
-#===================================================================
-# Recuperation edges du model pour l'association
-#===================================================================
-
-##=========================
-##       EDGES
-##=========================
-### BIG CYLINDER
-top_BIG    = []
-bottom_BIG = []
-for ny in range(8):
-    bottom_BIG += [ cross2.getEdgeJ(CYL2, 2, ny, 0) ]
-
-for ny in range(8):
-    top_BIG += [ cross2.getEdgeJ(CYL2, 2, ny, zvhaut2) ]
-
-### MEDIUM CYLINDER
-left_MEDIUM_BIG = []
-right_MEDIUM    = []
-
-for ny in range(8):
-    left_MEDIUM_BIG += [cross2.getEdgeJ (CYL1, 2, ny, 1)]
-
-for ny in range(8):
-    right_MEDIUM += [ cross1.getEdgeJ (CYL2, 2, ny, 0) ]
-
-### SMALL CYLINDER
-top_SMALL           = []
-top_SMALL_MEDIUM    = []
-bottom_SMALL_MEDIUM = []
-bottom_SMALL        = []
-
-for ny in range(8):
-    top_SMALL += [ cross1.getEdgeJ(CYL1, 2, ny, zvhaut1) ]
-for ny in range(8):
-    top_SMALL_MEDIUM += [ cross1.getEdgeJ(CYL1, 2, ny, zvhaut1-1) ]
-for ny in range(8):
-    bottom_SMALL_MEDIUM += [ cross1.getEdgeJ(CYL1, 2, ny, 1) ]
-for ny in range(8):
-    bottom_SMALL += [ cross1.getEdgeJ(CYL1, 2, ny, 0) ]
-
-
-#===================================================================
-#               LA GEOMETRIE
-#===================================================================
-
-#===================================================================
-# Recuperation des �l�ments de la geometrie tuyau pour l'association
-#===================================================================
-tees_ = geompy.Import(BREP_PATH, "BREP")
-
-##=========================
-##       EDGES
-##=========================
-all_edges_ = geompy.SubShapeAllSorted( tees_ , geompy.ShapeType["EDGE"] )
-
-### BIG CYLINDER
-top_BIG_    = all_edges_[1]
-bottom_BIG_ = all_edges_[0]
-
-### MEDIUM CYLINDER
-left_MEDIUM_BIG_ = [ all_edges_[3], all_edges_[5] , all_edges_[4], all_edges_[2], ]
-right_MEDIUM_    = all_edges_[20]
-
-### SMALL CYLINDER
-top_SMALL_            = all_edges_[13]
-top_SMALL_MEDIUM_     = [ all_edges_[11], all_edges_[16] ]
-bottom_SMALL_MEDIUM_  = [ all_edges_[10], all_edges_[9], all_edges_[14], all_edges_[15] ]
-bottom_SMALL_         = all_edges_[12]
-
-
-#==========================================================
-#               LES ASSOCIATIONS
-#==========================================================
-
-##===========================================
-##          EDGES
-##===========================================
-def associateEdges( edges, edges_, i_assoc, oppositeWay = False ):
-    nb_points = float( len(i_assoc) )
-    #print "nb_points ", nb_points
-    for i, i_ in i_assoc.items():
-        e  = edges[i]
-        e0 = e.getVertex(0)
-        e1 = e.getVertex(1)
-
-        if oppositeWay:
-            u0 = (i_+1.)/nb_points
-            u1 = i_/nb_points
-            e.addAssociation( edges_ , u1, u0 )
-        else:
-            u0 = i_/nb_points
-            u1 = (i_+1.)/nb_points
-            e.addAssociation( edges_ , u0, u1 )
-
-        e0_ = geompy.MakeVertexOnCurve( edges_, u0 )
-        e1_ = geompy.MakeVertexOnCurve( edges_, u1 )
-        e0.setAssociation( e0_ )
-        e1.setAssociation( e1_ )
-
-
-
-## BIG CYLINDER
-assoc   = { 4:0, 5:1, 6:2, 7:3, 0:4, 1:5, 2:6, 3:7 }
-associateEdges( top_BIG   , top_BIG_,    assoc )
-associateEdges( bottom_BIG, bottom_BIG_, assoc )
-
-## SMALL CYLINDER
-assoc = { 4:6, 5:7, 6:0, 7:1, 0:2, 1:3, 2:4, 3:5 }
-associateEdges( top_SMALL   , top_SMALL_,    assoc )
-associateEdges( bottom_SMALL, bottom_SMALL_, assoc )
-
-
-## SMALL-MEDIUM CYLINDER
-
-### Top ( un peu 'touchy' )
-e = top_SMALL_MEDIUM[0]
-e_0  = e.getVertex(0)
-e_0_ = geompy.MakeVertexOnCurve( top_SMALL_MEDIUM_[0], 0.)
-e_0.setAssociation( e_0_ )
-top_SMALL_MEDIUM_0_vertices_ = [ e_0_ ]
-
-for i, e in enumerate( top_SMALL_MEDIUM[0:6] ):
-    e_1 = e.getVertex(1)
-    e_1_ = geompy.MakeVertexOnCurve( top_SMALL_MEDIUM_[0], (i+1.)/6.)
-    e_1.setAssociation( e_1_ )
-    top_SMALL_MEDIUM_0_vertices_ += [ e_1_ ]
-
-partition_ = geompy.MakePartition( [ top_SMALL_MEDIUM_[0] ],
-    top_SMALL_MEDIUM_0_vertices_, [], [], geompy.ShapeType["EDGE"], 0, [], 0 )
-top_SMALL_MEDIUM_0_edges_ = geompy.SubShapeAllSorted( partition_, geompy.ShapeType["EDGE"] )
-
-
-assoc = { 0:2, 1:0, 2:1, 3:3, 4:4, 5:5 }
-for i,i_ in assoc.items():
-    e  = top_SMALL_MEDIUM[i]
-    e_ = top_SMALL_MEDIUM_0_edges_[i_]
-    e.addAssociation( e_, 0., 1. )
-
-assoc = { 6:0, 7:1 }
-associateEdges( top_SMALL_MEDIUM, top_SMALL_MEDIUM_[1], assoc )
-
-
-### Bottom
-assocs = [ { 0:1, 1:0  }, { 2:1, 3:0 },  { 4:0, 5:1 }, { 6:0, 7:1 } ] # 4 edges
-associateEdges( bottom_SMALL_MEDIUM, bottom_SMALL_MEDIUM_[0], assocs[0], True )
-associateEdges( bottom_SMALL_MEDIUM, bottom_SMALL_MEDIUM_[1], assocs[1], True )
-associateEdges( bottom_SMALL_MEDIUM, bottom_SMALL_MEDIUM_[2], assocs[2] )
-associateEdges( bottom_SMALL_MEDIUM, bottom_SMALL_MEDIUM_[3], assocs[3] )
-
-
-
-## MEDIUM CYLINDER
-assocs = [ { 0:0, 1:1  }, { 2:0, 3:1 },  { 4:1, 5:0 }, { 6:1, 7:0 } ]
-associateEdges( left_MEDIUM_BIG, left_MEDIUM_BIG_[0], assocs[0] )
-associateEdges( left_MEDIUM_BIG, left_MEDIUM_BIG_[1], assocs[1] )
-associateEdges( left_MEDIUM_BIG, left_MEDIUM_BIG_[2], assocs[2], True )
-associateEdges( left_MEDIUM_BIG, left_MEDIUM_BIG_[3], assocs[3], True )
-
-assoc = { 0:3, 1:2, 2:1, 3:0, 4:7, 5:6, 6:5, 7:4 }
-associateEdges( right_MEDIUM, right_MEDIUM_,  assoc , True )
-
-
-
-#allfaces_ = geompy.SubShapeAllSorted(tees_, geompy.ShapeType["FACE"])
-#for i,f in enumerate( allfaces_ ):
-    #geompy.addToStudy( f,   "allfaces"+str(i) )
-
-#for ny in range(8):
-    #q = cross2.getQuadJK(CYL2,2,ny,0)
-    #q.addAssociation( allfaces_[2] )
-
-#for ny in range(8):
-    #q = cross2.getQuadJK(CYL2,2,ny,1)
-    #if q:
-        #q.addAssociation( allfaces_[2] )
-
-
-
-
-##==========================================================
-##       LA GEOMETRIE DANS L'ARBRE D'ETUDE SALOME
-##==========================================================
-geompy.addToStudy( tees_,           "Tees" )
-
-#### BIG CYLINDER
-geompy.addToStudy( top_BIG_,        "top_BIG" )
-geompy.addToStudy( bottom_BIG_,     "bottom_BIG" )
-
-#### SMALL CYLINDER
-geompy.addToStudy( top_SMALL_,       "top_SMALL" )
-for i,e in enumerate(top_SMALL_MEDIUM_):
-    geompy.addToStudy( e, "top_SMALL_MEDIUM"+str(i) )
-for i,e in enumerate(top_SMALL_MEDIUM_0_edges_):
-    geompy.addToStudy( e, "top_SMALL_MEDIUM_0_edges_"+str(i) )
-for i,e in enumerate(bottom_SMALL_MEDIUM_):
-    geompy.addToStudy( e, "bottom_SMALL_MEDIUM"+str(i) )
-geompy.addToStudy( bottom_SMALL_,    "bottom_SMALL" )
-
-#### MEDIUM CYLINDER
-geompy.addToStudy( right_MEDIUM_,    "right_MEDIUM" )
-for i,e in enumerate(left_MEDIUM_BIG_):
-    geompy.addToStudy( e,   "left_MEDIUM_BIG"+str(i) )
-
-
-
-#====================================
-# CREATION GROUPES DU MAILLAGE
-#====================================
-
-#On definit 3 groupes de mailles
-
-#groupe d edges (aretes)
-Edge_grp = doc.addEdgeGroup("Edge_grp")
-Nbr_Edg = doc.countEdge()
-for i in range(Nbr_Edg):
-    Edge_i = doc.getEdge(i)
-    Edge_grp.addElement(Edge_i)
-
-# groupe de quads (faces)
-Quad_grp = doc.addQuadGroup("Quad_grp")
-Nbr_Qad = doc.countQuad()
-for i in range(Nbr_Qad):
-    Quad_i = doc.getQuad(i)
-    Quad_grp.addElement(Quad_i)
-
-# groupe d hexas (solids)
-Hexa_grp = doc.addHexaGroup("Hexa_grp")
-Nbr_Hex = doc.countHexa()
-for i in range(Nbr_Hex):
-    Hexa_i = doc.getHexa(i)
-    Hexa_grp.addElement(Hexa_i)
-
-# groupe de noeuds de vertex pour tout le modele 
-Vertex_Nod_Grp = doc.addVertexNodeGroup("Vertex_Nod_Grp")
-Nbr_Vx = doc.countVertex()
-for i in range(Nbr_Vx):
-    Vertex_i = doc.getVertex(i)
-    Vertex_Nod_Grp.addElement(Vertex_i)
-
-
-
-##====================================
-## CREATION MAILLAGE
-##====================================
-
-
-##====================================
-## Definir une loi de discretisation
-##====================================
-
-
-# definir une loi: le choix de la loi reste aux utilisateurs
-Law = doc.addLaw( "Uniform" , 4 )
-#Law = doc.addLaw( "Uniform" , 8 )
-
-# chercher les propagations du modele
-N_Propa = doc.countPropagation()
-
-for j in range(N_Propa):
-    Propa = doc.getPropagation(j)
-    Propa.setLaw( Law )# appliquer la loi de discretisation sur tout le modele et generer le maillage
-
-try:
-    mesh = hexablock.mesh(doc, "Inter_3_Cylindre")
-#    mesh = .hexablock.mesh(doc, "Inter_3_Cylindre:quads", 2)
-except SALOME.SALOME_Exception, ex:
-    print "Mesh computation failed, exception caught:"
-    print "    ", ex.details.text
-except:
-    import traceback
-    print "Mesh computation failed, exception caught:"
-    traceback.print_exc()
-
-
-print "Nombre d'hexaedres:", mesh.NbHexas()
-print "Nombre de quadrangles:", mesh.NbQuadrangles()
-print "Nombre de segments:", mesh.NbEdges()
-print "Nombre de noeuds:", mesh.NbNodes()
-
-
-
-
-
-
index 87385ed657ca520b70e00d54b3d3bbb68432fedd..6139168ecac0fe111ef7cdc72800efee486fde4f 100755 (executable)
@@ -25,23 +25,7 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
 # ===============================================================
 
 # Scripts to be installed
-# dist_salomescript_PYTHON = TestHEXA.py
-dist_salomescript_PYTHON = \
-       bielle.py \
-       test_BIELLE_no_assoc.py \
-       test_BIELLE_bad_assoc.py \
-       TUYAU_COURBE.py \
-       test_TUYAU_COURBE_no_assoc.py \
-       test_TUYAU_COURBE_weird_assoc.py \
-       INTER_3_CYLINDRE.py \
-       test_INTER_3_CYLINDRE_no_assoc.py \
-       Test_HEXABLOCK.py \
-       test_HEXABLOCK.py \
-       bride.py \
-       test_distrib.py
-
-dist_salomescript_DATA = \
-       tees.brep \
-       tuyau.brep \
-       crank.stp
+# dist_salomescript_PYTHON = foo
+dist_salomescript_PYTHON = foo.py
+dist_salomescript_DATA = 
 
diff --git a/src/TEST_PY/TUYAU_COURBE.py b/src/TEST_PY/TUYAU_COURBE.py
deleted file mode 100755 (executable)
index 51331bf..0000000
+++ /dev/null
@@ -1,790 +0,0 @@
-# -*- coding: latin-1 -*-
-# Copyright (C) 2009-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
-#
-
-#===============================================
-# By Karima DEBCHI YATAGHENE Nov 2009 at CS 
-#===============================================
-import os
-import geompy
-import smesh
-import hexablock
-import math
-
-# chemin du fichier BREP contenant la CAO
-BREP_PATH = os.path.expandvars("$HEXABLOCK_ROOT_DIR/bin/salome/tuyau.brep")
-
-
-
-
-#===================================================================
-#               LE MODELE:
-#   (Pour le tuyau on doit creer une grille cylindrique)
-#===================================================================
-
-
-#=============================
-# PARAMETRES
-#=============================
-R = 4.5
-r = 4.5
-r_t = 3.6
-h = 75.0
-
-
-#=================================================
-# Creation du document
-#=================================================
-doc = hexablock.addDocument("TUYAU_COURBE")
-
-#=================================================
-# Creation du tuyau (grille cylindrique) dans le document
-#=================================================
-# centre de la grille cylindrique
-c = doc.addVertex(0, 0, 0) 
-
-# vecteurs de la grille cylindrique
-dx = doc.addVector(h, 0, 0)
-dy = doc.addVector(0, h, 0)
-dz = doc.addVector(0, 0, h)
-
-# taille du cylindre
-dr = R
-da = 360
-dl = h
-
-nr = 1
-na = 4
-nl = 1
-
-model_tuyau_fin = doc.makeCylindrical(c, dx, dz, dr, da, dl, nr, na, nl, False)
-# note: on obtient une liste qui contient 4 hexaedres eguaux
-
-
-#===================================================================
-# Recuperation des vertex,edges et quads du model pour l'association
-#
-# h = haut
-# b = bas
-# g = grand
-# p = petit
-# t = trou
-#===================================================================
-
-#=========================
-#       VERTEX
-#=========================
-
-# Face du haut 
-#   grand rayon
-x_mod_h = doc.findVertex( 2*R , 0 , h )
-y_mod_h = doc.findVertex( 0 , 2*R , h )
-z_mod_h = doc.findVertex( -2*R , 0 , h )
-u_mod_h = doc.findVertex( 0 , -2*R , h )
-
-#   petit rayon
-x_mod_h_t = doc.findVertex( R , 0 , h )
-y_mod_h_t = doc.findVertex( 0 , R , h )
-z_mod_h_t = doc.findVertex( -R , 0 , h )
-u_mod_h_t = doc.findVertex( 0 , -R , h )
-
-# Face du bas
-#   grand rayon
-x_mod_b = doc.findVertex( 2*R , 0 , 0 )
-y_mod_b = doc.findVertex( 0 , 2*R , 0 )
-z_mod_b = doc.findVertex( -2*R , 0 , 0 )
-u_mod_b = doc.findVertex( 0 , -2*R , 0 )
-
-#   petit rayon
-x_mod_b_t = doc.findVertex( R , 0 , 0 )
-y_mod_b_t = doc.findVertex( 0 , R , 0 )
-z_mod_b_t = doc.findVertex( -R , 0 , 0 )
-u_mod_b_t = doc.findVertex( 0 , -R , 0 )
-
-
-# v�rifications
-assert x_mod_h
-assert y_mod_h
-assert z_mod_h
-assert u_mod_h
-
-assert x_mod_h_t
-assert y_mod_h_t
-assert z_mod_h_t
-assert u_mod_h_t
-
-assert x_mod_b
-assert y_mod_b
-assert z_mod_b
-assert u_mod_b
-
-assert x_mod_b_t
-assert y_mod_b_t
-assert z_mod_b_t
-assert u_mod_b_t
-
-
-#=========================
-#       EDGES
-#=========================
-
-# Face du haut
-
-#   grand rayon
-edge_mod_face_h_1_1 = doc.findEdge( y_mod_h , z_mod_h )
-edge_mod_face_h_1_2 = doc.findEdge( z_mod_h , u_mod_h )
-edge_mod_face_h_2_1 = doc.findEdge( y_mod_h,  x_mod_h )
-edge_mod_face_h_2_2 = doc.findEdge( x_mod_h,  u_mod_h )
-
-#   petit rayon
-edge_mod_t_face_h_1_1 = doc.findEdge( y_mod_h_t , z_mod_h_t )
-edge_mod_t_face_h_1_2 = doc.findEdge( z_mod_h_t , u_mod_h_t )
-edge_mod_t_face_h_2_1 = doc.findEdge( y_mod_h_t,  x_mod_h_t )
-edge_mod_t_face_h_2_2 = doc.findEdge( x_mod_h_t,  u_mod_h_t )
-
-
-# Face du bas
-
-#   grand rayon
-edge_mod_face_b_1_1 = doc.findEdge( y_mod_b , z_mod_b )
-edge_mod_face_b_1_2 = doc.findEdge( z_mod_b , u_mod_b )
-edge_mod_face_b_2_1 = doc.findEdge( y_mod_b,  x_mod_b )
-edge_mod_face_b_2_2 = doc.findEdge( x_mod_b,  u_mod_b )
-
-#   petit rayon
-edge_mod_t_face_b_1_1 = doc.findEdge( y_mod_b_t , z_mod_b_t )
-edge_mod_t_face_b_1_2 = doc.findEdge( z_mod_b_t , u_mod_b_t )
-edge_mod_t_face_b_2_1 = doc.findEdge( y_mod_b_t,  x_mod_b_t )
-edge_mod_t_face_b_2_2 = doc.findEdge( x_mod_b_t,  u_mod_b_t )
-
-
-
-# Joignant faces haut et du bas
-Edge_Mod_ext_h = doc.findEdge( y_mod_h , y_mod_b )
-Edge_Mod_int_h = doc.findEdge( y_mod_h_t , y_mod_b_t )
-
-Edge_Mod_int_b = doc.findEdge( u_mod_h_t , u_mod_b_t )
-Edge_Mod_ext_b = doc.findEdge( u_mod_h , u_mod_b )
-
-Edge_Mod_ext_g = doc.findEdge( x_mod_h , x_mod_b )
-Edge_Mod_int_g = doc.findEdge( x_mod_h_t , x_mod_b_t )
-
-Edge_Mod_int_d = doc.findEdge( z_mod_h_t , z_mod_b_t )
-Edge_Mod_ext_d = doc.findEdge( z_mod_h , z_mod_b )
-
-
-# v�rifications
-assert edge_mod_face_h_1_1
-assert edge_mod_face_h_1_2
-assert edge_mod_face_h_2_1
-assert edge_mod_face_h_2_2
-
-assert edge_mod_t_face_h_1_1
-assert edge_mod_t_face_h_1_2
-assert edge_mod_t_face_h_2_1
-assert edge_mod_t_face_h_2_2
-
-assert edge_mod_face_b_1_1
-assert edge_mod_face_b_1_2
-assert edge_mod_face_b_2_1
-assert edge_mod_face_b_2_2
-
-assert edge_mod_t_face_b_1_1
-assert edge_mod_t_face_b_1_2
-assert edge_mod_t_face_b_2_1
-assert edge_mod_t_face_b_2_2
-
-
-assert Edge_Mod_ext_h
-assert Edge_Mod_int_h
-
-assert Edge_Mod_int_b
-assert Edge_Mod_ext_b
-
-assert Edge_Mod_ext_g
-assert Edge_Mod_int_g
-
-assert Edge_Mod_int_d
-assert Edge_Mod_ext_d
-
-
-
-#=========================
-#       QUADS
-#=========================
-Quad_mod_0 = model_tuyau_fin.getQuadJK( 1 , 0 , 0 )
-Quad_mod_1 = model_tuyau_fin.getQuadJK( 1 , 1 , 0 )
-Quad_mod_2 = model_tuyau_fin.getQuadJK( 1 , 2 , 0 )
-Quad_mod_3 = model_tuyau_fin.getQuadJK( 1 , 3 , 0 )
-
-
-
-#===================================================================
-#               LA GEOMETRIE
-#===================================================================
-
-#===================================================================
-# Recuperation des points de la geometrie tuyau pour l'association
-#
-#===================================================================
-Tuyau_geom = geompy.Import(BREP_PATH, "BREP")
-doc.setShape(Tuyau_geom)
-
-#=========================
-#       SOMMETS
-#=========================
-Pt_A = geompy.MakeVertex( h , 20 , 4.5 )
-Pt_B = geompy.MakeVertex( h , 20 , 3.6 )
-Pt_C = geompy.MakeVertex( h , 20 , -4.5 )
-Pt_D = geompy.MakeVertex( h , 20 , -3.6 )
-Pt_E = geompy.MakeVertex( 0 , 0 , 2 )
-Pt_F = geompy.MakeVertex( 0 , 0 , 1.6 )
-Pt_G = geompy.MakeVertex( 0 , 0 , -2 )
-Pt_H = geompy.MakeVertex( 0 , 0 , -1.6 )
-
-# Face du bas
-Edge_bas_droite_grd = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_E)
-Edge_bas_droite_pte = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_F)
-Edge_bas_gauche_grd = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_G)
-Edge_bas_gauche_pte = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_H)
-## Grand rayon
-x_b = geompy.MakeVertexOnCurve(Edge_bas_droite_grd, 0.5)
-y_b = geompy.MakeVertexOnCurve(Edge_bas_droite_grd, 1)
-z_b = geompy.MakeVertexOnCurve(Edge_bas_gauche_grd, 0.5)
-u_b = geompy.MakeVertexOnCurve(Edge_bas_gauche_grd, 0)
-
-## Petit rayon
-x_b_t = geompy.MakeVertexOnCurve(Edge_bas_droite_pte, 0.5)
-y_b_t = geompy.MakeVertexOnCurve(Edge_bas_droite_pte, 1)
-z_b_t = geompy.MakeVertexOnCurve(Edge_bas_gauche_pte, 0.5)
-u_b_t = geompy.MakeVertexOnCurve(Edge_bas_gauche_pte, 0)
-
-
-# Face du haut
-Edge_haut_droite_grd = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_A)
-Edge_haut_droite_pte = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_B)
-Edge_haut_gauche_grd = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_C)
-Edge_haut_gauche_pte = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_D)
-## Grand rayon
-x_h = geompy.MakeVertexOnCurve(Edge_haut_droite_grd, 0.5)
-y_h = geompy.MakeVertexOnCurve(Edge_haut_droite_grd, 1)
-z_h = geompy.MakeVertexOnCurve(Edge_haut_gauche_grd, 0.5)
-u_h = geompy.MakeVertexOnCurve(Edge_haut_gauche_grd, 0)
-
-## Petit rayon
-x_h_t = geompy.MakeVertexOnCurve(Edge_haut_droite_pte, 0.5)
-y_h_t = geompy.MakeVertexOnCurve(Edge_haut_droite_pte, 1)
-z_h_t = geompy.MakeVertexOnCurve(Edge_haut_gauche_pte, 0.5)
-u_h_t = geompy.MakeVertexOnCurve(Edge_haut_gauche_pte, 0)
-
-
-
-#=========================
-#       EDGES
-#=========================
-All_Edges_Tuy_1 = geompy.SubShapeAllSorted( Tuyau_geom , geompy.ShapeType["EDGE"] )
-
-# Face du haut
-## Grand rayon
-edge_face_h_1   = All_Edges_Tuy_1[11]
-edge_face_h_2   = All_Edges_Tuy_1[14]
-## Petit rayon
-edge_t_face_h_1 = All_Edges_Tuy_1[12]
-edge_t_face_h_2 = All_Edges_Tuy_1[13]
-
-
-# Face du bas
-## Grand rayon
-edge_face_b_1   = All_Edges_Tuy_1[1]
-edge_face_b_2   = All_Edges_Tuy_1[4]
-##  Petit rayon
-edge_t_face_b_1 = All_Edges_Tuy_1[2]
-edge_t_face_b_2 = All_Edges_Tuy_1[3]
-
-
-# Joignant les 2 faces
-
-## edges compl�tes
-Edge_Tuy_ext_h = All_Edges_Tuy_1[6]
-Edge_Tuy_int_h = All_Edges_Tuy_1[7]
-Edge_Tuy_int_b = All_Edges_Tuy_1[8]
-Edge_Tuy_ext_b = All_Edges_Tuy_1[9]
-
-Pt_Z = geompy.MakeVertex( 75 , 20 , 0 )
-Pt_Z_1 = geompy.MakeVertexWithRef( Pt_Z , 0 , 0 , 10 )
-Pt_Z_2 = geompy.MakeVertexWithRef( Pt_Z , 0 , 0 , -10 )
-Line_Z1_Z2 = geompy.MakeLineTwoPnt( Pt_Z_1 , Pt_Z_2 )
-
-
-All_Edge_Tuy_ext_h = geompy.SubShapeAllSorted( Edge_Tuy_ext_h , geompy.ShapeType["VERTEX"] )
-
-Vx_Edg_Tuy_ext_h_1 = All_Edge_Tuy_ext_h[0]
-Vx_Edg_Tuy_ext_h_2 = All_Edge_Tuy_ext_h[1]
-
-Vx_Edg_Tuy_ext_h_1_trans = geompy.MakeVertexWithRef( Vx_Edg_Tuy_ext_h_1 , -10 , -10 , 0 )
-Vx_Edg_Tuy_ext_h_2_trans = geompy.MakeVertexWithRef( Vx_Edg_Tuy_ext_h_2 , 10 , 0 , 0 )
-
-Line_1 = geompy.MakeLineTwoPnt(Vx_Edg_Tuy_ext_h_1, Vx_Edg_Tuy_ext_h_1_trans)
-Line_2 = geompy.MakeLineTwoPnt(Vx_Edg_Tuy_ext_h_2, Vx_Edg_Tuy_ext_h_2_trans)
-
-Wire = geompy.MakeWire([Line_1, Line_2, Edge_Tuy_ext_h])
-Pipe_Z = geompy.MakePipe( Line_Z1_Z2 , Wire )
-Pipe_Ztt = geompy.MakePipe( Line_Z1_Z2 , Edge_Tuy_ext_h )
-Partition_Ztt = geompy.MakePartition([Tuyau_geom], [Pipe_Ztt], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
-All_Edges_Tuy_2tt = geompy.SubShapeAllSorted( Partition_Ztt , geompy.ShapeType["EDGE"] )
-
-Edge_Tuy_ext_g = All_Edges_Tuy_2tt[12]
-Edge_Tuy_int_g = All_Edges_Tuy_2tt[13]
-Edge_Tuy_ext_d = All_Edges_Tuy_2tt[10]
-Edge_Tuy_int_d = All_Edges_Tuy_2tt[11]
-
-## une edge en plusieurs(4) morceaux : Edge_Tuy_ext_h
-X_pln1 = geompy.MakeVertexWithRef( Pt_Z , -20 , 0 , 0 )
-Vec_X = geompy.MakeVectorDXDYDZ( 1 , 0 , 0 )
-
-Plan1 = geompy.MakePlane( X_pln1 , Vec_X , 200 )
-Plan2 = geompy.MakeTranslation( Plan1 , -20 , 0 , 0 )
-Plan3 = geompy.MakeTranslation( Plan1 , -40 , 0 , 0 )
-
-Partition_Edge_g_d_h_b = geompy.MakePartition([
-    Edge_Tuy_ext_h,
-    Edge_Tuy_int_h,
-    Edge_Tuy_ext_b,
-    Edge_Tuy_int_b,
-    Edge_Tuy_ext_g,
-    Edge_Tuy_int_g,
-    Edge_Tuy_ext_d,
-    Edge_Tuy_int_d], 
-    [Plan1, Plan2, Plan3], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
-
-All_Edge_g_d_h_b = geompy.SubShapeAllSorted( Partition_Edge_g_d_h_b , geompy.ShapeType["EDGE"] )
-Edge_Tuy_ext_h_1 = All_Edge_g_d_h_b[0]
-Edge_Tuy_ext_h_2 = All_Edge_g_d_h_b[15]
-Edge_Tuy_ext_h_3 = All_Edge_g_d_h_b[23]
-Edge_Tuy_ext_h_4 = All_Edge_g_d_h_b[31]
-
-
-
-#=========================
-#       FACES
-#=========================
-All_Faces_Tuy_1 = geompy.SubShapeAllSorted( Tuyau_geom , geompy.ShapeType["FACE"] )
-
-Face_Tuy_ext_1 = All_Faces_Tuy_1[4]
-Face_Tuy_ext_2 = All_Faces_Tuy_1[5]
-
-Partition_Face = geompy.MakePartition([ Face_Tuy_ext_1 , Face_Tuy_ext_2 ], [ Plan1 , Plan2 , Plan3 , Pipe_Z ], [], [], geompy.ShapeType["FACE"], 0, [], 0)
-
-
-All_Faces_Partition_Face = geompy.SubShapeAllSorted( Partition_Face , geompy.ShapeType["FACE"] )
-
-## -------------------------------------
-Face_0 = All_Faces_Partition_Face[0]
-Face_6 = All_Faces_Partition_Face[6]
-Face_10 = All_Faces_Partition_Face[10]
-Face_14 = All_Faces_Partition_Face[14]
-
-## -------------------------------------
-Face_1 = All_Faces_Partition_Face[1]
-Face_7 = All_Faces_Partition_Face[7]
-Face_11 = All_Faces_Partition_Face[11]
-Face_15 = All_Faces_Partition_Face[15]
-
-## -------------------------------------
-Face_2 = All_Faces_Partition_Face[2]
-Face_4 = All_Faces_Partition_Face[4]
-Face_8 = All_Faces_Partition_Face[8]
-Face_12 = All_Faces_Partition_Face[12]
-
-## -------------------------------------
-Face_3 = All_Faces_Partition_Face[3]
-Face_5 = All_Faces_Partition_Face[5]
-Face_9 = All_Faces_Partition_Face[9]
-Face_13 = All_Faces_Partition_Face[13]
-
-
-
-
-
-#==========================================================
-#               LES ASSOCIATIONS
-#==========================================================
-
-##===========================================
-##          VERTEX
-##===========================================
-
-# Face du haut
-
-## Grand rayon
-x_mod_h.setAssociation( x_h )
-y_mod_h.setAssociation( y_h )
-z_mod_h.setAssociation( z_h )
-u_mod_h.setAssociation( u_h )
-
-## Petit rayon
-x_mod_h_t.setAssociation( x_h_t )
-y_mod_h_t.setAssociation( y_h_t )
-z_mod_h_t.setAssociation( z_h_t )
-u_mod_h_t.setAssociation( u_h_t )
-
-
-# Face du bas
-
-## Grand rayon
-x_mod_b.setAssociation( x_b )
-y_mod_b.setAssociation( y_b )
-z_mod_b.setAssociation( z_b )
-u_mod_b.setAssociation( u_b )
-
-## Petit rayon
-x_mod_b_t.setAssociation( x_b_t )
-y_mod_b_t.setAssociation( y_b_t )
-z_mod_b_t.setAssociation( z_b_t )
-u_mod_b_t.setAssociation( u_b_t )
-
-
-##===========================================
-##          EDGES
-##===========================================
-
-# Face du haut
-
-## Grand rayon
-edge_mod_face_h_1_1.addAssociation( edge_face_h_1, 0.5, 1. )
-edge_mod_face_h_1_2.addAssociation( edge_face_h_1, 0., 0.5 )
-edge_mod_face_h_2_1.addAssociation( edge_face_h_2, 0.5, 1. )
-edge_mod_face_h_2_2.addAssociation( edge_face_h_2, 0., 0.5 )
-
-## Petit rayon
-edge_mod_t_face_h_1_1.addAssociation( edge_t_face_h_1, 0.5, 1. )
-edge_mod_t_face_h_1_2.addAssociation( edge_t_face_h_1, 0., 0.5 )
-edge_mod_t_face_h_2_1.addAssociation( edge_t_face_h_2, 0.5, 1. )
-edge_mod_t_face_h_2_2.addAssociation( edge_t_face_h_2, 0., 0.5 )
-
-# Face du bas
-
-## Grand rayon
-edge_mod_face_b_1_1.addAssociation( edge_face_b_1, 0.5, 1. )
-edge_mod_face_b_1_2.addAssociation( edge_face_b_1, 0., 0.5 )
-edge_mod_face_b_2_1.addAssociation( edge_face_b_2, 0.5, 1. )
-edge_mod_face_b_2_2.addAssociation( edge_face_b_2, 0., 0.5 )
-
-## Petit rayon
-edge_mod_t_face_b_1_1.addAssociation( edge_t_face_b_1, 0.5, 1. )
-edge_mod_t_face_b_1_2.addAssociation( edge_t_face_b_1, 0., 0.5 )
-edge_mod_t_face_b_2_1.addAssociation( edge_t_face_b_2, 0.5, 1. )
-edge_mod_t_face_b_2_2.addAssociation( edge_t_face_b_2, 0., 0.5 )
-
-
-
-# Joignant les 2 faces
-#Edge_Mod_ext_h.addAssociation( Edge_Tuy_ext_h, 0., 1. )
-Edge_Mod_ext_h.addAssociation( Edge_Tuy_ext_h_1, 0., 1. )
-Edge_Mod_ext_h.addAssociation( Edge_Tuy_ext_h_2, 0., 1. )
-Edge_Mod_ext_h.addAssociation( Edge_Tuy_ext_h_3, 0., 1. )
-Edge_Mod_ext_h.addAssociation( Edge_Tuy_ext_h_4, 0., 1. )
-Edge_Mod_int_h.addAssociation( Edge_Tuy_int_h, 0., 1. )
-
-Edge_Mod_int_b.addAssociation( Edge_Tuy_int_b, 0., 1. )
-Edge_Mod_ext_b.addAssociation( Edge_Tuy_ext_b, 0., 1. )
-
-Edge_Mod_ext_g.addAssociation( Edge_Tuy_ext_g, 0., 1. )
-Edge_Mod_int_g.addAssociation( Edge_Tuy_int_g, 0., 1. )
-
-Edge_Mod_int_d.addAssociation( Edge_Tuy_int_d, 0., 1. )
-Edge_Mod_ext_d.addAssociation( Edge_Tuy_ext_d, 0., 1. )
-
-
-#Quad_mod_1.addAssociation( Face_Tuy_ext_1 )
-Quad_mod_1.addAssociation( Face_0 )
-Quad_mod_1.addAssociation( Face_6 )
-Quad_mod_1.addAssociation( Face_10 )
-Quad_mod_1.addAssociation( Face_14 )
-
-#Quad_mod_0.addAssociation( Face_Tuy_ext_2 )
-Quad_mod_0.addAssociation( Face_1 )
-Quad_mod_0.addAssociation( Face_7 )
-Quad_mod_0.addAssociation( Face_11 )
-Quad_mod_0.addAssociation( Face_15 )
-
-#Quad_mod_2.addAssociation( Face_Tuy_ext_1 )
-Quad_mod_2.addAssociation( Face_2 )
-Quad_mod_2.addAssociation( Face_4 )
-Quad_mod_2.addAssociation( Face_8 )
-Quad_mod_2.addAssociation( Face_12 )
-
-#Quad_mod_3.addAssociation( Face_Tuy_ext_2 )
-Quad_mod_3.addAssociation( Face_3 )
-Quad_mod_3.addAssociation( Face_5 )
-Quad_mod_3.addAssociation( Face_9 )
-Quad_mod_3.addAssociation( Face_13 )
-
-
-
-#==========================================================
-#       LA GEOMETRIE DANS L'ARBRE D'ETUDE SALOME
-#==========================================================
-#for i,e in enumerate(All_Edges_Tuy_1): geompy.addToStudy( e, "edge_"+str(i) )
-geompy.addToStudy(Tuyau_geom, "Tuyau_geom")
-geompy.addToStudy( x_h, "x_h" )
-geompy.addToStudy( y_h, "y_h" )
-geompy.addToStudy( z_h, "z_h" )
-geompy.addToStudy( u_h, "u_h" )
-geompy.addToStudy( x_h_t, "x_h_t")
-geompy.addToStudy( y_h_t, "y_h_t" )
-geompy.addToStudy( z_h_t, "z_h_t" )
-geompy.addToStudy( u_h_t, "u_h_t" )
-
-geompy.addToStudy( x_b, "x_b")
-geompy.addToStudy( y_b, "y_b" )
-geompy.addToStudy( z_b, "z_b" )
-geompy.addToStudy( u_b, "u_b")
-geompy.addToStudy( x_b_t, "x_b_t" )
-geompy.addToStudy( y_b_t, "y_b_t" )
-geompy.addToStudy( z_b_t, "z_b_t" )
-geompy.addToStudy( u_b_t, "u_b_t" )
-
-
-#geompy.addToStudy(Line_Z1_Z2, "Line_Z1_Z2")
-#geompy.addToStudy(Pipe_Ztt, "Pipe_Ztt")
-#geompy.addToStudy( Partition_Ztt , "Partition_Ztt" )
-geompy.addToStudy( Edge_Tuy_ext_h , "Edge_Tuy_ext_h" )
-geompy.addToStudy( Edge_Tuy_int_h , "Edge_Tuy_int_h" )
-geompy.addToStudy( Edge_Tuy_int_b , "Edge_Tuy_int_b" )
-geompy.addToStudy( Edge_Tuy_ext_b , "Edge_Tuy_ext_b" )
-geompy.addToStudy( Edge_Tuy_ext_g , "Edge_Tuy_ext_g" )
-geompy.addToStudy( Edge_Tuy_int_g , "Edge_Tuy_int_g" )
-geompy.addToStudy( Edge_Tuy_ext_d , "Edge_Tuy_ext_d" )
-geompy.addToStudy( Edge_Tuy_int_d , "Edge_Tuy_int_d" )
-#geompy.addToStudy( Partition_Edge_g_d_h_b , "Partition_Edge_g_d_h_b" )
-geompy.addToStudy( Face_Tuy_ext_1 , "Face_Tuy_ext_1" )
-geompy.addToStudy( Face_Tuy_ext_2 , "Face_Tuy_ext_2" )
-#geompy.addToStudy( Partition_Face , "Partition_Face" )
-geompy.addToStudy( Face_0 , "Face_0" )
-geompy.addToStudy( Face_1 , "Face_1" )
-geompy.addToStudy( Face_2 , "Face_2" )
-geompy.addToStudy( Face_3 , "Face_3" )
-geompy.addToStudy( Face_4 , "Face_4" )
-geompy.addToStudy( Face_5 , "Face_5" )
-geompy.addToStudy( Face_6 , "Face_6" )
-geompy.addToStudy( Face_7 , "Face_7" )
-geompy.addToStudy( Face_8 , "Face_8" )
-geompy.addToStudy( Face_9 , "Face_9" )
-geompy.addToStudy( Face_10 , "Face_10" )
-geompy.addToStudy( Face_11 , "Face_11" )
-geompy.addToStudy( Face_12 , "Face_12" )
-geompy.addToStudy( Face_13 , "Face_13" )
-geompy.addToStudy( Face_14 , "Face_14" )
-geompy.addToStudy( Face_15 , "Face_15" )
-
-
-
-
-
-#====================================
-# CREATION MAILLAGE
-#====================================
-
-
-##=================================================
-## Definir les groupes d'elements pour le maillage
-##=================================================
-
-# groupe de Hexa(volumes) 
-Hexa_grp = doc.addHexaGroup("Hexa_all_grp")
-Nbr_Hex = doc.countHexa()
-print "doc.countHexa()->",Nbr_Hex
-
-for i in range(Nbr_Hex):
-    Hexa_i = doc.getHexa(i)
-    Hexa_grp.addElement(Hexa_i)
-
-#Nbr_elm_hex = Hexa_grp.countElement()
-#print "Hexa_all_grp  countElement() ->",Nbr_elm_hex
-
-for i in range(Nbr_Hex):
-    Hexa_grp = doc.addHexaGroup("Hexa_grp"+str(i))
-    Hexa_i = doc.getHexa(i)
-    Hexa_grp.addElement(Hexa_i)
-
-# groupe de quads (faces)
-Quad_grp_haut = doc.addQuadGroup("Quad_grp_haut")
-Quad_h_1 = doc.findQuad( x_mod_h , y_mod_h_t )
-Quad_h_2 = doc.findQuad( y_mod_h_t , z_mod_h )
-Quad_h_3 = doc.findQuad( z_mod_h , u_mod_h_t )
-Quad_h_4 = doc.findQuad( u_mod_h_t , x_mod_h )
-
-assert Quad_h_1
-assert Quad_h_2
-assert Quad_h_3
-assert Quad_h_4
-
-for Quad_h_i in [ Quad_h_1 , Quad_h_2 , Quad_h_3 , Quad_h_4 ]:
-    Quad_grp_haut.addElement(Quad_h_i)
-
-
-Quad_grp_bas = doc.addQuadGroup("Quad_grp_bas")
-Quad_b_1 = doc.findQuad( x_mod_b , y_mod_b_t )
-Quad_b_2 = doc.findQuad( y_mod_b_t , z_mod_b )
-Quad_b_3 = doc.findQuad( z_mod_b , u_mod_b_t )
-Quad_b_4 = doc.findQuad( u_mod_b_t , x_mod_b )
-
-
-assert Quad_b_1
-assert Quad_b_2
-assert Quad_b_3
-assert Quad_b_4
-
-for Quad_b_i in [ Quad_b_1 , Quad_b_2 , Quad_b_3 , Quad_b_4 ]:
-    Quad_grp_bas.addElement(Quad_b_i)
-
-#Nbr_elm_qad_bas = Quad_grp_bas.countElement()
-#print "Nbr_elm_qad_bas->",Nbr_elm_qad_bas
-
-
-
-# groupe de Edges
-Edge_Grp_haut = doc.addEdgeGroup("Edge_Grp_haut")
-Edge_Grp_haut.addElement(Edge_Mod_ext_h)
-Edge_Grp_haut.addElement(Edge_Mod_int_h)
-
-Edge_Grp_gauche = doc.addEdgeGroup("Edge_Grp_gauche")
-Edge_Grp_gauche.addElement(Edge_Mod_ext_g)
-Edge_Grp_gauche.addElement(Edge_Mod_int_g)
-
-Edge_Grp_bas = doc.addEdgeGroup("Edge_Grp_bas")
-Edge_Grp_bas.addElement(Edge_Mod_int_b)
-Edge_Grp_bas.addElement(Edge_Mod_ext_b)
-
-Edge_Grp_droit = doc.addEdgeGroup("Edge_Grp_droit")
-Edge_Grp_droit.addElement(Edge_Mod_int_d)
-Edge_Grp_droit.addElement(Edge_Mod_ext_d)
-
-
-# groupe de noeuds de Hexa 
-Hexa_Nod_Grp = doc.addHexaNodeGroup("Hexa_Nod_Grp")
-for i in range(Nbr_Hex):
-    Hexa_i = doc.getHexa(i)
-    Hexa_Nod_Grp.addElement(Hexa_i)
-
-# groupe de noeuds de Quad 
-Quad_Nod_Grp_h_1 = doc.addQuadNodeGroup("Quad_Nod_Grp_h_1")
-Quad_Nod_Grp_h_1.addElement(Quad_h_1)
-
-Quad_Nod_Grp_b_1 = doc.addQuadNodeGroup("Quad_Nod_Grp_b_1")
-Quad_Nod_Grp_b_1.addElement(Quad_b_1)
-
-# groupe de noeuds de Edge 
-Edge_Nod_Grp_b = doc.addEdgeNodeGroup("Edge_Nod_Grp_b")
-Edge_Nod_Grp_b.addElement(Edge_Mod_int_b)
-Edge_Nod_Grp_b.addElement(Edge_Mod_ext_b)
-
-Edge_Nod_Grp_h = doc.addEdgeNodeGroup("Edge_Nod_Grp_h")
-Edge_Nod_Grp_h.addElement(Edge_Mod_int_d)
-Edge_Nod_Grp_h.addElement(Edge_Mod_ext_d)
-
-
-# groupe de noeuds de vertex pour tout le modele
-Vertex_Nod_Grp = doc.addVertexNodeGroup("Vertex_Nod_Grp")
-Nbr_Vx = doc.countVertex()
-for i in range(Nbr_Vx):
-    Vertex_i = doc.getVertex(i)
-    Vertex_Nod_Grp.addElement(Vertex_i)
-
-
-#====================================
-# Definir une loi de discretisation
-#====================================
-bp_law = doc.getLaw(0)
-bp_law.setNodes(4)
-
-# definir une loi: le choix de la loi reste aux utilisateurs
-
-#Law_X = doc.addLaw( "Uniform" , 4 )
-#Law_Y = doc.addLaw( "Arithmetic" , 2 )
-#Law_Z = doc.addLaw( "Geometric" , 3 )
-Law_X = doc.addLaw( "Arithmetic" , 5 )
-Law_X.setKind(hexablock.ARITHMETIC)
-Law_X.setCoefficient(0.1)
-
-Law_Y = doc.addLaw( "Arithmetic" , 3 )
-Law_Y.setKind(hexablock.ARITHMETIC)
-Law_Y.setCoefficient(0.1)
-
-#Law_Z = doc.addLaw( "Geometric" , 4 )
-Law_Z = doc.addLaw( "Arithmetic" , 5 )
-Law_Z.setKind(hexablock.ARITHMETIC)
-Law_Z.setCoefficient(0.05)
-
-
-# chercher les propagations du modele
-Edge_Law_X = doc.findEdge( x_mod_h , x_mod_h_t )
-Edge_Law_Y = doc.findEdge( y_mod_h , y_mod_h_t )
-Edge_Law_Z = doc.findEdge( y_mod_h , y_mod_b )
-
-Propa_X = doc.findPropagation( Edge_Law_X )
-Propa_Y = doc.findPropagation( Edge_Law_Y )
-Propa_Z = doc.findPropagation( Edge_Law_Z )
-
-# appliquer la loi de discretisation sur tout le modele et generer le maillage
-Propa_X.setLaw( Law_X )
-Propa_Y.setLaw( Law_Y )
-Propa_Z.setLaw( Law_Z )
-
-print  " --- MAILLAGE HEXAHEDRIQUE --- "
-mesh = hexablock.mesh(doc)
-
-print "Nombre d hexaedres:"   , mesh.NbHexas()
-print "Nombre de quadrangles:", mesh.NbQuadrangles()
-print "Nombre de segments:"   , mesh.NbEdges()
-print "Nombre de noeuds:"     , mesh.NbNodes()
-
-salome.sg.updateObjBrowser(1)
-
-#Nombre d hexaedres: 480
-#Nombre de quadrangles: 496
-#Nombre de segments: 160
-#Nombre de noeuds: 700
-
-allGroups = mesh.GetGroups()
-print  " --- GROUPES --- "
-for aGroup in allGroups:
-    print "\nNOM:", aGroup.GetName()
-    print "IDS:", aGroup.GetIDs()
-
-
-
-## --------------------
-## Maillage hexa�drique
-## --------------------
-#mesh = mesh.ExportMED( "tuyau.med", 1 )
-#maillages = smesh.CreateMeshesFromMED( "tuyau.med" )
-
-#ijk = maillages[0][0]
-
-#ijk.Hexahedron()
-
-#ijk.Compute()
-
-#print  " --- MAILLAGE HEXAHEDRIQUE --- "
-#print "Nombre d hexaedres:", ijk.NbHexas()
-#print "Nombre de quadrangles:", ijk.NbQuadrangles()
-#print "Nombre de segments:", ijk.NbEdges()
-#print "Nombre de noeuds:", ijk.NbNodes()
diff --git a/src/TEST_PY/Test_HEXABLOCK.py b/src/TEST_PY/Test_HEXABLOCK.py
deleted file mode 100755 (executable)
index bbd2843..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-# -*- coding: latin-1 -*-
-# Copyright (C) 2009-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
-#
-
-import hexablock
-
-# ======================================================== test_sphere
-def test_sphere():
-   doc = hexablock.addDocument ("default")
-   orig = doc.addVertex (0,0,0)
-
-   ncouches = 1
-   k = 0.8
-   decal  = doc.addVector (1,1,1)
-   sphere = doc.makeSpherical(orig, decal, ncouches, k)
-
-   sphere.saveVtk ("test_sphere.vtk")
-   # doc.dump ()
-   print "test_sphere OK"
-   
-   
-# ======================================================== test_cartesi1
-def test_cartesi1():
-  size_x = 15
-  size_y = 12
-  size_z = 8
-
-  doc  = hexablock.addDocument()
-  orig = doc.addVertex (0,0,0)
-  direc= doc.addVector (1,1,1)
-  grid = doc.makeCartesian1(orig, direc, size_x,size_y,size_z,0,0,0)
-  grid.saveVtk ("test_cartesi1.vtk")
-  # doc.dump ()
-  print "test_cartesi1 OK"
-
-
-
-#// ======================================================== test_find
-def test_find():
-   size_x = 2
-   size_y = 2
-   size_z = 2
-
-   doc  = hexablock.addDocument()
-   
-   orig = doc.addVertex(0,0,0)
-   direc = doc.addVector (1,1,1)
-   grid = doc.makeCartesian1 (orig, direc, size_x,size_y,size_z,0,0,0)
-
-   grid.saveVtk ("mini1.vtk")
-   #doc.dump ().
-
-   v00 = doc.findVertex (0, 0, 0)   
-   v02 = doc.findVertex (1, 1, 0)
-   v06 = doc.findVertex (1, 1, 1)
-   v08 = doc.findVertex (2, 1, 0)
-   v10 = doc.findVertex (2, 1, 1)
-   v22 = doc.findVertex (2, 1, 2)
-   v26 = doc.findVertex (2, 2, 2)
-
-   assert v00
-   assert v02
-   assert v06
-   assert v08
-   assert v10
-   assert v22
-   assert v26
-
-   assert doc.findEdge (v06, v10)
-   assert doc.findEdge (v10, v06)
-
-   assert doc.findQuad (v02, v10)
-   assert doc.findQuad (v06, v08)
-   assert not doc.findQuad (v02, v06)  #CS_FAILS
-   
-   assert doc.findHexa (v00, v06)
-   assert doc.findHexa (v06, v26)
-   assert doc.findHexa (v26, v06)
-   print "test_find OK"
-
-#// ======================================================== test_joint
-def test_joint():
-   import HEXA_ORB
-   dimx = 11
-   dimy = 11
-   dimz = 2
-
-   doc = hexablock.addDocument()
-
-   orig1 = doc.addVertex (0,0,0)
-   direc = doc.addVector (1,1,1)
-
-   grid1 = doc.makeCartesian1(orig1, direc, dimx, dimy, dimz, 0, 0, 0 )
-
-   orig2 = doc.addVertex  (dimx/2.0,0,8)
-   vectj = doc.addVector (0,1,0)
-   vecti = doc.addVector (1,0,0)
-   grid2 = doc.makeCylindrical (orig2, vecti, vectj, 1, 180, 1,dimz,dimy,dimx, False)
-
-   mx = dimx/2
-   my = dimy/2
-   prems = grid1.getQuad1 (HEXA_ORB.DIR_Z, mx, my, dimz)
-   cible = grid2.getQuad1 (HEXA_ORB.DIR_X, dimz, mx, my)
-
-
-   v1 = prems.getVertex (0)
-   v2 = cible.getVertex (0)
-   v3 = prems.getVertex (1)
-   v4 = cible.getVertex (3)
-
-   liste = []
-   miroir = []
-
-   liste.append(prems)
-   
-   for nx in range(dimx):
-      if ( nx != mx ):
-        liste.append(grid1.getQuad1 (HEXA_ORB.DIR_Z, nx, my, dimz))
-   
-   #for (int nx=0. nx<dimx. nx++)
-       #if (nx!=mx) 
-          #liste.append(grid1.getQuad (dir_z, nx, my, dimz)). 
-
-   for ny in range(dimy):
-      if ( ny != my ):
-        liste.append(grid1.getQuad1 (HEXA_ORB.DIR_Z, mx, ny, dimz))
-   #for (int ny=0. ny<dimy. ny++)
-       #if (ny!=my) 
-          #liste.push_back (grid1.getQuad (dir_z, mx, ny, dimz)). 
-
-   joint = doc.joinQuads  (liste, cible, v1, v2, v3, v4, 5)
-
-   joint.saveVtk ("test_joint.vtk")
-   print "test_joint OK"
-
-#// ======================================================== test_mini
-def test_mini():  
-   size_x = 2
-   size_y = 2
-   size_z = 2
-
-   doc = hexablock.addDocument ()
-
-   orig  = doc.addVertex (0,0,0)
-   direc = doc.addVector (1,1,1)
-   grid  = doc.makeCartesian1( orig, direc, size_x,size_y,size_z, 0, 0, 0 )
-
-   orig2 = doc.addVertex (0,0,5)
-   grid2 = doc.makeCartesian1( orig2, direc, size_x,size_y,size_z, 0, 0, 0 )
-
-   #doc.saveVtk ("mini.vtk").
-   grid2.saveVtk ("test_mini.vtk")
-   print "test_mini OK"
-
-#// ======================================================== test_clone
-def test_clone():
-   size_x = 2
-   size_y = 2
-   size_z = 2
-
-   doc = hexablock.addDocument()
-
-   orig = doc.addVertex (0,0,0)
-   direc = doc.addVector (1,1,1)
-   grid1 = doc.makeCartesian1(orig, direc, size_x,size_y,size_z, 0, 0, 0 )
-
-   bond = doc.addVector (0, 0, 7)
-   grid2 = doc.makeTranslation(grid1, bond)
-
-   grid1.saveVtk ("test_clone.grid1.vtk")
-   grid2.saveVtk ("test_clone.grid2.vtk")
-   #doc .saveVtk ("clonage.vtk").
-   #doc .dump().
-   print "test_clone OK"
-
-#// ======================================================== test_separ
-def test_separ():
-   size_x = 2
-   size_y = 2
-   size_z = 2
-
-   doc = hexablock.addDocument()
-
-   orig = doc.addVertex (0,0,0)
-   direc = doc.addVector (1,1,1)
-   grid = doc.makeCartesian1(orig, direc, size_x,size_y,size_z, 0, 0, 0 )
-
-   grid.saveVtk ("test_separ.vtk")
-   #doc .saveVtk ("separ.vtk").
-   #doc .dump().
-   print "test_separ OK"
-
-#// ======================================================== test_cyl
-def test_cyl():
-   doc = hexablock.addDocument()
-
-   orig = doc.addVertex (0,0,0)
-   haut = doc.addVector (0,0,1)
-   base = doc.addVector (1,0,0)
-
-   dr = 1
-   #// double da = 360. // degres
-   dl = 1
-   nr = 2
-   na = 9
-   nl = 5
-
-   cyl1 = doc.makeCylindrical(orig,base,haut,dr, 360,  dl,nr,na,nl, False )
-   cyl1.saveVtk ("test_cyl.full.vtk")
-
-   cyl2 = doc.makeCylindrical(orig,haut,base,dr, 270, dl,nr,na,nl, False )
-   cyl2.saveVtk ("test_cyl.34.vtk")
-
-   #// doc.dump ()
-   print "test_cyl OK"
-
-
-#// ======================================================== test_propagation
-def test_propagation():
-   size_x = 2
-   size_y = 1
-   size_z = 1
-
-   doc = hexablock.addDocument()
-
-   orig  = doc.addVertex(0,0,0)
-   direc = doc.addVector(1,1,1)
-   grid  = doc.makeCartesian1(orig, direc, size_x,size_y,size_z, 0, 0, 0 )
-
-   #doc.dump  ().
-   nb = doc.countPropagation()
-
-   for nro in range(nb):
-       prop  = doc.getPropagation (nro)
-       edges = prop.getEdges()
-       #ways  = prop.getWays()
-       
-       for i, anEdge in enumerate(edges):
-         if anEdge.getWay():
-          print "( ", anEdge.getVertex (0), ",", anEdge.getVertex (1), " )"
-        else:
-          print "( ", anEdge.getVertex (1), ",", anEdge.getVertex (0), " )"
-           
-   print "test_propagation OK"
-
-
-
-
-
-
-
-
-
-
-#test_sphere()
-#test_cartesi1()
-#test_find()
-#test_joint()
-#test_mini()  
-#test_clone()
-#test_separ()
-#test_cyl()
-#test_propagation()
-
diff --git a/src/TEST_PY/bielle.py b/src/TEST_PY/bielle.py
deleted file mode 100644 (file)
index c911562..0000000
+++ /dev/null
@@ -1,545 +0,0 @@
-# -*- coding: latin-1 -*-
-# Copyright (C) 2009-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
-#
-
-import os
-import geompy
-import hexablock
-import math
-
-STEP_PATH = os.path.expandvars("$HEXABLOCK_ROOT_DIR/bin/salome/crank.stp")
-
-
-#=============================
-# CREATION DOCUMENT
-#=============================
-
-doc = hexablock.addDocument("bielle")
-
-#=============================
-# MODEL CREATION
-#=============================
-
-# For the connecting rod, two cylindrical grids have to be build and
-# the quadrangles have to be prismed between these wo grids
-
-#=============================
-# PARAMETRES
-#=============================
-
-#R = 40.0
-R = 0.095168291790720005
-
-r_pte = R
-r_pte_t = R/2.0
-
-xpetit = 0.0
-xgrand = 1.35739 + 0.1595
-longueur = (xgrand - xpetit)/2.0
-hauteur = 0.019999999553*2
-
-dr_pte = R
-da_pte = 360
-dl_pte = hauteur
-
-nr_pte = 1
-na_pte = 6
-nl_pte = 1
-
-# TESTS : sauvegarde
-f_mod_apres = open(os.path.join(os.environ['TMP'],
-                                "bielle_model_apres.txt"), 'w')
-
-# end TESTS
-
-
-# @todo JPL le 08/07/2011 :
-# refaire le mod�le de blocs avec des pentagones pour les grilles
-# cylindriques, et 1 hexaedre reliant ces 2 grilles.
-
-#=============================
-# Vectors Creation 
-#=============================
-
-dx = doc.addVector(longueur, 0, 0)
-dy = doc.addVector(0, longueur, 0)
-dz = doc.addVector(0, 0, longueur)
-
-#=================================================
-# Creation of cylindrical grid centers
-#=================================================
-
-c_pte = doc.addVertex(xpetit, 0, 0)
-c_grd = doc.addVertex(2*longueur, 0, 0)
-dx_prime = doc.addVectorVertices(c_pte, c_grd)
-
-#=================================================
-# small cylindrical grid creation
-#=================================================
-
-grille_cyl_pte = doc.makeCylindrical(c_pte, dx, dz, dr_pte, da_pte, dl_pte, nr_pte, na_pte, nl_pte, False)
-
-#=================================
-#  Small cylindrical grid creation
-#=================================
-
-grille_cyl_grd = doc.makeTranslation(grille_cyl_pte, dx_prime)
-
-# TEST :
-file_name = os.path.join(os.environ['TMP'], 'bielle0.vtk')
-doc.saveVtk(file_name)
-
-
-#==================================
-# Joining the two cylindrical grids
-#==================================
-
-mod_x1 = grille_cyl_pte.getVertexIJK(1, 0, 1)
-mod_x2 = grille_cyl_pte.getVertexIJK(1, 1, 0)
-mod_x3 = grille_cyl_pte.getVertexIJK(1, 5, 0)
-mod_x4 = grille_cyl_pte.getVertexIJK(1, 0, 0)
-quad_11 = doc.findQuad(mod_x1, mod_x2)
-quad_12 = doc.findQuad(mod_x1, mod_x3)
-
-mod_y1 = grille_cyl_grd.getVertexIJK(1, 3, 1)
-mod_y2 = grille_cyl_grd.getVertexIJK(1, 2, 0)
-mod_y3 = grille_cyl_grd.getVertexIJK(1, 4, 0)
-mod_y4 = grille_cyl_grd.getVertexIJK(1, 3, 0)
-
-quad_21 = doc.findQuad(mod_y1, mod_y2)
-quad_22 = doc.findQuad(mod_y1, mod_y3)
-
-model_biell_fin = doc.joinQuads([quad_11, quad_12], quad_21, mod_x1, mod_y1, mod_x4, mod_y4, 1)
-
-# TEST :
-file_name = os.path.join(os.environ['TMP'], 'bielle1.vtk')
-doc.saveVtk(file_name)
-
-
-#=======================
-# CREATION ASSOCIATION
-#=======================
-
-# JPL le 08/07/2011 :
-# la premi�re solution :
-# 1. 4 associations par ligne fermee pour les trous
-# 2. 2 associations par ligne fermee pour les contours
-# => pose probl�me car les points associ�s par cette m�thode sont
-# uniform�ment r�partis sur le contour => �a d�pend de la longueur
-# entre les 2 grilles cylindriques.
-# REM : a retester apr�s la correction d'Alain pour voir ce que �a
-# donne
-
-# deuxi�me solution :
-# 1. 4 associations par ligne fermee pour les trous
-# => pour chaque association, 6 edges du modele <-> 1 ligne de la geometrie
-# 2. 4 associations par lignes ouvertes pour les contours externes des
-# grilles cylindriques
-# => pour chaque association, 4 edges du modele <-> 3 lignes de la geometrie
-# 3. 4 associations de points restants (mod_x1, mod_x4, mod_y1, mod_y4)
-
-# => cette solution pose probl�me (� cause de l'association par ligne
-# ouverte)
-
-bielle_geom = geompy.ImportFile(STEP_PATH, "STEP")
-doc.setShape(bielle_geom)
-geompy.addToStudy(bielle_geom, "bielle_geom")
-all_edges_bielle = geompy.SubShapeAllSorted(bielle_geom, geompy.ShapeType["EDGE"])
-
-
-
-# dictionnaire des edges de la g�om�trie :
-# key = nom, value = indice dans all_edges_bielle
-dic_edge_names = {"edge_ray_pte_b": 0, "edge_ray_pte_h": 1,
-                  "edge_trou_pte_b": 2, "edge_trou_pte_h" :3,
-                  "edge_arr_pte_g_b": 7, "edge_arr_pte_g_h": 8,
-                  "edge_arr_pte_d_b": 9, "edge_arr_pte_d_h": 10,
-                  "edge_arr_grd_g_b": 19, "edge_arr_grd_g_h": 20,
-                  "edge_arr_grd_d_b": 21, "edge_arr_grd_d_h": 22,              
-                  "edge_trou_grd_b": 25, "edge_trou_grd_h": 26,
-                  "edge_ray_grd_b": 27, "edge_ray_grd_h": 28,
-                  "edge_long_g_b": 13, "edge_long_g_h": 14,
-                  "edge_long_d_b": 15, "edge_long_d_h": 16
-                  }
-
-
-all_faces_bielle = geompy.SubShapeAllSorted(bielle_geom, geompy.ShapeType["FACE"])
-# dictionnaire des faces de la geometrie :
-# key = nom, value = indice dans all_faces_bielle
-dic_face_names = {"face_ray_pte": 0, "face_trou_pte": 1, "face_pte_g": 2,
-                  "face_pte_d": 3, "face_long_g": 4, "face_long_d": 5,
-                  "face_bas": 6, "face_haut": 7, "face_grd_g": 8,
-                  "face_grd_d": 9, "face_trou_grd": 10,
-                  "face_ray_grd": 11
-                  }
-
-
-# la clef correspond a la geometrie, la valeur a l'indice en z dans le
-# modele de bloc (grille cylindrique)
-# NOTE : les dictionnaires ordonn�s ne sont pas encore introduits dans
-# la version 2.6.6 de python (Salome 6.2). On ne connait donc pas
-# l'ordre de bouclage (haut/bas ou bas/haut) mais �a n'a pas
-# d'importance :
-dico_haut_bas = {"h": 1, "b": 0}
-
-# 1. lignes internes (trou) haut/bas du petit cylindre
-# ====================================================
-for z in dico_haut_bas.iteritems():
-
-    # REM : la direction de la ligne geometrique est dans le sens anti-trigonometrique
-    # => on parcourt le modele en sens inverse
-
-##     # modele de blocs :
-##     mod_start = grille_cyl_pte.getEdgeJ(0, 5, z[1])
-##     mod_first = mod_start.getVertex(1)
-##     # table des edges :
-##     mod_line = [grille_cyl_pte.getEdgeJ(0, j, z[1]) for j in range(4, -1, -1)]
-
-    # modele de blocs :
-    mod_start = grille_cyl_pte.getEdgeJ(0, 0, z[1])
-    mod_first = mod_start.getVertex(0)
-    # table des edges :
-    mod_line = [grille_cyl_pte.getEdgeJ(0, j, z[1]) for j in range(1, 6)]
-
-
-    # geometrie : 1 seule ligne
-    edge_hole_in = all_edges_bielle[dic_edge_names["edge_trou_pte_"+z[0]]]
-    geo_start = edge_hole_in
-    par_start = 0.0
-    geo_line  = []
-
-    # association :
-    ier = doc.associateClosedLine(mod_first, mod_start, mod_line,
-                                  geo_start, par_start, geo_line)
-
-
-# 2. lignes internes (trou) haut/bas du grand cylindre
-# =====================================================
-for z in dico_haut_bas.iteritems():
-
-    # REM : la direction de la ligne geometrique est dans le sens anti-trigonometrique
-    # => on parcourt le modele en sens inverse
-
-##     # modele de blocs :
-##     mod_start = grille_cyl_grd.getEdgeJ(0, 5, z[1])
-##     mod_first = mod_start.getVertex(1)
-##     # table des edges :
-##     mod_line = [grille_cyl_grd.getEdgeJ(0, j, z[1]) for j in range(4, -1, -1)]
-
-    mod_start = grille_cyl_grd.getEdgeJ(0, 0, z[1])
-    mod_first = mod_start.getVertex(1)
-    # table des edges :
-    mod_line = [grille_cyl_grd.getEdgeJ(0, j, z[1]) for j in range(1, 6)]
-
-    # geometrie : 1 seule ligne
-    edge_hole_in = all_edges_bielle[dic_edge_names["edge_trou_grd_"+z[0]]]
-    geo_start = edge_hole_in
-    par_start = 0.0
-    geo_line  = []
-
-    # association :
-    ier = doc.associateClosedLine(mod_first, mod_start, mod_line,
-                                  geo_start, par_start, geo_line)
-
-
-# 3. lignes externes haut/bas du petit cylindre
-# =============================================
-for z in dico_haut_bas.iteritems():
-
-    # JPL le 08/07/2011 : on utilise ici l'association par ligne
-    # ouverte. Avec le nouvelle version, les points sont r�partis de
-    # mani�re �quidistance sur la ligne geometrique form�e par la
-    # concat�nation des lignes fournies en entr�e.
-
-    # modele de blocs :
-    mod_start = grille_cyl_pte.getEdgeJ(1, 1, z[1])
-    # table des edges :
-    mod_line = [grille_cyl_pte.getEdgeJ(1, j, z[1]) for j in [2, 3, 4]]
-
-    # geometrie :
-    # les edges de la geometrie correspondant sont, dans l'ordre (par
-    # exemple pour le haut) :
-    # edge_arr_pte_d_h, edge_ray_pte_h, edge_arr_pte_g_h
-    geo_start = all_edges_bielle[dic_edge_names["edge_arr_pte_d_"+z[0]]]
-
-    geo_line  = []
-    geo_line.append(all_edges_bielle[dic_edge_names["edge_ray_pte_"+z[0]]])
-    geo_line.append(all_edges_bielle[dic_edge_names["edge_arr_pte_g_"+z[0]]])
-
-    # association :
-    # la premi�re est la derni�re ligne sont orient�es "dans le
-    # mauvais sens" => on fournit cette info :
-    par_start = 0.0
-    par_end = 1.0
-    ier = doc.associateOpenedLine(mod_start, mod_line,
-                                  geo_start, par_start, geo_line, par_end)
-
-
-## # 4. lignes externes haut/bas du grand cylindre
-## # =============================================
-for z in dico_haut_bas.iteritems():
-
-    # JPL le 08/07/2011 : on utilise ici l'association par ligne
-    # ouverte. Avec le nouvelle version, les points sont r�partis de
-    # mani�re �quidistance sur la ligne geometrique form�e par la
-    # concat�nation des lignes fournies en entr�e.
-
-    # modele de blocs :
-    mod_start = grille_cyl_grd.getEdgeJ(1, 4, z[1])
-    # table des edges :
-    mod_line = [grille_cyl_grd.getEdgeJ(1, j, z[1]) for j in [5, 0, 1]]
-
-    # geometrie :
-    # les edges de la geometrie correspondant sont, dans l'ordre (par
-    # exemple pour le haut) :
-    # edge_arr_grd_g_h, edge_ray_grd_h, edge_arr_grd_d_h
-    geo_start = all_edges_bielle[dic_edge_names["edge_arr_grd_g_"+z[0]]]
-
-    geo_line  = []
-    geo_line.append(all_edges_bielle[dic_edge_names["edge_ray_grd_"+z[0]]])
-    geo_line.append(all_edges_bielle[dic_edge_names["edge_arr_grd_d_"+z[0]]])
-
-    # association :
-    # la premi�re est la derni�re ligne sont orient�es "dans le
-    # mauvais sens" => on fournit cette info :
-    par_start = 0.0
-    par_end = 1.0
-    ier = doc.associateOpenedLine(mod_start, mod_line,
-                                  geo_start, par_start, geo_line, par_end)
-
-# JPL le 26/07/2011 :
-# l'association des edges n'est pas necessaire (implicite)
-
-# 6. association des 4 points restants (x1, x4, y1, y4) :
-# =======================================================
-
-# NB:
-# h = top (haut)
-# b = bottom (bas)
-# g = big (grand)
-# p = small (petit)
-# t = hole (trou)
-
-# JPL le 08/07/2011 :
-# seuls 4 points de la geometrie sont n�cessaires (pour l'association
-# vertex/point : pour le reste on utilise l'association par lignes) :
-# dictionnaire geom_vertices
-# il s'agit de points des grilles cylindriques, � l'int�rieur
-# de la bielle, ayant servis au joinQuads (ie: mod_x1, mod_x4, mod_y1, mod_y4)
-
-
-## pt_a = geompy.MakeVertex(0, 0, hauteur/2.)
-## face_haut = geompy.GetFaceNearPoint(bielle_geom, pt_a)
-## pt_b = geompy.MakeVertex(0, 0, -hauteur/2.)
-## face_bas = geompy.GetFaceNearPoint(bielle_geom, pt_b)
-
-face_haut = all_faces_bielle[dic_face_names["face_haut"]]
-
-edge_haut_droite = geompy.GetEdgesByLength(face_haut, 0.136, 0.137)
-edge_haut_gauche = geompy.GetEdgesByLength(face_haut, 0.131, 0.132)
-
-# 1. grand cylindre :
-y_h_g = geompy.MakeVertexOnSurface(face_haut, 1, 0.5)
-u_h_g = geompy.MakeVertexOnCurve(edge_haut_droite, 1)
-w_h_g = geompy.MakeVertexOnCurve(edge_haut_gauche, 0)
-edge_v_grd = geompy.MakeLineTwoPnt(u_h_g, w_h_g)
-
-geo_y1 = geompy.MakeVertexOnCurve(edge_v_grd, 0.5)
-geo_y4 = geompy.MakeVertexWithRef(geo_y1, 0.0, 0.0, -hauteur)
-
-# vertex cote grande grille cylindrique :
-mod_y1.setAssociation(geo_y1)
-mod_y4.setAssociation(geo_y4)
-
-# 2. petit cylindre :
-# REM : le modele grand cylindre a ete cree par translation / au petit
-# cylindre.
-v_h_p = geompy.MakeVertexOnSurface(face_haut, 0, 0.5)
-x_h_p = geompy.MakeVertexOnCurve(edge_haut_droite, 0)
-z_h_p = geompy.MakeVertexOnCurve(edge_haut_gauche, 1)
-edge_v_pte = geompy.MakeLineTwoPnt(x_h_p, z_h_p)
-
-geo_x1 = geompy.MakeVertexOnCurve(edge_v_pte, 0.5)
-geo_x4 = geompy.MakeVertexWithRef(geo_x1, 0.0, 0.0, -hauteur)
-
-# vertex cote petite grille cylindrique :
-mod_x1.setAssociation(geo_x1)
-mod_x4.setAssociation(geo_x4)
-
-# 7. association des faces :
-# REM : l'association des faces internes ne semble pas necessaire (cylindres)
-# pas d'association des face_ray_XXX : pas necessaire ? De toute
-# fa�on, on a pour chaque 2 quads du mod�le...
-# les associations de face_haut, face_bas, face_long_g et face_long_d
-# ne sont pas necessaires ?
-
-# a decommenter donc si necessaire :
-## quad1 = grille_cyl_pte.getQuadJK(1, 1, 0)
-## quad1.addAssociation(all_faces_bielle[dic_face_names["face_pte_d"]])
-## quad2 = grille_cyl_pte.getQuadJK(1, 4, 0)
-## quad2.addAssociation(all_faces_bielle[dic_face_names["face_pte_g"]])
-## quad3 = grille_cyl_grd.getQuadJK(1, 1, 0)
-## quad3.addAssociation(all_faces_bielle[dic_face_names["face_grd_d"]])
-## quad4 = grille_cyl_grd.getQuadJK(1, 4, 0)
-## quad4.addAssociation(all_faces_bielle[dic_face_names["face_grd_g"]])
-
-
-#############################################################################################
-#############################################################################################
-# TEST :
-
-file_name = os.path.join(os.environ['TMP'], 'bielle2.vtk')
-doc.saveVtk(file_name)
-
-# affichage des points des 2 grilles cylindriques avec les
-# nouvelles coordonn�es (apres association)
-
-for k in range(2):
-    # petite grille cylindrique
-    i = 0
-    for j in range(6):
-        vertex = grille_cyl_pte.getVertexIJK(i, j, k)
-        value = " ".join(["i =", str(i), "j =", str(j),
-                          str(vertex.getX()), str(vertex.getY()), str(vertex.getZ()), '\n'])
-        f_mod_apres.write(str(value))
-        pass
-
-    f_mod_apres.write("stop\n")
-
-    i = 1
-    # on n'inclut pas les vertex associ�s individuellement (qui ne
-    # changent pas de coordonn�es...) : => j = 1 -> 5
-    for j in range(1, 6):
-        vertex = grille_cyl_pte.getVertexIJK(i, j, k)
-        value = " ".join(["i =", str(i), "j =", str(j),
-                          str(vertex.getX()), str(vertex.getY()), str(vertex.getZ()), '\n'])
-        f_mod_apres.write(str(value))
-        pass
-
-    f_mod_apres.write("stop\n")
-
-    # grande grille cylindrique
-    i = 0
-    for j in range(6):
-        vertex = grille_cyl_grd.getVertexIJK(i, j, k)
-        value = " ".join(["i =", str(i), "j =", str(j),
-                          str(vertex.getX()), str(vertex.getY()), str(vertex.getZ()), '\n'])
-        f_mod_apres.write(str(value))
-        pass
-
-    f_mod_apres.write("stop\n")
-
-    i = 1
-    # on n'inclut pas les vertex associ�s individuellement (qui ne
-    # changent pas de coordonn�es...) (j = 3)
-    # on ecrit les points dans le meme ordre que l'association :
-    for j in [4, 5, 0, 1, 2]:
-        vertex = grille_cyl_grd.getVertexIJK(i, j, k)
-        value = " ".join(["i =", str(i), "j =", str(j),
-                          str(vertex.getX()), str(vertex.getY()), str(vertex.getZ()), '\n'])
-        f_mod_apres.write(str(value))
-        pass
-    # end TEST
-
-    f_mod_apres.write("stop\n")
-
-#############################################################################################
-#############################################################################################    
-
-
-## #=================================================
-## # VERTEX, EDGES, FACES DANS L'ARBRE D'ETUDE SALOME
-## #=================================================
-
-# vertices :
-geompy.addToStudy(geo_x1, 'vertex_x1')
-geompy.addToStudy(geo_x4, 'vertex_x4')
-geompy.addToStudy(geo_y1, 'vertex_y1')
-geompy.addToStudy(geo_y4, 'vertex_y4')
-
-# edges :
-for key, value in dic_edge_names.iteritems():
-    geompy.addToStudy(all_edges_bielle[value], key)
-
-# faces (juste pour les tests) :
-for i, face in enumerate(all_faces_bielle):
-    geompy.addToStudy(face, "face_"+str(i))
-
-#====================================
-# CREATION MAILLAGE
-#====================================
-
-
-#=================================================
-# Definir les groupes d elements pour le maillage
-#=================================================
-
-# On definit 3 groupes de mailles
-
-# JPL (le 09/05/2011) :
-# @todo a revoir : apres correction des bugs "countXXX()" dans le moteur
-
-# groupe d edges (arretes)
-edge_grp = doc.addEdgeGroup("Edge_grp")
-for i in range(doc.countEdge()):
-    edge_grp.addElement(doc.getEdge(i))
-
-# groupe de quads (faces)
-quad_grp = doc.addQuadGroup("Quad_grp")
-for i in range(doc.countQuad()):
-    quad_grp.addElement(doc.getQuad(i))
-
-# groupe d hexas (solids)
-hexa_grp = doc.addHexaGroup("Hexa_grp")
-for i in range(doc.countHexa()):
-    hexa_grp.addElement(doc.getHexa(i))
-
-# groupe de noeuds de vertex pour tout le modele 
-vertex_nod_grp = doc.addVertexNodeGroup("Vertex_Nod_Grp")
-for i in range(doc.countVertex()):
-    vertex_nod_grp.addElement(doc.getVertex(i))
-
-#====================================
-# Definir une loi de discretisation
-#====================================
-# definir une loi: le choix de la loi reste aux utilisateurs
-law = doc.addLaw("Uniform", 4)
-
-# TEST : pour avoir le mod�le de blocs :
-## law = doc.addLaw("Uniform", 0)
-
-# chercher les propagations du modele
-for j in range(doc.countPropagation()):
-    propa = doc.getPropagation(j)
-    propa.setLaw(law)  # appliquer la loi de discretisation sur tout le modele et generer le maillage
-
-#====================================
-# G�n�rer des maillages
-#====================================
-
-print  " --- MAILLAGE HEXAHEDRIQUE --- "
-mesh_hexas = hexablock.mesh(doc)
-
-print "Nombre d hexaedres:", mesh_hexas.NbHexas()
-print "Nombre de quadrangles:", mesh_hexas.NbQuadrangles()
-print "Nombre de segments:", mesh_hexas.NbEdges()
-print "Nombre de noeuds:", mesh_hexas.NbNodes()
-
-# TESTS :
-f_mod_apres.close()
diff --git a/src/TEST_PY/bielle_variante.py b/src/TEST_PY/bielle_variante.py
deleted file mode 100644 (file)
index 7d163fd..0000000
+++ /dev/null
@@ -1,248 +0,0 @@
-# -*- coding: latin-1 -*-\r
-# Copyright (C) 2009-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
-#
-
-\r
-# Francis KLOSS - 2011 - CEA-Saclay, DEN, DM2S, SFME, LGLS, F-91191 Gif-sur-Yvette, France\r
-# ========================================================================================\r
-\r
-import geompy\r
-import hexablock\r
-\r
-# Définir les paramètres\r
-# ----------------------\r
-\r
-nom = "bielle"\r
-\r
-# Construire le modèle de bloc\r
-# ============================\r
-\r
-doc = hexablock.addDocument(nom)\r
-\r
-# Construire les 2 grilles cylindriques\r
-# -------------------------------------\r
-\r
-centre_a = doc.addVertex(0, 0, 0)\r
-centre_b = doc.addVertex(6, 0, 0)\r
-\r
-vecteur_a = doc.addVector(1, 1, 0)\r
-vecteur_z = doc.addVector(0, 0, 1)\r
-vecteur_b = doc.addVector(6, 0, 0)\r
-\r
-grille_a = doc.makeCylindrical(centre_a, vecteur_a, vecteur_z,  1, 360, 1,  1, 4, 1,  False)\r
-\r
-### grille_b = doc.makeTranslation(grille_a, vecteur_b)\r
-grille_b = doc.makeCylindrical(centre_b, vecteur_a, vecteur_z,  2, 360, 1,  1, 4, 1,  False)\r
-\r
-grilles = [ grille_a, grille_b ]\r
-\r
-# Relier les 2 grilles\r
-# --------------------\r
-\r
-quad_a = grille_a.getQuadJK(1, 3, 0)\r
-quad_b = grille_b.getQuadJK(1, 1, 0)\r
-\r
-point_a1 = grille_a.getVertexIJK(1, 0, 0)\r
-point_a2 = grille_a.getVertexIJK(1, 3, 0)\r
-\r
-point_b1 = grille_b.getVertexIJK(1, 1, 0)\r
-point_b2 = grille_b.getVertexIJK(1, 2, 0)\r
-\r
-prisme = doc.joinQuad(quad_a, quad_b,  point_a1, point_b1,  point_a2, point_b2,  3)\r
-\r
-# Associer le modèle de bloc avec la géométrie\r
-# ============================================\r
-\r
-# Charger la géométrie à associer\r
-# -------------------------------\r
-\r
-bielle = geompy.ImportSTEP("crank.stp")\r
-\r
-doc.setShape(bielle)\r
-\r
-# Extraire les subshapes de la géométrie\r
-# --------------------------------------\r
-\r
-g_vertices = geompy.SubShapeAllSortedCentres(bielle, geompy.ShapeType["VERTEX"])\r
-g_edges    = geompy.SubShapeAllSortedCentres(bielle, geompy.ShapeType["EDGE"  ])\r
-\r
-sommets = [ [ 8, 6, 9, 7 ], [ 12, 10, 13, 11 ] ]\r
-\r
-cercles = [ [2, 3], [25, 26] ]\r
-arcs_gr = [ [0, 1], [27, 28] ]\r
-arcs_pe = [ [ 9, 7,  10, 8 ], [ 21, 19,  22, 20 ] ]\r
-\r
-# Réparer l'association par ligne fermée\r
-# --------------------------------------\r
-\r
-def reparer(cercle, grille):\r
-  import math\r
-\r
-  k = geompy.KindOfShape(cercle)\r
-\r
-  centre = geompy.MakeVertex(k[1], k[2], k[3])\r
-  axe    = geompy.MakePrismDXDYDZ(centre,  k[4], k[5], k[6])\r
-  angle  = [ +math.pi/4, -math.pi/4 ][grille]\r
-\r
-  if grille==1:\r
-    axeY   = geompy.MakePrismDXDYDZ(centre, 0, 1, 0)\r
-    cercle = geompy.MakeRotation(cercle, axeY, math.pi)\r
-\r
-  return geompy.MakeRotation(cercle, axe, angle)\r
-\r
-# Associer les 4 cercles intérieurs\r
-# ---------------------------------\r
-\r
-for k in xrange(0, 2):\r
-  for g in xrange(0, 2):\r
-    grille = grilles[g]\r
-    ve = grille.getVertexIJK(0, g, k)\r
-    le = [ grille.getEdgeJ(0, j, k) for j in xrange(0, 4) ]\r
-    ed = reparer( g_edges[ cercles[g][k] ], g )\r
-    doc.associateClosedLine(ve, le[0], le[1:], ed, 0.0, [])\r
-\r
-# Associer les 4 grands arcs de cercle extérieurs\r
-# -----------------------------------------------\r
-\r
-for k in xrange(0, 2):\r
-  for g in xrange(0, 2):\r
-    grille = grilles[g]\r
-    le = [ grille.getEdgeJ(1, j, k) for j in [ [0, 1, 2], [2, 3, 0] ][g] ]\r
-    ed = g_edges[ arcs_gr[g][k] ]\r
-    doc.associateOpenedLine(le[0], le[1:], ed, 0, [], 1)\r
-\r
-# Associer les 8 sommets des petits arcs de cercle extérieurs\r
-# -----------------------------------------------------------\r
-\r
-for g, h in [ [0, 1], [1, 2] ]:\r
-  hexa = prisme.getHexa(h)\r
-  for vi in xrange(0, 4):\r
-    vm = hexa.getVertex(vi)\r
-    vg = g_vertices[ sommets[g][vi] ]\r
-    vm.setAssociation(vg)\r
-\r
-# Associer les 8 petits arcs de cercle extérieurs\r
-# -----------------------------------------------\r
-\r
-for g, h in [ [0, 0], [1, 2] ]:\r
-  hexa = prisme.getHexa(h)\r
-  for ei in xrange(0, 4):\r
-    em = hexa.getEdge(ei+8)\r
-    eg = g_edges[ arcs_pe[g][ei] ]\r
-    em.clearAssociation()\r
-    em.addAssociation(eg, 0, 1)\r
-\r
-# Associer 4 arcs nouveaux qui complétent les 4 grands arcs de cercle extérieurs\r
-# ------------------------------------------------------------------------------\r
-\r
-for h, ei, ech in [ [0, 0, 0.9], [0, 1, 0.9],  [2, 2, 0.85], [2, 3, 0.85] ]:\r
-  hexa = prisme.getHexa(h)\r
-  em = hexa.getEdge(ei)\r
-  va = em.getVertex(0).getAssociation()\r
-  vb = em.getVertex(1).getAssociation()\r
-  vax, vay, vaz = geompy.PointCoordinates(va)\r
-  vbx, vby, vbz = geompy.PointCoordinates(vb)\r
-  vmx = ( vax + vbx ) / 2.0 * ech\r
-  vmy = ( vay + vby ) / 2.0\r
-  vmz = ( vaz + vbz ) / 2.0\r
-  vm = geompy.MakeVertex(vmx, vmy, vmz)\r
-  eg = geompy.MakeArc(va, vm, vb)\r
-  em.clearAssociation()\r
-  em.addAssociation(eg, 0, 1)\r
-\r
-# Mailler le modèle de bloc\r
-# =========================\r
-\r
-# Définir 5 groupes de faces\r
-# --------------------------\r
-\r
-groupe_trou_p  = doc.addQuadGroup("Trou_petit")\r
-groupe_trou_g  = doc.addQuadGroup("Trou_grand")\r
-groupe_bas     = doc.addQuadGroup("Bas")\r
-groupe_haut    = doc.addQuadGroup("Haut")\r
-groupe_contour = doc.addQuadGroup("Contour")\r
-\r
-for i in xrange(4):\r
-  groupe_trou_p.addElement(grille_a.getQuadJK(0, i, 0))\r
-  groupe_trou_g.addElement(grille_b.getQuadJK(0, i, 0))\r
-\r
-  groupe_bas.addElement( grille_a.getQuadIJ(0, i, 0))\r
-  groupe_bas.addElement( grille_b.getQuadIJ(0, i, 0))\r
-  groupe_haut.addElement(grille_a.getQuadIJ(0, i, 1))\r
-  groupe_haut.addElement(grille_b.getQuadIJ(0, i, 1))\r
-\r
-for i in xrange(3):\r
-  groupe_contour.addElement(grille_a.getQuadJK(1, i, 0))\r
-\r
-for i in [0, 2, 3]:\r
-  groupe_contour.addElement(grille_b.getQuadJK(1, i, 0))\r
-\r
-for i in xrange(0, 3):\r
-  h = prisme.getHexa(i)\r
-\r
-  q = h.getQuad(2)\r
-  groupe_bas.addElement(q)\r
-\r
-  q = h.getQuad(3)\r
-  groupe_haut.addElement(q)\r
-\r
-  q = h.getQuad(4)\r
-  groupe_contour.addElement(q)\r
-  q = h.getQuad(5)\r
-  groupe_contour.addElement(q)\r
-\r
-# Définir 3 groupes de volumes\r
-# ----------------------------\r
-\r
-groupe_cyli_p = doc.addHexaGroup("Cylindre_petit")\r
-groupe_cyli_g = doc.addHexaGroup("Cylindre_grand")\r
-groupe_prisme = doc.addHexaGroup("Prisme")\r
-\r
-for i in xrange(4):\r
-  groupe_cyli_p.addElement(grille_a.getHexa(i))\r
-  groupe_cyli_g.addElement(grille_b.getHexa(i))\r
-\r
-for i in xrange(3):\r
-  groupe_prisme.addElement(prisme.getHexa(i))\r
-\r
-# Mailler le modèle de bloc avec association\r
-# ------------------------------------------\r
-\r
-l = doc.addLaw("Uniform1", 17)\r
-n = doc.countPropagation()\r
-\r
-for i in xrange(n):\r
-  p = doc.getPropagation(i)\r
-  p.setLaw(l)\r
-\r
-l = doc.addLaw("Uniform2", 40)\r
-p = doc.getPropagation(11)\r
-p.setLaw(l)\r
-\r
-blocs = hexablock.mesh(doc)\r
-\r
-print "nombre de sommets     du modèle de bloc: ", doc.countUsedVertex()\r
-print "nombre d'arêtes       du modèle de bloc: ", doc.countUsedEdge()\r
-print "nombre de quadrangles du modèle de bloc: ", doc.countUsedQuad()\r
-print "nombre de blocs       du modèle de bloc: ", doc.countUsedHexa()\r
-\r
-print "Nombre de noeuds      du maillage: ", blocs.NbNodes()\r
-print "Nombre de segments    du maillage: ", blocs.NbEdges()\r
-print "Nombre de quadrangles du maillage: ", blocs.NbQuadrangles()\r
-print "Nombre d'hexaèdres    du maillage: ", blocs.NbHexas()\r
diff --git a/src/TEST_PY/bride.py b/src/TEST_PY/bride.py
deleted file mode 100644 (file)
index b3cb914..0000000
+++ /dev/null
@@ -1,410 +0,0 @@
-# -*- coding: latin-1 -*-
-# Copyright (C) 2009-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
-#
-
-import os
-import GEOM
-import geompy
-import smesh
-import hexablock
-import math
-import SALOMEDS
-
-k1 = 1
-
-OPT_QUAD_IK = 1
-OPT_FIRST = 2
-
-count = 1
-def save_schema(doc):
-    """
-    sauvegarde vtk du modele de bloc
-    """
-    global count
-    file_name = os.path.join(os.environ['TMP'], 'bride' + str(count) + '.vtk')
-    doc.saveVtk(file_name)
-    count += 1
-    pass
-
-def merge_quads(doc, quart, demi, ni1, nj1, ni2, nj2, option=0) :
-    """
-    fusion des quadrangles entre les 2 grilles cylindriques :
-    """
-
-    prems = False
-    if option == OPT_FIRST:
-        prems = True
-
-    quad_ik = False
-    if option == OPT_QUAD_IK:
-        quad_ik = True
-
-    orig = None
-    if quad_ik:
-        orig = grille_cyl_quart.getQuadIK(ni1, nj1, k1)
-    else:
-        orig = grille_cyl_quart.getQuadJK(ni1, nj1, k1)
-
-    dest = grille_cyl_demi.getQuadJK(ni2, nj2, k1)
-
-
-# JPL le 10/05/2011 :
-# closeQuads() n'est pas accessible en python
-# a priori fonctionne avec mergeQuads()
-##     if prems:
-    if True:
-        iq1 = 0
-        if quad_ik:
-            iq1 = 1
-        iq3 = 1 - iq1
-        v1 = dest.getVertex(iq1)
-        v3 = dest.getVertex(iq3)
-        
-        v2 = orig.getVertex(0)
-        v4 = orig.getVertex(1)
-
-        doc.mergeQuads(dest, orig, v1, v2, v3, v4)
-        pass
-    else:
-##         doc.closeQuads(dest, orig)
-        print "closeQuads() : not yet implemented"
-        pass
-
-    return None
-
-BREP_PATH = os.path.expandvars("$HEXABLOCK_ROOT_DIR/bin/salome/bride.brep")
-
-#=============================
-# CREATION DOCUMENT
-#=============================
-
-doc = hexablock.addDocument("bride")
-
-#=============================
-# PARAMETRES
-#=============================
-
-height = 1.0
-
-# cylinder grid 1 :
-nr1 = 8
-na1 = 4
-nl1 = 5
-dr1 = 1.0
-da1 = 45.0  # angle
-dl1 = height
-
-# cylinder grid 2 :
-nr2 = 3
-na2 = 8
-nl2 = nl1
-dr2 = 0.5
-da2 = 180.0  # angle
-dl2 = dl1
-
-#=============================
-# Creation du modele de blocs
-#=============================
-
-# JPL (le 09/05/2011)
-# repris de test_bride_abu.cxx (version la plus a jour dans ~/IHMHEXA/Alain/models):
-# et de BRIDE.py (Karima) pour les "vraies" coordonn�es :
-
-#=================================================
-# Creation des centres des grilles cylindriques
-#=================================================
-
-center1 = doc.addVertex(0, 0, height)
-center2 = doc.addVertex(6, 0, height)
-
-dx = doc.addVector(height, 0, 0)
-dz = doc.addVector(0, 0, height)
-
-# Creation des grilles cylindriques initiales
-#============================================
-
-# 1. 1 ere grille (quart) :
-#==========================
-
-# JPL (le 10/05/2011) : vu la geometrie, on ne remplit pas le centre :
-## grille_cyl_quart = doc.makeCylindrical(orig1, dx, dz, dr_q, 45.0, dl,
-##                                        nr_q, na_q, dim_z, True)
-grille_cyl_quart = doc.makeCylindrical(center1, dx, dz, dr1, da1, dl1,
-                                       nr1, na1, nl1, False)
-
-
-# temporaire : sauvegarde du modele de blocs :
-save_schema(doc)
-# fin temporaire
-
-# Elagage  :
-for nk in range(2, nl1):
-    for nj in range(na1):
-        ideb = 2
-        if nk == nl1 - 1:
-            ideb = 1
-        for ni in range(ideb, nr1):
-            doc.removeHexa(grille_cyl_quart.getHexaIJK(ni, nj, nk))
-            pass
-        pass
-    pass
-
-# temporaire : sauvegarde du modele de blocs :
-save_schema(doc)
-# fin temporaire
-
-# Semelle :
-k0 = 0
-for nj in range(na1):
-    for ni in range(2, nr1):
-        doc.removeHexa(grille_cyl_quart.getHexaIJK(ni, nj, k0))
-        pass
-    pass
-
-# temporaire : sauvegarde du modele de blocs :
-save_schema(doc)
-# fin temporaire
-
-# @todo JPL : peut-on fusionner les edges du haut des hexaedres du haut du deuxieme
-# rang ? (cf. GEOM). Si oui revoir aussi l'association
-
-# 2. 2�me grille (demi) :
-#========================
-grille_cyl_demi = doc.makeCylindrical(center2, dx, dz, dr2, da2, dl2,
-                                      nr2, na2, nl2, True)
-
-# temporaire : sauvegarde du modele de blocs :
-save_schema(doc)
-# fin temporaire
-
-ni0 = [0, nr2, 2, 1, 0]  # en fonction de z (ie : nk) 
-for nk in range(0, nl2):
-    for nj in range(na2):  # elagage suivant toute la demi-circonference
-        for ni in range(ni0[nk], nr2):
-            doc.removeHexa(grille_cyl_demi.getHexaIJK(ni, nj, nk))            
-            pass
-        pass
-    pass
-
-
-# temporaire : sauvegarde du modele de blocs :
-save_schema(doc)
-# fin temporaire
-
-# 3. creusement des fondations de demi dans quart :
-#==================================================
-for nj in range(2):
-    for ni in range(3, nr1 - 1):
-        doc.removeHexa(grille_cyl_quart.getHexaIJK(ni, nj, k1))
-        pass
-    pass
-
-# temporaire : sauvegarde du modele de blocs :
-save_schema(doc)
-# fin temporaire
-
-# 4. Fusion des bords :
-#======================
-merge_quads(doc, grille_cyl_quart, grille_cyl_demi, 7, 0, nr2, 0, OPT_FIRST)
-merge_quads(doc, grille_cyl_quart, grille_cyl_demi, 7, 1, nr2, 1)
-for ni1 in range(2, 6):
-    merge_quads(doc, grille_cyl_quart, grille_cyl_demi, 8 - ni1, 2, nr2, ni1, OPT_QUAD_IK)
-    pass
-merge_quads(doc, grille_cyl_quart, grille_cyl_demi, 3, 1, nr2, 6)
-merge_quads(doc, grille_cyl_quart, grille_cyl_demi, 3, 0, nr2, 7)
-
-# temporaire : sauvegarde du modele de blocs :
-save_schema(doc)
-# fin temporaire
-
-###########
-# Geometry
-###########
-
-bride_geom = geompy.ImportFile(BREP_PATH, "BREP")
-
-geompy.addToStudy(bride_geom, "bride_geom")
-
-
-# parametres de la geometrie :
-
-r1 = 12.0
-r1_t = 7.88
-r2 = 20.0
-r2_t = 2.0
-
-##############
-# Association
-##############
-
-# association vertex/points de la grille 1
-# (tous les vertex qui ne sont pas fusionnes avec ceux de la grille #
-# 2)
-
-dz_geom = geompy.MakeVectorDXDYDZ(0., 0., 1.)
-
-# les vertex du cylindre 1 sont crees de bas en haut, en tournant dans
-# le sens trigonometrique :
-
-# 6 vertex sont necessaires / axe z (pour associer aux 6 vertices du
-# modele) :
-
-z_val = [-1, 1.5, 21.5, 34, 46.5]  # nl1 + 1 valeurs
-for ni in range(nr1 + 1):
-    # suivant ni, valeurs des x pour les (nl1 + 1) points (selon l'axe z)
-    x = []
-    z = []
-    nb_z = 0  # nombre de points suivant l'axe z
-    if ni == 0:
-        z = z_val
-        x = [r1_t] * len(z)
-        pass
-    elif ni == 1:
-        z = z_val
-        x = [r1_t + 2.77] * len(z)
-        pass
-    elif ni == 2:
-        z = z_val[0:-1]  # tout sauf le dernier
-        x_last = r1_t + 2.77
-        x = [24.0, 24.0, 19.0, (19.0 - x_last)/2 + x_last, x_last]  # pour le 4 eme point, moyenne
-        # entre le 3 eme et le 5 eme
-        pass
-    elif ni == 3:
-        z = z_val[1:3]
-        x = [24.0, 19.0]
-        pass
-    elif ni == 4:
-        z = z_val[1:3]
-        x = [26.5, 21.0]  # a revoir pour le premier point ??
-        pass
-    elif ni == 8:
-        z = z_val[1:3]
-        x = [47.5] * 2
-        pass
-    else:  # ni = 5, 6, 7
-        z = z_val[1:3]
-        x = [26.5 + (47.5 - 26.5)/4*(ni - 4)] * 2
-        pass
-    pass
-
-    nb_z = len(z)
-
-    # creation des points pour y = 0 :
-    vert_grid1_xi = [geompy.MakeVertex(xi, 0, zi) for (xi, zi) in \
-                     zip(x, z)]
-
-    # les points suivants sont crees par rotation de PI/16 suivant
-    # l'axe z / aux precedents :
-    angle = math.pi/4.0/na1  # PI/4 (45 degres), divise par 4
-    for j in range(na1):
-        li = [geompy.MakeRotation(v, dz_geom, angle) for v in vert_grid1_xi[-nb_z:]]
-        vert_grid1_xi.extend(li)
-        pass
-
-    # ajout des points a l'etude et association :
-    # les vertex fusionnes ou correspondant a des hexaedres effaces ne
-    # sont pas pris en compte.
-    for nj in range(na1 + 1):
-        for nk in range(nb_z):
-            if (ni <= 2) or (3 <= ni <= 7 and nj >= na1 - 1) or \
-                   (ni == 8 and (nj == 0  or nj >= na1 - 1)):
-                v_mod = grille_cyl_quart.getVertexIJK(ni, nj, nk)
-                v_geo = vert_grid1_xi[nk + nj*nb_z]
-                geompy.addToStudy(v_geo, "vert_grid1_x" + str(ni) + "_y" + \
-                                  str(nj) + "_z" + str(nk))
-                v_mod.setAssociation(v_geo)
-                pass
-            pass
-        pass
-    
-    pass
-
-# association vertex/points de la grille 2
-# (tous les vertex qui ne sont pas fusionnes avec ceux de la grille #
-# 1)
-## dz_geom2 = geompy.MakeVectorDXDYDZ(33.5, 0., 1.)
-pt_a = geompy.MakeVertex(33.5, 0, 0)
-pt_b = geompy.MakeVertex(33.5, 0, 1.)
-dz_geom2 = geompy.MakeVector(pt_a, pt_b)
-
-# les vertex du cylindre 2 sont crees de bas en haut, en tournant dans
-# le sens trigonometrique :
-
-# REM : pour l'instant on met de cote la partie centrale du cylindre
-# (6 vertex selon z) => a faire a la fin. Ils sont d'ailleurs ranges
-# apres les autres dans le modele
-
-
-# 6 vertex sont necessaires / axe z (pour associer aux 6 vertices du
-# modele) :
-
-z_val = [-1, 1.5, 21.5, 24, 36, 41.5]  # nl2 + 1 valeurs
-for ni in range(nr2 + 1):
-    # suivant ni, valeurs des x pour les (nl1 + 1) points (selon l'axe z)
-    x = []
-    z = []
-    nb_z = 0  # nombre de points suivant l'axe z
-    if ni == 0:
-        z = z_val
-        x = [39.5] * len(z)
-        pass
-    elif ni == 1:
-        z = z_val[1:-1]  # tout sauf le dernier et le premier
-        x = [42.5] * len(z)
-        pass
-    elif ni == 2:
-        z = z_val[1:-2]  # tout sauf les 2 derniers et le premier
-        x = [46.] * len(z)
-        pass
-    elif ni == 3:
-        z = z_val[1:3]
-        x = [46.7] * len(z)  # valeur a revoir ??
-        pass
-    pass
-
-    nb_z = len(z)
-
-    # creation des points pour y = 0 :
-    vert_grid2_xi = [geompy.MakeVertex(xi, 0, zi) for (xi, zi) in \
-                     zip(x, z)]
-
-    # les points suivants sont crees par rotation de PI/16 suivant
-    # l'axe z / aux precedents :
-    angle = math.pi/na2  # PI (180 degres), divise par 8
-    for j in range(na2):
-        li = [geompy.MakeRotation(v, dz_geom2, angle) for v in vert_grid2_xi[-nb_z:]]
-        vert_grid2_xi.extend(li)
-        pass
-
-    # ajout des points a l'etude et association :
-    for nj in range(na2 + 1):
-        for nk in range(nb_z):
-            v_mod = grille_cyl_demi.getVertexIJK(ni, nj, nk)
-            v_geo = vert_grid2_xi[nk + nj*nb_z]
-            geompy.addToStudy(v_geo, "vert_grid2_x" + str(ni) + "_y" + \
-                              str(nj) + "_z" + str(nk))
-            v_mod.setAssociation(v_geo)
-            pass
-        pass
-
-    pass
-
-# association des vertex communs grille1/grille2
-# REM : cette etape n'est pas necessaire ? En effet, les vertex ayant
-# ete fusionnes, l'association a ete faite avec la grille 2
diff --git a/src/TEST_PY/foo.py b/src/TEST_PY/foo.py
new file mode 100644 (file)
index 0000000..9bd924a
--- /dev/null
@@ -0,0 +1,4 @@
+
+
+a = 2
+print a
index dd42eb63713e9a30c258cbff907b1ade72dd384d..6cf16cb945a4769bbe118969425d57c524480e94 100644 (file)
-# -*- coding: latin-1 -*-
-# Copyright (C) 2009-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
-#
-
-# Francis KLOSS - 2011-2012 - CEA-Saclay, DEN, DM2S, SFME, LGLS, F-91191 Gif-sur-Yvette, France
-# =============================================================================================
-
-import math
-
-import geompy
-import hexablock
-
-# Charger la géométrie
-# ====================
-
-nom = "cuve"
-
-cuve = geompy.ImportBREP(nom+".brep")
-
-# Sélectionner des sommets de la géométrie
-# -----------------------------------------
-
-sommets = geompy.SubShapeAllSortedCentres(cuve, geompy.ShapeType["VERTEX"])
-
-coin_a = sommets[ 4]
-coin_b = sommets[43]
-coin_c = sommets[62]
-coin_d = sommets[15]
-
-support_a_o = sommets[ 3]
-support_a_x = sommets[ 8]
-support_a_y = sommets[ 6]
-support_a_d = sommets[10]
-
-support_b_o = sommets[42]
-support_b_x = sommets[36]
-support_b_y = sommets[47]
-support_b_d = sommets[38]
-
-support_c_o = sommets[61]
-support_c_x = sommets[51]
-support_c_y = sommets[59]
-support_c_d = sommets[49]
-
-support_d_o = sommets[14]
-support_d_x = sommets[19]
-support_d_y = sommets[12]
-support_d_d = sommets[17]
-
-coin_x1, coin_y1, coin_z1 = geompy.PointCoordinates(sommets[ 2])
-coin_x2, coin_y2, coin_z2 = geompy.PointCoordinates(support_a_d)
-coin_x3, coin_y3, coin_z3 = geompy.PointCoordinates(support_a_o)
-coin_x4, coin_y4, coin_z4 = geompy.PointCoordinates(coin_c)
-
-base_x, base_y, base_z = geompy.PointCoordinates(sommets[52])
-oppo_x, oppo_y, oppo_z = geompy.PointCoordinates(sommets[57])
-
-# Sélectionner des arêtes de la géométrie
-# ---------------------------------------
-
-aretes = geompy.SubShapeAllSortedCentres(cuve, geompy.ShapeType["EDGE"])
-
-interne0, interne_x, interne_y, interne_z,  interne_dx, interne_dy, interne_dz,  interne_rayon = geompy.KindOfShape(aretes[48])
-externe0, externe_x, externe_y, externe_z,  externe_dx, externe_dy, externe_dz,  externe_rayon = geompy.KindOfShape(aretes[49])
-
-cote_a = aretes[41]
-cote_b = aretes[91]
-cote_c = aretes[59]
-cote_d = aretes[12]
-
-piquage_1_int = aretes[  0]
-piquage_1_ext = aretes[  1]
-piquage_1_feb = aretes[ 36]
-piquage_1_feh = aretes[ 38]
-piquage_1_eeb = aretes[ 33]
-piquage_1_eeh = aretes[ 37]
-piquage_1_eib = aretes[ 34]
-piquage_1_eih = aretes[ 35]
-
-piquage_2_int = aretes[103]
-piquage_2_ext = aretes[104]
-piquage_2_feg = aretes[ 68]
-piquage_2_fed = aretes[ 73]
-piquage_2_eeg = aretes[ 79]
-piquage_2_eed = aretes[ 88]
-piquage_2_eig = aretes[ 80]
-piquage_2_eid = aretes[ 89]
-
-support_l, support_a, support_v = geompy.BasicProperties(aretes[43])
-cote_lgr, cote_aire, cote_vol   = geompy.BasicProperties(cote_a)
-
-# Sélectionner des faces de la géométrie
-# --------------------------------------
-
-faces = geompy.SubShapeAllSortedCentres(cuve, geompy.ShapeType["FACE"])
-
-face_cylindrique_int = faces[21]
-face_cylindrique_ext = faces[22]
-
-# Construire le modèle de blocs
-# =============================
-
-# Créer le document
-# -----------------
-
-doc = hexablock.addDocument(nom)
-
-# Calculer l'angle défini par le centre de la cuve et 2 points (projeté dans le plan XY)
-# --------------------------------------------------------------------------------------
-
-centre_cuve = geompy.MakeVertex(externe_x, externe_y, 0)
-
-def calculer_angle(point1, point2):
-  x1, y1, z1 = geompy.PointCoordinates(point1)
-  x2, y2, z2 = geompy.PointCoordinates(point2)
-
-  p1 = geompy.MakeVertex(x1, y1, 0)
-  p2 = geompy.MakeVertex(x2, y2, 0)
-
-  a1 = geompy.MakeEdge(centre_cuve, p1)
-  a2 = geompy.MakeEdge(centre_cuve, p2)
-
-  return geompy.GetAngle(a1, a2)
-
-# Construire les 8 points de la grille
-# ------------------------------------
-
-p1_int0, p1_int_x, p1_int_y, p1_int_z,  p1_int_dx, p1_int_dy, p1_int_dz,  p1_int_rayon = geompy.KindOfShape(piquage_1_int)
-p2_int0, p2_int_x, p2_int_y, p2_int_z,  p2_int_dx, p2_int_dy, p2_int_dz,  p2_int_rayon = geompy.KindOfShape(piquage_2_int)
-
-p1_int_c = geompy.MakeVertex(p1_int_x, p1_int_y, p1_int_z)
-p2_int_c = geompy.MakeVertex(p2_int_x, p2_int_y, p2_int_z)
-
-p1_int_e = geompy.MakePrismDXDYDZ2Ways(p1_int_c, p1_int_dx*cote_lgr, p1_int_dy*cote_lgr, p1_int_dz*cote_lgr)
-p2_int_e = geompy.MakePrismDXDYDZ2Ways(p2_int_c, p2_int_dx*cote_lgr, p2_int_dy*cote_lgr, p2_int_dz*cote_lgr)
-
-plan_2 = geompy.MakePrismDXDYDZ(p1_int_e, +cote_lgr, +cote_lgr, -cote_lgr)
-plan_3 = geompy.MakePrismDXDYDZ(p1_int_e, -cote_lgr, -cote_lgr, -cote_lgr)
-
-plan_7 = geompy.MakePrismDXDYDZ(p2_int_e, 0, -cote_lgr, -cote_lgr)
-plan_8 = geompy.MakePrismDXDYDZ(p2_int_e, 0, +cote_lgr, -cote_lgr)
-
-part_2 = geompy.MakePartition([piquage_1_eeb], [plan_2], [], [], geompy.ShapeType["VERTEX"])
-part_3 = geompy.MakePartition([piquage_1_eeb], [plan_3], [], [], geompy.ShapeType["VERTEX"])
-
-part_7 = geompy.MakePartition([piquage_2_feg], [plan_7], [], [], geompy.ShapeType["VERTEX"])
-part_8 = geompy.MakePartition([piquage_2_fed], [plan_8], [], [], geompy.ShapeType["VERTEX"])
-
-point_1 = coin_c
-point_2 = geompy.SubShapeAllSortedCentres(part_2, geompy.ShapeType["VERTEX"])[1]
-point_3 = geompy.SubShapeAllSortedCentres(part_3, geompy.ShapeType["VERTEX"])[1]
-point_4 = geompy.MakeVertexOnCurve(cote_d, 0.55)
-point_5 = coin_a
-point_6 = coin_b
-point_7 = geompy.SubShapeAllSortedCentres(part_7, geompy.ShapeType["VERTEX"])[0]
-point_8 = geompy.SubShapeAllSortedCentres(part_8, geompy.ShapeType["VERTEX"])[2]
-
-# Construire la grille cylindrique
-# --------------------------------
-
-grille_hauteur = coin_z4-coin_z2
-
-centre = doc.addVertex(externe_x, externe_y, externe_z-grille_hauteur)
-
-grille_x = doc.addVector(1, 1, 0)
-grille_z = doc.addVector(0, 0, 1)
-
-petit_rayon = interne_rayon * 0.2
-grand_rayon = math.sqrt( (coin_x1-externe_x)**2 + (coin_y1-externe_y)**2 )
-
-rayons = [ petit_rayon, interne_rayon-petit_rayon, externe_rayon-interne_rayon, grand_rayon-externe_rayon ]
-
-points = [ point_1, point_2, point_3, point_4, point_5, point_6, point_7, point_8, point_1 ]
-
-angles = []
-for i in xrange(8):
-  angle = calculer_angle(points[i], points[i+1])
-  angles.append(angle)
-
-hauteurs = [ grille_hauteur ]
-
-grille = doc.makeCylindricals(centre, grille_x, grille_z, rayons, angles, hauteurs, False)
-
-# Ajouter le centre
-# -----------------
-
-quad_0 = grille.getQuadJK(0, 7, 0)
-quad_6 = grille.getQuadJK(0, 0, 0)
-quad_7 = grille.getQuadJK(0, 1, 0)
-
-centre_a = doc.addHexa3Quads(quad_0, quad_6, quad_7)
-
-quad_2 = grille.getQuadJK(0, 3, 0)
-quad_3 = grille.getQuadJK(0, 4, 0)
-quad_4 = grille.getQuadJK(0, 5, 0)
-
-centre_b = doc.addHexa3Quads(quad_2, quad_3, quad_4)
-
-quad_1 = grille.getQuadJK(0, 2, 0)
-quad_5 = grille.getQuadJK(0, 6, 0)
-
-quad_a = centre_a.getQuad(1)
-quad_b = centre_b.getQuad(1)
-
-centre_c = doc.addHexa4Quads(quad_1, quad_a, quad_5, quad_b)
-
-# Ajouter l'enceinte
-# ------------------
-
-plan_0  = geompy.MakePrismDXDYDZ(p1_int_e, +cote_lgr, +cote_lgr, +cote_lgr)
-part_0  = geompy.MakePartition([piquage_1_feh], [plan_0], [], [], geompy.ShapeType["VERTEX"])
-point_0 = geompy.SubShapeAllSortedCentres(part_0, geompy.ShapeType["VERTEX"])[1]
-
-enceinte_quads = []
-for j in xrange(8):
-  q = grille.getQuadIJ(1, j, 1)
-  enceinte_quads.append(q)
-
-point_7x, point_7y, point_7z = geompy.PointCoordinates(point_7)
-point_2x, point_2y, point_2z = geompy.PointCoordinates(point_2)
-point_0x, point_0y, point_0z = geompy.PointCoordinates(point_0)
-
-enceinte_h1 = point_7z - base_z
-enceinte_h2 = point_2z - base_z
-enceinte_h3 = point_0z - base_z
-enceinte_h4 = oppo_z   - base_z
-
-enceinte_hauteurs = [ enceinte_h1, enceinte_h2, enceinte_h3, enceinte_h4 ]
-
-enceinte_pz = doc.addVector(oppo_x - base_x, oppo_y - base_y, enceinte_h4)
-
-enceinte = doc.prismQuadsVec(enceinte_quads, enceinte_pz, enceinte_hauteurs, 0)
-
-# Déconnecter via des arêtes, puis prismer, puis compléter (3) ou coller (1)
-# --------------------------------------------------------------------------
-
-periph_hexas     = []
-supports_quads_b = []
-supports_quads_h = []
-
-v1 = doc.addVector(   0, +0.1, 0)
-v2 = doc.addVector(   0, -0.1, 0)
-v3 = doc.addVector(+0.2, -0.1, 0)
-
-for j, v in [ [0, v1], [1, v1], [4, v2], [5, v3] ]:
-  h = grille.getHexaIJK(2, j, 0)
-  a = grille.getEdgeK(3, j, 0)
-  d = doc.disconnectEdge(h, a)
-
-  q1 = d.getQuad(0)
-  q2 = grille.getQuadIK(2, j, 0)
-  if j==1:
-    h0 = doc.addHexa2Quads(q1, q2)
-    q3 = grille.getQuadJK(3, j, 0)
-    q4 = h0.getQuad(3)
-    h1 = doc.addHexa2Quads(q3, q4)
-    qb = h1.getQuad(hexablock.Q_E)
-    qh = h1.getQuad(hexablock.Q_F)
-  else:
-    p = doc.prismQuad(q1, v, 2)
-
-    h0 = p.getHexa(0)
-    q3 = h0.getQuad(5)
-    h1 = p.getHexa(1)
-    q4 = h1.getQuad(5)
-    doc.addHexa3Quads(q2, q3, q4)
-    periph_hexas.append(h0)
-    qb = h1.getQuad(hexablock.Q_C)
-    qh = h1.getQuad(hexablock.Q_D)
-
-  supports_quads_b.append(qb)
-  supports_quads_h.append(qh)
-
-# Piquer les 2 tuyaux sur l'enceinte
-# ----------------------------------
-
-piquage_centre = doc.addVertex(10, 0, 0)
-
-piquage_vx = doc.addVector(1, 0, 0)
-piquage_vz = doc.addVector(0, 0, 1)
-
-piquage = doc.makeCylindrical(piquage_centre, piquage_vx, piquage_vz,  1, 360, 1,  1, 4, 1,  False)
-
-piquage_quads = [ piquage.getQuadIJ(0, j, 0) for j in xrange(4) ]
-
-piquage_s1 = piquage.getVertexIJK(1, 0, 0)
-piquage_s2 = piquage.getVertexIJK(1, 1, 0)
-piquage_s3 = piquage.getVertexIJK(1, 2, 0)
-
-enceinte_ha = enceinte.getHexa( 6)
-enceinte_hb = enceinte.getHexa(25)
-
-enceinte_s11 = enceinte_ha.getVertex(2)
-enceinte_s12 = enceinte_ha.getVertex(3)
-enceinte_s13 = enceinte_ha.getVertex(7)
-
-enceinte_s21 = enceinte_hb.getVertex(2)
-enceinte_s22 = enceinte_hb.getVertex(3)
-enceinte_s23 = enceinte_hb.getVertex(7)
-
-piquage_1 = doc.replace(piquage_quads, piquage_s1, enceinte_s11, piquage_s2, enceinte_s12, piquage_s3, enceinte_s13)
-piquage_2 = doc.replace(piquage_quads, piquage_s1, enceinte_s21, piquage_s2, enceinte_s22, piquage_s3, enceinte_s23)
-
-# Nettoyer le template du piquage
-# -------------------------------
-
-doc.removeElements(piquage)
-
-# Associer le modèle de blocs avec la géométrie
-# =============================================
-
-doc.setShape(cuve)
-
-# Nettoyer les associations implicites du centre et de la périphérie
-# ------------------------------------------------------------------
-
-for i in xrange(0, 4, 3):
-  for j in xrange(8):
-    for k in xrange(2):
-      e = grille.getEdgeJ(i, j, k)
-      e.clearAssociation()
-
-# Associer le centre de l'enceinte
-# --------------------------------
-
-for j, ig in [ [2, 30], [3, 28], [6, 32], [7, 34] ]:
-  sm0 = grille.getVertexIJK(0, j, 0)
-  sg0 = sommets[ig]
-  sm0.setAssociation(sg0)
-
-  sm1 = grille.getVertexIJK(0, j, 1)
-  sg1 = geompy.MakeTranslation(sg0, 0, 0, grille_hauteur)
-  sm1.setAssociation(sg1)
-
-for j, ig, sens in [ [0, 34, +1], [1, 30, +1], [4, 28, -1], [5, 32, -1] ]:
-  sm0 = grille.getVertexIJK(0, j, 0)
-  sg0 = geompy.MakeTranslation(sommets[ig], 0, sens*support_l, 0)
-  sm0.setAssociation(sg0)
-
-  sm1 = grille.getVertexIJK(0, j, 1)
-  sg1 = geompy.MakeTranslation(sg0, 0, 0, grille_hauteur)
-  sm1.setAssociation(sg1)
-
-# Associer les 16 sommets des 4 supports externes
-# -----------------------------------------------
-
-supports_points = [
-  [ support_c_o, support_c_y, support_c_d, support_c_x ],
-  [ support_d_d, support_d_y, support_d_o, support_d_x ],
-  [ support_a_o, support_a_y, support_a_d, support_a_x ],
-  [ support_b_o, support_b_x, support_b_d, support_b_y ]
-]
-
-for s in xrange(4):
-  qb = supports_quads_b[s]
-  qh = supports_quads_h[s]
-  cs = supports_points[s]
-  for i in xrange(4):
-    smb = qb.getVertex(i)
-    sgb = cs[i]
-    smb.setAssociation(sgb)
-
-    if s==1:
-      ind = i
-    else:
-      ind = [1, 0, 3, 2][i]
-    smh = qh.getVertex(ind)
-    sgh = geompy.MakeTranslation(sgb, 0, 0, grille_hauteur)
-    smh.setAssociation(sgh)
-
-# Associer les 7 sommets périphériques de la grille
-# -------------------------------------------------
-
-par_1 = 0.17
-par_2 = 1 - par_1
-
-periph_grille = [ [0, cote_b, par_2], [1, cote_c, 0.22], [3, cote_d, 0.548], [4, cote_d, par_1], [5, cote_a, par_2], [6, cote_b, 0.44], [7, cote_b, 0.555] ]
-
-for j, ag, p in periph_grille:
-  smb = grille.getVertexIJK(3, j, 1)
-  sgb = geompy.MakeVertexOnCurve(ag, p)
-  smb.setAssociation(sgb)
-
-  smh = grille.getVertexIJK(3, j, 0)
-  sgh = geompy.MakeTranslation(sgb, 0, 0, -grille_hauteur)
-  smh.setAssociation(sgh)
-
-# Associer les 3 sommets liés aux déconnections sur la grille
-# -----------------------------------------------------------
-
-periph_deco = [ [cote_c, par_2], [cote_a, par_1], [cote_b, par_1] ]
-
-for i in xrange(3):
-  hxa = periph_hexas[i]
-  ag, p = periph_deco[i]
-  smb = hxa.getVertex(2)
-  sgb = geompy.MakeVertexOnCurve(ag, p)
-  smb.setAssociation(sgb)
-
-  smh = hxa.getVertex(0)
-  sgh = geompy.MakeTranslation(sgb, 0, 0, -grille_hauteur)
-  smh.setAssociation(sgh)
-
-# Réparer les piquages
-# --------------------
-
-piquage_e_base  = geompy.MakeVertex(interne_x, interne_y, interne_z)
-piquage_e_axe   = geompy.MakeVectorDXDYDZ(interne_dx, interne_dy, interne_dz)
-piquage_e_cyl   = geompy.MakeCylinder(piquage_e_base, piquage_e_axe, interne_rayon, enceinte_h4)
-
-piquage_1_axe   = geompy.MakeVectorDXDYDZ(p1_int_dx, p1_int_dy, p1_int_dz)
-piquage_1_cyl   = geompy.MakeCylinder(p1_int_c, piquage_1_axe, p1_int_rayon, cote_lgr)
-
-piquage_2_axe   = geompy.MakeVectorDXDYDZ(p2_int_dx, p2_int_dy, p2_int_dz)
-piquage_2_cyl   = geompy.MakeCylinder(p2_int_c, piquage_2_axe, p2_int_rayon, cote_lgr)
-
-piquage_1_inter = geompy.SubShapeAllSortedCentres(geompy.MakeSection(piquage_e_cyl, piquage_1_cyl), geompy.ShapeType["EDGE"])
-piquage_2_inter = geompy.SubShapeAllSortedCentres(geompy.MakeSection(piquage_e_cyl, piquage_2_cyl), geompy.ShapeType["EDGE"])
-
-piquage_1_fi  = piquage_1_inter[0]
-
-piquage_2_fig = piquage_2_inter[0]
-piquage_2_fid = piquage_2_inter[1]
-
-# Associer les piquages
-# ---------------------
-
-piquages_devant = [
-  [ piquage_1, piquage_1_int, 0.375, piquage_1_ext, 0.125 ],
-  [ piquage_2, piquage_2_int, 0.125, piquage_2_ext, 0.875 ]
-]
-
-for m_piq, a_int, p_int, a_ext, p_ext in piquages_devant:
-
-  i1 = m_piq.getEdge(2)
-  i2 = m_piq.getEdge(5)
-  i3 = m_piq.getEdge(7)
-  i4 = m_piq.getEdge(10)
-
-  doc.associateClosedLine(i1.getVertex(1), i1, [ i2, i3, i4 ], a_int, p_int, True, [])
-
-  e1 = m_piq.getEdge(0)
-  e2 = m_piq.getEdge(1)
-  e3 = m_piq.getEdge(9)
-  e4 = m_piq.getEdge(11)
-
-  doc.associateClosedLine(e1.getVertex(0), e1, [ e2, e3, e4 ], a_ext, p_ext, False, [])
-
-piquages_milieu = [
-  [ piquage_1, piquage_1_eib, piquage_1_eih, 0.30, piquage_1_eeb, piquage_1_eeh, 0.30 ],
-  [ piquage_2, piquage_2_eid, piquage_2_eig, 0.75, piquage_2_eed, piquage_2_eeg, 0.75 ]
-]
-
-for m_piq, a_int1, a_int2, p_int, a_ext1, a_ext2, p_ext in piquages_milieu:
-
-  i1 = m_piq.getEdge(22)
-  i2 = m_piq.getEdge(25)
-  i3 = m_piq.getEdge(27)
-  i4 = m_piq.getEdge(30)
-
-  doc.associateClosedLine(i1.getVertex(0), i1, [ i4, i3, i2 ], a_int1, p_int, False, [a_int2])
-
-  e1 = m_piq.getEdge(20)
-  e2 = m_piq.getEdge(21)
-  e3 = m_piq.getEdge(29)
-  e4 = m_piq.getEdge(31)
-
-  doc.associateClosedLine(e1.getVertex(0), e1, [ e2, e3, e4 ], a_ext1, p_ext, False, [a_ext2])
-
-piquages_fond = [
-  [ piquage_1, piquage_1_fi , []             , 0.125, piquage_1_feb, piquage_1_feh, 0.30 ],
-  [ piquage_2, piquage_2_fid, [piquage_2_fig], 0.75 , piquage_2_fed, piquage_2_feg, 0.75 ]
-]
-
-for m_piq, a_int1, a_int2, p_int, a_ext1, a_ext2, p_ext in piquages_fond:
-
-  i1 = m_piq.getEdge(42)
-  i2 = m_piq.getEdge(45)
-  i3 = m_piq.getEdge(47)
-  i4 = m_piq.getEdge(50)
-
-  doc.associateClosedLine(i1.getVertex(0), i1, [ i4, i3, i2 ], a_int1, p_int, False, a_int2)
-
-  e1 = m_piq.getEdge(40)
-  e2 = m_piq.getEdge(41)
-  e3 = m_piq.getEdge(49)
-  e4 = m_piq.getEdge(51)
-
-  doc.associateClosedLine(e1.getVertex(1), e1, [ e2, e3, e4 ], a_ext1, p_ext, False, [a_ext2])
-
-# Associer quelques faces
-# -----------------------
-
-for h in [ 2, 5, 7, 10,  21, 24, 26, 29 ]:
-  enceinte_hc = enceinte.getHexa(h)
-
-  enceinte_qc = enceinte_hc.getQuad(hexablock.Q_C)
-  enceinte_qc.addAssociation(face_cylindrique_int)
-
-  enceinte_qc = enceinte_hc.getQuad(hexablock.Q_D)
-  enceinte_qc.addAssociation(face_cylindrique_ext)
-
-# Primer les 5 supports (finalisation du modèle de blocs)
-# -------------------------------------------------------
-
-supports_quads_b.append( centre_c.getQuad(hexablock.Q_E) )
-
-supports_z = doc.addVector(coin_x1 - coin_x3, coin_y1 - coin_y3, coin_z1 - coin_z3)
-
-supports = doc.prismQuads(supports_quads_b, supports_z, 1)
-
-# Mailler le modèle de blocs
-# ==========================
-
-# Définir les groupes volumiques
-# ------------------------------
-
-groupe_fd = doc.addHexaGroup("fond")
-groupe_en = doc.addHexaGroup("enceinte")
-groupe_p1 = doc.addHexaGroup("piquage:1")
-groupe_p2 = doc.addHexaGroup("piquage:2")
-groupe_su = doc.addHexaGroup("supports")
-
-for i in xrange( doc.countUsedHexa() ):
-  h = doc.getUsedHexa(i)
-  groupe_fd.addElement(h)
-
-for i in xrange( enceinte.countHexa() ):
-  h = enceinte.getHexa(i)
-  if h != None:
-    groupe_en.addElement(h)
-    groupe_fd.removeElement(h)
-
-for i in xrange( piquage_1.countHexa() ):
-  h = piquage_1.getHexa(i)
-  groupe_p1.addElement(h)
-  groupe_fd.removeElement(h)
-
-for i in xrange( piquage_2.countHexa() ):
-  h = piquage_2.getHexa(i)
-  groupe_p2.addElement(h)
-  groupe_fd.removeElement(h)
-
-for i in xrange( supports.countHexa() ):
-  h = supports.getHexa(i)
-  groupe_su.addElement(h)
-  groupe_fd.removeElement(h)
-
-# Générer le maillage
-# -------------------
-
-hexablock.addLaws(doc, 0.015, False)
-
-maillage = hexablock.mesh(doc)
-
-muv, mue, muq, muh = hexablock.dump(doc, maillage)
+# -*- coding: latin-1 -*-\r
+# Copyright (C) 2009-2012  CEA/DEN, EDF R&D\r
+#\r
+# This library is free software; you can redistribute it and/or\r
+# modify it under the terms of the GNU Lesser General Public\r
+# License as published by the Free Software Foundation; either\r
+# version 2.1 of the License.\r
+#\r
+# This library is distributed in the hope that it will be useful,\r
+# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+# Lesser General Public License for more details.\r
+#\r
+# You should have received a copy of the GNU Lesser General Public\r
+# License along with this library; if not, write to the Free Software\r
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA\r
+#\r
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+#\r
+\r
+# Francis KLOSS - 2011-2012 - CEA-Saclay, DEN, DM2S, SFME, LGLS, F-91191 Gif-sur-Yvette, France\r
+# =============================================================================================\r
+\r
+import math\r
+\r
+import geompy\r
+import hexablock\r
+\r
+# Charger la géométrie\r
+# ====================\r
+\r
+nom = "cuve"\r
+\r
+cuve = geompy.ImportBREP(nom+".brep")\r
+\r
+# Sélectionner des sommets de la géométrie\r
+# -----------------------------------------\r
+\r
+sommets = geompy.SubShapeAllSortedCentres(cuve, geompy.ShapeType["VERTEX"])\r
+\r
+coin_a = sommets[ 4]\r
+coin_b = sommets[43]\r
+coin_c = sommets[62]\r
+coin_d = sommets[15]\r
+\r
+support_a_o = sommets[ 3]\r
+support_a_x = sommets[ 8]\r
+support_a_y = sommets[ 6]\r
+support_a_d = sommets[10]\r
+\r
+support_b_o = sommets[42]\r
+support_b_x = sommets[36]\r
+support_b_y = sommets[47]\r
+support_b_d = sommets[38]\r
+\r
+support_c_o = sommets[61]\r
+support_c_x = sommets[51]\r
+support_c_y = sommets[59]\r
+support_c_d = sommets[49]\r
+\r
+support_d_o = sommets[14]\r
+support_d_x = sommets[19]\r
+support_d_y = sommets[12]\r
+support_d_d = sommets[17]\r
+\r
+coin_x1, coin_y1, coin_z1 = geompy.PointCoordinates(sommets[ 2])\r
+coin_x2, coin_y2, coin_z2 = geompy.PointCoordinates(support_a_d)\r
+coin_x3, coin_y3, coin_z3 = geompy.PointCoordinates(support_a_o)\r
+coin_x4, coin_y4, coin_z4 = geompy.PointCoordinates(coin_c)\r
+\r
+base_x, base_y, base_z = geompy.PointCoordinates(sommets[52])\r
+oppo_x, oppo_y, oppo_z = geompy.PointCoordinates(sommets[57])\r
+\r
+# Sélectionner des arêtes de la géométrie\r
+# ---------------------------------------\r
+\r
+aretes = geompy.SubShapeAllSortedCentres(cuve, geompy.ShapeType["EDGE"])\r
+\r
+interne0, interne_x, interne_y, interne_z,  interne_dx, interne_dy, interne_dz,  interne_rayon = geompy.KindOfShape(aretes[48])\r
+externe0, externe_x, externe_y, externe_z,  externe_dx, externe_dy, externe_dz,  externe_rayon = geompy.KindOfShape(aretes[49])\r
+\r
+cote_a = aretes[41]\r
+cote_b = aretes[91]\r
+cote_c = aretes[59]\r
+cote_d = aretes[12]\r
+\r
+piquage_1_int = aretes[  0]\r
+piquage_1_ext = aretes[  1]\r
+piquage_1_feb = aretes[ 36]\r
+piquage_1_feh = aretes[ 38]\r
+piquage_1_eeb = aretes[ 33]\r
+piquage_1_eeh = aretes[ 37]\r
+piquage_1_eib = aretes[ 34]\r
+piquage_1_eih = aretes[ 35]\r
+\r
+piquage_2_int = aretes[103]\r
+piquage_2_ext = aretes[104]\r
+piquage_2_feg = aretes[ 68]\r
+piquage_2_fed = aretes[ 73]\r
+piquage_2_eeg = aretes[ 79]\r
+piquage_2_eed = aretes[ 88]\r
+piquage_2_eig = aretes[ 80]\r
+piquage_2_eid = aretes[ 89]\r
+\r
+support_l, support_a, support_v = geompy.BasicProperties(aretes[43])\r
+cote_lgr, cote_aire, cote_vol   = geompy.BasicProperties(cote_a)\r
+\r
+# Sélectionner des faces de la géométrie\r
+# --------------------------------------\r
+\r
+faces = geompy.SubShapeAllSortedCentres(cuve, geompy.ShapeType["FACE"])\r
+\r
+face_cylindrique_int = faces[21]\r
+face_cylindrique_ext = faces[22]\r
+\r
+# Construire le modèle de blocs\r
+# =============================\r
+\r
+# Créer le document\r
+# -----------------\r
+\r
+doc = hexablock.addDocument(nom)\r
+\r
+# Calculer l'angle défini par le centre de la cuve et 2 points (projeté dans le plan XY)\r
+# --------------------------------------------------------------------------------------\r
+\r
+centre_cuve = geompy.MakeVertex(externe_x, externe_y, 0)\r
+\r
+def calculer_angle(point1, point2):\r
+  x1, y1, z1 = geompy.PointCoordinates(point1)\r
+  x2, y2, z2 = geompy.PointCoordinates(point2)\r
+\r
+  p1 = geompy.MakeVertex(x1, y1, 0)\r
+  p2 = geompy.MakeVertex(x2, y2, 0)\r
+\r
+  a1 = geompy.MakeEdge(centre_cuve, p1)\r
+  a2 = geompy.MakeEdge(centre_cuve, p2)\r
+\r
+  return geompy.GetAngle(a1, a2)\r
+\r
+# Construire les 8 points de la grille\r
+# ------------------------------------\r
+\r
+p1_int0, p1_int_x, p1_int_y, p1_int_z,  p1_int_dx, p1_int_dy, p1_int_dz,  p1_int_rayon = geompy.KindOfShape(piquage_1_int)\r
+p2_int0, p2_int_x, p2_int_y, p2_int_z,  p2_int_dx, p2_int_dy, p2_int_dz,  p2_int_rayon = geompy.KindOfShape(piquage_2_int)\r
+\r
+p1_int_c = geompy.MakeVertex(p1_int_x, p1_int_y, p1_int_z)\r
+p2_int_c = geompy.MakeVertex(p2_int_x, p2_int_y, p2_int_z)\r
+\r
+p1_int_e = geompy.MakePrismDXDYDZ2Ways(p1_int_c, p1_int_dx*cote_lgr, p1_int_dy*cote_lgr, p1_int_dz*cote_lgr)\r
+p2_int_e = geompy.MakePrismDXDYDZ2Ways(p2_int_c, p2_int_dx*cote_lgr, p2_int_dy*cote_lgr, p2_int_dz*cote_lgr)\r
+\r
+plan_2 = geompy.MakePrismDXDYDZ(p1_int_e, +cote_lgr, +cote_lgr, -cote_lgr)\r
+plan_3 = geompy.MakePrismDXDYDZ(p1_int_e, -cote_lgr, -cote_lgr, -cote_lgr)\r
+\r
+plan_7 = geompy.MakePrismDXDYDZ(p2_int_e, 0, -cote_lgr, -cote_lgr)\r
+plan_8 = geompy.MakePrismDXDYDZ(p2_int_e, 0, +cote_lgr, -cote_lgr)\r
+\r
+part_2 = geompy.MakePartition([piquage_1_eeb], [plan_2], [], [], geompy.ShapeType["VERTEX"])\r
+part_3 = geompy.MakePartition([piquage_1_eeb], [plan_3], [], [], geompy.ShapeType["VERTEX"])\r
+\r
+part_7 = geompy.MakePartition([piquage_2_feg], [plan_7], [], [], geompy.ShapeType["VERTEX"])\r
+part_8 = geompy.MakePartition([piquage_2_fed], [plan_8], [], [], geompy.ShapeType["VERTEX"])\r
+\r
+point_1 = coin_c\r
+point_2 = geompy.SubShapeAllSortedCentres(part_2, geompy.ShapeType["VERTEX"])[1]\r
+point_3 = geompy.SubShapeAllSortedCentres(part_3, geompy.ShapeType["VERTEX"])[1]\r
+point_4 = geompy.MakeVertexOnCurve(cote_d, 0.55)\r
+point_5 = coin_a\r
+point_6 = coin_b\r
+point_7 = geompy.SubShapeAllSortedCentres(part_7, geompy.ShapeType["VERTEX"])[0]\r
+point_8 = geompy.SubShapeAllSortedCentres(part_8, geompy.ShapeType["VERTEX"])[2]\r
+\r
+# Construire la grille cylindrique\r
+# --------------------------------\r
+\r
+grille_hauteur = coin_z4-coin_z2\r
+\r
+centre = doc.addVertex(externe_x, externe_y, externe_z-grille_hauteur)\r
+\r
+grille_x = doc.addVector(1, 1, 0)\r
+grille_z = doc.addVector(0, 0, 1)\r
+\r
+petit_rayon = interne_rayon * 0.2\r
+grand_rayon = math.sqrt( (coin_x1-externe_x)**2 + (coin_y1-externe_y)**2 )\r
+\r
+rayons = [ petit_rayon, interne_rayon-petit_rayon, externe_rayon-interne_rayon, grand_rayon-externe_rayon ]\r
+\r
+points = [ point_1, point_2, point_3, point_4, point_5, point_6, point_7, point_8, point_1 ]\r
+\r
+angles = []\r
+for i in xrange(8):\r
+  angle = calculer_angle(points[i], points[i+1])\r
+  angles.append(angle)\r
+\r
+hauteurs = [ grille_hauteur ]\r
+\r
+grille = doc.makeCylindricals(centre, grille_x, grille_z, rayons, angles, hauteurs, False)\r
+\r
+# Ajouter le centre\r
+# -----------------\r
+\r
+quad_0 = grille.getQuadJK(0, 7, 0)\r
+quad_6 = grille.getQuadJK(0, 0, 0)\r
+quad_7 = grille.getQuadJK(0, 1, 0)\r
+\r
+centre_a = doc.addHexa3Quads(quad_0, quad_6, quad_7)\r
+\r
+quad_2 = grille.getQuadJK(0, 3, 0)\r
+quad_3 = grille.getQuadJK(0, 4, 0)\r
+quad_4 = grille.getQuadJK(0, 5, 0)\r
+\r
+centre_b = doc.addHexa3Quads(quad_2, quad_3, quad_4)\r
+\r
+quad_1 = grille.getQuadJK(0, 2, 0)\r
+quad_5 = grille.getQuadJK(0, 6, 0)\r
+\r
+quad_a = centre_a.getQuad(1)\r
+quad_b = centre_b.getQuad(1)\r
+\r
+centre_c = doc.addHexa4Quads(quad_1, quad_a, quad_5, quad_b)\r
+\r
+# Ajouter l'enceinte\r
+# ------------------\r
+\r
+plan_0  = geompy.MakePrismDXDYDZ(p1_int_e, +cote_lgr, +cote_lgr, +cote_lgr)\r
+part_0  = geompy.MakePartition([piquage_1_feh], [plan_0], [], [], geompy.ShapeType["VERTEX"])\r
+point_0 = geompy.SubShapeAllSortedCentres(part_0, geompy.ShapeType["VERTEX"])[1]\r
+\r
+enceinte_quads = []\r
+for j in xrange(8):\r
+  q = grille.getQuadIJ(1, j, 1)\r
+  enceinte_quads.append(q)\r
+\r
+point_7x, point_7y, point_7z = geompy.PointCoordinates(point_7)\r
+point_2x, point_2y, point_2z = geompy.PointCoordinates(point_2)\r
+point_0x, point_0y, point_0z = geompy.PointCoordinates(point_0)\r
+\r
+enceinte_h1 = point_7z - base_z\r
+enceinte_h2 = point_2z - base_z\r
+enceinte_h3 = point_0z - base_z\r
+enceinte_h4 = oppo_z   - base_z\r
+\r
+enceinte_hauteurs = [ enceinte_h1, enceinte_h2, enceinte_h3, enceinte_h4 ]\r
+\r
+enceinte_pz = doc.addVector(oppo_x - base_x, oppo_y - base_y, enceinte_h4)\r
+\r
+enceinte = doc.prismQuadsVec(enceinte_quads, enceinte_pz, enceinte_hauteurs, 0)\r
+\r
+# Déconnecter via des arêtes, puis prismer, puis compléter (3) ou coller (1)\r
+# --------------------------------------------------------------------------\r
+\r
+periph_hexas     = []\r
+supports_quads_b = []\r
+supports_quads_h = []\r
+\r
+v1 = doc.addVector(   0, +0.1, 0)\r
+v2 = doc.addVector(   0, -0.1, 0)\r
+v3 = doc.addVector(+0.2, -0.1, 0)\r
+\r
+for j, v in [ [0, v1], [1, v1], [4, v2], [5, v3] ]:\r
+  h = grille.getHexaIJK(2, j, 0)\r
+  a = grille.getEdgeK(3, j, 0)\r
+  d = doc.disconnectEdge(h, a)\r
+\r
+  q1 = d.getQuad(0)\r
+  q2 = grille.getQuadIK(2, j, 0)\r
+  if j==1:\r
+    h0 = doc.addHexa2Quads(q1, q2)\r
+    q3 = grille.getQuadJK(3, j, 0)\r
+    q4 = h0.getQuad(3)\r
+    h1 = doc.addHexa2Quads(q3, q4)\r
+    qb = h1.getQuad(hexablock.Q_E)\r
+    qh = h1.getQuad(hexablock.Q_F)\r
+  else:\r
+    p = doc.prismQuad(q1, v, 2)\r
+\r
+    h0 = p.getHexa(0)\r
+    q3 = h0.getQuad(5)\r
+    h1 = p.getHexa(1)\r
+    q4 = h1.getQuad(5)\r
+    doc.addHexa3Quads(q2, q3, q4)\r
+    periph_hexas.append(h0)\r
+    qb = h1.getQuad(hexablock.Q_C)\r
+    qh = h1.getQuad(hexablock.Q_D)\r
+\r
+  supports_quads_b.append(qb)\r
+  supports_quads_h.append(qh)\r
+\r
+# Piquer les 2 tuyaux sur l'enceinte\r
+# ----------------------------------\r
+\r
+piquage_centre = doc.addVertex(10, 0, 0)\r
+\r
+piquage_vx = doc.addVector(1, 0, 0)\r
+piquage_vz = doc.addVector(0, 0, 1)\r
+\r
+piquage = doc.makeCylindrical(piquage_centre, piquage_vx, piquage_vz,  1, 360, 1,  1, 4, 1,  False)\r
+\r
+piquage_quads = [ piquage.getQuadIJ(0, j, 0) for j in xrange(4) ]\r
+\r
+piquage_s1 = piquage.getVertexIJK(1, 0, 0)\r
+piquage_s2 = piquage.getVertexIJK(1, 1, 0)\r
+piquage_s3 = piquage.getVertexIJK(1, 2, 0)\r
+\r
+enceinte_ha = enceinte.getHexa( 6)\r
+enceinte_hb = enceinte.getHexa(25)\r
+\r
+enceinte_s11 = enceinte_ha.getVertex(2)\r
+enceinte_s12 = enceinte_ha.getVertex(3)\r
+enceinte_s13 = enceinte_ha.getVertex(7)\r
+\r
+enceinte_s21 = enceinte_hb.getVertex(2)\r
+enceinte_s22 = enceinte_hb.getVertex(3)\r
+enceinte_s23 = enceinte_hb.getVertex(7)\r
+\r
+piquage_1 = doc.replace(piquage_quads, piquage_s1, enceinte_s11, piquage_s2, enceinte_s12, piquage_s3, enceinte_s13)\r
+piquage_2 = doc.replace(piquage_quads, piquage_s1, enceinte_s21, piquage_s2, enceinte_s22, piquage_s3, enceinte_s23)\r
+\r
+# Nettoyer le template du piquage\r
+# -------------------------------\r
+\r
+doc.removeElements(piquage)\r
+\r
+# Associer le modèle de blocs avec la géométrie\r
+# =============================================\r
+\r
+doc.setShape(cuve)\r
+\r
+# Nettoyer les associations implicites du centre et de la périphérie\r
+# ------------------------------------------------------------------\r
+\r
+for i in xrange(0, 4, 3):\r
+  for j in xrange(8):\r
+    for k in xrange(2):\r
+      e = grille.getEdgeJ(i, j, k)\r
+      e.clearAssociation()\r
+\r
+# Associer le centre de l'enceinte\r
+# --------------------------------\r
+\r
+for j, ig in [ [2, 30], [3, 28], [6, 32], [7, 34] ]:\r
+  sm0 = grille.getVertexIJK(0, j, 0)\r
+  sg0 = sommets[ig]\r
+  sm0.setAssociation(sg0)\r
+\r
+  sm1 = grille.getVertexIJK(0, j, 1)\r
+  sg1 = geompy.MakeTranslation(sg0, 0, 0, grille_hauteur)\r
+  sm1.setAssociation(sg1)\r
+\r
+for j, ig, sens in [ [0, 34, +1], [1, 30, +1], [4, 28, -1], [5, 32, -1] ]:\r
+  sm0 = grille.getVertexIJK(0, j, 0)\r
+  sg0 = geompy.MakeTranslation(sommets[ig], 0, sens*support_l, 0)\r
+  sm0.setAssociation(sg0)\r
+\r
+  sm1 = grille.getVertexIJK(0, j, 1)\r
+  sg1 = geompy.MakeTranslation(sg0, 0, 0, grille_hauteur)\r
+  sm1.setAssociation(sg1)\r
+\r
+# Associer les 16 sommets des 4 supports externes\r
+# -----------------------------------------------\r
+\r
+supports_points = [\r
+  [ support_c_o, support_c_y, support_c_d, support_c_x ],\r
+  [ support_d_d, support_d_y, support_d_o, support_d_x ],\r
+  [ support_a_o, support_a_y, support_a_d, support_a_x ],\r
+  [ support_b_o, support_b_x, support_b_d, support_b_y ]\r
+]\r
+\r
+for s in xrange(4):\r
+  qb = supports_quads_b[s]\r
+  qh = supports_quads_h[s]\r
+  cs = supports_points[s]\r
+  for i in xrange(4):\r
+    smb = qb.getVertex(i)\r
+    sgb = cs[i]\r
+    smb.setAssociation(sgb)\r
+\r
+    if s==1:\r
+      ind = i\r
+    else:\r
+      ind = [1, 0, 3, 2][i]\r
+    smh = qh.getVertex(ind)\r
+    sgh = geompy.MakeTranslation(sgb, 0, 0, grille_hauteur)\r
+    smh.setAssociation(sgh)\r
+\r
+# Associer les 7 sommets périphériques de la grille\r
+# -------------------------------------------------\r
+\r
+par_1 = 0.17\r
+par_2 = 1 - par_1\r
+\r
+periph_grille = [ [0, cote_b, par_2], [1, cote_c, 0.22], [3, cote_d, 0.548], [4, cote_d, par_1], [5, cote_a, par_2], [6, cote_b, 0.44], [7, cote_b, 0.555] ]\r
+\r
+for j, ag, p in periph_grille:\r
+  smb = grille.getVertexIJK(3, j, 1)\r
+  sgb = geompy.MakeVertexOnCurve(ag, p)\r
+  smb.setAssociation(sgb)\r
+\r
+  smh = grille.getVertexIJK(3, j, 0)\r
+  sgh = geompy.MakeTranslation(sgb, 0, 0, -grille_hauteur)\r
+  smh.setAssociation(sgh)\r
+\r
+# Associer les 3 sommets liés aux déconnections sur la grille\r
+# -----------------------------------------------------------\r
+\r
+periph_deco = [ [cote_c, par_2], [cote_a, par_1], [cote_b, par_1] ]\r
+\r
+for i in xrange(3):\r
+  hxa = periph_hexas[i]\r
+  ag, p = periph_deco[i]\r
+  smb = hxa.getVertex(2)\r
+  sgb = geompy.MakeVertexOnCurve(ag, p)\r
+  smb.setAssociation(sgb)\r
+\r
+  smh = hxa.getVertex(0)\r
+  sgh = geompy.MakeTranslation(sgb, 0, 0, -grille_hauteur)\r
+  smh.setAssociation(sgh)\r
+\r
+# Réparer les piquages\r
+# --------------------\r
+\r
+piquage_e_base  = geompy.MakeVertex(interne_x, interne_y, interne_z)\r
+piquage_e_axe   = geompy.MakeVectorDXDYDZ(interne_dx, interne_dy, interne_dz)\r
+piquage_e_cyl   = geompy.MakeCylinder(piquage_e_base, piquage_e_axe, interne_rayon, enceinte_h4)\r
+\r
+piquage_1_axe   = geompy.MakeVectorDXDYDZ(p1_int_dx, p1_int_dy, p1_int_dz)\r
+piquage_1_cyl   = geompy.MakeCylinder(p1_int_c, piquage_1_axe, p1_int_rayon, cote_lgr)\r
+\r
+piquage_2_axe   = geompy.MakeVectorDXDYDZ(p2_int_dx, p2_int_dy, p2_int_dz)\r
+piquage_2_cyl   = geompy.MakeCylinder(p2_int_c, piquage_2_axe, p2_int_rayon, cote_lgr)\r
+\r
+piquage_1_inter = geompy.SubShapeAllSortedCentres(geompy.MakeSection(piquage_e_cyl, piquage_1_cyl), geompy.ShapeType["EDGE"])\r
+piquage_2_inter = geompy.SubShapeAllSortedCentres(geompy.MakeSection(piquage_e_cyl, piquage_2_cyl), geompy.ShapeType["EDGE"])\r
+\r
+piquage_1_fi  = piquage_1_inter[0]\r
+\r
+piquage_2_fig = piquage_2_inter[0]\r
+piquage_2_fid = piquage_2_inter[1]\r
+\r
+# Associer les piquages\r
+# ---------------------\r
+\r
+piquages_devant = [\r
+  [ piquage_1, piquage_1_int, 0.375, piquage_1_ext, 0.125 ],\r
+  [ piquage_2, piquage_2_int, 0.125, piquage_2_ext, 0.875 ]\r
+]\r
+\r
+for m_piq, a_int, p_int, a_ext, p_ext in piquages_devant:\r
+\r
+  i1 = m_piq.getEdge(2)\r
+  i2 = m_piq.getEdge(5)\r
+  i3 = m_piq.getEdge(7)\r
+  i4 = m_piq.getEdge(10)\r
+\r
+  doc.associateClosedLine(i1.getVertex(1), i1, [ i2, i3, i4 ], a_int, p_int, True, [])\r
+\r
+  e1 = m_piq.getEdge(0)\r
+  e2 = m_piq.getEdge(1)\r
+  e3 = m_piq.getEdge(9)\r
+  e4 = m_piq.getEdge(11)\r
+\r
+  doc.associateClosedLine(e1.getVertex(0), e1, [ e2, e3, e4 ], a_ext, p_ext, False, [])\r
+\r
+piquages_milieu = [\r
+  [ piquage_1, piquage_1_eib, piquage_1_eih, 0.30, piquage_1_eeb, piquage_1_eeh, 0.30 ],\r
+  [ piquage_2, piquage_2_eid, piquage_2_eig, 0.75, piquage_2_eed, piquage_2_eeg, 0.75 ]\r
+]\r
+\r
+for m_piq, a_int1, a_int2, p_int, a_ext1, a_ext2, p_ext in piquages_milieu:\r
+\r
+  i1 = m_piq.getEdge(22)\r
+  i2 = m_piq.getEdge(25)\r
+  i3 = m_piq.getEdge(27)\r
+  i4 = m_piq.getEdge(30)\r
+\r
+  doc.associateClosedLine(i1.getVertex(0), i1, [ i4, i3, i2 ], a_int1, p_int, False, [a_int2])\r
+\r
+  e1 = m_piq.getEdge(20)\r
+  e2 = m_piq.getEdge(21)\r
+  e3 = m_piq.getEdge(29)\r
+  e4 = m_piq.getEdge(31)\r
+\r
+  doc.associateClosedLine(e1.getVertex(0), e1, [ e2, e3, e4 ], a_ext1, p_ext, False, [a_ext2])\r
+\r
+piquages_fond = [\r
+  [ piquage_1, piquage_1_fi , []             , 0.125, piquage_1_feb, piquage_1_feh, 0.30 ],\r
+  [ piquage_2, piquage_2_fid, [piquage_2_fig], 0.75 , piquage_2_fed, piquage_2_feg, 0.75 ]\r
+]\r
+\r
+for m_piq, a_int1, a_int2, p_int, a_ext1, a_ext2, p_ext in piquages_fond:\r
+\r
+  i1 = m_piq.getEdge(42)\r
+  i2 = m_piq.getEdge(45)\r
+  i3 = m_piq.getEdge(47)\r
+  i4 = m_piq.getEdge(50)\r
+\r
+  doc.associateClosedLine(i1.getVertex(0), i1, [ i4, i3, i2 ], a_int1, p_int, False, a_int2)\r
+\r
+  e1 = m_piq.getEdge(40)\r
+  e2 = m_piq.getEdge(41)\r
+  e3 = m_piq.getEdge(49)\r
+  e4 = m_piq.getEdge(51)\r
+\r
+  doc.associateClosedLine(e1.getVertex(1), e1, [ e2, e3, e4 ], a_ext1, p_ext, False, [a_ext2])\r
+\r
+# Associer quelques faces\r
+# -----------------------\r
+\r
+for h in [ 2, 5, 7, 10,  21, 24, 26, 29 ]:\r
+  enceinte_hc = enceinte.getHexa(h)\r
+\r
+  enceinte_qc = enceinte_hc.getQuad(hexablock.Q_C)\r
+  enceinte_qc.addAssociation(face_cylindrique_int)\r
+\r
+  enceinte_qc = enceinte_hc.getQuad(hexablock.Q_D)\r
+  enceinte_qc.addAssociation(face_cylindrique_ext)\r
+\r
+# Primer les 5 supports (finalisation du modèle de blocs)\r
+# -------------------------------------------------------\r
+\r
+supports_quads_b.append( centre_c.getQuad(hexablock.Q_E) )\r
+\r
+supports_z = doc.addVector(coin_x1 - coin_x3, coin_y1 - coin_y3, coin_z1 - coin_z3)\r
+\r
+supports = doc.prismQuads(supports_quads_b, supports_z, 1)\r
+\r
+# Mailler le modèle de blocs\r
+# ==========================\r
+\r
+# Définir les groupes volumiques\r
+# ------------------------------\r
+\r
+groupe_fd = doc.addHexaGroup("fond")\r
+groupe_en = doc.addHexaGroup("enceinte")\r
+groupe_p1 = doc.addHexaGroup("piquage:1")\r
+groupe_p2 = doc.addHexaGroup("piquage:2")\r
+groupe_su = doc.addHexaGroup("supports")\r
+\r
+for i in xrange( doc.countUsedHexa() ):\r
+  h = doc.getUsedHexa(i)\r
+  groupe_fd.addElement(h)\r
+\r
+for i in xrange( enceinte.countHexa() ):\r
+  h = enceinte.getHexa(i)\r
+  if h != None:\r
+    groupe_en.addElement(h)\r
+    groupe_fd.removeElement(h)\r
+\r
+for i in xrange( piquage_1.countHexa() ):\r
+  h = piquage_1.getHexa(i)\r
+  groupe_p1.addElement(h)\r
+  groupe_fd.removeElement(h)\r
+\r
+for i in xrange( piquage_2.countHexa() ):\r
+  h = piquage_2.getHexa(i)\r
+  groupe_p2.addElement(h)\r
+  groupe_fd.removeElement(h)\r
+\r
+for i in xrange( supports.countHexa() ):\r
+  h = supports.getHexa(i)\r
+  groupe_su.addElement(h)\r
+  groupe_fd.removeElement(h)\r
+\r
+# Générer le maillage\r
+# -------------------\r
+\r
+hexablock.addLaws(doc, 0.015, False)\r
+\r
+maillage = hexablock.mesh(doc)\r
+\r
+muv, mue, muq, muh = hexablock.dump(doc, maillage)\r
+\r
diff --git a/src/TEST_PY/test_BIELLE_bad_assoc.py b/src/TEST_PY/test_BIELLE_bad_assoc.py
deleted file mode 100755 (executable)
index 507389a..0000000
+++ /dev/null
@@ -1,1081 +0,0 @@
-# -*- coding: latin-1 -*-
-# Copyright (C) 2009-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
-#
-
-#===============================================
-# By Karima DEBCHI YATAGHENE Nov 2009 at CS 
-#===============================================
-
-
-import os
-import GEOM
-import geompy
-import smesh
-import hexablock
-import math
-import SALOMEDS
-
-
-STEP_PATH = os.path.expandvars("$HEXA_ROOT_DIR/bin/salome/crank.stp")
-
-
-#=============================
-# CREATION DOCUMENT
-#=============================
-
-doc = hexablock.addDocument("default")
-
-#=============================
-# CREATION DU MODELE
-#=============================
-
-# Pour la bielle on doit creer deux grilles cylindriques et prismer les quadrangles entre ces deux dernieres
-
-#=============================
-# PARAMETRES
-#=============================
-
-R = 40.0
-
-r_grd = R
-r_grd_t = R/2
-
-r_pte = R
-r_pte_t = R/2
-
-l = 200.0
-h = 0.019999999553*2
-#h = 40.
-
-# Taille du grand cylindre
-dr_grd = R
-da_grd = 360
-dl_grd = h
-
-nr_grd = 1
-na_grd = 6
-nl_grd = 1
-
-# Taille du petit cylindre
-dr_pte = R
-da_pte = 360
-dl_pte = h
-
-nr_pte = 1
-na_pte = 6
-nl_pte = 1
-
-
-#=============================
-# Creation des vecteurs
-#=============================
-
-dx = doc.addVector(l, 0, 0)
-dy = doc.addVector(0, l, 0)
-dz = doc.addVector(0, 0, l)
-
-#=================================================
-# Creation des centres des grilles cylindriques
-#=================================================
-
-c_grd = doc.addVertex(0, 0, 0)
-c_pte = doc.addVertex(2*l, 0, 0)
-dx_prime = doc.addVectorVertices( c_grd, c_pte )
-
-#=================================================
-# Creation de la grande grille cylindrique
-#=================================================
-
-grille_cyl_grd = doc.makeCylindrical(c_grd, dx, dz, dr_grd, da_grd, dl_grd, nr_grd, na_grd, nl_grd, False)
-
-# on obtient une liste qui contient 6 hexaedres eguaux
-
-# 30 = pi/6
-# 60 = pi/3
-# 45 = pi/4
-# 90 = pi/2
-# 180 = pi
-
-alpha_x = 2*R*math.cos(math.pi/3)
-alpha_y = 2*R*math.sin(math.pi/3)
-
-x1 = doc.findVertex( 2*R, 0, h )
-x2 = doc.findVertex( alpha_x, alpha_y, 0 )
-x3 = doc.findVertex( alpha_x, -alpha_y, 0 )
-x4 = doc.findVertex( 2*R, 0, 0 )
-
-quad_11 = doc.findQuad(x1, x2)
-quad_12 = doc.findQuad(x1, x3)
-
-quad_list = [ quad_11 , quad_12 ]
-
-#=================================================
-# Creation de la petite grille cylindrique
-#=================================================
-
-grille_cyl_pte = doc.makeTranslation( grille_cyl_grd , dx_prime )
-
-# on obtient une liste qui contient 6 hexaedres eguaux
-
-y1 = doc.findVertex( 2*l - 2*R , 0 , h )
-y2 = doc.findVertex( 2*l - alpha_x , alpha_y , 0 )
-y3 = doc.findVertex( 2*l - alpha_x , -alpha_y , 0 )
-y4 = doc.findVertex( 2*l - 2*R , 0 , 0 )
-
-quad_21 = doc.findQuad(y1, y2)
-quad_22 = doc.findQuad(y1, y3)
-
-#=================================================
-# Assemblage des deux grilles cylindriques
-#=================================================
-model_biell_fin = doc.joinQuads( quad_list , quad_21 , x1 , y1 , x4 , y4 , 1 )
-
-
-#===================================================================
-# Recuperation des vertex du model hexa bielle pour l association
-#===================================================================
-
-# NB:
-# h = haut
-# b = bas
-# g = grand
-# p = petit
-# t = trou
-
-alpha_x = 2*R*math.cos(math.pi/3)
-alpha_y = 2*R*math.sin(math.pi/3)
-
-# Face du haut grand trou
-
-## RQ:On remplace la fonction findVertex par getVertexIJK
-
-v_mod_h_g = grille_cyl_grd.getVertexIJK( 1 , 0 , 1 )
-w_mod_h_g = grille_cyl_grd.getVertexIJK( 1 , 1 , 1 )
-z_mod_h_g = grille_cyl_grd.getVertexIJK( 1 , 2 , 1 )
-
-y_mod_h_g = grille_cyl_grd.getVertexIJK( 1 , 3 , 1 )
-x_mod_h_g = grille_cyl_grd.getVertexIJK( 1 , 4 , 1 )
-u_mod_h_g = grille_cyl_grd.getVertexIJK( 1 , 5 , 1 )
-
-v_mod_h_g_t = grille_cyl_grd.getVertexIJK( 0 , 0 , 1 )
-w_mod_h_g_t = grille_cyl_grd.getVertexIJK( 0 , 1 , 1 )
-z_mod_h_g_t = grille_cyl_grd.getVertexIJK( 0 , 2 , 1 )
-
-y_mod_h_g_t = grille_cyl_grd.getVertexIJK( 0 , 3 , 1 )
-x_mod_h_g_t = grille_cyl_grd.getVertexIJK( 0 , 4 , 1 )
-u_mod_h_g_t = grille_cyl_grd.getVertexIJK( 0 , 5 , 1 )
-
-#----------- 
-#x_mod_h_g = doc.findVertex( -alpha_x , -alpha_y , h )
-#y_mod_h_g = doc.findVertex( -alpha_x , 0 , h )
-#z_mod_h_g = doc.findVertex( -alpha_x , alpha_y , h )
-
-#u_mod_h_g = doc.findVertex( alpha_x , -alpha_y , h )
-#v_mod_h_g = doc.findVertex( alpha_x , 0 , h )
-#w_mod_h_g = doc.findVertex( alpha_x , alpha_y , h )
-
-#x_mod_h_g_t = doc.findVertex( -alpha_x/2 , -alpha_y/2 , h )
-#y_mod_h_g_t = doc.findVertex( -alpha_x/2 , 0 , h )
-#z_mod_h_g_t = doc.findVertex( -alpha_x/2 , alpha_y/2 , h )
-
-#u_mod_h_g_t = doc.findVertex( alpha_x/2 , -alpha_y/2 , h )
-#v_mod_h_g_t = doc.findVertex( alpha_x/2 , 0 , h )
-#w_mod_h_g_t = doc.findVertex( alpha_x/2 , alpha_y/2 , h )
-#-----------
-
-assert x_mod_h_g
-assert y_mod_h_g
-assert z_mod_h_g
-
-assert u_mod_h_g
-assert v_mod_h_g
-assert w_mod_h_g
-
-assert x_mod_h_g_t
-assert y_mod_h_g_t #
-assert z_mod_h_g_t
-
-assert u_mod_h_g_t #
-assert v_mod_h_g_t
-assert w_mod_h_g_t #
-
-
-# Face du haut petit trou
-
-## RQ:On remplace la fonction findVertex par getVertexIJK
-v_mod_h_p = grille_cyl_pte.getVertexIJK( 1 , 0 , 1 )
-w_mod_h_p = grille_cyl_pte.getVertexIJK( 1 , 1 , 1 )
-z_mod_h_p = grille_cyl_pte.getVertexIJK( 1 , 2 , 1 )
-
-y_mod_h_p = grille_cyl_pte.getVertexIJK( 1 , 3 , 1 )
-x_mod_h_p = grille_cyl_pte.getVertexIJK( 1 , 4 , 1 )
-u_mod_h_p = grille_cyl_pte.getVertexIJK( 1 , 5 , 1 )
-
-v_mod_h_p_t = grille_cyl_pte.getVertexIJK( 0 , 0 , 1 )
-w_mod_h_p_t = grille_cyl_pte.getVertexIJK( 0 , 1 , 1 )
-z_mod_h_p_t = grille_cyl_pte.getVertexIJK( 0 , 2 , 1 )
-
-y_mod_h_p_t = grille_cyl_pte.getVertexIJK( 0 , 3 , 1 )
-x_mod_h_p_t = grille_cyl_pte.getVertexIJK( 0 , 4 , 1 )
-u_mod_h_p_t = grille_cyl_pte.getVertexIJK( 0 , 5 , 1 )
-
-
-#-----------
-#x_mod_h_p = doc.findVertex( l + alpha_x , -alpha_y , h )
-#y_mod_h_p = doc.findVertex( l + alpha_x , 0 , h )
-#z_mod_h_p = doc.findVertex( l + alpha_x , alpha_y , h )
-
-#u_mod_h_p = doc.findVertex( l - alpha_x , -alpha_y , h )
-#v_mod_h_p = doc.findVertex( l - alpha_x , 0 , h )
-#w_mod_h_p = doc.findVertex( l - alpha_x , alpha_y , h )
-
-#x_mod_h_p_t = doc.findVertex( l + (alpha_x/2) , -alpha_y/2 , h )
-#y_mod_h_p_t = doc.findVertex( l + (alpha_x/2) , 0 , h )
-#z_mod_h_p_t = doc.findVertex( l + (alpha_x/2) , alpha_y/2 , h )
-
-#u_mod_h_p_t = doc.findVertex( l - (alpha_x/2) , -alpha_y/2 , h )
-#v_mod_h_p_t = doc.findVertex( l - (alpha_x/2) , 0 , h )
-#w_mod_h_p_t = doc.findVertex( l - (alpha_x/2) , alpha_y/2 , h )
-#-----------
-
-#-----------
-assert x_mod_h_p
-assert y_mod_h_p
-assert z_mod_h_p
-
-assert u_mod_h_p
-assert v_mod_h_p
-assert w_mod_h_p
-
-assert x_mod_h_p_t
-assert y_mod_h_p_t
-assert z_mod_h_p_t
-
-assert u_mod_h_p_t
-assert v_mod_h_p_t
-assert w_mod_h_p_t
-#-----------
-
-# Face du bas grand trou
-
-## RQ:On remplace la fonction findVertex par getVertexIJK
-
-v_mod_b_g = grille_cyl_grd.getVertexIJK( 1 , 0 , 0 )
-w_mod_b_g = grille_cyl_grd.getVertexIJK( 1 , 1 , 0 )
-z_mod_b_g = grille_cyl_grd.getVertexIJK( 1 , 2 , 0 )
-
-y_mod_b_g = grille_cyl_grd.getVertexIJK( 1 , 3 , 0 )
-x_mod_b_g = grille_cyl_grd.getVertexIJK( 1 , 4 , 0 )
-u_mod_b_g = grille_cyl_grd.getVertexIJK( 1 , 5 , 0 )
-
-v_mod_b_g_t = grille_cyl_grd.getVertexIJK( 0 , 0 , 0 )
-w_mod_b_g_t = grille_cyl_grd.getVertexIJK( 0 , 1 , 0 )
-z_mod_b_g_t = grille_cyl_grd.getVertexIJK( 0 , 2 , 0 )
-
-y_mod_b_g_t = grille_cyl_grd.getVertexIJK( 0 , 3 , 0 )
-x_mod_b_g_t = grille_cyl_grd.getVertexIJK( 0 , 4 , 0 )
-u_mod_b_g_t = grille_cyl_grd.getVertexIJK( 0 , 5 , 0 )
-
-#-----------
-#x_mod_b_g = doc.findVertex( -alpha_x , -alpha_y , 0 )
-#y_mod_b_g = doc.findVertex( -alpha_x , 0 , 0 )
-#z_mod_b_g = doc.findVertex( -alpha_x , alpha_y , 0 )
-
-#u_mod_b_g = doc.findVertex( alpha_x , -alpha_y , 0 )
-#v_mod_b_g = doc.findVertex( alpha_x , 0 , 0 )
-#w_mod_b_g = doc.findVertex( alpha_x , alpha_y , 0 )
-
-#x_mod_b_g_t = doc.findVertex( -alpha_x/2 , -alpha_y/2 , 0 )
-#y_mod_b_g_t = doc.findVertex( -alpha_x/2 , 0 , 0 )
-#z_mod_b_g_t = doc.findVertex( -alpha_x/2 , alpha_y/2 , 0 )
-
-#u_mod_b_g_t = doc.findVertex( alpha_x/2 , -alpha_y/2 , 0 )
-#v_mod_b_g_t = doc.findVertex( alpha_x/2 , 0 , 0 )
-#w_mod_b_g_t = doc.findVertex( alpha_x/2 , alpha_y/2 , 0 )
-#-----------
-
-assert x_mod_b_g
-assert y_mod_b_g
-assert z_mod_b_g
-
-assert u_mod_b_g
-assert v_mod_b_g
-assert w_mod_b_g
-
-assert x_mod_b_g_t
-assert y_mod_b_g_t
-assert z_mod_b_g_t
-
-assert u_mod_b_g_t
-assert v_mod_b_g_t
-assert w_mod_b_g_t
-
-
-# Face du bas petit trou
-
-
-## RQ:On remplace la fonction findVertex par getVertexIJK
-
-v_mod_b_p = grille_cyl_pte.getVertexIJK( 1 , 0 , 0 )
-w_mod_b_p = grille_cyl_pte.getVertexIJK( 1 , 1 , 0 )
-z_mod_b_p = grille_cyl_pte.getVertexIJK( 1 , 2 , 0 )
-
-y_mod_b_p = grille_cyl_pte.getVertexIJK( 1 , 3 , 0 )
-x_mod_b_p = grille_cyl_pte.getVertexIJK( 1 , 4 , 0 )
-u_mod_b_p = grille_cyl_pte.getVertexIJK( 1 , 5 , 0 )
-
-v_mod_b_p_t = grille_cyl_pte.getVertexIJK( 0 , 0 , 0 )
-w_mod_b_p_t = grille_cyl_pte.getVertexIJK( 0 , 1 , 0 )
-z_mod_b_p_t = grille_cyl_pte.getVertexIJK( 0 , 2 , 0 )
-
-y_mod_b_p_t = grille_cyl_pte.getVertexIJK( 0 , 3 , 0 )
-x_mod_b_p_t = grille_cyl_pte.getVertexIJK( 0 , 4 , 0 )
-u_mod_b_p_t = grille_cyl_pte.getVertexIJK( 0 , 5 , 0 )
-
-
-#-----------
-#x_mod_b_p = doc.findVertex( l + alpha_x , -alpha_y , 0 )
-#y_mod_b_p = doc.findVertex( l + alpha_x , 0 , 0 )
-#z_mod_b_p = doc.findVertex( l + alpha_x , alpha_y , 0 )
-
-#u_mod_b_p = doc.findVertex( l - alpha_x , -alpha_y , 0 )
-#v_mod_b_p = doc.findVertex( l - alpha_x , 0 , 0 )
-#w_mod_b_p = doc.findVertex( l - alpha_x , alpha_y , 0 )
-
-#x_mod_b_p_t = doc.findVertex( l + (alpha_x/2) , -alpha_y/2 , 0 )
-#y_mod_b_p_t = doc.findVertex( l + (alpha_x/2) , 0 , 0 )
-#z_mod_b_p_t = doc.findVertex( l + (alpha_x/2) , alpha_y/2 , 0 )
-
-#u_mod_b_p_t = doc.findVertex( l - (alpha_x/2) , -alpha_y/2 , 0 )
-#v_mod_b_p_t = doc.findVertex( l - (alpha_x/2) , 0 , 0 )
-#w_mod_b_p_t = doc.findVertex( l - (alpha_x/2) , alpha_y/2 , 0 )
-#-----------
-
-#-----------
-assert x_mod_b_p
-assert y_mod_b_p
-assert z_mod_b_p
-
-assert u_mod_b_p
-assert v_mod_b_p
-assert w_mod_b_p
-
-assert x_mod_b_p_t
-assert y_mod_b_p_t
-assert z_mod_b_p_t
-
-assert u_mod_b_p_t
-assert v_mod_b_p_t
-assert w_mod_b_p_t
-#-----------
-
-
-
-#===================================================================
-# Recuperation des points de la geometrie bielle pour l association
-#===================================================================
-Bielle_geom = geompy.Import(STEP_PATH, "STEP")
-
-geompy.addToStudy(Bielle_geom, "Bielle_geom")
-
-Pt_A = geompy.MakeVertex(0, 0, h/2.)
-Face_haut = geompy.GetFaceNearPoint(Bielle_geom, Pt_A)
-
-
-Pt_B = geompy.MakeVertex(0, 0, -h/2.)
-Face_bas = geompy.GetFaceNearPoint(Bielle_geom, Pt_B)
-
-
-# NB:
-# h = haut
-# b = bas
-# g = grand
-# p = petit
-# t = trou
-
-
-y_h_g = geompy.MakeVertexOnSurface(Face_haut, 1, 0.5)
-geompy.addToStudy( y_h_g , "y_h_g" )
-y_b_g = geompy.MakeVertexWithRef(y_h_g, 0, 0, -h)
-geompy.addToStudy( y_b_g , "y_b_g" )
-
-v_h_p = geompy.MakeVertexOnSurface(Face_haut, 0, 0.5)
-geompy.addToStudy( v_h_p , "v_h_p" )
-v_b_p = geompy.MakeVertexWithRef(v_h_p, 0, 0, -h)
-geompy.addToStudy( v_b_p , "v_b_p" )
-
-Edge_haut_grd = geompy.GetEdgeNearPoint(Bielle_geom, y_h_g)
-Edge_haut_pte = geompy.GetEdgeNearPoint(Bielle_geom, v_h_p)
-
-
-
-x_h_g = geompy.MakeVertexOnCurve(Edge_haut_grd, 0)
-geompy.addToStudy( x_h_g , "x_h_g" )
-x_b_g = geompy.MakeVertexWithRef(x_h_g, 0, 0, -h)
-geompy.addToStudy( x_b_g , "x_b_g" )
-
-z_h_g = geompy.MakeVertexOnCurve(Edge_haut_grd, 1)
-geompy.addToStudy( z_h_g , "z_h_g" )
-z_b_g = geompy.MakeVertexWithRef(z_h_g, 0, 0, -h)
-geompy.addToStudy( z_b_g , "z_b_g" )
-
-w_h_p = geompy.MakeVertexOnCurve(Edge_haut_pte, 0)
-geompy.addToStudy( w_h_p , "w_h_p" )
-w_b_p = geompy.MakeVertexWithRef(w_h_p, 0, 0, -h)
-geompy.addToStudy( w_b_p , "w_b_p" )
-
-u_h_p = geompy.MakeVertexOnCurve(Edge_haut_pte, 1)
-geompy.addToStudy( u_h_p , "u_h_p" )
-u_b_p = geompy.MakeVertexWithRef(u_h_p, 0, 0, -h)
-geompy.addToStudy( u_b_p , "u_b_p" )
-
-
-
-Edge_haut_grd_trou = geompy.GetEdgesByLength(Face_haut, 0.147, 0.148)
-
-
-
-y_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0)
-geompy.addToStudy(y_h_g_t, "y_h_g_t")
-y_b_g_t = geompy.MakeVertexWithRef(y_h_g_t, 0, 0, -h)
-geompy.addToStudy(y_b_g_t, "y_b_g_t")
-
-z_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0.2)
-geompy.addToStudy(z_h_g_t, "z_h_g_t")
-z_b_g_t = geompy.MakeVertexWithRef(z_h_g_t, 0, 0, -h)
-geompy.addToStudy(z_b_g_t, "z_b_g_t")
-
-w_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0.35)
-geompy.addToStudy(w_h_g_t, "w_h_g_t")
-w_b_g_t = geompy.MakeVertexWithRef(w_h_g_t, 0, 0, -h)
-geompy.addToStudy(w_b_g_t, "w_b_g_t")
-
-v_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0.5)
-geompy.addToStudy(v_h_g_t, "v_h_g_t")
-v_b_g_t = geompy.MakeVertexWithRef(v_h_g_t, 0, 0, -h)
-geompy.addToStudy(v_b_g_t, "v_b_g_t")
-
-u_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0.65)
-geompy.addToStudy(u_h_g_t, "u_h_g_t")
-u_b_g_t = geompy.MakeVertexWithRef(u_h_g_t, 0, 0, -h)
-geompy.addToStudy(u_b_g_t, "u_b_g_t")
-
-x_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0.8)
-geompy.addToStudy(x_h_g_t, "x_h_g_t")
-x_b_g_t = geompy.MakeVertexWithRef(x_h_g_t, 0, 0, -h)
-geompy.addToStudy(x_b_g_t, "x_b_g_t")
-
-
-
-Edge_haut_pte_trou = geompy.GetEdgesByLength(Face_haut, 0.094, 0.095)
-
-y_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0)
-geompy.addToStudy(y_h_p_t, "y_h_p_t")
-y_b_p_t = geompy.MakeVertexWithRef(y_h_p_t, 0, 0, -h)
-geompy.addToStudy(y_b_p_t, "y_b_p_t")
-
-z_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0.2)
-geompy.addToStudy(z_h_p_t, "z_h_p_t")
-z_b_p_t = geompy.MakeVertexWithRef(z_h_p_t, 0, 0, -h)
-geompy.addToStudy(z_b_p_t, "z_b_p_t")
-
-w_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0.35)
-geompy.addToStudy(w_h_p_t, "w_h_p_t")
-w_b_p_t = geompy.MakeVertexWithRef(w_h_p_t, 0, 0, -h)
-geompy.addToStudy(w_b_p_t, "w_b_p_t")
-
-v_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0.5)
-geompy.addToStudy(v_h_p_t, "v_h_p_t")
-v_b_p_t = geompy.MakeVertexWithRef(v_h_p_t, 0, 0, -h)
-geompy.addToStudy(v_b_p_t, "v_b_p_t")
-
-u_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0.65)
-geompy.addToStudy(u_h_p_t, "u_h_p_t")
-u_b_p_t = geompy.MakeVertexWithRef(u_h_p_t, 0, 0, -h)
-geompy.addToStudy(u_b_p_t, "u_b_p_t")
-
-x_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0.8)
-geompy.addToStudy(x_h_p_t, "x_h_p_t")
-x_b_p_t = geompy.MakeVertexWithRef(x_h_p_t, 0, 0, -h)
-geompy.addToStudy(x_b_p_t, "x_b_p_t")
-
-
-
-Edge_haut_droite = geompy.GetEdgesByLength(Face_haut, 0.136, 0.137)
-
-u_h_g = geompy.MakeVertexOnCurve(Edge_haut_droite, 1)
-geompy.addToStudy(u_h_g, "u_h_g")
-
-u_b_g = geompy.MakeVertexWithRef(u_h_g, 0, 0, -h)
-geompy.addToStudy(u_b_g, "u_b_g")
-
-x_h_p = geompy.MakeVertexOnCurve(Edge_haut_droite, 0)
-geompy.addToStudy(x_h_p, "x_h_p")
-x_b_p = geompy.MakeVertexWithRef(x_h_p, 0, 0, -h)
-geompy.addToStudy(x_b_p, "x_b_p")
-
-
-Edge_haut_gauche = geompy.GetEdgesByLength(Face_haut, 0.131, 0.132)
-
-w_h_g = geompy.MakeVertexOnCurve(Edge_haut_gauche, 0)
-geompy.addToStudy(w_h_g, "w_h_g")
-
-w_b_g = geompy.MakeVertexWithRef(w_h_g, 0, 0, -h)
-geompy.addToStudy(w_b_g, "w_b_g")
-
-z_h_p = geompy.MakeVertexOnCurve(Edge_haut_gauche, 1)
-geompy.addToStudy(z_h_p, "z_h_p")
-z_b_p = geompy.MakeVertexWithRef(z_h_p, 0, 0, -h)
-geompy.addToStudy(z_b_p, "z_b_p")
-
-Edge_v_grd = geompy.MakeLineTwoPnt(u_h_g, w_h_g)
-
-v_h_g = geompy.MakeVertexOnCurve(Edge_v_grd, 0.5)
-geompy.addToStudy(v_h_g, "v_h_g")
-v_b_g = geompy.MakeVertexWithRef(v_h_g, 0, 0, -h)
-geompy.addToStudy(v_b_g, "v_b_g")
-
-
-Edge_v_pte = geompy.MakeLineTwoPnt(x_h_p, z_h_p)
-
-y_h_p = geompy.MakeVertexOnCurve(Edge_v_pte, 0.5)
-geompy.addToStudy(y_h_p, "y_h_p")
-y_b_p = geompy.MakeVertexWithRef(y_h_p, 0, 0, -h)
-geompy.addToStudy(y_b_p, "y_b_p")
-
-
-#=======================
-# CREATION ASSOCIATION
-#=======================
-
-#===========================================
-# association des sommets de la face du haut
-#===========================================
-
-# grand trou
-
-x_mod_h_g.setAssociation( x_h_g )
-y_mod_h_g.setAssociation( y_h_g )
-z_mod_h_g.setAssociation( z_h_g )
-u_mod_h_g.setAssociation( u_h_g )
-v_mod_h_g.setAssociation( v_h_g )
-w_mod_h_g.setAssociation( w_h_g )
-
-x_mod_h_g_t.setAssociation( x_h_g_t )
-y_mod_h_g_t.setAssociation( y_h_g_t )
-z_mod_h_g_t.setAssociation( z_h_g_t )
-u_mod_h_g_t.setAssociation( u_h_g_t )
-v_mod_h_g_t.setAssociation( v_h_g_t )
-w_mod_h_g_t.setAssociation( w_h_g_t )
-
-# petit trou
-
-x_mod_h_p.setAssociation( x_h_p )
-y_mod_h_p.setAssociation( y_h_p )
-z_mod_h_p.setAssociation( z_h_p )
-u_mod_h_p.setAssociation( u_h_p )
-v_mod_h_p.setAssociation( v_h_p )
-w_mod_h_p.setAssociation( w_h_p )
-
-x_mod_h_p_t.setAssociation( x_h_p_t )
-y_mod_h_p_t.setAssociation( y_h_p_t )
-z_mod_h_p_t.setAssociation( z_h_p_t )
-u_mod_h_p_t.setAssociation( u_h_p_t )
-v_mod_h_p_t.setAssociation( v_h_p_t )
-w_mod_h_p_t.setAssociation( w_h_p_t )
-
-
-#===========================================
-# association des sommets de la face du bas
-#===========================================
-
-# grand trou
-
-x_mod_b_g.setAssociation( x_b_g )
-y_mod_b_g.setAssociation( y_b_g )
-z_mod_b_g.setAssociation( z_b_g )
-u_mod_b_g.setAssociation( u_b_g )
-v_mod_b_g.setAssociation( v_b_g )
-w_mod_b_g.setAssociation( w_b_g )
-
-x_mod_b_g_t.setAssociation( x_b_g_t )
-y_mod_b_g_t.setAssociation( y_b_g_t )
-z_mod_b_g_t.setAssociation( z_b_g_t )
-u_mod_b_g_t.setAssociation( u_b_g_t )
-v_mod_b_g_t.setAssociation( v_b_g_t )
-w_mod_b_g_t.setAssociation( w_b_g_t )
-
-# petit trou
-
-x_mod_b_p.setAssociation( x_b_p )
-y_mod_b_p.setAssociation( y_b_p )
-z_mod_b_p.setAssociation( z_b_p )
-u_mod_b_p.setAssociation( u_b_p )
-v_mod_b_p.setAssociation( v_b_p )
-w_mod_b_p.setAssociation( w_b_p )
-
-x_mod_b_p_t.setAssociation( x_b_p_t )
-y_mod_b_p_t.setAssociation( y_b_p_t )
-z_mod_b_p_t.setAssociation( z_b_p_t )
-u_mod_b_p_t.setAssociation( u_b_p_t )
-v_mod_b_p_t.setAssociation( v_b_p_t )
-w_mod_b_p_t.setAssociation( w_b_p_t )
-
-
-
-
-#=================================
-# Creation association des edges
-#=================================
-
-
-All_Edges_Bielle = geompy.SubShapeAllSorted(Bielle_geom, geompy.ShapeType["EDGE"])
-
-## recuperer les arrondies du haut de la geometrie
-
-Edge_Arr_grd_g_h = All_Edges_Bielle[20]
-geompy.addToStudy( Edge_Arr_grd_g_h , "Edge_Arr_grd_g_h" )
-
-Edge_Arr_grd_g_h_mod = grille_cyl_grd.getEdgeJ( 1 , 1 , 1 )
-Edge_Arr_grd_g_h_mod.addAssociation( Edge_Arr_grd_g_h, 0., 1. )
-
-
-Edge_Arr_grd_d_h = All_Edges_Bielle[22]
-geompy.addToStudy( Edge_Arr_grd_d_h , "Edge_Arr_grd_d_h" )
-
-Edge_Arr_grd_d_h_mod = grille_cyl_grd.getEdgeJ( 1 , 4 , 1 )
-Edge_Arr_grd_d_h_mod.addAssociation( Edge_Arr_grd_d_h, 0., 1. )
-
-
-Edge_Arr_pte_g_h = All_Edges_Bielle[8]
-geompy.addToStudy( Edge_Arr_pte_g_h , "Edge_Arr_pte_g_h" )
-
-Edge_Arr_pte_g_h_mod = grille_cyl_pte.getEdgeJ( 1 , 1 , 1 )
-Edge_Arr_pte_g_h_mod.addAssociation( Edge_Arr_pte_g_h, 0., 1. )
-
-Edge_Arr_pte_d_h = All_Edges_Bielle[10]
-geompy.addToStudy( Edge_Arr_pte_d_h , "Edge_Arr_pte_d_h" )
-
-Edge_Arr_pte_d_h_mod = grille_cyl_pte.getEdgeJ( 1 , 4 , 1 )
-Edge_Arr_pte_d_h_mod.addAssociation( Edge_Arr_pte_d_h, 0., 1. )
-
-# recuperer les arrondies du bas de la geometrie
-
-Edge_Arr_grd_g_b = All_Edges_Bielle[19]
-geompy.addToStudy( Edge_Arr_grd_g_b , "Edge_Arr_grd_g_b" )
-
-Edge_Arr_grd_g_b_mod = grille_cyl_grd.getEdgeJ( 1 , 1 , 0 )
-Edge_Arr_grd_g_b_mod.addAssociation( Edge_Arr_grd_g_b, 0., 1. )
-
-Edge_Arr_grd_d_b = All_Edges_Bielle[21]
-geompy.addToStudy( Edge_Arr_grd_d_b , "Edge_Arr_grd_d_b" )
-
-Edge_Arr_grd_d_b_mod = grille_cyl_grd.getEdgeJ( 1 , 4 , 0 )
-Edge_Arr_grd_d_b_mod.addAssociation( Edge_Arr_grd_d_b, 0., 1. )
-
-Edge_Arr_pte_g_b = All_Edges_Bielle[7]
-geompy.addToStudy( Edge_Arr_pte_g_b , "Edge_Arr_pte_g_b" )
-
-Edge_Arr_pte_g_b_mod = grille_cyl_pte.getEdgeJ( 1 , 1 , 0 )
-Edge_Arr_pte_g_b_mod.addAssociation( Edge_Arr_pte_g_b, 0., 1. )
-
-Edge_Arr_pte_d_b = All_Edges_Bielle[9]
-geompy.addToStudy( Edge_Arr_pte_d_b , "Edge_Arr_pte_d_b" )
-
-Edge_Arr_pte_d_b_mod = grille_cyl_pte.getEdgeJ( 1 , 4 , 0 )
-Edge_Arr_pte_d_b_mod.addAssociation( Edge_Arr_pte_d_b, 0., 1. )
-
-
-# recuperer les grand rayons de la geometrie
-
-Edge_Ray_grd_g_h = All_Edges_Bielle[28]
-geompy.addToStudy( Edge_Ray_grd_g_h , "Edge_Ray_grd_g_h" )
-Edge_Ray_grd_d_h = All_Edges_Bielle[1]
-geompy.addToStudy( Edge_Ray_grd_d_h , "Edge_Ray_grd_d_h" )
-
-Edge_Ray_grd_g_b = All_Edges_Bielle[27]
-geompy.addToStudy( Edge_Ray_grd_g_b , "Edge_Ray_grd_g_b" )
-Edge_Ray_grd_d_b = All_Edges_Bielle[0]
-geompy.addToStudy( Edge_Ray_grd_d_b , "Edge_Ray_grd_d_b" )
-
-
-
-X_pln1 = geompy.MakeVertex( 0 , 0 , 0 )
-Vec_X = geompy.MakeVectorDXDYDZ( 0 , 1 , 0 )
-Plan1 = geompy.MakePlane( X_pln1 , Vec_X , 200 )
-
-Parti_Grd_Ray = geompy.MakePartition([ Edge_Ray_grd_g_h , Edge_Ray_grd_d_h , Edge_Ray_grd_g_b , Edge_Ray_grd_d_b ], [ Plan1 ], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
-geompy.addToStudy( Parti_Grd_Ray , "Parti_Grd_Ray" )
-
-
-All_Edges_Parti_Grd_Ray = geompy.SubShapeAllSorted(Parti_Grd_Ray, geompy.ShapeType["EDGE"])
-
-
-Grd_Ray_0 = All_Edges_Parti_Grd_Ray[0]
-geompy.addToStudy( Grd_Ray_0 , "Grd_Ray_0" ) 
-
-##Edge_Arr_grd_g_h_mod = grille_cyl_pte.getEdgeJ( 1 , 2 , 0 )
-Edge_Grd_Ray_0_mod = grille_cyl_pte.getEdgeJ( 1 , 0 , 0 )
-Edge_Grd_Ray_0_mod.addAssociation( Grd_Ray_0, 0., 1. )
-
-
-Grd_Ray_1 = All_Edges_Parti_Grd_Ray[1]
-geompy.addToStudy( Grd_Ray_1 , "Grd_Ray_1" )
-
-##Edge_Grd_Ray_1_mod = grille_cyl_pte.getEdgeJ( 1 , 2 , 1 )
-Edge_Grd_Ray_1_mod = grille_cyl_pte.getEdgeJ( 1 , 0 , 1 )
-Edge_Grd_Ray_1_mod.addAssociation( Grd_Ray_1, 0., 1. )
-
-Grd_Ray_2 = All_Edges_Parti_Grd_Ray[2]
-geompy.addToStudy( Grd_Ray_2 , "Grd_Ray_2" )
-
-##Edge_Grd_Ray_2_mod = grille_cyl_pte.getEdgeJ( 1 , 3 , 0 )
-Edge_Grd_Ray_2_mod = grille_cyl_pte.getEdgeJ( 1 , 5 , 0 )
-Edge_Grd_Ray_2_mod.addAssociation( Grd_Ray_2, 0., 1. )
-
-Grd_Ray_3 = All_Edges_Parti_Grd_Ray[3]
-geompy.addToStudy( Grd_Ray_3 , "Grd_Ray_3" )
-
-##Edge_Grd_Ray_3_mod = grille_cyl_pte.getEdgeJ( 1 , 3 , 1 )
-Edge_Grd_Ray_3_mod = grille_cyl_pte.getEdgeJ( 1 , 5 , 1 )
-Edge_Grd_Ray_3_mod.addAssociation( Grd_Ray_3, 0., 1. )
-
-Grd_Ray_4 = All_Edges_Parti_Grd_Ray[4]
-geompy.addToStudy( Grd_Ray_4 , "Grd_Ray_4" )
-
-Edge_Grd_Ray_4_mod = grille_cyl_grd.getEdgeJ( 1 , 2 , 0 )
-Edge_Grd_Ray_4_mod.addAssociation( Grd_Ray_4, 0., 1. )
-#Edge_Grd_Ray_4_mod.addAssociation( Edge_Ray_grd_g_b , 0., 1. )
-
-
-Grd_Ray_5 = All_Edges_Parti_Grd_Ray[5]
-geompy.addToStudy( Grd_Ray_5 , "Grd_Ray_5" )
-
-Edge_Grd_Ray_5_mod = grille_cyl_grd.getEdgeJ( 1 , 2 , 1 )
-Edge_Grd_Ray_5_mod.addAssociation( Grd_Ray_5, 0., 1. )
-
-Grd_Ray_6 = All_Edges_Parti_Grd_Ray[6]
-geompy.addToStudy( Grd_Ray_6 , "Grd_Ray_6" )
-
-Edge_Grd_Ray_6_mod = grille_cyl_grd.getEdgeJ( 1 , 3 , 0 )
-Edge_Grd_Ray_6_mod.addAssociation( Grd_Ray_6, 0., 1. )
-
-Grd_Ray_7 = All_Edges_Parti_Grd_Ray[7]
-geompy.addToStudy( Grd_Ray_7 , "Grd_Ray_7" )
-
-Edge_Arr_grd_g_h_mod = grille_cyl_grd.getEdgeJ( 1 , 3 , 1 )
-Edge_Arr_grd_g_h_mod.addAssociation( Grd_Ray_7, 0., 1. )
-
-
-# recuperer les rayons des trous de la bielle de la geometrie
-
-Edge_Trou_grd_h = All_Edges_Bielle[26]
-geompy.addToStudy( Edge_Trou_grd_h , "Edge_Trou_grd_h" )
-
-Edge_Trou_grd_b = All_Edges_Bielle[25]
-geompy.addToStudy( Edge_Trou_grd_b , "Edge_Trou_grd_b" )
-
-Edge_Trou_pte_h = All_Edges_Bielle[3]
-geompy.addToStudy( Edge_Trou_pte_h , "Edge_Trou_pte_h" )
-
-Edge_Trou_pte_b = All_Edges_Bielle[2]
-geompy.addToStudy( Edge_Trou_pte_b , "Edge_Trou_pte_b" )
-
-Partition_Trou_grd_haut = geompy.MakePartition([ Edge_Trou_grd_h ], [ z_h_g_t , w_h_g_t , v_h_g_t , u_h_g_t , x_h_g_t ], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
-geompy.addToStudy( Partition_Trou_grd_haut , "Partition_Trou_grd_haut" )
-
-All_Edge_Partition_Trou_grd_haut = geompy.SubShapeAllSorted(Partition_Trou_grd_haut, geompy.ShapeType["EDGE"])
-
-Edge_Trou_grd_h_0 = All_Edge_Partition_Trou_grd_haut[0]
-geompy.addToStudy( Edge_Trou_grd_h_0 , "Edge_Trou_grd_h_0" )
-
-Edge_Trou_grd_h_0_mod = grille_cyl_grd.getEdgeJ( 0 , 0 , 1 )
-Edge_Trou_grd_h_0_mod.addAssociation( Edge_Trou_grd_h_0, 0., 1. )
-
-Edge_Trou_grd_h_2 = All_Edge_Partition_Trou_grd_haut[2]
-geompy.addToStudy( Edge_Trou_grd_h_2 , "Edge_Trou_grd_h_2" )
-
-Edge_Trou_grd_h_2_mod = grille_cyl_grd.getEdgeJ( 0 , 1 , 1 )
-Edge_Trou_grd_h_2_mod.addAssociation( Edge_Trou_grd_h_2, 0., 1. )
-
-Edge_Trou_grd_h_4 = All_Edge_Partition_Trou_grd_haut[4]
-geompy.addToStudy( Edge_Trou_grd_h_4 , "Edge_Trou_grd_h_4" )
-
-Edge_Trou_grd_h_4_mod = grille_cyl_grd.getEdgeJ( 0 , 2 , 1 )
-Edge_Trou_grd_h_4_mod.addAssociation( Edge_Trou_grd_h_4, 0., 1. )
-
-Edge_Trou_grd_h_5 = All_Edge_Partition_Trou_grd_haut[5]
-geompy.addToStudy( Edge_Trou_grd_h_5 , "Edge_Trou_grd_h_5" )
-
-Edge_Trou_grd_h_5_mod = grille_cyl_grd.getEdgeJ( 0 , 3 , 1 )
-Edge_Trou_grd_h_5_mod.addAssociation( Edge_Trou_grd_h_5, 0., 1. )
-
-Edge_Trou_grd_h_3 = All_Edge_Partition_Trou_grd_haut[3]
-geompy.addToStudy( Edge_Trou_grd_h_3 , "Edge_Trou_grd_h_3" )
-
-Edge_Trou_grd_h_3_mod = grille_cyl_grd.getEdgeJ( 0 , 4 , 1 )
-Edge_Trou_grd_h_3_mod.addAssociation( Edge_Trou_grd_h_3, 0., 1. )
-
-Edge_Trou_grd_h_1 = All_Edge_Partition_Trou_grd_haut[1]
-geompy.addToStudy( Edge_Trou_grd_h_1 , "Edge_Trou_grd_h_1" )
-
-Edge_Trou_grd_h_1_mod = grille_cyl_grd.getEdgeJ( 0 , 5 , 1 )
-Edge_Trou_grd_h_1_mod.addAssociation( Edge_Trou_grd_h_1, 0., 1. )
-
-
-
-Partition_Trou_grd_bas = geompy.MakePartition([ Edge_Trou_grd_b ], [ z_b_g_t , w_b_g_t , v_b_g_t , u_b_g_t , x_b_g_t ], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
-geompy.addToStudy( Partition_Trou_grd_bas , "Partition_Trou_grd_bas" )
-
-
-All_Edge_Partition_Trou_grd_bas = geompy.SubShapeAllSorted(Partition_Trou_grd_bas, geompy.ShapeType["EDGE"])
-
-Edge_Trou_grd_b_0 = All_Edge_Partition_Trou_grd_bas[0]
-geompy.addToStudy( Edge_Trou_grd_b_0 , "Edge_Trou_grd_b_0" )
-
-Edge_Trou_grd_b_0_mod = grille_cyl_grd.getEdgeJ( 0 , 0 , 0 )
-Edge_Trou_grd_b_0_mod.addAssociation( Edge_Trou_grd_b_0, 0., 1. )
-
-Edge_Trou_grd_b_2 = All_Edge_Partition_Trou_grd_bas[2]
-geompy.addToStudy( Edge_Trou_grd_b_2 , "Edge_Trou_grd_b_2" )
-
-Edge_Trou_grd_b_2_mod = grille_cyl_grd.getEdgeJ( 0 , 1 , 0 )
-Edge_Trou_grd_b_2_mod.addAssociation( Edge_Trou_grd_b_2, 0., 1. )
-
-Edge_Trou_grd_b_4 = All_Edge_Partition_Trou_grd_bas[4]
-geompy.addToStudy( Edge_Trou_grd_b_4 , "Edge_Trou_grd_b_4" )
-
-Edge_Trou_grd_b_4_mod = grille_cyl_grd.getEdgeJ( 0 , 2 , 0 )
-Edge_Trou_grd_b_4_mod.addAssociation( Edge_Trou_grd_b_4, 0., 1. )
-
-Edge_Trou_grd_b_5 = All_Edge_Partition_Trou_grd_bas[5]
-geompy.addToStudy( Edge_Trou_grd_b_5 , "Edge_Trou_grd_b_5" )
-
-Edge_Trou_grd_b_5_mod = grille_cyl_grd.getEdgeJ( 0 , 3 , 0 )
-Edge_Trou_grd_b_5_mod.addAssociation( Edge_Trou_grd_b_5, 0., 1. )
-
-Edge_Trou_grd_b_3 = All_Edge_Partition_Trou_grd_bas[3]
-geompy.addToStudy( Edge_Trou_grd_b_3 , "Edge_Trou_grd_b_3" )
-
-Edge_Trou_grd_b_3_mod = grille_cyl_grd.getEdgeJ( 0 , 4 , 0 )
-Edge_Trou_grd_b_3_mod.addAssociation( Edge_Trou_grd_b_3, 0., 1. )
-
-Edge_Trou_grd_b_1 = All_Edge_Partition_Trou_grd_bas[1]
-geompy.addToStudy( Edge_Trou_grd_b_1 , "Edge_Trou_grd_b_1" )
-
-Edge_Trou_grd_b_1_mod = grille_cyl_grd.getEdgeJ( 0 , 5 , 0 )
-Edge_Trou_grd_b_1_mod.addAssociation( Edge_Trou_grd_b_1, 0., 1. )
-
-
-
-
-
-Partition_Trou_pte_haut = geompy.MakePartition([ Edge_Trou_pte_h ], [ z_h_p_t , w_h_p_t , v_h_p_t , u_h_p_t , x_h_p_t ], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
-geompy.addToStudy( Partition_Trou_pte_haut , "Partition_Trou_pte_haut" )
-
-
-All_Edge_Partition_Trou_pte_haut = geompy.SubShapeAllSorted(Partition_Trou_pte_haut, geompy.ShapeType["EDGE"])
-
-Edge_Trou_pte_h_0 = All_Edge_Partition_Trou_pte_haut[0]
-geompy.addToStudy( Edge_Trou_pte_h_0 , "Edge_Trou_pte_h_0" )
-
-Edge_Trou_pte_h_0_mod = grille_cyl_pte.getEdgeJ( 0 , 0 , 1 )
-Edge_Trou_pte_h_0_mod.addAssociation( Edge_Trou_pte_h_0, 0., 1. )
-
-Edge_Trou_pte_h_2 = All_Edge_Partition_Trou_pte_haut[2]
-geompy.addToStudy( Edge_Trou_pte_h_2 , "Edge_Trou_pte_h_2" )
-
-Edge_Trou_pte_h_2_mod = grille_cyl_pte.getEdgeJ( 0 , 1 , 1 )
-Edge_Trou_pte_h_2_mod.addAssociation( Edge_Trou_pte_h_2, 0., 1. )
-
-Edge_Trou_pte_h_4 = All_Edge_Partition_Trou_pte_haut[4]
-geompy.addToStudy( Edge_Trou_pte_h_4 , "Edge_Trou_pte_h_4" )
-
-Edge_Trou_pte_h_4_mod = grille_cyl_pte.getEdgeJ( 0 , 2 , 1 )
-Edge_Trou_pte_h_4_mod.addAssociation( Edge_Trou_pte_h_4, 0., 1. )
-
-Edge_Trou_pte_h_5 = All_Edge_Partition_Trou_pte_haut[5]
-geompy.addToStudy( Edge_Trou_pte_h_5 , "Edge_Trou_pte_h_5" )
-
-Edge_Trou_pte_h_5_mod = grille_cyl_pte.getEdgeJ( 0 , 3 , 1 )
-Edge_Trou_pte_h_5_mod.addAssociation( Edge_Trou_pte_h_5, 0., 1. )
-
-Edge_Trou_pte_h_3 = All_Edge_Partition_Trou_pte_haut[3]
-geompy.addToStudy( Edge_Trou_pte_h_3 , "Edge_Trou_pte_h_3" )
-
-Edge_Trou_pte_h_3_mod = grille_cyl_pte.getEdgeJ( 0 , 4 , 1 )
-Edge_Trou_pte_h_3_mod.addAssociation( Edge_Trou_pte_h_3, 0., 1. )
-
-Edge_Trou_pte_h_1 = All_Edge_Partition_Trou_pte_haut[1]
-geompy.addToStudy( Edge_Trou_pte_h_1 , "Edge_Trou_pte_h_1" )
-
-Edge_Trou_pte_h_1_mod = grille_cyl_pte.getEdgeJ( 0 , 5 , 1 )
-Edge_Trou_pte_h_1_mod.addAssociation( Edge_Trou_pte_h_1, 0., 1. )
-
-
-
-
-Partition_Trou_pte_bas = geompy.MakePartition([ Edge_Trou_pte_b ], [ z_b_p_t , w_b_p_t , v_b_p_t , u_b_p_t , x_b_p_t ], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
-geompy.addToStudy( Partition_Trou_pte_bas , "Partition_Trou_pte_bas" )
-
-
-All_Edge_Partition_Trou_pte_bas = geompy.SubShapeAllSorted(Partition_Trou_pte_bas, geompy.ShapeType["EDGE"])
-
-Edge_Trou_pte_b_0 = All_Edge_Partition_Trou_pte_bas[0]
-geompy.addToStudy( Edge_Trou_pte_b_0 , "Edge_Trou_pte_b_0" )
-
-Edge_Trou_pte_b_0_mod = grille_cyl_pte.getEdgeJ( 0 , 0 , 0 )
-Edge_Trou_pte_b_0_mod.addAssociation( Edge_Trou_pte_b_0, 0., 1. )
-
-Edge_Trou_pte_b_2 = All_Edge_Partition_Trou_pte_bas[2]
-geompy.addToStudy( Edge_Trou_pte_b_2 , "Edge_Trou_pte_b_2" )
-
-Edge_Trou_pte_b_2_mod = grille_cyl_pte.getEdgeJ( 0 , 1 , 0 )
-Edge_Trou_pte_b_2_mod.addAssociation( Edge_Trou_pte_b_2, 0., 1. )
-
-Edge_Trou_pte_b_4 = All_Edge_Partition_Trou_pte_bas[4]
-geompy.addToStudy( Edge_Trou_pte_b_4 , "Edge_Trou_pte_b_4" )
-
-Edge_Trou_pte_b_4_mod = grille_cyl_pte.getEdgeJ( 0 , 2 , 0 )
-Edge_Trou_pte_b_4_mod.addAssociation( Edge_Trou_pte_b_4, 0., 1. )
-
-Edge_Trou_pte_b_5 = All_Edge_Partition_Trou_pte_bas[5]
-geompy.addToStudy( Edge_Trou_pte_b_5 , "Edge_Trou_pte_b_5" )
-
-Edge_Trou_pte_b_5_mod = grille_cyl_pte.getEdgeJ( 0 , 3 , 0 )
-Edge_Trou_pte_b_5_mod.addAssociation( Edge_Trou_pte_b_5, 0., 1. )
-
-Edge_Trou_pte_b_3 = All_Edge_Partition_Trou_pte_bas[3]
-geompy.addToStudy( Edge_Trou_pte_b_3 , "Edge_Trou_pte_b_3" )
-
-Edge_Trou_pte_b_3_mod = grille_cyl_pte.getEdgeJ( 0 , 4 , 0 )
-Edge_Trou_pte_b_3_mod.addAssociation( Edge_Trou_pte_b_3, 0., 1. )
-
-Edge_Trou_pte_b_1 = All_Edge_Partition_Trou_pte_bas[1]
-geompy.addToStudy( Edge_Trou_pte_b_1 , "Edge_Trou_pte_b_1" )
-
-Edge_Trou_pte_b_1_mod = grille_cyl_pte.getEdgeJ( 0 , 5 , 0 )
-Edge_Trou_pte_b_1_mod.addAssociation( Edge_Trou_pte_b_1, 0., 1. )
-
-#====================================
-# CREATION DES FACES DES ARRONDIES
-#====================================
-
-All_Face_Arron_Bielle = geompy.SubShapeAllSorted(Bielle_geom, geompy.ShapeType["FACE"])
-
-Face_Arron_1 = All_Face_Arron_Bielle[2]
-geompy.addToStudy(Face_Arron_1, "Face_Arron_1")
-
-Quad_Arron_1 = grille_cyl_pte.getQuadJK( 1 , 1 , 0 )
-
-Face_Arron_2 = All_Face_Arron_Bielle[3]
-geompy.addToStudy(Face_Arron_2, "Face_Arron_2")
-
-Quad_Arron_2 = grille_cyl_pte.getQuadJK( 1 , 4 , 0 )
-
-Face_Arron_3 = All_Face_Arron_Bielle[8]
-geompy.addToStudy(Face_Arron_3, "Face_Arron_3")
-
-Quad_Arron_3 = grille_cyl_grd.getQuadJK( 1 , 1 , 0 )
-
-Face_Arron_4 = All_Face_Arron_Bielle[9]
-geompy.addToStudy(Face_Arron_4, "Face_Arron_4")
-
-Quad_Arron_4 = grille_cyl_grd.getQuadJK( 1 , 4 , 0 )
-
-
-
-
-
-
-#====================================
-# CREATION MAILLAGE
-#====================================
-
-
-#=================================================
-# Definir les groupes d elements pour le maillage
-#=================================================
-
-# On definit 3 groupes de mailles
-
-# groupe d edges (arretes)
-
-Edge_grp = doc.addEdgeGroup("Edge_grp")
-Nbr_Edg = doc.countEdge()
-#print Nbr_Edg
-for i in range(Nbr_Edg):
-    Edge_i = doc.getEdge(i)
-    Edge_grp.addElement(Edge_i)
-
-
-# groupe de quads (faces)
-Quad_grp = doc.addQuadGroup("Quad_grp")
-Nbr_Qad = doc.countQuad()
-#print Nbr_Qad
-for i in range(Nbr_Qad):
-    Quad_i = doc.getQuad(i)
-    Quad_grp.addElement(Quad_i)
-
-# groupe d hexas (solids)
-Hexa_grp = doc.addHexaGroup("Hexa_grp")
-Nbr_Hex = doc.countHexa()
-#print Nbr_Hex
-for i in range(Nbr_Hex):
-    Hexa_i = doc.getHexa(i)
-    Hexa_grp.addElement(Hexa_i)
-
-
-
-# groupe de noeuds de vertex pour tout le modele 
-
-Vertex_Nod_Grp = doc.addVertexNodeGroup("Vertex_Nod_Grp")
-Nbr_Vx = doc.countVertex()
-print Nbr_Vx
-
-for i in range(Nbr_Vx):
-    Vertex_i = doc.getVertex(i)
-    Vertex_Nod_Grp.addElement(Vertex_i)
-
-#====================================
-# Definir une loi de discretisation
-#====================================
-# definir une loi: le choix de la loi reste aux utilisateurs
-Law = doc.addLaw( "Uniform" , 4 )
-
-#n = doc.countLaw()
-#print n
-
-# chercher les propagations du modele
-N_Propa = doc.countPropagation()
-
-for j in range(N_Propa):
-    Propa = doc.getPropagation(j)
-    Propa.setLaw( Law )# appliquer la loi de discretisation sur tout le modele et generer le maillage
-
-mesh = hexablock.mesh(doc, "test_BIELLE_bad_assoc:hexas")
-#mesh = hexablock.mesh(doc, "test_BIELLE_bad_assoc:quads", 2)
-#mesh = hexablock.mesh(doc, "test_BIELLE_bad_assoc:edges", 1)
-#mesh = hexablock.mesh(doc, "test_BIELLE_bad_assoc:nodes", 0)
-
-print  " --- MAILLAGE HEXAHEDRIQUE --- "
-print "Nombre d hexaedres:"   , mesh.NbHexas()
-print "Nombre de quadrangles:", mesh.NbQuadrangles()
-print "Nombre de segments:"   , mesh.NbEdges()
-print "Nombre de noeuds:"     , mesh.NbNodes()
diff --git a/src/TEST_PY/test_BIELLE_no_assoc.py b/src/TEST_PY/test_BIELLE_no_assoc.py
deleted file mode 100755 (executable)
index f699d4a..0000000
+++ /dev/null
@@ -1,1075 +0,0 @@
-# -*- coding: latin-1 -*-
-# Copyright (C) 2009-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
-#
-
-#===============================================
-# By Karima DEBCHI YATAGHENE Nov 2009 at CS 
-#===============================================
-
-import os
-import GEOM
-import geompy
-import smesh
-import hexablock
-import math
-import SALOMEDS
-
-
-#STEP_PATH = os.path.expandvars("$HEXA_ROOT_DIR/bin/salome/crank.stp")
-
-#=============================
-# CREATION DOCUMENT
-#=============================
-
-doc = hexablock.addDocument("default")
-
-#=============================
-# CREATION DU MODELE
-#=============================
-
-# Pour la bielle on doit creer deux grilles cylindriques et prismer les quadrangles entre ces deux dernieres
-
-#=============================
-# PARAMETRES
-#=============================
-
-R = 40.0
-
-r_grd = R
-r_grd_t = R/2
-
-r_pte = R
-r_pte_t = R/2
-
-l = 200.0
-#h = 0.019999999553*2
-h = 40.
-
-# Taille du grand cylindre
-dr_grd = R
-da_grd = 360
-dl_grd = h
-
-nr_grd = 1
-na_grd = 6
-nl_grd = 1
-
-# Taille du petit cylindre
-dr_pte = R
-da_pte = 360
-dl_pte = h
-
-nr_pte = 1
-na_pte = 6
-nl_pte = 1
-
-
-#=============================
-# Creation des vecteurs
-#=============================
-
-dx = doc.addVector(l, 0, 0)
-dy = doc.addVector(0, l, 0)
-dz = doc.addVector(0, 0, l)
-
-#=================================================
-# Creation des centres des grilles cylindriques
-#=================================================
-
-c_grd = doc.addVertex(0, 0, 0)
-c_pte = doc.addVertex(2*l, 0, 0)
-dx_prime = doc.addVectorVertices( c_grd, c_pte )
-
-#=================================================
-# Creation de la grande grille cylindrique
-#=================================================
-
-grille_cyl_grd = doc.makeCylindrical(c_grd, dx, dz, dr_grd, da_grd, dl_grd, nr_grd, na_grd, nl_grd, False)
-
-# on obtient une liste qui contient 6 hexaedres eguaux
-
-# 30 = pi/6
-# 60 = pi/3
-# 45 = pi/4
-# 90 = pi/2
-# 180 = pi
-
-alpha_x = 2*R*math.cos(math.pi/3)
-alpha_y = 2*R*math.sin(math.pi/3)
-
-x1 = doc.findVertex( 2*R, 0, h )
-x2 = doc.findVertex( alpha_x, alpha_y, 0 )
-x3 = doc.findVertex( alpha_x, -alpha_y, 0 )
-x4 = doc.findVertex( 2*R, 0, 0 )
-
-quad_11 = doc.findQuad(x1, x2)
-quad_12 = doc.findQuad(x1, x3)
-
-quad_list = [ quad_11 , quad_12 ]
-
-#=================================================
-# Creation de la petite grille cylindrique
-#=================================================
-
-grille_cyl_pte = doc.makeTranslation( grille_cyl_grd , dx_prime )
-
-# on obtient une liste qui contient 6 hexaedres eguaux
-
-y1 = doc.findVertex( 2*l - 2*R , 0 , h )
-y2 = doc.findVertex( 2*l - alpha_x , alpha_y , 0 )
-y3 = doc.findVertex( 2*l - alpha_x , -alpha_y , 0 )
-y4 = doc.findVertex( 2*l - 2*R , 0 , 0 )
-
-quad_21 = doc.findQuad(y1, y2)
-quad_22 = doc.findQuad(y1, y3)
-
-#=================================================
-# Assemblage des deux grilles cylindriques
-#=================================================
-model_biell_fin = doc.joinQuads( quad_list , quad_21 , x1 , y1 , x4 , y4 , 1 )
-
-
-#===================================================================
-# Recuperation des vertex du model hexa bielle pour l association
-#===================================================================
-
-# NB:
-# h = haut
-# b = bas
-# g = grand
-# p = petit
-# t = trou
-
-alpha_x = 2*R*math.cos(math.pi/3)
-alpha_y = 2*R*math.sin(math.pi/3)
-
-# Face du haut grand trou
-
-## RQ:On remplace la fonction findVertex par getVertexIJK
-
-v_mod_h_g = grille_cyl_grd.getVertexIJK( 1 , 0 , 1 )
-w_mod_h_g = grille_cyl_grd.getVertexIJK( 1 , 1 , 1 )
-z_mod_h_g = grille_cyl_grd.getVertexIJK( 1 , 2 , 1 )
-
-y_mod_h_g = grille_cyl_grd.getVertexIJK( 1 , 3 , 1 )
-x_mod_h_g = grille_cyl_grd.getVertexIJK( 1 , 4 , 1 )
-u_mod_h_g = grille_cyl_grd.getVertexIJK( 1 , 5 , 1 )
-
-v_mod_h_g_t = grille_cyl_grd.getVertexIJK( 0 , 0 , 1 )
-w_mod_h_g_t = grille_cyl_grd.getVertexIJK( 0 , 1 , 1 )
-z_mod_h_g_t = grille_cyl_grd.getVertexIJK( 0 , 2 , 1 )
-
-y_mod_h_g_t = grille_cyl_grd.getVertexIJK( 0 , 3 , 1 )
-x_mod_h_g_t = grille_cyl_grd.getVertexIJK( 0 , 4 , 1 )
-u_mod_h_g_t = grille_cyl_grd.getVertexIJK( 0 , 5 , 1 )
-
-#----------- 
-#x_mod_h_g = doc.findVertex( -alpha_x , -alpha_y , h )
-#y_mod_h_g = doc.findVertex( -alpha_x , 0 , h )
-#z_mod_h_g = doc.findVertex( -alpha_x , alpha_y , h )
-
-#u_mod_h_g = doc.findVertex( alpha_x , -alpha_y , h )
-#v_mod_h_g = doc.findVertex( alpha_x , 0 , h )
-#w_mod_h_g = doc.findVertex( alpha_x , alpha_y , h )
-
-#x_mod_h_g_t = doc.findVertex( -alpha_x/2 , -alpha_y/2 , h )
-#y_mod_h_g_t = doc.findVertex( -alpha_x/2 , 0 , h )
-#z_mod_h_g_t = doc.findVertex( -alpha_x/2 , alpha_y/2 , h )
-
-#u_mod_h_g_t = doc.findVertex( alpha_x/2 , -alpha_y/2 , h )
-#v_mod_h_g_t = doc.findVertex( alpha_x/2 , 0 , h )
-#w_mod_h_g_t = doc.findVertex( alpha_x/2 , alpha_y/2 , h )
-#-----------
-
-assert x_mod_h_g
-assert y_mod_h_g
-assert z_mod_h_g
-
-assert u_mod_h_g
-assert v_mod_h_g
-assert w_mod_h_g
-
-assert x_mod_h_g_t
-assert y_mod_h_g_t #
-assert z_mod_h_g_t
-
-assert u_mod_h_g_t #
-assert v_mod_h_g_t
-assert w_mod_h_g_t #
-
-
-# Face du haut petit trou
-
-## RQ:On remplace la fonction findVertex par getVertexIJK
-v_mod_h_p = grille_cyl_pte.getVertexIJK( 1 , 0 , 1 )
-w_mod_h_p = grille_cyl_pte.getVertexIJK( 1 , 1 , 1 )
-z_mod_h_p = grille_cyl_pte.getVertexIJK( 1 , 2 , 1 )
-
-y_mod_h_p = grille_cyl_pte.getVertexIJK( 1 , 3 , 1 )
-x_mod_h_p = grille_cyl_pte.getVertexIJK( 1 , 4 , 1 )
-u_mod_h_p = grille_cyl_pte.getVertexIJK( 1 , 5 , 1 )
-
-v_mod_h_p_t = grille_cyl_pte.getVertexIJK( 0 , 0 , 1 )
-w_mod_h_p_t = grille_cyl_pte.getVertexIJK( 0 , 1 , 1 )
-z_mod_h_p_t = grille_cyl_pte.getVertexIJK( 0 , 2 , 1 )
-
-y_mod_h_p_t = grille_cyl_pte.getVertexIJK( 0 , 3 , 1 )
-x_mod_h_p_t = grille_cyl_pte.getVertexIJK( 0 , 4 , 1 )
-u_mod_h_p_t = grille_cyl_pte.getVertexIJK( 0 , 5 , 1 )
-
-
-#-----------
-#x_mod_h_p = doc.findVertex( l + alpha_x , -alpha_y , h )
-#y_mod_h_p = doc.findVertex( l + alpha_x , 0 , h )
-#z_mod_h_p = doc.findVertex( l + alpha_x , alpha_y , h )
-
-#u_mod_h_p = doc.findVertex( l - alpha_x , -alpha_y , h )
-#v_mod_h_p = doc.findVertex( l - alpha_x , 0 , h )
-#w_mod_h_p = doc.findVertex( l - alpha_x , alpha_y , h )
-
-#x_mod_h_p_t = doc.findVertex( l + (alpha_x/2) , -alpha_y/2 , h )
-#y_mod_h_p_t = doc.findVertex( l + (alpha_x/2) , 0 , h )
-#z_mod_h_p_t = doc.findVertex( l + (alpha_x/2) , alpha_y/2 , h )
-
-#u_mod_h_p_t = doc.findVertex( l - (alpha_x/2) , -alpha_y/2 , h )
-#v_mod_h_p_t = doc.findVertex( l - (alpha_x/2) , 0 , h )
-#w_mod_h_p_t = doc.findVertex( l - (alpha_x/2) , alpha_y/2 , h )
-#-----------
-
-#-----------
-assert x_mod_h_p
-assert y_mod_h_p
-assert z_mod_h_p
-
-assert u_mod_h_p
-assert v_mod_h_p
-assert w_mod_h_p
-
-assert x_mod_h_p_t
-assert y_mod_h_p_t
-assert z_mod_h_p_t
-
-assert u_mod_h_p_t
-assert v_mod_h_p_t
-assert w_mod_h_p_t
-#-----------
-
-# Face du bas grand trou
-
-## RQ:On remplace la fonction findVertex par getVertexIJK
-
-v_mod_b_g = grille_cyl_grd.getVertexIJK( 1 , 0 , 0 )
-w_mod_b_g = grille_cyl_grd.getVertexIJK( 1 , 1 , 0 )
-z_mod_b_g = grille_cyl_grd.getVertexIJK( 1 , 2 , 0 )
-
-y_mod_b_g = grille_cyl_grd.getVertexIJK( 1 , 3 , 0 )
-x_mod_b_g = grille_cyl_grd.getVertexIJK( 1 , 4 , 0 )
-u_mod_b_g = grille_cyl_grd.getVertexIJK( 1 , 5 , 0 )
-
-v_mod_b_g_t = grille_cyl_grd.getVertexIJK( 0 , 0 , 0 )
-w_mod_b_g_t = grille_cyl_grd.getVertexIJK( 0 , 1 , 0 )
-z_mod_b_g_t = grille_cyl_grd.getVertexIJK( 0 , 2 , 0 )
-
-y_mod_b_g_t = grille_cyl_grd.getVertexIJK( 0 , 3 , 0 )
-x_mod_b_g_t = grille_cyl_grd.getVertexIJK( 0 , 4 , 0 )
-u_mod_b_g_t = grille_cyl_grd.getVertexIJK( 0 , 5 , 0 )
-
-#-----------
-#x_mod_b_g = doc.findVertex( -alpha_x , -alpha_y , 0 )
-#y_mod_b_g = doc.findVertex( -alpha_x , 0 , 0 )
-#z_mod_b_g = doc.findVertex( -alpha_x , alpha_y , 0 )
-
-#u_mod_b_g = doc.findVertex( alpha_x , -alpha_y , 0 )
-#v_mod_b_g = doc.findVertex( alpha_x , 0 , 0 )
-#w_mod_b_g = doc.findVertex( alpha_x , alpha_y , 0 )
-
-#x_mod_b_g_t = doc.findVertex( -alpha_x/2 , -alpha_y/2 , 0 )
-#y_mod_b_g_t = doc.findVertex( -alpha_x/2 , 0 , 0 )
-#z_mod_b_g_t = doc.findVertex( -alpha_x/2 , alpha_y/2 , 0 )
-
-#u_mod_b_g_t = doc.findVertex( alpha_x/2 , -alpha_y/2 , 0 )
-#v_mod_b_g_t = doc.findVertex( alpha_x/2 , 0 , 0 )
-#w_mod_b_g_t = doc.findVertex( alpha_x/2 , alpha_y/2 , 0 )
-#-----------
-
-assert x_mod_b_g
-assert y_mod_b_g
-assert z_mod_b_g
-
-assert u_mod_b_g
-assert v_mod_b_g
-assert w_mod_b_g
-
-assert x_mod_b_g_t
-assert y_mod_b_g_t
-assert z_mod_b_g_t
-
-assert u_mod_b_g_t
-assert v_mod_b_g_t
-assert w_mod_b_g_t
-
-
-# Face du bas petit trou
-
-
-## RQ:On remplace la fonction findVertex par getVertexIJK
-
-v_mod_b_p = grille_cyl_pte.getVertexIJK( 1 , 0 , 0 )
-w_mod_b_p = grille_cyl_pte.getVertexIJK( 1 , 1 , 0 )
-z_mod_b_p = grille_cyl_pte.getVertexIJK( 1 , 2 , 0 )
-
-y_mod_b_p = grille_cyl_pte.getVertexIJK( 1 , 3 , 0 )
-x_mod_b_p = grille_cyl_pte.getVertexIJK( 1 , 4 , 0 )
-u_mod_b_p = grille_cyl_pte.getVertexIJK( 1 , 5 , 0 )
-
-v_mod_b_p_t = grille_cyl_pte.getVertexIJK( 0 , 0 , 0 )
-w_mod_b_p_t = grille_cyl_pte.getVertexIJK( 0 , 1 , 0 )
-z_mod_b_p_t = grille_cyl_pte.getVertexIJK( 0 , 2 , 0 )
-
-y_mod_b_p_t = grille_cyl_pte.getVertexIJK( 0 , 3 , 0 )
-x_mod_b_p_t = grille_cyl_pte.getVertexIJK( 0 , 4 , 0 )
-u_mod_b_p_t = grille_cyl_pte.getVertexIJK( 0 , 5 , 0 )
-
-
-#-----------
-#x_mod_b_p = doc.findVertex( l + alpha_x , -alpha_y , 0 )
-#y_mod_b_p = doc.findVertex( l + alpha_x , 0 , 0 )
-#z_mod_b_p = doc.findVertex( l + alpha_x , alpha_y , 0 )
-
-#u_mod_b_p = doc.findVertex( l - alpha_x , -alpha_y , 0 )
-#v_mod_b_p = doc.findVertex( l - alpha_x , 0 , 0 )
-#w_mod_b_p = doc.findVertex( l - alpha_x , alpha_y , 0 )
-
-#x_mod_b_p_t = doc.findVertex( l + (alpha_x/2) , -alpha_y/2 , 0 )
-#y_mod_b_p_t = doc.findVertex( l + (alpha_x/2) , 0 , 0 )
-#z_mod_b_p_t = doc.findVertex( l + (alpha_x/2) , alpha_y/2 , 0 )
-
-#u_mod_b_p_t = doc.findVertex( l - (alpha_x/2) , -alpha_y/2 , 0 )
-#v_mod_b_p_t = doc.findVertex( l - (alpha_x/2) , 0 , 0 )
-#w_mod_b_p_t = doc.findVertex( l - (alpha_x/2) , alpha_y/2 , 0 )
-#-----------
-
-#-----------
-assert x_mod_b_p
-assert y_mod_b_p
-assert z_mod_b_p
-
-assert u_mod_b_p
-assert v_mod_b_p
-assert w_mod_b_p
-
-assert x_mod_b_p_t
-assert y_mod_b_p_t
-assert z_mod_b_p_t
-
-assert u_mod_b_p_t
-assert v_mod_b_p_t
-assert w_mod_b_p_t
-#-----------
-
-
-
-##===================================================================
-## Recuperation des points de la geometrie bielle pour l association
-##===================================================================
-#Bielle_geom = geompy.Import(STEP_PATH, "STEP")
-
-#geompy.addToStudy(Bielle_geom, "Bielle_geom")
-
-#Pt_A = geompy.MakeVertex(0, 0, h/2.)
-#Face_haut = geompy.GetFaceNearPoint(Bielle_geom, Pt_A)
-
-
-#Pt_B = geompy.MakeVertex(0, 0, -h/2.)
-#Face_bas = geompy.GetFaceNearPoint(Bielle_geom, Pt_B)
-
-
-## NB:
-## h = haut
-## b = bas
-## g = grand
-## p = petit
-## t = trou
-
-
-#y_h_g = geompy.MakeVertexOnSurface(Face_haut, 1, 0.5)
-#geompy.addToStudy( y_h_g , "y_h_g" )
-#y_b_g = geompy.MakeVertexWithRef(y_h_g, 0, 0, -h)
-#geompy.addToStudy( y_b_g , "y_b_g" )
-
-#v_h_p = geompy.MakeVertexOnSurface(Face_haut, 0, 0.5)
-#geompy.addToStudy( v_h_p , "v_h_p" )
-#v_b_p = geompy.MakeVertexWithRef(v_h_p, 0, 0, -h)
-#geompy.addToStudy( v_b_p , "v_b_p" )
-
-#Edge_haut_grd = geompy.GetEdgeNearPoint(Bielle_geom, y_h_g)
-#Edge_haut_pte = geompy.GetEdgeNearPoint(Bielle_geom, v_h_p)
-
-
-
-#x_h_g = geompy.MakeVertexOnCurve(Edge_haut_grd, 0)
-#geompy.addToStudy( x_h_g , "x_h_g" )
-#x_b_g = geompy.MakeVertexWithRef(x_h_g, 0, 0, -h)
-#geompy.addToStudy( x_b_g , "x_b_g" )
-
-#z_h_g = geompy.MakeVertexOnCurve(Edge_haut_grd, 1)
-#geompy.addToStudy( z_h_g , "z_h_g" )
-#z_b_g = geompy.MakeVertexWithRef(z_h_g, 0, 0, -h)
-#geompy.addToStudy( z_b_g , "z_b_g" )
-
-#w_h_p = geompy.MakeVertexOnCurve(Edge_haut_pte, 0)
-#geompy.addToStudy( w_h_p , "w_h_p" )
-#w_b_p = geompy.MakeVertexWithRef(w_h_p, 0, 0, -h)
-#geompy.addToStudy( w_b_p , "w_b_p" )
-
-#u_h_p = geompy.MakeVertexOnCurve(Edge_haut_pte, 1)
-#geompy.addToStudy( u_h_p , "u_h_p" )
-#u_b_p = geompy.MakeVertexWithRef(u_h_p, 0, 0, -h)
-#geompy.addToStudy( u_b_p , "u_b_p" )
-
-
-
-#Edge_haut_grd_trou = geompy.GetEdgesByLength(Face_haut, 0.147, 0.148)
-
-
-
-#y_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0)
-#geompy.addToStudy(y_h_g_t, "y_h_g_t")
-#y_b_g_t = geompy.MakeVertexWithRef(y_h_g_t, 0, 0, -h)
-#geompy.addToStudy(y_b_g_t, "y_b_g_t")
-
-#z_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0.2)
-#geompy.addToStudy(z_h_g_t, "z_h_g_t")
-#z_b_g_t = geompy.MakeVertexWithRef(z_h_g_t, 0, 0, -h)
-#geompy.addToStudy(z_b_g_t, "z_b_g_t")
-
-#w_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0.35)
-#geompy.addToStudy(w_h_g_t, "w_h_g_t")
-#w_b_g_t = geompy.MakeVertexWithRef(w_h_g_t, 0, 0, -h)
-#geompy.addToStudy(w_b_g_t, "w_b_g_t")
-
-#v_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0.5)
-#geompy.addToStudy(v_h_g_t, "v_h_g_t")
-#v_b_g_t = geompy.MakeVertexWithRef(v_h_g_t, 0, 0, -h)
-#geompy.addToStudy(v_b_g_t, "v_b_g_t")
-
-#u_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0.65)
-#geompy.addToStudy(u_h_g_t, "u_h_g_t")
-#u_b_g_t = geompy.MakeVertexWithRef(u_h_g_t, 0, 0, -h)
-#geompy.addToStudy(u_b_g_t, "u_b_g_t")
-
-#x_h_g_t = geompy.MakeVertexOnCurve(Edge_haut_grd_trou, 0.8)
-#geompy.addToStudy(x_h_g_t, "x_h_g_t")
-#x_b_g_t = geompy.MakeVertexWithRef(x_h_g_t, 0, 0, -h)
-#geompy.addToStudy(x_b_g_t, "x_b_g_t")
-
-
-
-#Edge_haut_pte_trou = geompy.GetEdgesByLength(Face_haut, 0.094, 0.095)
-
-#y_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0)
-#geompy.addToStudy(y_h_p_t, "y_h_p_t")
-#y_b_p_t = geompy.MakeVertexWithRef(y_h_p_t, 0, 0, -h)
-#geompy.addToStudy(y_b_p_t, "y_b_p_t")
-
-#z_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0.2)
-#geompy.addToStudy(z_h_p_t, "z_h_p_t")
-#z_b_p_t = geompy.MakeVertexWithRef(z_h_p_t, 0, 0, -h)
-#geompy.addToStudy(z_b_p_t, "z_b_p_t")
-
-#w_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0.35)
-#geompy.addToStudy(w_h_p_t, "w_h_p_t")
-#w_b_p_t = geompy.MakeVertexWithRef(w_h_p_t, 0, 0, -h)
-#geompy.addToStudy(w_b_p_t, "w_b_p_t")
-
-#v_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0.5)
-#geompy.addToStudy(v_h_p_t, "v_h_p_t")
-#v_b_p_t = geompy.MakeVertexWithRef(v_h_p_t, 0, 0, -h)
-#geompy.addToStudy(v_b_p_t, "v_b_p_t")
-
-#u_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0.65)
-#geompy.addToStudy(u_h_p_t, "u_h_p_t")
-#u_b_p_t = geompy.MakeVertexWithRef(u_h_p_t, 0, 0, -h)
-#geompy.addToStudy(u_b_p_t, "u_b_p_t")
-
-#x_h_p_t = geompy.MakeVertexOnCurve(Edge_haut_pte_trou, 0.8)
-#geompy.addToStudy(x_h_p_t, "x_h_p_t")
-#x_b_p_t = geompy.MakeVertexWithRef(x_h_p_t, 0, 0, -h)
-#geompy.addToStudy(x_b_p_t, "x_b_p_t")
-
-
-
-#Edge_haut_droite = geompy.GetEdgesByLength(Face_haut, 0.136, 0.137)
-
-#u_h_g = geompy.MakeVertexOnCurve(Edge_haut_droite, 1)
-#geompy.addToStudy(u_h_g, "u_h_g")
-
-#u_b_g = geompy.MakeVertexWithRef(u_h_g, 0, 0, -h)
-#geompy.addToStudy(u_b_g, "u_b_g")
-
-#x_h_p = geompy.MakeVertexOnCurve(Edge_haut_droite, 0)
-#geompy.addToStudy(x_h_p, "x_h_p")
-#x_b_p = geompy.MakeVertexWithRef(x_h_p, 0, 0, -h)
-#geompy.addToStudy(x_b_p, "x_b_p")
-
-
-#Edge_haut_gauche = geompy.GetEdgesByLength(Face_haut, 0.131, 0.132)
-
-#w_h_g = geompy.MakeVertexOnCurve(Edge_haut_gauche, 0)
-#geompy.addToStudy(w_h_g, "w_h_g")
-
-#w_b_g = geompy.MakeVertexWithRef(w_h_g, 0, 0, -h)
-#geompy.addToStudy(w_b_g, "w_b_g")
-
-#z_h_p = geompy.MakeVertexOnCurve(Edge_haut_gauche, 1)
-#geompy.addToStudy(z_h_p, "z_h_p")
-#z_b_p = geompy.MakeVertexWithRef(z_h_p, 0, 0, -h)
-#geompy.addToStudy(z_b_p, "z_b_p")
-
-#Edge_v_grd = geompy.MakeLineTwoPnt(u_h_g, w_h_g)
-
-#v_h_g = geompy.MakeVertexOnCurve(Edge_v_grd, 0.5)
-#geompy.addToStudy(v_h_g, "v_h_g")
-#v_b_g = geompy.MakeVertexWithRef(v_h_g, 0, 0, -h)
-#geompy.addToStudy(v_b_g, "v_b_g")
-
-
-#Edge_v_pte = geompy.MakeLineTwoPnt(x_h_p, z_h_p)
-
-#y_h_p = geompy.MakeVertexOnCurve(Edge_v_pte, 0.5)
-#geompy.addToStudy(y_h_p, "y_h_p")
-#y_b_p = geompy.MakeVertexWithRef(y_h_p, 0, 0, -h)
-#geompy.addToStudy(y_b_p, "y_b_p")
-
-
-##=======================
-## CREATION ASSOCIATION
-##=======================
-
-##===========================================
-## association des sommets de la face du haut
-##===========================================
-
-## grand trou
-
-#x_mod_h_g.setAssociation( x_h_g )
-#y_mod_h_g.setAssociation( y_h_g )
-#z_mod_h_g.setAssociation( z_h_g )
-#u_mod_h_g.setAssociation( u_h_g )
-#v_mod_h_g.setAssociation( v_h_g )
-#w_mod_h_g.setAssociation( w_h_g )
-
-#x_mod_h_g_t.setAssociation( x_h_g_t )
-#y_mod_h_g_t.setAssociation( y_h_g_t )
-#z_mod_h_g_t.setAssociation( z_h_g_t )
-#u_mod_h_g_t.setAssociation( u_h_g_t )
-#v_mod_h_g_t.setAssociation( v_h_g_t )
-#w_mod_h_g_t.setAssociation( w_h_g_t )
-
-## petit trou
-
-#x_mod_h_p.setAssociation( x_h_p )
-#y_mod_h_p.setAssociation( y_h_p )
-#z_mod_h_p.setAssociation( z_h_p )
-#u_mod_h_p.setAssociation( u_h_p )
-#v_mod_h_p.setAssociation( v_h_p )
-#w_mod_h_p.setAssociation( w_h_p )
-
-#x_mod_h_p_t.setAssociation( x_h_p_t )
-#y_mod_h_p_t.setAssociation( y_h_p_t )
-#z_mod_h_p_t.setAssociation( z_h_p_t )
-#u_mod_h_p_t.setAssociation( u_h_p_t )
-#v_mod_h_p_t.setAssociation( v_h_p_t )
-#w_mod_h_p_t.setAssociation( w_h_p_t )
-
-
-##===========================================
-## association des sommets de la face du bas
-##===========================================
-
-## grand trou
-
-#x_mod_b_g.setAssociation( x_b_g )
-#y_mod_b_g.setAssociation( y_b_g )
-#z_mod_b_g.setAssociation( z_b_g )
-#u_mod_b_g.setAssociation( u_b_g )
-#v_mod_b_g.setAssociation( v_b_g )
-#w_mod_b_g.setAssociation( w_b_g )
-
-#x_mod_b_g_t.setAssociation( x_b_g_t )
-#y_mod_b_g_t.setAssociation( y_b_g_t )
-#z_mod_b_g_t.setAssociation( z_b_g_t )
-#u_mod_b_g_t.setAssociation( u_b_g_t )
-#v_mod_b_g_t.setAssociation( v_b_g_t )
-#w_mod_b_g_t.setAssociation( w_b_g_t )
-
-## petit trou
-
-#x_mod_b_p.setAssociation( x_b_p )
-#y_mod_b_p.setAssociation( y_b_p )
-#z_mod_b_p.setAssociation( z_b_p )
-#u_mod_b_p.setAssociation( u_b_p )
-#v_mod_b_p.setAssociation( v_b_p )
-#w_mod_b_p.setAssociation( w_b_p )
-
-#x_mod_b_p_t.setAssociation( x_b_p_t )
-#y_mod_b_p_t.setAssociation( y_b_p_t )
-#z_mod_b_p_t.setAssociation( z_b_p_t )
-#u_mod_b_p_t.setAssociation( u_b_p_t )
-#v_mod_b_p_t.setAssociation( v_b_p_t )
-#w_mod_b_p_t.setAssociation( w_b_p_t )
-
-
-
-
-##=================================
-## Creation association des edges
-##=================================
-
-
-#All_Edges_Bielle = geompy.SubShapeAllSorted(Bielle_geom, geompy.ShapeType["EDGE"])
-
-### recuperer les arrondies du haut de la geometrie
-
-#Edge_Arr_grd_g_h = All_Edges_Bielle[20]
-#geompy.addToStudy( Edge_Arr_grd_g_h , "Edge_Arr_grd_g_h" )
-
-#Edge_Arr_grd_g_h_mod = grille_cyl_grd.getEdgeJ( 1 , 1 , 1 )
-#Edge_Arr_grd_g_h_mod.addAssociation( Edge_Arr_grd_g_h, 0., 1. )
-
-
-#Edge_Arr_grd_d_h = All_Edges_Bielle[22]
-#geompy.addToStudy( Edge_Arr_grd_d_h , "Edge_Arr_grd_d_h" )
-
-#Edge_Arr_grd_d_h_mod = grille_cyl_grd.getEdgeJ( 1 , 4 , 1 )
-#Edge_Arr_grd_d_h_mod.addAssociation( Edge_Arr_grd_d_h, 0., 1. )
-
-
-#Edge_Arr_pte_g_h = All_Edges_Bielle[8]
-#geompy.addToStudy( Edge_Arr_pte_g_h , "Edge_Arr_pte_g_h" )
-
-#Edge_Arr_pte_g_h_mod = grille_cyl_pte.getEdgeJ( 1 , 1 , 1 )
-#Edge_Arr_pte_g_h_mod.addAssociation( Edge_Arr_pte_g_h, 0., 1. )
-
-#Edge_Arr_pte_d_h = All_Edges_Bielle[10]
-#geompy.addToStudy( Edge_Arr_pte_d_h , "Edge_Arr_pte_d_h" )
-
-#Edge_Arr_pte_d_h_mod = grille_cyl_pte.getEdgeJ( 1 , 4 , 1 )
-#Edge_Arr_pte_d_h_mod.addAssociation( Edge_Arr_pte_d_h, 0., 1. )
-
-## recuperer les arrondies du bas de la geometrie
-
-#Edge_Arr_grd_g_b = All_Edges_Bielle[19]
-#geompy.addToStudy( Edge_Arr_grd_g_b , "Edge_Arr_grd_g_b" )
-
-#Edge_Arr_grd_g_b_mod = grille_cyl_grd.getEdgeJ( 1 , 1 , 0 )
-#Edge_Arr_grd_g_b_mod.addAssociation( Edge_Arr_grd_g_b, 0., 1. )
-
-#Edge_Arr_grd_d_b = All_Edges_Bielle[21]
-#geompy.addToStudy( Edge_Arr_grd_d_b , "Edge_Arr_grd_d_b" )
-
-#Edge_Arr_grd_d_b_mod = grille_cyl_grd.getEdgeJ( 1 , 4 , 0 )
-#Edge_Arr_grd_d_b_mod.addAssociation( Edge_Arr_grd_d_b, 0., 1. )
-
-#Edge_Arr_pte_g_b = All_Edges_Bielle[7]
-#geompy.addToStudy( Edge_Arr_pte_g_b , "Edge_Arr_pte_g_b" )
-
-#Edge_Arr_pte_g_b_mod = grille_cyl_pte.getEdgeJ( 1 , 1 , 0 )
-#Edge_Arr_pte_g_b_mod.addAssociation( Edge_Arr_pte_g_b, 0., 1. )
-
-#Edge_Arr_pte_d_b = All_Edges_Bielle[9]
-#geompy.addToStudy( Edge_Arr_pte_d_b , "Edge_Arr_pte_d_b" )
-
-#Edge_Arr_pte_d_b_mod = grille_cyl_pte.getEdgeJ( 1 , 4 , 0 )
-#Edge_Arr_pte_d_b_mod.addAssociation( Edge_Arr_pte_d_b, 0., 1. )
-
-
-## recuperer les grand rayons de la geometrie
-
-#Edge_Ray_grd_g_h = All_Edges_Bielle[28]
-#geompy.addToStudy( Edge_Ray_grd_g_h , "Edge_Ray_grd_g_h" )
-#Edge_Ray_grd_d_h = All_Edges_Bielle[1]
-#geompy.addToStudy( Edge_Ray_grd_d_h , "Edge_Ray_grd_d_h" )
-
-#Edge_Ray_grd_g_b = All_Edges_Bielle[27]
-#geompy.addToStudy( Edge_Ray_grd_g_b , "Edge_Ray_grd_g_b" )
-#Edge_Ray_grd_d_b = All_Edges_Bielle[0]
-#geompy.addToStudy( Edge_Ray_grd_d_b , "Edge_Ray_grd_d_b" )
-
-
-
-#X_pln1 = geompy.MakeVertex( 0 , 0 , 0 )
-#Vec_X = geompy.MakeVectorDXDYDZ( 0 , 1 , 0 )
-#Plan1 = geompy.MakePlane( X_pln1 , Vec_X , 200 )
-
-#Parti_Grd_Ray = geompy.MakePartition([ Edge_Ray_grd_g_h , Edge_Ray_grd_d_h , Edge_Ray_grd_g_b , Edge_Ray_grd_d_b ], [ Plan1 ], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
-#geompy.addToStudy( Parti_Grd_Ray , "Parti_Grd_Ray" )
-
-
-#All_Edges_Parti_Grd_Ray = geompy.SubShapeAllSorted(Parti_Grd_Ray, geompy.ShapeType["EDGE"])
-
-
-#Grd_Ray_0 = All_Edges_Parti_Grd_Ray[0]
-#geompy.addToStudy( Grd_Ray_0 , "Grd_Ray_0" ) 
-
-###Edge_Arr_grd_g_h_mod = grille_cyl_pte.getEdgeJ( 1 , 2 , 0 )
-#Edge_Grd_Ray_0_mod = grille_cyl_pte.getEdgeJ( 1 , 0 , 0 )
-#Edge_Grd_Ray_0_mod.addAssociation( Grd_Ray_0, 0., 1. )
-
-
-#Grd_Ray_1 = All_Edges_Parti_Grd_Ray[1]
-#geompy.addToStudy( Grd_Ray_1 , "Grd_Ray_1" )
-
-###Edge_Grd_Ray_1_mod = grille_cyl_pte.getEdgeJ( 1 , 2 , 1 )
-#Edge_Grd_Ray_1_mod = grille_cyl_pte.getEdgeJ( 1 , 0 , 1 )
-#Edge_Grd_Ray_1_mod.addAssociation( Grd_Ray_1, 0., 1. )
-
-#Grd_Ray_2 = All_Edges_Parti_Grd_Ray[2]
-#geompy.addToStudy( Grd_Ray_2 , "Grd_Ray_2" )
-
-###Edge_Grd_Ray_2_mod = grille_cyl_pte.getEdgeJ( 1 , 3 , 0 )
-#Edge_Grd_Ray_2_mod = grille_cyl_pte.getEdgeJ( 1 , 5 , 0 )
-#Edge_Grd_Ray_2_mod.addAssociation( Grd_Ray_2, 0., 1. )
-
-#Grd_Ray_3 = All_Edges_Parti_Grd_Ray[3]
-#geompy.addToStudy( Grd_Ray_3 , "Grd_Ray_3" )
-
-###Edge_Grd_Ray_3_mod = grille_cyl_pte.getEdgeJ( 1 , 3 , 1 )
-#Edge_Grd_Ray_3_mod = grille_cyl_pte.getEdgeJ( 1 , 5 , 1 )
-#Edge_Grd_Ray_3_mod.addAssociation( Grd_Ray_3, 0., 1. )
-
-#Grd_Ray_4 = All_Edges_Parti_Grd_Ray[4]
-#geompy.addToStudy( Grd_Ray_4 , "Grd_Ray_4" )
-
-#Edge_Grd_Ray_4_mod = grille_cyl_grd.getEdgeJ( 1 , 2 , 0 )
-#Edge_Grd_Ray_4_mod.addAssociation( Grd_Ray_4, 0., 1. )
-##Edge_Grd_Ray_4_mod.addAssociation( Edge_Ray_grd_g_b , 0., 1. )
-
-
-#Grd_Ray_5 = All_Edges_Parti_Grd_Ray[5]
-#geompy.addToStudy( Grd_Ray_5 , "Grd_Ray_5" )
-
-#Edge_Grd_Ray_5_mod = grille_cyl_grd.getEdgeJ( 1 , 2 , 1 )
-#Edge_Grd_Ray_5_mod.addAssociation( Grd_Ray_5, 0., 1. )
-
-#Grd_Ray_6 = All_Edges_Parti_Grd_Ray[6]
-#geompy.addToStudy( Grd_Ray_6 , "Grd_Ray_6" )
-
-#Edge_Grd_Ray_6_mod = grille_cyl_grd.getEdgeJ( 1 , 3 , 0 )
-#Edge_Grd_Ray_6_mod.addAssociation( Grd_Ray_6, 0., 1. )
-
-#Grd_Ray_7 = All_Edges_Parti_Grd_Ray[7]
-#geompy.addToStudy( Grd_Ray_7 , "Grd_Ray_7" )
-
-#Edge_Arr_grd_g_h_mod = grille_cyl_grd.getEdgeJ( 1 , 3 , 1 )
-#Edge_Arr_grd_g_h_mod.addAssociation( Grd_Ray_7, 0., 1. )
-
-
-## recuperer les rayons des trous de la bielle de la geometrie
-
-#Edge_Trou_grd_h = All_Edges_Bielle[26]
-#geompy.addToStudy( Edge_Trou_grd_h , "Edge_Trou_grd_h" )
-
-#Edge_Trou_grd_b = All_Edges_Bielle[25]
-#geompy.addToStudy( Edge_Trou_grd_b , "Edge_Trou_grd_b" )
-
-#Edge_Trou_pte_h = All_Edges_Bielle[3]
-#geompy.addToStudy( Edge_Trou_pte_h , "Edge_Trou_pte_h" )
-
-#Edge_Trou_pte_b = All_Edges_Bielle[2]
-#geompy.addToStudy( Edge_Trou_pte_b , "Edge_Trou_pte_b" )
-
-#Partition_Trou_grd_haut = geompy.MakePartition([ Edge_Trou_grd_h ], [ z_h_g_t , w_h_g_t , v_h_g_t , u_h_g_t , x_h_g_t ], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
-#geompy.addToStudy( Partition_Trou_grd_haut , "Partition_Trou_grd_haut" )
-
-#All_Edge_Partition_Trou_grd_haut = geompy.SubShapeAllSorted(Partition_Trou_grd_haut, geompy.ShapeType["EDGE"])
-
-#Edge_Trou_grd_h_0 = All_Edge_Partition_Trou_grd_haut[0]
-#geompy.addToStudy( Edge_Trou_grd_h_0 , "Edge_Trou_grd_h_0" )
-
-#Edge_Trou_grd_h_0_mod = grille_cyl_grd.getEdgeJ( 0 , 0 , 1 )
-#Edge_Trou_grd_h_0_mod.addAssociation( Edge_Trou_grd_h_0, 0., 1. )
-
-#Edge_Trou_grd_h_2 = All_Edge_Partition_Trou_grd_haut[2]
-#geompy.addToStudy( Edge_Trou_grd_h_2 , "Edge_Trou_grd_h_2" )
-
-#Edge_Trou_grd_h_2_mod = grille_cyl_grd.getEdgeJ( 0 , 1 , 1 )
-#Edge_Trou_grd_h_2_mod.addAssociation( Edge_Trou_grd_h_2, 0., 1. )
-
-#Edge_Trou_grd_h_4 = All_Edge_Partition_Trou_grd_haut[4]
-#geompy.addToStudy( Edge_Trou_grd_h_4 , "Edge_Trou_grd_h_4" )
-
-#Edge_Trou_grd_h_4_mod = grille_cyl_grd.getEdgeJ( 0 , 2 , 1 )
-#Edge_Trou_grd_h_4_mod.addAssociation( Edge_Trou_grd_h_4, 0., 1. )
-
-#Edge_Trou_grd_h_5 = All_Edge_Partition_Trou_grd_haut[5]
-#geompy.addToStudy( Edge_Trou_grd_h_5 , "Edge_Trou_grd_h_5" )
-
-#Edge_Trou_grd_h_5_mod = grille_cyl_grd.getEdgeJ( 0 , 3 , 1 )
-#Edge_Trou_grd_h_5_mod.addAssociation( Edge_Trou_grd_h_5, 0., 1. )
-
-#Edge_Trou_grd_h_3 = All_Edge_Partition_Trou_grd_haut[3]
-#geompy.addToStudy( Edge_Trou_grd_h_3 , "Edge_Trou_grd_h_3" )
-
-#Edge_Trou_grd_h_3_mod = grille_cyl_grd.getEdgeJ( 0 , 4 , 1 )
-#Edge_Trou_grd_h_3_mod.addAssociation( Edge_Trou_grd_h_3, 0., 1. )
-
-#Edge_Trou_grd_h_1 = All_Edge_Partition_Trou_grd_haut[1]
-#geompy.addToStudy( Edge_Trou_grd_h_1 , "Edge_Trou_grd_h_1" )
-
-#Edge_Trou_grd_h_1_mod = grille_cyl_grd.getEdgeJ( 0 , 5 , 1 )
-#Edge_Trou_grd_h_1_mod.addAssociation( Edge_Trou_grd_h_1, 0., 1. )
-
-
-
-#Partition_Trou_grd_bas = geompy.MakePartition([ Edge_Trou_grd_b ], [ z_b_g_t , w_b_g_t , v_b_g_t , u_b_g_t , x_b_g_t ], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
-#geompy.addToStudy( Partition_Trou_grd_bas , "Partition_Trou_grd_bas" )
-
-
-#All_Edge_Partition_Trou_grd_bas = geompy.SubShapeAllSorted(Partition_Trou_grd_bas, geompy.ShapeType["EDGE"])
-
-#Edge_Trou_grd_b_0 = All_Edge_Partition_Trou_grd_bas[0]
-#geompy.addToStudy( Edge_Trou_grd_b_0 , "Edge_Trou_grd_b_0" )
-
-#Edge_Trou_grd_b_0_mod = grille_cyl_grd.getEdgeJ( 0 , 0 , 0 )
-#Edge_Trou_grd_b_0_mod.addAssociation( Edge_Trou_grd_b_0, 0., 1. )
-
-#Edge_Trou_grd_b_2 = All_Edge_Partition_Trou_grd_bas[2]
-#geompy.addToStudy( Edge_Trou_grd_b_2 , "Edge_Trou_grd_b_2" )
-
-#Edge_Trou_grd_b_2_mod = grille_cyl_grd.getEdgeJ( 0 , 1 , 0 )
-#Edge_Trou_grd_b_2_mod.addAssociation( Edge_Trou_grd_b_2, 0., 1. )
-
-#Edge_Trou_grd_b_4 = All_Edge_Partition_Trou_grd_bas[4]
-#geompy.addToStudy( Edge_Trou_grd_b_4 , "Edge_Trou_grd_b_4" )
-
-#Edge_Trou_grd_b_4_mod = grille_cyl_grd.getEdgeJ( 0 , 2 , 0 )
-#Edge_Trou_grd_b_4_mod.addAssociation( Edge_Trou_grd_b_4, 0., 1. )
-
-#Edge_Trou_grd_b_5 = All_Edge_Partition_Trou_grd_bas[5]
-#geompy.addToStudy( Edge_Trou_grd_b_5 , "Edge_Trou_grd_b_5" )
-
-#Edge_Trou_grd_b_5_mod = grille_cyl_grd.getEdgeJ( 0 , 3 , 0 )
-#Edge_Trou_grd_b_5_mod.addAssociation( Edge_Trou_grd_b_5, 0., 1. )
-
-#Edge_Trou_grd_b_3 = All_Edge_Partition_Trou_grd_bas[3]
-#geompy.addToStudy( Edge_Trou_grd_b_3 , "Edge_Trou_grd_b_3" )
-
-#Edge_Trou_grd_b_3_mod = grille_cyl_grd.getEdgeJ( 0 , 4 , 0 )
-#Edge_Trou_grd_b_3_mod.addAssociation( Edge_Trou_grd_b_3, 0., 1. )
-
-#Edge_Trou_grd_b_1 = All_Edge_Partition_Trou_grd_bas[1]
-#geompy.addToStudy( Edge_Trou_grd_b_1 , "Edge_Trou_grd_b_1" )
-
-#Edge_Trou_grd_b_1_mod = grille_cyl_grd.getEdgeJ( 0 , 5 , 0 )
-#Edge_Trou_grd_b_1_mod.addAssociation( Edge_Trou_grd_b_1, 0., 1. )
-
-
-
-
-
-#Partition_Trou_pte_haut = geompy.MakePartition([ Edge_Trou_pte_h ], [ z_h_p_t , w_h_p_t , v_h_p_t , u_h_p_t , x_h_p_t ], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
-#geompy.addToStudy( Partition_Trou_pte_haut , "Partition_Trou_pte_haut" )
-
-
-#All_Edge_Partition_Trou_pte_haut = geompy.SubShapeAllSorted(Partition_Trou_pte_haut, geompy.ShapeType["EDGE"])
-
-#Edge_Trou_pte_h_0 = All_Edge_Partition_Trou_pte_haut[0]
-#geompy.addToStudy( Edge_Trou_pte_h_0 , "Edge_Trou_pte_h_0" )
-
-#Edge_Trou_pte_h_0_mod = grille_cyl_pte.getEdgeJ( 0 , 0 , 1 )
-#Edge_Trou_pte_h_0_mod.addAssociation( Edge_Trou_pte_h_0, 0., 1. )
-
-#Edge_Trou_pte_h_2 = All_Edge_Partition_Trou_pte_haut[2]
-#geompy.addToStudy( Edge_Trou_pte_h_2 , "Edge_Trou_pte_h_2" )
-
-#Edge_Trou_pte_h_2_mod = grille_cyl_pte.getEdgeJ( 0 , 1 , 1 )
-#Edge_Trou_pte_h_2_mod.addAssociation( Edge_Trou_pte_h_2, 0., 1. )
-
-#Edge_Trou_pte_h_4 = All_Edge_Partition_Trou_pte_haut[4]
-#geompy.addToStudy( Edge_Trou_pte_h_4 , "Edge_Trou_pte_h_4" )
-
-#Edge_Trou_pte_h_4_mod = grille_cyl_pte.getEdgeJ( 0 , 2 , 1 )
-#Edge_Trou_pte_h_4_mod.addAssociation( Edge_Trou_pte_h_4, 0., 1. )
-
-#Edge_Trou_pte_h_5 = All_Edge_Partition_Trou_pte_haut[5]
-#geompy.addToStudy( Edge_Trou_pte_h_5 , "Edge_Trou_pte_h_5" )
-
-#Edge_Trou_pte_h_5_mod = grille_cyl_pte.getEdgeJ( 0 , 3 , 1 )
-#Edge_Trou_pte_h_5_mod.addAssociation( Edge_Trou_pte_h_5, 0., 1. )
-
-#Edge_Trou_pte_h_3 = All_Edge_Partition_Trou_pte_haut[3]
-#geompy.addToStudy( Edge_Trou_pte_h_3 , "Edge_Trou_pte_h_3" )
-
-#Edge_Trou_pte_h_3_mod = grille_cyl_pte.getEdgeJ( 0 , 4 , 1 )
-#Edge_Trou_pte_h_3_mod.addAssociation( Edge_Trou_pte_h_3, 0., 1. )
-
-#Edge_Trou_pte_h_1 = All_Edge_Partition_Trou_pte_haut[1]
-#geompy.addToStudy( Edge_Trou_pte_h_1 , "Edge_Trou_pte_h_1" )
-
-#Edge_Trou_pte_h_1_mod = grille_cyl_pte.getEdgeJ( 0 , 5 , 1 )
-#Edge_Trou_pte_h_1_mod.addAssociation( Edge_Trou_pte_h_1, 0., 1. )
-
-
-
-
-#Partition_Trou_pte_bas = geompy.MakePartition([ Edge_Trou_pte_b ], [ z_b_p_t , w_b_p_t , v_b_p_t , u_b_p_t , x_b_p_t ], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
-#geompy.addToStudy( Partition_Trou_pte_bas , "Partition_Trou_pte_bas" )
-
-
-#All_Edge_Partition_Trou_pte_bas = geompy.SubShapeAllSorted(Partition_Trou_pte_bas, geompy.ShapeType["EDGE"])
-
-#Edge_Trou_pte_b_0 = All_Edge_Partition_Trou_pte_bas[0]
-#geompy.addToStudy( Edge_Trou_pte_b_0 , "Edge_Trou_pte_b_0" )
-
-#Edge_Trou_pte_b_0_mod = grille_cyl_pte.getEdgeJ( 0 , 0 , 0 )
-#Edge_Trou_pte_b_0_mod.addAssociation( Edge_Trou_pte_b_0, 0., 1. )
-
-#Edge_Trou_pte_b_2 = All_Edge_Partition_Trou_pte_bas[2]
-#geompy.addToStudy( Edge_Trou_pte_b_2 , "Edge_Trou_pte_b_2" )
-
-#Edge_Trou_pte_b_2_mod = grille_cyl_pte.getEdgeJ( 0 , 1 , 0 )
-#Edge_Trou_pte_b_2_mod.addAssociation( Edge_Trou_pte_b_2, 0., 1. )
-
-#Edge_Trou_pte_b_4 = All_Edge_Partition_Trou_pte_bas[4]
-#geompy.addToStudy( Edge_Trou_pte_b_4 , "Edge_Trou_pte_b_4" )
-
-#Edge_Trou_pte_b_4_mod = grille_cyl_pte.getEdgeJ( 0 , 2 , 0 )
-#Edge_Trou_pte_b_4_mod.addAssociation( Edge_Trou_pte_b_4, 0., 1. )
-
-#Edge_Trou_pte_b_5 = All_Edge_Partition_Trou_pte_bas[5]
-#geompy.addToStudy( Edge_Trou_pte_b_5 , "Edge_Trou_pte_b_5" )
-
-#Edge_Trou_pte_b_5_mod = grille_cyl_pte.getEdgeJ( 0 , 3 , 0 )
-#Edge_Trou_pte_b_5_mod.addAssociation( Edge_Trou_pte_b_5, 0., 1. )
-
-#Edge_Trou_pte_b_3 = All_Edge_Partition_Trou_pte_bas[3]
-#geompy.addToStudy( Edge_Trou_pte_b_3 , "Edge_Trou_pte_b_3" )
-
-#Edge_Trou_pte_b_3_mod = grille_cyl_pte.getEdgeJ( 0 , 4 , 0 )
-#Edge_Trou_pte_b_3_mod.addAssociation( Edge_Trou_pte_b_3, 0., 1. )
-
-#Edge_Trou_pte_b_1 = All_Edge_Partition_Trou_pte_bas[1]
-#geompy.addToStudy( Edge_Trou_pte_b_1 , "Edge_Trou_pte_b_1" )
-
-#Edge_Trou_pte_b_1_mod = grille_cyl_pte.getEdgeJ( 0 , 5 , 0 )
-#Edge_Trou_pte_b_1_mod.addAssociation( Edge_Trou_pte_b_1, 0., 1. )
-
-##====================================
-## CREATION DES FACES DES ARRONDIES
-##====================================
-
-#All_Face_Arron_Bielle = geompy.SubShapeAllSorted(Bielle_geom, geompy.ShapeType["FACE"])
-
-#Face_Arron_1 = All_Face_Arron_Bielle[2]
-#geompy.addToStudy(Face_Arron_1, "Face_Arron_1")
-
-#Quad_Arron_1 = grille_cyl_pte.getQuadJK( 1 , 1 , 0 )
-
-#Face_Arron_2 = All_Face_Arron_Bielle[3]
-#geompy.addToStudy(Face_Arron_2, "Face_Arron_2")
-
-#Quad_Arron_2 = grille_cyl_pte.getQuadJK( 1 , 4 , 0 )
-
-#Face_Arron_3 = All_Face_Arron_Bielle[8]
-#geompy.addToStudy(Face_Arron_3, "Face_Arron_3")
-
-#Quad_Arron_3 = grille_cyl_grd.getQuadJK( 1 , 1 , 0 )
-
-#Face_Arron_4 = All_Face_Arron_Bielle[9]
-#geompy.addToStudy(Face_Arron_4, "Face_Arron_4")
-
-#Quad_Arron_4 = grille_cyl_grd.getQuadJK( 1 , 4 , 0 )
-
-
-
-
-
-
-#====================================
-# CREATION MAILLAGE
-#====================================
-
-
-#=================================================
-# Definir les groupes d elements pour le maillage
-#=================================================
-
-# On definit 3 groupes de mailles
-
-# groupe d edges (arretes)
-
-Edge_grp = doc.addEdgeGroup("Edge_grp")
-Nbr_Edg = doc.countEdge()
-#print Nbr_Edg
-for i in range(Nbr_Edg):
-    Edge_i = doc.getEdge(i)
-    Edge_grp.addElement(Edge_i)
-
-
-# groupe de quads (faces)
-Quad_grp = doc.addQuadGroup("Quad_grp")
-Nbr_Qad = doc.countQuad()
-#print Nbr_Qad
-for i in range(Nbr_Qad):
-    Quad_i = doc.getQuad(i)
-    Quad_grp.addElement(Quad_i)
-
-# groupe d hexas (solids)
-Hexa_grp = doc.addHexaGroup("Hexa_grp")
-Nbr_Hex = doc.countHexa()
-#print Nbr_Hex
-for i in range(Nbr_Hex):
-    Hexa_i = doc.getHexa(i)
-    Hexa_grp.addElement(Hexa_i)
-
-
-
-# groupe de noeuds de vertex pour tout le modele 
-Vertex_Nod_Grp = doc.addVertexNodeGroup("Vertex_Nod_Grp")
-Nbr_Vx = doc.countVertex()
-#print Nbr_Vx
-for i in range(Nbr_Vx):
-    Vertex_i = doc.getVertex(i)
-    Vertex_Nod_Grp.addElement(Vertex_i)
-    
-
-#====================================
-# Definir une loi de discretisation
-#====================================
-# definir une loi: le choix de la loi reste aux utilisateurs
-Law = doc.addLaw( "Uniform" , 4 )
-
-#n = doc.countLaw()
-#print n
-
-# chercher les propagations du modele
-N_Propa = doc.countPropagation()
-
-for j in range(N_Propa):
-    Propa = doc.getPropagation(j)
-    Propa.setLaw( Law )# appliquer la loi de discretisation sur tout le modele et generer le maillage
-
-mesh = hexablock.mesh(doc, "test_BIELLE_no_assoc")
-
-print  " --- MAILLAGE HEXAHEDRIQUE --- "
-print "Nombre d hexaedres:"   , mesh.NbHexas()
-print "Nombre de quadrangles:", mesh.NbQuadrangles()
-print "Nombre de segments:"   , mesh.NbEdges()
-print "Nombre de noeuds:"     , mesh.NbNodes()
diff --git a/src/TEST_PY/test_HEXABLOCK.py b/src/TEST_PY/test_HEXABLOCK.py
deleted file mode 100755 (executable)
index e53d07d..0000000
+++ /dev/null
@@ -1,418 +0,0 @@
-# -*- coding: latin-1 -*-
-# Copyright (C) 2009-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
-#
-
-import hexablock
-
-
-# ======================================================== test_sphere
-def test_sphere ():
-  doc = hexablock.addDocument ("default")
-  orig = doc.addVertex (0,0,0)
-
-  ncouches = 1
-  k = 0.8
-  decal  = doc.addVector (1,1,1)
-  sphere = doc.makeSpherical (orig, decal, ncouches, k)
-
-  for nc in range(ncouches):
-    cell = sphere.getStrate (nc, Q_A)
-    cell.remove ()
-
-  sphere.saveVtk ("sphere.vtk")
-  print "test_sphere OK"
-
-# ======================================================== test_cartesi1
-def test_cartesi1 ():
-  size_x = 15
-  size_y = 12
-  size_z = 8
-
-  doc = hexablock.addDocument ()
-  orig = doc.addVertex (0,0,0)
-
-  dirVr = doc.addVector (1,1,1)
-  grid  = doc.makeCartesian1 (orig, dirVr, size_x,size_y,size_z, 0, 0, 0 ) #CS_NOT_SPEC (makeCartesian1)
-
-   #for (int nz=0 nz<size_z  nz++)
-       #for (int ny=nz+1 ny<size_y-nz-1  ny++)
-           #for (int nx=nz+1 nx<size_x-nz-1  nx++)
-               
-               ##  grid.getHexa (nx, ny, nz).remove ()
-               #Hexa* cell = grid.getHexa (nx, ny, nz)
-               #cell.remove ()
-
-  grid.saveVtk ("hexa1.vtk")
-  print "test_cartesi1 OK"
-  # doc.dump ()
-
-## ======================================================== afficher
-##define Afficher(elt) afficher (#elt, elt)
-#def afficher (cpchar nom, EltBase* elt):
-
-   #if (elt==NULL)
-      
-      #printf (" .... %s = 0x0\n", nom)
-      #return HOK
-      
-
-   #printf (" .... %s = 0x%08lx = %03d\n", nom, (unsigned long) elt, elt.getId())
-   #return HOK
-
-# ======================================================== test_find
-def test_find ():
-   size_x = 2
-   size_y = 2
-   size_z = 2
-
-   doc = hexablock.addDocument ()
-
-   orig = doc.addVertex (0,0,0)
-   dirVr  = doc.addVector (1,1,1)
-   grid = doc.makeCartesian1 (orig, dirVr, size_x,size_y,size_z, 0, 0, 0 )
-
-   grid.saveVtk ("mini1.vtk")
-   #doc.dump()
-
-   v00 = doc.findVertex (0, 0, 0)
-   v02 = doc.findVertex (1, 1, 0)
-   v06 = doc.findVertex (1, 1, 1)
-   v08 = doc.findVertex (2, 1, 0)
-   v10 = doc.findVertex (2, 1, 1)
-   v22 = doc.findVertex (2, 1, 2)
-   v26 = doc.findVertex (2, 2, 2)
-
-   assert v00
-   assert v02
-   assert v06
-   assert v08
-   assert v10
-   assert v22
-   assert v26
-
-   assert doc.findEdge (v06, v10)
-   assert doc.findEdge (v10, v06)
-
-
-   assert doc.findQuad (v02, v10)
-   assert doc.findQuad (v06, v08)
-   assert not doc.findQuad (v02, v06)
-
-
-   assert doc.findHexa (v00, v06)
-   assert doc.findHexa (v06, v26)
-   assert doc.findHexa (v26, v06)
-   print "test_find OK"
-
-# ======================================================== test_joint
-def test_joint ():
-  dimx = 11
-  dimy = 11
-  dimz = 2
-  doc = hexablock.addDocument ()
-
-  orig1 = doc.addVertex (0,0,0)
-  dirVr = doc.addVector (1,1,1)
-
-  grid1 = doc.makeCartesian1(orig1, dirVr, dimx,dimy,dimz , 0, 0, 0 )
-
-  orig2 = doc.addVertex  (dimx/2.0,0,8)
-  vectj = doc.addVector (0,1,0)
-  vecti = doc.addVector (1,0,0)
-  grid2 = doc.makeCylindrical (orig2, vecti, vectj, 1, 180, 1,dimz,dimy,dimx, False)
-  
-  mx = dimx/2
-  my = dimy/2
-  prems = grid1.getQuad1 (hexablock.DIR_Z, mx, my, dimz)
-  cible = grid2.getQuad1 (hexablock.DIR_X, dimz, mx, my)
-
-  v1 = prems.getVertex (0)
-  v2 = cible.getVertex (0)
-  v3 = prems.getVertex (1)
-  v4 = cible.getVertex (3)
-
-  liste  = []
-  miroir = []
-
-  liste += [prems]
-  for nx in range (dimx):
-    if ( nx != mx ):
-      liste += [grid1.getQuad1 (hexablock.DIR_Z, nx, my, dimz)]
-
-  for ny in range (dimy):
-    if ( ny != my ):
-      liste += [grid1.getQuad1 (hexablock.DIR_Z, mx, ny, dimz)]
-
-   # Elements* joint = 
-   #
-  doc.joinQuads(liste, cible, v1, v2, v3, v4, 5)
-  doc.saveVtk ("joint.vtk")
-  print "test_joint OK"
-
-# ======================================================== test_hexa1
-def test_hexa1 ():
-   size_x = 1
-   size_y = 1
-   size_z = 1
-
-   doc = hexablock.addDocument ()
-   orig  = doc.addVertex (0,0,0)
-   dirVr = doc.addVector (1,1,1)
-   #  Elements*  grid = 
-   doc.makeCartesian1 (orig, dirVr, size_x,size_y,size_z, 0, 0, 0 )
-
-   #doc.dump ()
-   print "test_hexa1 OK"
-
-# ======================================================== test_decoupage
-def test_decoupage ():
-  size_x = 2
-  size_y = 1
-  size_z = 1
-
-  doc = hexablock.addDocument ()
-
-  orig = doc.addVertex (0,0,0)
-  dirVr = doc.addVector (1,1,1)
-
-  grid  = doc.makeCartesian1 (orig, dirVr, size_x,size_y,size_z, 0, 0, 0 )
-  #arete = grid.getEdge ( HEXA_ORB.hexablock.DIR_Z, 0, 0, 0)
-  arete = grid.getEdge1( hexablock.DIR_Z, 0, 0, 0 )
-
-  #doc.dump()
-  doc.saveVtk ("no_decoupe.vtk")
-  doc.cut (arete, 1)
-
-  #doc .dump ()
-  doc .saveVtk ("decoupe.vtk")
-  # doc .saveFile ()
-  print "test_decoupage OK"
-
-# ======================================================== test_gen_xml
-def test_gen_xml ():
-
-  size_x = 2
-  size_y = 2
-  size_z = 2
-
-  doc = hexablock.addDocument ()
-
-  orig  = doc.addVertex (0,0,0)
-  dirVr = doc.addVector (1,1,1)
-  grid  = doc.makeCartesian1 (orig, dirVr, size_x,size_y,size_z, 0, 0, 0 )
-
-  cell    = grid.getHexa (0)
-  face    = cell.getQuad (0)
-  arete   = cell.getEdge (0)
-  noeud   = cell.getVertex (0)
-
-  #CS_TODO?
-  #shape1 = Shape()
-  #shape2 = Shape()
-  #shape3 = Shape()
-
-  #noeud.setAssociation (shape1)
-  #arete.setAssociation (shape2)
-  #face .setAssociation (shape3)
-
-  law1 = doc.addLaw("loi1", 1)
-  law2 = doc.addLaw("loi2", 2)
-  law3 = doc.addLaw("loi3", 3)
-
-  law1.setKind (hexablock.UNIFORM)
-  law2.setKind (hexablock.ARITHMETIC)
-  law3.setKind (hexablock.GEOMETRIC)
-
-  prop1 = doc.getPropagation (0)
-  prop2 = doc.getPropagation (1)
-  prop3 = doc.getPropagation (2)
-
-  prop1.setLaw (law1)
-  prop2.setLaw (law2)
-  prop3.setLaw (law3)
-
-  prop1.setWay (True)
-  prop2.setWay (False)
-  prop3.setWay (True)
-
-  doc .saveVtk ("mini.vtk")
-  doc .setFile ("Essai")
-  doc .saveFile ()
-  print "test_gen_xml OK"
-
-
-
-# ======================================================== test_relecture
-def test_relecture ():
-  doc = hexablock.loadDocument ("Essai")
-
-  #doc .dump ()
-  doc .saveVtk ("restore.vtk")
-  print "test_relecture OK"
-
-# ======================================================== test_clone
-def test_clone ():
-  size_x = 2
-  size_y = 2
-  size_z = 2
-  doc = hexablock.addDocument ()
-
-  orig = doc.addVertex (0,0,0)
-  dirVr = doc.addVector (1,1,1)
-  grid  = doc.makeCartesian1 (orig, dirVr, size_x,size_y,size_z, 0, 0, 0 )
-
-  bond  = doc.addVector (0, 0, 7)
-  #  Elements* grid2 = doc.makeTranslation (grid, bond)
-  doc.makeTranslation (grid, bond)
-
-  doc.saveVtk ("clonage.vtk")
-  #doc.dump()
-  print "test_clone OK"
-
-# ======================================================== test_separ
-def test_separ ():
-  size_x = 2
-  size_y = 2
-  size_z = 2
-
-  doc = hexablock.addDocument ()
-
-  orig  = doc.addVertex (0,0,0)
-  dirVr = doc.addVector (1,1,1)
-
-  doc.makeCartesian1 (orig, dirVr, size_x,size_y,size_z, 0, 0, 0 )
-
-  doc .saveVtk ("separ.vtk")
-  #doc .dump()
-  print "test_separ OK"
-
-
-# ======================================================== test_cyl
-def test_cyl ():
-  doc = hexablock.addDocument ()
-
-  orig = doc.addVertex (0,0,0)
-  haut = doc.addVector (0,0,1)
-  base = doc.addVector (1,0,0)
-
-  dr = 1
-  # double da = 360 # degres
-  dl = 1
-  nr = 2
-  na = 9
-  nl = 5
-
-  cyl1 = doc.makeCylindrical(orig,base,haut,dr, 360,dl,nr,na,nl)
-  cyl1.saveVtk ("cylindre_full.vtk")
-
-  cyl2 = doc.makeCylindrical(orig,haut,base,dr, 270,dl,nr,na,nl)
-  cyl2.saveVtk ("cylindre_34.vtk")
-
-  # doc.dump ()
-  print "test_cyl OK"
-
-# ======================================================== test_propagation
-def test_propagation ():
-  size_x = 2
-  size_y = 1
-  size_z = 1
-
-  doc = hexablock.addDocument ()
-
-  orig = doc.addVertex (0,0,0)
-  dirVr = doc.addVector (1,1,1)
-
-  doc.makeCartesian1 (orig, dirVr, size_x,size_y,size_z, 0, 0, 0 )
-
-  nb = doc.countPropagation ()
-
-  for nro in range(nb):
-    prop  = doc .getPropagation (nro)
-    edges = prop.getEdges ()
-    print " ____________________________________ Prop nro %s\n"%nro
-    for e in edges:
-      way = e.getWay ()
-      if (way):
-        print "     (%s,%s)\n"%( e.getVertex(0).name, e.getVertex(1).name )
-      else:
-        print "     (%s,%s)\n"%( e.getVertex(1).name, e.getVertex(0).name )
-
-  #doc.dump  ()
-  doc.saveVtk ("test_propagation.vtk")
-  doc.setFile ("test_propagation")
-  doc.saveFile ()
-  print "test_propagation OK"
-
-
-# ======================================================== test_move
-def test_move ():
-  size_x = 1
-  size_y = 1
-  size_z = 2
-
-  doc = hexablock.addDocument ()
-
-  orig  = doc.addVertex (0,0,0)
-  dirVr = doc.addVector (1,1,1)
-  grid  = doc.makeCartesian1 (orig, dirVr, size_x,size_y,size_z, 0, 0, 0 )
-
-  enhaut = doc.addVector (0, 0, 5)
-  devant = doc.addVector (5, 0, 0)
-  agauche = doc.addVector (0, 5, 0)
-
-  #CS_TODO?
-  #matrice = Matrix() 
-  #matrice.defTranslation (enhaut)
-
-  cube    = grid.getHexa (1)
-  dessous = cube.getQuad (0)#(Q_A) #CS_TODO?
-  #dessous.dump()
-
-  grid2 = doc.makeTranslation (grid, devant)
-  doc.makeTranslation (grid, agauche)
-  cube2 = grid2.getHexa (1)
-
-  cube .disconnectQuad (dessous)
-  
-  #CS_TODO?
-  #cube .transform( matrice )
-  #cube2.transform( matrice )
-
-
-  doc .saveVtk ("move.vtk")
-  #doc .dump()
-  print "test_move OK, CS_TODO?"
-
-
-
-
-#test_sphere () KO
-test_cartesi1 ()
-test_find ()
-test_joint ()
-test_hexa1 ()
-test_decoupage ()
-test_gen_xml ()
-#test_relecture () KO
-#test_clone ()
-#test_separ ()
-#test_cyl ()
-#test_propagation ()
-#test_move ()
-
diff --git a/src/TEST_PY/test_INTER_3_CYLINDRE_no_assoc.py b/src/TEST_PY/test_INTER_3_CYLINDRE_no_assoc.py
deleted file mode 100755 (executable)
index 160270a..0000000
+++ /dev/null
@@ -1,433 +0,0 @@
-# -*- coding: latin-1 -*-
-# Copyright (C) 2009-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
-#
-
-#===============================================
-# By Karima DEBCHI YATAGHENE Nov 2009 at CS 
-#===============================================
-
-import SALOME
-import geompy
-import smesh
-import hexablock
-import math
-
-
-
-#=============================
-# CREATION DOCUMENT
-#=============================
-
-doc = hexablock.addDocument ("default")
-
-#=============================
-# CREATION DU MODELE
-#=============================
-
-# Pour l'intersection des trois cylindres on doit s enservir des modeles predefinis des cylindres deja decoupes
-
-#=============================
-# PARAMETRES
-#=============================
-
-R = 5.0
-
-r_pte = R
-
-r_moy = 2*R
-
-r_grd = 4*R
-
-l = 200
-h = 100
-
-# Taille du 1er petit cylindre
-dr_pte_1 = 20
-da_pte_1 = 360
-dl_pte_1 = 200
-
-nr_pte_1 = 1
-na_pte_1 = 4 #remplissage a l interieur de 1 hexa
-nl_pte_1 = 1
-
-# Taille du 1er grand cylindre
-dr_grd_1 = 50
-da_grd_1 = 360
-dl_grd_1 = 150
-
-nr_grd_1 = 1
-na_grd_1 = 12 #remplissage a l interieur de 8 hexas
-nl_grd_1 = 1
-
-# Taille du 2eme petit cylindre
-dr_pte_2 = 50
-da_pte_2 = 360
-dl_pte_2 = 200
-
-nr_pte_2 = 1
-na_pte_2 = 12 #remplissage a l interieur de 8 hexas
-nl_pte_2 = 1
-
-# Taille du 2eme grand cylindre
-dr_grd_2 = 100
-da_grd_2 = 360
-dl_grd_2 = 400
-
-nr_grd_2 = 1
-na_grd_2 = 18 #remplissage a l interieur de 8 hexas
-nl_grd_2 = 1
-
-
-
-#=============================
-# Creation des vecteurs
-#=============================
-
-DX = doc.addVector( 1 , 0 , 0 )
-DY = doc.addVector( 0 , 1 , 0 )
-DZ = doc.addVector( 0 , 0 , 1 )
-
-
-#===================================
-# Creation des centres de cylindres
-#===================================
-
-C_pte_1 = doc.addVertex( -h , 0 , h )
-C_grd_1 = doc.addVertex( 0 , 0 , 0 )
-
-C_pte_2 = doc.addVertex( 0 , 0 , 3*h )
-C_grd_2 = doc.addVertex( -2*h , 0 , 4*h )
-
-#C_pte_1 = doc.addVertex( 190 , 0 , 220 )
-#C_grd_1 = doc.addVertex( 300 , 0 , 400 )
-
-#C_pte_2 = doc.addVertex( 200 , 0 , 400 )
-#C_grd_2 = doc.addVertex( 0 , 0 , 0 )
-
-
-#================================
-# Creation du 1er petit cylindre
-#================================
-
-Cyl_pte_1 = doc.addCylinder( C_pte_1 , DX , dr_pte_1 , dl_pte_1 )
-#Cyl_pte_1 = doc.addCylinder( C_pte_1 , DX , 5 , 100 )
-#Cyl_pte_1.saveVtk("/tmp/Cyl_pte_1.vtk")
-
-#================================
-# Creation du 1er grand cylindre
-#================================
-
-Cyl_grd_1 = doc.addCylinder( C_grd_1 , DZ , dr_grd_1 , dl_grd_1 )
-#Cyl_grd_1 = doc.addCylinder( C_grd_1 , DZ , 10 , 200 )
-#Cyl_grd_1.saveVtk("/tmp/Cyl_grd_1.vtk")
-
-#================================
-# Creation du 2eme petit cylindre
-#================================
-
-Cyl_pte_2 = doc.addCylinder( C_pte_2 , DZ , dr_pte_2 , dl_pte_2 )
-#Cyl_pte_2 = doc.addCylinder( C_pte_2 , DZ , 10 , 200 )
-#Cyl_pte_2.saveVtk("/tmp/Cyl_pte_2.vtk")
-
-#================================
-# Creation du 2eme grand cylindre
-#================================
-
-Cyl_grd_2 = doc.addCylinder( C_grd_2 , DX , dr_grd_2 , dl_grd_2 )
-#Cyl_grd_2 = doc.addCylinder( C_grd_2 , DX , 20 , 200 )
-#Cyl_grd_2.saveVtk("/tmp/Cyl_grd_2.vtk")
-
-
-
-#=================================
-# Intersection cylindres decoupes
-#=================================
-
-
-Cyl_Decou_Cyl_pte_grd_1 = doc.makeCylinders( Cyl_pte_1 , Cyl_grd_1 )
-
-Cyl_Decou_Cyl_pte_grd_2 = doc.makeCylinders( Cyl_pte_2 , Cyl_grd_2 )
-
-
-
-#====================================================================
-# Recuperation des quads qui servent a fusionner les deux partitions
-#====================================================================
-
-
-
-# reperer les quads du 1er decoupe des cylindres
-# on a besoin des quads IJ dans le plan XY
-
-#ni = 2
-#nj = 4
-#nk = 4
-
-#0 <= i < ni = 2
-#0 <= j < nj = 4
-#0 <= k < nk + 1 = 5
-
-#quad_decoup1_x0_y0_z4 = Cyl_Decou_Cyl_pte_grd_1.getQuadIJ( 1 , 0 , 0 , 4 )
-
-#vx_1 = Cyl_Decou_Cyl_pte_grd_1.getVertexIJK( 1 , 0 , 0 , 4 )
-#vx_2 = Cyl_Decou_Cyl_pte_grd_1.getVertexIJK( 1 , 1 , 2 , 4 )
-
-
-#ni = 2
-#nj = 8
-#nk = 4
-
-#0 <= i < ni = 2
-#0 <= j < nj = 8
-#0 <= k < nk + 1 = 5
-
-#quad_decoup1_x1_y0_z4 = Cyl_Decou_Cyl_pte_grd_1.getQuadIJ( 1 , 1 , 0 , 4 )
-
-#vx_1 = Cyl_Decou_Cyl_pte_grd_1.getVertexIJK( 1 , 2 , 0 , 4 )
-#vx_2 = Cyl_Decou_Cyl_pte_grd_1.getVertexIJK( 1 , 2 , 1 , 4 )
-
-
-
-
-# reperer les quads du 2eme decoupe des cylindres
-# on a besoin des quads IJ dans le plan XY
-
-#ni = 2
-#nj = 4
-#nk = 4
-
-#0 <= i < ni = 2
-#0 <= j < nj = 4
-#0 <= k < nk + 1 = 5
-
-quad_decoup2_x0_y0_z0 = Cyl_Decou_Cyl_pte_grd_2.getQuadIJ( 0 , 0 , 0 , 0 )
-quad_decoup2_x0_y1_z0 = Cyl_Decou_Cyl_pte_grd_2.getQuadIJ( 0 , 0 , 1 , 0 )
-quad_decoup2_x0_y2_z0 = Cyl_Decou_Cyl_pte_grd_2.getQuadIJ( 0 , 0 , 2 , 0 )
-quad_decoup2_x0_y3_z0 = Cyl_Decou_Cyl_pte_grd_2.getQuadIJ( 0 , 0 , 3 , 0 )
-
-#list_quad_decoup2_x0 = [ quad_decoup2_x0_y0_z0 , quad_decoup2_x0_y1_z0 , quad_decoup2_x0_y2_z0 , quad_decoup2_x0_y3_z0 ]
-
-#vx_1_prim = Cyl_Decou_Cyl_pte_grd_2.getVertexIJK( 0 , 0 , 0 , 0 )
-#vx_2_prim = Cyl_Decou_Cyl_pte_grd_2.getVertexIJK( 0 , 1 , 2 , 0 )
-
-
-
-#ni = 2
-#nj = 8
-#nk = 4
-
-#0 <= i < ni = 2
-#0 <= j < nj = 8
-#0 <= k < nk + 1 = 5
-
-#for j in [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ]:
-    #for i in [ 0 , 1 ]:
-       #quad_list = Cyl_Decou_Cyl_pte_grd_2.getQuadIJ( 0 , i , j , 0 )
-
-quad_decoup2_x1_y0_z0 = Cyl_Decou_Cyl_pte_grd_2.getQuadIJ( 0 , 1 , 0 , 0 )
-quad_decoup2_x1_y1_z0 = Cyl_Decou_Cyl_pte_grd_2.getQuadIJ( 0 , 1 , 1 , 0 )
-quad_decoup2_x1_y2_z0 = Cyl_Decou_Cyl_pte_grd_2.getQuadIJ( 0 , 1 , 2 , 0 )
-quad_decoup2_x1_y3_z0 = Cyl_Decou_Cyl_pte_grd_2.getQuadIJ( 0 , 1 , 3 , 0 )
-quad_decoup2_x1_y4_z0 = Cyl_Decou_Cyl_pte_grd_2.getQuadIJ( 0 , 1 , 4 , 0 )
-quad_decoup2_x1_y5_z0 = Cyl_Decou_Cyl_pte_grd_2.getQuadIJ( 0 , 1 , 5 , 0 )
-quad_decoup2_x1_y6_z0 = Cyl_Decou_Cyl_pte_grd_2.getQuadIJ( 0 , 1 , 6 , 0 )
-quad_decoup2_x1_y7_z0 = Cyl_Decou_Cyl_pte_grd_2.getQuadIJ( 0 , 1 , 7 , 0 )
-
-list_quad_decoup2_x1 = [ quad_decoup2_x1_y2_z0 , quad_decoup2_x0_y0_z0 , quad_decoup2_x0_y1_z0 , quad_decoup2_x0_y2_z0 , quad_decoup2_x0_y3_z0 , quad_decoup2_x1_y0_z0 , quad_decoup2_x1_y1_z0 , quad_decoup2_x1_y2_z0 , quad_decoup2_x1_y3_z0 , quad_decoup2_x1_y4_z0 , quad_decoup2_x1_y5_z0 , quad_decoup2_x1_y6_z0 , quad_decoup2_x1_y7_z0 ]
-
-quad_decoup1_x1_y0_z4 = Cyl_Decou_Cyl_pte_grd_1.getQuadIJ( 1 , 1 , 0 , 4 )
-
-vx_1 = Cyl_Decou_Cyl_pte_grd_1.getVertexIJK( 1 , 2 , 0 , 4 )
-vx_2 = Cyl_Decou_Cyl_pte_grd_1.getVertexIJK( 1 , 2 , 1 , 4 )
-
-vx_1_prim = Cyl_Decou_Cyl_pte_grd_2.getVertexIJK( 0 , 2 , 2 , 0 )
-vx_2_prim = Cyl_Decou_Cyl_pte_grd_2.getVertexIJK( 0 , 2 , 3 , 0 )
-
-
-jointure = doc.joinQuads( list_quad_decoup2_x1 , quad_decoup1_x1_y0_z4 , vx_1_prim , vx_1 , vx_2_prim , vx_2 , 3 )
-
-
-
-
-#jointure.saveVtk("/tmp/jointure.vtk")
-#doc.saveVtk("/tmp/inter.vtk")
-
-
-##==========================
-## CREATION ASSOCIATION
-##==========================
-
-
-##========================================
-## INTERSECTION DES TROIS CYLINDRES GEOM
-##========================================
-
-#Inter_Cylin_geom = geompy.Import("/export/home/PR_HEX/SCRIPTS/cao_cea/tees.brep", "BREP")
-
-#geompy.addToStudy(Inter_Cylin_geom, "Inter_Cylin_geom")
-#36
-
-## Remarque:
-### 1- On a utiliser les memes parametres de la geometrie des trois cylindres dans l'espace
-###    pour construire notre modele hexa ( intersection des trois cylindres )
-### 2- On conclu qu'on a pas besoin d'une association pts par pts comme les 3 cas tests precedemment
-###    realises
-### 3- l'association sa se fait automatiquement
-### 4- donc on passe directement a la creation du maillage
-
-
-
-
-
-
-
-
-
-##====================================
-## CREATION GROUPES DU MAILLAGE
-##====================================
-
-# On definit 3 groupes de mailles
-
-# groupe d edges (arretes)
-
-Edge_grp = doc.addEdgeGroup("Edge_grp")
-Nbr_Edg = doc.countEdge()
-#print Nbr_Edg
-for i in range(Nbr_Edg):
-    Edge_i = doc.getEdge(i)
-    Edge_grp.addElement(Edge_i)
-
-
-# groupe de quads (faces)
-Quad_grp = doc.addQuadGroup("Quad_grp")
-Nbr_Qad = doc.countQuad()
-#print Nbr_Qad
-for i in range(Nbr_Qad):
-    Quad_i = doc.getQuad(i)
-    Quad_grp.addElement(Quad_i)
-
-# groupe d hexas (solids)
-Hexa_grp = doc.addHexaGroup("Hexa_grp")
-Nbr_Hex = doc.countHexa()
-#print Nbr_Hex
-for i in range(Nbr_Hex):
-    Hexa_i = doc.getHexa(i)
-    Hexa_grp.addElement(Hexa_i)
-
-
-
-# groupe de noeuds de vertex pour tout le modele 
-Vertex_Nod_Grp = doc.addVertexNodeGroup("Vertex_Nod_Grp")
-Nbr_Vx = doc.countVertex()
-#print Nbr_Vx
-
-for i in range(Nbr_Vx):
-    Vertex_i = doc.getVertex(i)
-    Vertex_Nod_Grp.addElement(Vertex_i)
-
-
-
-
-
-##====================================
-## CREATION MAILLAGE
-##====================================
-
-
-##====================================
-## Definir une loi de discretisation
-##====================================
-
-
-# definir une loi: le choix de la loi reste aux utilisateurs
-
-Law = doc.addLaw( "Uniform" , 4 )
-
-#petit test
-n = doc.countLaw()
-print n
-
-# chercher les propagations du modele
-
-N_Propa = doc.countPropagation()
-
-for j in range(N_Propa):
-       Propa = doc.getPropagation(j)
-       Propa.setLaw( Law )# appliquer la loi de discretisation sur tout le modele et generer le maillage
-
-try:
-    mesh = hexablock.mesh(doc, "test_INTER_3_CYLINDRE_no_assoc")
-except SALOME.SALOME_Exception, ex:
-    print "Mesh computation failed, exception caught:"
-    print "    ", ex.details.text
-except:
-    import traceback
-    print "Mesh computation failed, exception caught:"
-    traceback.print_exc()
-
-
-print "Nombre d'hexaedres:"   , mesh.NbHexas()
-print "Nombre de quadrangles:", mesh.NbQuadrangles()
-print "Nombre de segments:"   , mesh.NbEdges()
-print "Nombre de noeuds:"     , mesh.NbNodes()
-
-
-#nQuad = doc.countQuad();
-#print "countQuad = ",nQuad
-
-###qds = [2,6,10,14]
-##qds = [2,6,10,14]
-##for j in qds:
-#for j in range(nQuad):
-  #q = doc.getQuad(j)
-  ##ok = smesh.computeQuad(q, False)
-  #ok = smesh.computeQuad(q, True)
-  #print "quad j->",j
-  #print "ok ->",ok
-
-
-## --------------------
-## Maillage hexa�drique
-## --------------------
-#mesh = mesh.ExportMED( "3cyl.med", 1 )
-#maillages = smesh.CreateMeshesFromMED( "3cyl.med" )
-
-#ijk = maillages[0][0]
-
-#ijk.Hexahedron()
-
-#ijk.Compute()
-
-#print  4*" -- ijk --- "
-#print "Nombre d hexaedres:", ijk.NbHexas()
-#print "Nombre de quadrangles:", ijk.NbQuadrangles()
-#print "Nombre de segments:", ijk.NbEdges()
-#print "Nombre de noeuds:", ijk.NbNodes()
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/TEST_PY/test_TUYAU_COURBE_no_assoc.py b/src/TEST_PY/test_TUYAU_COURBE_no_assoc.py
deleted file mode 100755 (executable)
index b326461..0000000
+++ /dev/null
@@ -1,466 +0,0 @@
-# -*- coding: latin-1 -*-
-# Copyright (C) 2009-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
-#
-
-#===============================================
-# By Karima DEBCHI YATAGHENE Nov 2009 at CS 
-#===============================================
-
-import os
-#import GEOM
-import geompy
-import smesh
-import hexablock
-import math
-#import SALOMEDS
-
-
-BREP_PATH = os.path.expandvars("$HEXABLOCK_ROOT_DIR/bin/salome/tuyau.brep")
-
-#=============================
-# CREATION DOCUMENT
-#=============================
-
-doc = hexablock.addDocument ("default")
-
-#=============================
-# CREATION DU MODELE
-#=============================
-
-# Pour le tuyau on doit creer une grille cylindrique
-
-#=============================
-# PARAMETRES
-#=============================
-
-R = 4.5
-
-r = 4.5
-r_t = 3.6
-
-h = 75.0
-
-# Taille du cylindre
-dr = R
-da = 360
-dl = h
-
-nr = 1
-na = 4
-nl = 1
-
-
-#=============================
-# Creation des vecteurs
-#=============================
-
-dx = doc.addVector(h, 0, 0)
-dy = doc.addVector(0, h, 0)
-dz = doc.addVector(0, 0, h)
-
-
-#=================================================
-# Creation du centre de la grille cylindrique
-#=================================================
-
-c = doc.addVertex(0, 0, 0)
-
-#=================================================
-# Creation de la grille cylindrique
-#=================================================
-
-grille_cyl = doc.makeCylindrical(c, dx, dz, dr, da, dl, nr, na, nl, False)
-
-# on obtient une liste qui contient 4 hexaedres eguaux
-
-# 30� = pi/6
-# 60� = pi/3
-# 45� = pi/4
-# 90� = pi/2
-# 180� = pi
-
-
-#=================================================
-# Model tuyau final
-#=================================================
-
-model_tuyau_fin = grille_cyl
-
-
-#model_tuyau_fin.saveVtk("/tmp/tuyau.vtk")
-#grille_cyl.saveVtk("/tmp/grille_cyl.vtk")
-
-
-
-#===================================================================
-# Recuperation des vertex du model hexa tuyau pour l'association
-#===================================================================
-
-## NB:
-## h = haut
-## b = bas
-## g = grand
-## p = petit
-## t = trou
-
-
-# Face du haut grand rayon
-
-x_mod_h = doc.findVertex( 2*R , 0 , h )
-y_mod_h = doc.findVertex( 0 , 2*R , h )
-z_mod_h = doc.findVertex( -2*R , 0 , h )
-u_mod_h = doc.findVertex( 0 , -2*R , h )
-
-# Face du haut petit rayon
-
-x_mod_h_t = doc.findVertex( R , 0 , h )
-y_mod_h_t = doc.findVertex( 0 , R , h )
-z_mod_h_t = doc.findVertex( -R , 0 , h )
-u_mod_h_t = doc.findVertex( 0 , -R , h )
-
-
-# Face du bas grand rayon
-
-x_mod_b = doc.findVertex( 2*R , 0 , 0 )
-y_mod_b = doc.findVertex( 0 , 2*R , 0 )
-z_mod_b = doc.findVertex( -2*R , 0 , 0 )
-u_mod_b = doc.findVertex( 0 , -2*R , 0 )
-
-# Face du bas petit rayon
-
-x_mod_b_t = doc.findVertex( R , 0 , 0 )
-y_mod_b_t = doc.findVertex( 0 , R , 0 )
-z_mod_b_t = doc.findVertex( -R , 0 , 0 )
-u_mod_b_t = doc.findVertex( 0 , -R , 0 )
-
-
-#===================================================================
-# Recuperation des points de la geometrie tuyau pour l'association
-#===================================================================
-Tuyau_geom = geompy.Import(BREP_PATH, "BREP")
-geompy.addToStudy(Tuyau_geom, "Tuyau_geom")
-
-
-Pt_A = geompy.MakeVertex( h , 20 , 4.5 )
-Edge_haut_droite_grd = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_A)
-
-
-Pt_B = geompy.MakeVertex( h , 20 , 3.6 )
-Edge_haut_droite_pte = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_B)
-
-
-Pt_C = geompy.MakeVertex( h , 20 , -4.5 )
-Edge_haut_gauche_grd = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_C)
-
-
-
-Pt_D = geompy.MakeVertex( h , 20 , -3.6 )
-Edge_haut_gauche_pte = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_D)
-
-
-
-# NB:
-# h = haut
-# b = bas
-# g = grand
-# p = petit
-# t = trou
-
-# Face tuyau du haut
-x_h = geompy.MakeVertexOnCurve(Edge_haut_droite_grd, 0.5)
-y_h = geompy.MakeVertexOnCurve(Edge_haut_droite_grd, 1)
-z_h = geompy.MakeVertexOnCurve(Edge_haut_gauche_grd, 0.5)
-u_h = geompy.MakeVertexOnCurve(Edge_haut_gauche_grd, 0)
-
-
-
-x_h_t = geompy.MakeVertexOnCurve(Edge_haut_droite_pte, 0.5)
-y_h_t = geompy.MakeVertexOnCurve(Edge_haut_droite_pte, 1)
-z_h_t = geompy.MakeVertexOnCurve(Edge_haut_gauche_pte, 0.5)
-u_h_t = geompy.MakeVertexOnCurve(Edge_haut_gauche_pte, 0)
-
-
-
-Pt_E = geompy.MakeVertex( 0 , 0 , 2 )
-Edge_bas_droite_grd = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_E)
-
-
-Pt_F = geompy.MakeVertex( 0 , 0 , 1.6 )
-Edge_bas_droite_pte = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_F)
-
-
-Pt_G = geompy.MakeVertex( 0 , 0 , -2 )
-Edge_bas_gauche_grd = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_G)
-
-
-
-Pt_H = geompy.MakeVertex( 0 , 0 , -1.6 )
-Edge_bas_gauche_pte = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_H)
-
-
-
-# Face tuyau du bas
-x_b = geompy.MakeVertexOnCurve(Edge_bas_droite_grd, 0.5)
-y_b = geompy.MakeVertexOnCurve(Edge_bas_droite_grd, 1)
-z_b = geompy.MakeVertexOnCurve(Edge_bas_gauche_grd, 0.5)
-u_b = geompy.MakeVertexOnCurve(Edge_bas_gauche_grd, 0)
-
-
-
-x_b_t = geompy.MakeVertexOnCurve(Edge_bas_droite_pte, 0.5)
-y_b_t = geompy.MakeVertexOnCurve(Edge_bas_droite_pte, 1)
-z_b_t = geompy.MakeVertexOnCurve(Edge_bas_gauche_pte, 0.5)
-u_b_t = geompy.MakeVertexOnCurve(Edge_bas_gauche_pte, 0)
-
-
-
-
-bp_law = doc.getLaw(0)
-bp_law.setNodes(4)
-
-#====================================
-# CREATION MAILLAGE
-#====================================
-##=================================================
-## Definir les groupes d'elements pour le maillage
-##=================================================
-
-# groupe de Hexa(volumes) 
-Hexa_grp = doc.addHexaGroup("Hexa_all_grp")
-Nbr_Hex = doc.countHexa()
-print "doc.countHexa()->",Nbr_Hex
-
-for i in range(Nbr_Hex):
-    Hexa_i = doc.getHexa(i)
-    Hexa_grp.addElement(Hexa_i)
-
-#Nbr_elm_hex = Hexa_grp.countElement()
-#print "Hexa_all_grp  countElement() ->",Nbr_elm_hex
-
-for i in range(Nbr_Hex):
-    Hexa_grp = doc.addHexaGroup("Hexa_grp"+str(i))
-    Hexa_i = doc.getHexa(i)
-    Hexa_grp.addElement(Hexa_i)
-
-
-# groupe de quads (faces)
-Quad_grp_haut = doc.addQuadGroup("Quad_grp_haut")
-
-Quad_h_1 = doc.findQuad( x_mod_h , y_mod_h_t )
-Quad_h_2 = doc.findQuad( y_mod_h_t , z_mod_h )
-Quad_h_3 = doc.findQuad( z_mod_h , u_mod_h_t )
-Quad_h_4 = doc.findQuad( u_mod_h_t , x_mod_h )
-
-assert Quad_h_1
-assert Quad_h_2
-assert Quad_h_3
-assert Quad_h_4
-
-
-for Quad_h_i in [ Quad_h_1 , Quad_h_2 , Quad_h_3 , Quad_h_4 ]:
-    Quad_grp_haut.addElement(Quad_h_i)
-
-
-
-Nbr_elm_qad_haut = Quad_grp_haut.countElement()
-print "Nbr_elm_qad_haut ->",Nbr_elm_qad_haut
-
-
-Quad_grp_bas = doc.addQuadGroup("Quad_grp_bas")
-
-Quad_b_1 = doc.findQuad( x_mod_b , y_mod_b_t )
-Quad_b_2 = doc.findQuad( y_mod_b_t , z_mod_b )
-Quad_b_3 = doc.findQuad( z_mod_b , u_mod_b_t )
-Quad_b_4 = doc.findQuad( u_mod_b_t , x_mod_b )
-
-
-assert Quad_b_1
-assert Quad_b_2
-assert Quad_b_3
-assert Quad_b_4
-
-for Quad_b_i in [ Quad_b_1 , Quad_b_2 , Quad_b_3 , Quad_b_4 ]:
-    Quad_grp_bas.addElement(Quad_b_i)
-
-
-Nbr_elm_qad_bas = Quad_grp_bas.countElement()
-print "Nbr_elm_qad_bas->",Nbr_elm_qad_bas
-
-
-# groupe de Edges
-
-Edge_Mod_ext_h = doc.findEdge( y_mod_h , y_mod_b )
-Edge_Mod_int_h = doc.findEdge( y_mod_h_t , y_mod_b_t )
-
-Edge_Mod_int_b = doc.findEdge( u_mod_h_t , u_mod_b_t )
-Edge_Mod_ext_b = doc.findEdge( u_mod_h , u_mod_b )
-
-Edge_Mod_ext_g = doc.findEdge( x_mod_h , x_mod_b )
-Edge_Mod_int_g = doc.findEdge( x_mod_h_t , x_mod_b_t )
-
-Edge_Mod_int_d = doc.findEdge( z_mod_h_t , z_mod_b_t )
-Edge_Mod_ext_d = doc.findEdge( z_mod_h , z_mod_b )
-
-
-Edge_Grp_haut = doc.addEdgeGroup("Edge_Grp_haut")
-Edge_Grp_haut.addElement(Edge_Mod_ext_h)
-Edge_Grp_haut.addElement(Edge_Mod_int_h)
-
-Edge_Grp_gauche = doc.addEdgeGroup("Edge_Grp_gauche")
-Edge_Grp_gauche.addElement(Edge_Mod_ext_g)
-Edge_Grp_gauche.addElement(Edge_Mod_int_g)
-
-Edge_Grp_bas = doc.addEdgeGroup("Edge_Grp_bas")
-Edge_Grp_bas.addElement(Edge_Mod_int_b)
-Edge_Grp_bas.addElement(Edge_Mod_ext_b)
-
-Edge_Grp_droit = doc.addEdgeGroup("Edge_Grp_droit")
-Edge_Grp_droit.addElement(Edge_Mod_int_d)
-Edge_Grp_droit.addElement(Edge_Mod_ext_d)
-
-
-
-# groupe de noeuds de Hexa 
-Hexa_Nod_Grp = doc.addHexaNodeGroup("Hexa_Nod_Grp")
-for i in range(Nbr_Hex):
-    Hexa_i = doc.getHexa(i)
-    Hexa_Nod_Grp.addElement(Hexa_i)
-
-
-# groupe de noeuds de Quad 
-Quad_Nod_Grp_h_1 = doc.addQuadNodeGroup("Quad_Nod_Grp_h_1")
-Quad_Nod_Grp_h_1.addElement(Quad_h_1)
-
-Quad_Nod_Grp_b_1 = doc.addQuadNodeGroup("Quad_Nod_Grp_b_1")
-Quad_Nod_Grp_b_1.addElement(Quad_b_1)
-
-# groupe de noeuds de Edge 
-Edge_Nod_Grp_b = doc.addEdgeNodeGroup("Edge_Nod_Grp_b")
-Edge_Nod_Grp_b.addElement(Edge_Mod_int_b)
-Edge_Nod_Grp_b.addElement(Edge_Mod_ext_b)
-
-Edge_Nod_Grp_h = doc.addEdgeNodeGroup("Edge_Nod_Grp_h")
-Edge_Nod_Grp_h.addElement(Edge_Mod_int_d)
-Edge_Nod_Grp_h.addElement(Edge_Mod_ext_d)
-
-
-
-
-# groupe de noeuds de vertex pour tout le modele
-Vertex_Nod_Grp = doc.addVertexNodeGroup("Vertex_Nod_Grp")
-
-Nbr_Vx = doc.countVertex()
-print "doc.countVertex()->",Nbr_Vx
-
-for i in range(Nbr_Vx):
-    Vertex_i = doc.getVertex(i)
-    Vertex_Nod_Grp.addElement(Vertex_i)
-
-
-Nbr_elm_vex = Vertex_Nod_Grp.countElement()
-
-if Nbr_elm_vex == Nbr_Vx:
-    print "Vertex node group OK (on group :%s  on model : %s)"%(Nbr_elm_vex, Nbr_Vx)
-else:
-    print "Vertex node group KO (on group :%s  on model : %s)"%(Nbr_elm_vex, Nbr_Vx)
-
-
-#====================================
-# Definir une loi de discretisation
-#====================================
-
-
-# definir une loi: le choix de la loi reste aux utilisateurs
-
-#Law_X = doc.addLaw( "Uniform" , 4 )
-#Law_Y = doc.addLaw( "Arithmetic" , 2 )
-#Law_Z = doc.addLaw( "Geometric" , 3 )
-
-
-Law_X = doc.addLaw( "Arithmetic" , 5 )
-Law_X.setKind(hexablock.ARITHMETIC)
-Law_X.setCoefficient(0.1)
-
-Law_Y = doc.addLaw( "Arithmetic" , 3 )
-Law_Y.setKind(hexablock.ARITHMETIC)
-Law_Y.setCoefficient(0.1)
-
-#Law_Z = doc.addLaw( "Geometric" , 4 )
-Law_Z = doc.addLaw( "Arithmetic" , 5 )
-Law_Z.setKind(hexablock.ARITHMETIC)
-Law_Z.setCoefficient(0.05)
-
-
-# chercher les propagations du modele
-Edge_Law_X = doc.findEdge( x_mod_h , x_mod_h_t )
-Edge_Law_Y = doc.findEdge( y_mod_h , y_mod_h_t )
-Edge_Law_Z = doc.findEdge( y_mod_h , y_mod_b )
-
-
-Propa_X = doc.findPropagation( Edge_Law_X )
-Propa_Y = doc.findPropagation( Edge_Law_Y )
-Propa_Z = doc.findPropagation( Edge_Law_Z )
-
-
-
-# appliquer la loi de discretisation sur tout le modele et generer le maillage
-Propa_X.setLaw( Law_X )
-Propa_Y.setLaw( Law_Y )
-Propa_Z.setLaw( Law_Z )
-
-print  " --- MAILLAGE HEXAHEDRIQUE --- "
-mesh = hexablock.mesh(doc, "test_TUYAU_COURBE_no_assoc")
-
-print "Nombre d hexaedres:"   , mesh.NbHexas()
-print "Nombre de quadrangles:", mesh.NbQuadrangles()
-print "Nombre de segments:"   , mesh.NbEdges()
-print "Nombre de noeuds:"     , mesh.NbNodes()
-
-salome.sg.updateObjBrowser(1)
-
-#Nombre d hexaedres: 480
-#Nombre de quadrangles: 496
-#Nombre de segments: 160
-#Nombre de noeuds: 700
-
-allGroups = mesh.GetGroups()
-print  " --- GROUPES --- "
-for aGroup in allGroups:
-    print "\nNOM:", aGroup.GetName()
-    print "IDS:", aGroup.GetIDs()
-
-
-
-## --------------------
-## Maillage hexa�drique
-## --------------------
-#mesh = mesh.ExportMED( "tuyau.noassoc.med", 1 )
-#maillages = smesh.CreateMeshesFromMED( "tuyau.noassoc.med" )
-
-#ijk = maillages[0][0]
-
-#ijk.Hexahedron()
-
-#ijk.Compute()
-
-#print  " --- MAILLAGE HEXAHEDRIQUE --- "
-#print "Nombre d hexaedres:", ijk.NbHexas()
-#print "Nombre de quadrangles:", ijk.NbQuadrangles()
-#print "Nombre de segments:", ijk.NbEdges()
-#print "Nombre de noeuds:", ijk.NbNodes()
diff --git a/src/TEST_PY/test_TUYAU_COURBE_weird_assoc.py b/src/TEST_PY/test_TUYAU_COURBE_weird_assoc.py
deleted file mode 100755 (executable)
index 3df354f..0000000
+++ /dev/null
@@ -1,808 +0,0 @@
-# -*- coding: latin-1 -*-
-# Copyright (C) 2009-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
-#
-
-#===============================================
-# By Karima DEBCHI YATAGHENE Nov 2009 at CS 
-#===============================================
-import os
-import geompy
-import smesh
-import hexablock
-import math
-
-# chemin du fichier BREP contenant la CAO
-BREP_PATH = os.path.expandvars("$HEXA_ROOT_DIR/bin/salome/tuyau.brep")
-
-
-
-
-#===================================================================
-#               LE MODELE:
-#   (Pour le tuyau on doit creer une grille cylindrique)
-#===================================================================
-
-
-#=============================
-# PARAMETRES
-#=============================
-R = 4.5
-r = 4.5
-r_t = 3.6
-h = 75.0
-
-
-#=================================================
-# Creation du document
-#=================================================
-doc = hexablock.addDocument ("default")
-
-#=================================================
-# Creation du tuyau (grille cylindrique) dans le document
-#=================================================
-# centre de la grille cylindrique
-c = doc.addVertex(0, 0, 0) 
-
-# vecteurs de la grille cylindrique
-dx = doc.addVector(h, 0, 0)
-dy = doc.addVector(0, h, 0)
-dz = doc.addVector(0, 0, h)
-
-# taille du cylindre
-dr = R
-da = 360
-dl = h
-
-nr = 1
-na = 4
-nl = 1
-
-model_tuyau_fin = doc.makeCylindrical(c, dx, dz, dr, da, dl, nr, na, nl, False)
-# note: on obtient une liste qui contient 4 hexaedres eguaux
-
-
-#===================================================================
-# Recuperation des vertex,edges et quads du model pour l'association
-#
-# h = haut
-# b = bas
-# g = grand
-# p = petit
-# t = trou
-#===================================================================
-
-#=========================
-#       VERTEX
-#=========================
-
-# Face du haut 
-#   grand rayon
-x_mod_h = doc.findVertex( 2*R , 0 , h )
-y_mod_h = doc.findVertex( 0 , 2*R , h )
-z_mod_h = doc.findVertex( -2*R , 0 , h )
-u_mod_h = doc.findVertex( 0 , -2*R , h )
-
-#   petit rayon
-x_mod_h_t = doc.findVertex( R , 0 , h )
-y_mod_h_t = doc.findVertex( 0 , R , h )
-z_mod_h_t = doc.findVertex( -R , 0 , h )
-u_mod_h_t = doc.findVertex( 0 , -R , h )
-
-# Face du bas
-#   grand rayon
-x_mod_b = doc.findVertex( 2*R , 0 , 0 )
-y_mod_b = doc.findVertex( 0 , 2*R , 0 )
-z_mod_b = doc.findVertex( -2*R , 0 , 0 )
-u_mod_b = doc.findVertex( 0 , -2*R , 0 )
-
-#   petit rayon
-x_mod_b_t = doc.findVertex( R , 0 , 0 )
-y_mod_b_t = doc.findVertex( 0 , R , 0 )
-z_mod_b_t = doc.findVertex( -R , 0 , 0 )
-u_mod_b_t = doc.findVertex( 0 , -R , 0 )
-
-
-# v�rifications
-assert x_mod_h
-assert y_mod_h
-assert z_mod_h
-assert u_mod_h
-
-assert x_mod_h_t
-assert y_mod_h_t
-assert z_mod_h_t
-assert u_mod_h_t
-
-assert x_mod_b
-assert y_mod_b
-assert z_mod_b
-assert u_mod_b
-
-assert x_mod_b_t
-assert y_mod_b_t
-assert z_mod_b_t
-assert u_mod_b_t
-
-
-#=========================
-#       EDGES
-#=========================
-
-# Face du haut
-
-#   grand rayon
-edge_mod_face_h_1_1 = doc.findEdge( y_mod_h , z_mod_h )
-edge_mod_face_h_1_2 = doc.findEdge( z_mod_h , u_mod_h )
-edge_mod_face_h_2_1 = doc.findEdge( y_mod_h,  x_mod_h )
-edge_mod_face_h_2_2 = doc.findEdge( x_mod_h,  u_mod_h )
-
-#   petit rayon
-edge_mod_t_face_h_1_1 = doc.findEdge( y_mod_h_t , z_mod_h_t )
-edge_mod_t_face_h_1_2 = doc.findEdge( z_mod_h_t , u_mod_h_t )
-edge_mod_t_face_h_2_1 = doc.findEdge( y_mod_h_t,  x_mod_h_t )
-edge_mod_t_face_h_2_2 = doc.findEdge( x_mod_h_t,  u_mod_h_t )
-
-
-# Face du bas
-
-#   grand rayon
-edge_mod_face_b_1_1 = doc.findEdge( y_mod_b , z_mod_b )
-edge_mod_face_b_1_2 = doc.findEdge( z_mod_b , u_mod_b )
-edge_mod_face_b_2_1 = doc.findEdge( y_mod_b,  x_mod_b )
-edge_mod_face_b_2_2 = doc.findEdge( x_mod_b,  u_mod_b )
-
-#   petit rayon
-edge_mod_t_face_b_1_1 = doc.findEdge( y_mod_b_t , z_mod_b_t )
-edge_mod_t_face_b_1_2 = doc.findEdge( z_mod_b_t , u_mod_b_t )
-edge_mod_t_face_b_2_1 = doc.findEdge( y_mod_b_t,  x_mod_b_t )
-edge_mod_t_face_b_2_2 = doc.findEdge( x_mod_b_t,  u_mod_b_t )
-
-
-
-# Joignant faces haut et du bas
-Edge_Mod_ext_h = doc.findEdge( y_mod_h , y_mod_b )
-Edge_Mod_int_h = doc.findEdge( y_mod_h_t , y_mod_b_t )
-
-Edge_Mod_int_b = doc.findEdge( u_mod_h_t , u_mod_b_t )
-Edge_Mod_ext_b = doc.findEdge( u_mod_h , u_mod_b )
-
-Edge_Mod_ext_g = doc.findEdge( x_mod_h , x_mod_b )
-Edge_Mod_int_g = doc.findEdge( x_mod_h_t , x_mod_b_t )
-
-Edge_Mod_int_d = doc.findEdge( z_mod_h_t , z_mod_b_t )
-Edge_Mod_ext_d = doc.findEdge( z_mod_h , z_mod_b )
-
-
-# v�rifications
-assert edge_mod_face_h_1_1
-assert edge_mod_face_h_1_2
-assert edge_mod_face_h_2_1
-assert edge_mod_face_h_2_2
-
-assert edge_mod_t_face_h_1_1
-assert edge_mod_t_face_h_1_2
-assert edge_mod_t_face_h_2_1
-assert edge_mod_t_face_h_2_2
-
-assert edge_mod_face_b_1_1
-assert edge_mod_face_b_1_2
-assert edge_mod_face_b_2_1
-assert edge_mod_face_b_2_2
-
-assert edge_mod_t_face_b_1_1
-assert edge_mod_t_face_b_1_2
-assert edge_mod_t_face_b_2_1
-assert edge_mod_t_face_b_2_2
-
-
-assert Edge_Mod_ext_h
-assert Edge_Mod_int_h
-
-assert Edge_Mod_int_b
-assert Edge_Mod_ext_b
-
-assert Edge_Mod_ext_g
-assert Edge_Mod_int_g
-
-assert Edge_Mod_int_d
-assert Edge_Mod_ext_d
-
-
-
-#=========================
-#       QUADS
-#=========================
-Quad_mod_0 = model_tuyau_fin.getQuadJK( 1 , 0 , 0 )
-Quad_mod_1 = model_tuyau_fin.getQuadJK( 1 , 1 , 0 )
-Quad_mod_2 = model_tuyau_fin.getQuadJK( 1 , 2 , 0 )
-Quad_mod_3 = model_tuyau_fin.getQuadJK( 1 , 3 , 0 )
-
-
-
-#===================================================================
-#               LA GEOMETRIE
-#===================================================================
-
-#===================================================================
-# Recuperation des points de la geometrie tuyau pour l'association
-#
-#===================================================================
-Tuyau_geom = geompy.Import(BREP_PATH, "BREP")
-
-
-#=========================
-#       SOMMETS
-#=========================
-Pt_A = geompy.MakeVertex( h , 20 , 4.5 )
-Pt_B = geompy.MakeVertex( h , 20 , 3.6 )
-Pt_C = geompy.MakeVertex( h , 20 , -4.5 )
-Pt_D = geompy.MakeVertex( h , 20 , -3.6 )
-Pt_E = geompy.MakeVertex( 0 , 0 , 2 )
-Pt_F = geompy.MakeVertex( 0 , 0 , 1.6 )
-Pt_G = geompy.MakeVertex( 0 , 0 , -2 )
-Pt_H = geompy.MakeVertex( 0 , 0 , -1.6 )
-
-# Face du bas
-Edge_bas_droite_grd = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_E)
-Edge_bas_droite_pte = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_F)
-Edge_bas_gauche_grd = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_G)
-Edge_bas_gauche_pte = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_H)
-## Grand rayon
-x_b = geompy.MakeVertexOnCurve(Edge_bas_droite_grd, 0.5)
-y_b = geompy.MakeVertexOnCurve(Edge_bas_droite_grd, 1)
-z_b = geompy.MakeVertexOnCurve(Edge_bas_gauche_grd, 0.5)
-u_b = geompy.MakeVertexOnCurve(Edge_bas_gauche_grd, 0)
-
-## Petit rayon
-x_b_t = geompy.MakeVertexOnCurve(Edge_bas_droite_pte, 0.5)
-y_b_t = geompy.MakeVertexOnCurve(Edge_bas_droite_pte, 1)
-z_b_t = geompy.MakeVertexOnCurve(Edge_bas_gauche_pte, 0.5)
-u_b_t = geompy.MakeVertexOnCurve(Edge_bas_gauche_pte, 0)
-
-
-# Face du haut
-Edge_haut_droite_grd = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_A)
-Edge_haut_droite_pte = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_B)
-Edge_haut_gauche_grd = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_C)
-Edge_haut_gauche_pte = geompy.GetEdgeNearPoint(Tuyau_geom, Pt_D)
-## Grand rayon
-x_h = geompy.MakeVertexOnCurve(Edge_haut_droite_grd, 0.5)
-y_h = geompy.MakeVertexOnCurve(Edge_haut_droite_grd, 1)
-z_h = geompy.MakeVertexOnCurve(Edge_haut_gauche_grd, 0.5)
-u_h = geompy.MakeVertexOnCurve(Edge_haut_gauche_grd, 0)
-
-## Petit rayon
-x_h_t = geompy.MakeVertexOnCurve(Edge_haut_droite_pte, 0.5)
-y_h_t = geompy.MakeVertexOnCurve(Edge_haut_droite_pte, 1)
-z_h_t = geompy.MakeVertexOnCurve(Edge_haut_gauche_pte, 0.5)
-u_h_t = geompy.MakeVertexOnCurve(Edge_haut_gauche_pte, 0)
-
-
-
-#=========================
-#       EDGES
-#=========================
-All_Edges_Tuy_1 = geompy.SubShapeAllSorted( Tuyau_geom , geompy.ShapeType["EDGE"] )
-
-# Face du haut
-## Grand rayon
-edge_face_h_1   = All_Edges_Tuy_1[11]
-edge_face_h_2   = All_Edges_Tuy_1[14]
-## Petit rayon
-edge_t_face_h_1 = All_Edges_Tuy_1[12]
-edge_t_face_h_2 = All_Edges_Tuy_1[13]
-
-
-# Face du bas
-## Grand rayon
-edge_face_b_1   = All_Edges_Tuy_1[1]
-edge_face_b_2   = All_Edges_Tuy_1[4]
-##  Petit rayon
-edge_t_face_b_1 = All_Edges_Tuy_1[2]
-edge_t_face_b_2 = All_Edges_Tuy_1[3]
-
-
-# Joignant les 2 faces
-
-## edges compl�tes
-Edge_Tuy_ext_h = All_Edges_Tuy_1[6]
-Edge_Tuy_int_h = All_Edges_Tuy_1[7]
-Edge_Tuy_int_b = All_Edges_Tuy_1[8]
-Edge_Tuy_ext_b = All_Edges_Tuy_1[9]
-
-Pt_Z = geompy.MakeVertex( 75 , 20 , 0 )
-Pt_Z_1 = geompy.MakeVertexWithRef( Pt_Z , 0 , 0 , 10 )
-Pt_Z_2 = geompy.MakeVertexWithRef( Pt_Z , 0 , 0 , -10 )
-Line_Z1_Z2 = geompy.MakeLineTwoPnt( Pt_Z_1 , Pt_Z_2 )
-
-
-All_Edge_Tuy_ext_h = geompy.SubShapeAllSorted( Edge_Tuy_ext_h , geompy.ShapeType["VERTEX"] )
-
-Vx_Edg_Tuy_ext_h_1 = All_Edge_Tuy_ext_h[0]
-Vx_Edg_Tuy_ext_h_2 = All_Edge_Tuy_ext_h[1]
-
-Vx_Edg_Tuy_ext_h_1_trans = geompy.MakeVertexWithRef( Vx_Edg_Tuy_ext_h_1 , -10 , -10 , 0 )
-Vx_Edg_Tuy_ext_h_2_trans = geompy.MakeVertexWithRef( Vx_Edg_Tuy_ext_h_2 , 10 , 0 , 0 )
-
-Line_1 = geompy.MakeLineTwoPnt(Vx_Edg_Tuy_ext_h_1, Vx_Edg_Tuy_ext_h_1_trans)
-Line_2 = geompy.MakeLineTwoPnt(Vx_Edg_Tuy_ext_h_2, Vx_Edg_Tuy_ext_h_2_trans)
-
-Wire = geompy.MakeWire([Line_1, Line_2, Edge_Tuy_ext_h])
-Pipe_Z = geompy.MakePipe( Line_Z1_Z2 , Wire )
-Pipe_Ztt = geompy.MakePipe( Line_Z1_Z2 , Edge_Tuy_ext_h )
-Partition_Ztt = geompy.MakePartition([Tuyau_geom], [Pipe_Ztt], [], [], geompy.ShapeType["SOLID"], 0, [], 0)
-All_Edges_Tuy_2tt = geompy.SubShapeAllSorted( Partition_Ztt , geompy.ShapeType["EDGE"] )
-
-Edge_Tuy_ext_g = All_Edges_Tuy_2tt[12]
-Edge_Tuy_int_g = All_Edges_Tuy_2tt[13]
-Edge_Tuy_ext_d = All_Edges_Tuy_2tt[10]
-Edge_Tuy_int_d = All_Edges_Tuy_2tt[11]
-
-## une edge en plusieurs(4) morceaux : Edge_Tuy_ext_h
-X_pln1 = geompy.MakeVertexWithRef( Pt_Z , -20 , 0 , 0 )
-Vec_X = geompy.MakeVectorDXDYDZ( 1 , 0 , 0 )
-
-Plan1 = geompy.MakePlane( X_pln1 , Vec_X , 200 )
-Plan2 = geompy.MakeTranslation( Plan1 , -20 , 0 , 0 )
-Plan3 = geompy.MakeTranslation( Plan1 , -40 , 0 , 0 )
-
-Partition_Edge_g_d_h_b = geompy.MakePartition([
-    Edge_Tuy_ext_h,
-    Edge_Tuy_int_h,
-    Edge_Tuy_ext_b,
-    Edge_Tuy_int_b,
-    Edge_Tuy_ext_g,
-    Edge_Tuy_int_g,
-    Edge_Tuy_ext_d,
-    Edge_Tuy_int_d], 
-    [Plan1, Plan2, Plan3], [], [], geompy.ShapeType["EDGE"], 0, [], 0)
-
-All_Edge_g_d_h_b = geompy.SubShapeAllSorted( Partition_Edge_g_d_h_b , geompy.ShapeType["EDGE"] )
-Edge_Tuy_ext_h_1 = All_Edge_g_d_h_b[0]
-Edge_Tuy_ext_h_2 = All_Edge_g_d_h_b[15]
-Edge_Tuy_ext_h_3 = All_Edge_g_d_h_b[23]
-Edge_Tuy_ext_h_4 = All_Edge_g_d_h_b[31]
-
-
-
-## une edge d�coup�e en plusieurs morceaux n'�pousant pas la g�om�trie: 
-VX_A = geompy.MakeVertexOnCurve(Edge_Tuy_ext_d, 0.)
-VX_B = geompy.MakeVertexOnCurve(Edge_Tuy_ext_d, 1.)
-VX_C = geompy.MakeVertexOnCurve(Edge_Tuy_ext_d, 0.25)
-#VX_Cbis = geompy.MakeVertexWithRef(VX_C, -10, 10, 0)
-VX_Cbis = geompy.MakeVertexWithRef(VX_C, -5, 1, -4)
-
-weird_part = geompy.MakePartition([Edge_Tuy_ext_d], [VX_C], [], [], geompy.ShapeType["EDGE"])
-
-weird_edge0 = geompy.GetEdge(weird_part, VX_C, VX_B)
-weird_edge1 = geompy.MakeEdge(VX_Cbis, VX_C )
-weird_edge2 = geompy.MakeEdge(VX_A, VX_Cbis   )
-
-
-#=========================
-#       FACES
-#=========================
-All_Faces_Tuy_1 = geompy.SubShapeAllSorted( Tuyau_geom , geompy.ShapeType["FACE"] )
-
-Face_Tuy_ext_1 = All_Faces_Tuy_1[4]
-Face_Tuy_ext_2 = All_Faces_Tuy_1[5]
-
-Partition_Face = geompy.MakePartition([ Face_Tuy_ext_1 , Face_Tuy_ext_2 ], [ Plan1 , Plan2 , Plan3 , Pipe_Z ], [], [], geompy.ShapeType["FACE"], 0, [], 0)
-
-
-All_Faces_Partition_Face = geompy.SubShapeAllSorted( Partition_Face , geompy.ShapeType["FACE"] )
-
-## -------------------------------------
-Face_0 = All_Faces_Partition_Face[0]
-Face_6 = All_Faces_Partition_Face[6]
-Face_10 = All_Faces_Partition_Face[10]
-Face_14 = All_Faces_Partition_Face[14]
-
-## -------------------------------------
-Face_1 = All_Faces_Partition_Face[1]
-Face_7 = All_Faces_Partition_Face[7]
-Face_11 = All_Faces_Partition_Face[11]
-Face_15 = All_Faces_Partition_Face[15]
-
-## -------------------------------------
-Face_2 = All_Faces_Partition_Face[2]
-Face_4 = All_Faces_Partition_Face[4]
-Face_8 = All_Faces_Partition_Face[8]
-Face_12 = All_Faces_Partition_Face[12]
-
-## -------------------------------------
-Face_3 = All_Faces_Partition_Face[3]
-Face_5 = All_Faces_Partition_Face[5]
-Face_9 = All_Faces_Partition_Face[9]
-Face_13 = All_Faces_Partition_Face[13]
-
-
-
-
-
-#==========================================================
-#               LES ASSOCIATIONS
-#==========================================================
-
-##===========================================
-##          VERTEX
-##===========================================
-
-# Face du haut
-
-## Grand rayon
-x_mod_h.setAssociation( x_h )
-y_mod_h.setAssociation( y_h )
-z_mod_h.setAssociation( z_h )
-u_mod_h.setAssociation( u_h )
-
-## Petit rayon
-x_mod_h_t.setAssociation( x_h_t )
-y_mod_h_t.setAssociation( y_h_t )
-z_mod_h_t.setAssociation( z_h_t )
-u_mod_h_t.setAssociation( u_h_t )
-
-
-# Face du bas
-
-## Grand rayon
-x_mod_b.setAssociation( x_b )
-y_mod_b.setAssociation( y_b )
-z_mod_b.setAssociation( z_b )
-u_mod_b.setAssociation( u_b )
-
-## Petit rayon
-x_mod_b_t.setAssociation( x_b_t )
-y_mod_b_t.setAssociation( y_b_t )
-z_mod_b_t.setAssociation( z_b_t )
-u_mod_b_t.setAssociation( u_b_t )
-
-
-##===========================================
-##          EDGES
-##===========================================
-
-# Face du haut
-
-## Grand rayon
-edge_mod_face_h_1_1.addAssociation( edge_face_h_1, 0.5, 1. )
-edge_mod_face_h_1_2.addAssociation( edge_face_h_1, 0., 0.5 )
-edge_mod_face_h_2_1.addAssociation( edge_face_h_2, 0.5, 1. )
-edge_mod_face_h_2_2.addAssociation( edge_face_h_2, 0., 0.5 )
-
-## Petit rayon
-edge_mod_t_face_h_1_1.addAssociation( edge_t_face_h_1, 0.5, 1. )
-edge_mod_t_face_h_1_2.addAssociation( edge_t_face_h_1, 0., 0.5 )
-edge_mod_t_face_h_2_1.addAssociation( edge_t_face_h_2, 0.5, 1. )
-edge_mod_t_face_h_2_2.addAssociation( edge_t_face_h_2, 0., 0.5 )
-
-# Face du bas
-
-## Grand rayon
-edge_mod_face_b_1_1.addAssociation( edge_face_b_1, 0.5, 1. )
-edge_mod_face_b_1_2.addAssociation( edge_face_b_1, 0., 0.5 )
-edge_mod_face_b_2_1.addAssociation( edge_face_b_2, 0.5, 1. )
-edge_mod_face_b_2_2.addAssociation( edge_face_b_2, 0., 0.5 )
-
-## Petit rayon
-edge_mod_t_face_b_1_1.addAssociation( edge_t_face_b_1, 0.5, 1. )
-edge_mod_t_face_b_1_2.addAssociation( edge_t_face_b_1, 0., 0.5 )
-edge_mod_t_face_b_2_1.addAssociation( edge_t_face_b_2, 0.5, 1. )
-edge_mod_t_face_b_2_2.addAssociation( edge_t_face_b_2, 0., 0.5 )
-
-
-
-# Joignant les 2 faces
-#Edge_Mod_ext_h.addAssociation( Edge_Tuy_ext_h, 0., 1. )
-Edge_Mod_ext_h.addAssociation( Edge_Tuy_ext_h_1, 0., 1. )
-Edge_Mod_ext_h.addAssociation( Edge_Tuy_ext_h_2, 0., 1. )
-Edge_Mod_ext_h.addAssociation( Edge_Tuy_ext_h_3, 0., 1. )
-Edge_Mod_ext_h.addAssociation( Edge_Tuy_ext_h_4, 0., 1. )
-Edge_Mod_int_h.addAssociation( Edge_Tuy_int_h, 0., 1. )
-
-Edge_Mod_int_b.addAssociation( Edge_Tuy_int_b, 0., 1. )
-Edge_Mod_ext_b.addAssociation( Edge_Tuy_ext_b, 0., 1. )
-
-Edge_Mod_ext_g.addAssociation( Edge_Tuy_ext_g, 0., 1. )
-Edge_Mod_int_g.addAssociation( Edge_Tuy_int_g, 0., 1. )
-
-Edge_Mod_int_d.addAssociation( Edge_Tuy_int_d, 0., 1. )
-#Edge_Mod_ext_d.addAssociation( Edge_Tuy_ext_d, 0., 1. )
-Edge_Mod_ext_d.addAssociation( weird_edge0, 0., 1. )
-Edge_Mod_ext_d.addAssociation( weird_edge1, 0., 1. )
-Edge_Mod_ext_d.addAssociation( weird_edge2, 0., 1. )
-
-
-
-##===========================================
-##          FACES
-##===========================================
-
-#Quad_mod_1.addAssociation( Face_Tuy_ext_1 )
-Quad_mod_1.addAssociation( Face_0 )
-Quad_mod_1.addAssociation( Face_6 )
-Quad_mod_1.addAssociation( Face_10 )
-Quad_mod_1.addAssociation( Face_14 )
-
-#Quad_mod_0.addAssociation( Face_Tuy_ext_2 )
-Quad_mod_0.addAssociation( Face_1 )
-Quad_mod_0.addAssociation( Face_7 )
-Quad_mod_0.addAssociation( Face_11 )
-Quad_mod_0.addAssociation( Face_15 )
-
-#Quad_mod_2.addAssociation( Face_Tuy_ext_1 )
-Quad_mod_2.addAssociation( Face_2 )
-Quad_mod_2.addAssociation( Face_4 )
-Quad_mod_2.addAssociation( Face_8 )
-Quad_mod_2.addAssociation( Face_12 )
-
-#Quad_mod_3.addAssociation( Face_Tuy_ext_2 )
-Quad_mod_3.addAssociation( Face_3 )
-Quad_mod_3.addAssociation( Face_5 )
-Quad_mod_3.addAssociation( Face_9 )
-Quad_mod_3.addAssociation( Face_13 )
-
-
-
-#==========================================================
-#       LA GEOMETRIE DANS L'ARBRE D'ETUDE SALOME
-#==========================================================
-#for i,e in enumerate(All_Edges_Tuy_1): geompy.addToStudy( e, "edge_"+str(i) )
-geompy.addToStudy(Tuyau_geom, "Tuyau_geom")
-geompy.addToStudy( x_h, "x_h" )
-geompy.addToStudy( y_h, "y_h" )
-geompy.addToStudy( z_h, "z_h" )
-geompy.addToStudy( u_h, "u_h" )
-geompy.addToStudy( x_h_t, "x_h_t")
-geompy.addToStudy( y_h_t, "y_h_t" )
-geompy.addToStudy( z_h_t, "z_h_t" )
-geompy.addToStudy( u_h_t, "u_h_t" )
-
-geompy.addToStudy( x_b, "x_b")
-geompy.addToStudy( y_b, "y_b" )
-geompy.addToStudy( z_b, "z_b" )
-geompy.addToStudy( u_b, "u_b")
-geompy.addToStudy( x_b_t, "x_b_t" )
-geompy.addToStudy( y_b_t, "y_b_t" )
-geompy.addToStudy( z_b_t, "z_b_t" )
-geompy.addToStudy( u_b_t, "u_b_t" )
-
-
-#geompy.addToStudy(Line_Z1_Z2, "Line_Z1_Z2")
-#geompy.addToStudy(Pipe_Ztt, "Pipe_Ztt")
-#geompy.addToStudy( Partition_Ztt , "Partition_Ztt" )
-geompy.addToStudy( Edge_Tuy_ext_h , "Edge_Tuy_ext_h" )
-geompy.addToStudy( Edge_Tuy_int_h , "Edge_Tuy_int_h" )
-geompy.addToStudy( Edge_Tuy_int_b , "Edge_Tuy_int_b" )
-geompy.addToStudy( Edge_Tuy_ext_b , "Edge_Tuy_ext_b" )
-geompy.addToStudy( Edge_Tuy_ext_g , "Edge_Tuy_ext_g" )
-geompy.addToStudy( Edge_Tuy_int_g , "Edge_Tuy_int_g" )
-geompy.addToStudy( Edge_Tuy_ext_d , "Edge_Tuy_ext_d" )
-geompy.addToStudy( Edge_Tuy_int_d , "Edge_Tuy_int_d" )
-#geompy.addToStudy( Partition_Edge_g_d_h_b , "Partition_Edge_g_d_h_b" )
-geompy.addToStudy( Face_Tuy_ext_1 , "Face_Tuy_ext_1" )
-geompy.addToStudy( Face_Tuy_ext_2 , "Face_Tuy_ext_2" )
-#geompy.addToStudy( Partition_Face , "Partition_Face" )
-geompy.addToStudy( Face_0 , "Face_0" )
-geompy.addToStudy( Face_1 , "Face_1" )
-geompy.addToStudy( Face_2 , "Face_2" )
-geompy.addToStudy( Face_3 , "Face_3" )
-geompy.addToStudy( Face_4 , "Face_4" )
-geompy.addToStudy( Face_5 , "Face_5" )
-geompy.addToStudy( Face_6 , "Face_6" )
-geompy.addToStudy( Face_7 , "Face_7" )
-geompy.addToStudy( Face_8 , "Face_8" )
-geompy.addToStudy( Face_9 , "Face_9" )
-geompy.addToStudy( Face_10 , "Face_10" )
-geompy.addToStudy( Face_11 , "Face_11" )
-geompy.addToStudy( Face_12 , "Face_12" )
-geompy.addToStudy( Face_13 , "Face_13" )
-geompy.addToStudy( Face_14 , "Face_14" )
-geompy.addToStudy( Face_15 , "Face_15" )
-
-
-
-
-
-#====================================
-# CREATION MAILLAGE
-#====================================
-
-
-##=================================================
-## Definir les groupes d'elements pour le maillage
-##=================================================
-
-# groupe de Hexa(volumes) 
-Hexa_grp = doc.addHexaGroup("Hexa_grp")
-Nbr_Hex = doc.countHexa()
-
-
-for i in range(Nbr_Hex):
-    Hexa_i = doc.getHexa(i)
-    Hexa_grp.addElement(Hexa_i)
-
-Nbr_elm_hex = Hexa_grp.countElement()
-print "Hexa_grp.countElement() ->",Nbr_elm_hex
-
-
-# groupe de quads (faces)
-Quad_grp_haut = doc.addQuadGroup("Quad_grp_haut")
-Quad_h_1 = doc.findQuad( x_mod_h , y_mod_h_t )
-Quad_h_2 = doc.findQuad( y_mod_h_t , z_mod_h )
-Quad_h_3 = doc.findQuad( z_mod_h , u_mod_h_t )
-Quad_h_4 = doc.findQuad( u_mod_h_t , x_mod_h )
-
-assert Quad_h_1
-assert Quad_h_2
-assert Quad_h_3
-assert Quad_h_4
-
-for Quad_h_i in [ Quad_h_1 , Quad_h_2 , Quad_h_3 , Quad_h_4 ]:
-    Quad_grp_haut.addElement(Quad_h_i)
-
-
-Quad_grp_bas = doc.addQuadGroup("Quad_grp_bas")
-Quad_b_1 = doc.findQuad( x_mod_b , y_mod_b_t )
-Quad_b_2 = doc.findQuad( y_mod_b_t , z_mod_b )
-Quad_b_3 = doc.findQuad( z_mod_b , u_mod_b_t )
-Quad_b_4 = doc.findQuad( u_mod_b_t , x_mod_b )
-
-
-assert Quad_b_1
-assert Quad_b_2
-assert Quad_b_3
-assert Quad_b_4
-
-for Quad_b_i in [ Quad_b_1 , Quad_b_2 , Quad_b_3 , Quad_b_4 ]:
-    Quad_grp_bas.addElement(Quad_b_i)
-
-#Nbr_elm_qad_bas = Quad_grp_bas.countElement()
-#print "Nbr_elm_qad_bas->",Nbr_elm_qad_bas
-
-
-
-# groupe de Edges
-Edge_Grp_haut = doc.addEdgeGroup("Edge_Grp_haut")
-Edge_Grp_haut.addElement(Edge_Mod_ext_h)
-Edge_Grp_haut.addElement(Edge_Mod_int_h)
-
-Edge_Grp_gauche = doc.addEdgeGroup("Edge_Grp_gauche")
-Edge_Grp_gauche.addElement(Edge_Mod_ext_g)
-Edge_Grp_gauche.addElement(Edge_Mod_int_g)
-
-Edge_Grp_bas = doc.addEdgeGroup("Edge_Grp_bas")
-Edge_Grp_bas.addElement(Edge_Mod_int_b)
-Edge_Grp_bas.addElement(Edge_Mod_ext_b)
-
-Edge_Grp_droit = doc.addEdgeGroup("Edge_Grp_droit")
-Edge_Grp_droit.addElement(Edge_Mod_int_d)
-Edge_Grp_droit.addElement(Edge_Mod_ext_d)
-
-
-# groupe de noeuds de Hexa 
-Hexa_Nod_Grp = doc.addHexaNodeGroup("Hexa_Nod_Grp")
-for i in range(Nbr_Hex):
-    Hexa_i = doc.getHexa(i)
-    Hexa_Nod_Grp.addElement(Hexa_i)
-
-# groupe de noeuds de Quad 
-Quad_Nod_Grp_h_1 = doc.addQuadNodeGroup("Quad_Nod_Grp_h_1")
-Quad_Nod_Grp_h_1.addElement(Quad_h_1)
-
-Quad_Nod_Grp_b_1 = doc.addQuadNodeGroup("Quad_Nod_Grp_b_1")
-Quad_Nod_Grp_b_1.addElement(Quad_b_1)
-
-# groupe de noeuds de Edge 
-Edge_Nod_Grp_b = doc.addEdgeNodeGroup("Edge_Nod_Grp_b")
-Edge_Nod_Grp_b.addElement(Edge_Mod_int_b)
-Edge_Nod_Grp_b.addElement(Edge_Mod_ext_b)
-
-Edge_Nod_Grp_h = doc.addEdgeNodeGroup("Edge_Nod_Grp_h")
-Edge_Nod_Grp_h.addElement(Edge_Mod_int_d)
-Edge_Nod_Grp_h.addElement(Edge_Mod_ext_d)
-
-
-# groupe de noeuds de vertex pour tout le modele
-Vertex_Nod_Grp = doc.addVertexNodeGroup("Vertex_Nod_Grp")
-Nbr_Vx = doc.countVertex()
-for i in range(Nbr_Vx):
-    Vertex_i = doc.getVertex(i)
-    Vertex_Nod_Grp.addElement(Vertex_i)
-
-
-#====================================
-# Definir une loi de discretisation
-#====================================
-bp_law = doc.getLaw(0)
-bp_law.setNodes(4)
-
-# definir une loi: le choix de la loi reste aux utilisateurs
-
-#Law_X = doc.addLaw( "Uniform" , 4 )
-#Law_Y = doc.addLaw( "Arithmetic" , 2 )
-#Law_Z = doc.addLaw( "Geometric" , 3 )
-Law_X = doc.addLaw( "Arithmetic" , 5 )
-Law_X.setKind(hexablock.ARITHMETIC)
-Law_X.setCoefficient(0.1)
-
-Law_Y = doc.addLaw( "Arithmetic" , 3 )
-Law_Y.setKind(hexablock.ARITHMETIC)
-Law_Y.setCoefficient(0.1)
-
-#Law_Z = doc.addLaw( "Geometric" , 4 )
-Law_Z = doc.addLaw( "Arithmetic" , 5 )
-Law_Z.setKind(hexablock.ARITHMETIC)
-Law_Z.setCoefficient(0.05)
-
-
-# chercher les propagations du modele
-Edge_Law_X = doc.findEdge( x_mod_h , x_mod_h_t )
-Edge_Law_Y = doc.findEdge( y_mod_h , y_mod_h_t )
-Edge_Law_Z = doc.findEdge( y_mod_h , y_mod_b )
-
-Propa_X = doc.findPropagation( Edge_Law_X )
-Propa_Y = doc.findPropagation( Edge_Law_Y )
-Propa_Z = doc.findPropagation( Edge_Law_Z )
-
-# appliquer la loi de discretisation sur tout le modele et generer le maillage
-Propa_X.setLaw( Law_X )
-Propa_Y.setLaw( Law_Y )
-Propa_Z.setLaw( Law_Z )
-
-print  " --- MAILLAGE HEXAHEDRIQUE --- "
-mesh = hexablock.mesh(doc, "test_TUYAU_COURBE_weird_assoc")
-
-print "Nombre d hexaedres:"   , mesh.NbHexas()
-print "Nombre de quadrangles:", mesh.NbQuadrangles()
-print "Nombre de segments:"   , mesh.NbEdges()
-print "Nombre de noeuds:"     , mesh.NbNodes()
-
-salome.sg.updateObjBrowser(1)
-
-#Nombre d hexaedres: 480
-#Nombre de quadrangles: 496
-#Nombre de segments: 160
-#Nombre de noeuds: 700
-
-allGroups = mesh.GetGroups()
-print  " --- GROUPES --- "
-for aGroup in allGroups:
-    print "\nNOM:", aGroup.GetName()
-    print "IDS:", aGroup.GetIDs()
-
-
-
-## --------------------
-## Maillage hexa�drique
-## --------------------
-#mesh = mesh.ExportMED( "tuyau.med", 1 )
-#maillages = smesh.CreateMeshesFromMED( "tuyau.med" )
-
-#ijk = maillages[0][0]
-
-#ijk.Hexahedron()
-
-#ijk.Compute()
-
-#print  " --- MAILLAGE HEXAHEDRIQUE --- "
-#print "Nombre d hexaedres:", ijk.NbHexas()
-#print "Nombre de quadrangles:", ijk.NbQuadrangles()
-#print "Nombre de segments:", ijk.NbEdges()
-#print "Nombre de noeuds:", ijk.NbNodes()
diff --git a/src/TEST_PY/test_distrib.py b/src/TEST_PY/test_distrib.py
deleted file mode 100755 (executable)
index a62fc88..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-# -*- coding: latin-1 -*-
-# Copyright (C) 2009-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
-#
-
-# Francis KLOSS - 2010 - CEA-Saclay, DEN, DM2S, SFME, LGLS, F-91191 Gif-sur-Yvette, France
-# ========================================================================================
-
-import geompy
-import hexablock
-
-# Build the geometry to mesh with hexahedra: a sphere
-# ---------------------------------------------------
-
-name = "Sphere"
-
-cx = 0
-cy = 0
-cz = 0
-
-radius = 5
-
-sphere = geompy.MakeSphere(cx, cy, cz, radius)
-
-geompy.addToStudy(sphere, name)
-
-# Add a new document
-# ------------------
-
-doc = hexablock.addDocument(name)
-
-doc.addShape(sphere)
-
-# Build the model of blocks: a catesian grid
-# ------------------------------------------
-
-center = doc.addVertex(cx, cy, cz)
-
-axis_x = doc.addVector(1, 0, 0)
-axis_y = doc.addVector(0, 1, 0)
-axis_z = doc.addVector(0, 0, 1)
-
-doc.makeCartesian(center, axis_x, axis_y, axis_z, 5, 4, 3)
-
-# Associate the model of block to the geometry
-# --------------------------------------------
-
-# Define group of all hexahedra
-# -----------------------------
-
-group_h = doc.addHexaGroup(name+":hexas")
-for i in xrange(doc.countHexa()):
-    e = doc.getHexa(i)
-    group_h.addElement(e)
-
-# Define group of all quadrangles
-# -------------------------------
-
-group_q = doc.addQuadGroup(name+":quadrangles")
-for i in xrange(doc.countQuad()):
-    e = doc.getQuad(i)
-    group_q.addElement(e)
-
-# Define the laws for discretization
-# ----------------------------------
-
-law = doc.addLaw("Uniform" , 3)
-
-# Set the law on all edges of the model of blocks
-# -----------------------------------------------
-
-for i in xrange(doc.countPropagation()):
-    p = doc.getPropagation(i)
-    p.setLaw(law)
-
-# Generate the hexehadral mesh on FactoryServer
-# ---------------------------------------------
-
-mesh_1 = hexablock.mesh(doc)
-
-print "Number of hexaedra   :", mesh_1.NbHexas()
-print "Number of quadrangles:", mesh_1.NbQuadrangles()
-print "Number of segments   :", mesh_1.NbEdges()
-print "Number de nodes      :", mesh_1.NbNodes()
-
-# Generate the hexehadral mesh on FooBar container
-# ------------------------------------------------
-
-container = "FooBar"
-
-mesh_2 = hexablock.mesh(doc, name+":"+container, 3, container)
-
-print "Number of hexaedra   :", mesh_2.NbHexas()
-print "Number of quadrangles:", mesh_2.NbQuadrangles()
-print "Number of segments   :", mesh_2.NbEdges()
-print "Number de nodes      :", mesh_2.NbNodes()