]> SALOME platform Git repositories - plugins/blsurfplugin.git/commitdiff
Salome HOME
rnc:
authorgdd <gdd>
Wed, 30 Mar 2011 14:11:15 +0000 (14:11 +0000)
committergdd <gdd>
Wed, 30 Mar 2011 14:11:15 +0000 (14:11 +0000)
- French translations
- Small improvements of GUI
- Small bug fixes

src/BLSURFPlugin/BLSURFPlugin_Attractor.cxx
src/BLSURFPlugin/BLSURFPlugin_Attractor.hxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx
src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx
src/GUI/BLSURFPluginGUI_HypothesisCreator.h
src/GUI/BLSURFPlugin_msg_en.ts
src/GUI/BLSURFPlugin_msg_fr.ts

index 8c26eb175bb7c41d8619d842455199b2aac6d86d..ad2317998141d2dbba1ad69370c2241dfcbf2b1f 100644 (file)
@@ -116,13 +116,12 @@ bool BLSURFPlugin_Attractor::init(){
     ShapeConstruct_ProjectCurveOnSurface curveProjector;
     curveProjector.Init(aSurf, Precision::Confusion());
     curveProjector.PerformAdvanced (aCurve3d, first, last, aCurve2d);
-    //Handle(Geom2d_Curve) Curve2d = BRep_Tool::CurveOnSurface(TopoDS::Edge(_attractorShape), _face, first, last);
     int N = 20 * (last - first) / _step;  // If the edge is a circle : 4>Pi so the number of points on the edge should be good -> 5 for ellipses
     for (i=0; i<=N; i++){
       P2 = aCurve2d->Value(first + i * (last-first) / N);
       i0 = floor( (P2.X() - _u1) * _gridU / (_u2 - _u1) + 0.5 );
       j0 = floor( (P2.Y() - _v1) * _gridV / (_v2 - _v1) + 0.5 );
-      MESSAGE("i0 = "<<i0<<" , j0 = "<<j0)
+      //MESSAGE("i0 = "<<i0<<" , j0 = "<<j0)
       TPnt[0] = 0.;
       TPnt[1] = i0;
       TPnt[2] = j0;
@@ -133,6 +132,7 @@ bool BLSURFPlugin_Attractor::init(){
 }
 
 void BLSURFPlugin_Attractor::SetParameters(double Start_Size, double End_Size, double Action_Radius, double Constant_Radius){
+  MESSAGE("BLSURFPlugin_Attractor::SetParameters")
   _startSize = Start_Size;
   _endSize = End_Size;
   _actionRadius = Action_Radius;
index 88c3a667472b96115d47f2662bb6ce2fce841732..74260d6ff49985229c9e0a7274c9cbe389bb0684 100644 (file)
@@ -91,11 +91,12 @@ class BLSURFPlugin_Attractor {
     BLSURFPlugin_Attractor (const TopoDS_Face& Face, const TopoDS_Shape& Attractor, const std::string& attEntry, double Step = 0.015);
     bool init();                                                // Calculates the discrete points correponding to attractor 
                                                                 // and intialises the map of distances
-    double GetSize (double u, double v);
-    TopoDS_Face GetFace() const { return _face; }
-    TopoDS_Shape GetAttractorShape() const { return _attractorShape; }
-    std::string GetAttractorEntry() const { return _attEntry; }
-    std::vector<double> GetParameters() const 
+    double              GetSize (double u, double v);
+    TopoDS_Face         GetFace()           const { return _face; }
+    TopoDS_Shape        GetAttractorShape() const { return _attractorShape; }
+    std::string         GetAttractorEntry() const { return _attEntry; }
+    double              GetStep()           const { return _step; }
+    std::vector<double> GetParameters()     const 
     { 
       double tab_params[] = {_startSize, _endSize, _actionRadius, _constantRadius}; 
       std::vector<double> params (tab_params, tab_params + sizeof(tab_params) / sizeof(double) );
index 4c2ff2e1ebf1c5449f4fe5b9c90e23bb6b628c69..4e51e6519b1d837924fe653d06aa1b7cdc50c668 100644 (file)
@@ -955,22 +955,16 @@ std::ostream & BLSURFPlugin_Hypothesis::SaveTo(std::ostream & save) {
     test << " " << "__NEW_ATTRACTORS_BEGIN__";
     for (; it_At != _classAttractors.end(); ++it_At) {
       std::vector<double> attParams;
-      attParams = it_At->second->GetParameters();
+      attParams   = it_At->second->GetParameters();
+      double step = it_At->second->GetStep();
       save << " " << it_At->first;
-//       save << " " << "__BEGIN_AT_SHAPE__";
       save << " " << it_At->second->GetAttractorEntry();
-//       save << " " << "__END_AT_SHAPE__";
-//       save << " " << "__BEGIN_AT_PARAMS__";
-      save << " " <<  attParams[0]  << " " <<  attParams[1] << " " <<  attParams[2] << " " <<  attParams[3];
-//       save << " " << "__END_AT_PARAMS__"<< "%#"; // "%#" is a mark of value end
-      //test
+      save << " " << attParams[0]  << " " <<  attParams[1] << " " <<  attParams[2] << " " <<  attParams[3];
+      save << " " << step;
       test << " " << it_At->first;
-//       test << " " << "__BEGIN_AT_SHAPE__";
       test << " " << it_At->second->GetAttractorEntry();
-//       test << " " << "__END_AT_SHAPE__";
-//       test << " " << "__BEGIN_AT_PARAMS__";
-      test << " " <<  attParams[0]  << " " <<  attParams[1] << " " <<  attParams[2] << " " <<  attParams[3];
-//       test << " " << "__END_AT_PARAMS__"<< "%#"; // "%#" is a mark of value end
+      test << " " << attParams[0]  << " " <<  attParams[1] << " " <<  attParams[2] << " " <<  attParams[3];
+      test << " " << step;
     }
     save << " " << "__NEW_ATTRACTORS_END__";
     test << " " << "__NEW_ATTRACTORS_END__";
@@ -1248,7 +1242,8 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
   
   std::string newAtFaceEntry, atTestString;
   std::string newAtShapeEntry;
-  double AttParams[4];
+  double attParams[4];
+  double step;
   while (isOK && hasNewAttractor) {
     std::cout<<"Load new attractor"<<std::endl;
     isOK = (load >> newAtFaceEntry);
@@ -1258,30 +1253,16 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
       isOK = (load >> newAtShapeEntry);
       if (!isOK)
        break;
-      isOK = (load >> AttParams[0]>>AttParams[1]>>AttParams[2]>>AttParams[3]);
+      isOK = (load >> attParams[0]>>attParams[1]>>attParams[2]>>attParams[3]>>step);
     }
     if (isOK) {
       MESSAGE(" LOADING ATTRACTOR HYPOTHESIS ")
-      const TopoDS_Shape AttractorShape = BLSURFPlugin_Hypothesis::entryToShape(newAtShapeEntry);
-      const TopoDS_Face FaceShape = TopoDS::Face(BLSURFPlugin_Hypothesis::entryToShape(newAtFaceEntry));
-      BLSURFPlugin_Attractor* Attractor = new BLSURFPlugin_Attractor(FaceShape, AttractorShape, newAtShapeEntry);
-      Attractor->SetParameters(AttParams[0], AttParams[1], AttParams[2], AttParams[3]);
-      _classAttractors[newAtFaceEntry]=Attractor;
-//       load >> atTestString;
-//       std::string & value4 = atTestString;
-//       int len4 = value4.size();
-//       // continue reading until "%#" encountered
-//       while (value4[len4 - 1] != '#' || value4[len4 - 2] != '%') {
-//         isOK = (load >> atTestString);
-//         if (isOK) {
-//           value4 += " ";
-//           value4 += atTestString;
-//           len4 = value4.size();
-//         } else {
-//           break;
-//         }
-//       }
-//       value4[len4 - 2] = '\0'; //cut off "%#"
+      const TopoDS_Shape attractorShape = BLSURFPlugin_Hypothesis::entryToShape(newAtShapeEntry);
+      const TopoDS_Face faceShape = TopoDS::Face(BLSURFPlugin_Hypothesis::entryToShape(newAtFaceEntry));
+      BLSURFPlugin_Attractor* attractor = new BLSURFPlugin_Attractor(faceShape, attractorShape, newAtShapeEntry, step);
+      attractor->SetParameters(attParams[0], attParams[1], attParams[2], attParams[3]);
+      attractor->BuildMap();                     
+      _classAttractors[newAtFaceEntry]=attractor;
     }
   }
   
index 1e40b89c89d325aa789b70e931b2e8bad7db7baa..3b748cd57fc70553bd24147cd998f6cb9e4cc9d8 100644 (file)
@@ -125,18 +125,8 @@ enum {
 };
 
 enum {
-//  SMP_BTNS = 0,
-//   SMP_ATTRACTOR_BTN,
-//   SMP_SEPARATOR1,
-//  SMP_POINT_BTN,
-//  SMP_EDGE_BTN,
-//  SMP_SURFACE_BTN,
-//   SMP_SEPARATOR2,
-//  SMP_SEPARATOR,
   SMP_TAB_WDG,
-//  SMP_ATT_GROUP, 
   SMP_ADD_BTN,
-//  SMP_REMOVE_BTN,
   SMP_NB_LINES,
   SMP_STD_TAB = 0,
   ATT_TAB,
@@ -165,6 +155,7 @@ 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,
@@ -796,35 +787,32 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
 
   mySmpGroup = new QWidget();
 //   mySmpGroup->setMinimumWidth(500);
-  //mySmpGroup->setMinimumHeight(350);
+
   //Layout
   QGridLayout* anSmpLayout = new QGridLayout(mySmpGroup);
+  
   // Table
   mySizeMapTable = new QTreeWidget( mySmpGroup );
   mySizeMapTable ->setMinimumWidth(250);
-  // tab widget
-  smpTab = new QTabWidget( mySmpGroup );
-  smpTab->setTabShape( QTabWidget::Rounded );
-  smpTab->setTabPosition( QTabWidget::East );
-  lay->addWidget( smpTab );
-  
-  // Table settings
-  //mySizeMapTable->setSortingEnabled(true);
   QStringList sizeMapHeaders;
   sizeMapHeaders << tr( "SMP_NAME_COLUMN" )<< tr( "SMP_SIZEMAP_COLUMN" )<< tr( "SMP_ENTRY_COLUMN" );// << tr( "SMP_DIST_COLUMN" );
   mySizeMapTable->setHeaderLabels(sizeMapHeaders);
-//   mySizeMapTable->headerItem()->hideSection( SMP_ENTRY_COLUMN );
-//   mySizeMapTable->headerItem()->setResizeMode(QHeaderView::Interactive);
-//   mySizeMapTable->headerItem()->setStretchLastSection(true);
-  //mySizeMapTable->horizontalHeader()->setProperty("showSortIndicator", QVariant(true));
   mySizeMapTable->resizeColumnToContents(SMP_NAME_COLUMN);
   mySizeMapTable->resizeColumnToContents(SMP_SIZEMAP_COLUMN);
   mySizeMapTable->hideColumn(SMP_ENTRY_COLUMN);
- // mySizeMapTable->resizeColumnToContents(SMP_DIST_COLUMN);
   mySizeMapTable->setAlternatingRowColors(true);
-//   mySizeMapTable->verticalHeader()->hide();
-
-//   mySizeMapTable->setShowGrid(true);
+  
+  // tab widget
+  smpTab = new QTabWidget( mySmpGroup );
+  smpTab->setTabShape( QTabWidget::Rounded );
+  smpTab->setTabPosition( QTabWidget::East );
+  lay->addWidget( smpTab );
+  
+  // Push buttons
+  removeMapButton = new QPushButton(tr("BLSURF_SM_REMOVE"),mySmpGroup);
+  addMapButton = new QPushButton(tr("BLSURF_SM_ADD"),mySmpGroup);
+  modifyMapButton = new QPushButton(tr("BLSURF_SM_MODIFY"),mySmpGroup);
+  modifyMapButton->setEnabled(false);
   
   // Filters of selection
   TColStd_MapOfInteger SM_ShapeTypes, ATT_ShapeTypes;
@@ -840,26 +828,16 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   SMESH_NumberFilter* myFilter2 = new SMESH_NumberFilter("GEOM", TopAbs_SHAPE, 0, ATT_ShapeTypes);
   SMESH_NumberFilter* myFilter3 = new SMESH_NumberFilter("GEOM", TopAbs_SHAPE, 0, TopAbs_FACE);
   
-  // Size Map GroupBox
+  // Geometry Selection Widgets 
   myGeomSelWdg1 = new StdMeshersGUI_ObjectReferenceParamWdg( myFilter1, 0, /*multiSel=*/false,/*stretch=*/false);
-  myGeomSelWdg1->SetDefaultText("Select a shape", "QLineEdit { color: grey }");
+  myGeomSelWdg1->SetDefaultText(tr("BLS_SEL_SHAPE"), "QLineEdit { color: grey }");
   myGeomSelWdg2 = new StdMeshersGUI_ObjectReferenceParamWdg( myFilter3, 0, /*multiSel=*/false,/*stretch=*/false);
-  myGeomSelWdg2->SetDefaultText("Select a face", "QLineEdit { color: grey }");
-//   QFrame *line2 = new QFrame(mySmpGroup);
-//   line2->setFrameShape(QFrame::HLine);
-//   line2->setFrameShadow(QFrame::Sunken);
-  removeMapButton = new QPushButton(tr("BLSURF_SM_REMOVE"),mySmpGroup);
-  addMapButton = new QPushButton(tr("BLSURF_SM_ADD"),mySmpGroup);
-  modifyMapButton = new QPushButton(tr("BLSURF_SM_MODIFY"),mySmpGroup);
-  modifyMapButton->setEnabled(false);
+  myGeomSelWdg2->SetDefaultText(tr("BLS_SEL_FACE"), "QLineEdit { color: grey }");// TODO ajouter aux fichiers de traduction
+  
+  myGeomSelWdg1->AvoidSimultaneousSelection(myGeomSelWdg2);
   
-  // Attractor GroupBox
-  //myAttractorGroup = new QGroupBox(tr("BLSURF_SM_ATTRACTOR"),mySmpGroup);
+  // Attractor tab
   myAttractorGroup = new QWidget();
-//   myAttractorGroup->setMinimumWidth(220);
-//   myAttractorGroup->setCheckable(true);
-//   myAttractorGroup->setChecked(false);
-//   myAttractorGroup->setEnabled(false);
   QGridLayout* anAttLayout = new QGridLayout(myAttractorGroup);
   myAttractorCheck = new QCheckBox(tr("BLSURF_ATTRACTOR"),myAttractorGroup);
   myConstSizeCheck = new QCheckBox(tr("BLSURF_CONST_SIZE"),myAttractorGroup);
@@ -876,42 +854,17 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   myAttDistLabel2 = new QLabel(tr("BLSURF_ATT_RADIUS"),myParamsGroup);
   myAttSizeLabel = new QLabel(tr("BLSURF_SM_SIZE"),myParamsGroup);
   myAttSelWdg = new StdMeshersGUI_ObjectReferenceParamWdg( myFilter2, myParamsGroup, /*multiSel=*/false,/*stretch=*/false);
-  myAttSelWdg->SetDefaultText("Select the attractor", "QLineEdit { color: grey }");
+  myAttSelWdg->SetDefaultText(tr("BLS_SEL_ATTRACTOR"), "QLineEdit { color: grey }"); // TODO ajouter aux fichiers de traduction
   
   myAttSelWdg->AvoidSimultaneousSelection(myGeomSelWdg1);
   myAttSelWdg->AvoidSimultaneousSelection(myGeomSelWdg2);
-  myGeomSelWdg1->AvoidSimultaneousSelection(myGeomSelWdg2);
-  
-  // Initialization of widgets
-//   myAttDistSpin->hide();
-//   myAttSizeSpin->hide();
-//   myAttDistLabel->hide();
-//   myAttSizeLabel->hide();
-//   myAttSelWdg->hide();
   
   // Standard size map tab
   mySmpStdGroup = new QWidget();
   QGridLayout* anSmpStdLayout = new QGridLayout(mySmpStdGroup);
-  
-  // Constant Size GroupBox
   mySmpSizeSpin = new SMESHGUI_SpinBox(mySmpStdGroup);
   mySmpSizeSpin->RangeStepAndValidator(0., COORD_MAX, 10.0, "length_precision");
   QLabel* mySmpSizeLabel = new QLabel(tr("BLSURF_SM_SIZE"),mySmpStdGroup);
-
-//   myDistanceGroup = new QGroupBox(tr("BLSURF_SM_CONST"),mySmpStdGroup);
-//   myDistanceGroup->setFlat(true);
-//   myDistanceGroup->setCheckable(true);
-//   myDistanceGroup->setChecked(false);
-//   myDistanceGroup->setEnabled(true);
-//   myDistanceGroup->setVisible(false); // NOTE Désactivé pour l'instant
-  
-//   QGridLayout* aDistLayout = new QGridLayout(myDistanceGroup );
-//   QLabel* mySmpDistLabel = new QLabel(tr("BLSURF_SM_DIST"),myDistanceGroup);
-//   myDistSelWdg = new StdMeshersGUI_ObjectReferenceParamWdg( myFilter3, myDistanceGroup, /*multiSel=*/true,/*stretch=*/false);
-//   myDistSelWdg->SetDefaultText("On Face(s)", "QLineEdit { color: grey }");
-//   myDistSelWdg->AvoidSimultaneousSelection(myGeomSelWdg1);
-//   myDistSelWdg->AvoidSimultaneousSelection(myGeomSelWdg2);
-//   myDistSelWdg->AvoidSimultaneousSelection(myAttSelWdg);
   
   // Init SpinBoxes
   myAttDistSpin->setValue(0.);
@@ -920,42 +873,39 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   mySmpSizeSpin->setValue(0.);
   
   // ADD WIDGETS (SIZEMAP TAB)
-//  anSmpLayout->addWidget(mySizeMapTable,     SMP_POINT_BTN, 0, SMP_NB_LINES+1, 1);
   anSmpLayout->addWidget(mySizeMapTable,     0,  0, SMP_NB_LINES, 1);
   anSmpLayout->setColumnStretch(0, 1);
 //  anSmpLayout->addWidget(line2,              SMP_SEPARATOR2, 1, 2, 2);
-  anSmpLayout->addWidget(smpTab,             SMP_TAB_WDG,   1, 1, 3);
-//   anSmpLayout->addWidget(myAttractorGroup,   SMP_ATT_GROUP, 1, 1, 2);
-//   anSmpLayout->addWidget(myDistanceGroup,    SMP_DIST_GROUP, 1, 1, 2);
+  anSmpLayout->addWidget(smpTab,             SMP_TAB_WDG,     1, 1, 3);
   anSmpLayout->setRowStretch(SMP_TAB_WDG, 1);
-  anSmpLayout->addWidget(addMapButton,       SMP_ADD_BTN,   1, 1, 1);
-  anSmpLayout->addWidget(removeMapButton,    SMP_ADD_BTN,   2, 1, 1);
-  anSmpLayout->addWidget(modifyMapButton,    SMP_ADD_BTN,   3, 1, 1);
-  
-  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);
-  anAttLayout->addWidget(myParamsGroup,      SMP_PARAMS,    1, 1, 2);
-  aParamsLayout->addWidget(myAttSelWdg,      SMP_ATT_SHAPE, 1, 1, 2);
-  aParamsLayout->addWidget(myAttSizeLabel,   SMP_ATT_SIZE,  1, 1, 1);
-  aParamsLayout->addWidget(myAttSizeSpin,    SMP_ATT_SIZE,  2, 1, 1);
-  aParamsLayout->addWidget(myAttDistLabel,   SMP_ATT_DIST,  1, 1, 1);
-  aParamsLayout->addWidget(myAttDistSpin,    SMP_ATT_DIST,  2, 1, 1);
-  aParamsLayout->addWidget(myAttDistLabel2,  SMP_ATT_RAD,   1, 1, 1);
-  aParamsLayout->addWidget(myAttDistSpin2,   SMP_ATT_RAD,   2, 1, 1);
-  aParamsLayout->setRowStretch(SMP_ATT_RAD+1, 1);
+  anSmpLayout->addWidget(addMapButton,       SMP_ADD_BTN,     1, 1, 1);
+  anSmpLayout->addWidget(removeMapButton,    SMP_ADD_BTN,     2, 1, 1);
+  anSmpLayout->addWidget(modifyMapButton,    SMP_ADD_BTN,     3, 1, 1);
   
-  anSmpStdLayout->addWidget(myGeomSelWdg1,    SMP_GEOM_BTN_1,  1, 1, 2);
-  anSmpStdLayout->addWidget(mySmpSizeLabel,  SMP_SIZE,      1, 1, 1);
-  anSmpStdLayout->addWidget(mySmpSizeSpin,   SMP_SIZE,      2, 1, 1);
+  // STANDARD TAB
+  anSmpStdLayout->addWidget(myGeomSelWdg1,   SMP_GEOM_BTN_1,  1, 1, 2);
+  anSmpStdLayout->addWidget(mySmpSizeLabel,  SMP_SIZE,        1, 1, 1);
+  anSmpStdLayout->addWidget(mySmpSizeSpin,   SMP_SIZE,        2, 1, 1);
   anSmpStdLayout->setRowStretch(SMP_SPACE2, 1);
   
+  //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);
+  anAttLayout->addWidget(myParamsGroup,      SMP_PARAMS,      1, 1, 2);
+  aParamsLayout->addWidget(myAttSelWdg,      SMP_ATT_SHAPE,   1, 1, 2);
+  aParamsLayout->addWidget(myAttSizeLabel,   SMP_ATT_SIZE,    1, 1, 1);
+  aParamsLayout->addWidget(myAttSizeSpin,    SMP_ATT_SIZE,    2, 1, 1);
+  aParamsLayout->addWidget(myAttDistLabel,   SMP_ATT_DIST,    1, 1, 1);
+  aParamsLayout->addWidget(myAttDistSpin,    SMP_ATT_DIST,    2, 1, 1);
+  aParamsLayout->addWidget(myAttDistLabel2,  SMP_ATT_RAD,     1, 1, 1);
+  aParamsLayout->addWidget(myAttDistSpin2,   SMP_ATT_RAD,     2, 1, 1);
+  aParamsLayout->setRowStretch(SMP_ATT_RAD+1, 1);
+  
   smpTab->insertTab( SMP_STD_TAB, mySmpStdGroup, tr( "BLSURF_SM_STD_TAB" ) );
   smpTab->insertTab( ATT_TAB, myAttractorGroup, tr( "BLSURF_SM_ATT_TAB" ) );
 
-  smpTab->setCurrentIndex( SMP_STD_TAB );
-  
-
+  smpTab->setCurrentIndex( SMP_STD_TAB ); 
 
   // Enforced vertices parameters
   myEnfGroup = new QWidget();
@@ -996,11 +946,11 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame()
   shapeTypes2.Add( TopAbs_COMPOUND );
 
   SMESH_NumberFilter* faceFilter = new SMESH_NumberFilter("GEOM", TopAbs_FACE, 0, shapeTypes1);
-  myEnfFaceWdg = new StdMeshersGUI_ObjectReferenceParamWdg( faceFilter, 0, /*multiSel=*/true);
+  myEnfFaceWdg = new StdMeshersGUI_ObjectReferenceParamWdg( faceFilter, 0, /*multiSel=*/true, /*stretch=*/false);
   myEnfFaceWdg->SetDefaultText("Select Faces", "QLineEdit { color: grey }");
 
   SMESH_NumberFilter* vertexFilter = new SMESH_NumberFilter("GEOM", TopAbs_SHAPE, 1, shapeTypes2);
-  myEnfVertexWdg = new StdMeshersGUI_ObjectReferenceParamWdg( vertexFilter, 0, /*multiSel=*/true);
+  myEnfVertexWdg = new StdMeshersGUI_ObjectReferenceParamWdg( vertexFilter, 0, /*multiSel=*/true, /*stretch=*/false);
   myEnfVertexWdg->SetDefaultText("Select Vertices", "QLineEdit { color: grey }");
 
   myEnfVertexWdg->AvoidSimultaneousSelection(myEnfFaceWdg);
@@ -1048,6 +998,7 @@ 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);
@@ -1894,10 +1845,6 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi
 
     BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this;
     QMapIterator<QString,QString> i(that->mySMPMap);
-    // QMapIterator<QString,QString> att_it(that->myATTMap);
-    // QMapIterator<QString,QString> inf_dist_it(that->myAttDistMap);
-    // QMapIterator<QString,QString> const_dist_it(that->myDistMap)
-    // Iterate over each size map
     while (i.hasNext()) {
       i.next();
       const QString entry = i.key();
@@ -1916,18 +1863,13 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi
 //        h->SetCustomSizeMapEntry( entry.toLatin1().constData(), sizeMap.toLatin1().constData() );
       }
       else {
-       // TODO coder le stockage des parametres ici dans l'idee de ce qui est fait en dessous
        if (!myATTMap[entry].isEmpty()){
          QString att_entry = myATTMap[entry];
          double infDist = myAttDistMap[entry];
          double constDist = myDistMap[entry];
          double phySize = h->GetPhySize();
-         //double const_dist = myDistMap[entry];
          h->SetClassAttractorEntry( entry.toLatin1().constData(), att_entry.toLatin1().constData(), sizeMap.toDouble() , phySize, infDist, constDist );        
        }
-//      else if( myAttDistMap[entry] > 1e-12) {
-//            h->SetConstantSizeOnAdjacentFaces(att_entry.toLatin1().constData(), conversion en double (sizeMap), endSize = user_size, const_dist  ) 
-//      }
         else {
          QString fullSizeMap;
          fullSizeMap = QString("");
@@ -1937,7 +1879,6 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi
            fullSizeMap = QString("def f(t): return ") + sizeMap;
          else if (that->mySMPShapeTypeMap[entry] == TopAbs_VERTEX)
            fullSizeMap = QString("def f(): return ") + sizeMap;
-
   //         MESSAGE("SetSizeMapEntry("<<entry.toStdString()<<") = " <<fullSizeMap.toStdString());
          h->SetSizeMapEntry( entry.toLatin1().constData(), fullSizeMap.toLatin1().constData() );
        }
@@ -2332,38 +2273,6 @@ void BLSURFPluginGUI_HypothesisCreator::onMapGeomContentModified()
       
 } 
 
-// void BLSURFPluginGUI_HypothesisCreator::onAttractorGroupClicked(bool checked){
-// //   QObjectList grpChildren = myAttractorGroup->children();
-// //   QObjectList::iterator it;
-// //   QObject* myChild;
-//   if (checked){
-//     myDistanceGroup->setEnabled(true);
-//     myAttDistSpin->show();    // TODO voir si on garde ça
-//     myAttSizeSpin->show();
-//     myAttDistLabel->show();
-//     myAttSizeLabel->show();
-//     myAttSelWdg->show();
-// //     for(it = grpChildren.begin(); it != grpChildren.end(); it++){
-// //       myChild=*it;
-// //       myChild->hide();
-// //     }
-//   }
-//   else{
-//     myDistanceGroup->setEnabled(false);
-//     myDistanceGroup->setChecked(false);
-//     myAttDistSpin->hide();
-//     myAttSizeSpin->hide();
-//     myAttDistLabel->hide();
-//     myAttSizeLabel->hide();
-//     myAttSelWdg->hide();
-//   
-// //     for(it = grpChildren.begin(); it != grpChildren.end(); it++){
-// //       myChild=*it;
-// //       myChild->show();
-// //     }
-//   } 
-// }
-
 void BLSURFPluginGUI_HypothesisCreator::onSmpItemClicked(QTreeWidgetItem * item, int col)
 { 
   MESSAGE("BLSURFPluginGUI_HypothesisCreator::onSmpItemClicked("<<col<<")")
@@ -2404,7 +2313,6 @@ void BLSURFPluginGUI_HypothesisCreator::onSmpItemClicked(QTreeWidgetItem * item,
       myGeomSelWdg1->SetObject(obj);        // Retrieve values of the selected item in the current tab widgets
       if (!sizeMap.startsWith("def")){
        mySmpSizeSpin->setValue(that->mySMPMap[entry].toDouble()); 
-//       myAttractorGroup->setChecked( false );
       }
     }  
   } 
@@ -2434,20 +2342,22 @@ void BLSURFPluginGUI_HypothesisCreator::onAttractorClicked(int state)
     myAttDistLabel->setEnabled(true);
     myAttDistSpin2->setEnabled(true);
     myAttDistLabel2->setEnabled(true);
-    if(myConstSizeCheck->checkState() == Qt::Unchecked){
+    myAttSelWdg->SetDefaultText(tr("BLS_SEL_ATTRACTOR"), "QLineEdit { color: grey }");
+    if(myConstSizeCheck->checkState() == Qt::Unchecked){   // Only attractor
       myAttDistSpin2->setEnabled(false);
       myAttDistLabel2->setEnabled(false);
       myAttDistSpin2->setValue(0.);
     }
   }
   if (state == Qt::Unchecked){
-    if(myConstSizeCheck->checkState() == Qt::Unchecked){
+    if(myConstSizeCheck->checkState() == Qt::Unchecked){  // No predefined map selected
       myParamsGroup->setEnabled(false);
     }
-    else{
+    else{                                                 // Only constant size selected
       myAttDistSpin->setEnabled(false);
       myAttDistLabel->setEnabled(false);
       myAttDistSpin->setValue(0.);
+      myAttSelWdg->SetDefaultText(tr("BLS_SEL_SHAPE"), "QLineEdit { color: grey }");
     }
   }   
 }
@@ -2460,18 +2370,19 @@ void BLSURFPluginGUI_HypothesisCreator::onConstSizeClicked(int state)
     myAttDistLabel->setEnabled(true);
     myAttDistSpin2->setEnabled(true);
     myAttDistLabel2->setEnabled(true);
-    if(myAttractorCheck->checkState() == Qt::Unchecked){
+    if(myAttractorCheck->checkState() == Qt::Unchecked){  // Only constant size
       myAttDistSpin->setEnabled(false);
       myAttDistLabel->setEnabled(false);
       myAttDistSpin->setValue(0.);
+      myAttSelWdg->SetDefaultText(tr("BLS_SEL_SHAPE"), "QLineEdit { color: grey }");
     }
   }
   if (state == Qt::Unchecked){
-    if(myAttractorCheck->checkState() == Qt::Unchecked){
+    if(myAttractorCheck->checkState() == Qt::Unchecked){  // No predefined map selected
       myParamsGroup->setEnabled(false);
     }
     else{
-      myAttDistSpin2->setEnabled(false);
+      myAttDistSpin2->setEnabled(false);                  // Only attractor selected  
       myAttDistLabel2->setEnabled(false);
       myAttDistSpin2->setValue(0.);
     }
@@ -2754,7 +2665,6 @@ void BLSURFPluginGUI_HypothesisCreator::insertAttractor(GEOM::GEOM_Object_var aF
   mySizeMapTable->resizeColumnToContents( SMP_ENTRY_COLUMN );
   mySizeMapTable->resizeColumnToContents( SMP_NAME_COLUMN );
   mySizeMapTable->resizeColumnToContents( SMP_SIZEMAP_COLUMN );
-//  mySizeMapTable->resizeColumnToContents( SMP_DIST_COLUMN );
 //  mySizeMapTable->clearSelection();
 //  mySizeMapTable->scrollToItem( mySizeMapTable->item( row  , SMP_SIZEMAP_COLUMN ) );//TODO voir si l'option est utile
 
index 454a41b2f194116740eeb01e5953c751a0262ea4..eb515a666e9efb1692710714999be0647aee29cb 100644 (file)
@@ -192,10 +192,7 @@ protected slots:
   void                onAddOption();
   void                onDeleteOption();
   void                onOptionChosenInPopup( QAction* );
-//  void                onAddAttractor();
-//  void                onMapSelectionActivated();
   void                onMapGeomContentModified();
-//   void                onAttractorGroupClicked(bool);
   void                onSmpItemClicked( QTreeWidgetItem *, int );
   void                onSmpTabChanged(int);
   void                onAttractorClicked(int);
@@ -246,12 +243,9 @@ private:
   QSpinBox*           myVerbosity;
   QTableWidget*       myOptionTable;
 
+  // Sizemap widgets
   QWidget             *mySmpGroup;
   QTreeWidget         *mySizeMapTable;
-  QPushButton         *addAttractorButton;
-  QPushButton         *addSurfaceButton;
-  QPushButton         *addEdgeButton;
-  QPushButton         *addPointButton;
   QPushButton         *addMapButton;
   QPushButton         *removeMapButton;
   QPushButton         *modifyMapButton;
@@ -269,7 +263,7 @@ private:
   QLabel              *myAttDistLabel;
   QLabel              *myAttDistLabel2;
   QLabel              *myAttSizeLabel;
-  // Sizemap widgets
+  // Selection widgets for size maps
   StdMeshersGUI_ObjectReferenceParamWdg *myGeomSelWdg1;
   StdMeshersGUI_ObjectReferenceParamWdg *myGeomSelWdg2;
   StdMeshersGUI_ObjectReferenceParamWdg *myAttSelWdg;
index 9737ce81a7c4b5c5fd91d81e8df3eeaa930b4978..fecda28696b285be8ad4b8eab3509bf53df9f0e2 100644 (file)
         <source>SMP_SIZEMAP_COLUMN</source>
         <translation>Local size</translation>
     </message>
-    <message>
-        <source>SMP_DIST_COLUMN</source>
-        <translation>Constant size dist.</translation>
-    </message>
     <message>
         <source>BLSURF_SM_SURFACE</source>
         <translation>On face (or group)</translation>
         <source>BLSURF_ATT_RADIUS</source>
         <translation>Constant over</translation>
     </message>
-    <message>
-        <source>BLSURF_SM_CONST</source>
-        <translation>Keep constant size near shape</translation>
-    </message>
     <message>
         <source>BLSURF_SM_SIZE</source>
         <translation>Local Size</translation>
         <source>BLSURF_SM_DIST</source>
         <translation>Distance</translation>
     </message>
+    <message>
+        <source>BLS_SEL_SHAPE</source>
+        <translation>Select a shape</translation>
+    </message>
+    <message>
+        <source>BLS_SEL_FACE</source>
+        <translation>Select a face</translation>
+    </message>
+    <message>
+        <source>BLS_SEL_ATTRACTOR</source>
+        <translation>Select the attractor</translation>
+    </message>
     <message>
         <source>BLSURF_SM_ADD</source>
         <translation>Add</translation>
index d5097362a859b6597f2dbc4d606de50a8248b18e..c7510fd99b1660599aa2c7fa1e03ad99cb59f70e 100755 (executable)
         <source>BLSURF_SM_ATTRACTOR</source>
         <translation>Ajouter un attracteur</translation>
     </message>
+    <message>
+        <source>BLSURF_SM_STD_TAB</source>
+        <translation>Simple</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_ATT_TAB</source>
+        <translation>Avancé</translation>
+    </message>
     <message>
         <source>BLSURF_SM_REMOVE</source>
         <translation>Supprimer</translation>
     </message>
+    <message>
+        <source>BLSURF_SM_ADD</source>
+        <translation>Ajouter</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_MODIFY</source>
+        <translation>Modifier</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_PARAMS</source>
+        <translation>Paramètres</translation>
+    </message>
+    <message>
+        <source>BLSURF_ATTRACTOR</source>
+        <translation>Attracteur</translation>
+    </message>
+    <message>
+        <source>BLSURF_CONST_SIZE</source>
+        <translation>Taille constante autour d'un objet</translation>
+    </message>
+    <message>
+        <source>BLSURF_ATT_DIST</source>
+        <translation>Dist. d'influence :</translation>
+    </message>
+    <message>
+        <source>BLSURF_ATT_RADIUS</source>
+        <translation>Constant sur :</translation>
+    </message>
+    <message>
+        <source>BLSURF_SM_SIZE</source>
+        <translation>Taille Locale :</translation>
+    </message>
+    <message>
+        <source>BLS_SEL_SHAPE</source>
+        <translation>Sélectionnez un objet</translation>
+    </message>
+    <message>
+        <source>BLS_SEL_FACE</source>
+        <translation>Sélectionnez une face</translation>
+    </message>
+    <message>
+        <source>BLS_SEL_ATTRACTOR</source>
+        <translation>Sélectionnez l'attracteur</translation>
+    </message>
     <message>
         <source>BLSURF_SM_SURF_VALUE</source>
         <translation>Taille sur les/la face(s)</translation>