#include "GEOMGUI_OCCSelector.h"
#include "GEOMGUI_Selection.h"
#include "GEOMGUI_CreationInfoWdg.h"
+#include "GEOMGUI_TextTreeWdg.h"
#include "GEOMGUI_DimensionProperty.h"
#include "GEOM_Constants.h"
#include "GEOM_Displayer.h"
#include <SALOMEDS_SObject.hxx>
#include <Basics_OCCTVersion.hxx>
+#include <QtxFontEdit.h>
// External includes
#include <QDir>
#include <QString>
#include <QPainter>
#include <QSignalMapper>
+#include <QFontDatabase>
-#include <AIS_Drawer.hxx>
#include <AIS_ListOfInteractive.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx>
#include <Prs3d_Drawer.hxx>
#include <NCollection_DataMap.hxx>
#include <TColStd_HArray1OfByte.hxx>
+#include <TColStd_SequenceOfHAsciiString.hxx>
#include <utilities.h>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx>
+#include <Font_SystemFont.hxx>
+#include <Font_FontMgr.hxx>
+#include <TCollection_HAsciiString.hxx>
+
#include "GEOM_version.h"
#include "GEOMImpl_Types.hxx" // dangerous hxx (defines short-name macros) - include after all
myLocalSelectionMode = GEOM_ALLOBJECTS;
myCreationInfoWdg = 0;
+ myTextTreeWdg = 0;
connect( Material_ResourceMgr::resourceMgr(), SIGNAL( changed() ), this, SLOT( updateMaterials() ) );
case GEOMOp::OpShow: // MENU VIEW - DISPLAY
case GEOMOp::OpSwitchVectors: // MENU VIEW - VECTOR MODE
case GEOMOp::OpSwitchVertices: // MENU VIEW - VERTICES MODE
+ case GEOMOp::OpSwitchName: // MENU VIEW - VERTICES MODE
case GEOMOp::OpWireframe: // POPUP MENU - WIREFRAME
case GEOMOp::OpShading: // POPUP MENU - SHADING
case GEOMOp::OpShadingWithEdges: // POPUP MENU - SHADING WITH EDGES
case GEOMOp::OpTexture: // POPUP MENU - TEXTURE
case GEOMOp::OpVectors: // POPUP MENU - VECTORS
case GEOMOp::OpVertices: // POPUP MENU - VERTICES
+ case GEOMOp::OpShowName: // POPUP MENU - SHOW NAME
libName = "DisplayGUI";
break;
case GEOMOp::OpPoint: // MENU BASIC - POINT
case GEOMOp::OpFilling: // MENU GENERATION - FILLING
case GEOMOp::OpPipe: // MENU GENERATION - PIPE
case GEOMOp::OpPipePath: // MENU GENERATION - RESTORE PATH
+ case GEOMOp::OpThickness: // MENU GENERATION - THICKNESS
libName = "GenerationGUI";
break;
case GEOMOp::Op2dSketcher: // MENU ENTITY - SKETCHER
case GEOMOp::OpScale: // MENU TRANSFORMATION - SCALE
case GEOMOp::OpOffset: // MENU TRANSFORMATION - OFFSET
case GEOMOp::OpProjection: // MENU TRANSFORMATION - PROJECTION
+ case GEOMOp::OpProjOnCyl: // MENU TRANSFORMATION - PROJECTION ON CYLINDER
case GEOMOp::OpMultiTranslate: // MENU TRANSFORMATION - MULTI-TRANSLATION
case GEOMOp::OpMultiRotate: // MENU TRANSFORMATION - MULTI-ROTATION
case GEOMOp::OpReimport: // CONTEXT(POPUP) MENU - RELOAD_IMPORTED
case GEOMOp::OpCheckSelfInters: // MENU MEASURE - CHECK SELF INTERSECTIONS
case GEOMOp::OpFastCheckInters: // MENU MEASURE - FAST CHECK INTERSECTIONS
case GEOMOp::OpManageDimensions: // MENU MEASURE - MANAGE DIMENSIONS
+ case GEOMOp::OpShapeStatistics: // MENU MEASURE - SHAPE STATISTICS
case GEOMOp::OpShowAllDimensions: // POPUP MENU - SHOW ALL DIMENSIONS
case GEOMOp::OpHideAllDimensions: // POPUP MENU - HIDE ALL DIMENSIONS
libName = "MeasureGUI";
createGeomAction( GEOMOp::OpFilling, "FILLING" );
createGeomAction( GEOMOp::OpPipe, "PIPE" );
createGeomAction( GEOMOp::OpPipePath, "PIPE_PATH" );
+ createGeomAction( GEOMOp::OpThickness, "THICKNESS" );
createGeomAction( GEOMOp::OpGroupCreate, "GROUP_CREATE" );
createGeomAction( GEOMOp::OpGroupEdit, "GROUP_EDIT" );
createGeomAction( GEOMOp::OpScale, "SCALE" );
createGeomAction( GEOMOp::OpOffset, "OFFSET" );
createGeomAction( GEOMOp::OpProjection, "PROJECTION" );
+ createGeomAction( GEOMOp::OpProjOnCyl, "PROJ_ON_CYL" );
createGeomAction( GEOMOp::OpMultiTranslate, "MUL_TRANSLATION" );
createGeomAction( GEOMOp::OpMultiRotate, "MUL_ROTATION" );
createGeomAction( GEOMOp::OpExtension, "EXTENSION" );
createGeomAction( GEOMOp::OpGetNonBlocks, "GET_NON_BLOCKS" );
createGeomAction( GEOMOp::OpCheckSelfInters, "CHECK_SELF_INTERSECTIONS" );
createGeomAction( GEOMOp::OpFastCheckInters, "FAST_CHECK_INTERSECTIONS" );
+ createGeomAction( GEOMOp::OpShapeStatistics, "SHAPE_STATISTICS" );
#ifdef _DEBUG_ // PAL16821
createGeomAction( GEOMOp::OpCheckGeom, "CHECK_GEOMETRY" );
createGeomAction( GEOMOp::OpShow, "DISPLAY" );
createGeomAction( GEOMOp::OpSwitchVectors, "VECTOR_MODE");
createGeomAction( GEOMOp::OpSwitchVertices, "VERTICES_MODE");
+ createGeomAction( GEOMOp::OpSwitchName, "NAME_MODE");
createGeomAction( GEOMOp::OpSelectVertex, "VERTEX_SEL_ONLY" ,"", 0, true );
createGeomAction( GEOMOp::OpSelectEdge, "EDGE_SEL_ONLY", "", 0, true );
createGeomAction( GEOMOp::OpSelectWire, "WIRE_SEL_ONLY", "", 0, true );
createGeomAction( GEOMOp::OpIsosWidth, "ISOS_WIDTH");
createGeomAction( GEOMOp::OpVectors, "POP_VECTORS", "", 0, true );
createGeomAction( GEOMOp::OpVertices, "POP_VERTICES", "", 0, true );
+ createGeomAction( GEOMOp::OpShowName, "POP_SHOW_NAME", "", 0, true );
createGeomAction( GEOMOp::OpDeflection, "POP_DEFLECTION" );
createGeomAction( GEOMOp::OpColor, "POP_COLOR" );
createGeomAction( GEOMOp::OpSetTexture, "POP_SETTEXTURE" );
createMenu( GEOMOp::OpFilling, genId, -1 );
createMenu( GEOMOp::OpPipe, genId, -1 );
createMenu( GEOMOp::OpPipePath, genId, -1 );
+ createMenu( GEOMOp::OpThickness, genId, -1 );
//int advId = createMenu( tr( "MEN_ADVANCED" ), newEntId, -1 );
//createMenu( GEOMOp::OpSmoothingSurface, advId, -1 );
createMenu( GEOMOp::OpOffset, transId, -1 );
createMenu( GEOMOp::OpProjection, transId, -1 );
createMenu( GEOMOp::OpExtension, transId, -1 );
+ createMenu( GEOMOp::OpProjOnCyl, transId, -1 );
createMenu( separator(), transId, -1 );
createMenu( GEOMOp::OpMultiTranslate, transId, -1 );
createMenu( GEOMOp::OpMultiRotate, transId, -1 );
createMenu( GEOMOp::OpCheckSelfInters, measurId, -1 );
createMenu( GEOMOp::OpFastCheckInters, measurId, -1 );
createMenu( GEOMOp::OpInspectObj, measurId, -1 );
+ createMenu( GEOMOp::OpShapeStatistics, measurId, -1 );
int toolsId = createMenu( tr( "MEN_TOOLS" ), -1, -1, 50 );
#if defined(_DEBUG_) || defined(_DEBUG) // PAL16821
createMenu( separator(), dispmodeId, -1 );
createMenu( GEOMOp::OpSwitchVectors, dispmodeId, -1 );
createMenu( GEOMOp::OpSwitchVertices, dispmodeId, -1 );
+ createMenu( GEOMOp::OpSwitchName, dispmodeId, -1 );
createMenu( separator(), viewId, -1 );
createMenu( GEOMOp::OpShowAll, viewId, -1 );
createTool( GEOMOp::OpFilling, genTbId );
createTool( GEOMOp::OpPipe, genTbId );
createTool( GEOMOp::OpPipePath, genTbId );
+ createTool( GEOMOp::OpThickness, genTbId );
int transTbId = createTool( tr( "TOOL_TRANSFORMATION" ), QString( "GEOMTransformation" ) );
createTool( GEOMOp::OpTranslate, transTbId );
createTool( GEOMOp::OpOffset, transTbId );
createTool( GEOMOp::OpProjection, transTbId );
createTool( GEOMOp::OpExtension, transTbId );
+ createTool( GEOMOp::OpProjOnCyl, transTbId );
createTool( separator(), transTbId );
createTool( GEOMOp::OpMultiTranslate, transTbId );
createTool( GEOMOp::OpMultiRotate, transTbId );
mgr->insert( action( GEOMOp::OpVertices ), dispmodeId, -1 ); // vertices
mgr->setRule( action( GEOMOp::OpVertices ), clientOCCorVTK_AndSomeVisible + " and ($component={'GEOM'})", QtxPopupMgr::VisibleRule );
mgr->setRule( action( GEOMOp::OpVertices ), clientOCCorVTK + " and isVerticesMode", QtxPopupMgr::ToggleRule );
+ mgr->insert( action( GEOMOp::OpShowName ), dispmodeId, -1 ); // show name
+ mgr->setRule( action( GEOMOp::OpShowName ), clientOCCorVTK_AndSomeVisible + " and ($component={'GEOM'})", QtxPopupMgr::VisibleRule );
+ mgr->setRule( action( GEOMOp::OpShowName ), clientOCCorVTK + " and isNameMode", QtxPopupMgr::ToggleRule );
mgr->insert( separator(), -1, -1 ); // -----------
mgr->insert( action( GEOMOp::OpColor ), -1, -1 ); // color
// icon
QPixmap icon;
if ( !adata.icon.empty() )
- icon = resMgr->loadPixmap( pdata.name.c_str(), adata.icon.c_str() );
+ icon = resMgr->loadPixmap( pdata.name.c_str(), adata.icon.c_str() );
// menu text (path)
QStringList smenus = QString( adata.menuText.c_str() ).split( "/" );
QString actionName = smenus.last();
actionStat = actionStat.toUpper().prepend( "STB_" );
createAction( id, // ~ adata.label
- tr( actionTool.toLatin1().constData() ),
- icon,
- tr( actionName.toLatin1().constData() ),
- tr( actionStat.toLatin1().constData() ),
- QKeySequence( tr( adata.accel.c_str() ) ),
- application()->desktop(),
- false /*toggle*/,
- this, SLOT( OnGUIEvent() ),
- QString() /*shortcutAction*/ );
+ tr( actionTool.toLatin1().constData() ),
+ icon,
+ tr( actionName.toLatin1().constData() ),
+ tr( actionStat.toLatin1().constData() ),
+ QKeySequence( tr( adata.accel.c_str() ) ),
+ application()->desktop(),
+ false /*toggle*/,
+ this, SLOT( OnGUIEvent() ),
+ QString() /*shortcutAction*/ );
int menuId = -1;
foreach ( QString subMenu, smenus ) {
- QStringList subMenuList = subMenu.split( ":" );
- QString subMenuName = subMenuList[0].toUpper().prepend( "MEN_" );
- int subMenuGroup = subMenuList.size() > 1 ? subMenuList[1].toInt() : -1;
- menuId = createMenu( tr( subMenuName.toLatin1().constData() ), menuId, -1, subMenuGroup );
+ QStringList subMenuList = subMenu.split( ":" );
+ QString subMenuName = subMenuList[0].toUpper().prepend( "MEN_" );
+ int subMenuGroup = subMenuList.size() > 1 ? subMenuList[1].toInt() : -1;
+ menuId = createMenu( tr( subMenuName.toLatin1().constData() ), menuId, -1, subMenuGroup );
}
createMenu( id, menuId, -1 );
if ( !stools.isEmpty() ) {
- QString subTool = stools[0];
- subTool = subTool.toUpper().prepend( "TOOL_" );
- int toolId = createTool( tr( subTool.toLatin1().constData() ) );
- createTool(id, toolId);
+ QString subTool = stools[0];
+ subTool = subTool.toUpper().prepend( "TOOL_" );
+ int toolId = createTool( tr( subTool.toLatin1().constData() ) );
+ createTool(id, toolId);
}
// add action id to map
else {
PyObjWrapper result =
PyObject_CallMethod(pluginsmanager, (char*)"initialize", (char*)"isss", 1, "geom",
- tr("MEN_NEW_ENTITY").toStdString().c_str(),
- tr("GEOM_PLUGINS_OTHER").toStdString().c_str());
+ tr("MEN_NEW_ENTITY").toUtf8().data(),
+ tr("GEOM_PLUGINS_OTHER").toUtf8().data());
if ( !result )
PyErr_Print();
}
getApp()->insertDockWindow( myCreationInfoWdg->getWinID(), myCreationInfoWdg );
getApp()->placeDockWindow( myCreationInfoWdg->getWinID(), Qt::LeftDockWidgetArea );
+ if ( !myTextTreeWdg )
+ myTextTreeWdg = new GEOMGUI_TextTreeWdg( getApp() );
+ getApp()->insertDockWindow( myTextTreeWdg->getWinID(), myTextTreeWdg );
+ getApp()->placeDockWindow( myTextTreeWdg->getWinID(), Qt::LeftDockWidgetArea );
+
//NPAL 19674
SALOME_ListIO selected;
sm->selectedObjects( selected );
disconnect( selMrg, SIGNAL( currentSelectionChanged() ), this, SLOT( updateCreationInfo() ));
disconnect( selMrg, SIGNAL( currentSelectionChanged() ), this, SLOT( updateFieldColorScale() ));
- getApp()->removeDockWindow( myCreationInfoWdg->getWinID() );
- myCreationInfoWdg = 0;
+ if ( myCreationInfoWdg ) {
+ getApp()->removeDockWindow( myCreationInfoWdg->getWinID() );
+ myCreationInfoWdg = 0;
+ }
+ if ( myTextTreeWdg ) {
+ getApp()->removeDockWindow( myTextTreeWdg->getWinID() );
+ disconnect( application(), 0, myTextTreeWdg, 0 );
+ myTextTreeWdg = 0;
+ }
EmitSignalCloseAllDialogs();
mappa.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea );
if ( myCreationInfoWdg )
mappa.insert( myCreationInfoWdg->getWinID(), Qt::LeftDockWidgetArea );
+ if ( myTextTreeWdg )
+ mappa.insert( myTextTreeWdg->getWinID(), Qt::LeftDockWidgetArea );
}
void GeometryGUI::viewManagers( QStringList& lst ) const
// pass creation info of geomObj to myCreationInfoWdg
if ( myCreationInfoWdg ) {
- QPixmap icon;
- QString operationName;
- myCreationInfoWdg->setOperation( icon, operationName );
+ GEOM::CreationInformationSeq_var info;
try {
OCC_CATCH_SIGNALS;
- GEOM::CreationInformation_var info = geomObj->GetCreationInformation();
- if ( &info.in() ) {
- SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- QString name = info->operationName.in();
- if ( !name.isEmpty() ) {
-
- QString plugin_name;
- for ( size_t i = 0; i < info->params.length(); ++i ) {
- myCreationInfoWdg->addParam( info->params[i].name.in(),
- info->params[i].value.in() );
- QString value = info->params[i].name.in();
- if( value == PLUGIN_NAME ) {
- plugin_name = info->params[i].value.in();
- }
- }
- QString prefix = plugin_name.isEmpty() ? "GEOM" : plugin_name;
- icon = resMgr->loadPixmap( prefix, tr( ("ICO_"+name).toLatin1().constData() ), false );
- operationName = tr( ("MEN_"+name).toLatin1().constData() );
- if ( operationName.startsWith( "MEN_" ))
- operationName = name; // no translation
- myCreationInfoWdg->setOperation( icon, operationName );
- }
- }
+ info = geomObj->GetCreationInformation();
}
catch (...) {
}
+ myCreationInfoWdg->setInfo( info );
}
}
void GeometryGUI::createPreferences()
{
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+
int tabId = addPreference( tr( "PREF_TAB_SETTINGS" ) );
int genGroup = addPreference( tr( "PREF_GROUP_GENERAL" ), tabId );
addPreference( tr( "PREF_ISOS_COLOR" ), genGroup,
LightApp_Preferences::Color, "Geometry", "isos_color" );
+ addPreference( tr( "PREF_LABEL_COLOR" ), genGroup,
+ LightApp_Preferences::Color, "Geometry", "label_color" );
+
+ addPreference( "", genGroup, LightApp_Preferences::Space );
+
addPreference( tr( "PREF_TOPLEVEL_COLOR" ), genGroup,
LightApp_Preferences::Color, "Geometry", "toplevel_color" );
LightApp_Preferences::Selector, "Geometry", "toplevel_dm" );
int transparency = addPreference( tr( "PREF_TRANSPARENCY" ), genGroup,
- LightApp_Preferences::IntSpin, "Geometry", "transparency" );
+ LightApp_Preferences::IntSpin, "Geometry", "transparency" );
int defl = addPreference( tr( "PREF_DEFLECTION" ), genGroup,
LightApp_Preferences::DblSpin, "Geometry", "deflection_coeff" );
setPreferenceProperty( aDimLineWidthId, "min", 1 );
setPreferenceProperty( aDimLineWidthId, "max", 5 );
- int aDimFontHeightId = addPreference( tr( "PREF_DIMENSIONS_FONT_HEIGHT" ), aDimGroupId,
- LightApp_Preferences::DblSpin, "Geometry", "dimensions_font_height" );
-
- setPreferenceProperty( aDimFontHeightId, "min", 1e-9 );
- setPreferenceProperty( aDimFontHeightId, "max", 1e+9 );
- setPreferenceProperty( aDimFontHeightId, "precision", 9 );
+ int aDimFontId = addPreference( tr( "PREF_DIMENSIONS_FONT" ), aDimGroupId, LightApp_Preferences::Font, "Geometry", "dimensions_font" );
+
+ int f = QtxFontEdit::Family | QtxFontEdit::Size;
+ setPreferenceProperty( aDimFontId, "features", f );
+ setPreferenceProperty( aDimFontId, "mode", QtxFontEdit::Custom );
+
+ Handle(Font_FontMgr) fmgr = Font_FontMgr::GetInstance();
+ QString aFontFile = "";
+ resMgr->value("resources", "GEOM", aFontFile);
+ aFontFile = aFontFile + QDir::separator() + "Y14.5M-2009.ttf";
+ // add enginier font into combobox
+ int fontID = QFontDatabase::addApplicationFont( aFontFile );
+ Handle(Font_SystemFont) sf = new Font_SystemFont(
+ new TCollection_HAsciiString("Y14.5M-2009"),
+ Font_FA_Regular,
+ new TCollection_HAsciiString(aFontFile.toLatin1().data()) );
+ // register font in OCC font manager
+ fmgr->RegisterFont( sf, Standard_False );
+
+ // get list of supported fonts by OCC
+ QStringList anOCCFonts;
+ TColStd_SequenceOfHAsciiString theFontsNames;
+ fmgr->GetAvailableFontsNames( theFontsNames );
+ for(Standard_Integer i=1; i<=theFontsNames.Length(); i++) {
+ Handle(TCollection_HAsciiString) str = theFontsNames(i);
+ anOCCFonts << str->ToCString();
+ }
+ anOCCFonts.removeDuplicates();
+ // set the supported fonts into combobox to use its only
+ setPreferenceProperty( aDimFontId, "fonts", anOCCFonts );
int aDimArrLengthId = addPreference( tr( "PREF_DIMENSIONS_ARROW_LENGTH" ), aDimGroupId,
LightApp_Preferences::DblSpin, "Geometry", "dimensions_arrow_length" );
int anAngUnitsId = addPreference( tr( "PREF_DIMENSIONS_ANGLE_UNITS" ), aDimGroupId,
LightApp_Preferences::Selector, "Geometry", "dimensions_angle_units" );
- addPreference( tr( "PREF_DIMENSIONS_SHOW_UNITS" ), aDimGroupId,
- LightApp_Preferences::Bool, "Geometry", "dimensions_show_units" );
-
QStringList aListOfLengthUnits;
aListOfLengthUnits << "m";
aListOfLengthUnits << "cm";
setPreferenceProperty( aLengthUnitsId, "strings", aListOfLengthUnits );
setPreferenceProperty( anAngUnitsId, "strings", aListOfAngUnits );
+ addPreference( tr( "PREF_DIMENSIONS_SHOW_UNITS" ), aDimGroupId,
+ LightApp_Preferences::Bool, "Geometry", "dimensions_show_units" );
+
int aDimDefFlyout = addPreference( tr( "PREF_DIMENSIONS_DEFAULT_FLYOUT" ), aDimGroupId,
LightApp_Preferences::DblSpin, "Geometry", "dimensions_default_flyout" );
setPreferenceProperty( aDimDefFlyout, "max", 1e+9 );
setPreferenceProperty( aDimDefFlyout, "precision", 9 );
+ addPreference( tr( "PREF_DIMENSIONS_USE_TEXT3D" ), aDimGroupId,
+ LightApp_Preferences::Bool, "Geometry", "dimensions_use_text3d" );
+
int isoGroup = addPreference( tr( "PREF_ISOS" ), tabId );
setPreferenceProperty( isoGroup, "columns", 2 );
int isoU = addPreference( tr( "PREF_ISOS_U" ), isoGroup,
QList<QVariant> aMarkerTypeIndicesList;
QList<QVariant> aMarkerTypeIconsList;
- SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
for ( int i = GEOM::MT_POINT; i < GEOM::MT_USER; i++ ) {
QString icoFile = QString( "ICON_VERTEX_MARKER_%1" ).arg( i );
QPixmap pixmap = resMgr->loadPixmap( "GEOM", tr( qPrintable( icoFile ) ) );
addPreference( tr( "GEOM_PREVIEW" ), operationsGroup,
LightApp_Preferences::Bool, "Geometry", "geom_preview" );
+ addPreference( tr( "PREF_HIDE_INPUT_OBJECT" ), operationsGroup,
+ LightApp_Preferences::Bool, "Geometry", "hide_input_object" );
+
int DependencyViewId = addPreference( tr( "PREF_TAB_DEPENDENCY_VIEW" ) );
int treeGeneralGroup = addPreference( tr( "PREF_GROUP_GENERAL" ), DependencyViewId );
}
else if ( param == QString("dimensions_color") ||
param == QString("dimensions_line_width") ||
- param == QString("dimensions_font_height") ||
+ param == QString("dimensions_font") ||
param == QString("dimensions_arrow_length") ||
param == QString("dimensions_show_units") ||
param == QString("dimensions_length_units") ||
- param == QString("dimensions_angle_units") )
+ param == QString("dimensions_angle_units") ||
+ param == QString("dimensions_use_text3d") ||
+ param == QString("label_color") )
{
SalomeApp_Application* anApp = getApp();
if ( !anApp )
aViewer->GetVisible( aVisible );
aDisplayer.Redisplay( aVisible, false, aViewer );
}
-
+ if ( param == QString( "label_color" ) ) {
+ ViewManagerList aVMsVTK;
+ anApp->viewManagers( SVTK_Viewer::Type(), aVMsVTK );
+ ViewManagerList::Iterator anIt = aVMsVTK.begin();
+ for ( ; anIt != aVMsVTK.end(); ++anIt )
+ {
+ SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>( (*anIt)->getViewModel() );
+ if ( !aViewer )
+ {
+ continue;
+ }
+ SALOME_ListIO aVisible;
+ aViewer->GetVisible( aVisible );
+ aDisplayer.Redisplay( aVisible, false, aViewer );
+ }
+ }
aDisplayer.UpdateViewer();
}
else if ( param.startsWith( "dependency_tree") )
ip->setParameter(entry, param.toStdString(), aProps.value(GEOM::propertyName( GEOM::Vertices )).toString().toStdString());
}
+ if (aProps.contains(GEOM::propertyName( GEOM::ShowName ))) {
+ param = occParam + GEOM::propertyName( GEOM::ShowName );
+ ip->setParameter(entry, param.toStdString(), aProps.value(GEOM::propertyName( GEOM::ShowName )).toString().toStdString());
+ }
+
if (aProps.contains(GEOM::propertyName( GEOM::Deflection ))) {
param = occParam + GEOM::propertyName( GEOM::Deflection );
ip->setParameter(entry, param.toStdString(), aProps.value(GEOM::propertyName( GEOM::Deflection )).toString().toStdString());
aListOfMap[viewIndex].insert( GEOM::propertyName( GEOM::EdgesDirection ), val == "true" || val == "1");
} else if (paramNameStr == GEOM::propertyName( GEOM::Vertices )) {
aListOfMap[viewIndex].insert( GEOM::propertyName( GEOM::Vertices ), val == "true" || val == "1");
+ } else if (paramNameStr == GEOM::propertyName( GEOM::ShowName )) {
+ aListOfMap[viewIndex].insert( GEOM::propertyName( GEOM::ShowName ), val == "true" || val == "1");
} else if (paramNameStr == GEOM::propertyName( GEOM::Deflection )) {
aListOfMap[viewIndex].insert( GEOM::propertyName( GEOM::Deflection ), val.toDouble());
} else if (paramNameStr == GEOM::propertyName( GEOM::PointMarker )) {
}
}
+// Compute current name mode of the viewer
+void UpdateNameMode( SalomeApp_Application* app )
+{
+ bool isMode = false;
+ SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() );
+ SUIT_ViewWindow* viewWindow = app->desktop()->activeWindow();
+ GEOM_Displayer displayer( aStudy );
+ int aMgrId = viewWindow->getViewManager()->getGlobalId();
+
+ SALOME_View* window = displayer.GetActiveView();
+ if ( !window ) return;
+
+ SALOME_ListIO anIOlst;
+ window->GetVisible( anIOlst );
+
+ for ( SALOME_ListIteratorOfListIO It( anIOlst ); It.More(); It.Next() ) {
+ Handle( SALOME_InteractiveObject ) io = It.Value();
+ QVariant v = aStudy->getObjectProperty( aMgrId, io->getEntry(), GEOM::propertyName( GEOM::ShowName ), QVariant() );
+ bool isIONameMode = v.isValid() ? v.toBool() : false;
+ if( isIONameMode )
+ isMode = true;
+ }
+ viewWindow->setProperty( "NameMode", isMode );
+}
+
void GeometryGUI::onViewAboutToShow()
{
SUIT_ViewWindow* window = application()->desktop()->activeWindow();
QAction* a = action( GEOMOp::OpSwitchVectors );
QAction* aVerticesAction = action( GEOMOp::OpSwitchVertices );
+ QAction* aNameAction = action( GEOMOp::OpSwitchName );
if ( window ) {
a->setEnabled(true);
bool vmode = window->property("VectorsMode").toBool();
aVerticesAction->setEnabled(true);
vmode = window->property("VerticesMode").toBool();
aVerticesAction->setText ( vmode == 1 ? tr( "MEN_VERTICES_MODE_OFF" ) : tr("MEN_VERTICES_MODE_ON") );
+ UpdateNameMode( getApp() );
+ aNameAction->setEnabled(true);
+ vmode = window->property("NameMode").toBool();
+ aNameAction->setText ( vmode == 1 ? tr( "MEN_NAME_MODE_OFF" ) : tr("MEN_NAME_MODE_ON") );
} else {
a->setText ( tr("MEN_VECTOR_MODE_ON") );
a->setEnabled(false);
aVerticesAction->setText ( tr("MEN_VERTICES_MODE_ON") );
aVerticesAction->setEnabled(false);
+ aNameAction->setText ( tr("MEN_NAME_MODE_ON") );
+ aNameAction->setEnabled(false);
}
}
// update Object browser
getApp()->updateObjectBrowser( false );
}
+
+void GeometryGUI::emitDimensionsUpdated( QString entry )
+{
+ emit DimensionsUpdated( entry );
+}