#include "VisuGUI_Prs3dTools.h"
-#include "VISU_ScalarMap_i.hh"
+#include "VISU_GaussPoints_i.hh"
#include "VisuGUI_ScalarBarDlg.h"
#include "VISU_Gen_i.hh"
#include "VISU_Result_i.hh"
#include "VISU_CutLines_i.hh"
-#include "VisuGUI_Tools.h"
#include "VISU_Actor.h"
+#include "VisuGUI_Tools.h"
+#include "VisuGUI_ActionsDef.h"
#ifdef _DEBUG_
static int MYDEBUG = 1;
#define GAUSS_NEW_VIEWER 5100
#define GAUSS_CREATE_PRS 5200
+#define GAUSS_EDIT_PRS 5300
+#define GAUSS_ERASE_PRS 5400
+#define GAUSS_DISPLAY_PRS 5500
+#define GAUSS_DISPLAY_ONLY_PRS 5600
void
CreateCurves( SalomeApp_Module* theModule,
createAction( GAUSS_NEW_VIEWER, tr("MEN_GAUSS_NEW_VIEWER"), QIconSet(),
tr("MEN_GAUSS_NEW_VIEWER"), "", 0, this, false,
this, SLOT(onCreateViewManager()));
- createAction( GAUSS_CREATE_PRS, tr("MEN_GAUSS_CREATE_PRS"), QIconSet(),
- tr("MEN_GAUSS_CREATE_PRS"), "", 0, this, false,
- this, SLOT(OnCreateGaussPoints()));
-
int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, 100 );
int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 );
int gaussMenu = createMenu( action( GAUSS_NEW_VIEWER ), newWinMenu, -1 );
+ // Add actions to menus
int aMenuId = createMenu( tr( "MEN_GAUSS" ), -1, -1, 30 );
- createMenu( GAUSS_CREATE_PRS, aMenuId, 10 );
+ //createMenu( GAUSS_CREATE_PRS, aMenuId, 10 );
+
+ // Prepare popup menus
+ QString aSel_One_ObjBr("client='ObjectBrowser' and selcount=1");
+ QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
+ "'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TGAUSSPOINTS'");
+ QtxPopupMgr* mgr = popupMgr();
+ QString aRule;
+
+ createAction( GAUSS_CREATE_PRS, tr("MEN_GAUSS_CREATE_PRS"), QIconSet(),
+ tr("MEN_GAUSS_CREATE_PRS"), "", 0, this, false,
+ this, SLOT(OnCreateGaussPoints()));
+ mgr->insert( action( GAUSS_CREATE_PRS ), -1, 0, -1 );
+ mgr->setRule( action( GAUSS_CREATE_PRS ),
+ aSel_One_ObjBr + " and type='VISU::TTIMESTAMP'", true );
+
+ createAction( GAUSS_EDIT_PRS, VisuGUI::tr("MEN_EDIT_PRS"), QIconSet(),
+ VisuGUI::tr("MEN_EDIT_PRS"), "", 0, this, false,
+ this, SLOT(OnEditGaussPoints()));
+ mgr->insert( action( GAUSS_EDIT_PRS ), -1, 0, -1 );
+ mgr->setRule( action( GAUSS_EDIT_PRS ),
+ "selcount=1 and type='VISU::TGAUSSPOINTS'", true );
+
+ aRule = "(selcount>0 and type='VISU::TGAUSSPOINTS')";
+
+ createAction( GAUSS_ERASE_PRS, VisuGUI::tr("MEN_ERASE"), QIconSet(),
+ VisuGUI::tr("MEN_ERASE"), "", 0, this, false,
+ this, SLOT(OnErasePrs()));
+ mgr->insert( action( GAUSS_ERASE_PRS ), -1, -1, -1 ); // erase
+ mgr->setRule( action( GAUSS_ERASE_PRS ),
+ aRule + " and (isVisible=true)", true );
+
+ createAction( GAUSS_DISPLAY_PRS, VisuGUI::tr("MEN_DISPLAY"), QIconSet(),
+ VisuGUI::tr("MEN_DISPLAY"), "", 0, this, false,
+ this, SLOT(OnDisplayPrs()));
+ mgr->insert( action( GAUSS_DISPLAY_PRS ), -1, -1, -1 ); // display
+ mgr->setRule( action( GAUSS_DISPLAY_PRS ),
+ aRule + " and ((isVisible=false and isActiveView=true) or (isActiveView=false))", true );
+
+ createAction( GAUSS_DISPLAY_ONLY_PRS, VisuGUI::tr("MEN_DISPLAY_ONLY"), QIconSet(),
+ VisuGUI::tr("MEN_DISPLAY_ONLY"), "", 0, this, false,
+ this, SLOT(OnDisplayOnlyPrs()));
+ mgr->insert( action( GAUSS_DISPLAY_ONLY_PRS ), -1, -1, -1 ); // display only
+ mgr->setRule( action( GAUSS_DISPLAY_ONLY_PRS ),
+ aRule, true );
}
//---------------------------------------------------------------
VisuGUI_Module
::OnCreateGaussPoints()
{
- CreatePrs3d<VISU::ScalarMap_i,VVTK_Viewer,VisuGUI_ScalarBarDlg,1>(this);
+ CreatePrs3d<VISU::GaussPoints_i,VVTK_Viewer,VisuGUI_ScalarBarDlg,1>(this);
}
+void
+VisuGUI_Module::
+OnEditGaussPoints()
+{
+ Handle(SALOME_InteractiveObject) anIO;
+ if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
+ EditPrs3d<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg>(this, aPrs3d);
+ if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+ aViewWindow->highlight(anIO, 1);
+ }
+ }
+}