mySelectionMgr->installFilter(myMeshFilter);
/* init data from current selection */
+ restoreShowEntityMode();
myMesh = SMESH::SMESH_Mesh::_duplicate(theMesh);
+ setShowEntityMode();
myGroup = SMESH::SMESH_Group::_nil();
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
//=================================================================================
void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup)
{
+ restoreShowEntityMode();
myMesh = theGroup->GetMesh();
+ setShowEntityMode();
myName->setText(theGroup->GetName());
myName->home(false);
myElements->clear();
if (myCurrentLineEdit == 0)
setSelectionMode(id);
+ myTypeId = id;
+ setShowEntityMode();
}
- myTypeId = id;
}
//=================================================================================
if (aNbSel != 1 ) {
myGroup = SMESH::SMESH_Group::_nil();
- myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
+ myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
+ restoreShowEntityMode();
myMesh = SMESH::SMESH_Mesh::_nil();
updateGeomPopup();
updateButtons();
Handle(SALOME_InteractiveObject) IO = aList.First();
if (myCreate) {
+ restoreShowEntityMode();
myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
+ setShowEntityMode();
updateGeomPopup();
if (myMesh->_is_nil())
{
SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
SMESH::SetPointRepresentation(false);
SMESH::SetPickable();
+ restoreShowEntityMode();
}
mySelectionMgr->clearSelected();
setGroupQColor( aQColor );
}
+
+//=======================================================================
+//function : setShowEntityMode
+//purpose : make shown only entity corresponding to my type
+//=======================================================================
+
+void SMESHGUI_GroupDlg::setShowEntityMode()
+{
+ if ( !myMesh->_is_nil() ) {
+ if ( SMESH_Actor* actor = SMESH::FindActorByObject(myMesh) ) {
+ if (!myStoredShownEntity)
+ myStoredShownEntity = actor->GetEntityMode();
+ switch ( myTypeId ) {
+ case 0: restoreShowEntityMode(); break;
+ case 1: actor->SetEntityMode( SMESH_Actor::eEdges ); break;
+ case 2: actor->SetEntityMode( SMESH_Actor::eFaces ); break;
+ case 3: actor->SetEntityMode( SMESH_Actor::eVolumes ); break;
+ }
+ }
+ }
+}
+
+//=======================================================================
+//function : restoreShowEntityMode
+//purpose : restore ShowEntity mode of myActor
+//=======================================================================
+
+void SMESHGUI_GroupDlg::restoreShowEntityMode()
+{
+ if ( myStoredShownEntity && !myMesh->_is_nil() ) {
+ if ( SMESH_Actor* actor = SMESH::FindActorByObject(myMesh) ) {
+ actor->SetEntityMode(myStoredShownEntity);
+ }
+ }
+ myStoredShownEntity = 0;
+}
void setSelectionMode(int theMode);
void updateButtons();
void updateGeomPopup();
+ void setShowEntityMode();
+ void restoreShowEntityMode();
void setGroupColor( const SALOMEDS::Color& );
SALOMEDS::Color getGroupColor() const;
SMESH_Actor* myActor; /* Current mesh actor */
int myGrpTypeId; /* Current group type id : standalone or group on geometry */
int myTypeId; /* Current type id = radio button id */
+ int myStoredShownEntity; /* Store ShowEntity mode of myMesh */
QLineEdit* myCurrentLineEdit; /* Current LineEdit */
SVTK_Selector* mySelector;