문제

I'm trying to build a small application for a specific problem in cartography. The workflow is like this:

  • in the field, use a compass and tape measure to obtain terrain data.
  • also in the field, sketch the plot being surveyed
  • using inkscape, create a vector drawing of that sketch
  • crunch the data to obtain the relevant information (implemented already)
  • put the vector and the data together (mostly warping and scaling the drawing - implemented already)

Now, I'd like to do the vectorizing, which I'm doing in inkscape now, directly in my custom application - this helps me characterize the sketch faster.

I had a look at the Inkscape and Karbon codebases, but the code responsible for the widgets that draw curves and paths, along with the whole user interaction parts, is quite involved. I'd like to stick to number crunching and make sure that works properly.

In short, I'm looking for something like Qwt (whichs provides plotting utilities), but directed to adding vector drawing/sketching functionality to an application. Then it'd be a matter of putting the GUI pieces together, and i'd be free to worry about the number crunching. So far I couldn't find anything like this - Inkscape, Karbon, Libreoffice, Printdesign, Gimp, they all implement their own path, curve widgets, using the graphics primitives of their frameworks and adding all the code that shows the curve moving with the mouse, the control points, etc.

Does anyone have an idea if such a pre-made framework for higher-level graphics - that lets me forget about the GUI code - exists? Thanks!

도움이 되었습니까?

해결책

QGraphicsScene and QGraphicsView provide enough for you to fairly simply implement the rest of it. Do note that Qt has a rather rich set of graphics primitives that you can trivially reuse, like bezier curves, paths, etc. You need to implement the application-specific bits, but the basics are done.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top