mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-28 18:30:35 +05:00
PAL19321 Problem of Create Group for volumes
SetEntityMode() according to group type
This commit is contained in:
parent
e7f0754d32
commit
1634a3e4d9
@ -479,7 +479,9 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_Mesh_ptr theMesh)
|
|||||||
mySelectionMgr->installFilter(myMeshFilter);
|
mySelectionMgr->installFilter(myMeshFilter);
|
||||||
|
|
||||||
/* init data from current selection */
|
/* init data from current selection */
|
||||||
|
restoreShowEntityMode();
|
||||||
myMesh = SMESH::SMESH_Mesh::_duplicate(theMesh);
|
myMesh = SMESH::SMESH_Mesh::_duplicate(theMesh);
|
||||||
|
setShowEntityMode();
|
||||||
myGroup = SMESH::SMESH_Group::_nil();
|
myGroup = SMESH::SMESH_Group::_nil();
|
||||||
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
|
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
|
||||||
|
|
||||||
@ -509,7 +511,9 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_Mesh_ptr theMesh)
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup)
|
void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup)
|
||||||
{
|
{
|
||||||
|
restoreShowEntityMode();
|
||||||
myMesh = theGroup->GetMesh();
|
myMesh = theGroup->GetMesh();
|
||||||
|
setShowEntityMode();
|
||||||
|
|
||||||
myName->setText(theGroup->GetName());
|
myName->setText(theGroup->GetName());
|
||||||
myName->home(false);
|
myName->home(false);
|
||||||
@ -629,8 +633,9 @@ void SMESHGUI_GroupDlg::onTypeChanged (int id)
|
|||||||
myElements->clear();
|
myElements->clear();
|
||||||
if (myCurrentLineEdit == 0)
|
if (myCurrentLineEdit == 0)
|
||||||
setSelectionMode(id);
|
setSelectionMode(id);
|
||||||
}
|
|
||||||
myTypeId = id;
|
myTypeId = id;
|
||||||
|
setShowEntityMode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -995,6 +1000,7 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
|
|||||||
if (aNbSel != 1 ) {
|
if (aNbSel != 1 ) {
|
||||||
myGroup = SMESH::SMESH_Group::_nil();
|
myGroup = SMESH::SMESH_Group::_nil();
|
||||||
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
|
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
|
||||||
|
restoreShowEntityMode();
|
||||||
myMesh = SMESH::SMESH_Mesh::_nil();
|
myMesh = SMESH::SMESH_Mesh::_nil();
|
||||||
updateGeomPopup();
|
updateGeomPopup();
|
||||||
updateButtons();
|
updateButtons();
|
||||||
@ -1004,7 +1010,9 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged()
|
|||||||
Handle(SALOME_InteractiveObject) IO = aList.First();
|
Handle(SALOME_InteractiveObject) IO = aList.First();
|
||||||
|
|
||||||
if (myCreate) {
|
if (myCreate) {
|
||||||
|
restoreShowEntityMode();
|
||||||
myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
|
myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
|
||||||
|
setShowEntityMode();
|
||||||
updateGeomPopup();
|
updateGeomPopup();
|
||||||
if (myMesh->_is_nil())
|
if (myMesh->_is_nil())
|
||||||
{
|
{
|
||||||
@ -1682,6 +1690,7 @@ void SMESHGUI_GroupDlg::onClose()
|
|||||||
SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
|
SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
|
||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
SMESH::SetPickable();
|
SMESH::SetPickable();
|
||||||
|
restoreShowEntityMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
mySelectionMgr->clearSelected();
|
mySelectionMgr->clearSelected();
|
||||||
@ -1986,3 +1995,39 @@ void SMESHGUI_GroupDlg::setDefaultGroupColor()
|
|||||||
|
|
||||||
setGroupQColor( aQColor );
|
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;
|
||||||
|
}
|
||||||
|
@ -132,6 +132,8 @@ private:
|
|||||||
void setSelectionMode(int theMode);
|
void setSelectionMode(int theMode);
|
||||||
void updateButtons();
|
void updateButtons();
|
||||||
void updateGeomPopup();
|
void updateGeomPopup();
|
||||||
|
void setShowEntityMode();
|
||||||
|
void restoreShowEntityMode();
|
||||||
|
|
||||||
void setGroupColor( const SALOMEDS::Color& );
|
void setGroupColor( const SALOMEDS::Color& );
|
||||||
SALOMEDS::Color getGroupColor() const;
|
SALOMEDS::Color getGroupColor() const;
|
||||||
@ -146,6 +148,7 @@ private:
|
|||||||
SMESH_Actor* myActor; /* Current mesh actor */
|
SMESH_Actor* myActor; /* Current mesh actor */
|
||||||
int myGrpTypeId; /* Current group type id : standalone or group on geometry */
|
int myGrpTypeId; /* Current group type id : standalone or group on geometry */
|
||||||
int myTypeId; /* Current type id = radio button id */
|
int myTypeId; /* Current type id = radio button id */
|
||||||
|
int myStoredShownEntity; /* Store ShowEntity mode of myMesh */
|
||||||
QLineEdit* myCurrentLineEdit; /* Current LineEdit */
|
QLineEdit* myCurrentLineEdit; /* Current LineEdit */
|
||||||
SVTK_Selector* mySelector;
|
SVTK_Selector* mySelector;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user