diff options
author | Adam NAILI | 2017-12-28 22:52:28 +0100 |
---|---|---|
committer | Adam NAILI | 2017-12-28 22:52:28 +0100 |
commit | 9ed3c28a0335137d34e51d5fd49be6e523f65a89 (patch) | |
tree | 1abc903ff235f921eecadcbb68fe7a37449274e0 /include/gui/pictureframe.h | |
parent | 9e4eb30f33867bcb37d5accfb5588cfb3b450f90 (diff) | |
download | morpher-9ed3c28a0335137d34e51d5fd49be6e523f65a89.tar.gz |
Implementing the add constraint feature, need to be fixed
Diffstat (limited to 'include/gui/pictureframe.h')
-rw-r--r-- | include/gui/pictureframe.h | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/include/gui/pictureframe.h b/include/gui/pictureframe.h index 1f5407c..f06a530 100644 --- a/include/gui/pictureframe.h +++ b/include/gui/pictureframe.h | |||
@@ -1,13 +1,14 @@ | |||
1 | #ifndef UPEM_MORPHING_PITUREFRAME | 1 | #ifndef UPEM_MORPHING_PITUREFRAME |
2 | #define UPEM_MORPHING_PITUREFRAME | 2 | #define UPEM_MORPHING_PITUREFRAME |
3 | 3 | ||
4 | #include <blender/canvas.h> | ||
5 | #include <morpher/morphing.h> | 4 | #include <morpher/morphing.h> |
5 | #include <painter/canvas.h> | ||
6 | #include "component.h" | 6 | #include "component.h" |
7 | |||
8 | /** | 7 | /** |
9 | * File: pictureframe.h | 8 | * File: pictureframe.h |
10 | */ | 9 | */ |
10 | |||
11 | CartesianVector savedPoint; | ||
11 | /** | 12 | /** |
12 | * Type: CartesianMappingDivision | 13 | * Type: CartesianMappingDivision |
13 | * Type of functions needed to split CartesianMapping and keep only the CartesianVector needed, related to the type of PictureFrame involved | 14 | * Type of functions needed to split CartesianMapping and keep only the CartesianVector needed, related to the type of PictureFrame involved |
@@ -49,8 +50,24 @@ CartesianVector pictureframe_origin_split(const CartesianMapping *cartesianMappi | |||
49 | */ | 50 | */ |
50 | CartesianVector pictureframe_target_split(const CartesianMapping *cartesianMapping); | 51 | CartesianVector pictureframe_target_split(const CartesianMapping *cartesianMapping); |
51 | 52 | ||
53 | bool pictureframe_is_selected(int x, int y, PictureFrame *pictureFrame); | ||
54 | |||
55 | /** | ||
56 | * Function: pictureframe_conversion_to_origin | ||
57 | * Returns the relative coordinate on the picture corresponding to the input values | ||
58 | * | ||
59 | * Parameters: | ||
60 | * x - value on x axis from the origin of the window to convert | ||
61 | * y - value on y axis from the origin of the window to convert | ||
62 | * *pictureFrame - pointer to the reference pictureframe that will give his relative coordinates | ||
63 | */ | ||
64 | CartesianVector pictureframe_conversion_to_origin(int x, int y, PictureFrame *pictureFrame); | ||
65 | |||
66 | CartesianVector pictureframe_conversion_to_picture(int x, int y, PictureFrame *pictureFrame); | ||
67 | |||
52 | void pictureframe_init(PictureFrame *pictureFrame, int width, int height, int x_pos, int y_pos, | 68 | void pictureframe_init(PictureFrame *pictureFrame, int width, int height, int x_pos, int y_pos, |
53 | CartesianMappingDivision cartesianMappingDivision, Morphing *morphing, Canvas *canvas); | 69 | CartesianMappingDivision cartesianMappingDivision, Morphing *morphing, Canvas *canvas, |
70 | ClickHandler clickHandler); | ||
54 | 71 | ||
55 | void pictureframe_free(PictureFrame *pictureFrame); | 72 | void pictureframe_free(PictureFrame *pictureFrame); |
56 | 73 | ||
@@ -73,7 +90,18 @@ void pictureframe_draw_canvas(PictureFrame *pictureFrame); | |||
73 | void pictureframe_print(Component *parameterSelf); | 90 | void pictureframe_print(Component *parameterSelf); |
74 | 91 | ||
75 | /** | 92 | /** |
76 | * Function: pictureframe_click_handler | 93 | * Function: pictureframe_click_handler_origin |
94 | * Adds a point on the coordinate of the picture that the mouse is pointing. | ||
95 | * | ||
96 | * Parameters: | ||
97 | * x_pos - coordinate on x axis of the mouse | ||
98 | * y_pos - coordinate on y axis of the mouse | ||
99 | * *parameterSelf - pointer that will be casted into a PictureFrame | ||
100 | */ | ||
101 | void pictureframe_click_handler_origin(int x_pos, int y_pos, Component *parameterSelf); | ||
102 | |||
103 | /** | ||
104 | * Function: pictureframe_click_handler_target | ||
77 | * Adds a point on the coordinate of the picture that the mouse is pointing. | 105 | * Adds a point on the coordinate of the picture that the mouse is pointing. |
78 | * | 106 | * |
79 | * Parameters: | 107 | * Parameters: |
@@ -81,7 +109,7 @@ void pictureframe_print(Component *parameterSelf); | |||
81 | * y_pos - coordinate on y axis of the mouse | 109 | * y_pos - coordinate on y axis of the mouse |
82 | * *parameterSelf - pointer that will be casted into a PictureFrame | 110 | * *parameterSelf - pointer that will be casted into a PictureFrame |
83 | */ | 111 | */ |
84 | void pictureframe_click_handler(int x_pos, int y_pos, Component *parameterSelf); | 112 | void pictureframe_click_handler_target(int x_pos, int y_pos, Component *parameterSelf); |
85 | 113 | ||
86 | 114 | ||
87 | #endif | 115 | #endif |