Salome HOME
Merge branch 'V9_9_BR'
[modules/smesh.git] / src / StdMeshersGUI / StdMeshersGUI_CartesianParamCreator.cxx
index 5f193dc30a6258057a7c872f59d501573d94264d..363e04e2fbda9f1a22ca22b6e02d7252589fa4ab 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -204,8 +204,8 @@ namespace StdMeshersGUI
     axisTabLayout->setSpacing( SPACING );
 
     axisTabLayout->addWidget( modeBox    , 0, 0, 1, 3 );
-    axisTabLayout->addWidget( myInsertBtn  , 1, 0, 1, 2 );
-    axisTabLayout->addWidget( myDeleteBtn  , 2, 0, 1, 2 );
+    axisTabLayout->addWidget( myInsertBtn, 1, 0, 1, 2 );
+    axisTabLayout->addWidget( myDeleteBtn, 2, 0, 1, 2 );
     axisTabLayout->addWidget( myStepLabel, 3, 0 );
     axisTabLayout->addWidget( myStepSpin , 3, 1 );
     axisTabLayout->addWidget( csFrame    , 1, 2, 4, 1 );
@@ -457,7 +457,7 @@ namespace StdMeshersGUI
 
   //================================================================================
   /*!
-   * \brief Returms spacing to set to a hypothesis
+   * \brief Returns spacing to set to a hypothesis
    */
   //================================================================================
 
@@ -534,7 +534,7 @@ namespace StdMeshersGUI
   //================================================================================
 
   QWidget* LineDelegate::createEditor( QWidget*                    parent,
-                                       const QStyleOptionViewItem& opt,
+                                       const QStyleOptionViewItem& /*opt*/,
                                        const QModelIndex&          index) const
   {
     QWidget* w = 0;
@@ -821,6 +821,15 @@ QFrame* StdMeshersGUI_CartesianParamCreator::buildFrame()
   myAddEdges = new QCheckBox( tr("ADD_EDGES"), GroupC1 );
   argGroupLayout->addWidget( myAddEdges, row, 0, 1, 2 );
   row++;
+  myCreateFaces = new QCheckBox( tr("CREATE_FACES"), GroupC1 );
+  argGroupLayout->addWidget( myCreateFaces, row, 0, 1, 2 );
+  row++;
+  myConsiderInternalFaces = new QCheckBox( tr("CONSIDER_INTERNAL_FACES"), GroupC1 );
+  argGroupLayout->addWidget( myConsiderInternalFaces, row, 0, 1, 2 );
+  row++;
+  myUseThresholdForInternalFaces = new QCheckBox( tr("USE_THRESHOLD_FOR_INTERNAL_FACES"), GroupC1 );
+  argGroupLayout->addWidget( myUseThresholdForInternalFaces, row, 0, 1, 2 );
+  row++;
 
   // 3)  Grid definition
   QTabWidget* tabWdg = new QTabWidget( fr );
@@ -924,6 +933,8 @@ QFrame* StdMeshersGUI_CartesianParamCreator::buildFrame()
   connect( myOrthogonalChk, SIGNAL( toggled(bool)),             SLOT( onOrthogonalAxes(bool)));
   connect( optimBtn,        SIGNAL( clicked(bool)),             SLOT( onOptimalAxes(bool)));
   connect( resetBtn,        SIGNAL( clicked(bool)),             SLOT( onResetAxes(bool)));
+  connect( myConsiderInternalFaces,      SIGNAL( toggled(bool)),
+           myUseThresholdForInternalFaces, SLOT( setEnabled(bool)));
   for ( int i = 0; i < 3; ++i )
   {
     connect( myXDirSpin[i], SIGNAL(valueChanged   (const QString&)),
@@ -944,9 +955,7 @@ QFrame* StdMeshersGUI_CartesianParamCreator::buildFrame()
   if ( !shapeEntry.isEmpty() )
   {
     // find origin
-    Handle(SALOME_InteractiveObject) io =
-      new SALOME_InteractiveObject( shapeEntry.toStdString().c_str(), "GEOM" );
-    GEOM::GEOM_Object_var geomObj = SMESH::IObjectToInterface<GEOM::GEOM_Object>( io );
+    GEOM::GEOM_Object_var geomObj = SMESH::EntryToInterface<GEOM::GEOM_Object>( shapeEntry );
     if ( GEOMBase::GetShape( geomObj, shape ) && !shape.IsNull())
     {
       Bnd_Box box;
@@ -999,6 +1008,9 @@ void StdMeshersGUI_CartesianParamCreator::retrieveParams() const
     myThreshold->setText( varName );
 
   myAddEdges->setChecked( h->GetToAddEdges() );
+  myCreateFaces->setChecked( h->GetToCreateFaces() );
+  myConsiderInternalFaces->setChecked( h->GetToConsiderInternalFaces() );
+  myUseThresholdForInternalFaces->setChecked( h->GetToUseThresholdForInternalFaces() );
 
   // grid definition
   for ( int ax = 0; ax < 3; ++ax )
@@ -1086,6 +1098,9 @@ QString StdMeshersGUI_CartesianParamCreator::storeParams() const
     h->SetVarParameter( myThreshold->text().toLatin1().constData(), "SetSizeThreshold" );
     h->SetSizeThreshold( myThreshold->text().toDouble() );
     h->SetToAddEdges( myAddEdges->isChecked() );
+    h->SetToCreateFaces( myCreateFaces->isChecked() );
+    h->SetToConsiderInternalFaces( myConsiderInternalFaces->isChecked() );
+    h->SetToUseThresholdForInternalFaces( myUseThresholdForInternalFaces->isChecked() );
 
     // grid
     for ( int ax = 0; ax < 3; ++ax )
@@ -1377,9 +1392,7 @@ void StdMeshersGUI_CartesianParamCreator::onOptimalAxes(bool)
   if ( shapeEntry.isEmpty() )
     return;
 
-  Handle(SALOME_InteractiveObject) io =
-    new SALOME_InteractiveObject( shapeEntry.toStdString().c_str(), "GEOM" );
-  GEOM::GEOM_Object_var geomObj = SMESH::IObjectToInterface<GEOM::GEOM_Object>( io );
+  GEOM::GEOM_Object_var geomObj = SMESH::EntryToInterface<GEOM::GEOM_Object>( shapeEntry );
   if ( geomObj->_is_nil() )
     return;