HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 <SYS/SYS_Types.h>
29 
30 class OP_Node;
31 
33 {
34 public:
35  OP_Channels(OP_Node *owner, CH_Manager *chman,
36  CH_LocalVariable *vars);
37  virtual ~OP_Channels();
38 
39  virtual int64 getMemoryUsage(bool inclusive) const;
40 
41  // PATH/ID RELATED (1)
42  // these functions rely on the one-to-one mapping between
43  // OP_Node and OP_Channels
44  virtual const UT_String &getName() const;
45 
46  virtual int getUniqueId() const;
47  virtual CH_Collection * lookupCollection(int id) const;
48 
49  virtual const CH_Collection *getParent() const;
50  virtual CH_Collection *getParent();
51  virtual const CH_Collection *getChild(const char *name) const;
52  virtual CH_Collection *getChild(const char *name);
53  virtual const void *getOwner() const;
54  virtual void *getOwner();
55 
56  virtual int getChildren(CH_NameList &names) const;
57  virtual int getChildren(CH_CollectionList &grps) const;
58 
59  virtual void getFullPath(UT_String &str) const;
60  virtual CH_Collection *findCollection(const char *name) const;
61 
62  // EVENTS (1)
63  virtual void setChanged(CH_CHANGE_TYPE how, void *data=0);
64 
65  // CHANNEL EVALUATION (1 & 2)
66  OP_Node *getNode() const { return myOwner; }
67  void setNode(OP_Node *new_owner);
68 
69  virtual bool getVariableValue(fpreal &val, int table, int index,
70  int thread);
71  virtual bool getVariableValue(UT_String &str, int table, int index,
72  int thread);
73 
74  enum { OP_VARIABLE_TABLE_INDEX = 4 };
75 
76  virtual const CH_LocalVariable *resolveVariable(const char *name, int &tab);
77  const CH_LocalVariable *resolveExtraVariableForSyntaxHighlight(
78  const char *name);
79 
80  virtual void getXformOrder(UT_XformOrder &xord, const CH_Channel *chp) const;
81 
82  // CHANNEL BUFFER STUFF (2)
83  // this sets the node so that contained channels can evaluate channel
84  // references as if they are in the same node as target
85  void setTargetChannel( const CH_Channel *target ) const;
86 
87  // UTILITIES (1)
88  virtual int canAccess(unsigned mask) const;
89  virtual int canAccessChannel(uint mask,
90  const CH_Channel *chp) const;
91  virtual void saveKeyFrameForUndo(CH_Channel *chp, fpreal gtime);
92 
93  virtual void addLocalVarDependency(int table, int index,
94  void *ref_id);
95 
96  virtual OP_Channels *castToOPChannels() { return this; }
97  virtual const OP_Channels *castToOPChannels() const { return this; }
98 
99 protected:
100 
101  virtual void notifyChannelRenameDependents(const char *old_name,
102  const char *new_name);
103 
104 private:
105  OP_Node *myOwner; // (1 & 2)
106 };
107 
108 #endif
virtual const CH_LocalVariable * resolveVariable(const char *name, int &tab)
virtual int canAccess(uint mask) const
OP_Node * getNode() const
Definition: OP_Channels.h:66
virtual bool getVariableValue(UT_String &str, int table, int index, int thread)
virtual int canAccessChannel(uint mask, const CH_Channel *chp) const
GLint GLuint mask
Definition: glcorearb.h:123
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
virtual const CH_Collection * getParent() const =0
virtual const OP_Channels * castToOPChannels() const
Definition: OP_Channels.h:97
virtual int64 getMemoryUsage(bool inclusive) const
long long int64
Definition: SYS_Types.h:100
CH_CHANGE_TYPE
virtual void getFullPath(UT_String &path) const =0
virtual int getChildren(CH_NameList &names) const =0
GLenum target
Definition: glcorearb.h:1666
virtual const void * getOwner() const =0
virtual OP_Channels * castToOPChannels()
Definition: OP_Channels.h:96
virtual void setChanged(CH_CHANGE_TYPE how, void *data=0)
virtual int getUniqueId() const
GLboolean * data
Definition: glcorearb.h:130
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual const UT_String & getName() const =0
unsigned int uint
Definition: SYS_Types.h:33
double fpreal
Definition: SYS_Types.h:263
#define OP_API
Definition: OP_API.h:10
GLuint index
Definition: glcorearb.h:785
GLuint GLfloat * val
Definition: glcorearb.h:1607
virtual void notifyChannelRenameDependents(const char *old_name, const char *new_name)
virtual void saveKeyFrameForUndo(CH_Channel *chp, fpreal gtime)=0
virtual void addLocalVarDependency(int table, int index, void *ref_id)