#include <c4d_general.h>
Used to select any GUI element with a lasso.
Private Member Functions | |
| LassoSelection () | |
| ~LassoSelection () | |
Alloc/Free | |
| static LassoSelection * | Alloc () |
| static void | Free (LassoSelection *&ls) |
Start | |
| Bool | Start (GeDialog &dlg, Int32 mode, Int32 start_x=-1, Int32 start_y=-1, Int32 start_button=-1, Int32 sx1=-1, Int32 sy1=-1, Int32 sx2=-1, Int32 sy2=-1) |
| Bool | Start (GeUserArea &ua, Int32 mode, Int32 start_x=-1, Int32 start_y=-1, Int32 start_button=-1, Int32 sx1=-1, Int32 sy1=-1, Int32 sx2=-1, Int32 sy2=-1) |
| Bool | Start (EditorWindow *win, Int32 mode, Int32 start_x=-1, Int32 start_y=-1, Int32 start_button=-1, Int32 sx1=-1, Int32 sy1=-1, Int32 sx2=-1, Int32 sy2=-1) |
Check/Test | |
| Bool | CheckSingleClick () |
| Bool | Test (Int32 x, Int32 y) |
| Bool | TestPolygon (const Vector &pa, const Vector &pb, const Vector &pc, const Vector &pd) |
Miscellaneous | |
| Int32 | GetMode () |
| Bool | GetRectangle (Float &x1, Float &y1, Float &x2, Float &y2) |
|
private |
|
private |
|
static |
|
static |
| Bool Start | ( | GeDialog & | dlg, |
| Int32 | mode, | ||
| Int32 | start_x = -1, |
||
| Int32 | start_y = -1, |
||
| Int32 | start_button = -1, |
||
| Int32 | sx1 = -1, |
||
| Int32 | sy1 = -1, |
||
| Int32 | sx2 = -1, |
||
| Int32 | sy2 = -1 |
||
| ) |
Starts the lasso selection in a dialog.
If start_x, start_y and start_button are not passed then the call waits for the user to click. It is only needed to pass them if the mouse has already been hit.
Optionally specify a visual clipping boundary rectangle from (sx1,sy1) to (sx2,sy2).
| [in] | dlg | The dialog to draw the lasso in. The caller owns the pointed dialog. |
| [in] | mode | The lasso mode: MOUSESELECT |
| [in] | start_x | The start X position, or NOTOK to wait for mouse down. |
| [in] | start_y | The start Y position, or NOTOK to wait for mouse down. |
| [in] | start_button | The start button, or NOTOK to wait for mouse down: BFM_INPUT_CHANNEL |
| [in] | sx1 | The optional left X coordinate of the clipping boundary. |
| [in] | sy1 | The optional top Y coordinate of the clipping boundary. |
| [in] | sx2 | The optional right X coordinate of the clipping boundary. |
| [in] | sy2 | The optional bottom Y coordinate of the clipping boundary. |
| Bool Start | ( | GeUserArea & | ua, |
| Int32 | mode, | ||
| Int32 | start_x = -1, |
||
| Int32 | start_y = -1, |
||
| Int32 | start_button = -1, |
||
| Int32 | sx1 = -1, |
||
| Int32 | sy1 = -1, |
||
| Int32 | sx2 = -1, |
||
| Int32 | sy2 = -1 |
||
| ) |
Starts the lasso selection in a user area.
If start_x, start_y and start_button are not passed then the call waits for the user to click. It is only needed to pass them if the mouse has already been hit.
Optionally specify a visual clipping boundary rectangle from (sx1,sy1) to (sx2,sy2).
| [in] | ua | The user area to draw the lasso in. The caller owns the pointed user area. |
| [in] | mode | The lasso mode: MOUSESELECT |
| [in] | start_x | The start X position, or NOTOK to wait for mouse down. |
| [in] | start_y | The start Y position, or NOTOK to wait for mouse down. |
| [in] | start_button | The start button, or NOTOK to wait for mouse down: BFM_INPUT_CHANNEL |
| [in] | sx1 | The optional left X coordinate of the clipping boundary. |
| [in] | sy1 | The optional top Y coordinate of the clipping boundary. |
| [in] | sx2 | The optional right X coordinate of the clipping boundary. |
| [in] | sy2 | The optional bottom Y coordinate of the clipping boundary. |
| Bool Start | ( | EditorWindow * | win, |
| Int32 | mode, | ||
| Int32 | start_x = -1, |
||
| Int32 | start_y = -1, |
||
| Int32 | start_button = -1, |
||
| Int32 | sx1 = -1, |
||
| Int32 | sy1 = -1, |
||
| Int32 | sx2 = -1, |
||
| Int32 | sy2 = -1 |
||
| ) |
Starts the lasso selection in an editor window.
If start_x, start_y and start_button are not passed then the call waits for the user to click. It is only needed to pass them if the mouse has already been hit.
Optionally specify a visual clipping boundary rectangle from (sx1,sy1) to (sx2,sy2).
| [in] | win | The editor window to draw the lasso in. The caller owns the pointed editor window. |
| [in] | mode | The lasso mode: MOUSESELECT |
| [in] | start_x | The start X position, or NOTOK to wait for mouse down. |
| [in] | start_y | The start Y position, or NOTOK to wait for mouse down. |
| [in] | start_button | The start button, or NOTOK to wait for mouse down: BFM_INPUT_CHANNEL |
| [in] | sx1 | The optional left X coordinate of the clipping boundary. |
| [in] | sy1 | The optional top Y coordinate of the clipping boundary. |
| [in] | sx2 | The optional right X coordinate of the clipping boundary. |
| [in] | sy2 | The optional bottom Y coordinate of the clipping boundary. |
| Bool CheckSingleClick | ( | ) |
Checks if the user did not move the mouse.
Tests if the point (x,y) is inside the lasso selection.
| [in] | x | The X coordinate. |
| [in] | y | The Y coordinate. |
Tests if the 2D polygon a-b-c-d is inside the selection. The point c can be equal to d in case of a triangle.
| [in] | pa | The first point. |
| [in] | pb | The second point. |
| [in] | pc | The third point. |
| [in] | pd | The fourth point, or equal to pc for triangles. |
| Int32 GetMode | ( | ) |
Gets the mode passed to Start().
Gets the selection rectangle.
| [out] | x1 | Assigned the X coordinate of the top-left rectangle corner. |
| [out] | y1 | Assigned the Y coordinate of the top-left rectangle corner. |
| [out] | x2 | Assigned the X coordinate of the bottom-right rectangle corner. |
| [out] | y2 | Assigned the Y coordinate of the bottom-right rectangle corner. |