SLOT(onCreateViewManager()));
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 );
+ createMenu( action( GAUSS_NEW_VIEWER ), newWinMenu, -1 );
// Add actions to menus
- int aMenuId = createMenu( tr( "MEN_GAUSS" ), -1, -1, 30 );
+ createMenu( tr( "MEN_GAUSS" ), -1, -1, 30 );
//createMenu( GAUSS_CREATE_PRS, aMenuId, 10 );
QString aViewerType = VVTK_Viewer::Type();
connect( getApp(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ), this, SLOT( OnViewManagerAdded (SUIT_ViewManager*) ) );
// 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;
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 );
+ "client='ObjectBrowser' and selcount=1 "
+ "and type='VISU::TTIMESTAMP' "
+ "and $medEntity in {'EDGE_ENTITY' 'FACE_ENTITY' 'CELL_ENTITY'} "
+ "and $medSource in {'eImportFile' 'eCopyAndImportFile'} ",
+ true );
createMenu( action( GAUSS_CREATE_PRS ), createMenu( tr( "MEN_VISUALISATION" ), -1 ), -1 );
createTool( GAUSS_CREATE_PRS, createTool( tr( "TOOL_VISUALISATION" ) ), -1 );
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 );
+ "selcount=1 and type='VISU::TGAUSSPOINTS'",
+ true );
aRule = "(selcount>0 and type='VISU::TGAUSSPOINTS')";
setPreferenceProperty( clampPref, "min", 1 );
setPreferenceProperty( clampPref, "max", 512 );
- int mainTexturePref = addPreference( tr( "VISU_GAUSS_PREF_MAIN_TEXTURE" ), primitiveGr,
- SalomeApp_Preferences::File, "VISU", "point_sprite_main_texture" );
+ addPreference( tr( "VISU_GAUSS_PREF_MAIN_TEXTURE" ), primitiveGr,
+ SalomeApp_Preferences::File, "VISU", "point_sprite_main_texture" );
- int alphaTexturePref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_TEXTURE" ), primitiveGr,
- SalomeApp_Preferences::File, "VISU", "point_sprite_alpha_texture" );
+ addPreference( tr( "VISU_GAUSS_PREF_ALPHA_TEXTURE" ), primitiveGr,
+ SalomeApp_Preferences::File, "VISU", "point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
SalomeApp_Preferences::DblSpin, "VISU", "point_sprite_alpha_threshold" );
setPreferenceProperty( sizePref, "min", 1 );
setPreferenceProperty( sizePref, "max", 100 );
- int colorPref = addPreference( tr( "VISU_GAUSS_PREF_COLOR" ), geomGr,
- SalomeApp_Preferences::Color, "VISU", "point_sprite_color" );
+ addPreference( tr( "VISU_GAUSS_PREF_COLOR" ), geomGr,
+ SalomeApp_Preferences::Color, "VISU", "point_sprite_color" );
}
setPreferenceProperty( activeBarPref, "strings", values );
setPreferenceProperty( activeBarPref, "indexes", indices );
- int diplayGlobalPref = addPreference( tr( "VISU_GAUSS_PREF_DISPLAY_GLOBAL" ), scalarBarGr,
- SalomeApp_Preferences::Bool, "VISU", "scalar_bar_display_global" );
+ addPreference( tr( "VISU_GAUSS_PREF_DISPLAY_GLOBAL" ), scalarBarGr,
+ SalomeApp_Preferences::Bool, "VISU", "scalar_bar_display_global" );
int colorPref = addPreference( tr( "VISU_GAUSS_PREF_SCALAR_BAR_MODE" ), scalarBarGr,
SalomeApp_Preferences::Selector, "VISU", "scalar_bar_bicolor" );
setPreferenceProperty( clampPref, "min", 1 );
setPreferenceProperty( clampPref, "max", 512 );
- int mainTexturePref = addPreference( tr( "VISU_GAUSS_PREF_MAIN_TEXTURE" ), primitiveGr,
- SalomeApp_Preferences::File, "VISU", "outside_point_sprite_main_texture" );
+ addPreference( tr( "VISU_GAUSS_PREF_MAIN_TEXTURE" ), primitiveGr,
+ SalomeApp_Preferences::File, "VISU", "outside_point_sprite_main_texture" );
- int alphaTexturePref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_TEXTURE" ), primitiveGr,
- SalomeApp_Preferences::File, "VISU", "outside_point_sprite_alpha_texture" );
+ addPreference( tr( "VISU_GAUSS_PREF_ALPHA_TEXTURE" ), primitiveGr,
+ SalomeApp_Preferences::File, "VISU", "outside_point_sprite_alpha_texture" );
int alphaThresholdPref = addPreference( tr( "VISU_GAUSS_PREF_ALPHA_THRESHOLD" ), primitiveGr,
SalomeApp_Preferences::DblSpin, "VISU", "outside_point_sprite_alpha_threshold" ); setPreferenceProperty( alphaThresholdPref, "min", 0.0 );
int colorGr = addPreference( tr( "VISU_GAUSS_PREF_COLOR_GROUP_TTL" ), outsideCursorTab );
- int colorPref = addPreference( tr( "VISU_GAUSS_PREF_COLOR" ), colorGr,
- SalomeApp_Preferences::Color, "VISU", "outside_point_sprite_color" );
+ addPreference( tr( "VISU_GAUSS_PREF_COLOR" ), colorGr,
+ SalomeApp_Preferences::Color, "VISU", "outside_point_sprite_color" );
}
#include "VisuGUI_ViewTools.h"
#include "VisuGUI_Tools.h"
+#include "VISU_Result_i.hh"
+#include "SalomeApp_Study.h"
+
using namespace VISU;
//////////////////////////////////////////////////
if ( !val.isValid() ) {
if ( p == "type" ) val = QtxValue( type( ind ) );
else if ( p == "nbComponents" ) val = QtxValue( nbComponents( ind ) );
+ else if ( p == "medEntity" ) val = QtxValue( medEntity( ind ) );
+ else if ( p == "medSource" ) val = QtxValue( medSource( ind ) );
else if ( p == "representation" ) val = QtxValue( representation( ind ) );
else if ( p == "nbTimeStamps" ) val = QtxValue( nbTimeStamps( ind ) );
else if ( p == "nbChildren" ) val = QtxValue( nbChildren( ind ) );
return aResStr;
}
+QString VisuGUI_Selection::medEntity( const int ind ) const
+{
+ bool isExist;
+ VISU::Storable::TRestoringMap aMap;
+ GetSelectedObj( study(), entry( ind ), &aMap );
+ const QString& aVal = VISU::Storable::FindValue(aMap,"myEntityId",&isExist);
+ if ( isExist ) {
+ using namespace VISU;
+ TEntity anEntityId = TEntity(aVal.toInt());
+ switch(anEntityId){
+ case NODE_ENTITY :
+ return "NODE_ENTITY";
+ case EDGE_ENTITY :
+ return "EDGE_ENTITY";
+ case FACE_ENTITY :
+ return "FACE_ENTITY";
+ case CELL_ENTITY :
+ return "CELL_ENTITY";
+ default:
+ return QString();
+ }
+ }
+ return QString();
+}
+
+QString VisuGUI_Selection::medSource( const int ind ) const
+{
+ _PTR(Study) aStudyDS = study()->studyDS();
+ if(_PTR(SObject) aSObject = aStudyDS->FindObjectID(entry(ind))){
+ VISU::Result_var aRes;
+ if(VISU::Result_i* aResult = CheckResult(myModule,aSObject,aRes)){
+ using namespace VISU;
+ Result_i::ECreationId aCreationId = aResult->GetCreationId();
+ switch(aCreationId){
+ case Result_i::eImportFile :
+ return "eImportFile";
+ case Result_i::eCopyAndImportFile :
+ return "eCopyAndImportFile";
+ case Result_i::eImportMed :
+ return "eImportMed";
+ case Result_i::eImportMedField :
+ return "eImportMedField";
+ default:
+ return QString();
+ }
+ }
+ }
+ return QString();
+}
+
QString VisuGUI_Selection::nbTimeStamps( const int ind ) const
{
QString aResStr;