HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_CommandManager.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: OP_CommandManager.h ( OP Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __OP_CommandManager__
12 #define __OP_CommandManager__
13 
14 #include "OP_API.h"
15 #include <CMD/CMD_Manager.h>
16 
17 class UT_WorkBuffer;
18 class OP_Node;
19 class PRM_Parm;
20 class CH_Channel;
21 class CH_ChannelRef;
22 
23 
25 {
26 public:
27  OP_CommandManager(const char *appname);
28  ~OP_CommandManager() override;
29 
30 
31  /// The following methods are used to extract information from channel
32  /// references.
33  virtual void getChRefData(const CH_ChannelRef &r,
34  OP_Node **pnode, CH_Channel **pchp,
35  PRM_Parm **ppparm, int *subindex) const;
36 
37  virtual OP_Node *getChRefOpNode(const CH_ChannelRef &r) const;
38 
39  virtual int getChRefParmIndex(
40  const CH_ChannelRef &r,
41  int *subindex) const;
42  virtual PRM_Parm *getChRefParm(
43  const CH_ChannelRef &r,
44  int *subindex) const;
45 
46  virtual PRM_Parm *getChRefFullParm(const CH_ChannelRef &r) const;
47 
48  CH_Channel *getChRefChannel(const CH_ChannelRef &r) const override;
49 
50  bool isOwnerExposed(const CH_ChannelRef &r) const override;
51 
53  int node_id) const override;
54 
55  /// This method will return true if the channel reference r matches the
56  /// pattern patt, or false otherwise.
57  bool match(const CH_ChannelRef &r, const char *patt) const;
58 
59 
60  /// The following methods are used to build channel references using,
61  /// nodes, parms or channels. The passed in channel reference r will
62  /// be filled in with the appropriate data.
63  /// Return true if success, false otherwise.
65  const CH_Channel *chp) const override;
66 
67  virtual bool buildChanRef(CH_ChannelRef &r,
68  const OP_Node *node,
69  const PRM_Parm *parm) const;
70 
71  virtual bool buildChanRef(CH_ChannelRef &r,
72  const OP_Node &node,
73  const char *channel_name) const;
74 
75  virtual bool buildChanRef(CH_ChannelRef &r,
76  const OP_Node *node,
77  const PRM_Parm *parm,
78  int subindex) const;
80  const char *path) const override;
81 
82 
83  /// Returns 0 if r1 and r2 are equal, -1 if r1 < r2 and 1 if r1 > r2
84  int compareChanRefs(
85  const CH_ChannelRef &r1,
86  const CH_ChannelRef &r2) const override;
87 
88  /// Returns 0 if r1 and r2 are equal, -1 if r1 < r2 and 1 if r1 > r2
89  int compareLayerRefs(
90  const CH_ChannelRef &r1,
91  const CH_ChannelRef &r2) const override;
92 
93  // Returns a full path from a given channel reference
94  void getChanRefPath(
95  const CH_ChannelRef &r,
96  UT_String &path,
97  bool use_alias = false) const override;
98 
99  /// Returns Python code representing the list of channel references
100  void getChanRefsPythonListCode(
101  const CH_ChannelRefList &chanrefs,
103 
104  /// Returns a list of unique nodes corresponding to the given channel ref
105  /// list. The order of the nodes will match chanrefs.
106  static void getChRefUniqueNodes(const CH_ChannelRefList &chanrefs,
107  UT_ValArray<OP_Node *> &nodes);
108 
109  // Query trust using the current operational context.
110  bool inTrustedContextForNode(const OP_Node *node, int thread) const;
111  bool inTrustedContextForNodeContents(
112  const OP_Node *node, int thread) const;
113 
114  CH_ScriptAccessManager *getAccessManager(int thread) override;
115 
117  const CH_ChannelRef& r,
118  CH_ChannelRef& out_export) override;
119 
121  const CH_ChannelRef &chref) const override;
122 
123  // Resolve channel labels and node path without exposing OP_Node*
124  bool getChRefLabelForUI(
125  const CH_ChannelRef &r,
126  UT_String &ret) const override;
127  bool getChRefAlias(
128  const CH_ChannelRef &r,
129  UT_String &ret) const override;
130  bool getChRefNodePath(
131  const CH_ChannelRef &r,
132  UT_String &ret) const override;
133 };
134 
135 #endif
virtual bool isOwnerExposed(const CH_ChannelRef &r) const
virtual void getChannelsWithNodeId(CH_ChannelList &chans, int node_id) const
bool getChRefAlias(const CH_ChannelRef &r, UT_String &ret) const override
bool getChRefNodePath(const CH_ChannelRef &r, UT_String &ret) const override
virtual bool buildChanRef(CH_ChannelRef &r, const CH_Channel *chp) const
Use this method to build a channel reference from a channel pointer.
virtual bool resolveChanRefExport(const CH_ChannelRef &r, CH_ChannelRef &out_export)
*Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
virtual int compareChanRefs(const CH_ChannelRef &r1, const CH_ChannelRef &r2) const
virtual void getChanRefPath(const CH_ChannelRef &r, UT_String &path, bool use_alias=false) const
Use this method to get the full path of the channel referenced by r.
GLsizei const GLchar *const * path
Definition: glew.h:6461
#define OP_API
Definition: OP_API.h:10
virtual int compareLayerRefs(const CH_ChannelRef &r1, const CH_ChannelRef &r2) const
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
virtual CH_ScriptAccessManager * getAccessManager(int)
Definition: CH_Manager.h:1202
GLuint64EXT * result
Definition: glew.h:14007
virtual bool getChannelAutoSelect(const CH_ChannelRef &chref) const
Definition: CH_Manager.h:1452
virtual CH_Channel * getChRefChannel(const CH_ChannelRef &r) const
bool getChRefLabelForUI(const CH_ChannelRef &r, UT_String &ret) const override