mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-24 16:30:35 +05:00
0022618: [CEA 1062] Define the transparency by default in the preferences
This commit is contained in:
parent
3866909ccc
commit
a0e22ed86a
Binary file not shown.
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 89 KiB |
@ -33,8 +33,7 @@ default color for edges, vectors and wires (isolated lines).</li>
|
||||
vertices.</li>
|
||||
<li><b>Color of isolines</b> - allows to select default color for
|
||||
isolines.</li>
|
||||
<li><b>Step value for spin boxes</b> - allows to define the increment
|
||||
of values set in spin boxes.</li>
|
||||
<li><b>Transparency</b> - allows to define default transparency value.</li>
|
||||
<li><b>Deflection coefficient</b> - allows to define default deflection
|
||||
coefficient for lines and surfaces. A smaller coefficient provides
|
||||
better quality of a shape in the viewer.</li>
|
||||
@ -46,6 +45,8 @@ predefined materials.</li>
|
||||
<li><b>Isolines width</b> - allows to define default width of the isolines.</li>
|
||||
<li><b>Preview edges width</b> - allows to define width of the edges for preview.</li>
|
||||
<li><b>Measures line width</b> - allows to define lines width of measurements tools.</li>
|
||||
<li><b>Step value for spin boxes</b> - allows to define the increment
|
||||
of values set in spin boxes.</li>
|
||||
<li><b>Automatic bring to front</b> - when the option is on, the objects selected by the user automatically become "top-level".</li>
|
||||
|
||||
</ul>
|
||||
|
@ -44,6 +44,7 @@
|
||||
<!-- Other module preferences -->
|
||||
<parameter name="SettingsGeomStep" value="10" />
|
||||
<parameter name="display_mode" value="2" />
|
||||
<parameter name="transparency" value="0" />
|
||||
<parameter name="shading_color" value="#a7a7a7" />
|
||||
<parameter name="edges_in_shading_color" value="#000000" />
|
||||
<parameter name="wireframe_color" value="255, 255, 0" />
|
||||
|
@ -508,6 +508,9 @@ GEOM_Displayer::GEOM_Displayer( SalomeApp_Study* st )
|
||||
myWidth = resMgr->integerValue("Geometry", "edge_width", -1);
|
||||
myIsosWidth = resMgr->integerValue("Geometry", "isolines_width", -1);
|
||||
|
||||
myTransparency = resMgr->integerValue("Geometry", "transparency", 0) / 100.;
|
||||
myHasTransparency = false;
|
||||
|
||||
myTypeOfMarker = (Aspect_TypeOfMarker)(std::min((int)Aspect_TOM_RING3, std::max((int)Aspect_TOM_POINT, aType)));
|
||||
myScaleOfMarker = (resMgr->integerValue("Geometry", "marker_scale", 1)-(int)GEOM::MS_10)*0.5 + 1.0;
|
||||
myScaleOfMarker = std::min(7.0, std::max(1., myScaleOfMarker));
|
||||
@ -519,7 +522,6 @@ GEOM_Displayer::GEOM_Displayer( SalomeApp_Study* st )
|
||||
|
||||
myWidth = -1;
|
||||
myType = -1;
|
||||
myTransparency = -1.0;
|
||||
myToActivate = true;
|
||||
// This parameter is used for activisation/deactivisation of objects to be displayed
|
||||
|
||||
@ -2057,24 +2059,54 @@ void GEOM_Displayer::UnsetColor()
|
||||
* Set transparency for shape displaying.
|
||||
*/
|
||||
//=================================================================
|
||||
void GEOM_Displayer::SetTransparency( const double transparency )
|
||||
double GEOM_Displayer::SetTransparency( const double transparency )
|
||||
{
|
||||
myTransparency = transparency;
|
||||
double aPrevTransparency = myTransparency;
|
||||
if ( transparency < 0 ) {
|
||||
UnsetTransparency();
|
||||
}
|
||||
else {
|
||||
myTransparency = transparency;
|
||||
myHasTransparency = true;
|
||||
}
|
||||
return aPrevTransparency;
|
||||
}
|
||||
|
||||
//=================================================================
|
||||
/*!
|
||||
* GEOM_Displayer::GetTransparency
|
||||
* Get transparency for shape displaying.
|
||||
*/
|
||||
//=================================================================
|
||||
double GEOM_Displayer::GetTransparency() const
|
||||
{
|
||||
return myTransparency;
|
||||
}
|
||||
|
||||
//=================================================================
|
||||
/*!
|
||||
* GEOM_Displayer::HasTransparency
|
||||
* Check if transparency for shape displaying is set.
|
||||
*/
|
||||
//=================================================================
|
||||
bool GEOM_Displayer::HasTransparency() const
|
||||
{
|
||||
return myTransparency != -1.0;
|
||||
return myHasTransparency;
|
||||
}
|
||||
|
||||
void GEOM_Displayer::UnsetTransparency()
|
||||
//=================================================================
|
||||
/*!
|
||||
* GEOM_Displayer::UnsetTransparency
|
||||
* Unset transparency for shape displaying.
|
||||
*/
|
||||
//=================================================================
|
||||
double GEOM_Displayer::UnsetTransparency()
|
||||
{
|
||||
myTransparency = -1.0;
|
||||
double aPrevTransparency = myTransparency;
|
||||
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
||||
myTransparency = resMgr->integerValue("Geometry", "transparency", 0) / 100.;
|
||||
myHasTransparency = false;
|
||||
return aPrevTransparency;
|
||||
}
|
||||
|
||||
|
||||
@ -2452,7 +2484,8 @@ PropMap GEOM_Displayer::getDefaultPropertyMap()
|
||||
arg( resMgr->integerValue( "Geometry", "iso_number_v", 1 ) ) );
|
||||
|
||||
// - transparency (opacity = 1-transparency)
|
||||
propMap.insert( GEOM::propertyName( GEOM::Transparency ), 0.0 );
|
||||
propMap.insert( GEOM::propertyName( GEOM::Transparency ),
|
||||
resMgr->integerValue( "Geometry", "transparency", 0 ) / 100. );
|
||||
|
||||
// - display mode (take default value from preferences)
|
||||
propMap.insert( GEOM::propertyName( GEOM::DisplayMode ),
|
||||
|
@ -139,8 +139,8 @@ public:
|
||||
int GetColor () const;
|
||||
bool HasColor () const;
|
||||
|
||||
void SetTransparency ( const double );
|
||||
void UnsetTransparency();
|
||||
double SetTransparency ( const double );
|
||||
double UnsetTransparency();
|
||||
double GetTransparency () const;
|
||||
bool HasTransparency () const;
|
||||
|
||||
@ -294,6 +294,7 @@ protected:
|
||||
Aspect_TypeOfMarker myTypeOfMarker;
|
||||
double myScaleOfMarker;
|
||||
double myTransparency;
|
||||
bool myHasTransparency;
|
||||
|
||||
private:
|
||||
SalomeApp_Application* myApp;
|
||||
|
@ -3148,6 +3148,10 @@ Please, select face, shell or solid and try again</translation>
|
||||
<source>PREF_DISPLAY_MODE</source>
|
||||
<translation>Default display mode</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>PREF_TRANSPARENCY</source>
|
||||
<translation>Transparency</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>PREF_FREE_BOUND_COLOR</source>
|
||||
<translation>Color of free boundaries</translation>
|
||||
|
@ -3152,6 +3152,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
||||
<source>PREF_DISPLAY_MODE</source>
|
||||
<translation>Mode de visualisation</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>PREF_TRANSPARENCY</source>
|
||||
<translation>Transparence</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>PREF_FREE_BOUND_COLOR</source>
|
||||
<translation>Couleur des contours libres</translation>
|
||||
|
@ -3143,6 +3143,10 @@
|
||||
<source>PREF_DISPLAY_MODE</source>
|
||||
<translation>表示モード</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>PREF_TRANSPARENCY</source>
|
||||
<translation>透明度</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>PREF_FREE_BOUND_COLOR</source>
|
||||
<translation>自由境界の色</translation>
|
||||
|
@ -2338,8 +2338,8 @@ void GeometryGUI::createPreferences()
|
||||
int top_lev_dm = addPreference( tr( "PREF_TOPLEVEL_DM" ), genGroup,
|
||||
LightApp_Preferences::Selector, "Geometry", "toplevel_dm" );
|
||||
|
||||
int step = addPreference( tr( "PREF_STEP_VALUE" ), genGroup,
|
||||
LightApp_Preferences::IntSpin, "Geometry", "SettingsGeomStep" );
|
||||
int transparency = addPreference( tr( "PREF_TRANSPARENCY" ), genGroup,
|
||||
LightApp_Preferences::IntSpin, "Geometry", "transparency" );
|
||||
|
||||
int defl = addPreference( tr( "PREF_DEFLECTION" ), genGroup,
|
||||
LightApp_Preferences::DblSpin, "Geometry", "deflection_coeff" );
|
||||
@ -2375,6 +2375,9 @@ void GeometryGUI::createPreferences()
|
||||
setPreferenceProperty( wd[i], "max", 5 );
|
||||
}
|
||||
|
||||
int step = addPreference( tr( "PREF_STEP_VALUE" ), genGroup,
|
||||
LightApp_Preferences::IntSpin, "Geometry", "SettingsGeomStep" );
|
||||
|
||||
addPreference( tr( "PREF_AUTO_BRING_TO_FRONT" ), genGroup,
|
||||
LightApp_Preferences::Bool, "Geometry", "auto_bring_to_front" );
|
||||
|
||||
@ -2523,6 +2526,10 @@ void GeometryGUI::createPreferences()
|
||||
setPreferenceProperty( step, "max", 10000 );
|
||||
setPreferenceProperty( step, "precision", 3 );
|
||||
|
||||
// Set property for trandparency value for spinboxes
|
||||
setPreferenceProperty( transparency, "min", 0 );
|
||||
setPreferenceProperty( transparency, "max", 100 );
|
||||
|
||||
// Set property for deflection value for spinboxes
|
||||
setPreferenceProperty( defl, "min", GEOM::minDeflection() );
|
||||
setPreferenceProperty( defl, "max", 1.0 );
|
||||
|
Loading…
Reference in New Issue
Block a user