/*! 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);
};
//-------------------------------------------------------
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)
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: