Back to index

salome-geom  6.5.0
Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes
RepairGUI_ShapeProcessDlg Class Reference

#include <RepairGUI_ShapeProcessDlg.h>

List of all members.

Public Member Functions

 RepairGUI_ShapeProcessDlg (GeometryGUI *, QWidget *=0, bool=false)
 ~RepairGUI_ShapeProcessDlg ()

Protected Member Functions

virtual GEOM::GEOM_IOperations_ptr createOperation ()
virtual bool isValid (QString &)
virtual bool execute (ObjectList &)

Private Slots

void onOk ()
bool onApply ()
void activate ()
void lineEditReturnPressed ()
void selectionChanged ()
void selectClicked ()
void advOptionToggled (bool)

Private Member Functions

void init ()
void reset ()
void loadDefaults ()
GEOM::string_arraygetActiveOperators ()
GEOM::string_arraygetParameters (const GEOM::string_array &)
GEOM::string_arraygetValues (const GEOM::string_array &)
QStringList getTexts (const GEOM::string_array &)
void enterEvent (QEvent *)
QWidget * getControl (const QString &)
void setValue (QWidget *, const QString &)
QString getValue (QWidget *) const
QString getText (QWidget *) const
void initParamsValues ()
void initSelection ()

Private Attributes

QStringList myOpLst
QMap< QString, QStringList > myValMap
GEOM::ListOfGO_var myObjects
DlgRef_1Sel * mySelectWdgt
QListWidget * myOpList
SalomeApp_DoubleSpinBox * myFixShapeTol3D
SalomeApp_DoubleSpinBox * myFixShapeMaxTol3D
SalomeApp_DoubleSpinBox * myFixFaceSizeTol
SalomeApp_DoubleSpinBox * myDropSmallEdgesTol3D
SalomeApp_DoubleSpinBox * mySplitAngleAngle
SalomeApp_DoubleSpinBox * mySplitAngleMaxTol
SalomeApp_IntSpinBox * mySplitClosedFacesNum
SalomeApp_DoubleSpinBox * mySplitContTol3D
QComboBox * mySplitContSurfCont
QComboBox * mySplitContCurvCont
QCheckBox * myBSplineSurfModeChk
QCheckBox * myBSpline3DCurveChk
QCheckBox * myBSpline2DCurveChk
SalomeApp_DoubleSpinBox * myBSplineTol3D
SalomeApp_DoubleSpinBox * myBSplineTol2D
SalomeApp_IntSpinBox * myBSplineDegree
SalomeApp_IntSpinBox * myBSplineSegments
QComboBox * myBSpline2DCont
QComboBox * myBSpline3DCont
QCheckBox * myToBezierSurfModeChk
QCheckBox * myToBezier3DCurveChk
QCheckBox * myToBezier2DCurveChk
SalomeApp_DoubleSpinBox * myToBezierMaxTol
SalomeApp_DoubleSpinBox * mySameParameterTol3D

Detailed Description

Definition at line 45 of file RepairGUI_ShapeProcessDlg.h.


Constructor & Destructor Documentation

RepairGUI_ShapeProcessDlg::RepairGUI_ShapeProcessDlg ( GeometryGUI *  theGeometryGUI,
QWidget *  parent = 0,
bool  modal = false 
)

Definition at line 59 of file RepairGUI_ShapeProcessDlg.cxx.

  : GEOMBase_Skeleton( theGeometryGUI, parent, modal )
{
  setHelpFileName( "shape_processing_operation_page.html" );
  init();
}

Here is the call graph for this function:

Definition at line 71 of file RepairGUI_ShapeProcessDlg.cxx.

{
}

Member Function Documentation

void RepairGUI_ShapeProcessDlg::activate ( ) [private, slot]

Definition at line 413 of file RepairGUI_ShapeProcessDlg.cxx.

{
  GEOMBase_Skeleton::ActivateThisDialog();
  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication( ) ))->selectionMgr(),
           SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() ) );
        
  reset();
  //myGeomGUI->SetState( 0 );
  initSelection();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void RepairGUI_ShapeProcessDlg::advOptionToggled ( bool  on) [private, slot]

Definition at line 860 of file RepairGUI_ShapeProcessDlg.cxx.

{
  QAbstractButton* btn = (QAbstractButton*)sender();
  if ( on && btn->isCheckable() &&
       SUIT_MessageBox::warning( this,
                                 tr( "GEOM_WRN_WARNING" ), tr( "TIME_CONSUMING" ),
                                 SUIT_MessageBox::Yes | SUIT_MessageBox::No ) == SUIT_MessageBox::No )
    btn->toggle();
}

Here is the caller graph for this function:

GEOM::GEOM_IOperations_ptr RepairGUI_ShapeProcessDlg::createOperation ( ) [protected, virtual]

Definition at line 565 of file RepairGUI_ShapeProcessDlg.cxx.

{
  return getGeomEngine()->GetIHealingOperations( getStudyId() );
}
void RepairGUI_ShapeProcessDlg::enterEvent ( QEvent *  ) [private]

Definition at line 429 of file RepairGUI_ShapeProcessDlg.cxx.

{
  if ( !mainFrame()->GroupBoxName->isEnabled() )
    activate();
}

Here is the call graph for this function:

bool RepairGUI_ShapeProcessDlg::execute ( ObjectList objects) [protected, virtual]

Definition at line 611 of file RepairGUI_ShapeProcessDlg.cxx.

{
  GEOM::string_array_var anOperators = getActiveOperators();
  GEOM::string_array_var aParams = getParameters( anOperators );
  GEOM::string_array_var aValues = getValues( aParams );

  /*//-- check --
  int z;
        MESSAGE("Objects : ");
        for ( z = 0; z < myObjects->length(); z++ )
                MESSAGE(myObjects[z]->GetName() << " ");
        MESSAGE("\nOperators : ");
        for ( z = 0; z < anOperators->length(); z++ )
                MESSAGE(anOperators[z] << " ");
        MESSAGE("\nParameters : ");
        for ( z = 0; z < aParams->length(); z++ )
                MESSAGE(aParams[z] << " ");
        MESSAGE("\nValues : ");
        for ( z = 0; z < aValues->length(); z ++ )
                MESSAGE(aValues[z] << " ");
        MESSAGE("\n");
  */// -----------

  QStringList anErrorObjNames;
  for ( int i = 0; i < myObjects->length(); i++ ) {
    GEOM::GEOM_Object_var obj = myObjects[i];
    GEOM::GEOM_IHealingOperations_var anOper = GEOM::GEOM_IHealingOperations::_narrow( getOperation() );
    GEOM::GEOM_Object_var anObj = anOper->ProcessShape( obj, anOperators, aParams, aValues );
    if ( anObj->_is_nil() )
      anErrorObjNames << GEOMBase::GetName( obj );
    else
    {
      if ( !IsPreview() )
      {
        QStringList aParameters;

        for ( int i = 0; i < anOperators->length(); i++ )
          aParameters << QString( anOperators[i] );

        for ( int i = 0; i < aParams->length(); i++ )
          aParameters << QString( aParams[i] );

        aParameters << getTexts( aParams );
        anObj->SetParameters(aParameters.join(":").toLatin1().constData());
      }
      objects.push_back( anObj._retn() );
    }
  }

  if ( !anErrorObjNames.empty() )
    MESSAGE( "ERRORS occured while processing the following objects: " << anErrorObjNames.join( " " ).toLatin1().data() );
    
  return anErrorObjNames.size() < myObjects->length(); // true if at least one object was OK, false if ALL objects were nil after Healing.
}

Here is the call graph for this function:

Definition at line 670 of file RepairGUI_ShapeProcessDlg.cxx.

{
  GEOM::string_array_var anOperators = new GEOM::string_array();
  QStringList aCheckedList;

  for ( int i = 0; i < myOpList->count(); i++ ) {
    if ( myOpList->item( i )->checkState() == Qt::Checked )
      aCheckedList << myOpList->item( i )->text();
  }

  anOperators->length( aCheckedList.count() );

  for ( int i = 0; i < aCheckedList.count(); i++ )
    anOperators[i] = CORBA::string_dup( aCheckedList[i].toLatin1().constData() );
                 
  return anOperators._retn();
}

Here is the caller graph for this function:

QWidget * RepairGUI_ShapeProcessDlg::getControl ( const QString &  theParam) [private]

Definition at line 692 of file RepairGUI_ShapeProcessDlg.cxx.

{
  if ( theParam == "SplitAngle.Angle" )                           return mySplitAngleAngle;
  else if ( theParam == "SplitAngle.MaxTolerance" )               return mySplitAngleMaxTol;
  else if ( theParam == "SplitClosedFaces.NbSplitPoints" )        return mySplitClosedFacesNum;
  else if ( theParam == "FixFaceSize.Tolerance" )                 return myFixFaceSizeTol;
  else if ( theParam == "DropSmallEdges.Tolerance3d" )            return myDropSmallEdgesTol3D;
  else if ( theParam == "BSplineRestriction.SurfaceMode" )        return myBSplineSurfModeChk;
  else if ( theParam == "BSplineRestriction.Curve3dMode" )        return myBSpline3DCurveChk;
  else if ( theParam == "BSplineRestriction.Curve2dMode" )        return myBSpline2DCurveChk;
  else if ( theParam == "BSplineRestriction.Tolerance3d" )        return myBSplineTol3D;
  else if ( theParam == "BSplineRestriction.Tolerance2d" )        return myBSplineTol2D;
  else if ( theParam == "BSplineRestriction.RequiredDegree" )     return myBSplineDegree;
  else if ( theParam == "BSplineRestriction.RequiredNbSegments" ) return myBSplineSegments;
  else if ( theParam == "BSplineRestriction.Continuity3d" )       return myBSpline3DCont;
  else if ( theParam == "BSplineRestriction.Continuity2d" )       return myBSpline2DCont;
  else if ( theParam == "SplitContinuity.Tolerance3d" )           return mySplitContTol3D;
  else if ( theParam == "SplitContinuity.SurfaceContinuity" )     return mySplitContSurfCont;
  else if ( theParam == "SplitContinuity.CurveContinuity" )       return mySplitContCurvCont;
  else if ( theParam == "ToBezier.SurfaceMode" )                  return myToBezierSurfModeChk;
  else if ( theParam == "ToBezier.Curve3dMode" )                  return myToBezier3DCurveChk;
  else if ( theParam == "ToBezier.Curve2dMode" )                  return myToBezier2DCurveChk;
  else if ( theParam == "ToBezier.MaxTolerance" )                 return myToBezierMaxTol;
  else if ( theParam == "SameParameter.Tolerance3d" )             return mySameParameterTol3D;
  else if ( theParam == "FixShape.Tolerance3d" )                  return myFixShapeTol3D;
  else if ( theParam == "FixShape.MaxTolerance3d" )               return myFixShapeMaxTol3D;
  return 0;
}

Here is the caller graph for this function:

Definition at line 777 of file RepairGUI_ShapeProcessDlg.cxx.

{
  GEOM::string_array_var aParams = new GEOM::string_array();
  int i = 0, j = 0;

  // calculate the length of parameters
  for ( i = 0, j = 0; i < theOperators.length(); i++ )
    j += myValMap[ QString( theOperators[i] ) ].size();
  
  // set the new length of paremeters
  aParams->length( j );

  // fill the parameters
  for ( i = 0, j = 0; i < theOperators.length(); i++ ) {
    QStringList aValLst = myValMap[ QString( theOperators[i] ) ];
    for ( QStringList::Iterator it = aValLst.begin(); it != aValLst.end(); ++it )
      aParams[j++] = CORBA::string_dup( (*it).toLatin1().constData() );
  }

  return aParams._retn();
}

Here is the caller graph for this function:

QString RepairGUI_ShapeProcessDlg::getText ( QWidget *  theControl) const [private]

Definition at line 550 of file RepairGUI_ShapeProcessDlg.cxx.

{
  if ( theControl ) {
    if ( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl ) )
      return qobject_cast<SalomeApp_DoubleSpinBox*>( theControl )->text();
    else if ( qobject_cast<SalomeApp_IntSpinBox*>( theControl ) )
      return qobject_cast<SalomeApp_IntSpinBox*>( theControl )->text();
  }   
  return QString::null;
}

Here is the caller graph for this function:

QStringList RepairGUI_ShapeProcessDlg::getTexts ( const GEOM::string_array theParams) [private]

Definition at line 822 of file RepairGUI_ShapeProcessDlg.cxx.

{
  QStringList aTexts;
    
  for ( int i = 0; i < theParams.length(); i++ ) {
    QWidget* aCtrl = getControl( (const char*)theParams[i] );
    if ( aCtrl )
    {
      QString aText = getText( aCtrl );
      if( !aText.isNull() )
        aTexts.append( aText );
    }
  }
    
  return aTexts;
}

Here is the call graph for this function:

Here is the caller graph for this function:

QString RepairGUI_ShapeProcessDlg::getValue ( QWidget *  theControl) const [private]

Definition at line 531 of file RepairGUI_ShapeProcessDlg.cxx.

{
  if ( theControl ) {
    if ( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl ) )
      return QString::number( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl )->value() );
    else if ( qobject_cast<SalomeApp_IntSpinBox*>( theControl ) )
      return QString::number( qobject_cast<SalomeApp_IntSpinBox*>( theControl )->value() );
    else if ( qobject_cast<QComboBox*>( theControl ) )
      return qobject_cast<QComboBox*>( theControl )->currentText();
    else if ( qobject_cast<QCheckBox*>( theControl ) )
      return qobject_cast<QCheckBox*>( theControl )->isChecked() ? "1" : "0";
  }   
  return 0;
}

Here is the caller graph for this function:

Definition at line 804 of file RepairGUI_ShapeProcessDlg.cxx.

{
  GEOM::string_array_var aValues = new GEOM::string_array();
  aValues->length( theParams.length() );
    
  for ( int i = 0; i < theParams.length(); i++ ) {
    QWidget* aCtrl = getControl( (const char*)theParams[i] );
    if ( aCtrl )
      aValues[i] = get_convert( (const char*)theParams[i], getValue( aCtrl ) );
  }
    
  return aValues._retn();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void RepairGUI_ShapeProcessDlg::init ( ) [private]

Definition at line 79 of file RepairGUI_ShapeProcessDlg.cxx.

{
  //myGeomGUI->SetState( 0 );

  initParamsValues();
  initSelection();
        
  setWindowTitle( tr( "GEOM_SHAPEPROCESS_TITLE" ) );

  mainFrame()->GroupConstructors->hide();
  
  // select widget on the top 
  mySelectWdgt = new DlgRef_1Sel( centralWidget() );
  mySelectWdgt->GroupBox1->setTitle( tr( "GEOM_SHAPE" ) );
  mySelectWdgt->TextLabel1->setText( tr( "GEOM_SELECTED_OBJECTS" ) );
  mySelectWdgt->PushButton1->setIcon( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
  mySelectWdgt->LineEdit1->setReadOnly( true );

  // layout the two group boxes in the middle, add a list of operations
  QGroupBox* anOperGr = new QGroupBox( tr( "GEOM_OPERATIONS" ), centralWidget() );

  // operations list widget
  myOpList = new QListWidget( anOperGr );
  myOpList->setSortingEnabled( false );
  myOpList->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) );

  QVBoxLayout* aOperLay = new QVBoxLayout( anOperGr );
  aOperLay->setMargin( 9 );
  aOperLay->addWidget( myOpList );

  QGroupBox* aParamsGr = new QGroupBox( tr( "GEOM_PARAMETERS" ), centralWidget() );

  // add a widget stack to the parameters group box
  QStackedLayout* aStack = new QStackedLayout( aParamsGr );

  // continueties values..
  QStringList aContinueties = QString( "C0,G1,C1,G2,C2,C3,CN" ).split( "," );

  // fill in the widgets
  for ( int i = 0; i < myOpLst.count(); i++ ) {
    QListWidgetItem* item = new QListWidgetItem( myOpLst[i] );
    item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable );
    item->setCheckState( Qt::Unchecked );
    myOpList->addItem( item );

    QWidget* w;
    if ( myOpLst[i] == "FixShape" ) {
      // FixShape
      w = new QWidget( aParamsGr );
      QGridLayout* aLay = new QGridLayout( w );
      aLay->setMargin( 9 ); aLay->setSpacing( 6 );
      
      myFixShapeTol3D = new SalomeApp_DoubleSpinBox( w );
      initSpinBox( myFixShapeTol3D, 0., 100., 1e-7, "len_tol_precision" );
      myFixShapeMaxTol3D = new SalomeApp_DoubleSpinBox( w );
      initSpinBox( myFixShapeMaxTol3D, 0., 100., 1e-7, "len_tol_precision" );      
      
      aLay->addWidget( new QLabel( tr( "GEOM_3D_TOLERANCE" ), w ), 0, 0 );
      aLay->addWidget( myFixShapeTol3D, 0, 1 );
      aLay->addWidget( new QLabel( tr( "GEOM_MAX_3D_TOLERANCE" ), w ), 1, 0 );
      aLay->addWidget( myFixShapeMaxTol3D, 1, 1 );
      aLay->setRowStretch( aLay->rowCount(), 5 );
    }
    else if ( myOpLst[i] == "FixFaceSize" ) {
      // FixFaceSize  
      w = new QWidget( aParamsGr );
      QGridLayout* aLay = new QGridLayout( w );
      aLay->setMargin( 9 ); aLay->setSpacing( 6 );
      
      myFixFaceSizeTol = new SalomeApp_DoubleSpinBox( w );
      initSpinBox( myFixFaceSizeTol, 0., 100., 1e-7, "len_tol_precision" );      
      
      aLay->addWidget( new QLabel( tr( "GEOM_TOLERANCE" ), w ), 0, 0 );
      aLay->addWidget( myFixFaceSizeTol, 0, 1 );
      aLay->setRowStretch( aLay->rowCount(), 5 );
    }
    else if ( myOpLst[i] == "DropSmallEdges" ) {
      // DropSmallEdges
      w = new QWidget( aParamsGr );
      QGridLayout* aLay = new QGridLayout( w );
      aLay->setMargin( 9 ); aLay->setSpacing( 6 );
      
      myDropSmallEdgesTol3D = new SalomeApp_DoubleSpinBox( w );
      initSpinBox( myDropSmallEdgesTol3D, 0., 100., 1e-7, "len_tol_precision" );
  
      aLay->addWidget( new QLabel( tr( "GEOM_3D_TOLERANCE" ), w ), 0, 0 );
      aLay->addWidget( myDropSmallEdgesTol3D, 0, 1 );
      aLay->setRowStretch( aLay->rowCount(), 5 );
    }
    else if ( myOpLst[i] == "SplitAngle" ) {
      // SplitAngle
      w = new QWidget( aParamsGr );
      QGridLayout* aLay = new QGridLayout( w );
      aLay->setMargin( 9 ); aLay->setSpacing( 6 );
      
      mySplitAngleAngle = new SalomeApp_DoubleSpinBox( w );
      initSpinBox( mySplitAngleAngle, 0, 360, 1, "angle_precision" );      
      mySplitAngleMaxTol = new SalomeApp_DoubleSpinBox( w );
      initSpinBox( mySplitAngleMaxTol, 0., 100., 1e-7, "ang_tol_precision" );      
      
      aLay->addWidget( new QLabel( tr( "GEOM_ANGLE_1" ), w ), 0, 0 );
      aLay->addWidget( mySplitAngleAngle, 0, 1 );
      aLay->addWidget( new QLabel( tr( "GEOM_MAX_TOLERANCE" ), w ), 1, 0 );
      aLay->addWidget( mySplitAngleMaxTol, 1, 1 );
      aLay->setRowStretch( aLay->rowCount(), 5 );
    }
    else if ( myOpLst[i] == "SplitClosedFaces" ) {
      // SplitClosedFaces
      w = new QWidget( aParamsGr );
      QGridLayout* aLay = new QGridLayout( w );
      aLay->setMargin( 9 ); aLay->setSpacing( 6 );
      
      mySplitClosedFacesNum = new SalomeApp_IntSpinBox( w );
  
      aLay->addWidget( new QLabel( tr( "GEOM_NUM_SPLIT_POINTS" ), w ), 0, 0 );
      aLay->addWidget( mySplitClosedFacesNum, 0, 1 );
      aLay->setRowStretch( aLay->rowCount(), 5 );
    }      
    else if ( myOpLst[i] == "SplitContinuity" ) {
      // SplitContinuity
      w = new QWidget( aParamsGr );
      QGridLayout* aLay = new QGridLayout( w );
      aLay->setMargin( 9 ); aLay->setSpacing( 6 );

      mySplitContTol3D = new SalomeApp_DoubleSpinBox( w );
      initSpinBox( mySplitContTol3D, 0., 100., 1e-7, "len_tol_precision" );
      mySplitContSurfCont = new QComboBox( w );
      mySplitContSurfCont->addItems( aContinueties );
      mySplitContCurvCont = new QComboBox( w );
      mySplitContCurvCont->addItems( aContinueties );
      
      aLay->addWidget( new QLabel( tr( "GEOM_3D_TOLERANCE" ), w ), 0, 0 );
      aLay->addWidget( mySplitContTol3D, 0, 1 );
      aLay->addWidget( new QLabel( tr( "GEOM_SURFACE_CONTINUTY" ), w ), 1, 0 );
      aLay->addWidget( mySplitContSurfCont, 1, 1 );
      aLay->addWidget( new QLabel( tr( "GEOM_CURVE_CONTINUTY" ), w ), 2, 0 );
      aLay->addWidget( mySplitContCurvCont, 2, 1 );
      aLay->setRowStretch( aLay->rowCount(), 5 );
    }
    else if ( myOpLst[i] == "BSplineRestriction" ) {
      // BSplineRestriction
      w = new QWidget( aParamsGr );
      QGridLayout* aLay = new QGridLayout( w );
      aLay->setMargin( 9 ); aLay->setSpacing( 6 );

      myBSplineSurfModeChk = new QCheckBox( tr("GEOM_SURFACE_MODE"), w );
      myBSpline3DCurveChk = new QCheckBox( tr("GEOM_3D_CURVE_MODE"), w );
      myBSpline2DCurveChk = new QCheckBox( tr("GEOM_2D_CURVE_MODE"), w );

      myBSplineTol3D = new SalomeApp_DoubleSpinBox( w );
      initSpinBox( myBSplineTol3D, 0., 100., 1e-7, "len_tol_precision" );
      
      myBSplineTol2D = new SalomeApp_DoubleSpinBox( w );
      initSpinBox( myBSplineTol2D, 0., 100., 1e-7, "param_tol_precision" );      

      myBSplineDegree = new SalomeApp_IntSpinBox( w );
      myBSplineSegments = new SalomeApp_IntSpinBox( w );
      myBSpline2DCont = new QComboBox( w );
      myBSpline2DCont->addItems( aContinueties );
      myBSpline3DCont = new QComboBox( w );
      myBSpline3DCont->addItems( aContinueties );
      
      myBSplineSurfModeChk->setChecked( true );
      myBSpline3DCurveChk->setChecked( true );
      myBSpline2DCurveChk->setChecked( true );

      aLay->addWidget( myBSplineSurfModeChk, 0, 0 );
      aLay->addWidget( myBSpline3DCurveChk,  1, 0 );
      aLay->addWidget( myBSpline2DCurveChk,  2, 0 );
      aLay->addWidget( new QLabel( tr( "GEOM_3D_TOLERANCE" ), w ), 3, 0 );
      aLay->addWidget( myBSplineTol3D, 3, 1 );
      aLay->addWidget( new QLabel( tr( "GEOM_2D_TOLERANCE" ), w ), 4, 0 );
      aLay->addWidget( myBSplineTol2D, 4, 1 );
      aLay->addWidget( new QLabel( tr( "GEOM_REQUIRED_DEGREE" ), w ), 5, 0 );
      aLay->addWidget( myBSplineDegree, 5, 1 );
      aLay->addWidget( new QLabel( tr( "GEOM_REQUIRED_NUM_SEGMENTS" ), w ), 6, 0 );
      aLay->addWidget( myBSplineSegments, 6, 1 );
      aLay->addWidget( new QLabel( tr( "GEOM_3D_CONTINUTY" ), w ), 7, 0 );
      aLay->addWidget( myBSpline3DCont, 7, 1 );
      aLay->addWidget( new QLabel( tr( "GEOM_2D_CONTINUTY" ), w ), 8, 0 );
      aLay->addWidget( myBSpline2DCont, 8, 1 );
      aLay->setRowStretch( aLay->rowCount(), 5 );
    }
    else if ( myOpLst[i] == "ToBezier" ) {
      // ToBezier
      w = new QWidget( aParamsGr );
      QGridLayout* aLay = new QGridLayout( w );
      aLay->setMargin( 9 ); aLay->setSpacing( 6 );

      myToBezierSurfModeChk = new QCheckBox( tr("GEOM_SURFACE_MODE"), w );
      myToBezier3DCurveChk = new QCheckBox( tr("GEOM_3D_CURVE_MODE"), w );
      myToBezier2DCurveChk = new QCheckBox( tr("GEOM_2D_CURVE_MODE"), w );
  
      myToBezierMaxTol = new SalomeApp_DoubleSpinBox( w );
      initSpinBox( myToBezierMaxTol, 0., 100., 1e-7, "len_tol_precision" );            

      aLay->addWidget( myToBezierSurfModeChk, 0, 0 );
      aLay->addWidget( myToBezier3DCurveChk, 1, 0 );
      aLay->addWidget( myToBezier2DCurveChk, 2, 0 );
      aLay->addWidget( new QLabel( tr( "GEOM_MAX_TOLERANCE" ), w ), 3, 0 );
      aLay->addWidget( myToBezierMaxTol, 3, 1 );
      aLay->setRowStretch( aLay->rowCount(), 5 );
    }
    else if ( myOpLst[i] == "SameParameter" ) {
      // SameParameter
      w = new QWidget( aParamsGr );
      QGridLayout* aLay = new QGridLayout( w );
      aLay->setMargin( 9 ); aLay->setSpacing( 6 );

      mySameParameterTol3D = new SalomeApp_DoubleSpinBox( w );
      initSpinBox( mySameParameterTol3D, 0., 100., 1e-7, "len_tol_precision" );            
      
      aLay->addWidget( new QLabel( tr( "GEOM_3D_TOLERANCE" ), w ), 0, 0 );
      aLay->addWidget( mySameParameterTol3D, 0, 1 );
      aLay->setRowStretch( aLay->rowCount(), 5 );
    }
    else {
      w = new QWidget( aParamsGr ); // dumb widget
    }
    aStack->insertWidget( i, w );
  }

  QGridLayout* layout = new QGridLayout( centralWidget() );
  layout->setMargin( 0 ); layout->setSpacing( 6 );
  layout->addWidget( mySelectWdgt, 0, 0, 1, 2 );
  layout->addWidget( anOperGr,     1, 0 );
  layout->addWidget( aParamsGr,    1, 1 );

  // signals and slots connections
  connect( buttonOk(),    SIGNAL( clicked() ), this, SLOT( onOk() ) );
  connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( onApply() ) );

  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
           SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() ) );

  connect( mySelectWdgt->PushButton1, SIGNAL( clicked() ),       this, SLOT( selectClicked() ) );
  connect( mySelectWdgt->LineEdit1,   SIGNAL( returnPressed() ), this, SLOT( lineEditReturnPressed() ) );

  connect( myToBezierSurfModeChk,     SIGNAL( toggled( bool ) ), this, SLOT( advOptionToggled( bool ) ) );

  connect( myOpList, SIGNAL( currentRowChanged( int ) ), aStack, SLOT( setCurrentIndex( int ) ) );

  adjustSize();
  loadDefaults(); // init dialog fields with values from resource file
  //myOpList->setCurrentRow( myOpList->findItem( 0 );
  reset();

  initName( tr( "PROCESS_SHAPE_NEW_OBJ_NAME" ) );
  selectionChanged();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 725 of file RepairGUI_ShapeProcessDlg.cxx.

{
  if ( myOpLst.count() )
    return;  // already filled

  myOpLst << "FixShape";
  myValMap["FixShape"] << "FixShape.Tolerance3d";
  myValMap["FixShape"] << "FixShape.MaxTolerance3d";

  myOpLst << "FixFaceSize";
  myValMap["FixFaceSize"] << "FixFaceSize.Tolerance";

  myOpLst << "DropSmallEdges";
  myValMap["DropSmallEdges"] << "DropSmallEdges.Tolerance3d";

  myOpLst << "SplitAngle";
  myValMap["SplitAngle"] << "SplitAngle.Angle";
  myValMap["SplitAngle"] << "SplitAngle.MaxTolerance";

  myOpLst << "SplitClosedFaces";
  myValMap["SplitClosedFaces"] << "SplitClosedFaces.NbSplitPoints";

  myOpLst << "SplitContinuity";
  myValMap["SplitContinuity"] << "SplitContinuity.Tolerance3d";
  myValMap["SplitContinuity"] << "SplitContinuity.SurfaceContinuity";
  myValMap["SplitContinuity"] << "SplitContinuity.CurveContinuity";

  myOpLst << "BSplineRestriction";
  myValMap["BSplineRestriction"] << "BSplineRestriction.SurfaceMode";
  myValMap["BSplineRestriction"] << "BSplineRestriction.Curve3dMode";
  myValMap["BSplineRestriction"] << "BSplineRestriction.Curve2dMode";
  myValMap["BSplineRestriction"] << "BSplineRestriction.Tolerance3d";
  myValMap["BSplineRestriction"] << "BSplineRestriction.Tolerance2d";
  myValMap["BSplineRestriction"] << "BSplineRestriction.RequiredDegree";
  myValMap["BSplineRestriction"] << "BSplineRestriction.RequiredNbSegments";
  myValMap["BSplineRestriction"] << "BSplineRestriction.Continuity3d";
  myValMap["BSplineRestriction"] << "BSplineRestriction.Continuity2d";

  myOpLst << "ToBezier";
  myValMap["ToBezier"] << "ToBezier.SurfaceMode";
  myValMap["ToBezier"] << "ToBezier.Curve3dMode";
  myValMap["ToBezier"] << "ToBezier.Curve2dMode";
  myValMap["ToBezier"] << "ToBezier.MaxTolerance";

  myOpLst << "SameParameter";
  myValMap["SameParameter"] << "SameParameter.Tolerance3d";
}

Here is the caller graph for this function:

Definition at line 843 of file RepairGUI_ShapeProcessDlg.cxx.

{
  TColStd_MapOfInteger aTypes;
  aTypes.Add( GEOM_COMPOUND );
  aTypes.Add( GEOM_SOLID );
  aTypes.Add( GEOM_SHELL );
  aTypes.Add( GEOM_FACE );
  aTypes.Add( GEOM_WIRE );
  aTypes.Add( GEOM_EDGE );
  globalSelection( aTypes );
}

Here is the caller graph for this function:

bool RepairGUI_ShapeProcessDlg::isValid ( QString &  msg) [protected, virtual]

Definition at line 574 of file RepairGUI_ShapeProcessDlg.cxx.

{
  bool ok = true;
  QMapIterator<QString,QStringList> aMapIter( myValMap );
  while( aMapIter.hasNext() ) {
    aMapIter.next();
    const QStringList& aList = aMapIter.value();
    QListIterator<QString> aListIter( aList );
    while( aListIter.hasNext() ) {
      const QString& aParam = aListIter.next();
      QWidget* aControl = getControl( aParam );
      if ( qobject_cast<SalomeApp_DoubleSpinBox*>( aControl ) )
        ok = qobject_cast<SalomeApp_DoubleSpinBox*>( aControl )->isValid( msg, !IsPreview() ) && ok;
      else if ( qobject_cast<SalomeApp_IntSpinBox*>( aControl ) )
        ok = qobject_cast<SalomeApp_IntSpinBox*>( aControl )->isValid( msg, !IsPreview() ) && ok;
    }
  }

  bool error = false;
  GEOM::string_array_var anOperators = getActiveOperators();
  if ( !myObjects->length() ) {
    msg += tr( "ERROR_NO_OBJECTS" );
    error = true;
  }
  if ( !anOperators->length() ) {
    if ( error ) 
      msg += "\n";
    msg += tr( "ERROR_NO_OPERATORS" );
    error = true;
  }
  return !error && ok;
}

Here is the call graph for this function:

Definition at line 403 of file RepairGUI_ShapeProcessDlg.cxx.

{
  GEOMBase_Skeleton::LineEditReturnPressed();
}

Here is the caller graph for this function:

Definition at line 479 of file RepairGUI_ShapeProcessDlg.cxx.

{
  GEOM::GEOM_IHealingOperations_var anOp = myGeomGUI->GetGeomGen()->GetIHealingOperations( getStudyId() );
  GEOM::string_array_var anOperators, aParams, aValues;
  anOp->GetShapeProcessParameters( anOperators, aParams, aValues );

  // check the default items-operators
  for ( int i = 0; i < anOperators->length(); i++ ) {
    //MESSAGE("-->"<<(const char*)anOperators[i]);
    QList<QListWidgetItem*> items = myOpList->findItems ( (const char*)anOperators[i], Qt::MatchFixedString );
    if ( items.count() ) 
      ( items[0] )->setCheckState( Qt::Checked );
  }

  // Retrieve default parameters for ALL operators
  for ( int i = 0; i < myOpList->count(); i++ ) {
    CORBA::String_var anOperator = CORBA::string_dup( myOpList->item( i )->text().toLatin1().constData() );
    anOp->GetOperatorParameters( anOperator.in(), aParams, aValues );

    // set default values of parameters
    if ( aParams->length() != aValues->length() )
      continue;

    for ( int j = 0; j < aParams->length(); j++ ) {
      QWidget* aCtrl = getControl( (const char*)aParams[j] );
      setValue( aCtrl, set_convert( (const char*)aParams[j], aValues[j] ) );
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool RepairGUI_ShapeProcessDlg::onApply ( ) [private, slot]

Definition at line 345 of file RepairGUI_ShapeProcessDlg.cxx.

{
  if ( !onAccept() )
    return false;

  initName();

  reset();
  initSelection();
  
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void RepairGUI_ShapeProcessDlg::onOk ( ) [private, slot]

Definition at line 334 of file RepairGUI_ShapeProcessDlg.cxx.

{
  setIsApplyAndClose( true );
  if ( onApply() )
    ClickOnCancel();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 440 of file RepairGUI_ShapeProcessDlg.cxx.

{
  myObjects = new GEOM::ListOfGO();
  myObjects->length( 0 );       
  mySelectWdgt->LineEdit1->setText( "" );
}

Here is the caller graph for this function:

void RepairGUI_ShapeProcessDlg::selectClicked ( ) [private, slot]

Definition at line 391 of file RepairGUI_ShapeProcessDlg.cxx.

{
  myEditCurrentArgument = mySelectWdgt->LineEdit1;
  mySelectWdgt->LineEdit1->setFocus();
  selectionChanged();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 364 of file RepairGUI_ShapeProcessDlg.cxx.

{
  reset();
        
  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
  SALOME_ListIO aSelList;
  aSelMgr->selectedObjects(aSelList);

  int i = 0;
  myObjects->length(aSelList.Extent());
  for (SALOME_ListIteratorOfListIO anIt (aSelList); anIt.More(); anIt.Next()) {
    GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIt.Value() );
    if ( !CORBA::is_nil( aSelectedObject ) )
      myObjects[i++] = aSelectedObject;
  }
  myObjects->length( i );
  if ( i == 1 )
    mySelectWdgt->LineEdit1->setText( GEOMBase::GetName( myObjects[0] ) );
  else if ( i > 0 )
    mySelectWdgt->LineEdit1->setText( QString::number( i ) + "_" + tr( "GEOM_OBJECTS" ) );
}

Here is the call graph for this function:

Here is the caller graph for this function:

void RepairGUI_ShapeProcessDlg::setValue ( QWidget *  theControl,
const QString &  theValue 
) [private]

Definition at line 513 of file RepairGUI_ShapeProcessDlg.cxx.

{
  if ( theControl && !theValue.isNull() ) {
    if ( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl ) )
      qobject_cast<SalomeApp_DoubleSpinBox*>( theControl )->setValue( theValue.toDouble() );
    else if ( qobject_cast<SalomeApp_IntSpinBox*>( theControl ) )
      qobject_cast<SalomeApp_IntSpinBox*>( theControl )->setValue( theValue.toInt() );
    else if ( qobject_cast<QComboBox*>( theControl ) )
      qobject_cast<QComboBox*>( theControl )->setEditText( theValue );
    else if ( qobject_cast<QCheckBox*>( theControl ) )
      qobject_cast<QCheckBox*>( theControl )->setChecked( theValue.toInt() != 0 );
  }
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 114 of file RepairGUI_ShapeProcessDlg.h.

Definition at line 109 of file RepairGUI_ShapeProcessDlg.h.

Definition at line 115 of file RepairGUI_ShapeProcessDlg.h.

Definition at line 108 of file RepairGUI_ShapeProcessDlg.h.

SalomeApp_IntSpinBox* RepairGUI_ShapeProcessDlg::myBSplineDegree [private]

Definition at line 112 of file RepairGUI_ShapeProcessDlg.h.

SalomeApp_IntSpinBox* RepairGUI_ShapeProcessDlg::myBSplineSegments [private]

Definition at line 113 of file RepairGUI_ShapeProcessDlg.h.

Definition at line 107 of file RepairGUI_ShapeProcessDlg.h.

SalomeApp_DoubleSpinBox* RepairGUI_ShapeProcessDlg::myBSplineTol2D [private]

Definition at line 111 of file RepairGUI_ShapeProcessDlg.h.

SalomeApp_DoubleSpinBox* RepairGUI_ShapeProcessDlg::myBSplineTol3D [private]

Definition at line 110 of file RepairGUI_ShapeProcessDlg.h.

SalomeApp_DoubleSpinBox* RepairGUI_ShapeProcessDlg::myDropSmallEdgesTol3D [private]

Definition at line 96 of file RepairGUI_ShapeProcessDlg.h.

SalomeApp_DoubleSpinBox* RepairGUI_ShapeProcessDlg::myFixFaceSizeTol [private]

Definition at line 94 of file RepairGUI_ShapeProcessDlg.h.

SalomeApp_DoubleSpinBox* RepairGUI_ShapeProcessDlg::myFixShapeMaxTol3D [private]

Definition at line 92 of file RepairGUI_ShapeProcessDlg.h.

SalomeApp_DoubleSpinBox* RepairGUI_ShapeProcessDlg::myFixShapeTol3D [private]

Definition at line 91 of file RepairGUI_ShapeProcessDlg.h.

GEOM::ListOfGO_var RepairGUI_ShapeProcessDlg::myObjects [private]

Definition at line 86 of file RepairGUI_ShapeProcessDlg.h.

QListWidget* RepairGUI_ShapeProcessDlg::myOpList [private]

Definition at line 89 of file RepairGUI_ShapeProcessDlg.h.

QStringList RepairGUI_ShapeProcessDlg::myOpLst [private]

Definition at line 83 of file RepairGUI_ShapeProcessDlg.h.

SalomeApp_DoubleSpinBox* RepairGUI_ShapeProcessDlg::mySameParameterTol3D [private]

Definition at line 122 of file RepairGUI_ShapeProcessDlg.h.

Definition at line 88 of file RepairGUI_ShapeProcessDlg.h.

SalomeApp_DoubleSpinBox* RepairGUI_ShapeProcessDlg::mySplitAngleAngle [private]

Definition at line 98 of file RepairGUI_ShapeProcessDlg.h.

SalomeApp_DoubleSpinBox* RepairGUI_ShapeProcessDlg::mySplitAngleMaxTol [private]

Definition at line 99 of file RepairGUI_ShapeProcessDlg.h.

SalomeApp_IntSpinBox* RepairGUI_ShapeProcessDlg::mySplitClosedFacesNum [private]

Definition at line 101 of file RepairGUI_ShapeProcessDlg.h.

Definition at line 105 of file RepairGUI_ShapeProcessDlg.h.

Definition at line 104 of file RepairGUI_ShapeProcessDlg.h.

SalomeApp_DoubleSpinBox* RepairGUI_ShapeProcessDlg::mySplitContTol3D [private]

Definition at line 103 of file RepairGUI_ShapeProcessDlg.h.

Definition at line 119 of file RepairGUI_ShapeProcessDlg.h.

Definition at line 118 of file RepairGUI_ShapeProcessDlg.h.

SalomeApp_DoubleSpinBox* RepairGUI_ShapeProcessDlg::myToBezierMaxTol [private]

Definition at line 120 of file RepairGUI_ShapeProcessDlg.h.

Definition at line 117 of file RepairGUI_ShapeProcessDlg.h.

QMap<QString,QStringList> RepairGUI_ShapeProcessDlg::myValMap [private]

Definition at line 84 of file RepairGUI_ShapeProcessDlg.h.


The documentation for this class was generated from the following files: