HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VOP_TabMenuFilter.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: ( VOP Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __VOP_TabMenuFilter_h__
12 #define __VOP_TabMenuFilter_h__
13 
14 #include "VOP_API.h"
15 #include <OP/OP_Value.h>
16 #include <UT/UT_StringArray.h>
17 class OP_Network;
18 class OP_Operator;
19 
20 
22 {
23 public:
24  VOP_TabMenuFilter( OP_Network &network_node );
26 
27  /// Returns true if the given operator can show up in the Tab menu
28  /// inside the member network.
29  bool isOperatorAllowedInTabMenu( OP_Operator *op );
30 
31 
32  /// Returns true if the filter has an explicitly set mask (empty or not).
33  /// Ie, there is a spare parm on the network node that specifies the mask.
34  bool hasMask();
35 
36 private:
37  /// @{ Manages member data based on the network node's parameters.
38  void dirtyTabMenuContext();
39  void updateTabMenuContext();
40  /// @}
41 
42  /// Reacts to the change in the network node owning the Tab menu.
43  static void handleNetworkNodeChange( OP_Node *caller,
44  void *callee, OP_EventType t, void *data);
45 
46 private:
47  enum class FilterState
48  {
49  NEEDS_UPDATE, // Undetermined state yet.
50  FIND_WORD, // Find the keyword given in the mask string.
51  };
52 
53  FilterState myState; // State of this filter object.
54  UT_StringArray myTabMenuMask; // Target names/keywords to match.
55  OP_Network & myNetworkNode; // Network owning the Tab menu.
56  bool myHasMask; // Network has tab menu mask parm.
57 };
58 
59 #endif
60 
GLdouble GLdouble t
Definition: glew.h:1403
#define VOP_API
Definition: VOP_API.h:10
OP_EventType
Definition: OP_Value.h:22
Definition: format.h:895