mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-12 01:30:36 +05:00
0022220: EDF 2656 GEOM: Wireframe display mode when selecting sub-shapes with Explode
This commit is contained in:
parent
42c95d7ba4
commit
d88fed29fa
@ -65,6 +65,7 @@
|
|||||||
EntityGUI_SubShapeDlg::EntityGUI_SubShapeDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
|
EntityGUI_SubShapeDlg::EntityGUI_SubShapeDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
|
||||||
bool modal, Qt::WindowFlags fl)
|
bool modal, Qt::WindowFlags fl)
|
||||||
: GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl),
|
: GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl),
|
||||||
|
myDmMode( -1 ),
|
||||||
myWithShape(true),
|
myWithShape(true),
|
||||||
myIsHiddenMain(false)
|
myIsHiddenMain(false)
|
||||||
{
|
{
|
||||||
@ -118,6 +119,7 @@ EntityGUI_SubShapeDlg::~EntityGUI_SubShapeDlg()
|
|||||||
aDisplayer->Display(myObject);
|
aDisplayer->Display(myObject);
|
||||||
myIsHiddenMain = false;
|
myIsHiddenMain = false;
|
||||||
}
|
}
|
||||||
|
myDmMode = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -127,6 +129,7 @@ EntityGUI_SubShapeDlg::~EntityGUI_SubShapeDlg()
|
|||||||
void EntityGUI_SubShapeDlg::Init()
|
void EntityGUI_SubShapeDlg::Init()
|
||||||
{
|
{
|
||||||
/* init variables */
|
/* init variables */
|
||||||
|
myDmMode = -1;
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
myObject = GEOM::GEOM_Object::_nil();
|
||||||
|
|
||||||
@ -679,27 +682,36 @@ void EntityGUI_SubShapeDlg::activateSelection()
|
|||||||
{
|
{
|
||||||
GEOM_Displayer* aDisplayer = getDisplayer();
|
GEOM_Displayer* aDisplayer = getDisplayer();
|
||||||
|
|
||||||
// Mantis issue 0021421: do not hide main shape, if explode on VERTEX
|
//display mode for main shape
|
||||||
if ((TopAbs_ShapeEnum)shapeType() == TopAbs_VERTEX) {
|
if ( myDmMode == -1 ) {
|
||||||
if (myIsHiddenMain)
|
|
||||||
aDisplayer->Display(myObject);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
SALOME_View* view = GEOM_Displayer::GetActiveView();
|
SALOME_View* view = GEOM_Displayer::GetActiveView();
|
||||||
if (view) {
|
if (view) {
|
||||||
CORBA::String_var aMainEntry = myObject->GetStudyEntry();
|
CORBA::String_var aMainEntry = myObject->GetStudyEntry();
|
||||||
Handle(SALOME_InteractiveObject) io =
|
Handle(SALOME_InteractiveObject) io =
|
||||||
new SALOME_InteractiveObject (aMainEntry.in(), "GEOM", "TEMP_IO");
|
new SALOME_InteractiveObject (aMainEntry.in(), "GEOM", "TEMP_IO");
|
||||||
if (view->isVisible(io)) {
|
if ( view->isVisible( io ) ) {
|
||||||
|
Handle(GEOM_AISShape) aSh = GEOMBase::ConvertIOinGEOMAISShape( io, true );
|
||||||
|
if(!aSh.IsNull()) {
|
||||||
|
myDmMode = aSh->isTopLevel() ? aSh->prevDisplayMode() : aSh->DisplayMode();
|
||||||
|
}
|
||||||
|
// Hide main shape, if explode on VERTEX
|
||||||
|
if (shapeType() != TopAbs_VERTEX) {
|
||||||
aDisplayer->Erase(myObject, false, false);
|
aDisplayer->Erase(myObject, false, false);
|
||||||
myIsHiddenMain = true;
|
myIsHiddenMain = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
myDmMode = SUIT_Session::session()->resourceMgr()->integerValue( "Geometry", "display_mode" );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// Mantis issue 0021421: do not hide main shape, if explode on VERTEX
|
||||||
|
if (shapeType() == TopAbs_VERTEX) {
|
||||||
|
if (myIsHiddenMain)
|
||||||
|
aDisplayer->Display(myObject);
|
||||||
|
}
|
||||||
|
aDisplayer->SetDisplayMode(myDmMode);
|
||||||
|
|
||||||
if(!isApply) {
|
if(!isApply) {
|
||||||
int prevDisplayMode = aDisplayer->SetDisplayMode(0);
|
|
||||||
|
|
||||||
SUIT_ViewWindow* aViewWindow = 0;
|
SUIT_ViewWindow* aViewWindow = 0;
|
||||||
SUIT_Study* activeStudy = SUIT_Session::session()->activeApplication()->activeStudy();
|
SUIT_Study* activeStudy = SUIT_Session::session()->activeApplication()->activeStudy();
|
||||||
if (activeStudy)
|
if (activeStudy)
|
||||||
@ -727,15 +739,15 @@ void EntityGUI_SubShapeDlg::activateSelection()
|
|||||||
{
|
{
|
||||||
TopoDS_Shape aSubShape = anExp.Current();
|
TopoDS_Shape aSubShape = anExp.Current();
|
||||||
int index = aSubShapesMap.FindIndex(aSubShape);
|
int index = aSubShapesMap.FindIndex(aSubShape);
|
||||||
QString anEntry = anEntryBase + QString("_%1").arg(index);
|
QString anEntry = QString( "TEMP_" ) + anEntryBase + QString("_%1").arg(index);
|
||||||
|
|
||||||
SALOME_Prs* aPrs = aDisplayer->buildSubshapePresentation(aSubShape, anEntry, aView);
|
SALOME_Prs* aPrs = aDisplayer->buildSubshapePresentation(aSubShape, anEntry, aView);
|
||||||
if (aPrs) {
|
if (aPrs) {
|
||||||
displayPreview(aPrs, true, false); // append, do not update
|
displayPreview(aPrs, true, false); // append, do not update
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
aDisplayer->UnsetDisplayMode();
|
||||||
aDisplayer->UpdateViewer();
|
aDisplayer->UpdateViewer();
|
||||||
aDisplayer->SetDisplayMode(prevDisplayMode);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,6 +85,7 @@ private:
|
|||||||
private:
|
private:
|
||||||
TopoDS_Shape myShape;
|
TopoDS_Shape myShape;
|
||||||
GEOM::GEOM_Object_var myObject;
|
GEOM::GEOM_Object_var myObject;
|
||||||
|
int myDmMode;
|
||||||
|
|
||||||
bool myWithShape;
|
bool myWithShape;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user