From: ouv Date: Thu, 24 Jul 2008 13:52:57 +0000 (+0000) Subject: Feature 0016551: EDF PAL 501: To add a second trihedron always visible and with const... X-Git-Tag: TG_TRIPOLI_qt4_porting~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2606285453c8ff837d483741938e52f53e44bb9d;p=modules%2Fgui.git Feature 0016551: EDF PAL 501: To add a second trihedron always visible and with constant size --- diff --git a/src/OCCViewer/OCCViewer_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index 0beafa3c2..b65c14d0a 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.cxx +++ b/src/OCCViewer/OCCViewer_ViewModel.cxx @@ -55,7 +55,7 @@ Constructor \param DisplayTrihedron - is trihedron displayed */ -OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron ) +OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron, bool DisplayStaticTrihedron ) : SUIT_ViewModel(), myBgColor( Qt::black ) { @@ -111,6 +111,33 @@ myBgColor( Qt::black ) myAISContext->Deactivate(myTrihedron); } + /* create static trihedron (16551: EDF PAL 501) */ + if( DisplayStaticTrihedron ) + { + Handle(Geom_Axis2Placement) anAxis = new Geom_Axis2Placement(gp::XOY()); + Handle(AIS_Trihedron) aStaticTrihedron = new AIS_Trihedron(anAxis); + aStaticTrihedron->SetInfiniteState( Standard_True ); + + Quantity_Color Col(193/255., 205/255., 193/255., Quantity_TOC_RGB); + aStaticTrihedron->SetArrowColor( Col.Name() ); + aStaticTrihedron->SetSize(100); + Handle(AIS_Drawer) drawer = aStaticTrihedron->Attributes(); + if (drawer->HasDatumAspect()) { + Handle(Prs3d_DatumAspect) daspect = drawer->DatumAspect(); + daspect->FirstAxisAspect()->SetColor(Quantity_Color(1.0, 0.0, 0.0, Quantity_TOC_RGB)); + daspect->FirstAxisAspect()->SetWidth(2); + daspect->SecondAxisAspect()->SetColor(Quantity_Color(0.0, 1.0, 0.0, Quantity_TOC_RGB)); + daspect->SecondAxisAspect()->SetWidth(2); + daspect->ThirdAxisAspect()->SetColor(Quantity_Color(0.0, 0.0, 1.0, Quantity_TOC_RGB)); + daspect->ThirdAxisAspect()->SetWidth(2); + } + + myAISContext->Display(aStaticTrihedron); + myAISContext->Deactivate(aStaticTrihedron); + + aStaticTrihedron->SetTransformPersistence(Graphic3d_TMF_TriedronPers, gp_Pnt( -1, -1, 200 )); + } + // selection mySelectionEnabled = true; myMultiSelectionEnabled = true; diff --git a/src/OCCViewer/OCCViewer_ViewModel.h b/src/OCCViewer/OCCViewer_ViewModel.h index 323979697..586cb80a7 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.h +++ b/src/OCCViewer/OCCViewer_ViewModel.h @@ -73,7 +73,7 @@ class OCCVIEWER_EXPORT OCCViewer_Viewer: public SUIT_ViewModel public: static QString Type() { return "OCCViewer"; } - OCCViewer_Viewer( bool DisplayTrihedron = true ); + OCCViewer_Viewer( bool DisplayTrihedron = true, bool DisplayStaticTrihedron = true ); virtual ~OCCViewer_Viewer(); void update();