From: ouv Date: Fri, 16 Dec 2005 09:07:55 +0000 (+0000) Subject: Fixed bug GVIEW10814 : size of the cursor is not modified when changing the magnification X-Git-Tag: TG-D5-38-2003_D2005-20-12~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1d65643cf6abac16ddf20976d33e9a1c989b4587;p=modules%2Fvisu.git Fixed bug GVIEW10814 : size of the cursor is not modified when changing the magnification --- diff --git a/src/VISUGUI/VISUM_msg_en.po b/src/VISUGUI/VISUM_msg_en.po index 59fdedf4..4f3467bb 100644 --- a/src/VISUGUI/VISUM_msg_en.po +++ b/src/VISUGUI/VISUM_msg_en.po @@ -130,6 +130,9 @@ msgstr "Uniform Color" msgid "VisuGUI_Module::VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL" msgstr "Inside Cursor Gauss Points" +msgid "VisuGUI_Module::VISU_GAUSS_PREF_MAGNIFICATION_GROUP_TTL" +msgstr "Magnification (Inside & Outside)" + msgid "VisuGUI_Module::VISU_GAUSS_PREF_COLOR_GROUP_TTL" msgstr "Color" @@ -139,6 +142,9 @@ msgstr "Picking" msgid "VisuGUI_Module::VISU_PICKING_PREF_CURSOR_GROUP_TTL" msgstr "Cursor" +msgid "VisuGUI_Module::VISU_PICKING_PREF_CURSOR_SIZE" +msgstr "Size of the cursor" + msgid "VisuGUI_Module::VISU_PICKING_PREF_PYRAMID_HEIGHT" msgstr "Height of the pyramids" @@ -413,16 +419,16 @@ msgid "VVTK_MainWindow1::DSC_VVTK_SELECTION_MODE_SWITCH" msgstr "Selection Mode Switch" msgid "VVTK_MainWindow1::MNU_VVTK_PLANE_SEGMENTATION_SWITCH" -msgstr "Plane Segmentation Switch" +msgstr "Plane Segmentation" msgid "VVTK_MainWindow1::DSC_VVTK_PLANE_SEGMENTATION_SWITCH" -msgstr "Plane Segmentation Switch" +msgstr "Plane Segmentation" msgid "VVTK_MainWindow1::MNU_VVTK_SPHERE_SEGMENTATION_SWITCH" -msgstr "Sphere Segmentation Switch" +msgstr "Sphere Segmentation" msgid "VVTK_MainWindow1::DSC_VVTK_SPHERE_SEGMENTATION_SWITCH" -msgstr "Sphere Segmentation Switch" +msgstr "Sphere Segmentation" msgid "VVTK_PrimitiveBox::PRIMITIVE_TITLE" msgstr "Primitive" @@ -670,6 +676,9 @@ msgstr "Picking" msgid "VVTK_PickingDlg::CURSOR_TITLE" msgstr "Cursor" +msgid "VVTK_PickingDlg::CURSOR_SIZE" +msgstr "Size of the cursor :" + msgid "VVTK_PickingDlg::PYRAMID_HEIGHT" msgstr "Height of the pyramids :" diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index 4c5f00e2..c4b88674 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -522,12 +522,15 @@ VisuGUI_Module setPreferenceProperty( maxSizePref, "min", 1 ); setPreferenceProperty( maxSizePref, "max", 100 ); - int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), sizeGr, + int magnificationGr = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION_GROUP_TTL" ), insideCursorTab ); + setPreferenceProperty( magnificationGr, "columns", 2 ); + + int magnificationPref = addPreference( tr( "VISU_GAUSS_PREF_MAGNIFICATION" ), magnificationGr, LightApp_Preferences::IntSpin, "VISU", "inside_point_sprite_magnification" ); setPreferenceProperty( magnificationPref, "min", 10 ); setPreferenceProperty( magnificationPref, "max", 1000 ); - int incrementPref = addPreference( tr( "VISU_GAUSS_PREF_INCREMENT" ), sizeGr, + int incrementPref = addPreference( tr( "VISU_GAUSS_PREF_INCREMENT" ), magnificationGr, LightApp_Preferences::DblSpin, "VISU", "inside_point_sprite_increment" ); setPreferenceProperty( incrementPref, "min", 0.01 ); setPreferenceProperty( incrementPref, "max", 10 ); @@ -606,6 +609,12 @@ VisuGUI_Module int cursorGr = addPreference( tr( "VISU_PICKING_PREF_CURSOR_GROUP_TTL" ), pickingTab ); setPreferenceProperty( cursorGr, "columns", 1 ); + int cursorSizePref = addPreference( tr( "VISU_PICKING_PREF_CURSOR_SIZE" ), cursorGr, + LightApp_Preferences::DblSpin, "VISU", "picking_cursor_size" ); + setPreferenceProperty( cursorSizePref, "min", 0 ); + setPreferenceProperty( cursorSizePref, "max", 1.0 ); + setPreferenceProperty( cursorSizePref, "step", 0.1 ); + int pyramidHeightPref = addPreference( tr( "VISU_PICKING_PREF_PYRAMID_HEIGHT" ), cursorGr, LightApp_Preferences::DblSpin, "VISU", "picking_pyramid_height" ); setPreferenceProperty( pyramidHeightPref, "min", 1 ); @@ -731,10 +740,6 @@ VisuGUI_Module setPreferenceProperty( spacemousePref4, "indexes", indices ); setPreferenceProperty( spacemousePref5, "strings", values ); setPreferenceProperty( spacemousePref5, "indexes", indices ); - - int cameraGr = addPreference( tr( "VISU_CAMERA_PREF_GROUP_TTL" ), mouseTab ); - int cameraPref = addPreference( tr( "VISU_CAMERA_MOVE_PREF" ), cameraGr, LightApp_Preferences::IntSpin, "VISU", "camera_movement_steps" ); - setPreferenceProperty( cameraPref, "max", 1000 ); } diff --git a/src/VVTK/VVTK_PickingDlg.cxx b/src/VVTK/VVTK_PickingDlg.cxx index 21b8c2e6..0d9052eb 100644 --- a/src/VVTK/VVTK_PickingDlg.cxx +++ b/src/VVTK/VVTK_PickingDlg.cxx @@ -76,25 +76,29 @@ VVTK_PickingDlg::VVTK_PickingDlg( QWidget* parent, const char* name ) CursorGroupLayout->setSpacing(6); CursorGroupLayout->setMargin(11); + QLabel* CursorSizeLabel = new QLabel( tr( "CURSOR_SIZE" ), CursorGroup ); + myCursorSizeSpinBox = new QtxDblSpinBox( 0, 1, 0.1, CursorGroup ); + myCursorSizeSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); + QLabel* PyramidHeightLabel = new QLabel( tr( "PYRAMID_HEIGHT" ), CursorGroup ); double aHeightMin=1.e-7; double aHeightMax=10.; double aHeightStep=0.1; myPyramidHeightSpinBox = new QtxDblSpinBox(aHeightMin, aHeightMax, aHeightStep, CursorGroup ); - myPyramidHeightSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); - QLabel* SelectionColorLabel = new QLabel( tr( "SELECTION_COLOR" ), CursorGroup ); mySelectionColorButton = new QPushButton( CursorGroup ); mySelectionColorButton->setPaletteBackgroundColor( Qt::blue ); mySelectionColorButton->setPaletteForegroundColor( Qt::blue ); connect( mySelectionColorButton, SIGNAL( clicked() ), this, SLOT( onColorButtonPressed() ) ); - CursorGroupLayout->addWidget( PyramidHeightLabel, 0, 0 ); - CursorGroupLayout->addWidget( myPyramidHeightSpinBox, 0, 1 ); - CursorGroupLayout->addWidget( SelectionColorLabel, 1, 0 ); - CursorGroupLayout->addWidget( mySelectionColorButton, 1, 1 ); + CursorGroupLayout->addWidget( CursorSizeLabel, 0, 0 ); + CursorGroupLayout->addWidget( myCursorSizeSpinBox, 0, 1 ); + CursorGroupLayout->addWidget( PyramidHeightLabel, 1, 0 ); + CursorGroupLayout->addWidget( myPyramidHeightSpinBox, 1, 1 ); + CursorGroupLayout->addWidget( SelectionColorLabel, 2, 0 ); + CursorGroupLayout->addWidget( mySelectionColorButton, 2, 1 ); // Tolerance QGroupBox* ToleranceGroup = new QGroupBox( tr( "TOLERANCE_TITLE" ), aBox, "ToleranceGroup" ); @@ -225,6 +229,7 @@ void VVTK_PickingDlg::RemoveActor( VISU_GaussPtsAct* theActor ) void VVTK_PickingDlg::Update() { + float aCursorSize = 0.5; float aPyramidHeight = 10.0; float aPointTolerance = 0.1; QColor aColor = Qt::yellow; @@ -236,6 +241,7 @@ void VVTK_PickingDlg::Update() if( !myPickingSettings->GetInitial() ) { + myCursorSizeSpinBox->setValue( myPickingSettings->GetCursorSize() ); myPyramidHeightSpinBox->setValue( myPickingSettings->GetPyramidHeight() ); myPointToleranceSpinBox->setValue( myPickingSettings->GetPointTolerance() ); myTransparencySpinBox->setValue( myPickingSettings->GetInfoWindowTransparency() * 100.0 ); @@ -255,6 +261,9 @@ void VVTK_PickingDlg::Update() SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); + aCursorSize = aResourceMgr->doubleValue( "VISU", "picking_cursor_size", aCursorSize ); + myCursorSizeSpinBox->setValue( aCursorSize ); + aPyramidHeight = aResourceMgr->doubleValue( "VISU", "picking_pyramid_height", aPyramidHeight ); myPyramidHeightSpinBox->setValue( aPyramidHeight ); @@ -331,6 +340,7 @@ void VVTK_PickingDlg::onClickApply() { myPickingSettings->SetInitial( false ); + myPickingSettings->SetCursorSize( myCursorSizeSpinBox->value() ); myPickingSettings->SetPyramidHeight( myPyramidHeightSpinBox->value() ); myPickingSettings->SetPointTolerance( myPointToleranceSpinBox->value() ); myPickingSettings->SetInfoWindowTransparency( myTransparencySpinBox->value() / 100.0 ); diff --git a/src/VVTK/VVTK_PickingDlg.h b/src/VVTK/VVTK_PickingDlg.h index 01ba29cd..72d3a4ec 100644 --- a/src/VVTK/VVTK_PickingDlg.h +++ b/src/VVTK/VVTK_PickingDlg.h @@ -78,6 +78,7 @@ private: void KeyPressed(); private: + QtxDblSpinBox* myCursorSizeSpinBox; QtxDblSpinBox* myPyramidHeightSpinBox; QPushButton* mySelectionColorButton; QtxDblSpinBox* myPointToleranceSpinBox;