IPAL22456: TC6.3.0: main shape dissapears after Explode with Select Sub Shapes option.

This commit is contained in:
jfa 2011-06-29 11:04:49 +00:00
parent 21399917a5
commit 56c5e93e6b
4 changed files with 58 additions and 7 deletions

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : EntityGUI_SubShapeDlg.cxx
@ -64,7 +63,9 @@
//=================================================================================
EntityGUI_SubShapeDlg::EntityGUI_SubShapeDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
bool modal, Qt::WindowFlags fl)
: GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl)
: GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl),
myWithShape(true),
myIsHiddenMain(false)
{
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_SUBSHAPE")));
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
@ -111,6 +112,11 @@ EntityGUI_SubShapeDlg::EntityGUI_SubShapeDlg(GeometryGUI* theGeometryGUI, QWidge
//=================================================================================
EntityGUI_SubShapeDlg::~EntityGUI_SubShapeDlg()
{
if (myIsHiddenMain) {
GEOM_Displayer* aDisplayer = getDisplayer();
aDisplayer->Display(myObject);
myIsHiddenMain = false;
}
}
//=================================================================================
@ -289,6 +295,12 @@ void EntityGUI_SubShapeDlg::SelectionIntoArgument()
return;
}
if (myIsHiddenMain) {
GEOM_Displayer* aDisplayer = getDisplayer();
aDisplayer->Display(myObject);
myIsHiddenMain = false;
}
TopoDS_Shape S = GEOMBase::GetTopoFromSelection(aSelList);
if (S.IsNull() || S.ShapeType() == TopAbs_VERTEX) {
myObject = GEOM::GEOM_Object::_nil();
@ -393,6 +405,11 @@ void EntityGUI_SubShapeDlg::LineEditReturnPressed()
//=================================================================================
void EntityGUI_SubShapeDlg::ResetStateOfDialog()
{
if (myIsHiddenMain) {
GEOM_Displayer* aDisplayer = getDisplayer();
aDisplayer->Display(myObject);
myIsHiddenMain = false;
}
myObject = GEOM::GEOM_Object::_nil();
myShape.Nullify();
myEditCurrentArgument->setText("");
@ -496,7 +513,7 @@ unsigned int EntityGUI_SubShapeDlg::NumberOfSubShapes(const TopoDS_Shape& S,
void EntityGUI_SubShapeDlg::updateButtonState()
{
if (SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType() != OCCViewer_Viewer::Type() ||
myObject->_is_nil() || shapeType() == TopAbs_SHAPE || shapeType() == TopAbs_COMPOUND) {
myObject->_is_nil() || shapeType() == TopAbs_SHAPE || shapeType() == TopAbs_COMPOUND) {
GroupPoints->CheckButton1->setChecked(false);
GroupPoints->CheckButton1->setEnabled(false);
}
@ -641,7 +658,15 @@ void EntityGUI_SubShapeDlg::activateSelection()
if (!myObject->_is_nil() && !isAllSubShapes())
{
GEOM_Displayer* aDisplayer = getDisplayer();
aDisplayer->Erase(myObject, false, false);
SALOME_View* view = GEOM_Displayer::GetActiveView();
if (view) {
CORBA::String_var aMainEntry = myObject->GetStudyEntry();
Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject (aMainEntry.in(), "GEOM", "TEMP_IO");
if (view->isVisible(io)) {
aDisplayer->Erase(myObject, false, false);
myIsHiddenMain = true;
}
}
int prevDisplayMode = aDisplayer->SetDisplayMode(0);

View File

@ -88,6 +88,8 @@ private:
bool myWithShape;
bool myIsHiddenMain;
DlgRef_1Sel1List1Check3Btn* GroupPoints;
};

View File

@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// GEOM GEOMGUI : GUI for Geometry component
// File : GroupGUI_GroupDlg.cxx
@ -72,7 +71,8 @@ GroupGUI_GroupDlg::GroupGUI_GroupDlg (Mode mode, GeometryGUI* theGeometryGUI, QW
: GEOMBase_Skeleton(theGeometryGUI, parent, false),
myMode(mode),
myBusy(false),
myIsShapeType(false)
myIsShapeType(false),
myIsHiddenMain(false)
{
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
@ -184,6 +184,11 @@ GroupGUI_GroupDlg::GroupGUI_GroupDlg (Mode mode, GeometryGUI* theGeometryGUI, QW
GroupGUI_GroupDlg::~GroupGUI_GroupDlg()
{
if (myIsHiddenMain) {
GEOM_Displayer* aDisplayer = getDisplayer();
aDisplayer->Display(myMainObj);
myIsHiddenMain = false;
}
}
//=================================================================================
@ -461,6 +466,11 @@ void GroupGUI_GroupDlg::SelectionIntoArgument()
GEOMBase::ConvertIOinGEOMObject(aSelList.First());
if (GEOMBase::IsShape(anObj)) {
if (myIsHiddenMain) {
GEOM_Displayer* aDisplayer = getDisplayer();
aDisplayer->Display(myMainObj);
myIsHiddenMain = false;
}
myMainObj = anObj;
myEditCurrentArgument->setText(GEOMBase::GetName(anObj));
// activate subshapes selection by default
@ -470,6 +480,11 @@ void GroupGUI_GroupDlg::SelectionIntoArgument()
}
}
else {
if (myIsHiddenMain) {
GEOM_Displayer* aDisplayer = getDisplayer();
aDisplayer->Display(myMainObj);
myIsHiddenMain = false;
}
myMainObj = GEOM::GEOM_Object::_nil();
}
}
@ -788,7 +803,15 @@ void GroupGUI_GroupDlg::activateSelection()
myIsShapeType) // check if shape type is already choosen by user
{
GEOM_Displayer* aDisplayer = getDisplayer();
aDisplayer->Erase(myMainObj, false, false);
SALOME_View* view = GEOM_Displayer::GetActiveView();
if (view) {
CORBA::String_var aMainEntry = myMainObj->GetStudyEntry();
Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject (aMainEntry.in(), "GEOM", "TEMP_IO");
if (view->isVisible(io)) {
aDisplayer->Erase(myMainObj, false, false);
myIsHiddenMain = true;
}
}
int prevDisplayMode = aDisplayer->SetDisplayMode(0);

View File

@ -96,6 +96,7 @@ private:
Mode myMode;
bool myBusy;
bool myIsShapeType;
bool myIsHiddenMain;
GEOM::GEOM_Object_var myMainObj;
GEOM::GEOM_Object_var myGroup;
GEOM::GEOM_Object_var myInPlaceObj;