Commit Graph

29 Commits

Author SHA1 Message Date
Tats
62492a9c41 Minor: added some Q_UNUSED() to prevent warnings 2014-01-11 21:59:56 -05:00
Tats
4639a228c6 Resolved all compilation errors from merging 2014-01-05 18:07:19 -05:00
Tats
559a7ebf90 Merge branch 'develop' into statesaving
Conflicts:
	DestinationGLCanvas.cpp
	MainWindow.cpp
	MainWindow.h
	Mapper.h
	MappingManager.cpp
	MappingManager.h
	Paint.h
	Shape.h
	SourceGLCanvas.cpp
	Util.cpp
	libremapping.pro
	main.cpp
2014-01-05 18:06:41 -05:00
Vasilis Liaskovitis
5852cde869 Shape: Convert Point to QObject / QPointF
Also add one Q_PROPERTY for each coordinate (x and y) of a Point. This will
enable the controller to set and get these properties.

Since QObjects cannot be copied, we also need to change the Shape class to have
a vector of pointers to Points, instead of actual Point structs.
2013-12-24 13:50:20 +02:00
Tats
6b864b64ed Removed some debugging code 2013-12-15 23:12:44 -05:00
Tats
f66f67c654 Better managing of vertex selection 2013-12-10 22:27:39 -05:00
Alexandre Quessy
dce8f0b35d Saves an XML file. 2013-12-09 15:20:33 -05:00
Tats
cd2639812d Replaced signal quadChanged for shapeChanged 2013-12-08 11:56:55 -05:00
Tats
4a80c0a328 Merge branch 'sticky-vertices' of github.com:vliaskov/libremapping into develop
Conflicts:
	Shape.h
	SourceGLCanvas.cpp
2013-12-06 18:06:28 -05:00
Vasilis Liaskovitis
b3340e2633 GLCanvas: Implement sticky vertex movement
If the vertex of the current Shape is being moved, it may be useful to "glue" it
to a vertex of another shape, if the 2 vertices are close together. This patch
implements this. THe sticky-sensitivity is controlled by the dist_stick
variable, which is currently hardcoded but could be made configurable e.g.
through the GUI.

The patch also uses a new pure virtual method called getShapeFromMappingId(),
which is implemented by Source / Dest Canvas subclasses. getCurrentShape() is
now using this function, so it is now a non-virtual function in MapperGLCanvas.
2013-12-05 23:48:16 +02:00
Tats
3e34947a88 Merge branch 'shape-drag' of github.com:vliaskov/libremapping
Conflicts:
	MapperGLCanvas.h
	Shape.h
2013-12-04 23:02:47 -05:00
Vasilis Liaskovitis
d7c09a5426 Move active_vertex from Shape to MapperGLCanvas 2013-12-03 01:34:49 +02:00
Vasilis Liaskovitis
35fb1ca821 Implement shape drag-and-drop
A user may find it useful in some cases to drag and drop a whole shape, instead
of moving each vertex separately. This patch implements shape drag-and-drop by
pressing and holding the right mouse button. Point inclusion algorithm should
work for non-convex and convex polygons, as suggested in
http://www.cs.tufts.edu/comp/163/notes05/point_inclusion_handout.pdf
2013-12-03 01:14:17 +02:00
Tats
8b205526fe Completed integration of one source -> many quads (everything working) 2013-11-30 21:48:01 -05:00
Tats
73d934b4d0 Some cleanup in switching of image source 2013-11-30 19:23:35 -05:00
Tats
5a999f1983 - Put all mappings and paints in a single MappingManager class
- Basic compiling / running program (no quads for now)
2013-11-30 19:19:29 -05:00
Tats
7fce243072 Merge remote-tracking branch 'vliaskov/click-drag' 2013-11-29 12:09:58 -05:00
Tats
fd958cecf2 Merge branch 'master' of github.com:libremapping/libremapping
Conflicts:
	Common.cpp
	Common.h
	DestinationGLCanvas.cpp
	SourceGLCanvas.cpp
	main.cpp
2013-11-29 12:09:49 -05:00
Vasilis Liaskovitis
74894e59d1 MapperGLCanvas: Add click and drag functionality
Pressing the left-mouse button close enough to a vertex makes that vertex the
current / active one to operate on. If the button is not released, the vertex
can be dragged on the canvas. If on the source canvas, updates on the
destination canvas can be seen dynamically.

The user needs to click within a specific distance around a vertex otherwise
the click will have no effect in vertex selection. Distances of all vertices
from the point clicked are calculated (manhattan distance, but other can be
used) and the vertex with the smallest distance is declared as the new active
one.

An active vertex variable is also added in the Shape class. Both mouse and key
events update the active vertex of a shape (tested only with quad so far). So
the active vertex is no longer a static variable in the key event handler, but
is common state shared by both mouse and key event handlers.
2013-11-29 15:35:34 +02:00
Alexandre Quessy
ed1056527d Always draw OpenGL shapes' vertices in a counterclockwise order 2013-11-26 22:08:02 -05:00
Tats
11616282b0 Allows selection of the source: changes the source in the canvases 2013-11-26 13:38:36 -05:00
Tats
3889b68ad3 Merge branch 'qt-port'
Conflicts:
	MapperGLCanvas.cpp
2013-11-24 10:34:36 -05:00
Tats
54c199f8fd Correct management of source<->destionation interaction using signals/slots 2013-11-24 09:27:28 -05:00
Tats
4310f297d1 Done: reproduced the wxwidgets prototype in Qt 2013-11-23 23:16:04 -05:00
Tats
fbeddb0def Fix: move lines (focus by clicking) 2013-11-23 17:43:12 -05:00
Tats
5c1ec14662 Basic switch from wxWidget to Qt (not working yet) 2013-11-23 17:37:59 -05:00
sylvain
42e839b179 Fix filcker 2013-11-23 15:23:11 -05:00
Tats
06ecc20f83 Multi-source harcoded: switch between mappings 2013-11-16 11:41:39 +01:00
Tats
32924471e0 Copy wx-02-input-output to root 2013-11-15 16:12:22 +01:00