HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_Channels.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_Channels.h (C++)
7  *
8  * COMMENTS: OP_Channels is a channel collection used by an OP_Node
9  * object. This class implements the pure virtuals defined
10  * in CH_Collection to access local variables and the channel
11  * collection hierarchy.
12  *
13  * there are two uses of this class
14  * 1: as a channel holder for each OP_Node
15  * 2: as a channel holder to do copying and pasting
16  *
17  * appropriate methods/variables are marked accordingly
18  * this should be two or three classes maybe, but there is no
19  * reason to do this now.
20  *
21  */
22 
23 #ifndef __OP_Channels__
24 #define __OP_Channels__
25 
26 #include "OP_API.h"
27 #include <CH/CH_Collection.h>
28 #include <CH/CH_EventManager.h>
29 #include <CH/CH_Types.h>
30 #include <UT/UT_StringHolder.h>
31 #include <SYS/SYS_Types.h>
32 
33 
34 class OP_Node;
35 class CH_Channel;
36 class CH_LocalVariable;
37 class CH_Manager;
38 class UT_String;
39 class UT_XformOrder;
40 
41 
43 {
44 public:
45  OP_Channels(OP_Node *owner, CH_Manager *chman,
46  CH_LocalVariable *vars);
47  ~OP_Channels() override;
48 
49  int64 getMemoryUsage(bool inclusive) const override;
50 
51  // PATH/ID RELATED (1)
52  // these functions rely on the one-to-one mapping between
53  // OP_Node and OP_Channels
54  const UT_String &getName() const override;
55 
56  int getUniqueId() const override;
57  CH_Collection * lookupCollection(int id) const override;
58 
59  const CH_Collection *getParent() const override;
60  CH_Collection *getParent() override;
61  const CH_Collection *getChild(const char *name) const override;
62  CH_Collection *getChild(const char *name) override;
63  const void *getOwner() const override;
64  void *getOwner() override;
65 
66  int getChildren(CH_NameList &names) const override;
67  int getChildren(CH_CollectionList &grps) const override;
68 
69  UT_StringHolder getFullPath() const override;
70  CH_Collection *findCollection(const char *name) const override;
71 
72  // EVENTS (1)
73  virtual void setChanged(CH_CHANGE_TYPE how, void *data=0) override;
74 
75  // CHANNEL EVALUATION (1 & 2)
76  OP_Node *getNode() const { return myOwner; }
77  void setNode(OP_Node *new_owner);
78 
79  bool getVariableValue(fpreal &val, int table, int index,
80  int thread) override;
81  bool getVariableValue(UT_String &str, int table, int index,
82  int thread) override;
83 
84  enum { OP_VARIABLE_TABLE_INDEX = 4 };
85 
86  const CH_LocalVariable *resolveVariable(const char *name,
87  int &tab) override;
88  const CH_LocalVariable *resolveExtraVariableForSyntaxHighlight(
89  const char *name);
90 
91  void getXformOrder(UT_XformOrder &xord,
92  const CH_Channel *chp) const override;
93 
94  // CHANNEL BUFFER STUFF (2)
95  // this sets the node so that contained channels can evaluate channel
96  // references as if they are in the same node as target
97  void setTargetChannel( const CH_Channel *target ) const;
98 
99  // UTILITIES (1)
100  int canAccess(unsigned mask) const override;
102  const CH_Channel *chp) const override;
104  fpreal gtime) override;
105  void saveChannelForUndo(CH_Channel *chp) override;
106 
107  void addLocalVarDependency(int table, int index,
108  void *ref_id) override;
109 
110  OP_Channels *castToOPChannels() override { return this; }
111  const OP_Channels *castToOPChannels() const override { return this; }
112 
113 protected:
114 
116  const char *old_name,
117  const char *new_name) override;
118 
119 private:
120  OP_Node *myOwner; // (1 & 2)
121 };
122 
123 #endif
virtual const CH_LocalVariable * resolveVariable(const char *name, int &tab)
virtual int canAccess(uint mask) const
Transformation order of scales, rotates, and translates.
Definition: UT_XformOrder.h:23
OP_Node * getNode() const
Definition: OP_Channels.h:76
virtual bool getVariableValue(UT_String &str, int table, int index, int thread)
virtual int canAccessChannel(uint mask, const CH_Channel *chp) const
virtual CH_Collection * findCollection(const char *path) const =0
virtual const CH_Collection * getChild(const char *name) const =0
virtual CH_Collection * lookupCollection(int id) const
virtual void getXformOrder(UT_XformOrder &xord, const CH_Channel *chp) const
const OP_Channels * castToOPChannels() const override
Definition: OP_Channels.h:111
virtual const CH_Collection * getParent() const =0
virtual int64 getMemoryUsage(bool inclusive) const
virtual void saveChannelForUndo(CH_Channel *chp)=0
Save the entire channel for undo.
CH_CHANGE_TYPE
virtual int getChildren(CH_NameList &names) const =0
GLint GLuint mask
Definition: glcorearb.h:124
virtual UT_StringHolder getFullPath() const =0
long long int64
Definition: SYS_Types.h:116
GLenum target
Definition: glcorearb.h:1667
virtual const void * getOwner() const =0
virtual int getUniqueId() const
GLuint const GLchar * name
Definition: glcorearb.h:786
virtual const UT_String & getName() const =0
GLenum GLenum GLsizei void * table
Definition: glad.h:5129
OP_Channels * castToOPChannels() override
Definition: OP_Channels.h:110
**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
fpreal64 fpreal
Definition: SYS_Types.h:277
#define OP_API
Definition: OP_API.h:10
GLuint index
Definition: glcorearb.h:786
GLuint GLfloat * val
Definition: glcorearb.h:1608
virtual void notifyChannelRenameDependents(const char *old_name, const char *new_name)
virtual void setChanged(CH_CHANGE_TYPE how, void *data=nullptr)
virtual void saveKeyFrameForUndo(CH_Channel *chp, fpreal gtime)=0
unsigned int uint
Definition: SYS_Types.h:45
Definition: format.h:895
virtual void addLocalVarDependency(int table, int index, void *ref_id)