From c8eae8d292a0e5d01136486e9f39158e8102c470 Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 17 Dec 2012 12:25:01 +0000 Subject: [PATCH] Imp: move U/V iso-lines number preferences to the GEOM module plus make them working with VTK viewer also. --- resources/SalomeApp.xml.in | 2 ++ src/GEOMGUI/GEOM_Displayer.cxx | 28 ++++++++++------------------ src/GEOMGUI/GEOM_msg_en.ts | 12 ++++++++++++ src/GEOMGUI/GEOM_msg_fr.ts | 12 ++++++++++++ src/GEOMGUI/GeometryGUI.cxx | 13 ++++++++++++- 5 files changed, 48 insertions(+), 19 deletions(-) diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in index 6fb716e5a..83ef31de5 100644 --- a/resources/SalomeApp.xml.in +++ b/resources/SalomeApp.xml.in @@ -62,6 +62,8 @@ + + diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 1718d7d0b..50dac6d68 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -665,7 +665,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs ) // Temporary staff: vertex must be infinite for correct visualization AISShape->SetInfiniteState( myShape.Infinite() ); // || myShape.ShapeType() == TopAbs_VERTEX // VSR: 05/04/2010: Fix 20668 (Fit All for points & lines) - if(useStudy){ + if(useStudy) { aPropMap = aStudy->getObjectPropMap(aMgrId,anEntry); aDefPropMap = getDefaultPropertyMap(SOCC_Viewer::Type()); Quantity_Color quant_col; @@ -706,20 +706,20 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs ) QString anIsos = aPropMap.value(ISOS_PROP).toString(); QStringList uv = anIsos.split(DIGIT_SEPARATOR); anUIsoNumber = uv[0].toInt(); - aVIsoNumber = uv[1].toInt(); + aVIsoNumber = uv[1].toInt(); AISShape->SetTransparency(aPropMap.value(TRANSPARENCY_PROP).toDouble()); } else { - anUIsoNumber = aResMgr->integerValue("OCCViewer", "iso_number_u", 1); - aVIsoNumber = aResMgr->integerValue("OCCViewer", "iso_number_v", 1); + anUIsoNumber = aResMgr->integerValue("Geometry", "iso_number_u", 1); + aVIsoNumber = aResMgr->integerValue("Geometry", "iso_number_v", 1); } - + Handle(Prs3d_IsoAspect) anAspect = AISShape->Attributes()->UIsoAspect(); anAspect->SetNumber( anUIsoNumber ); anAspect->SetColor( aColor ); - if(HasIsosWidth()) anAspect->SetWidth( GetIsosWidth() ); AISShape->Attributes()->SetUIsoAspect( anAspect ); + anAspect = AISShape->Attributes()->VIsoAspect(); anAspect->SetNumber( aVIsoNumber ); if(HasIsosWidth()) @@ -1927,17 +1927,10 @@ PropMap GEOM_Displayer::getDefaultPropertyMap(const QString& viewer_type) { aDefaultMap.insert(VISIBILITY_PROP , 1); //2. Nb Isos - int anUIsoNumber; - int aVIsoNumber; - if(viewer_type == SOCC_Viewer::Type()) { - anUIsoNumber = aResMgr->integerValue("OCCViewer", "iso_number_u", 1); - aVIsoNumber = aResMgr->integerValue("OCCViewer", "iso_number_v", 1); - } else if( viewer_type==SVTK_Viewer::Type()) { - anUIsoNumber = aResMgr->integerValue("VTKViewer", "iso_number_u", 1); - aVIsoNumber = aResMgr->integerValue("VTKViewer", "iso_number_u", 1); - } - QString anIsos("%1%2%3"); - anIsos = anIsos.arg(anUIsoNumber);anIsos = anIsos.arg(DIGIT_SEPARATOR);anIsos = anIsos.arg(aVIsoNumber); + int anUIsoNumber = aResMgr->integerValue("Geometry", "iso_number_u", 1); + int aVIsoNumber = aResMgr->integerValue("Geometry", "iso_number_v", 1); + + QString anIsos = QString("%1%2%3").arg(anUIsoNumber).arg(DIGIT_SEPARATOR).arg(aVIsoNumber); aDefaultMap.insert(ISOS_PROP , anIsos); //3. Transparency @@ -1973,7 +1966,6 @@ PropMap GEOM_Displayer::getDefaultPropertyMap(const QString& viewer_type) { //9. Width of the edges aDefaultMap.insert( EDGE_WIDTH_PROP , aResMgr->integerValue("Geometry", "edge_width", 1)); - //10. Width of iso-lines aDefaultMap.insert( ISOS_WIDTH_PROP , aResMgr->integerValue("Geometry", "isolines_width", 1)); diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index 4b0d81c5c..9abe92cbc 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -3186,6 +3186,18 @@ Please, select face, shell or solid and try again PREF_MEASURES_LINE_WIDTH Measures lines width + + PREF_ISOS + Number of isolines + + + PREF_ISOS_U + Along U + + + PREF_ISOS_V + Along V + PROCESS_SHAPE_NEW_OBJ_NAME ProcessShape diff --git a/src/GEOMGUI/GEOM_msg_fr.ts b/src/GEOMGUI/GEOM_msg_fr.ts index 81d5072c6..b423af062 100644 --- a/src/GEOMGUI/GEOM_msg_fr.ts +++ b/src/GEOMGUI/GEOM_msg_fr.ts @@ -3186,6 +3186,18 @@ Choisissez une face, une coque ou un solide et essayez de nouveau PREF_MEASURES_LINE_WIDTH Epaisseur des traits de mesure + + PREF_ISOS + Nombre d'isolignes + + + PREF_ISOS_U + Selon U + + + PREF_ISOS_V + Selon V + PROCESS_SHAPE_NEW_OBJ_NAME FormeRetraitee diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 0242a8761..262efef7f 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -1769,6 +1769,17 @@ void GeometryGUI::createPreferences() setPreferenceProperty( wd[i], "min", 1 ); setPreferenceProperty( wd[i], "max", 5 ); } + + int isoGroup = addPreference( tr( "PREF_ISOS" ), tabId ); + setPreferenceProperty( isoGroup, "columns", 2 ); + int isoU = addPreference( tr( "PREF_ISOS_U" ), isoGroup, + LightApp_Preferences::IntSpin, "Geometry", "iso_number_u" ); + setPreferenceProperty( isoU, "min", 0 ); + setPreferenceProperty( isoU, "max", 100000 ); + int isoV = addPreference( tr( "PREF_ISOS_V" ), isoGroup, + LightApp_Preferences::IntSpin, "Geometry", "iso_number_v" ); + setPreferenceProperty( isoV, "min", 0 ); + setPreferenceProperty( isoV, "max", 100000 ); // Quantities with individual precision settings int precGroup = addPreference( tr( "GEOM_PREF_GROUP_PRECISION" ), tabId ); @@ -1855,7 +1866,7 @@ void GeometryGUI::createPreferences() // Set property for default material Material_ResourceMgr aMatResMgr; setPreferenceProperty( material, "strings", aMatResMgr.materials() ); - + // Set property vertex marker type QList aMarkerTypeIndicesList; QList aMarkerTypeIconsList; -- 2.39.2