From 88048e6fab07181d5125bab08e68bb03c7edf9c6 Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 21 Oct 2005 06:54:50 +0000 Subject: [PATCH] Adjust to HEAD modifications --- src/VISU_I/VISU_View_i.cc | 65 +++++++++++++++++++++++++++++++++++---- 1 file changed, 59 insertions(+), 6 deletions(-) diff --git a/src/VISU_I/VISU_View_i.cc b/src/VISU_I/VISU_View_i.cc index 92e46a57..da0593b7 100644 --- a/src/VISU_I/VISU_View_i.cc +++ b/src/VISU_I/VISU_View_i.cc @@ -49,7 +49,6 @@ #include "SPlot2d_ViewModel.h" #include "Plot2d_ViewFrame.h" -#include "Plot2d_ViewModel.h" #include "SalomeApp_Application.h" #include "SalomeApp_Study.h" @@ -940,7 +939,7 @@ namespace VISU { { if (MYDEBUG) MESSAGE("XYPlot_i::XYPlot_i"); if (theApplication) { - myViewManager = ProcessEvent(new TNewSpecViewEvent(theApplication)); + myViewManager = ProcessEvent(new TNewSpecViewEvent(theApplication)); } } @@ -1071,8 +1070,8 @@ namespace VISU { protected: Plot2d_ViewFrame* myView; TFun myFun; - CORBA::Boolean myMajor, myNumMajor; - CORBA::Boolean myMinor, myNumMinor; + CORBA::Boolean myMajor, myMinor; + CORBA::Long myNumMajor, myNumMinor; }; void XYPlot_i::EnableXGrid (CORBA::Boolean theMajor, CORBA::Long theNumMajor, @@ -1084,8 +1083,9 @@ namespace VISU { void XYPlot_i::EnableYGrid(CORBA::Boolean theMajor, CORBA::Long theNumMajor, CORBA::Boolean theMinor, CORBA::Long theNumMinor) { - //jfa tmp:ProcessVoidEvent(new TEnableGridEvent(myView,&Plot2d_ViewFrame::setYGrid, - //jfa tmp: theMajor,theNumMajor,theMinor,theNumMinor)); + //asl: Plot2d_ViewFrame::setYGrid has more parameters + //ProcessVoidEvent(new TEnableGridEvent(myView,&Plot2d_ViewFrame::setYGrid, + // theMajor,theNumMajor,theMinor,theNumMinor)); } class TSetScaleModeEvent: public SALOME_Event @@ -1260,6 +1260,59 @@ namespace VISU { ProcessVoidEvent(new TVoidMemFunEvent (myView,&Plot2d_ViewFrame::fitAll)); } + class TFitRangeEvent: public SALOME_Event + { + public: + TFitRangeEvent (Plot2d_ViewFrame* theView, + const int mode, + const double xMin, const double xMax, + const double yMin, const double yMax): + myView(theView), + myMode(mode), + myXMin(xMin),myXMax(xMax), + myYMin(yMin),myYMax(yMax) + {} + virtual void Execute() + { + myView->fitData(myMode,myXMin,myXMax,myYMin,myYMax); + } + protected: + const int myMode; + const double myXMin; + const double myXMax; + const double myYMin; + const double myYMax; + Plot2d_ViewFrame* myView; + }; + + void XYPlot_i::FitXRange(const CORBA::Double xMin,const CORBA::Double xMax) + { + const CORBA::Long mode = 1; + const CORBA::Double yMin = 0.0; + const CORBA::Double yMax = 0.0; + ProcessVoidEvent(new TFitRangeEvent(myView,mode,xMin,xMax,yMin,yMax)); + } + + void XYPlot_i::FitYRange(const CORBA::Double yMin,const CORBA::Double yMax) + { + const CORBA::Long mode = 2; + const CORBA::Double xMin = 0.0; + const CORBA::Double xMax = 0.0; + ProcessVoidEvent(new TFitRangeEvent(myView,mode,xMin,xMax,yMin,yMax)); + } + + void XYPlot_i::FitRange(const CORBA::Double xMin,const CORBA::Double xMax, + const CORBA::Double yMin,const CORBA::Double yMax) + { + const CORBA::Long mode = 0; + ProcessVoidEvent(new TFitRangeEvent(myView,mode,xMin,xMax,yMin,yMax)); + } + + void XYPlot_i::GetFitRanges(double& xMin, double& xMax, double& yMin, double& yMax) + { + double y2Min,y2Max; + myView->getFitRanges(xMin,xMax,yMin,yMax,y2Min,y2Max); + } //=========================================================================== TableView_i::TableView_i (SalomeApp_Application* theApplication) -- 2.39.2