anIds->InsertId(i,theIds[i]);
myGrid->InsertNextCell(theType,anIds);
+ if(theIds.size()!=0){
+ myGrid->InsertNextCell(theType,anIds);
+ myGrid->Modified();
+ }
+
anIds->Delete();
- myGrid->Modified();
-
SetVisibility(true);
+
}
void ResetGrid(bool theReset=true){
//=================================================================================
void SMESHGUI_CreatePolyhedralVolumeDlg::ConstructorsClicked(int constructorId)
{
- disconnect(mySelectionMgr, 0, this, 0);
+ //disconnect(mySelectionMgr, 0, this, 0);
SALOME_ListIO aList;
mySelectionMgr->setSelectedObjects( aList );
{
if ( myActor ){
myActor->SetPointRepresentation(true);
+ myActor->SetEntityMode(SMESH_Actor::eVolumes);
+ myActor->SetRepresentation(SMESH_Actor::eSurface);
}
else
SMESH::SetPointRepresentation(true);
}
case 1 :
{
- SMESH::SetPointRepresentation(false);
+ if( myActor ){
+ myActor->SetPointRepresentation(false);
+ myActor->SetEntityMode(SMESH_Actor::eFaces);
+ myActor->SetEntityMode(SMESH_Actor::eVolumes);
+ myActor->SetRepresentation(SMESH_Actor::eSurface);
+ } else {
+ SMESH::SetPointRepresentation(false);
+ }
myViewWindow->SetSelectionMode(FaceSelection);
TextLabelIds->setText( tr( "SMESH_ID_FACES" ) );
}
}
- connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ //connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
}
//=================================================================================
for ( int i = 0; i < aListId.count(); i++ ) {
const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() );
if ( n ) {
- /*if ( mySelectionMgr->IsIndexSelected( myActor->getIO(), n->GetID() ))
- allOk = false;
- else
- mySelectionMgr->AddOrRemoveIndex (myActor->getIO(), n->GetID(), true);*/
if (selectedIndices.Add(n->GetID()))
newIndices.Add(n->GetID());
myNbOkElements++;
}
}
-
+
if (newIndices.Extent() > 0){
mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, true );
myViewWindow->highlight( myActor->getIO(), true, true );
}
-/* bool aNodesOK = false;
- if (aListId.count() >= 3)
- aNodesOK = true;
-
- allOk = (allOk && aNodesOK);*/
-
if ( myNbOkElements>0 && aListId.count()>=3)
AddButton->setEnabled(true);
- else
- AddButton->setEnabled(false);
-
-// if (allOk && !myOkElements)
- displaySimulation();
- }
+ else
+ AddButton->setEnabled(false);
+
+ displaySimulation();
}
- else if (GetConstructorId() == 1)
+ } else if (GetConstructorId() == 1)
{
myNbOkElements = 0;
buttonOk->setEnabled( false );
for ( int i = 0; i < aListId.count(); i++ ) {
const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() );
if ( e ) {
- /*if ( mySelectionMgr->IsIndexSelected( myActor->getIO(), e->GetID() ))
- myOkElements = false;
- else
- mySelectionMgr->AddOrRemoveIndex (myActor->getIO(), e->GetID(), true);*/
if (selectedIndices.Add(e->GetID()))
newIndices.Add(e->GetID());
myNbOkElements++;
int anbNodes = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aString);
if (anbNodes >= 3)
AddButton->setEnabled(true);
- else
- break;
+ else if (anbNodes < 3){
+ AddButton->setEnabled(false);
+ }
busy = true;
myEditCurrentArgument->setText( aString );
busy = false;
case 1:{
// get selected faces
int aNbFaces = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aString);
- if (aNbFaces<=1)
- return;
+ if (aNbFaces<=1){
+ buttonOk->setEnabled( false );
+ buttonApply->setEnabled( false );
+ } else {
+ buttonOk->setEnabled( true );
+ buttonApply->setEnabled( true );
+ }
busy = true;
myEditCurrentArgument->setText( aString );
busy = false;
// OK
myNbOkElements = 1;
- buttonOk->setEnabled( true );
- buttonApply->setEnabled( true );
break;
}
default: return;
mySimulation->SetPosition(myActor, aType, aVTKIds_faces,false);
}
}
+ if(myFacesByNodes->count() == 0){
+ mySimulation->SetVisibility(false);
+ } else {
+ mySimulation->SetVisibility(true);
+ }
if(Preview->isChecked()){
mySimulation->SetPosition(myActor, aType, aVTKIds);
}
mySimulation->SetPosition(myActor, aType, aVTKIds);
}
}
- }
+ SMESH::UpdateView();
+ }
}
//=================================================================================
myNbOkElements = 1;
myEditCurrentArgument->clear();
AddButton->setEnabled(false);
- RemoveButton->setEnabled(true);
buttonOk->setEnabled( true );
if(myFacesByNodes->count()>1) buttonApply->setEnabled( true );
}
for (int i = myFacesByNodes->count(); i > 0; i--) {
if (myFacesByNodes->isSelected(i-1)) {
myFacesByNodes->removeItem(i-1);
+ myNbOkElements = 1;
}
}
if (myFacesByNodes->count() < 1){
- myNbOkElements = 0;
RemoveButton->setEnabled(false);
buttonOk->setEnabled( false );
buttonApply->setEnabled( false );
}
else if (myFacesByNodes->count() == 1){
- myNbOkElements = 0;
buttonOk->setEnabled( false );
buttonApply->setEnabled( false );
}
- displaySimulation();
busy = false;
- onListSelectionChanged();
+ displaySimulation();
}
//=================================================================================
{
if (busy || !myActor) return;
busy = true;
-
- SALOME_ListIO list;
- mySelectionMgr->setSelectedObjects( list );
+ bool isSelected=false;
+ SALOME_ListIO aList;
+ mySelectionMgr->setSelectedObjects( aList );
TColStd_MapOfInteger aIndexes;
QListBoxItem* anItem;
for (anItem = myFacesByNodes->firstItem(); anItem != 0; anItem = anItem->next()) {
if (anItem->isSelected()) {
+ isSelected = true;
QStringList anIds = QStringList::split(" ", anItem->text());
for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it)
aIndexes.Add((*it).toInt());
}
}
+ if(isSelected) RemoveButton->setEnabled(true);
+ else RemoveButton->setEnabled(false);
mySelector->AddOrRemoveIndex(myActor->getIO(), aIndexes, true );
myViewWindow->highlight( myActor->getIO(), true, true );
- list.Append( myActor->getIO() );
- mySelectionMgr->setSelectedObjects( list );
+ mySelectionMgr->clearFilters();
+ aList.Append( myActor->getIO() );
+ mySelectionMgr->setSelectedObjects( aList );
busy = false;
}