QApplication::restoreOverrideCursor();
}
+
void
VisuGUI::
-OnEditPrs()
+OnEditScalarMap()
{
- if (CheckLock(GetCStudy(GetAppStudy(this))))
- return;
-
Handle(SALOME_InteractiveObject) anIO;
- CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
- if (CORBA::is_nil(anObject)) return;
- PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
- if (!aServant.in()) return;
+ 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);
+ }
+ }
+}
- VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
- if (!aPrs3d) return;
- switch (aPrs3d->GetType()) {
- case VISU::TMESH:
- break;
- case VISU::TSCALARMAP:
- EditPrs3d<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg>(this, aPrs3d);
- break;
- case VISU::TDEFORMEDSHAPE:
+void
+VisuGUI::
+OnEditDeformedShape()
+{
+ Handle(SALOME_InteractiveObject) anIO;
+ if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
EditPrs3d<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg>(this, aPrs3d);
- break;
- case VISU::TCUTPLANES:
+ if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+ aViewWindow->highlight(anIO, 1);
+ }
+ }
+}
+
+
+void
+VisuGUI::
+OnEditCutPlanes()
+{
+ Handle(SALOME_InteractiveObject) anIO;
+ if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
EditPrs3d<VISU::CutPlanes_i, VisuGUI_CutPlanesDlg>(this, aPrs3d);
- break;
- case VISU::TCUTLINES:
+ if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+ aViewWindow->highlight(anIO, 1);
+ }
+ }
+}
+
+
+void
+VisuGUI::
+OnEditCutLines()
+{
+ Handle(SALOME_InteractiveObject) anIO;
+ if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
EditPrs3d<VISU::CutLines_i, VisuGUI_CutLinesDlg>(this, aPrs3d);
- break;
- case VISU::TISOSURFACE:
+ if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+ aViewWindow->highlight(anIO, 1);
+ }
+ }
+}
+
+
+void
+VisuGUI::
+OnEditIsoSurfaces()
+{
+ Handle(SALOME_InteractiveObject) anIO;
+ if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
EditPrs3d<VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg>(this, aPrs3d);
- break;
- case VISU::TVECTORS:
+ if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+ aViewWindow->highlight(anIO, 1);
+ }
+ }
+}
+
+
+void
+VisuGUI::
+OnEditVectors()
+{
+ Handle(SALOME_InteractiveObject) anIO;
+ if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
EditPrs3d<VISU::Vectors_i, VisuGUI_VectorsDlg>(this, aPrs3d);
- break;
- case VISU::TSTREAMLINES:
+ if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+ aViewWindow->highlight(anIO, 1);
+ }
+ }
+}
+
+
+void
+VisuGUI::
+OnEditStreamLines()
+{
+ Handle(SALOME_InteractiveObject) anIO;
+ if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
EditPrs3d<VISU::StreamLines_i, VisuGUI_StreamLinesDlg>(this, aPrs3d);
- break;
- case VISU::TPLOT3D:
- EditPrs3d<VISU::Plot3D_i, VisuGUI_Plot3DDlg>(this, aPrs3d);
- break;
- default:
- return;
+ if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+ aViewWindow->highlight(anIO, 1);
+ }
}
+}
- if (SVTK_ViewWindow* vw = GetViewWindow())
- vw->highlight(anIO, 1);
+
+void
+VisuGUI::
+OnEditPlot3D()
+{
+ Handle(SALOME_InteractiveObject) anIO;
+ if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
+ EditPrs3d<VISU::Plot3D_i, VisuGUI_Plot3DDlg>(this, aPrs3d);
+ if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+ aViewWindow->highlight(anIO, 1);
+ }
+ }
}
+
void
VisuGUI::
OnEraseAll()
tr("MEN_LINE_WIDTH"), "", 0, aParent, false,
this, SLOT(OnChangeLines()));
- createAction( VISU_EDIT_PRS, tr("MEN_EDIT_PRS"), QIconSet(),
+
+ createAction( VISU_EDIT_SCALARMAP, tr("MEN_EDIT_PRS"), QIconSet(),
+ tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+ this, SLOT(OnEditScalarMap()));
+
+ createAction( VISU_EDIT_DEFORMEDSHAPE, tr("MEN_EDIT_PRS"), QIconSet(),
tr("MEN_EDIT_PRS"), "", 0, aParent, false,
- this, SLOT(OnEditPrs()));
+ this, SLOT(OnEditDeformedShape()));
+
+ createAction( VISU_EDIT_CUTPLANES, tr("MEN_EDIT_PRS"), QIconSet(),
+ tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+ this, SLOT(OnEditCutPlanes()));
+
+ createAction( VISU_EDIT_CUTLINES, tr("MEN_EDIT_PRS"), QIconSet(),
+ tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+ this, SLOT(OnEditCutLines()));
+
+ createAction( VISU_EDIT_ISOSURFACE, tr("MEN_EDIT_PRS"), QIconSet(),
+ tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+ this, SLOT(OnEditIsoSurfaces()));
+
+ createAction( VISU_EDIT_VECTORS, tr("MEN_EDIT_PRS"), QIconSet(),
+ tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+ this, SLOT(OnEditVectors()));
+
+ createAction( VISU_EDIT_STREAMLINES, tr("MEN_EDIT_PRS"), QIconSet(),
+ tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+ this, SLOT(OnEditStreamLines()));
+
+ createAction( VISU_EDIT_PLOT3D, tr("MEN_EDIT_PRS"), QIconSet(),
+ tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+ this, SLOT(OnEditPlot3D()));
+
createAction( VISU_CREATE_TABLE, tr("MEN_CREATE_TABLE"), QIconSet(),
tr("MEN_CREATE_TABLE"), "", 0, aParent, false,
mgr->insert( action( VISU_CREATE_TABLE ), -1, -1, -1 ); // create table
// edit
- mgr->insert( action( VISU_EDIT_PRS ), -1, -1, -1 );
+ mgr->insert( action( VISU_EDIT_SCALARMAP ), -1, -1, -1 );
+ mgr->insert( action( VISU_EDIT_DEFORMEDSHAPE ), -1, -1, -1 );
+ mgr->insert( action( VISU_EDIT_CUTPLANES ), -1, -1, -1 );
+ mgr->insert( action( VISU_EDIT_CUTLINES ), -1, -1, -1 );
+ mgr->insert( action( VISU_EDIT_ISOSURFACE ), -1, -1, -1 );
+ mgr->insert( action( VISU_EDIT_VECTORS ), -1, -1, -1 );
+ mgr->insert( action( VISU_EDIT_STREAMLINES ), -1, -1, -1 );
+ mgr->insert( action( VISU_EDIT_PLOT3D ), -1, -1, -1 );
mgr->insert( action( VISU_EDIT_CONTAINER ), -1, -1, -1 );
// rename
mgr->setRule( action( VISU_EDIT_CONTAINER ), aRule, true );
mgr->setRule( action( VISU_CLEAR_CONTAINER ), aRule, true );
- aRule = "selcount=1 and $type in {" + aPrsAll + "}";
- mgr->setRule( action( VISU_EDIT_PRS ), aRule, true );
+ mgr->setRule( action( VISU_EDIT_SCALARMAP ),
+ "selcount=1 and type='VISU::TSCALARMAP'", true );
+ mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPE ),
+ "selcount=1 and type='VISU::TDEFORMEDSHAPE'", true );
+ mgr->setRule( action( VISU_EDIT_CUTPLANES ),
+ "selcount=1 and type='VISU::TCUTPLANES'", true );
+ mgr->setRule( action( VISU_EDIT_CUTLINES ),
+ "selcount=1 and type='VISU::TCUTLINES'", true );
+ mgr->setRule( action( VISU_EDIT_ISOSURFACE ),
+ "selcount=1 and type='VISU::TISOSURFACE'", true );
+ mgr->setRule( action( VISU_EDIT_VECTORS ),
+ "selcount=1 and type='VISU::TVECTORS'", true );
+ mgr->setRule( action( VISU_EDIT_STREAMLINES ),
+ "selcount=1 and type='VISU::TSTREAMLINES'", true );
+ mgr->setRule( action( VISU_EDIT_PLOT3D ),
+ "selcount=1 and type='VISU::TPLOT3D'", true );
aRule = "selcount=1 and type='VISU::TCUTLINES' and nbNamedChildren=0";
mgr->setRule( action( VISU_CREATE_TABLE ), aRule, true );
QString VisuGUI_Selection::type( const int ind ) const
{
- QString aTypeStr;
+ QString aResStr;
VISU::Storable::TRestoringMap aMap;
- CORBA::Object_var anObject = GetSelectedObj( study(), entry( ind ), &aMap );
-
- VISU::Base_var aVisuObj = VISU::Base::_narrow( anObject );
-
- if ( !CORBA::is_nil( aVisuObj ) ){
- VISU::VISUType aType = aVisuObj->GetType();
- switch (aType) {
- ENUM2STRING( aTypeStr, VISU::TVISUGEN )
- ENUM2STRING( aTypeStr, VISU::TRESULT )
- ENUM2STRING( aTypeStr, VISU::TTABLE )
- ENUM2STRING( aTypeStr, VISU::TCURVE )
- ENUM2STRING( aTypeStr, VISU::TCONTAINER )
- ENUM2STRING( aTypeStr, VISU::TMESH )
- ENUM2STRING( aTypeStr, VISU::TSCALARMAP )
- ENUM2STRING( aTypeStr, VISU::TISOSURFACE )
- ENUM2STRING( aTypeStr, VISU::TDEFORMEDSHAPE )
- ENUM2STRING( aTypeStr, VISU::TCUTPLANES )
- ENUM2STRING( aTypeStr, VISU::TCUTLINES )
- ENUM2STRING( aTypeStr, VISU::TVECTORS )
- ENUM2STRING( aTypeStr, VISU::TSTREAMLINES )
- ENUM2STRING( aTypeStr, VISU::TPLOT3D )
- ENUM2STRING( aTypeStr, VISU::TANIMATION )
- }
- }
- else{
- bool isExist;
- VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue( aMap, "myType", &isExist).toInt();
- if( isExist ){
- switch (aType) {
- ENUM2STRING( aTypeStr, VISU::TENTITY )
- ENUM2STRING( aTypeStr, VISU::TFAMILY )
- ENUM2STRING( aTypeStr, VISU::TGROUP )
- ENUM2STRING( aTypeStr, VISU::TVIEW3D )
- ENUM2STRING( aTypeStr, VISU::TFIELD )
- ENUM2STRING( aTypeStr, VISU::TTIMESTAMP )
- }
- }
- }
-
- return aTypeStr;
+ GetSelectedObj( study(), entry( ind ), &aMap );
+ bool isExist;
+ const QString& aVal = VISU::Storable::FindValue(aMap,"myComment",&isExist);
+ if ( isExist )
+ aResStr = "VISU::T" + aVal;
+ return aResStr;
}
QString VisuGUI_Selection::nbComponents( const int ind ) const