// File : VisuGUI.cxx
// Author :
// Module : VISU
-//
+
+#include <Standard_math.hxx> // E.A. must be included before Python.h to fix compilation on windows
+#include "Python.h"
+
#include "VisuGUI.h"
// STL Includes
case VISU::TCURVE:
case VISU::TCONTAINER:
case VISU::TTABLE:
+ getViewManager(SPlot2d_Viewer::Type(), true);
displayer()->Display(anIO->getEntry());
break;
default: {
if( VISU::Prs3d_i* aPrs = aPrsList[i] )
{
VTKViewer_MarkerDlg* aDlg = new VTKViewer_MarkerDlg( GetDesktop( this ) );
+ aDlg->setHelpData( "VISU", "point_marker_page.html" );
aDlg->setCustomMarkerMap( aMarkerMap[ aStudyId ] );
if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase)){
if(aContainer && aContainer->GetNbCurves() > 0){
aContainer->Clear();
+ VISU::updateContainerVisibility(aContainer);
UpdateObjBrowser(this);
}
}
if (aDlg->exec()) {
aDlg->storeToPrsObject(aContainer);
UpdateObjBrowser(this, true);
+ delete aDlg;
+ VISU::updateContainerVisibility(aContainer);
}
- delete aDlg;
}
//----------------------------------------------------------------------------
QString aPrsInvisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "})" + andInvisible + " and (not isPlot2dViewer))";
QString aComponent = "( selcount=1 and canBeDisplayed and isVisuComponent )";
- QString anEraseRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsVisible +
+ QString anEraseRule = "( selcount>0 and ({true} in $canBeDisplayed or type in {'VISU::TCONTAINER' 'VISU::TCURVE'}) and (" + aPrsVisible +
" or ( (" + aTableOrContHide + orCurveVisible + "))) ) or " + aComponent;
- QString aDisplayRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsInvisible +
+ QString aDisplayRule = "( selcount>0 and ({true} in $canBeDisplayed or type in {'VISU::TCONTAINER' 'VISU::TCURVE'}) and (" + aPrsInvisible +
" or ( (" + aTableOrContShow + orCurveInvisible + "))) ) or " + aComponent;
- QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed) and (($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "})"
+ QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed or type in {'VISU::TCONTAINER' 'VISU::TCURVE'}) and (($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "})"
" or ( ((type='VISU::TTABLE' and nbChildren>0) or (type='VISU::TCONTAINER' and hasCurves) or"
" (type='VISU::TCURVE')))) ) or" + aComponent;
setMenuShown( true );
setToolShown( true );
+ // import Python module that manages VISU plugins (need to be here because SalomePyQt API uses active module)
+ PyGILState_STATE gstate = PyGILState_Ensure();
+ PyObject* pluginsmanager=PyImport_ImportModule((char*)"salome_pluginsmanager");
+ if(pluginsmanager==NULL)
+ PyErr_Print();
+ else
+ {
+ PyObject* result=PyObject_CallMethod( pluginsmanager, (char*)"initialize", (char*)"isss",1,"visu",tr("MEN_VISUALIZATION").toStdString().c_str(),tr("VISU_PLUGINS_OTHER").toStdString().c_str());
+ if(result==NULL)
+ PyErr_Print();
+ Py_XDECREF(result);
+ }
+ PyGILState_Release(gstate);
+ // end of GEOM plugins loading
+
// Reset actions accelerator keys
QList<QKeySequence> shortcuts;
shortcuts.append( QKeySequence(Qt::CTRL + Qt::Key_I) );
void VisuGUI::createPreferences()
{
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+
// TAB: General
int genTab = addPreference( tr( "VISU_PREF_GENERAL" ) );
// Quantities with individual precision settings
// Set property for precision value for spinboxes
for ( ii = 0; ii < nbQuantities; ii++ ){
- setPreferenceProperty( precs[ii], "min", ii == 2 ? 0 : -10 );
- setPreferenceProperty( precs[ii], "max", ii == 2 ? 3 : 10 );
+ setPreferenceProperty( precs[ii], "min", ii == 2 ? 0 : -14 );
+ setPreferenceProperty( precs[ii], "max", ii == 2 ? 3 : 14 );
setPreferenceProperty( precs[ii], "precision", 2 );
}
int imposedGr = addPreference( tr( "VISU_MINMAX_IMPOSED_RANGE" ), sbarTab );
setPreferenceProperty( imposedGr, "columns", 4 );
- 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" );
- setPreferenceProperty( min, "step", 0.1 );
- setPreferenceProperty( max, "step", 0.1 );
+ int min = addPreference( tr( "VISU_MIN" ), imposedGr, LightApp_Preferences::Double, "VISU", "scalar_range_min" );
+ int max = addPreference( tr( "VISU_MAX" ), imposedGr, LightApp_Preferences::Double, "VISU", "scalar_range_max" );
+ setPreferenceProperty( min, "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
+ setPreferenceProperty( max, "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
// group: "Font"
int fontGr = addPreference( tr( "VISU_FONT" ), sbarTab );
addPreference( tr( "Generate data table" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_data_table" );
addPreference( tr( "Generate curves" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_curves" );
+ // TAB: "StreamLines"
+ int streamLinesTab = addPreference( tr( "VISU_STREAM_LINES" ) );
+
+ // group: "StreamLines preferences"
+ int streamLinesGr = addPreference( tr( "VISU_STREAM_LINES_PREF" ), streamLinesTab );
+ setPreferenceProperty( cutLineGr, "columns", 1 );
+ int usedPoints = addPreference( tr( "VISU_STREAM_LINES_USED_POINTS" ), streamLinesGr,
+ LightApp_Preferences::DblSpin, "VISU", "stream_lines_used_points" );
+ setPreferenceProperty( usedPoints, "min", 0 );
+ setPreferenceProperty( usedPoints, "max", 1 );
+ setPreferenceProperty( usedPoints, "step", 0.1 );
+
// TAB: "Sweep, Animation, 3D Cache"
int animationTab = addPreference( tr( "Sweep, Animation" ) );
{
addPreference( tr( "VISU_EDGE_COLOR" ), representGr, LightApp_Preferences::Color, "VISU", "edge_color" );
addPreference( "", representGr, LightApp_Preferences::Space );
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
-
int typeOfMarker = addPreference( tr( "VISU_TYPE_OF_MARKER" ), representGr, LightApp_Preferences::Selector, "VISU", "type_of_marker" );
QList<QVariant> aMarkerTypeIndicesList;
aResourceMgr->setValue("VISU", "scalar_bar_horizontal_height",sbH);
}
}
+ else if(b == "visual_data_precision") {
+ LightApp_Preferences* pref = preferences();
+ QtxPreferenceItem* min = pref->findItem( tr( "VISU_MIN" ), true );
+ QtxPreferenceItem* max = pref->findItem( tr( "VISU_MAX" ), true );
+ if ( min )
+ setPreferenceProperty( min->id(), "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
+ if ( max )
+ setPreferenceProperty( max->id(), "decimals", qAbs( aResourceMgr->integerValue( "VISU", "visual_data_precision", 0 ) ) );
+ }
if ( !aWarning.isEmpty() ){
aWarning += "The default values are applied instead.";