LassoSelection Class Reference

#include <c4d_general.h>

详细描述

Used to select any GUI element with a lasso.

私有成员函数

  LassoSelection ()
  ~LassoSelection ()

Alloc/Free

static LassoSelection Alloc ()
static void  Free ( LassoSelection *&ls)

开始

Bool   开始 ( GeDialog &dlg, Int32 模式, 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   开始 ( GeUserArea &ua, Int32 模式, 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   开始 ( EditorWindow *win, Int32 模式, 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 向量 &pa, const 向量 &pb, const 向量 &pc, const 向量 &pd)

杂项

Int32   GetMode ()
Bool   GetRectangle ( Float &x1, Float &y1, Float &x2, Float &y2)

构造函数 & 析构函数文档编制

◆  LassoSelection()

LassoSelection () private

◆  ~LassoSelection()

~ LassoSelection () private

成员函数文档编制

◆  Alloc()

static LassoSelection * Alloc ( )
static

Allocates a lasso selection. Destroy the allocated lasso selection with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

返回
The allocated lasso selection, or nullptr if the allocation failed.

◆  Free()

static void Free ( LassoSelection *&  ls )
static

Destructs lasso selections allocated with Alloc() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

参数
[in,out] ls The lasso selection to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  Start() [1/3]

Bool 开始 ( 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.
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.
返回
true if the user selected elements in the dialog with the lasso, otherwise false .

◆  Start() [2/3]

Bool 开始 ( 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.
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.
返回
true if the user selected elements in the user area with the lasso, otherwise false .

◆  Start() [3/3]

Bool 开始 ( 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.
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.
返回
true if the user selected elements in the editor window with the lasso, otherwise false .

◆  CheckSingleClick()

Bool CheckSingleClick ( )

Checks if the user did not move the mouse.

返回
true if the user single clicked, otherwise false .

◆  Test()

Bool Test ( Int32   x ,
Int32   y  
)

Tests if the point ( x , y ) is inside the lasso selection.

参数
[in] x The X coordinate.
[in] y The Y coordinate.
返回
true if the point is within the lasso, otherwise false .

◆  TestPolygon()

Bool TestPolygon ( const 向量 pa ,
const 向量 pb ,
const 向量 pc ,
const 向量 pd  
)

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.

注意
Checks if the 2D polygon is fully or partially within the lasso selection.
参数
[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.
返回
true if the polygon is within the lasso, otherwise false .

◆  GetMode()

Int32 GetMode ( )

Gets the mode passed to Start() .

返回
The lasso mode: MOUSESELECT

◆  GetRectangle()

Bool GetRectangle ( Float x1 ,
Float y1 ,
Float x2 ,
Float y2  
)

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.
返回
true if the selection rectangle was retrieved, otherwise false .