Salome HOME
Fix for Bug PAL8856
authorenk <enk@opencascade.com>
Thu, 20 Oct 2005 14:06:28 +0000 (14:06 +0000)
committerenk <enk@opencascade.com>
Thu, 20 Oct 2005 14:06:28 +0000 (14:06 +0000)
  set axis scale not available from TUI

idl/VISU_Gen.idl
src/VISU_I/VISU_View_i.cc
src/VISU_I/VISU_View_i.hh

index a4b58de1c7504ef897ca5a96a811bfbd2cafefa6..0138653ae039479e0b89f63d4d1f2cfa0db25625 100644 (file)
@@ -1852,6 +1852,22 @@ module VISU {
     /*! Shrinks and enlarges the 2D plot to fit the 2D viewer.
      */
     void FitAll();
+
+    /*! Set range of the 2D plot to X axis of the 2D viewer.
+     */
+    void FitXRange(in double xMin, in double xMax);
+
+    /*! Set range of the 2D plot to Y axis of the 2D viewer.
+     */
+    void FitYRange(in double yMin, in double yMax);
+
+    /*! Set range of the 2D plot to XY axis of the 2D viewer.
+     */
+    void FitRange(in double xMin, in double xMax,
+                 in double yMin, in double yMax);
+
+    void GetFitRanges(out double xMin,out double xMax,
+                     out double yMin,out double yMax);
   };
 
   //-------------------------------------------------------
index 6b1244b5b5a8d92654ab2e8f7af089e4b547c57a..b927adb1eacee9c19a4db41a8b025390a59c562d 100644 (file)
@@ -1261,6 +1261,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)
index ae1f245b18a8c0028d32415012a5a9970a17d10b..4f9c8176d9f4a2e34c3b93382cfd135675c97f3e 100644 (file)
@@ -167,6 +167,11 @@ namespace VISU
     virtual void Update();
 
     virtual void FitAll();
+    virtual void FitXRange(const CORBA::Double xMin,const CORBA::Double xMax);
+    virtual void FitYRange(const CORBA::Double yMin,const CORBA::Double yMax);
+    virtual void FitRange(const CORBA::Double xMin,const CORBA::Double xMax,
+                         const CORBA::Double yMin,const CORBA::Double yMax);
+    virtual void GetFitRanges(double& xMin, double& xMax, double& yMin, double& yMax);
 
     virtual void Close();
   protected: