X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMGUI%2FGeometryGUI_Swig.cxx;h=22159ad46a71486fdb881ee153f4fd139c7059fb;hb=771241721ff3c790b2a2e12fd6848eceac6f0a90;hp=4f563eb131f178fdddefd48b55304b0b339b4205;hpb=4a2420a9a577f420cb824106f988f34dc399f500;p=modules%2Fgeom.git diff --git a/src/GEOMGUI/GeometryGUI_Swig.cxx b/src/GEOMGUI/GeometryGUI_Swig.cxx index 4f563eb13..22159ad46 100644 --- a/src/GEOMGUI/GeometryGUI_Swig.cxx +++ b/src/GEOMGUI/GeometryGUI_Swig.cxx @@ -66,6 +66,7 @@ #include #include #include +#include // IDL Headers #include @@ -269,6 +270,25 @@ void GEOM_Swig::createAndDisplayFitAllGO (const char* Entry) ProcessVoidEvent(new TEventFitAll()); } +void GEOM_Swig::UpdateViewer() +{ + class TEventUpdateViewer: public SALOME_Event + { + public: + TEventUpdateViewer() {} + virtual void Execute() { + SUIT_Application* app = SUIT_Session::session()->activeApplication(); + if (!app) return; + SalomeApp_Study* ActiveStudy = dynamic_cast(app->activeStudy()); + if (!ActiveStudy) return; + + GEOM_Displayer(ActiveStudy).UpdateViewer(); + } + }; + + ProcessVoidEvent(new TEventUpdateViewer()); +} + int GEOM_Swig::getIndexTopology(const char* SubIOR, const char* IOR) { GEOM::GEOM_Gen_var aGeomGen = GeometryGUI::GetGeomGen(); @@ -420,7 +440,7 @@ void GEOM_Swig::setColor(const char* theEntry, int red, int green, int blue, boo ite.Value()->SetColor(CSFColor); if (ite.Value()->IsKind(STANDARD_TYPE(GEOM_AISShape))) Handle(GEOM_AISShape)::DownCast(ite.Value())->SetShadingColor(CSFColor); - ite.Value()->Redisplay(Standard_True); + ic->Redisplay(ite.Value(), true, true); if (myUpdateViewer) occViewer->update(); break; @@ -594,13 +614,13 @@ void GEOM_Swig::setDeflection(const char* theEntry, float theDeflect) if ((!aObj.IsNull()) && aObj->hasEntry() && aObj->isSame(anIO)) { Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(it.Value()); if (!aShape.IsNull()) { - Handle(AIS_Drawer) aDrawer = aShape->Attributes(); - if (aDrawer.IsNull()) - aDrawer = new AIS_Drawer(); - aDrawer->SetDeviationCoefficient(myParam); - aShape->SetAttributes(aDrawer); - aContext->Redisplay(aShape, true, true); - aContext->UpdateCurrentViewer(); + TopoDS_Shape aSh = aShape->Shape(); + if (!aSh.IsNull()) + BRepTools::Clean(aSh); + + aShape->SetOwnDeviationCoefficient( myParam ); + aShape->SetOwnHLRDeviationAngle( 1.57 ); + aContext->Redisplay(aShape); return; } }