]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Imp: move U/V iso-lines number preferences to the GEOM module plus make them working...
authorvsr <vsr@opencascade.com>
Mon, 17 Dec 2012 12:25:01 +0000 (12:25 +0000)
committervsr <vsr@opencascade.com>
Mon, 17 Dec 2012 12:25:01 +0000 (12:25 +0000)
resources/SalomeApp.xml.in
src/GEOMGUI/GEOM_Displayer.cxx
src/GEOMGUI/GEOM_msg_en.ts
src/GEOMGUI/GEOM_msg_fr.ts
src/GEOMGUI/GeometryGUI.cxx

index 6fb716e5a28cfe396415b36b47648265daa4b705..83ef31de5ec1d2ea9e1126a0bfb3a1ee275a0cae 100644 (file)
@@ -62,6 +62,8 @@
     <parameter name="isolines_width"      value="1" />
     <parameter name="preview_edge_width"  value="1" />
     <parameter name="measures_line_width" value="1" />
+    <parameter name="iso_number_u"        value="1" />
+    <parameter name="iso_number_v"        value="1" />
 
     <!-- Input field precisions -->
     <parameter name="def_precision"       value="3"  />
index 1718d7d0bd808753e6755c39ce8a57274f8e5c31..50dac6d681d79e645ee232c895197f622ec649f5 100644 (file)
@@ -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));
 
index 4b0d81c5ce0873c522fe54a9c675f6cebecca2b3..9abe92cbc542ee0ccd91e984f902c8ab62a7a7a2 100644 (file)
@@ -3186,6 +3186,18 @@ Please, select face, shell or solid and try again</translation>
         <source>PREF_MEASURES_LINE_WIDTH</source>
         <translation>Measures lines width</translation>
     </message>
+    <message>
+        <source>PREF_ISOS</source>
+        <translation>Number of isolines</translation>
+    </message>
+    <message>
+        <source>PREF_ISOS_U</source>
+        <translation>Along U</translation>
+    </message>
+    <message>
+        <source>PREF_ISOS_V</source>
+        <translation>Along V</translation>
+    </message>
     <message>
         <source>PROCESS_SHAPE_NEW_OBJ_NAME</source>
         <translation>ProcessShape</translation>
index 81d5072c6818abd543cab4b26fe64c05f8bfc715..b423af0621421e3500d667c4ca954ffd285c7742 100644 (file)
@@ -3186,6 +3186,18 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>PREF_MEASURES_LINE_WIDTH</source>
         <translation>Epaisseur des traits de mesure</translation>
     </message>
+    <message>
+        <source>PREF_ISOS</source>
+        <translation>Nombre d&apos;isolignes</translation>
+    </message>
+    <message>
+        <source>PREF_ISOS_U</source>
+        <translation>Selon U</translation>
+    </message>
+    <message>
+        <source>PREF_ISOS_V</source>
+        <translation>Selon V</translation>
+    </message>
     <message>
         <source>PROCESS_SHAPE_NEW_OBJ_NAME</source>
         <translation>FormeRetraitee</translation>
index 0242a87613b987367d2202f74925cca4aaaebf95..262efef7f6d855a78a7c6b85f25c989ca4ff0921 100644 (file)
@@ -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<QVariant> aMarkerTypeIndicesList;
   QList<QVariant> aMarkerTypeIconsList;