Salome HOME
PreCAD GUI
authorgdd <gdd>
Wed, 27 Jul 2011 18:45:53 +0000 (18:45 +0000)
committergdd <gdd>
Wed, 27 Jul 2011 18:45:53 +0000 (18:45 +0000)
Some comestic modifications of the the BlSURF hypothesis window

src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx
src/GUI/BLSURFPluginGUI_HypothesisCreator.h
src/GUI/BLSURFPlugin_msg_en.ts
src/GUI/BLSURFPlugin_msg_fr.ts

index 6828af0ef814bdf06e242fafaa5cdd5465258b19..249a9d159ff87b8f67d35c67d598916be2ed9be0 100644 (file)
@@ -78,6 +78,7 @@
 #include <boost/algorithm/string.hpp>
 #include <structmember.h>
 #include <stdexcept>
+#include <algorithm>
 
 #define WITH_SIZE_BOUNDARIES
 
@@ -157,11 +158,12 @@ enum {
   ENF_VER_Y_COORD,
   ENF_VER_Z_COORD,
   ENF_VER_GROUP,
-  ENF_VER_SPACE,
-  ENF_VER_VERTEX_BTN,
-  ENF_VER_REMOVE_BTN,
-//   ENF_VER_SEPARATOR,
   ENF_VER_GROUP_CHECK,
+//   ENF_VER_SPACE,
+  ENF_VER_BTN,
+//   ENF_VER_VERTEX_BTN,
+//   ENF_VER_REMOVE_BTN,
+//   ENF_VER_SEPARATOR,
   ENF_VER_NB_LINES
 };
 
@@ -696,34 +698,42 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   int row = 0;
   if( isCreation() ) {
     aStdLayout->addWidget( new QLabel( tr( "SMESH_NAME" ), myStdGroup ),        row, 0, 1, 1 );
-    aStdLayout->addWidget( myName,                                              row++, 1, 1, 1 );
+    aStdLayout->addWidget( myName,                                              row++, 1, 1, 3 );
   }
-  aStdLayout->addWidget( new QLabel( tr( "BLSURF_GRADATION" ), myStdGroup ),    row, 0, 1, 1 );
-  aStdLayout->addWidget( myGradation,                                           row++, 1, 1, 1 );
   aStdLayout->addWidget( new QLabel( tr( "BLSURF_PHY_MESH" ), myStdGroup ),     row, 0, 1, 1 );
   aStdLayout->addWidget( myPhysicalMesh,                                        row++, 1, 1, 1 );
   aStdLayout->addWidget( new QLabel( tr( "BLSURF_HPHYDEF" ), myStdGroup),       row, 0, 1, 1 );
   aStdLayout->addWidget( myPhySize,                                             row++, 1, 1, 1 );
+  aStdLayout->addWidget( new QLabel( tr( "BLSURF_GRADATION" ), myStdGroup ),    row, 0, 1, 1 );
+  aStdLayout->addWidget( myGradation,                                           row++, 1, 1, 1 );
 #ifdef WITH_SIZE_BOUNDARIES
   aStdLayout->addWidget( new QLabel( tr( "BLSURF_HPHYMIN" ), myStdGroup ),      row, 0, 1, 1 );
   aStdLayout->addWidget( myPhyMin,                                              row++, 1, 1, 1 );
   aStdLayout->addWidget( new QLabel( tr( "BLSURF_HPHYMAX" ), myStdGroup ),      row, 0, 1, 1 );
   aStdLayout->addWidget( myPhyMax,                                              row++, 1, 1, 1 );
 #endif
-  aStdLayout->addWidget( new QLabel( tr( "BLSURF_GEOM_MESH" ), myStdGroup ),    row, 0, 1, 1 );
-  aStdLayout->addWidget( myGeometricMesh,                                       row++, 1, 1, 1 );
-  aStdLayout->addWidget( new QLabel( tr( "BLSURF_ANGLE_MESH_S" ), myStdGroup ), row, 0, 1, 1 );
-  aStdLayout->addWidget( myAngleMeshS,                                          row++, 1, 1, 1 );
-  aStdLayout->addWidget( new QLabel( tr( "BLSURF_ANGLE_MESH_C" ), myStdGroup ), row, 0, 1, 1 );
-  aStdLayout->addWidget( myAngleMeshC,                                          row++, 1, 1, 1 );
+  int maxrow = row;
+  if( isCreation() )
+    row = 1;
+  else
+    row = 0;
+  aStdLayout->addWidget( new QLabel( tr( "BLSURF_GEOM_MESH" ), myStdGroup ),    row, 2, 1, 1 );
+  aStdLayout->addWidget( myGeometricMesh,                                       row++, 3, 1, 1 );
+  aStdLayout->addWidget( new QLabel( tr( "BLSURF_ANGLE_MESH_S" ), myStdGroup ), row, 2, 1, 1 );
+  aStdLayout->addWidget( myAngleMeshS,                                          row++, 3, 1, 1 );
+  aStdLayout->addWidget( new QLabel( tr( "BLSURF_ANGLE_MESH_C" ), myStdGroup ), row, 2, 1, 1 );
+  aStdLayout->addWidget( myAngleMeshC,                                          row++, 3, 1, 1 );
 #ifdef WITH_SIZE_BOUNDARIES
-  aStdLayout->addWidget( new QLabel( tr( "BLSURF_HGEOMIN" ), myStdGroup ),      row, 0, 1, 1 );
-  aStdLayout->addWidget( myGeoMin,                                              row++, 1, 1, 1 );
-  aStdLayout->addWidget( new QLabel( tr( "BLSURF_HGEOMAX" ), myStdGroup ),      row, 0, 1, 1 );
-  aStdLayout->addWidget( myGeoMax,                                              row++, 1, 1, 1 );
+  aStdLayout->addWidget( new QLabel( tr( "BLSURF_HGEOMIN" ), myStdGroup ),      row, 2, 1, 1 );
+  aStdLayout->addWidget( myGeoMin,                                              row++, 3, 1, 1 );
+  aStdLayout->addWidget( new QLabel( tr( "BLSURF_HGEOMAX" ), myStdGroup ),      row, 2, 1, 1 );
+  aStdLayout->addWidget( myGeoMax,                                              row++, 3, 1, 1 );
 #endif
-  aStdLayout->addWidget( myAllowQuadrangles,                                    row++, 0, 1, 1 );
-  aStdLayout->addWidget( myDecimesh,                                            row++, 0, 1, 1 );
+  row = max(row,maxrow)+1;
+  aStdLayout->addWidget( myAllowQuadrangles,                                    row, 0, 1, 2 );
+  aStdLayout->addWidget( myDecimesh,                                            row++, 2, 1, 2 );
+  aStdLayout->setRowStretch(row,1);
+  maxrow = row;
 
   // advanced parameters
   myAdvGroup = new QWidget();
@@ -762,15 +772,30 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   addBtn->setMenu( new QMenu() );
   QPushButton* rmBtn = new QPushButton( tr( "REMOVE_OPTION"), myAdvGroup );
 
+  myPreCADGroupBox = new QGroupBox(tr("BLSURF_PRECAD_GROUP"),  myAdvGroup );
+  myPreCADGroupBox->setEnabled(false);
+  QGridLayout* aPreCADGroupLayout = new QGridLayout(myPreCADGroupBox);
+  myPreCADOptimCAD = new QCheckBox(tr("BLSURF_PRECAD_OPTIM_CAD"),myPreCADGroupBox);
+  aPreCADGroupLayout->addWidget(myPreCADOptimCAD);
+  myPreCADDiscardInput = new QCheckBox(tr("BLSURF_PRECAD_DISCARD_INPUT"),myPreCADGroupBox);
+  aPreCADGroupLayout->addWidget(myPreCADDiscardInput);
+  myPreCADManifoldGeom = new QCheckBox(tr("BLSURF_PRECAD_MANIFOLD_GEOM"),myPreCADGroupBox);
+  aPreCADGroupLayout->addWidget(myPreCADManifoldGeom);
+  myPreCADClosedGeom = new QCheckBox(tr("BLSURF_PRECAD_CLOSED_GEOM"),myPreCADGroupBox);
+  aPreCADGroupLayout->addWidget(myPreCADClosedGeom);
+  
 
   // ADD WIDGETS (ADVANCED TAB)
-  anAdvLayout->addWidget( new QLabel( tr( "BLSURF_TOPOLOGY" ), myAdvGroup ),  0, 0, 1, 1 );
-  anAdvLayout->addWidget( myTopology,                                         0, 1, 1, 1 );
-  anAdvLayout->addWidget( new QLabel( tr( "BLSURF_VERBOSITY" ), myAdvGroup ), 1, 0, 1, 1 );
-  anAdvLayout->addWidget( myVerbosity,                                        1, 1, 1, 1 );
-  anAdvLayout->addWidget( myOptionTable,                                      2, 0, 3, 2 );
-  anAdvLayout->addWidget( addBtn,                                             2, 2, 1, 1 );
-  anAdvLayout->addWidget( rmBtn,                                              3, 2, 1, 1 );
+  anAdvLayout->addWidget( new QLabel( tr( "BLSURF_VERBOSITY" ), myAdvGroup ), 0, 0, 1, 1 );
+  anAdvLayout->addWidget( myVerbosity,                                        0, 1, 1, 1 );
+  anAdvLayout->addWidget( new QLabel( tr( "BLSURF_TOPOLOGY" ), myAdvGroup ),  1, 0, 1, 1 );
+  anAdvLayout->addWidget( myTopology,                                         1, 1, 1, 1 );
+  anAdvLayout->addWidget( myPreCADGroupBox ,                                  2, 0, 1, 2 );
+  anAdvLayout->addWidget( addBtn,                                             0, 2, 1, 1 );
+  anAdvLayout->addWidget( rmBtn,                                              0, 3, 1, 1 );
+  anAdvLayout->addWidget( myOptionTable,                                      1, 2, 2, 2 );
+  anAdvLayout->setColumnStretch(2,0);
+  anAdvLayout->setRowStretch(3,1);
 
 
   // Size Maps parameters
@@ -887,7 +912,7 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   anSmpStdLayout->addWidget(mySmpSizeSpin,   SMP_SIZE,        2, 1, 1);
   anSmpStdLayout->setRowStretch(SMP_SPACE2, 1);
   
-  //ADVANCED TAB
+  // ADVANCED TAB
   anAttLayout->addWidget(myGeomSelWdg2,      SMP_GEOM_BTN_2,  1, 1, 2);
   anAttLayout->addWidget(myAttractorCheck,   ATT_CHECK,       1, 1, 2);
   anAttLayout->addWidget(myConstSizeCheck,   CONST_SIZE_CHECK,1, 1, 2);
@@ -946,11 +971,11 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
 
   SMESH_NumberFilter* faceFilter = new SMESH_NumberFilter("GEOM", TopAbs_FACE, 0, shapeTypes1);
   myEnfFaceWdg = new StdMeshersGUI_ObjectReferenceParamWdg( faceFilter, 0, /*multiSel=*/true, /*stretch=*/false);
-  myEnfFaceWdg->SetDefaultText("Select Faces", "QLineEdit { color: grey }");
+  myEnfFaceWdg->SetDefaultText(tr("BLS_SEL_FACES"), "QLineEdit { color: grey }");
 
   SMESH_NumberFilter* vertexFilter = new SMESH_NumberFilter("GEOM", TopAbs_SHAPE, 1, shapeTypes2);
   myEnfVertexWdg = new StdMeshersGUI_ObjectReferenceParamWdg( vertexFilter, 0, /*multiSel=*/true, /*stretch=*/false);
-  myEnfVertexWdg->SetDefaultText("Select Vertices", "QLineEdit { color: grey }");
+  myEnfVertexWdg->SetDefaultText(tr("BLS_SEL_VERTICES"), "QLineEdit { color: grey }");
 
   myEnfVertexWdg->AvoidSimultaneousSelection(myEnfFaceWdg);
 
@@ -976,19 +1001,19 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   removeVertexButton = new QPushButton(tr("BLSURF_ENF_VER_REMOVE"),myEnfGroup);
 
   // CheckBox for groups generation
-  makeGroupsCheck = new QGroupBox(tr("BLSURF_ENF_VER_GROUPS"), myEnfGroup);
-  makeGroupsCheck->setCheckable(true);
-  makeGroupsCheck->setChecked(false);
-  QGridLayout* aGroupLayout = new QGridLayout(makeGroupsCheck);
-  myGlobalGroupName = new QLineEdit(makeGroupsCheck);
-  aGroupLayout->addWidget(myGlobalGroupName);
-
-  anEnfLayout->addWidget(myEnforcedTreeWidget,     0, 0, ENF_VER_NB_LINES+1, 1);
+//   makeGroupsCheck = new QGroupBox(tr("BLSURF_ENF_VER_GROUPS"), myEnfGroup);
+//   makeGroupsCheck->setCheckable(true);
+//   makeGroupsCheck->setChecked(false);
+//   QGridLayout* aGroupLayout = new QGridLayout(makeGroupsCheck);
+  myGlobalGroupName = new QCheckBox(tr("BLSURF_ENF_VER_GROUPS"), myEnfGroup);
+  myGlobalGroupName->setChecked(false);
+//   aGroupLayout->addWidget(myGlobalGroupName);
+
+  anEnfLayout->addWidget(myEnforcedTreeWidget,     0, 0, ENF_VER_NB_LINES, 1);
   QGridLayout* anEnfLayout2 = new QGridLayout(myEnfGroup);
 //  FACE AND VERTEX SELECTION
   anEnfLayout2->addWidget(myEnfFaceWdg,             ENF_VER_FACE, 0, 1, 2);
   anEnfLayout2->addWidget(myEnfVertexWdg,           ENF_VER_VERTEX, 0, 1, 2);
-
   anEnfLayout2->addWidget(myXCoordLabel,            ENF_VER_X_COORD, 0, 1, 1);
   anEnfLayout2->addWidget(myXCoord,                 ENF_VER_X_COORD, 1, 1, 1);
   anEnfLayout2->addWidget(myYCoordLabel,            ENF_VER_Y_COORD, 0, 1, 1);
@@ -997,12 +1022,14 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   anEnfLayout2->addWidget(myZCoord,                 ENF_VER_Z_COORD, 1, 1, 1);
   anEnfLayout2->addWidget(myGroupNameLabel,         ENF_VER_GROUP, 0, 1, 1);
   anEnfLayout2->addWidget(myGroupName,              ENF_VER_GROUP, 1, 1, 1);
-  anEnfLayout2->setRowStretch(                      ENF_VER_SPACE, 1);
-  anEnfLayout2->addWidget(addVertexButton,          ENF_VER_VERTEX_BTN, 0, 1, 2);
-  anEnfLayout2->addWidget(removeVertexButton,       ENF_VER_REMOVE_BTN, 0, 1, 2);
-//   anEnfLayout->addWidget(line,                     ENF_VER_SEPARATOR, 0, 1, 2);
-  anEnfLayout2->addWidget(makeGroupsCheck,          ENF_VER_GROUP_CHECK, 0, 1, 2);
+  anEnfLayout2->addWidget(myGlobalGroupName,        ENF_VER_GROUP_CHECK, 0, 1, 2);
+//   anEnfLayout2->setRowStretch(                      ENF_VER_SPACE, 1);
+  anEnfLayout2->addWidget(addVertexButton,          ENF_VER_BTN, 0, 1, 1);
+  anEnfLayout2->addWidget(removeVertexButton,       ENF_VER_BTN, 1, 1, 1);
+  anEnfLayout2->setRowStretch(ENF_VER_NB_LINES+1, 1);
+//   anEnfLayout2->addWidget(makeGroupsCheck,          ENF_VER_GROUP_CHECK, 0, 1, 2);
   anEnfLayout->addLayout(anEnfLayout2, 0,1,ENF_VER_NB_LINES+1,2);
+//   anEnfLayout->setRowStretch(1, 1);
 
   // ---
   tab->insertTab( STD_TAB, myStdGroup, tr( "SMESH_ARGUMENTS" ) );
@@ -1064,7 +1091,7 @@ This method stop the selection of the widgets StdMeshersGUI_ObjectReferenceParam
 void BLSURFPluginGUI_HypothesisCreator::deactivateSelection(QWidget* old, QWidget* now)
 {
   if ((now == myXCoord) || (now == myYCoord) || (now == myZCoord)
-      || (now = myGroupName) || (now = makeGroupsCheck) || (now = myEnforcedTreeWidget)) {
+      || (now = myGroupName) || (now = myGlobalGroupName) || (now = myEnforcedTreeWidget)) {
     BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
     that->getGeomSelectionTool()->selectionMgr()->clearFilters();
     myEnfFaceWdg->deactivateSelection();
@@ -1330,7 +1357,7 @@ void BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices() {
     shapeName = myEnfFace->GetName();
 
     std::string groupName = myGroupName->text().toStdString();
-    if (makeGroupsCheck->isChecked())
+    if (myGlobalGroupName->isChecked())
       groupName = myGlobalGroupName->text().toStdString();
 
     if (boost::trim_copy(groupName).empty())
@@ -2007,7 +2034,7 @@ QString BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets( BlsurfHypothes
           childValueY = child->data(ENF_VER_Y_COLUMN,Qt::EditRole).toDouble();
           childValueZ = child->data(ENF_VER_Z_COLUMN,Qt::EditRole).toDouble();
           vertexEntry = child->data(ENF_VER_ENTRY_COLUMN,Qt::EditRole).toString().toStdString();
-          if (makeGroupsCheck->isChecked())
+          if (myGlobalGroupName->isChecked())
             groupName = myGlobalGroupName->text().toStdString();
           else
             groupName = child->data(ENF_VER_GROUP_COLUMN,Qt::EditRole).toString().toStdString();
index 3ef6c779e71094b774383eb6aa29ce1b029749bc..c8686d928c3cab16252c0ab24db40646c4e101f0 100644 (file)
@@ -125,6 +125,7 @@ typedef struct
   double  myAngleMeshS, myAngleMeshC, myGradation;
   double  myPhySize, myGeoMin, myGeoMax, myPhyMin,myPhyMax;
   bool    myAllowQuadrangles, myDecimesh,mySmpsurface,mySmpedge,mySmppoint,myEnforcedVertex;
+  bool    myPreCADOptimCAD, myPreCADDiscardInput, myPreCADManifoldGeom, myPreCADClosedGeom;
   TEnfVertexList enfVertexList;
   TFaceEntryEnfVertexListMap faceEntryEnfVertexListMap;
   /* TODO GROUPS
@@ -239,6 +240,11 @@ private:
 
   QWidget*            myAdvGroup;
   QComboBox*          myTopology;
+  QGroupBox*          myPreCADGroupBox;
+  QCheckBox*          myPreCADOptimCAD;
+  QCheckBox*          myPreCADDiscardInput;
+  QCheckBox*          myPreCADManifoldGeom;
+  QCheckBox*          myPreCADClosedGeom;
   QSpinBox*           myVerbosity;
   QTableWidget*       myOptionTable;
 
@@ -289,8 +295,8 @@ private:
   SMESHGUI_SpinBox*   myZCoord;
 
   QLineEdit*          myGroupName;
-  QGroupBox*          makeGroupsCheck;
-  QLineEdit*          myGlobalGroupName;
+//   QGroupBox*          makeGroupsCheck;
+  QCheckBox*          myGlobalGroupName;
 
   QPushButton*        addVertexButton;
   QPushButton*        removeVertexButton;
index 864b039e2675efaeae53e956f04c10f8f3adfd8c..e8f0a615a243eebd6c8c93e6e067c3d5bdf34c7d 100644 (file)
         <source>REMOVE_OPTION</source>
         <translation>Clear option</translation>
     </message>
+    <message>
+        <source>BLSURF_PRECAD_GROUP</source>
+        <translation>PreCAD options</translation>
+    </message>
+    <message>
+        <source>BLSURF_PRECAD_OPTIM_CAD</source>
+        <translation>Optimize CAD</translation>
+    </message>
+    <message>
+        <source>BLSURF_PRECAD_DISCARD_INPUT</source>
+        <translation>Discard input topology</translation>
+    </message>
+    <message>
+        <source>BLSURF_PRECAD_MANIFOLD_GEOM</source>
+        <translation>Manifold geometry</translation>
+    </message>
+    <message>
+        <source>BLSURF_PRECAD_CLOSED_GEOM</source>
+        <translation>Closed geometry</translation>
+    </message>
     <message>
         <source>BLSURF_SIZE_MAP</source>
         <translation>Local Size</translation>
         <source>BLS_SEL_SHAPE</source>
         <translation>Select a shape</translation>
     </message>
+    <message>
+        <source>BLS_SEL_VERTICES</source>
+        <translation>Select vertices</translation>
+    </message>
     <message>
         <source>BLS_SEL_FACE</source>
         <translation>Select a face</translation>
     </message>
+    <message>
+        <source>BLS_SEL_FACES</source>
+        <translation>Select faces</translation>
+    </message>
     <message>
         <source>BLS_SEL_ATTRACTOR</source>
         <translation>Select the attractor</translation>
     </message>
     <message>
         <source>BLSURF_ENF_VER_VERTEX</source>
-        <translation>Add enforced vertex</translation>
+        <translation>Add</translation>
     </message>
     <message>
         <source>BLSURF_ENF_VER_REMOVE</source>
-        <translation>Remove vertex</translation>
+        <translation>Remove</translation>
     </message>
     <message>
         <source>BLSURF_ENF_VER_GROUPS</source>
index 20d490449d548f7b96fc64524df6871b442b6b57..03b0618373c7cc2cd6049aa43aa7e52c6eb47be2 100755 (executable)
         <source>REMOVE_OPTION</source>
         <translation>Effacer l&apos;option</translation>
     </message>
+    <message>
+        <source>BLSURF_PRECAD_GROUP</source>
+        <translation>Options PreCAD</translation>
+    </message>
+    <message>
+        <source>BLSURF_PRECAD_OPTIM_CAD</source>
+        <translation>Optimiser la CAO</translation>
+    </message>
+    <message>
+        <source>BLSURF_PRECAD_DISCARD_INPUT</source>
+        <translation>Ignorer la topologie</translation>
+    </message>
+    <message>
+        <source>BLSURF_PRECAD_MANIFOLD_GEOM</source>
+        <translation>Géometrie manifolde</translation>
+    </message>
+    <message>
+        <source>BLSURF_PRECAD_CLOSED_GEOM</source>
+        <translation>Géometrie fermée</translation>
+    </message>
     <message>
         <source>BLSURF_SIZE_MAP</source>
         <translation>Tailles locales</translation>
         <source>BLS_SEL_SHAPE</source>
         <translation>Sélectionnez un objet</translation>
     </message>
+    <message>
+        <source>BLS_SEL_VERTICES</source>
+        <translation>Sélectionnez une/des point(s)</translation>
+    </message>
     <message>
         <source>BLS_SEL_FACE</source>
         <translation>Sélectionnez une face</translation>
     </message>
+    <message>
+        <source>BLS_SEL_FACES</source>
+        <translation>Sélectionnez une/des face(s)</translation>
+    </message>
     <message>
         <source>BLS_SEL_ATTRACTOR</source>
         <translation>Sélectionnez l&apos;attracteur</translation>
     </message>
     <message>
         <source>BLSURF_ENF_VER_VERTEX</source>
-        <translation>Ajouter un point de passage</translation>
+        <translation>Ajouter</translation>
     </message>
     <message>
         <source>BLSURF_ENF_VER_REMOVE</source>
-        <translation>Supprimer un point</translation>
+        <translation>Supprimer</translation>
     </message>
     <message>
         <source>BLSURF_ENF_VER_GROUPS</source>