]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Adjust to HEAD modifications
authorapo <apo@opencascade.com>
Fri, 21 Oct 2005 06:54:50 +0000 (06:54 +0000)
committerapo <apo@opencascade.com>
Fri, 21 Oct 2005 06:54:50 +0000 (06:54 +0000)
src/VISU_I/VISU_View_i.cc

index 92e46a57a9d6f8c0e8b5d30b341a912526299ff9..da0593b7d79370a294a70034ab59ce08a2a62f54 100644 (file)
@@ -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<Plot2d_Viewer>(theApplication));
+      myViewManager = ProcessEvent(new TNewSpecViewEvent<SPlot2d_Viewer>(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<Plot2d_ViewFrame> (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)