Commit Graph

50 Commits

Author SHA1 Message Date
Tats
e8870db92a Replaced Shape by MShape to avoid name conflicts. 2014-10-31 17:03:18 -04:00
Tats
ca78874387 Cosmetic changes 2014-05-03 13:17:00 -04:00
Tats
0711e236f6 Implemented constraining of vertices in polygons (esp. meshes) to avoid line crossing problems. Working at 99%. 2014-05-03 13:16:47 -04:00
Tats
f5d375442a Improved the style of the control rendering. 2014-05-03 00:26:02 -04:00
Tats
eded602ef9 Fixed bug: texture meshes points were not loaded in the right order 2014-04-04 00:54:17 -04:00
Alexandre Quessy
a7608e5413 mv Math.h Maths.h, caused problems on Mac 2014-03-30 11:50:04 -04:00
Tats
f2a7e93b36 Prevents quad / polygon vertices to cross a segment (ie. makes sure they stay simple polygons). 2014-03-19 22:35:22 -04:00
Tats
441664e6f0 Added a Polygon shape and corresponding mappers (just used as a superclass of Quad and Triangle for now). 2014-03-19 22:34:34 -04:00
Tats
8256ace2e1 Added sanity check for ellipses (makes sure the points are ok). 2014-03-02 22:29:36 -05:00
Tats
d0e697d77a Remove unused center control point for color ellipses. 2014-03-02 21:07:11 -05:00
Tats
755b7cfa94 Use QTransform to manage point remapping when moving vertices. 2014-03-02 20:49:59 -05:00
Tats
964a968b36 Added center control point (basic functionality, just "stays inside" the ellipse for now but not working 100%) 2014-03-02 17:43:44 -05:00
Tats
e72a1a3c77 Override of includesPoint() methods in Ellipse. 2014-03-02 17:37:49 -05:00
Tats
dea2781100 Modification of includePoint() method to work with qreal instead of int (also overloaded for QPointF). 2014-03-02 17:37:10 -05:00
Tats
4bbe4df115 Added methods to directly access the horizontal / vertical radius of an ellipse. 2014-03-02 17:35:54 -05:00
Tats
0b027f29f3 Implemented basic support for texture ellipse (works, default center point, no drawing of control points). 2014-03-02 17:02:52 -05:00
Tats
8964876b0a Ellipse overrides setVertex() in order to limit placement of vertices correctly. 2014-02-09 02:39:29 -05:00
Tats
02fe8650c5 Fixed small error in the way color ellipses were drawn (wrong coordinates). 2014-02-09 01:36:23 -05:00
Tats
9938793ddd Adapted ellipse code to latest changes (Point -> QPointF). 2014-02-09 01:21:22 -05:00
Tats
1dbb174d86 Merge branch 'develop' into ellipseshape
Conflicts:
	Shape.h
2014-02-09 01:20:54 -05:00
Tats
e36cb1a991 Replace std::vector and std::map by QVector and QMap (not everywhere yet). 2014-02-09 01:02:54 -05:00
Tats
195c426991 Removed the Point class and replace all instances by QPointF. 2014-02-09 01:02:13 -05:00
Tats
ac555b7b10 Added basic support for color ellipses 2014-02-08 23:44:56 -05:00
Tats
3692565d94 Comment cleanup in Shape 2014-01-22 14:59:54 -05:00
Tats
3de61fc6dc Some accessor functions in the Mesh class 2014-01-22 14:59:45 -05:00
Tats
478e5681a7 Added a toPolygon() method to Shape 2014-01-22 14:59:18 -05:00
Tats
f7cdb15754 Added a method that returns an enclosing polygon based on a shape. 2014-01-22 13:30:39 -05:00
Tats
9219cee81c Add save/load of meshes 2014-01-11 23:02:52 -05:00
Tats
2fb214060b Reading and writing of triangle mappings 2014-01-11 21:56:18 -05:00
Tats
0a45fdfdc3 Merge branch 'statesaving' of github.com:libremapping/libremapping into statesaving
Conflicts:
	MainWindow.cpp
	Shape.h
2014-01-05 18:14:08 -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
Alexandre Quessy
586751cfab some progress in facade 2014-01-05 17:27:24 -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
245a74c5c9 Transferred implementations of Shape methods to .cpp file 2013-12-12 21:38:13 -05:00
Tats
88bc2dd745 Mesh properties allows one to add columns and rows 2013-12-11 00:10:04 -05:00
Tats
b808c982f8 Implemented support for meshes: allows for adding columns and rows to meshes 2013-12-10 22:27:06 -05:00
Alexandre Quessy
dce8f0b35d Saves an XML file. 2013-12-09 15:20:33 -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
0015e237c9 Added support for triangles 2013-11-30 23:55:25 -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
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
0e73f157f8 Document with Doxygen 2013-11-27 01:33:04 -05:00
Alexandre Quessy
944ede8587 Add typedefs for std::tr1::shared_ptr<*> 2013-11-26 22:25:11 -05:00
Alexandre Quessy
ed1056527d Always draw OpenGL shapes' vertices in a counterclockwise order 2013-11-26 22:08:02 -05:00
Tats
32924471e0 Copy wx-02-input-output to root 2013-11-15 16:12:22 +01:00