HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSS_ReusableSelector.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: MSS_ReusableSelector.h ( Direct Manipulation Library, C++)
7  *
8  * COMMENTS:
9  * Custom selector meant to create a new node only if one isn't already
10  * present. If the node exists, it reuses it.
11  */
12 
13 #ifndef __MSS_ReusableSelector_h__
14 #define __MSS_ReusableSelector_h__
15 
16 #include "MSS_API.h"
17 #include <UT/UT_String.h>
19 
21 {
22 public:
23  MSS_ReusableSelector(OP3D_View &viewer,
24  PI_SelectorTemplate &templ,
25  const char *sopname,
26  const char *groupparm = 0,
27  const char *grouptypeparm = 0,
28  bool allowblankgroup = false);
29  ~MSS_ReusableSelector() override;
30 
31  const char *className() const override;
32 
33  // Generate special SOPs and Merge SOPs as necessary and fill in
34  // group parameters in the SOPs to enable editing of the
35  // selected geometry. edit_node is set to the current working SOP node.
36  virtual bool connectSops(bool branch_off, bool request_new,
37  OP_Node *&edit_node);
38 
39  // If myInlineSelection is true, then we will set the selection into our
40  // edit_node even if the selection is not on it in connectSops().
41  void setInlineSelection(bool set_inline)
42  { myInlineSelection = set_inline; }
43  bool getInlineSelection(bool set_inline)
44  { return myInlineSelection; }
45 
46  // Synchronize the current component type from the node. This method is
47  // intended to be called before startSelecting().
48  void syncGeometryTypeFromNode(OP_Node *node);
49 
50 protected:
51  virtual void setGroupParm(OP_Node *node, const char *value);
52  virtual void setGroupTypeParm(OP_Node *node, int value);
53 
54  /// Returns the name of the reusable SOP.
56  { return mySopName; }
57 
58 private:
59  UT_String mySopName;
60  UT_String myGroupParm;
61  UT_String myGroupTypeParm;
62  bool myAllowBlankGroup;
63  bool myInlineSelection;
64 };
65 
66 #endif
bool getInlineSelection(bool set_inline)
const char * className() const override
UT_String getSopName()
Returns the name of the reusable SOP.
#define MSS_API
Definition: MSS_API.h:10
void setInlineSelection(bool set_inline)
Definition: core.h:1131