HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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, int load_dsos = 1);
28  virtual ~OP_CommandManager();
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  virtual CH_Channel *getChRefChannel(const CH_ChannelRef &r) const;
49 
50  virtual bool isOwnerExposed(const CH_ChannelRef &r) const;
51 
52  virtual void getChannelsWithNodeId(CH_ChannelList &chans, int node_id) const;
53 
54  /// This method will return true if the channel reference r matches the
55  /// pattern patt, or false otherwise.
56  bool match(const CH_ChannelRef &r, const char *patt) const;
57 
58 
59  /// The following methods are used to build channel references using,
60  /// nodes, parms or channels. The passed in channel reference r will
61  /// be filled in with the appropriate data.
62  /// Return true if success, false otherwise.
63  virtual bool buildChanRef(CH_ChannelRef &r,
64  const CH_Channel *chp) const;
65 
66  virtual bool buildChanRef(CH_ChannelRef &r,
67  const OP_Node *node,
68  const PRM_Parm *parm) const;
69 
70  virtual bool buildChanRef(CH_ChannelRef &r,
71  const OP_Node &node,
72  const char *channel_name) const;
73 
74  virtual bool buildChanRef(CH_ChannelRef &r,
75  const OP_Node *node,
76  const PRM_Parm *parm,
77  int subindex) const;
78  virtual bool buildChanRef(CH_ChannelRef &r,
79  const char *path) const;
80 
81 
82  /// Returns 0 if r1 and r2 are equal, -1 if r1 < r2 and 1 if r1 > r2
83  virtual int compareChanRefs(const CH_ChannelRef &r1,
84  const CH_ChannelRef &r2) const;
85 
86  /// Returns 0 if r1 and r2 are equal, -1 if r1 < r2 and 1 if r1 > r2
87  virtual int compareLayerRefs(const CH_ChannelRef &r1,
88  const CH_ChannelRef &r2) const;
89 
90  // Returns a full path from a given channel reference
91  virtual void getChanRefPath(const CH_ChannelRef &r,
92  UT_String &path,
93  bool use_alias = false) const;
94 
95  /// Returns Python code representing the list of channel references
96  void getChanRefsPythonListCode(
97  const CH_ChannelRefList &chanrefs,
98  UT_WorkBuffer &result);
99 
100  /// Returns a list of unique nodes corresponding to the given channel ref
101  /// list. The order of the nodes will match chanrefs.
102  static void getChRefUniqueNodes(const CH_ChannelRefList &chanrefs,
103  UT_ValArray<OP_Node *> &nodes);
104 
105  // Query trust using the current operational context.
106  bool inTrustedContextForNode(const OP_Node *node, int thread) const;
107  bool inTrustedContextForNodeContents(
108  const OP_Node *node, int thread) const;
109 
110  virtual CH_ScriptAccessManager *getAccessManager(int thread);
111 
112  virtual bool resolveChanRefExport( const CH_ChannelRef& r, CH_ChannelRef& out_export );
113 };
114 
115 #endif
virtual bool isOwnerExposed(const CH_ChannelRef &r) const
virtual void getChannelsWithNodeId(CH_ChannelList &chans, int node_id) const
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
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)
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.
#define OP_API
Definition: OP_API.h:10
virtual int compareLayerRefs(const CH_ChannelRef &r1, const CH_ChannelRef &r2) const
virtual CH_ScriptAccessManager * getAccessManager(int)
Definition: CH_Manager.h:1172
GLboolean r
Definition: glcorearb.h:1221
virtual CH_Channel * getChRefChannel(const CH_ChannelRef &r) const