// 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
//=================================================================================
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")));
//=================================================================================
EntityGUI_SubShapeDlg::~EntityGUI_SubShapeDlg()
{
+ if (myIsHiddenMain) {
+ GEOM_Displayer* aDisplayer = getDisplayer();
+ aDisplayer->Display(myObject);
+ myIsHiddenMain = false;
+ }
}
//=================================================================================
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();
//=================================================================================
void EntityGUI_SubShapeDlg::ResetStateOfDialog()
{
+ if (myIsHiddenMain) {
+ GEOM_Displayer* aDisplayer = getDisplayer();
+ aDisplayer->Display(myObject);
+ myIsHiddenMain = false;
+ }
myObject = GEOM::GEOM_Object::_nil();
myShape.Nullify();
myEditCurrentArgument->setText("");
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);
}
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);
// 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
: GEOMBase_Skeleton(theGeometryGUI, parent, false),
myMode(mode),
myBusy(false),
- myIsShapeType(false)
+ myIsShapeType(false),
+ myIsHiddenMain(false)
{
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
GroupGUI_GroupDlg::~GroupGUI_GroupDlg()
{
+ if (myIsHiddenMain) {
+ GEOM_Displayer* aDisplayer = getDisplayer();
+ aDisplayer->Display(myMainObj);
+ myIsHiddenMain = false;
+ }
}
//=================================================================================
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
}
}
else {
+ if (myIsHiddenMain) {
+ GEOM_Displayer* aDisplayer = getDisplayer();
+ aDisplayer->Display(myMainObj);
+ myIsHiddenMain = false;
+ }
myMainObj = GEOM::GEOM_Object::_nil();
}
}
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);