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>
<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>
<!-- 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" />
int aType = resMgr->integerValue("Geometry", "type_of_marker", (int)Aspect_TOM_PLUS);
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;
myWidth = -1;
myType = -1;
- myTransparency = -1.0;
myToActivate = true;
// This parameter is used for activisation/deactivisation of objects to be displayed
* 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;
}
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 ),
int GetColor () const;
bool HasColor () const;
- void SetTransparency ( const double );
- void UnsetTransparency();
+ double SetTransparency ( const double );
+ double UnsetTransparency();
double GetTransparency () const;
bool HasTransparency () const;
Aspect_TypeOfMarker myTypeOfMarker;
double myScaleOfMarker;
double myTransparency;
+ bool myHasTransparency;
private:
SalomeApp_Application* myApp;
<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>
<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>
<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>
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" );
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" );
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 );