-
Notifications
You must be signed in to change notification settings - Fork 0
/
gnuplot_ci.h
56 lines (46 loc) · 1.46 KB
/
gnuplot_ci.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* C++ Interface to GNUPLOT
*
* FILE: gnuplot_ci.h
*
* Date: 09 August 2007 Thursday
* Date: 12 October 2007 Friday
* ---------------------------------- */
#ifndef _GNUPLOT_CI_H
#define _GNUPLOT_CI_H
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<unistd.h>
#include<csignal>
#include<cmath>
#include <cstring>
namespace gnuplot_ci
{
class GP_handle
{
private:
char *gp_binary;
char *set_term;
char *xt;
char *yt;
char *zt;
FILE *fp;
int arrow_cnt; // To keep count of arrows
public:
GP_handle(const char *gp_bin, const char *xl, const char *yl, const char *zl=NULL);
GP_handle(const char *gp_bin);
~GP_handle();
void gen_random_string(char *s, const int len);
void gen_random_color(char *s);
void gnuplot_cmd(const char *command);
void draw_circle(float x, float y, float r);
void draw_sphere(float x, float y, float z, float r, int iso, int ltc=0);
void draw_cuboid(float x1, float y1, float z1, float x2, float y2, float z2);
void draw_cuboid2(double x1[3], double dx[3], int replot_flag=0);
void draw_cuboid_solid(double x1[3], double dx[3], int replot_flag=0);
void draw3dcoordAxis(double xp[],double dx[], bool replot_flag=false, int cFlag = 1, float scale=1.0);
void draw3dcoordAxis(double x[], double xp[], double yp[], double zp[], bool replot_flag=false, int cFlag = 1);
int get_arrow_cnt() const;
};
}
#endif