From 4c738f01fef295120fc159860f7feb9156d9154b Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 15 Dec 2005 14:57:02 +0000 Subject: [PATCH] Bug IPAL9976: Preferences-SALOME-Viewers-Plot2d Viewer-Curve type: Points doesn't work --- src/Plot2d/Plot2d_ViewFrame.cxx | 4 ++-- src/Plot2d/Plot2d_ViewWindow.cxx | 27 ++++++++++----------------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index c9f598b94..3e800e09b 100755 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -303,8 +303,8 @@ void Plot2d_ViewFrame::readPreferences() SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); myCurveType = resMgr->integerValue( "Plot2d", "CurveType", myCurveType ); - if ( myCurveType < 1 || myCurveType > 2 ) - myCurveType = 1; + setCurveType( resMgr->integerValue( "Plot2d", "CurveType", myCurveType ) ); + myShowLegend = resMgr->booleanValue( "Plot2d", "ShowLegend", myShowLegend ); myLegendPos = resMgr->integerValue( "Plot2d", "LegendPos", myLegendPos ); myMarkerSize = resMgr->integerValue( "Plot2d", "MarkerSize", myMarkerSize ); diff --git a/src/Plot2d/Plot2d_ViewWindow.cxx b/src/Plot2d/Plot2d_ViewWindow.cxx index 95b49ab03..437e2b92f 100755 --- a/src/Plot2d/Plot2d_ViewWindow.cxx +++ b/src/Plot2d/Plot2d_ViewWindow.cxx @@ -356,7 +356,12 @@ void Plot2d_ViewWindow::onChangeVerMode() //**************************************************************** void Plot2d_ViewWindow::onChangeCurveMode() { - myCurveBtn->SetItem(myViewFrame->getCurveType()); + int aCurveType = myViewFrame->getCurveType(); + myCurveBtn->SetItem(aCurveType); + + myActionsMap[CurvPointsId]->setOn(aCurveType == 0); + myActionsMap[CurvLinesId]->setOn(aCurveType == 1); + myActionsMap[CurvSplinesId]->setOn(aCurveType == 2); } //**************************************************************** @@ -424,26 +429,14 @@ void Plot2d_ViewWindow::onLegend() void Plot2d_ViewWindow::onCurves() { QtxAction* aSender = (QtxAction*) sender(); - if(aSender == myActionsMap[CurvPointsId]) { - myActionsMap[CurvPointsId]->setOn(true); - myActionsMap[CurvLinesId]->setOn(false); - myActionsMap[CurvSplinesId]->setOn(false); + if(aSender == myActionsMap[CurvPointsId]) myViewFrame->setCurveType(0); - } - else if(aSender == myActionsMap[CurvLinesId]) { - myActionsMap[CurvLinesId]->setOn(true); - myActionsMap[CurvPointsId]->setOn(false); - myActionsMap[CurvSplinesId]->setOn(false); + else if(aSender == myActionsMap[CurvLinesId]) myViewFrame->setCurveType(1); - } - else if(aSender == myActionsMap[CurvSplinesId]) { - myActionsMap[CurvSplinesId]->setOn( true ); - myActionsMap[CurvPointsId]->setOn( false ); - myActionsMap[CurvLinesId]->setOn( false ); + else if(aSender == myActionsMap[CurvSplinesId]) myViewFrame->setCurveType(2); - } } - + //**************************************************************** void Plot2d_ViewWindow::onDumpView() { -- 2.39.2