mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-18 17:00:40 +05:00
Merge from BR_WIN_INDUS_514 branch 21/03/2011 (Windows industrialization)
This commit is contained in:
parent
74ccd03bbb
commit
a4c7964a28
Binary file not shown.
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 7.7 KiB |
@ -3,14 +3,18 @@
|
|||||||
\page transparency_page Transparency
|
\page transparency_page Transparency
|
||||||
|
|
||||||
\n You can change the transparency of a shape in the range between 0%
|
\n You can change the transparency of a shape in the range between 0%
|
||||||
(absolutely transparent and thus invisible) and 100% (absolutely opaque)
|
(absolutely opaque) and 100% (absolutely transparent and thus invisible)
|
||||||
in the following dialog box.
|
in the following dialog box.
|
||||||
|
|
||||||
\image html neo-transparency.png
|
\image html neo-transparency.png
|
||||||
|
|
||||||
or using a <b>TUI Command:</b> <em>gg.setTransparency(ID, Double)</em>
|
or using a <b>TUI Command:</b> <em>gg.setTransparency(ID, Value)</em>
|
||||||
|
|
||||||
\n <b>Examples:</b>
|
where
|
||||||
|
- <em>ID</em> is an object ID (entry)
|
||||||
|
- <em>Value</em> is a transparency value in range [0-1]; 0 means fully opaque, 1 means fully transparent
|
||||||
|
|
||||||
|
<b>Examples:</b>
|
||||||
|
|
||||||
\image html colorsn.png
|
\image html colorsn.png
|
||||||
<center><em>Opaque</em></center>
|
<center><em>Opaque</em></center>
|
||||||
|
@ -97,8 +97,8 @@ GEOMToolsGUI_TransparencyDlg::GEOMToolsGUI_TransparencyDlg( QWidget* parent )
|
|||||||
GroupC1Layout->setMargin( 11 );
|
GroupC1Layout->setMargin( 11 );
|
||||||
|
|
||||||
QLabel* TextLabelTransparent = new QLabel( tr( "GEOM_TRANSPARENCY_TRANSPARENT" ), GroupC1 );
|
QLabel* TextLabelTransparent = new QLabel( tr( "GEOM_TRANSPARENCY_TRANSPARENT" ), GroupC1 );
|
||||||
TextLabelTransparent->setAlignment( Qt::AlignRight );
|
TextLabelTransparent->setAlignment( Qt::AlignLeft );
|
||||||
GroupC1Layout->addWidget( TextLabelTransparent, 0, 0 );
|
GroupC1Layout->addWidget( TextLabelTransparent, 0, 2 );
|
||||||
|
|
||||||
myValueLab = new QLabel( GroupC1 );
|
myValueLab = new QLabel( GroupC1 );
|
||||||
myValueLab->setAlignment( Qt::AlignCenter );
|
myValueLab->setAlignment( Qt::AlignCenter );
|
||||||
@ -107,8 +107,8 @@ GEOMToolsGUI_TransparencyDlg::GEOMToolsGUI_TransparencyDlg( QWidget* parent )
|
|||||||
GroupC1Layout->addWidget( myValueLab, 0, 1 );
|
GroupC1Layout->addWidget( myValueLab, 0, 1 );
|
||||||
|
|
||||||
QLabel* TextLabelOpaque = new QLabel( tr( "GEOM_TRANSPARENCY_OPAQUE" ), GroupC1 );
|
QLabel* TextLabelOpaque = new QLabel( tr( "GEOM_TRANSPARENCY_OPAQUE" ), GroupC1 );
|
||||||
TextLabelOpaque->setAlignment( Qt::AlignLeft );
|
TextLabelOpaque->setAlignment( Qt::AlignRight );
|
||||||
GroupC1Layout->addWidget( TextLabelOpaque, 0, 2 );
|
GroupC1Layout->addWidget( TextLabelOpaque, 0, 0 );
|
||||||
//GroupC1Layout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
|
//GroupC1Layout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
|
||||||
|
|
||||||
mySlider = new QSlider( Qt::Horizontal, GroupC1 );
|
mySlider = new QSlider( Qt::Horizontal, GroupC1 );
|
||||||
@ -242,7 +242,7 @@ void GEOMToolsGUI_TransparencyDlg::SliderHasMoved(int value)
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GEOMToolsGUI_TransparencyDlg::SetTransparency()
|
void GEOMToolsGUI_TransparencyDlg::SetTransparency()
|
||||||
{
|
{
|
||||||
float newValue = ( 100 - mySlider->value() ) / 100.;
|
float newValue = mySlider->value() / 100.;
|
||||||
|
|
||||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
||||||
if ( !app )
|
if ( !app )
|
||||||
@ -276,7 +276,7 @@ void GEOMToolsGUI_TransparencyDlg::SetTransparency()
|
|||||||
SVTK_View* aView = vtkVW->getView();
|
SVTK_View* aView = vtkVW->getView();
|
||||||
if ( myFirstInit ) {
|
if ( myFirstInit ) {
|
||||||
myFirstInit = false;
|
myFirstInit = false;
|
||||||
int transp = int (100 - ((aView->GetTransparency(FirstIOS))*100.0) + 0.5);
|
int transp = int ((aView->GetTransparency(FirstIOS))*100.0 + 0.5);
|
||||||
mySlider->setValue(transp);
|
mySlider->setValue(transp);
|
||||||
ValueHasChanged();
|
ValueHasChanged();
|
||||||
return;
|
return;
|
||||||
@ -300,7 +300,7 @@ void GEOMToolsGUI_TransparencyDlg::SetTransparency()
|
|||||||
aisShape = gb->ConvertIOinGEOMAISShape( FirstIOS, true );
|
aisShape = gb->ConvertIOinGEOMAISShape( FirstIOS, true );
|
||||||
if( aisShape.IsNull() )
|
if( aisShape.IsNull() )
|
||||||
return;
|
return;
|
||||||
int transp = int( 100 - ( aisShape->Transparency() * 100.0 ) + 0.5);
|
int transp = int( aisShape->Transparency() * 100.0 + 0.5);
|
||||||
mySlider->setValue(transp);
|
mySlider->setValue(transp);
|
||||||
ValueHasChanged();
|
ValueHasChanged();
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user