Imp: move U/V iso-lines number preferences to the GEOM module plus make them working with VTK viewer also.

This commit is contained in:
vsr 2012-12-17 12:25:01 +00:00
parent 8b6d0798f2
commit c8eae8d292
5 changed files with 48 additions and 19 deletions

View File

@ -62,6 +62,8 @@
<parameter name="isolines_width" value="1" /> <parameter name="isolines_width" value="1" />
<parameter name="preview_edge_width" value="1" /> <parameter name="preview_edge_width" value="1" />
<parameter name="measures_line_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 --> <!-- Input field precisions -->
<parameter name="def_precision" value="3" /> <parameter name="def_precision" value="3" />

View File

@ -665,7 +665,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
// Temporary staff: vertex must be infinite for correct visualization // 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) 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); aPropMap = aStudy->getObjectPropMap(aMgrId,anEntry);
aDefPropMap = getDefaultPropertyMap(SOCC_Viewer::Type()); aDefPropMap = getDefaultPropertyMap(SOCC_Viewer::Type());
Quantity_Color quant_col; Quantity_Color quant_col;
@ -709,17 +709,17 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
aVIsoNumber = uv[1].toInt(); aVIsoNumber = uv[1].toInt();
AISShape->SetTransparency(aPropMap.value(TRANSPARENCY_PROP).toDouble()); AISShape->SetTransparency(aPropMap.value(TRANSPARENCY_PROP).toDouble());
} else { } else {
anUIsoNumber = aResMgr->integerValue("OCCViewer", "iso_number_u", 1); anUIsoNumber = aResMgr->integerValue("Geometry", "iso_number_u", 1);
aVIsoNumber = aResMgr->integerValue("OCCViewer", "iso_number_v", 1); aVIsoNumber = aResMgr->integerValue("Geometry", "iso_number_v", 1);
} }
Handle(Prs3d_IsoAspect) anAspect = AISShape->Attributes()->UIsoAspect(); Handle(Prs3d_IsoAspect) anAspect = AISShape->Attributes()->UIsoAspect();
anAspect->SetNumber( anUIsoNumber ); anAspect->SetNumber( anUIsoNumber );
anAspect->SetColor( aColor ); anAspect->SetColor( aColor );
if(HasIsosWidth()) if(HasIsosWidth())
anAspect->SetWidth( GetIsosWidth() ); anAspect->SetWidth( GetIsosWidth() );
AISShape->Attributes()->SetUIsoAspect( anAspect ); AISShape->Attributes()->SetUIsoAspect( anAspect );
anAspect = AISShape->Attributes()->VIsoAspect(); anAspect = AISShape->Attributes()->VIsoAspect();
anAspect->SetNumber( aVIsoNumber ); anAspect->SetNumber( aVIsoNumber );
if(HasIsosWidth()) if(HasIsosWidth())
@ -1927,17 +1927,10 @@ PropMap GEOM_Displayer::getDefaultPropertyMap(const QString& viewer_type) {
aDefaultMap.insert(VISIBILITY_PROP , 1); aDefaultMap.insert(VISIBILITY_PROP , 1);
//2. Nb Isos //2. Nb Isos
int anUIsoNumber; int anUIsoNumber = aResMgr->integerValue("Geometry", "iso_number_u", 1);
int aVIsoNumber; int aVIsoNumber = aResMgr->integerValue("Geometry", "iso_number_v", 1);
if(viewer_type == SOCC_Viewer::Type()) {
anUIsoNumber = aResMgr->integerValue("OCCViewer", "iso_number_u", 1); QString anIsos = QString("%1%2%3").arg(anUIsoNumber).arg(DIGIT_SEPARATOR).arg(aVIsoNumber);
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);
aDefaultMap.insert(ISOS_PROP , anIsos); aDefaultMap.insert(ISOS_PROP , anIsos);
//3. Transparency //3. Transparency
@ -1973,7 +1966,6 @@ PropMap GEOM_Displayer::getDefaultPropertyMap(const QString& viewer_type) {
//9. Width of the edges //9. Width of the edges
aDefaultMap.insert( EDGE_WIDTH_PROP , aResMgr->integerValue("Geometry", "edge_width", 1)); aDefaultMap.insert( EDGE_WIDTH_PROP , aResMgr->integerValue("Geometry", "edge_width", 1));
//10. Width of iso-lines //10. Width of iso-lines
aDefaultMap.insert( ISOS_WIDTH_PROP , aResMgr->integerValue("Geometry", "isolines_width", 1)); aDefaultMap.insert( ISOS_WIDTH_PROP , aResMgr->integerValue("Geometry", "isolines_width", 1));

View File

@ -3186,6 +3186,18 @@ Please, select face, shell or solid and try again</translation>
<source>PREF_MEASURES_LINE_WIDTH</source> <source>PREF_MEASURES_LINE_WIDTH</source>
<translation>Measures lines width</translation> <translation>Measures lines width</translation>
</message> </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> <message>
<source>PROCESS_SHAPE_NEW_OBJ_NAME</source> <source>PROCESS_SHAPE_NEW_OBJ_NAME</source>
<translation>ProcessShape</translation> <translation>ProcessShape</translation>

View File

@ -3186,6 +3186,18 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
<source>PREF_MEASURES_LINE_WIDTH</source> <source>PREF_MEASURES_LINE_WIDTH</source>
<translation>Epaisseur des traits de mesure</translation> <translation>Epaisseur des traits de mesure</translation>
</message> </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> <message>
<source>PROCESS_SHAPE_NEW_OBJ_NAME</source> <source>PROCESS_SHAPE_NEW_OBJ_NAME</source>
<translation>FormeRetraitee</translation> <translation>FormeRetraitee</translation>

View File

@ -1770,6 +1770,17 @@ void GeometryGUI::createPreferences()
setPreferenceProperty( wd[i], "max", 5 ); 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 // Quantities with individual precision settings
int precGroup = addPreference( tr( "GEOM_PREF_GROUP_PRECISION" ), tabId ); int precGroup = addPreference( tr( "GEOM_PREF_GROUP_PRECISION" ), tabId );
setPreferenceProperty( precGroup, "columns", 2 ); setPreferenceProperty( precGroup, "columns", 2 );