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 class UI_KeyResolveInfo;
24 
26 {
27 public:
28  DM_InputSelector(BM_View &viewer,
29  PI_SelectorTemplate &templ);
30  ~DM_InputSelector() override;
31 
32  const char *className() const override;
33 
34  // Gets a string representing the current selection.
35  virtual void generateAllSelectionStrings(UT_String &sel_string,
36  bool only_one_gdp,
37  bool force_numeric,
38  bool consume_selections);
39 
40  // Override this virtual to allow other classes to programatically force
41  // this selector to convert any current pre-seleciton in the viewport to
42  // a real selection on the geometry. Does nothing by default.
43  virtual void commitViewportPreSelection(UI_Event *event,
44  GU_SelectionRule sel_rule);
45 
46  // Override this virtual to let the selector expose a list of looks
47  // that the selector can pick from.
48  virtual void getSelectableLooks(GUI_DetailList &look_list);
49 
50  // Override to return a custom toolbar UI
51  virtual UI_Feel *getCustomToolbox() const { return nullptr; }
52 
53  virtual void getKeyResolveInfo(UI_KeyResolveInfo &info) = 0;
54 
55  // Selectors respond to keyboard events to know when to finish a selection
56  // stage and possibly enter the next.
57  virtual int handleKeyEvent(int key, UI_Event *event,
58  DM_Viewport &viewport) = 0;
59 
60  // Return the feel containing the RMB menu. Subclasses implement this.
61  virtual UI_Menu *getSelectorMenu() const = 0;
62  virtual UI_Menu *getSelectorHotkeyMenu() const
63  { return nullptr; }
64 
65  virtual bool handleTransitoryKey(const UI_Event &event,
66  int /*hotkey_id*/)
67  { return false; }
68 
69  // Override this virtual to return the types of primitives that this
70  // selector is interested in.
71  virtual GEO_PrimTypeCompat::TypeMask primMask() const;
72 
73  // Derived classes can override these virtuals to support
74  // a drawable selection
75  virtual bool canSelectDrawables() const;
76  virtual const UT_StringArray& drawableMask() const;
77  virtual void onLocateDrawableSelection();
78 };
79 
80 #endif
virtual UI_Menu * getSelectorHotkeyMenu() const
virtual bool handleTransitoryKey(const UI_Event &event, int)
struct _cl_event * event
Definition: glcorearb.h:2961
#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
const char * className() const override