#include <qobjectlist.h>
#include <qvalidator.h>
+// IDL Headers
+#include "SALOMEconfig.h"
+#include CORBA_SERVER_HEADER(SMESH_Group)
+
#define SPACING 5
#define MARGIN 10
//=======================================================================
SMESHGUI_FilterTable::SMESHGUI_FilterTable( QWidget* parent,
const int type )
-: QFrame( parent )
+: QFrame( parent ),
+ myIsLocked( false )
{
myEntityType = -1;
Init( type );
//=======================================================================
SMESHGUI_FilterTable::SMESHGUI_FilterTable( QWidget* parent,
const QValueList<int>& types )
-: QFrame( parent )
+: QFrame( parent ),
+ myIsLocked( false )
{
myEntityType = -1;
Init( types );
if ( aCriterion == FT_RangeOfIds ||
aCriterion == FT_BelongToGeom ||
aCriterion == FT_BelongToPlane ||
- aCriterion == FT_BelongToCylinder )
+ aCriterion == FT_BelongToCylinder ||
+ aCriterion == FT_LyingOnGeom)
{
if ( aTable->text( i, 2 ).isEmpty() )
{
if ( aCriterionType != FT_RangeOfIds &&
aCriterionType != FT_BelongToGeom &&
aCriterionType != FT_BelongToPlane &&
- aCriterionType != FT_BelongToCylinder )
+ aCriterionType != FT_BelongToCylinder &&
+ aCriterionType != FT_LyingOnGeom)
{
theCriterion.Compare = ( (ComboItem*)aTable->item( theRow, 1 ) )->GetValue();
theCriterion.Threshold = aTable->item( theRow, 2 )->text().toDouble();
if ( theCriterion.Type != FT_RangeOfIds &&
theCriterion.Type != FT_BelongToGeom &&
theCriterion.Type != FT_BelongToPlane &&
- theCriterion.Type != FT_BelongToCylinder )
+ theCriterion.Type != FT_BelongToCylinder &&
+ theCriterion.Type != FT_LyingOnGeom)
aTable->setText( theRow, 2, QString( "%1" ).arg( theCriterion.Threshold, 0, 'g', 15 ) );
else
aTable->setText( theRow, 2, QString( theCriterion.ThresholdStr ) );
int aType = GetType();
addRow( myTables[ aType ], aType );
- Table* aTable = myTables[ aType ];
Update();
}
ComboItem* anItem = ( (ComboItem*)aTable->item( aRow, 0 ) );
bool toEnable = ( (ComboItem*)aTable->item( aRow, 1 ) )->GetValue() == FT_EqualTo &&
GetCriterionType( aRow ) != FT_BelongToGeom &&
+ GetCriterionType( aRow ) != FT_LyingOnGeom &&
GetCriterionType( aRow ) != FT_RangeOfIds &&
- GetCriterionType( aRow ) != FT_FreeEdges;
+ GetCriterionType( aRow ) != FT_FreeEdges &&
+ GetCriterionType( aRow ) != FT_BadOrientedVolume;
if ( !myAddWidgets.contains( anItem ) )
{
myAddWidgets[ anItem ] = new AdditionalWidget( myWgStack );
//=======================================================================
void SMESHGUI_FilterTable::onCurrentChanged( int theRow, int theCol )
{
- updateAdditionalWidget();
+ if( !myIsLocked )
+ updateAdditionalWidget();
emit CurrentChanged( theRow, theCol );
}
int aCriterionType = GetCriterionType( row );
if ( aType == SMESH::EDGE && aCriterionType == SMESH::FT_FreeBorders ||
- aType == SMESH::FACE && aCriterionType == SMESH::FT_FreeEdges )
+ aType == SMESH::FACE && aCriterionType == SMESH::FT_FreeEdges ||
+ aType == SMESH::VOLUME && aCriterionType == SMESH::FT_BadOrientedVolume )
{
if ( aCompareItem->count() > 0 )
aCompareItem->setStringList( QStringList() );
else if ( aCriterionType == SMESH::FT_RangeOfIds ||
aCriterionType == SMESH::FT_BelongToGeom ||
aCriterionType == SMESH::FT_BelongToPlane ||
- aCriterionType == SMESH::FT_BelongToCylinder )
+ aCriterionType == SMESH::FT_BelongToCylinder ||
+ aCriterionType == SMESH::FT_LyingOnGeom)
{
QMap<int, QString> aMap;
aMap[ FT_EqualTo ] = tr( "EQUAL_TO" );
int aSelectedRow = getFirstSelectedRow();
int aCurrCol = theTable->currentColumn();
+ myIsLocked = true;
if ( toTheEnd || aSelectedRow == -1 )
{
theTable->insertRows( theTable->numRows() );
theTable->insertRows( aSelectedRow );
aCurrRow = aSelectedRow;
}
+ myIsLocked = false;
// Criteria
theTable->setItem( aCurrRow, 0, getCriterionItem( theTable, theType ) );
aCriteria[ SMESH::FT_BelongToGeom ] = tr( "BELONG_TO_GEOM" );
aCriteria[ SMESH::FT_BelongToPlane ] = tr( "BELONG_TO_PLANE" );
aCriteria[ SMESH::FT_BelongToCylinder ] = tr( "BELONG_TO_CYLINDER" );
+ aCriteria[ SMESH::FT_LyingOnGeom ] = tr( "LYING_ON_GEOM" );
}
return aCriteria;
}
aCriteria[ SMESH::FT_BelongToGeom ] = tr( "BELONG_TO_GEOM" );
aCriteria[ SMESH::FT_BelongToPlane ] = tr( "BELONG_TO_PLANE" );
aCriteria[ SMESH::FT_BelongToCylinder ] = tr( "BELONG_TO_CYLINDER" );
+ aCriteria[ SMESH::FT_LyingOnGeom ] = tr( "LYING_ON_GEOM" );
}
return aCriteria;
}
aCriteria[ SMESH::FT_BelongToGeom ] = tr( "BELONG_TO_GEOM" );
aCriteria[ SMESH::FT_BelongToPlane ] = tr( "BELONG_TO_PLANE" );
aCriteria[ SMESH::FT_BelongToCylinder ] = tr( "BELONG_TO_CYLINDER" );
+ aCriteria[ SMESH::FT_LyingOnGeom ] = tr( "LYING_ON_GEOM" );
+ aCriteria[ SMESH::FT_Length2D ] = tr( "LENGTH2D" );
+ aCriteria[ SMESH::FT_MultiConnection2D] = tr( "MULTI2D_BORDERS" );
}
return aCriteria;
}
static QMap<int, QString> aCriteria;
if ( aCriteria.isEmpty() )
{
+ aCriteria[ SMESH::FT_AspectRatio3D] = tr( "ASPECT_RATIO_3D" );
aCriteria[ SMESH::FT_RangeOfIds ] = tr( "RANGE_OF_IDS" );
aCriteria[ SMESH::FT_BelongToGeom ] = tr( "BELONG_TO_GEOM" );
+ aCriteria[ SMESH::FT_LyingOnGeom ] = tr( "LYING_ON_GEOM" );
+ aCriteria[ SMESH::FT_BadOrientedVolume ] = tr( "BAD_ORIENTED_VOLUME" );
}
return aCriteria;
}
static int aLenCr = abs( aMaxLenCr -
aMetrics.width( tr( "CRITERION" ) ) ) / aMetrics.width( ' ' ) + 5;
- static int aLenCo = abs( maxLength( getCompare(), aMetrics ) -
- aMetrics.width( tr( "COMPARE" ) ) ) / aMetrics.width( ' ' ) + 5;
-
QString aCrStr;
aCrStr.fill( ' ', aLenCr );
QString aCoStr;
void SMESHGUI_FilterDlg::enterEvent( QEvent* )
{
// mySMESHGUI->EmitSignalDeactivateDialog();
+ mySMESHGUI->SetActiveDialogBox( (QDialog*)this );
+ mySMESHGUI->ResetState();
setEnabled( true );
}
int aType = myTable->GetCriterionType( i );
if ( aType == FT_BelongToGeom ||
aType == FT_BelongToPlane ||
- aType == FT_BelongToCylinder )
+ aType == FT_BelongToCylinder ||
+ aType == FT_LyingOnGeom)
{
QString aName;
myTable->GetThreshold( i, aName );
if ( aSelMap.Extent() > 0 )
{
- if(SMESH_Actor *anActor = SMESH::FindActorByEntry( anIter.Key()->getEntry() ) )
+ if( SMESH::FindActorByEntry( anIter.Key()->getEntry() ) )
{
for ( int i = 1; i <= aSelMap.Extent(); i++ )
aToBeFiltered.Add( aSelMap(i) );
!myTable->CurrentCell( aRow, aCol ) ||
myTable->GetCriterionType( aRow ) != FT_BelongToGeom &&
myTable->GetCriterionType( aRow ) != FT_BelongToPlane &&
- myTable->GetCriterionType( aRow ) != FT_BelongToCylinder)
+ myTable->GetCriterionType( aRow ) != FT_BelongToCylinder &&
+ myTable->GetCriterionType( aRow ) != FT_LyingOnGeom )
return;
Handle(SALOME_InteractiveObject) anIO = mySelection->firstIObject() ;
GEOM::GEOM_Object_var anObj = SMESH::IObjectToInterface<GEOM::GEOM_Object>( anIO ) ;
if ( !anObj->_is_nil() )
- myTable->SetThreshold( aRow, anIO->getName() );
+ myTable->SetThreshold( aRow, GEOMBase::GetName(anObj) );
}
//=======================================================================
if ( myTable->CurrentCell( aRow, aCol ) &&
( myTable->GetCriterionType( aRow ) == FT_BelongToGeom ||
myTable->GetCriterionType( aRow ) == FT_BelongToPlane ||
- myTable->GetCriterionType( aRow ) == FT_BelongToCylinder ) )
+ myTable->GetCriterionType( aRow ) == FT_BelongToCylinder ||
+ myTable->GetCriterionType( aRow ) == FT_LyingOnGeom) )
{
- if ( myTable->GetCriterionType( aRow ) == FT_BelongToGeom )
+ if ( myTable->GetCriterionType( aRow ) == FT_BelongToGeom || myTable->GetCriterionType( aRow ) == FT_LyingOnGeom )
mySelection->AddFilter( new SALOME_TypeFilter( "GEOM" ) );
else if ( myTable->GetCriterionType( aRow ) == FT_BelongToPlane )
mySelection->AddFilter( new GEOM_FaceFilter( StdSelect_Plane ) );