X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_PropertiesDlg.cxx;h=dbf2e168c2849779da4b9db153b487ef986c7df4;hp=1e9874b086c3fc7e31850c782d3469be331f2415;hb=HEAD;hpb=f5016d85b7b4b88623723027a1585c6414c4dc66 diff --git a/src/SMESHGUI/SMESHGUI_PropertiesDlg.cxx b/src/SMESHGUI/SMESHGUI_PropertiesDlg.cxx index 1e9874b08..da92ec1c1 100644 --- a/src/SMESHGUI/SMESHGUI_PropertiesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_PropertiesDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -155,23 +156,27 @@ SMESHGUI_PropertiesDlg::SMESHGUI_PropertiesDlg( const VTK::MarkerMap& customMark myBallGrp = new QGroupBox( tr( "BALLS" ), mainFrame() ); QLabel* ballColorLab = new QLabel( tr( "COLOR" ), myBallGrp ); myBallColor = new QtxColorButton( myBallGrp ); - QLabel* ballSizeLab = new QLabel( tr( "SIZE" ), myBallGrp ); - myBallSize = new QtxIntSpinBox( myBallGrp ); + // QLabel* ballSizeLab = new QLabel( tr( "SIZE" ), myBallGrp ); + // myBallSize = new QtxIntSpinBox( myBallGrp ); + QLabel* ballScaleLab = new QLabel( tr( "SCALE_FACTOR" ), myBallGrp ); + myBallScale = new QtxDoubleSpinBox( 1e-2, 1e7, 0.5, myBallGrp ); hl = new QHBoxLayout( myBallGrp ); hl->setMargin( MARGIN ); hl->setSpacing( SPACING ); hl->addWidget( ballColorLab ); hl->addWidget( myBallColor ); - hl->addWidget( ballSizeLab ); - hl->addWidget( myBallSize ); + // hl->addWidget( ballSizeLab ); + // hl->addWidget( myBallSize ); + hl->addWidget( ballScaleLab ); + hl->addWidget( myBallScale ); widthLab1 = qMax( widthLab1, ballColorLab->minimumSizeHint().width() ); - widthLab2 = qMax( widthLab2, ballSizeLab->minimumSizeHint().width() ); + // widthLab2 = qMax( widthLab2, ballSizeLab->minimumSizeHint().width() ); // -- orientation vector controls myOrientationGrp = new QGroupBox( tr( "ORIENTATIONS" ), mainFrame() ); QLabel* orientationColorLab = new QLabel( tr( "COLOR" ), myOrientationGrp ); myOrientationColor = new QtxColorButton( myOrientationGrp ); - QLabel* orientationScaleLab = new QLabel( tr( "ORIENTATION_SCALE" ), myOrientationGrp ); + QLabel* orientationScaleLab = new QLabel( tr( "SCALE_FACTOR" ), myOrientationGrp ); myOrientationSize = new QtxIntSpinBox( myOrientationGrp ); myOrientationSize->setSuffix( "% "); myOrientation3d = new QCheckBox( tr("ORIENTATION_3D"), myOrientationGrp ); @@ -229,20 +234,21 @@ SMESHGUI_PropertiesDlg::SMESHGUI_PropertiesDlg( const VTK::MarkerMap& customMark myVolumeColor->label()->setMinimumWidth( widthLab2 ); outlineWidthLab->setMinimumWidth( widthLab2 ); elem0dSizeLab->setMinimumWidth( widthLab2 ); - ballSizeLab->setMinimumWidth( widthLab2 ); + // ballSizeLab->setMinimumWidth( widthLab2 ); orientationScaleLab->setMinimumWidth( widthLab2 ); myEdgeWidth->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); myOutlineWidth->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); myElem0dSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - myBallSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + // myBallSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + myBallScale->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); myOrientationSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); myShrinkSize->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); // initialize widgets myNodeMarker->setCustomMarkers( customMarkers ); myElem0dSize->setRange( 1, 10 ); - myBallSize->setRange( 1, 10 ); + // myBallSize->setRange( 1, 10 ); myEdgeWidth->setRange( 1, 5 ); myOutlineWidth->setRange( 1, 5 ); myShrinkSize->setRange( 20, 100 ); @@ -516,18 +522,36 @@ QColor SMESHGUI_PropertiesDlg::ballColor() const \brief Set discrete elements (balls) size \param size discrete elements (balls) size */ -void SMESHGUI_PropertiesDlg::setBallSize( int size ) +/*void SMESHGUI_PropertiesDlg::setBallSize( int size ) { myBallSize->setValue( size ); -} +}*/ /*! \brief Get discrete elements (balls) size \return current discrete elements (balls) size */ -int SMESHGUI_PropertiesDlg::ballSize() const +/*int SMESHGUI_PropertiesDlg::ballSize() const { return myBallSize->value(); +}*/ + +/*! + \brief Set discrete elements (balls) scale factor + \param size discrete elements (balls) scale factor +*/ +void SMESHGUI_PropertiesDlg::setBallScale( double size ) +{ + myBallScale->setValue( size ); +} + +/*! + \brief Get discrete elements (balls) scale factor + \return current discrete elements (balls) scale factor +*/ +double SMESHGUI_PropertiesDlg::ballScale() const +{ + return myBallScale->value(); } /*! @@ -621,8 +645,8 @@ void SMESHGUI_PropertiesDlg::showControls( int elements, bool nodes ) // node controls are supposed to be shown if at least any element type is present // or if there are only nodes myNodeGrp->setVisible( nodes || elements & SMESH_Actor::eAllEntity ); - // edge controls are shown only if there are edges - myEdgeGrp->setVisible( elements & SMESH_Actor::eEdges ); + // edge/wireframe controls are needed for edges, faces and volumes + myEdgeGrp->setVisible( elements & ( SMESH_Actor::eEdges | SMESH_Actor::eFaces | SMESH_Actor::eVolumes ) ); // face controls are shown only if there are faces myFaceGrp->setVisible( elements & SMESH_Actor::eFaces ); // volume controls are shown only if there are volumes @@ -645,5 +669,5 @@ void SMESHGUI_PropertiesDlg::showControls( int elements, bool nodes ) void SMESHGUI_PropertiesDlg::onHelp() { LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); - app->onHelpContextModule( "SMESH", "colors_size_page.html" ); + app->onHelpContextModule( "SMESH", "colors_size.html" ); }