mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-27 18:40:34 +05:00
23368: [CEA 1865] Possibility to define faces to mesh as a single one: transpatch mesh
This commit is contained in:
parent
189e207e89
commit
20d9e162bd
@ -56,11 +56,9 @@
|
|||||||
|
|
||||||
StdMeshersGUI_ObjectReferenceParamWdg::StdMeshersGUI_ObjectReferenceParamWdg
|
StdMeshersGUI_ObjectReferenceParamWdg::StdMeshersGUI_ObjectReferenceParamWdg
|
||||||
( SUIT_SelectionFilter* f, QWidget* parent, bool multiSelection
|
( SUIT_SelectionFilter* f, QWidget* parent, bool multiSelection
|
||||||
/*, bool stretch */)
|
|
||||||
: QWidget( parent ), myMultiSelection( multiSelection )
|
: QWidget( parent ), myMultiSelection( multiSelection )
|
||||||
{
|
{
|
||||||
myFilter = f;
|
myFilter = f;
|
||||||
// myStretchActivated = stretch;
|
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,6 +76,7 @@ StdMeshersGUI_ObjectReferenceParamWdg::StdMeshersGUI_ObjectReferenceParamWdg
|
|||||||
myFilter = new SMESH_TypeFilter( objType );
|
myFilter = new SMESH_TypeFilter( objType );
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Destructor
|
* \brief Destructor
|
||||||
@ -93,7 +92,6 @@ StdMeshersGUI_ObjectReferenceParamWdg::~StdMeshersGUI_ObjectReferenceParamWdg()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Create a leayout, initialize fields
|
* \brief Create a leayout, initialize fields
|
||||||
@ -128,9 +126,6 @@ void StdMeshersGUI_ObjectReferenceParamWdg::init()
|
|||||||
|
|
||||||
aHBox->addWidget( mySelButton );
|
aHBox->addWidget( mySelButton );
|
||||||
aHBox->addWidget( myObjNameLineEdit );
|
aHBox->addWidget( myObjNameLineEdit );
|
||||||
//if (myStretchActivated){
|
|
||||||
// aHBox->addStretch();
|
|
||||||
//}
|
|
||||||
|
|
||||||
connect( mySelButton, SIGNAL(clicked()), SLOT(activateSelection()));
|
connect( mySelButton, SIGNAL(clicked()), SLOT(activateSelection()));
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,9 @@
|
|||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
StdMeshersGUI_SubShapeSelectorWdg
|
StdMeshersGUI_SubShapeSelectorWdg
|
||||||
::StdMeshersGUI_SubShapeSelectorWdg( QWidget * parent, TopAbs_ShapeEnum aSubShType ):
|
::StdMeshersGUI_SubShapeSelectorWdg( QWidget * parent,
|
||||||
|
TopAbs_ShapeEnum subShType,
|
||||||
|
const bool toShowList ):
|
||||||
QWidget( parent ),
|
QWidget( parent ),
|
||||||
myMaxSize( -1 ),
|
myMaxSize( -1 ),
|
||||||
myPreviewActor( 0 )
|
myPreviewActor( 0 )
|
||||||
@ -80,31 +82,48 @@ StdMeshersGUI_SubShapeSelectorWdg
|
|||||||
QGridLayout* edgesLayout = new QGridLayout( this );
|
QGridLayout* edgesLayout = new QGridLayout( this );
|
||||||
edgesLayout->setMargin( MARGIN );
|
edgesLayout->setMargin( MARGIN );
|
||||||
edgesLayout->setSpacing( SPACING );
|
edgesLayout->setSpacing( SPACING );
|
||||||
|
|
||||||
myListWidget = new QListWidget( this );
|
if ( toShowList )
|
||||||
myAddButton = new QPushButton( tr( "SMESH_BUT_ADD" ), this );
|
{
|
||||||
myRemoveButton = new QPushButton( tr( "SMESH_BUT_REMOVE" ), this );
|
myListWidget = new QListWidget( this );
|
||||||
|
myAddButton = new QPushButton( tr( "SMESH_BUT_ADD" ), this );
|
||||||
|
myRemoveButton = new QPushButton( tr( "SMESH_BUT_REMOVE" ), this );
|
||||||
|
myListWidget->setSelectionMode( QListWidget::ExtendedSelection );
|
||||||
|
myListWidget->setMinimumWidth(300);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
myListWidget = 0;
|
||||||
|
myAddButton = 0;
|
||||||
|
myRemoveButton = 0;
|
||||||
|
}
|
||||||
myInfoLabel = new QLabel( this );
|
myInfoLabel = new QLabel( this );
|
||||||
myPrevButton = new QPushButton( "<<", this );
|
myPrevButton = new QPushButton( "<<", this );
|
||||||
myNextButton = new QPushButton( ">>", this );
|
myNextButton = new QPushButton( ">>", this );
|
||||||
myListWidget->setSelectionMode( QListWidget::ExtendedSelection );
|
|
||||||
|
|
||||||
edgesLayout->addWidget(myListWidget, 0, 0, 3, 3);
|
if ( myListWidget )
|
||||||
edgesLayout->addWidget(myAddButton, 0, 3);
|
{
|
||||||
edgesLayout->addWidget(myRemoveButton, 1, 3);
|
edgesLayout->addWidget(myListWidget, 0, 0, 3, 3);
|
||||||
edgesLayout->addWidget(myInfoLabel, 3, 0, 1, 3);
|
edgesLayout->addWidget(myAddButton, 0, 3);
|
||||||
edgesLayout->addWidget(myPrevButton, 4, 0);
|
edgesLayout->addWidget(myRemoveButton, 1, 3);
|
||||||
edgesLayout->addWidget(myNextButton, 4, 2);
|
edgesLayout->addWidget(myInfoLabel, 3, 0, 1, 3);
|
||||||
|
edgesLayout->addWidget(myPrevButton, 4, 0);
|
||||||
|
edgesLayout->addWidget(myNextButton, 4, 2);
|
||||||
|
|
||||||
edgesLayout->setRowStretch(2, 5);
|
edgesLayout->setRowStretch(2, 5);
|
||||||
edgesLayout->setColumnStretch(1, 5);
|
edgesLayout->setColumnStretch(1, 5);
|
||||||
|
}
|
||||||
myListWidget->setMinimumWidth(300);
|
else // show only Prev and Next buttons
|
||||||
myInfoLabel->setMinimumWidth(300);
|
{
|
||||||
myInfoLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
edgesLayout->addWidget(myInfoLabel, 0, 0, 1, 2);
|
||||||
|
edgesLayout->addWidget(myPrevButton, 1, 0);
|
||||||
|
edgesLayout->addWidget(myNextButton, 1, 1);
|
||||||
|
}
|
||||||
|
//myInfoLabel->setMinimumWidth(300);
|
||||||
|
//myInfoLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
||||||
myInfoLabel->setAlignment(Qt::AlignCenter);
|
myInfoLabel->setAlignment(Qt::AlignCenter);
|
||||||
|
|
||||||
mySubShType = aSubShType;
|
mySubShType = subShType;
|
||||||
|
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
@ -150,30 +169,31 @@ StdMeshersGUI_SubShapeSelectorWdg::~StdMeshersGUI_SubShapeSelectorWdg()
|
|||||||
void StdMeshersGUI_SubShapeSelectorWdg::init()
|
void StdMeshersGUI_SubShapeSelectorWdg::init()
|
||||||
{
|
{
|
||||||
myParamValue = "";
|
myParamValue = "";
|
||||||
myIsNotCorrected = true; // to dont call the GetCorrectedValue method twice
|
|
||||||
myListOfIDs.clear();
|
myListOfIDs.clear();
|
||||||
mySelectedIDs.clear();
|
mySelectedIDs.clear();
|
||||||
|
|
||||||
myAddButton->setEnabled( false );
|
|
||||||
myRemoveButton->setEnabled( false );
|
|
||||||
|
|
||||||
mySMESHGUI = SMESHGUI::GetSMESHGUI();
|
mySMESHGUI = SMESHGUI::GetSMESHGUI();
|
||||||
mySelectionMgr = SMESH::GetSelectionMgr( mySMESHGUI );
|
mySelectionMgr = SMESH::GetSelectionMgr( mySMESHGUI );
|
||||||
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
|
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
|
||||||
|
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->SetSelectionMode( ActorSelection );
|
aViewWindow->SetSelectionMode( ActorSelection );
|
||||||
|
|
||||||
myFilter=0;
|
myFilter=0;
|
||||||
//setFilter();
|
|
||||||
|
|
||||||
connect( myAddButton, SIGNAL(clicked()), SLOT(onAdd()));
|
if ( myListWidget )
|
||||||
connect( myRemoveButton, SIGNAL(clicked()), SLOT(onRemove()));
|
{
|
||||||
|
myAddButton->setEnabled( false );
|
||||||
|
myRemoveButton->setEnabled( false );
|
||||||
|
|
||||||
|
connect( myListWidget, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged()));
|
||||||
|
connect( myAddButton, SIGNAL(clicked()), SLOT(onAdd()));
|
||||||
|
connect( myRemoveButton, SIGNAL(clicked()), SLOT(onRemove()));
|
||||||
|
}
|
||||||
connect( myPrevButton, SIGNAL(clicked()), SLOT(onPrevious()));
|
connect( myPrevButton, SIGNAL(clicked()), SLOT(onPrevious()));
|
||||||
connect( myNextButton, SIGNAL(clicked()), SLOT(onNext()));
|
connect( myNextButton, SIGNAL(clicked()), SLOT(onNext()));
|
||||||
|
|
||||||
connect( mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(selectionIntoArgument()));
|
connect( mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(selectionIntoArgument()));
|
||||||
connect( myListWidget, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged()));
|
|
||||||
|
|
||||||
updateState();
|
updateState();
|
||||||
}
|
}
|
||||||
@ -186,14 +206,17 @@ void StdMeshersGUI_SubShapeSelectorWdg::init()
|
|||||||
|
|
||||||
void StdMeshersGUI_SubShapeSelectorWdg::setFilter()
|
void StdMeshersGUI_SubShapeSelectorWdg::setFilter()
|
||||||
{
|
{
|
||||||
SalomeApp_Study* study = mySMESHGUI->activeStudy();
|
// if ( !myFilter )
|
||||||
GEOM_TypeFilter* typeFilter = new GEOM_TypeFilter(study, mySubShType, /*isShapeType=*/true );
|
// {
|
||||||
GEOM_CompoundFilter* gpoupFilter = new GEOM_CompoundFilter(study);
|
// SalomeApp_Study* study = mySMESHGUI->activeStudy();
|
||||||
gpoupFilter->addSubType( mySubShType );
|
// GEOM_TypeFilter* typeFilter = new GEOM_TypeFilter(study, mySubShType, /*isShapeType=*/true );
|
||||||
myGeomFilters.append( typeFilter );
|
// GEOM_CompoundFilter* gpoupFilter = new GEOM_CompoundFilter(study);
|
||||||
myGeomFilters.append( gpoupFilter );
|
// gpoupFilter->addSubType( mySubShType );
|
||||||
myFilter = new SMESH_LogicalFilter( myGeomFilters, SMESH_LogicalFilter::LO_OR );
|
// myGeomFilters.append( typeFilter );
|
||||||
mySelectionMgr->installFilter( myFilter );
|
// myGeomFilters.append( gpoupFilter );
|
||||||
|
// myFilter = new SMESH_LogicalFilter( myGeomFilters, SMESH_LogicalFilter::LO_OR );
|
||||||
|
// }
|
||||||
|
// mySelectionMgr->installFilter( myFilter );
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
@ -217,6 +240,26 @@ void StdMeshersGUI_SubShapeSelectorWdg::ShowPreview( bool visible)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Connect/disconnect to change of selection
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
void StdMeshersGUI_SubShapeSelectorWdg::ActivateSelection( bool toActivate )
|
||||||
|
{
|
||||||
|
if ( !mySelectionMgr ) return;
|
||||||
|
|
||||||
|
if ( toActivate )
|
||||||
|
{
|
||||||
|
connect( mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(selectionIntoArgument()));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
disconnect(mySelectionMgr, 0, this, 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Clears selected IDs. This is a workaround of a bug that
|
* \brief Clears selected IDs. This is a workaround of a bug that
|
||||||
@ -232,7 +275,7 @@ void StdMeshersGUI_SubShapeSelectorWdg::ClearSelected()
|
|||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : selectionIntoArgument()
|
// function : selectionIntoArgument()
|
||||||
// purpose : Called when selection as changed or other case
|
// purpose : Called when selection has changed or in other cases
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void StdMeshersGUI_SubShapeSelectorWdg::selectionIntoArgument()
|
void StdMeshersGUI_SubShapeSelectorWdg::selectionIntoArgument()
|
||||||
{
|
{
|
||||||
@ -291,7 +334,7 @@ void StdMeshersGUI_SubShapeSelectorWdg::selectionIntoArgument()
|
|||||||
} else if ( aGeomObj->GetType() == 28 /*GEOM_SUBSHAPE*/ ||
|
} else if ( aGeomObj->GetType() == 28 /*GEOM_SUBSHAPE*/ ||
|
||||||
myEntry == IO->getEntry() )
|
myEntry == IO->getEntry() )
|
||||||
{
|
{
|
||||||
GEOMBase::GetShape(aGeomObj, shape);
|
GEOMBase::GetShape(aGeomObj, shape);
|
||||||
if ( !shape.IsNull() && shape.ShapeType() == mySubShType ) {
|
if ( !shape.IsNull() && shape.ShapeType() == mySubShType ) {
|
||||||
int index = myPreviewActor->GetIndexByShape( shape );
|
int index = myPreviewActor->GetIndexByShape( shape );
|
||||||
if ( index ) {
|
if ( index ) {
|
||||||
@ -313,23 +356,28 @@ void StdMeshersGUI_SubShapeSelectorWdg::selectionIntoArgument()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update add button
|
// update add button
|
||||||
myAddButton->setEnabled( ( myListWidget->count() < myMaxSize || myMaxSize == -1 ) &&
|
if ( myListWidget )
|
||||||
mySelectedIDs.size() > 0 &&
|
{
|
||||||
( mySelectedIDs.size() <= myMaxSize || myMaxSize == -1 ) );
|
myAddButton->setEnabled(( myListWidget->count() < myMaxSize || myMaxSize == -1 ) &&
|
||||||
|
( mySelectedIDs.size() > 0 ) &&
|
||||||
|
( mySelectedIDs.size() <= myMaxSize || myMaxSize == -1 ) );
|
||||||
|
|
||||||
//Connect Selected Ids in viewer and dialog's Ids list
|
//Connect Selected Ids in viewer and dialog's Ids list
|
||||||
bool signalsBlocked = myListWidget->blockSignals( true );
|
bool signalsBlocked = myListWidget->blockSignals( true );
|
||||||
myListWidget->clearSelection();
|
myListWidget->clearSelection();
|
||||||
if ( mySelectedIDs.size() > 0 ) {
|
if ( mySelectedIDs.size() > 0 ) {
|
||||||
for (int i = 0; i < mySelectedIDs.size(); i++) {
|
for (int i = 0; i < mySelectedIDs.size(); i++) {
|
||||||
QString anID = QString(" %1").arg( mySelectedIDs.at(i) );
|
QString anID = QString(" %1").arg( mySelectedIDs.at(i) );
|
||||||
QList<QListWidgetItem*> anItems = myListWidget->findItems ( anID, Qt::MatchExactly );
|
QList<QListWidgetItem*> anItems = myListWidget->findItems ( anID, Qt::MatchExactly );
|
||||||
QListWidgetItem* item;
|
QListWidgetItem* item;
|
||||||
foreach(item, anItems)
|
foreach(item, anItems)
|
||||||
item->setSelected(true);
|
item->setSelected(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
myListWidget->blockSignals( signalsBlocked );
|
||||||
}
|
}
|
||||||
myListWidget->blockSignals( signalsBlocked );
|
|
||||||
|
emit shapeSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -338,7 +386,7 @@ void StdMeshersGUI_SubShapeSelectorWdg::selectionIntoArgument()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void StdMeshersGUI_SubShapeSelectorWdg::onAdd()
|
void StdMeshersGUI_SubShapeSelectorWdg::onAdd()
|
||||||
{
|
{
|
||||||
if ( mySelectedIDs.size() < 1 )
|
if ( mySelectedIDs.size() < 1 || !myListWidget )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
myListWidget->blockSignals( true );
|
myListWidget->blockSignals( true );
|
||||||
@ -365,7 +413,7 @@ void StdMeshersGUI_SubShapeSelectorWdg::onAdd()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void StdMeshersGUI_SubShapeSelectorWdg::onRemove()
|
void StdMeshersGUI_SubShapeSelectorWdg::onRemove()
|
||||||
{
|
{
|
||||||
if ( myListWidget->count() < 1 )
|
if ( myListWidget->count() < 1 || !myListWidget )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
myListWidget->blockSignals( true );
|
myListWidget->blockSignals( true );
|
||||||
@ -390,7 +438,8 @@ void StdMeshersGUI_SubShapeSelectorWdg::onPrevious()
|
|||||||
{
|
{
|
||||||
if ( myPreviewActor ) {
|
if ( myPreviewActor ) {
|
||||||
myPreviewActor->previous();
|
myPreviewActor->previous();
|
||||||
myListWidget->clearSelection();
|
if ( myListWidget )
|
||||||
|
myListWidget->clearSelection();
|
||||||
updateButtons();
|
updateButtons();
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->Repaint();
|
aViewWindow->Repaint();
|
||||||
@ -401,7 +450,8 @@ void StdMeshersGUI_SubShapeSelectorWdg::onNext()
|
|||||||
{
|
{
|
||||||
if ( myPreviewActor ) {
|
if ( myPreviewActor ) {
|
||||||
myPreviewActor->next();
|
myPreviewActor->next();
|
||||||
myListWidget->clearSelection();
|
if ( myListWidget )
|
||||||
|
myListWidget->clearSelection();
|
||||||
updateButtons();
|
updateButtons();
|
||||||
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
|
||||||
aViewWindow->Repaint();
|
aViewWindow->Repaint();
|
||||||
@ -417,7 +467,6 @@ void StdMeshersGUI_SubShapeSelectorWdg::onListSelectionChanged()
|
|||||||
if ( !myPreviewActor )
|
if ( !myPreviewActor )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//mySelectionMgr->clearSelected();
|
|
||||||
myPreviewActor->HighlightAll( false );
|
myPreviewActor->HighlightAll( false );
|
||||||
QList<QListWidgetItem*> selItems = myListWidget->selectedItems();
|
QList<QListWidgetItem*> selItems = myListWidget->selectedItems();
|
||||||
QListWidgetItem* anItem;
|
QListWidgetItem* anItem;
|
||||||
@ -458,7 +507,6 @@ void StdMeshersGUI_SubShapeSelectorWdg::SetGeomShapeEntry( const QString& theEnt
|
|||||||
else
|
else
|
||||||
myMainShape = GetTopoDSByEntry( myMainEntry.c_str() );
|
myMainShape = GetTopoDSByEntry( myMainEntry.c_str() );
|
||||||
updateState();
|
updateState();
|
||||||
myIsNotCorrected = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -468,19 +516,21 @@ void StdMeshersGUI_SubShapeSelectorWdg::SetGeomShapeEntry( const QString& theEnt
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void StdMeshersGUI_SubShapeSelectorWdg::updateState()
|
void StdMeshersGUI_SubShapeSelectorWdg::updateState()
|
||||||
{
|
{
|
||||||
bool state = false;
|
bool state = ( !myGeomShape.IsNull() );
|
||||||
if ( !myGeomShape.IsNull() )
|
|
||||||
state = true;
|
myInfoLabel ->setVisible( false );
|
||||||
myInfoLabel->setVisible( false );
|
|
||||||
myPrevButton->setVisible( false );
|
myPrevButton->setVisible( false );
|
||||||
myNextButton->setVisible( false );
|
myNextButton->setVisible( false );
|
||||||
|
|
||||||
myListWidget->setEnabled( state );
|
if ( myListWidget )
|
||||||
myAddButton->setEnabled( mySelectedIDs.size() > 0 );
|
{
|
||||||
|
myListWidget->setEnabled( state );
|
||||||
if (state) {
|
myAddButton->setEnabled( mySelectedIDs.size() > 0 );
|
||||||
|
}
|
||||||
|
if ( state ) {
|
||||||
SUIT_OverrideCursor wc;
|
SUIT_OverrideCursor wc;
|
||||||
myPreviewActor = new SMESH_PreviewActorsCollection();
|
if ( !myPreviewActor )
|
||||||
|
myPreviewActor = new SMESH_PreviewActorsCollection();
|
||||||
myPreviewActor->SetSelector( mySelector );
|
myPreviewActor->SetSelector( mySelector );
|
||||||
myPreviewActor->Init( myGeomShape, myMainShape, mySubShType, myEntry.c_str() );
|
myPreviewActor->Init( myGeomShape, myMainShape, mySubShType, myEntry.c_str() );
|
||||||
myPreviewActor->SetShown( false );
|
myPreviewActor->SetShown( false );
|
||||||
@ -555,9 +605,12 @@ bool StdMeshersGUI_SubShapeSelectorWdg::SetListOfIDs( SMESH::long_array_var theI
|
|||||||
for ( int i = 0; i < size; i++ )
|
for ( int i = 0; i < size; i++ )
|
||||||
mySelectedIDs.append( theIds[ i ] );
|
mySelectedIDs.append( theIds[ i ] );
|
||||||
|
|
||||||
myListWidget->blockSignals( true );
|
if ( myListWidget )
|
||||||
myListWidget->clear();
|
{
|
||||||
myListWidget->blockSignals( false );
|
myListWidget->blockSignals( true );
|
||||||
|
myListWidget->clear();
|
||||||
|
myListWidget->blockSignals( false );
|
||||||
|
}
|
||||||
|
|
||||||
bool isOk = true;
|
bool isOk = true;
|
||||||
if ( myPreviewActor )
|
if ( myPreviewActor )
|
||||||
@ -572,7 +625,6 @@ bool StdMeshersGUI_SubShapeSelectorWdg::SetListOfIDs( SMESH::long_array_var theI
|
|||||||
for ( int i = 0; i < size && isOk; i++ )
|
for ( int i = 0; i < size && isOk; i++ )
|
||||||
isOk = ( theIds[ i ] > 0 && theIds[ i ] <= aMainMap.Extent() );
|
isOk = ( theIds[ i ] > 0 && theIds[ i ] <= aMainMap.Extent() );
|
||||||
}
|
}
|
||||||
// mySelectedIDs = GetCorrectedListOfIDs( false, &isOk );
|
|
||||||
onAdd();
|
onAdd();
|
||||||
return isOk;
|
return isOk;
|
||||||
}
|
}
|
||||||
|
@ -50,26 +50,22 @@ class STDMESHERSGUI_EXPORT StdMeshersGUI_SubShapeSelectorWdg : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
StdMeshersGUI_SubShapeSelectorWdg( QWidget* parent = 0,
|
StdMeshersGUI_SubShapeSelectorWdg( QWidget* parent = 0,
|
||||||
TopAbs_ShapeEnum aSubShType = TopAbs_EDGE );
|
TopAbs_ShapeEnum subShType = TopAbs_EDGE,
|
||||||
|
const bool toShowList = true);
|
||||||
~StdMeshersGUI_SubShapeSelectorWdg();
|
~StdMeshersGUI_SubShapeSelectorWdg();
|
||||||
|
|
||||||
SMESH::long_array_var GetListOfIDs();
|
SMESH::long_array_var GetListOfIDs();
|
||||||
bool SetListOfIDs( SMESH::long_array_var );
|
bool SetListOfIDs( SMESH::long_array_var );
|
||||||
|
const QList<int>& GetSelectedIDs() const { return mySelectedIDs; }
|
||||||
|
|
||||||
void SetGeomShapeEntry( const QString& theEntry,
|
void SetGeomShapeEntry( const QString& theEntry,
|
||||||
const QString& theMainShapeEntry);
|
const QString& theMainShapeEntry);
|
||||||
//QString GetGeomShapeEntry() { return myEntry; }
|
|
||||||
|
|
||||||
// void SetMainShapeEntry( const QString& theEntry );
|
|
||||||
const char* GetMainShapeEntry();
|
const char* GetMainShapeEntry();
|
||||||
|
|
||||||
TopoDS_Shape GetGeomShape() { return myGeomShape; }
|
TopoDS_Shape GetGeomShape() { return myGeomShape; }
|
||||||
TopoDS_Shape GetMainShape() { return myMainShape; }
|
TopoDS_Shape GetMainShape() { return myMainShape; }
|
||||||
|
|
||||||
// QList<int> GetCorrectedListOfIDs( bool fromSubshapeToMainshape,
|
|
||||||
// bool* isOK=0);
|
|
||||||
|
|
||||||
static GEOM::GEOM_Object_var GetGeomObjectByEntry( const QString& );
|
static GEOM::GEOM_Object_var GetGeomObjectByEntry( const QString& );
|
||||||
static TopoDS_Shape GetTopoDSByEntry( const QString& );
|
static TopoDS_Shape GetTopoDSByEntry( const QString& );
|
||||||
|
|
||||||
@ -84,9 +80,11 @@ public:
|
|||||||
vtkRenderer* GetRenderer() { return myRenderer; }
|
vtkRenderer* GetRenderer() { return myRenderer; }
|
||||||
SMESH_PreviewActorsCollection* GetActorCollection() { return myPreviewActor; }
|
SMESH_PreviewActorsCollection* GetActorCollection() { return myPreviewActor; }
|
||||||
void ClearSelected();
|
void ClearSelected();
|
||||||
|
void ActivateSelection( bool );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void selectionChanged();
|
void selectionChanged(); // in the list
|
||||||
|
void shapeSelected(); // globally
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateState();
|
void updateState();
|
||||||
@ -126,7 +124,6 @@ private:
|
|||||||
|
|
||||||
QString myParamValue;
|
QString myParamValue;
|
||||||
bool myIsShown;
|
bool myIsShown;
|
||||||
bool myIsNotCorrected;
|
|
||||||
|
|
||||||
// for manage possible size of myListOfIDs
|
// for manage possible size of myListOfIDs
|
||||||
int myMaxSize;
|
int myMaxSize;
|
||||||
|
Loading…
Reference in New Issue
Block a user