File : API\core\tools\toolTypes.h Namespace : core::tools
//
// Tool's requirements. Each tool might require variouse user input.
//
#define TOOL_REQUIRES_MOUSEL 0x00000001
#define TOOL_REQUIRES_MOUSER 0x00000002
#define TOOL_REQUIRES_MOUSEM 0x00000004
#define TOOL_REQUIRES_MOUSEW 0x00000008
#define TOOL_ALTERNATIVE_BIT 0x10000000
#define TOOL_REQUIRES_LEV_NODE 0x20000000
#define TOOL_REQUIRES_LEV_MANIPULATOR 0x40000000
#define TOOL_ALTERNATIVE(_code) ((_code) | TOOL_ALTERNATIVE_BIT)
#define TOOL_CODEMASK(_code) ((_code) & 0xFFFFFF)
#define IS_ALTERNATE(_code) (TOOL_ALTERNATIVE_BIT == ((_code) & TOOL_ALTERNATIVE_BIT))
#define IS_TOOL_OVERLAP(_c1, _c2) \
((IS_ALTERNATE(_c1) == IS_ALTERNATE(_c2)) && \
(0!=(TOOL_CODEMASK(_c1) & TOOL_CODEMASK(_c2))))
Tool requirements for user input. Or, literally, what tool uses to be applied. Among mouse button requirements tool can be marked as alternative and will be applied only when Alt key is held down.
The values above are used as bitwise-or combination ret-val argument in ITool::requires method to determine whether tool can be active with other tools selected and to determine whether certain methods have to be invoked when user interacts in a viewport. For example, tool that uses only right mouse button (TOOL_REQUIRES_MOUSER) will not be invokedn when user left-clicks.
//-------------------------------------------------------
// @name : CSelectQuadr::requires
// Tool requirements
// @param DWORD& dwRequires : ret-val
//
// @return ZRESULT :
//-------------------------------------------------------
ZRESULT CSelectQuadr::requires(DWORD& dwRequires) const
{
dwRequires = TOOL_REQUIRES_MOUSER;
return ZRESULT_OK;
}