Цитата(Didro @ Jul 8 2012, 00:40)

Есть ли что-то бесплатное и открытое для таких целей ?
чем не устраивали собственные программы?
какая функциональность нужна? из предложенного списка немного непонятно.
если просто графики строить, чтобы пользователь их мышкой мог двигать/масштабировать, тогда
gnuplotвот простая плюсовая обёртка для запихивания gnuplot'у данных через pipe под windows.
вот
тут похожее на перле.
gnuplot.h:
CODE
#include <windows.h>
class gnuplot{
HANDLE g_hChildStd_IN_Rd;
HANDLE g_hChildStd_IN_Wr;
HANDLE g_hChildStd_OUT_Rd;
HANDLE g_hChildStd_OUT_Wr;
PROCESS_INFORMATION piProcInfo;
int _skip;
public:
gnuplot();
void skip(int s){_skip = s;}
int skip(){return _skip;}
int read(char * d, int num);
int write(char * d, int num = 0);
int print(char * s, ...);
void plot(double * y, int n); //y vs n.
void plot(double ** y, int n, int yn, char ** key = NULL); //y[0] vs n, y[1] vs n, y[yn] vs n.
void plot(double ** y, int * n, int yn, char ** key = NULL); //y[0] vs n[0], y[1] vs n[1], ..., y[yn] vs n[yn].
void plot(double * x, double * y, int n); //y vs x.
void plot(double * x, double ** y, int n, int yn, char ** key = NULL); //y[0] vs x, y[1] vs x, ..., y[yn] vs x.
void plot(double ** x, double ** y, int * n, int yn, char ** key = NULL); //y[0] vs x[0], y[1] vs x[1], ..., y[yn] vs x[yn]
~gnuplot();
};
gnuplot.cpp:
CODE
#include "gnuplot.h"
#include <stdio.h>
gnuplot::gnuplot(){
g_hChildStd_IN_Rd = NULL;
g_hChildStd_IN_Wr = NULL;
g_hChildStd_OUT_Rd = NULL;
g_hChildStd_OUT_Wr = NULL;
SECURITY_ATTRIBUTES saAttr;
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
saAttr.bInheritHandle = TRUE;
saAttr.lpSecurityDescriptor = NULL;
CreatePipe(&g_hChildStd_OUT_Rd, &g_hChildStd_OUT_Wr, &saAttr, 0);
SetHandleInformation(g_hChildStd_OUT_Rd, HANDLE_FLAG_INHERIT, 0);
CreatePipe(&g_hChildStd_IN_Rd, &g_hChildStd_IN_Wr, &saAttr, 0);
SetHandleInformation(g_hChildStd_IN_Wr, HANDLE_FLAG_INHERIT, 0);
STARTUPINFO siStartInfo;
BOOL bSuccess = FALSE;
ZeroMemory( &piProcInfo, sizeof(PROCESS_INFORMATION) );
ZeroMemory( &siStartInfo, sizeof(STARTUPINFO) );
siStartInfo.cb = sizeof(STARTUPINFO);
siStartInfo.hStdError = g_hChildStd_OUT_Wr;
siStartInfo.hStdOutput = g_hChildStd_OUT_Wr;
siStartInfo.hStdInput = g_hChildStd_IN_Rd;
siStartInfo.dwFlags |= STARTF_USESTDHANDLES;
bSuccess = CreateProcess(NULL,
"gnuplot -p", // command line
NULL, // process security attributes
NULL, // primary thread security attributes
TRUE, // handles are inherited
0, // creation flags
NULL, // use parent's environment
NULL, // use parent's current directory
&siStartInfo, // STARTUPINFO pointer
&piProcInfo); // receives PROCESS_INFORMATION
print("set terminal wxt noraise\n");
// print("set terminal windows enhanced size 500,500\n");
print("set grid\n");
read(NULL, 256);
_skip = 0;
}
int gnuplot::print(char * s, ...){
char tmpStr[256];
va_list args;
va_start (args, s);
vsprintf_s (tmpStr, 255, s, args);
va_end (args);
return write(tmpStr);
}
int gnuplot::write(char * d, int num){
if (num <= 0){num = 0; while (d[num]) num++;}
DWORD dwWritten;
BOOL bSuccess = FALSE;
bSuccess = WriteFile(g_hChildStd_IN_Wr, d, num, &dwWritten, NULL);
return bSuccess;
}
int gnuplot::read(char * d, int num){
DWORD dwRead;
BOOL bSuccess = FALSE;
if (d == NULL){
d = new char[num];
bSuccess = ReadFile( g_hChildStd_OUT_Rd, d, num, &dwRead, NULL);
delete [] d;
}
else{
bSuccess = ReadFile( g_hChildStd_OUT_Rd, d, num, &dwRead, NULL);
d[dwRead] = 0;
}
return dwRead;
}
void gnuplot::plot(double * y, int n){
print("plot '-' binary record=%d format='%%float64' using 1 with linespoints title \"\"\n", (_skip > 0) ? n / _skip + 1: n);
for (int i = 0; i < n ; i+= _skip > 0 ? _skip : 1)
write((char*)(&y[i]), 8);
read(NULL, 256);
}
void gnuplot::plot(double ** y, int n, int yn, char ** key){
print("plot ");
for (int i = 0; i < yn; i++){
print("'-' binary record=%d format='%%float64' using 1 with linespoints title ", (_skip > 0) ? n / _skip + 1: n);
if (key) print("\"%s\"", key[i]); else print("\"\"");
if (i < yn - 1) print(",\\");
print("\n");
}
for (int j = 0; j < yn; j++)
for (int i = 0; i < n ; i+= _skip > 0 ? _skip : 1)
write((char*)(&(y[j][i])), 8);
read(NULL,256);
}
void gnuplot::plot(double ** y, int * n, int yn, char ** key){
print("plot ");
for (int i = 0; i < yn; i++){
print("'-' binary record=%d format='%%float64' using 1 with linespoints title ", (_skip > 0) ? n[i] / _skip + 1: n[i]);
if (key) print("\"%s\"", key[i]); else print("\"\"");
if (i < yn - 1) print(",\\");
print("\n");
}
for (int i = 0; i < yn; i++)
for (int j = 0; j < n[i] ; j+= _skip > 0 ? _skip : 1)
write((char*)(&(y[i][j])), 8);
read(NULL,256);
}
void gnuplot::plot(double * x, double * y, int n){
print("plot '-' binary record=%d format='%%float64%%float64' using 1:2 with linespoints title \"\"\n", (_skip > 0) ? n / _skip + 1: n);
for (int i = 0; i < n ; i+= _skip > 0 ? _skip : 1){
write((char*)(&(x[i])), 8);
write((char*)(&(y[i])), 8);
}
read(NULL, 256);
}
void gnuplot::plot(double * x, double ** y, int n, int yn, char ** key){
print("plot ");
for (int i = 0; i < yn; i++){
print("'-' binary record=%d format='%%float64%%float64' using 1:2 with linespoints title ", (_skip > 0) ? n / _skip + 1 : n);
if (key) print("\"%s\"", key[i]); else print("\"\"");
if (i < yn - 1) print(",\\");
print("\n");
}
for (int i = 0; i < yn; i++)
for (int j = 0; j < n ; j+= _skip > 0 ? _skip : 1){
write((char*)(&(x[j])), 8);
write((char*)(&(y[i][j])), 8);
}
read(NULL,256);
}
void gnuplot::plot(double ** x, double ** y, int *n, int yn, char ** key){
print("plot ");
for (int i = 0; i < yn; i++){
print("'-' binary record=%d format='%%float64%%float64' using 1:2 with linespoints title ", (_skip > 0) ? n[i] / _skip + 1: n[i]);
if (key) print("\"%s\"", key[i]); else print("\"\"");
if (i < yn - 1) print(",\\");
print("\n");
}
for (int i = 0; i < yn; i++)
for (int j = 0; j < n[i] ; j+= _skip > 0 ? _skip : 1){
write((char*)(&(x[i][j])), 8);
write((char*)(&(y[i][j])), 8);
}
read(NULL,256);
}
gnuplot::~gnuplot(){
print("exit\n");
}