Added the first scope of the visual dive planner.

Added the first files and skeleton code for the visual
dive planner. now I need to fill things. The code is
using the print action borrowed, this will need to move
to a better choice in the future.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Make double click work to put new items on the canvas.

Make double click work to put new items on the canvas.
Those items right now are QGraphicsEllipseItems, but
it will change to 'draggable' items.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Plots Lines and handles on the Planner

This is still a bit bugged - the lines are going to the wrong
end - most probaly I messed something on the math. I'll now fix
the sizing issue then I'll try to make it behave in the proper
way.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Better handling of the scene size for the dive Plan

Better handling of the scene size for the dive plan,
The scene can be resized and a transform will be applied,
the handles will not resize however - they are 10x10px
and that's it.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Fix creation of the poligon-based lines for the dive planner

This fixes the creation of the poligon-based lines
next thing to do is to forbit creation of the next point
before the last one.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Created a cross that follows the mouse on the dive planner.

Created a cross that follows the mouse on the dive planner,
this will help the user to know where it is placing the stop.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Better defaults for placement of dive stops.

This patch makes it impossible to create a dive stop
outside of the scene - this, messing the complete
planning system.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Make the cross red when you cant plot a dive stop

Make the cross red when you cant plot a dive stop,
also make impossible to put a dive stop before the last one.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Created a class DiveHandle to make drag drop work.

Create d a class DiveHandle to make drag drop works,
it has a from and to Lines, and it will move them
around.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added drag and drop code to the dive plan

Added drag and drop code to the dive plan, it can move the user-
inputted data, but will not touch the computer generated ones.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Make the plan handlers to not move across other handlers.

This patch disables the hability to move handlers across
the others, making a 'zigzag' in the time line.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added the skeleton for the Ruler Item,

The ruler will deliver the Time and the Depth, later.
it should be vertical or horizontal, and will have
ticks

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added a 2 Ruler Items, Time and Depth.

The ruler items are needed so I can get the correct
coordinates of the planned dive. This is a very
rudimentary ruler and it needs a bit of love, but
it already gives me something to work on.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added the code to set the Depth / Time on the user Handlers.

Added the code to set the Depth / Time on the user handlers,
I think this finishes the difficult part. ( well, not really )
the depth and time is being set when handler is added or moved,
but as soon as the deco calculations enters on the code, the
handlers will need to be repositioned - and this code is not ready
yet.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added text to the rules so the user knows what's happening at that point.

Added text to the rules, so the user knows what's happening at that point
The text will move left / right ( for time ) and up / down ( for depth )

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Restore the original color of the Handler as soon as mouseRelease.

Restore the original color of the handler as soon as mouseRelease,
also a bit of code cleanup.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Make skeleton of 'create_deco_stop'.

This is a skeleton of 'create_deco_stop' plus a bit of
code cleanup. I'v commented the create_deco_stop so that
the other developers can help me a bit here - since I don't
know too well the internals of subsurface. In the original
GTK code - a new dive was created every time a user changed
something on the dive, I don't know if this will be needed,
I jusst need two things: the correct time of dive calculated
by the app, and the points to put the decompression lines.

The usability of the widget right now is 'ok', nothing to
be proud of, it's ugly as hell too, and the Rules are in
the wrong position ( they are 'inside' the area where
the lines are being drawn, but htis is easily fixable. )

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added a new class to handle the DivePlanner dialog

Added a new class named DivePlanner that is a QDialog,
and renamed the old DivePlanner class to DivePlannerGraphics.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added back the menu entry 'Dive Planner'

Added back the menu entry Dive Planner, and removed the
calee code from the Print action.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Use the gasmix straight off

In calculate_deco_information we compute the ppo2 so we can graph it,
but if we send that ppo2 on to add_segment it will just reverse the
computation and introduce errors.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>