if(MYDEBUG) MESSAGE("VisuGUI::OnImportFromFile()");
if ( CheckLock(GetCStudy(GetAppStudy(this)),GetDesktop(this)) )
return;
-
+
SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
// Get file name
QStringList aFilter;
aFilter.append( tr( "FLT_MED_FILES" ) );
aFilter.append( tr( "FLT_ALL_FILES" ) );
-
+
bool toUseBuildProgress = aResourceMgr->booleanValue("VISU", "use_build_progress", false);
SalomeApp_CheckFileDlg* fd = new SalomeApp_CheckFileDlg( GetDesktop(this), true, tr("USE_BUILD_PROGRESS") );
QFileInfo aFileInfo( fd->selectedFile() );
toUseBuildProgress = fd->IsChecked();
delete fd;
-
+
// Check the file name
if ( !aFileInfo.exists() )
return;
-
+
if ( !toUseBuildProgress )
{
bool toBuildFields = aResourceMgr->booleanValue( "VISU", "build_fields", true );
bool toBuildGroups = aResourceMgr->booleanValue( "VISU", "build_groups", true );
bool toBuildAll = aResourceMgr->booleanValue( "VISU", "full_med_loading", false );
bool toBuildAtOnce = aResourceMgr->booleanValue( "VISU", "build_at_once", false );
-
- QString anInfo("Importing From File " + aFileInfo.absoluteFilePath() + "..." );
+
+ QString anInfo("Importing From File " + aFileInfo.absoluteFilePath() + "..." );
application()->putInfo( anInfo );
QApplication::setOverrideCursor(Qt::WaitCursor);
SUIT_MessageBox::warning( GetDesktop(this),
tr("WRN_VISU"),
tr("ERR_ERROR_DURING_EXPORT") );
-
+
}
}
}
}
}
}
-
+
}
aBuilder->RemoveObjectWithChildren( aTblObj ); // We should have only one child
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
// Get selected SObject
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
Handle(SALOME_InteractiveObject) anIO = it.Value();
TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
VISU::Base_i* aBase = anObjectInfo.myBase;
- if(!aBase)
+ if(!aBase)
continue;
VISU::VISUType aType = aBase->GetType();
switch (aType) {
- case VISU::TCURVE:
- case VISU::TCONTAINER:
- case VISU::TTABLE:
+ case VISU::TCURVE:
+ case VISU::TCONTAINER:
+ case VISU::TTABLE:
displayer()->Display(anIO->getEntry());
break;
default: {
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule);
if(aSelectionInfo.empty())
return false;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
thePrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase);
if(!thePrs3d)
return false;
-
+
theViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
if(!theViewWindow)
return false;
-
+
thenActor = FindActor(theViewWindow, thePrs3d);
if(!thenActor)
return false;
-
+
return true;
}
}
SVTK_ViewWindow* aViewWindow = NULL;
if(!GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor))
return;
-
+
VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d);
VISU::DeformedShape_i* aDeformedShape = dynamic_cast<VISU::DeformedShape_i*>(aPrs3d);
SVTK_ViewWindow* aViewWindow = NULL;
if(!GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor))
return;
-
+
VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d);
if(!aMesh)
return;
SVTK_ViewWindow* aViewWindow = NULL;
if(!GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor))
return;
-
+
VisuGUI_TransparencyDlg* aDialog = new VisuGUI_TransparencyDlg( this );
aDialog->show();
}
SVTK_ViewWindow* aViewWindow = NULL;
if(!GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor))
return;
-
+
VisuGUI_CursorDlg* CursorDlg =
new VisuGUI_CursorDlg (GetDesktop(this), (const char*)tr("DLG_LINEWIDTH_TITLE").toLatin1(), TRUE);
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
_PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase))
aSObject = GetCStudy( GetAppStudy( this ) )->FindObjectID( aTable->GetObjectEntry() );
-
+
if( !IsSObjectTable( aSObject ) )
return;
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
_PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
if(VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase){
if(aBase->GetType() == VISU::TTABLE) {
int marker, line, lineWidth;
QColor color;
if ( aDlg->getCurveAttributes(verIndices[i], isAuto, marker,
- line, lineWidth, color) && !isAuto )
+ line, lineWidth, color) && !isAuto )
{
SALOMEDS::Color c;
c.R = color.red() /255.;
int marker, line, lineWidth;
QColor color;
if ( aDlg->getCurveAttributes(verIndices[i], isAuto, marker,
- line, lineWidth, color) && !isAuto )
+ line, lineWidth, color) && !isAuto )
{
SALOMEDS::Color c;
c.R = color.red()/255.;
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
- if(!aBase)
+ if(!aBase)
return;
if(aBase->GetType() == VISU::TCURVE) {
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
if(!aBase)
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
if(!aBase)
return;
VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase);
- if(!aContainer)
+ if(!aContainer)
return;
VisuGUI_EditContainerDlg* aDlg = new VisuGUI_EditContainerDlg (this);
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
_PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
if(!aSObject)
Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
aName->SetValue((const char*)Name.toLatin1()); // rename the SObject
anIO->setName((const char*)Name.toLatin1()); // rename the InteractiveObject
-
+
ViewManagerList aViewManagerList;
ViewManagerList::Iterator anIt;
getApp()->viewManagers(SPlot2d_Viewer::Type(), aViewManagerList);
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
if(!aBase)
createAction( VISU_UNSHRINK, tr("MEN_UNSHRINK"), QIcon(),
tr("MEN_UNSHRINK"), "", 0, aParent, false,
this, SLOT(OnMakeShrink()));
-
+
createAction( VISU_SHADING, tr("MEN_SHADING"), QIcon(),
tr("MEN_SHADING"), "", 0, aParent, false,
this, SLOT(OnSetShadingOn()));
-
+
createAction( VISU_NOSHADING, tr("MEN_NOSHADING"), QIcon(),
tr("MEN_NOSHADING"), "", 0, aParent, false,
this, SLOT(OnSetShadingOff()));
int aMenuId;
aMenuId = createMenu( tr( "MEN_DESK_FILE" ), -1 );
createMenu( separator(), aMenuId, -1, 10 );
-
+
int anImportId = createMenu( tr( "MEN_IMPORT" ), aMenuId, -1, 10 );
createMenu( VISU_IMPORT_FROM_FILE, anImportId ); // import from file
createMenu( VISU_IMPORT_TABLE, anImportId ); // import table
mgr->insert( action( VISU_MULTIPR_LOW_RES ), -1, -1, -1 );
mgr->insert( action( VISU_MULTIPR_HIDE ), -1, -1, -1 );
#endif
-
-
+
+
// Rules
QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
//aRule = "client='ObjectBrowser' and type='MEDFIELD'";
//mgr->setRule( action( VISU_IMPORT_MED ), aRule, true );
-
+
#ifdef ENABLE_MULTIPR
// MULTIPR
aRule = "client='ObjectBrowser' and $type in {'VISU::TPART'}";
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
_PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
}
// Check single selection
- if (aListIO.Extent() != 1)
+ if (aListIO.Extent() != 1)
return;
bool isExist;
{
// TAB: "MED import"
int importTab = addPreference( tr( "MED import" ) );
- //printf( "Tab index %d\n", importTab );
+ //printf( "++++++++++++++++++ Tab index %d\n", importTab );
//int importFrame = addPreference( tr( "MED FRAME" ), importTab );
//printf( "Frame index %d\n", importFrame );
-
-
+
// group: "MED files import"
int importGr = addPreference( tr( "MED files import" ), importTab );
//printf( "Group index %d\n", importGr );
- setPreferenceProperty( importGr, "columns", 1 );
+ setPreferenceProperty( importGr, "columns", 2 );
+
addPreference( tr( "Use build progress" ), importGr, LightApp_Preferences::Bool, "VISU", "use_build_progress" );
addPreference( tr( "Full MED loading" ), importGr, LightApp_Preferences::Bool, "VISU", "full_med_loading" );
addPreference( tr( "Build at once" ), importGr, LightApp_Preferences::Bool, "VISU", "build_at_once" );
int sbarTab = addPreference( tr( "VISU_SCALAR_BAR" ) );
int rangeGr = addPreference( tr( "VISU_SCALAR_RANGE" ), sbarTab );
- setPreferenceProperty( rangeGr, "columns", 1 );
+ setPreferenceProperty( rangeGr, "columns", 4 );
int mode = addPreference( tr( "VISU_SCALAR_MODE" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_bar_mode" );
QStringList modes;
setPreferenceProperty( mode, "strings", modes );
setPreferenceProperty( mode, "indexes", indices );
- addPreference( tr( "VISU_LOGARITHMIC_SCALING" ), rangeGr, LightApp_Preferences::Bool, "VISU", "scalar_bar_logarithmic" );
-
int rangetype = addPreference( tr( "VISU_RANGE_TO_USE" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_range_type" );
QStringList types;
types.append( tr( "VISU_FIELD_RANGE" ) );
setPreferenceProperty( rangetype, "strings", types );
setPreferenceProperty( rangetype, "indexes", indices );
+ addPreference( tr( "VISU_LOGARITHMIC_SCALING" ), rangeGr, LightApp_Preferences::Bool, "VISU", "scalar_bar_logarithmic" );
+
int imposedGr = addPreference( tr( "VISU_MINMAX_IMPOSED_RANGE" ), sbarTab );
+ setPreferenceProperty( imposedGr, "columns", 2 );
int min = addPreference( tr( "VISU_MIN" ), imposedGr, LightApp_Preferences::DblSpin, "VISU", "scalar_range_min" );
int max = addPreference( tr( "VISU_MAX" ), imposedGr, LightApp_Preferences::DblSpin, "VISU", "scalar_range_max" );
// group: "Colors & Labels"
int colorsLabelsGr = addPreference( tr( "VISU_COLORS_AND_LABELS" ), sbarTab );
+ setPreferenceProperty( colorsLabelsGr, "columns", 2 );
int numcol = addPreference( tr( "VISU_NB_COLORS" ), colorsLabelsGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_colors" );
// group: "Origin & Size Vertical"
int posVSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_VERTICAL" ), sbarTab );
+ setPreferenceProperty( posVSizeGr, "columns", 2 );
int xv = addPreference( tr( "VISU_X" ), posVSizeGr,
LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_x" );
int yv = addPreference( tr( "VISU_Y" ), posVSizeGr,
// group: "Origin & Size Horizontal"
int posHSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_HORIZONTAL" ), sbarTab );
+ setPreferenceProperty( posHSizeGr, "columns", 2 );
int xh = addPreference( tr( "VISU_X" ), posHSizeGr,
LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_x" );
int yh = addPreference( tr( "VISU_Y" ), posHSizeGr,
// TAB: "Sweep, Animation"
int srangeTab = addPreference( tr( "Sweep, Animation" ) );
-
+
// group: "Sweeping preferences"
int sweepGr = addPreference( tr( "VISU_SWEEPING_PREF" ), srangeTab );
setPreferenceProperty( sweepGr, "columns", 1 );
-
+
int modeSw = addPreference( tr( "VISU_SWEEPING_MODES" ), sweepGr, LightApp_Preferences::Selector, "VISU", "sweeping_modes" );
QStringList sweep_modes;
sweep_modes.append( tr( "VISU_LINEAR_SWEEP" ) );
setPreferenceProperty( timestep, "step", 0.1 );
setPreferenceProperty( timestep, "max", 1000 );
setPreferenceProperty( nbcycles, "max", 100 );
- setPreferenceProperty( nbsteps, "max", 200 );
+ setPreferenceProperty( nbsteps, "max", 200 );
// group: "Animation preferences"
int animationGr = addPreference( tr( "Animation preferences" ), srangeTab );
addPreference( tr( "Cycled animation" ), animationGr, LightApp_Preferences::Bool, "VISU", "cycled_animation" );
addPreference( tr( "Use proportional timing" ), animationGr, LightApp_Preferences::Bool, "VISU", "use_proportional_timing" );
addPreference( tr( "Clean memory at each frame" ), animationGr, LightApp_Preferences::Bool, "VISU", "clean_memory_at_each_frame" );
-
+
setPreferenceProperty( speed, "min", 1 );
setPreferenceProperty( speed, "max", 99 );
// TAB: Representation ; group: "Representation properties"
int representationTab = addPreference( tr( "Representation" ) );
-
+
int representGr = addPreference( tr( "VISU_REPRESENT_PROPS" ), representationTab );
-
+
QStringList mesh_modes;
mesh_modes.append( "Points" );
mesh_modes.append( "Wireframe" );
mesh_indices.append( 3 );
mesh_indices.append( 4 );
mesh_indices.append( 2 );
-
+
QStringList modes1 = mesh_modes;
modes1.removeAll( "Insideframe" );
QList<QVariant> indices1 = mesh_indices;
indices1.removeAll( 3 );
-
+
QStringList modes2 = modes1;
modes2.removeAll( "Surfaceframe" );
QList<QVariant> indices2 = indices1;
modes3.removeAll( "Surface" );
QList<QVariant> indices3 = indices2;
indices3.removeAll( 2 );
-
-
+
+
int mesh_represent = addPreference( tr( "VISU_MESH" ), representGr, LightApp_Preferences::Selector, "VISU", "mesh_represent" );
setPreferenceProperty( mesh_represent, "strings", mesh_modes );
setPreferenceProperty( mesh_represent, "indexes", mesh_indices );
setPreferenceProperty( scalar_def_represent, "strings", modes1 );
setPreferenceProperty( scalar_def_represent, "indexes", indices1 );
addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_def_shrink" );
-
+
addPreference( tr( "VISU_USE_SHADING" ), representGr,
LightApp_Preferences::Bool, "VISU", "represent_shading" );
addPreference( "", representGr, LightApp_Preferences::Space );
// TAB: 3D Cache ; group: "Cache properties"
int cacheTab = addPreference( tr( "3D Cache" ) );
-
+
int cacheGr = addPreference( tr( "VISU_3DCACHE_PROPS" ), cacheTab );
setPreferenceProperty( cacheGr, "columns", 1 );
indices.append( 1 );
setPreferenceProperty( mode, "strings", modes );
setPreferenceProperty( mode, "indexes", indices );
-
+
int memory_mode = addPreference( tr( "VISU_MEMORY_MODE" ), cacheGr,
LightApp_Preferences::Selector, "VISU", "cache_memory_mode" );
setPreferenceProperty( memory_mode, "strings", modes );
{
if( !myDisplayer )
myDisplayer = new VisuGUI_Displayer( getApp() );
-
+
return myDisplayer;
}
if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase)){
if (aPrsObject->GetType() == VISU::TCUTPLANES) {
aCutPrs = dynamic_cast<VISU::CutPlanes_i*>(aPrsObject);
- if (aCutPrs)
+ if (aCutPrs)
break;
}
}
aType = Storable::FindValue(aMap,"myType",&isExist);
if (!isExist || aType.toInt() != TTIMESTAMP )
return;
-
+
QString aMeshName = (const char*)Storable::FindValue(aMap,"myMeshName",&isExist).toLatin1();
QString anEntity = (const char*)Storable::FindValue(aMap,"myEntityId",&isExist).toLatin1();
QString aFieldName = (const char*)Storable::FindValue(aMap,"myFieldName",&isExist).toLatin1();
aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<SVTK_ViewWindow*>(GetViewWindow<SVTK_Viewer>(this)));
}
GetResourceMgr()->setValue("VISU", "scalar_bar_position_num", aPos);
-
- VISU::Plot3D_i* aPrs3d =
- CreatePrs3dFromFactory<VISU::Plot3D_i>(this,
- aTimeStampSObj,
- (const char*)aMeshName.toLatin1(),
+
+ VISU::Plot3D_i* aPrs3d =
+ CreatePrs3dFromFactory<VISU::Plot3D_i>(this,
+ aTimeStampSObj,
+ (const char*)aMeshName.toLatin1(),
(Entity)anEntity.toInt(),
- (const char*)aFieldName.toLatin1(),
+ (const char*)aFieldName.toLatin1(),
aTimeStampId.toInt(),
ColoredPrs3d_i::EPublishUnderTimeStamp);
if (aPrs3d) {
double aRotY = aCutPrs->GetRotateY();
double aPlanePos = aCutPrs->GetPlanePosition(0);
aDlg->setPlane(aOrient, aRotX, aRotY, aPlanePos);
-
+
if (!(runAndWait(aDlg, 0) && (aDlg->storeToPrsObject(aPrs3d)))) {
DeletePrs3d(this, aPrs3d);
delete aDlg;
if ( aSVtkWindow ) {
PublishInView(this, aPrs3d, aSVtkWindow, /*highlight = */true);
aSVtkWindow->onFitAll();
-
+
AddScalarBarPosition(this, aSVtkWindow, aPrs3d, aPos);
}
}
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
_PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
{
bool hasMediumOrLow = (strstr(aSObject->GetComment().c_str(), "res=FML") != NULL);
- if (resolution == 'F')
+ if (resolution == 'F')
{
if (result != NULL) result->SetResolutionMultipr(aSObject->GetName().c_str(), 'F');
aPixMap->SetPixMap("ICON_MULTIPR_VIEW_FULL");
- }
- else if ((resolution == 'M') && hasMediumOrLow)
+ }
+ else if ((resolution == 'M') && hasMediumOrLow)
{
if (result != NULL) result->SetResolutionMultipr(aSObject->GetName().c_str(), 'M');
aPixMap->SetPixMap("ICON_MULTIPR_VIEW_MEDIUM");
- }
- else if ((resolution == 'L') && hasMediumOrLow)
+ }
+ else if ((resolution == 'L') && hasMediumOrLow)
{
if (result != NULL) result->SetResolutionMultipr(aSObject->GetName().c_str(), 'L');
- aPixMap->SetPixMap("ICON_MULTIPR_VIEW_LOW");
+ aPixMap->SetPixMap("ICON_MULTIPR_VIEW_LOW");
}
- else if (resolution == 'H')
+ else if (resolution == 'H')
{
if (result != NULL) result->SetResolutionMultipr(aSObject->GetName().c_str(), 'H');
aPixMap->SetPixMap("ICON_MULTIPR_VIEW_HIDE");