integrating plotting in a C++ native application: general questions about which tools to use

H

Hicham Mouline

Hello,

I am writing an application with a native C++ computation engine (library)
that generates plotable data 2d and 3d, and a plotting engine.
I am trying to determine what tools/libraries to use for the plotting
engine.

My graphs are all time series in the x axis (typically dates but maybe day
numbers).
I have a y axis and sometimes a z axis as well.
Data is available in std::vector/list< pair<> > or std::vector/list<
boost::tuple<> >, sometimes std::map<k,v>, perhaps later
boost::multi_array<2> or <3> as well, or in fact just native arrays of pairs
or boost::tuples.

Decisions are made by the users, tweaking parameters and seeing how the
plots change.

The application user interface will be as:
1. win command line and just the plotting being graphical
2. Linux command line and just the plotting being graphical
3. win .net interface - input of parameters to the computing engine, and
the plotting being graphical
4. Linux with X (maybe gtk/qt) - input of parameters to the computing
engine, and the plotting being graphical

And the results of the computation will then need to be plotted.

So far, I have seen these solutions:
***1 - With 1,2,3 and 4, I can see a write the numbers to a file, call the
external process on windows that runs gnuplot that runs a script file to
plot the file.
Both 2D (y(x)) and 3D(z(x,y)) visualizations are pretty flexible, in
particular 3D visualizations allow to rotate the graph and view from
different angles.
But this process seems tortuous, gnuplot accepts piped data on linux but not
on windows without mingw/cigwin. It would be preferable to not generate
intermediary files, especially if that is very large.
There is also a gnuplot c++ interface, but that doesn't avoid running the
gnuplot external process.

***2 - I've come across boost.plot and it generates svg files which have
only 2D if I understood correctly, SVG doesn't express 3D, and then use a
browser (chrome) or that tool that uses SVG as its native format, or use
ImageDisplay for e.g.( this comes with c++ dev library, perhaps that helps
to plot directly the svg without running the process externally )
Cons: no 3d (rotating and different angles) and still require external
programs.

***3 - I don't know .net but it seems c# is more convenient for the GUI part
(inputting parameters, selecting options), running the c++ computation
engine, and .net probably has some plotting part (don't know about 3D plots
and rotating though)
Cons: non portable solution - how would c# plotting interact with native c++
stl?

***4 - gtk/qt : does it have plotting features? It is ported to linux and
win, does the windows port requires cygwin/mingw?
How does it interact with STL containers?

The solution is ideally the quickest-to-deploy and most portable, with
windows not requiring cygwin/mingw, and not needing to run an external
process.

The need for portability comes from hardware requirements machines with a
large number of processor cores run linux, while smaller boxes run win.

I appreciate there are a lot of questions here, that deal with many topics
and I thank everyone for answers or suggestions,
Regards,
 
R

Rune Allnor

***4 - gtk/qt : does it have plotting features?

Qt does, yes. Choose between a painter class, or use OpenGL.
It is ported to linux and
win, does the windows port requires cygwin/mingw?

There are several versions of Qt for windows. One of the
textbooks

http://www.amazon.com/Programming-P...ef=sr_1_1?ie=UTF8&qid=1260918388&sr=8-1-fkmr0

comes with a CD that contains a MinGW set-up. The
commercial Qt license can be integrated into Visual
Studio.
How does it interact with STL containers?

Like any C++ library. Qt is a library that is an
addition to the standard C++. Use STL containers as
you please for data. You might want to use the Qt
counterparts if you need the containers to handle
GUI components, though.

Rune
 
M

Michael Doubez

I am writing an application with a native C++ computation engine (library)
that generates plotable data 2d and 3d, and a plotting engine.
I am trying to determine what tools/libraries to use for the plotting
engine.

My graphs are all time series in the x axis (typically dates but maybe day
numbers).
I have a y axis and sometimes a z axis as well.
Data is available in std::vector/list< pair<> >  or std::vector/list<
boost::tuple<> >, sometimes std::map<k,v>, perhaps later
boost::multi_array<2> or <3> as well, or in fact just native arrays of pairs
or boost::tuples.

Decisions are made by the users, tweaking parameters and seeing how the
plots change.

The application user interface will be as:
1. win command line and just the plotting being graphical
2. Linux command line and just the plotting being graphical
3. win .net interface  - input of parameters to the computing engine, and
the plotting being graphical
4. Linux with X (maybe gtk/qt) - input of parameters to the computing
engine, and the plotting being graphical

And the results of the computation will then need to be plotted. [snip]
***3 - I don't know .net but it seems c# is more convenient for the GUI part
(inputting parameters, selecting options), running the c++ computation
engine, and .net probably has some plotting part (don't know about 3D plots
and rotating though)
Cons: non portable solution - how would c# plotting interact with native c++
stl?

There is a Linux C# implementation: mono. So it should be fairly
portable.
But you could use another scripting language like Python.

I guess that whatever you are familiar with is the best choice for the
interface.

[snip]
The need for portability comes from hardware requirements machines with a
large number of processor cores run linux, while smaller boxes run win.

I appreciate there are a lot of questions here, that deal with many topics
and I thank everyone for answers or suggestions,
Regards,

Have you considered VTK for the rendering ?
http://www.vtk.org/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top