Skip to content
Snippets Groups Projects
dualplot.h 1.94 KiB
Newer Older
  • Learn to ignore specific revisions
  • class CRange {
     public:
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
        double inf, sup;
    
        CRange();
        CRange( double infin, double supin );
    
        void set_from_string( const string& text );
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
        bool finite() const;
        bool contained(double val) const;
    
        double value2plotcoord( int logflag, double v ) const;
        double plotcoord2value( int logflag, double c ) const;
        double inf_pos(void) const;
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
        void Round(int logflag, double relmargin, double digits);
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
        string str(void) const;
    
        CRange R;
        CRange AlternateR; // obsoleted by multi-CPlot
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
        CCoord C;
        bool   log;
        bool   force;
    
        CAxis( bool _log ) : log(_log), force(false) {};
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
        void Ask( const string& quest );
        void SetLog( const bool _log );
    
    #define CPLOT_PSMAX 10
    #define CPLOT_LINSIZ 80
    
    class CPlot { // additional declarations in dualplot.cpp
     public:
        uint iPlot;
        CAxis X, Y;
        uint maxpoints;
    
        CPlot( uint _iPlot, bool _logx, bool _logy ) : 
            iPlot( _iPlot ), maxpoints(12000), X( _logx ), Y( _logy )
            { Open(); };
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
        void Multiask();
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
        void Open();
        void Close();
        void Clear();
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
        void Box();
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
        void Line( const bool as_line, const int style_no,
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
                   const vector<double> x, const vector<double> y,
                   const vector<double>* z,
    
                   const string xco, const string yco,
                   const string info );
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
        void Doc (vector<string> lDoc);
        void Save( bool full_outfile );
    
    Wuttke, Joachim's avatar
    Wuttke, Joachim committed
        void Dialog();
    
        string info();
    
     private:
        int gp_fifo;
        void gp_write(string);
        int gp_fno;
        string gp_fnames;
    
        uint ps_fnum; // file
        uint ps_snum; // scan
        uint ps_pnum; // scan with pstyle
        uint ps_cnum; // scan with cstyle
        void ps_ticktack(uint ntack, double *tack, int ntpt, double *ticklim,
                         CAxis *A);
        vector<string> ps_Doc;
        vector<string> ps_accu; // future output is accumulated here
        char outlin[ CPLOT_LINSIZ ];