Skip to content
Snippets Groups Projects
Commit 65477436 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

new libfridaplot

parent e1b2d086
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,7 @@ find_package(Gnuplot REQUIRED)
add_subdirectory(ThirdParty/googletest)
add_subdirectory(readplus)
add_subdirectory(trivia)
add_subdirectory(plot)
add_subdirectory(lib)
add_subdirectory(src)
add_subdirectory(share)
......
......@@ -11,11 +11,9 @@ include_directories(${Frida_SOURCE_DIR}/lib ${CMAKE_CURRENT_BINARY_DIR} ${Boost_
configure_file("config.hpp.in" "${CMAKE_CURRENT_BINARY_DIR}/config.hpp")
set(src_files
axis.cpp
commands.cpp
coord.cpp
curve.cpp
dualplot.cpp
edif.cpp
expr.cpp
fbase.cpp
......@@ -38,7 +36,6 @@ obj.cpp
olf.cpp
opr.cpp
plot.cpp
plowin.cpp
rssm.cpp
slice.cpp
special.cpp
......@@ -47,12 +44,10 @@ variables.cpp
)
set(inc_files
axis.hpp
commands.hpp
coord.hpp
curve.hpp
defs.hpp
dualplot.hpp
edif.hpp
expr.hpp
file_in.hpp
......@@ -72,7 +67,6 @@ obj.hpp
olf.hpp
opr.hpp
plot.hpp
plowin.hpp
ptr.hpp
registry.hpp
rssm.hpp
......@@ -91,7 +85,7 @@ ${FLEX_xaxlex_OUTPUTS}
set_target_properties(libfrida PROPERTIES OUTPUT_NAME frida)
target_link_libraries(libfrida libreadplus libtrivia
target_link_libraries(libfrida libreadplus libtrivia libfridaplot
pthread
${GSL_LIBRARIES}
${FFTW_LIBRARIES}
......
......@@ -15,6 +15,8 @@
#include "../trivia/file_ops.hpp"
#include "../readplus/ask.hpp"
#include "../plot/dualplot.hpp"
#include "../plot/plowin.hpp"
#include "config.hpp"
#include "olf.hpp"
......@@ -24,10 +26,8 @@
#include "func.hpp"
#include "fregistry.hpp"
#include "geni.hpp"
#include "dualplot.hpp"
#include "opr.hpp"
#include "plot.hpp"
#include "plowin.hpp"
#include "file_in.hpp"
#include "file_out.hpp"
#include "rssm.hpp"
......
......@@ -12,13 +12,13 @@
#include <cmath>
#include "../trivia/vector_ops.hpp"
#include "../plot/dualplot.hpp"
#include "olf.hpp"
#include "mem.hpp"
#include "obj.hpp"
#include "jsel.hpp"
#include "slice.hpp"
#include "dualplot.hpp"
#include "plot.hpp"
#include "curve.hpp"
......
......@@ -18,6 +18,8 @@
#include "../readplus/ask.hpp"
#include "../readplus/macro.hpp"
#include "../readplus/readln.hpp"
#include "../plot/plowin.hpp"
#include "../plot/dualplot.hpp"
#include "toplevel.hpp"
#include "config.hpp"
......@@ -29,8 +31,6 @@
#include "fregistry.hpp"
#include "geni.hpp"
#include "integrate.hpp"
#include "dualplot.hpp"
#include "plowin.hpp"
#include "commands.hpp"
#include "expr.hpp"
#include "xax_lex.hpp"
......
# frida: trivia/CMakeLists.txt
include_directories(${Frida_SOURCE_DIR}/plot ${CMAKE_CURRENT_BINARY_DIR})
set(src_files
axis.cpp
dualplot.cpp
plowin.cpp
)
set(inc_files
axis.hpp
dualplot.hpp
plowin.hpp
)
add_library(libfridaplot SHARED
${src_files}
)
set_target_properties(libfridaplot PROPERTIES OUTPUT_NAME fridaplot)
target_link_libraries(libfridaplot
)
install(TARGETS libfridaplot DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
\ No newline at end of file
......@@ -7,15 +7,23 @@
//! \file axis.cpp
//! \brief CAxis: One axis of a coordinate frame.
#include "defs.hpp"
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include "../trivia/math.hpp"
#include "../trivia/string_convs.hpp"
#include "../readplus/macro.hpp"
#include "axis.hpp"
using std::string;
using std::vector;
using std::cout;
#define S(a) triv::strg((a))
//! Sets infinite limits so that next plot call will recompute them.
......
......@@ -11,13 +11,13 @@
class CAxis {
public:
string name; //!< usually "x" or "y"
std::string name; //!< usually "x" or "y"
double inf; //!< infimum: lower plot limit
double sup; //!< supremum: upper plot limit
bool logflag; //!< is logarithmic ?
bool force; //!< force points into range ?
CAxis( const string _name, bool _log ) :
CAxis( const std::string _name, bool _log ) :
name(_name), logflag(_log), force(false) { set_auto(); }
void set_log( bool _log );
......@@ -25,17 +25,17 @@ class CAxis {
void set_auto();
void set_limits( double _inf, double _sup );
void set_rounded_limits( double _inf, double _sup );
void ask_and_set( const string& quest );
void ask_and_set( const std::string& quest );
string str() const;
string info() const;
std::string str() const;
std::string info() const;
bool finite() const;
bool contains( double val ) const;
bool close_enough( double v1, double v2, double tol ) const;
double value2plotcoord( double v ) const;
double value2ploterror( double v, double dv ) const;
void set_xgrid( vector<double>& x, int n ) const;
void set_xgrid( std::vector<double>& x, int n ) const;
double pc( double v ) const;
double pcerr( double v, double dv ) const;
void calc_ticks( vector<double>& Tacks, int *ntpt, double *ticklim ) const;
void calc_ticks( std::vector<double>& Tacks, int *ntpt, double *ticklim ) const;
};
......@@ -7,8 +7,9 @@
//! \file dualplot.cpp
//! \brief Collection NPlot of plot frames CPlot.
#include "defs.hpp"
#include <iostream>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstring>
......@@ -18,11 +19,17 @@
#include <boost/format.hpp>
#include "../trivia/file_ops.hpp"
#include "../trivia/string_convs.hpp"
#include "dualplot.hpp"
using std::string;
using std::vector;
using std::cout;
using boost::format;
#define S(a) triv::strg((a))
static const int mLin = 80; // max num of chars in PostScript line
......
......@@ -26,40 +26,40 @@ class CPlot {
CPlot( int _iPlot, bool _logx, bool _logy );
void gp_write( const string& in );
void gp_write( const std::string& in );
void clear_frame();
void plot_frame( const string& xlabel, const string& ylabel );
void plot_frame( const std::string& xlabel, const std::string& ylabel );
void add_spec( bool as_line, bool new_style, int style_no,
const vector<double>& xp,
const vector<double>& yp,
const vector<double>& dyp,
const vector<string>& z,
const string& xco,
const string& yco,
const string& info );
const std::vector<double>& xp,
const std::vector<double>& yp,
const std::vector<double>& dyp,
const std::vector<std::string>& z,
const std::string& xco,
const std::string& yco,
const std::string& info );
void show_specs();
void doc_TxLine( const string& line );
void doc_PtTxLine( const string& line, int num );
void doc_CvTxLine( const string& line, int num );
void write_postscript( const string& ps_outdir,
const string& ps_head,
const string& ps_dict );
void set_aux( const string& cmd );
string info() const;
void doc_TxLine( const std::string& line );
void doc_PtTxLine( const std::string& line, int num );
void doc_CvTxLine( const std::string& line, int num );
void write_postscript( const std::string& ps_outdir,
const std::string& ps_head,
const std::string& ps_dict );
void set_aux( const std::string& cmd );
std::string info() const;
private:
// TODO: some of this could be made local static, if class instances
// are created anew instead of calling clearFrame().
int gp_fifo; //!< Pipe to Gnuplot.
int gp_fno; //!< Number of Gnuplot input file.
string gp_fnames; //!< List of currently plotted Gnuplot input file names.
std::string gp_fnames; //!< List of currently plotted Gnuplot input file names.
int ps_fnum; //!< Postscript output file number.
int ps_snum; //!< Slice number in Postscript file.
int ps_pnum; //!< Spectrum number, for setting pstyle.
int ps_cnum; //!< Curve number, for setting cstyle.
void ps_ticktack( const vector<double>& Tacks, int ntpt,
void ps_ticktack( const std::vector<double>& Tacks, int ntpt,
const double *ticklim, const CAxis *A );
vector<string> ps_accu; //!< Main Postscript cache.
vector<string> ps_Doc; //!< Special Postscript cache for doc lines ?.
std::vector<std::string> ps_accu; //!< Main Postscript cache.
std::vector<std::string> ps_Doc; //!< Special Postscript cache for doc lines ?.
};
......@@ -32,7 +32,7 @@ void SPloWin::select( int i ) {
iPlot = i;
Plots.push_back( CPlot( nPlot(), false, false ) );
} else
throw S("invalid graphic window number");
throw std::string("invalid graphic window number");
}
//! List available windows.
......
......@@ -7,7 +7,7 @@
//! \file plowin.hpp
//! \brief declares SPloWin, to administer plot windows
#include "defs.hpp"
#include<vector>
#include <memory>
#include "../trivia/singleton.hpp"
......@@ -15,7 +15,7 @@ class CPlot;
class SPloWin : public triv::ISingleton<SPloWin> {
private:
vector<CPlot> Plots;
std::vector<CPlot> Plots;
int iPlot; //!< current plot window
public:
static void initialize();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment