HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DM_InputSelector.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: DM_InputSelector.h ( Direct Manipulation Library, C++)
7  *
8  * COMMENTS:
9  * The base class for objects that select the inputs of a sop or obj.
10  */
11 
12 #ifndef __DM_InputSelector_h__
13 #define __DM_InputSelector_h__
14 
15 #include "DM_API.h"
16 #include <GUI/GUI_RenderCommon.h>
17 #include <BM/BM_InputSelector.h>
18 #include <GEO/GEO_PrimTypeCompat.h>
19 #include <GU/GU_SelectType.h>
20 
21 class DM_Viewport;
22 class UI_Menu;
23 
25 {
26 public:
27  DM_InputSelector(BM_View &viewer,
28  PI_SelectorTemplate &templ);
29  virtual ~DM_InputSelector();
30 
31  virtual const char *className() const;
32 
33  // Gets a string representing the current selection.
34  virtual void generateAllSelectionStrings(UT_String &sel_string,
35  bool only_one_gdp,
36  bool force_numeric,
37  bool consume_selections);
38 
39  // Override this virtual to allow other classes to programatically force
40  // this selector to convert any current pre-seleciton in the viewport to
41  // a real selection on the geometry. Does nothing by default.
42  virtual void commitViewportPreSelection(UI_Event *event,
43  GU_SelectionRule sel_rule);
44 
45  // Override this virtual to let the selector expose a list of looks
46  // that the selector can pick from.
47  virtual void getSelectableLooks(GUI_DetailList &look_list);
48 
49  // Override to return a custom toolbar UI
50  virtual UI_Feel *getCustomToolbox() const { return nullptr; }
51 
52  // Selectors respond to keyboard events to know when to finish a selection
53  // stage and possibly enter the next.
54  virtual int handleKeyEvent(UI_Event *event,
55  DM_Viewport &viewport) = 0;
56 
57  // Return the feel containing the RMB menu. Subclasses implement this.
58  virtual UI_Menu *getSelectorMenu() const = 0;
59  virtual UI_Menu *getSelectorHotkeyMenu() const
60  { return nullptr; }
61 
62  virtual bool handleTransitoryKey(const UI_Event &event)
63  { return false; }
64 
65  // Override this virtual to return the types of primitives that this
66  // selector is interested in.
67  virtual GEO_PrimTypeCompat::TypeMask primMask() const;
68 };
69 
70 #endif
virtual const char * className() const
virtual UI_Menu * getSelectorHotkeyMenu() const
virtual bool handleTransitoryKey(const UI_Event &event)
struct _cl_event * event
Definition: glcorearb.h:2960
#define DM_API
Definition: DM_API.h:10
GU_SelectionRule
Definition: GU_SelectType.h:40
Contains transitional objects to provide some backward compatibility for code that references old GEO...
virtual UI_Feel * getCustomToolbox() const