-// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//================================================================================
QWidget* LineDelegate::createEditor( QWidget* parent,
- const QStyleOptionViewItem& opt,
+ const QStyleOptionViewItem& /*opt*/,
const QModelIndex& index) const
{
QWidget* w = 0;
myUseThresholdForInternalFaces = new QCheckBox( tr("USE_THRESHOLD_FOR_INTERNAL_FACES"), GroupC1 );
argGroupLayout->addWidget( myUseThresholdForInternalFaces, row, 0, 1, 2 );
row++;
+ mySetQuanta = new QCheckBox( tr("SET_QUANTA"), GroupC1 );
+ argGroupLayout->addWidget( mySetQuanta, row, 0, 1, 2 );
+ row++;
+
+ argGroupLayout->addWidget( new QLabel( tr("QUANTA_VALUE"), GroupC1 ), row, 0 );
+ myQuanta = new SMESHGUI_SpinBox( GroupC1 );
+ myQuanta->setAcceptNames( false );
+ myQuanta->RangeStepAndValidator( 1e-6, 1, 0.05, "length_precision" );
+ myQuanta->setEnabled(false);
+ argGroupLayout->addWidget( myQuanta, row, 1 );
+ row++;
// 3) Grid definition
QTabWidget* tabWdg = new QTabWidget( fr );
connect( resetBtn, SIGNAL( clicked(bool)), SLOT( onResetAxes(bool)));
connect( myConsiderInternalFaces, SIGNAL( toggled(bool)),
myUseThresholdForInternalFaces, SLOT( setEnabled(bool)));
+ connect( mySetQuanta, SIGNAL( clicked(bool)), SLOT( onSetQuanta(bool)) );
for ( int i = 0; i < 3; ++i )
{
connect( myXDirSpin[i], SIGNAL(valueChanged (const QString&)),
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;
myCreateFaces->setChecked( h->GetToCreateFaces() );
myConsiderInternalFaces->setChecked( h->GetToConsiderInternalFaces() );
myUseThresholdForInternalFaces->setChecked( h->GetToUseThresholdForInternalFaces() );
+ mySetQuanta->setChecked( h->GetToUseQuanta() );
+ myQuanta->setValue( h->GetQuanta() );
+ if (h->GetToUseQuanta())
+ myQuanta->setEnabled(true);
// grid definition
for ( int ax = 0; ax < 3; ++ax )
h->SetToCreateFaces( myCreateFaces->isChecked() );
h->SetToConsiderInternalFaces( myConsiderInternalFaces->isChecked() );
h->SetToUseThresholdForInternalFaces( myUseThresholdForInternalFaces->isChecked() );
+ h->SetToUseQuanta( mySetQuanta->isChecked() );
+ h->SetQuanta( myQuanta->text().toDouble() );
// grid
for ( int ax = 0; ax < 3; ++ax )
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;
myFixedPointGrp->setEnabled( haveSpacing );
}
+
+//================================================================================
+/*!
+ * \brief Enable and disable quanta value combo box
+ */
+//================================================================================
+
+void StdMeshersGUI_CartesianParamCreator::onSetQuanta(bool)
+{
+ StdMeshers::StdMeshers_CartesianParameters3D_var h =
+ StdMeshers::StdMeshers_CartesianParameters3D::_narrow( hypothesis() );
+ if ( h->_is_nil() )
+ return;
+
+ myQuanta->setEnabled( mySetQuanta->isChecked() );
+}