HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
OP_Value.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 library (C++)
7
*
8
* COMMENTS: Value for expressing interest in a node...
9
*
10
*/
11
12
#ifndef __OP_Value_h__
13
#define __OP_Value_h__
14
15
#include "
OP_API.h
"
16
#include <
UT/UT_ValArray.h
>
17
#include <
UT/UT_WorkBuffer.h
>
18
19
class
OP_Node
;
20
class
OP_EventHandler;
21
22
typedef
enum
23
{
24
OP_CHILD_CREATED
,
// A new node has been created -- DATA: ptr to child
25
OP_CHILD_REORDERED
,
// A child's index has been changed
26
// -- DATA: child ptr
27
28
OP_NODE_DELETED
,
// This node was deleted
29
OP_CHILD_DELETED
,
// Let the network know about the above.
30
31
OP_CHILD_UNSTOWED
,
// These are used by OH to signal that an OH gadget
32
OP_NODE_STOWED
,
// is stow/unstowed and should have interests added
33
// or removed appropriately.
34
OP_NODE_HIDDEN
,
// Almost the same as a STOWED. UNSTOW is opposite.
35
OP_CHILD_REVEALED
,
// Almost the same as a UNSTOWED. STOW is opposite.
36
OP_CHILD_HIDDEN
,
// Let network know about the above.
37
38
OP_CHILD_SWITCHED
,
// Change to networks current, display or render node.
39
40
OP_NAME_CHANGED
,
// This node's name changed
41
42
// these five need to be propagated to dependents so that we can recook
43
OP_INPUT_REWIRED
,
// One of this node's inputs was connected to
44
// a different node -- DATA: input index
45
OP_INPUT_CHANGED
,
// One of the input nodes has changed
46
OP_FLAG_CHANGED
,
// Something like the display flag changed
47
48
49
// of the following three events, each implies the preceeding ones
50
OP_PARM_UICHANGED
,
// A parameter's appearance changed
51
// -- DATA: parm index
52
OP_PARM_CHANGED
,
// A parameter's value changed -- DATA: parm index
53
OP_PARM_ANIMATED
,
// One of the node's channels has changed in a drastic
54
// way eg keyframe added/removed -- DATA: parm index
55
OP_PARM_CHANNELS
,
// A channel has been added, deleted, or renamed
56
// -- DATA: parm index
57
58
OP_UI_CHANGED
,
// for example error status, current, selected
59
// -- DATA: OP_UIChangeType
60
OP_UI_CURRENT_CHANGED
,
// The current node has been set when emitted
61
// from OPgetDirector() -- DATA: node pointer
62
OP_UI_EDIT_CURRENT_CHANGED
,
// The current node has been set when emitted
63
// from OPgetDirector() and is meant to be
64
// edited -- DATA: node pointer
65
OP_UI_EDIT_NETWORK
,
// Our picked network has changed.
66
// This is only emitted from OP_Director
67
// -- DATA: network node pointer
68
OP_UI_MOVED
,
// location change
69
OP_OUTPUT_CHANGED
,
// the output of a node has changed
70
OP_OUTPUT_CHANGED_FOR_COOK_TYPE
,
// the output of a node has changed as the
71
// node changed from cooking for render to
72
// cooking for display or vice versa.
73
// This change, unlike OP_OUTPUT_CHANGED,
74
// is not propagated to dependents!
75
// -- DATA: 0 = cooked for display
76
// -- DATA: 1 = cooked for render
77
OP_GROUPLIST_CHANGED
,
// The network group list or selection has changed
78
OP_INDIRECT_CREATED
,
// An OP_IndirectInput object was added to the net
79
OP_INDIRECT_DELETED
,
// or deleted from the net.
80
81
OP_COOKING_CHANGED
,
// current status of cook state (for performance)
82
83
OP_GROUP_CREATED
,
// An OP_Group object was added to the net
84
OP_GROUP_DELETED
,
// or deleted from the net.
85
OP_GROUP_CHANGED
,
// An OP_Group was renamed or its membership
86
// changed.
87
88
OP_DATA_COOKSELECTION_CHANGED
,
// The data's cook selection changed
89
OP_DATA_USERSELECTION_CHANGED
,
// The data's user selection changed
90
91
// These CHGROUP events are only triggered on the OP_Director
92
// data is (CH_Group*)
93
OP_CHGROUP_CREATED
,
// Channel group added (must be first)
94
OP_CHGROUP_REMOVED
,
// Channel group removed
95
OP_CHGROUP_RENAMED
,
// Channel group renamed
96
OP_CHGROUP_MOVED
,
// Channel group changed index
97
OP_CHGROUP_SELCHANGED
,
// Group selection changed
98
OP_CHGROUP_CURCHANGED
,
// Current group changed
99
OP_CHGROUP_CHANGED
,
// Channel group membership has changed
100
// (stays last)
101
102
OP_INPUT_RENAMED
,
// One of our inputs was renamed
103
104
OP_CHSCOPE_CHANGED
,
// Channel scope has changed (only OP_Director)
105
OP_CHSCOPEPIN_CHANGED
,
// Channel selection has changed
106
OP_CHSCOPESELECTION_CHANGED
,
// Channel selection has changed
107
// (only OP_Director)
108
OP_CHSCOPE_DISPLAY_CHANGED
,
// Channel selection has changed
109
// (only OP_Director)
110
OP_CHSCOPE_GRAPH_SELECTION_CHANGED
,
// Channel selection has changed
111
// (only OP_Director)
112
113
OP_CHILD_PICK_CHANGED
,
// A selection has changed for our children
114
115
OP_NODE_PREDELETE
,
// This node will be deleted
116
117
OP_NETWORKBOX_CREATED
,
// A network box was created within the network
118
// -- DATA: OP_NetworkBox*
119
OP_NETWORKBOX_DELETED
,
// A network box was removed from the network
120
// -- DATA: OP_NetworkBox*
121
OP_NETWORKBOX_CHANGED
,
// The contents of a network box have changed
122
// -- DATA: OP_NetworkBox*
123
OP_NETWORKBOX_STOWED
,
// An OP_NetworkBox has been stowed, similar to
124
// OP_NODE_STOWED
125
126
OP_SPAREPARM_MODIFIED
,
// A Spare parm was created or deleted.
127
128
OP_MULTIPARM_MODIFIED
,
// A Multiparm instance was created or deleted.
129
130
OP_PARM_ENABLE_CHANGED
,
// Parm's enable state changed.
131
// -- DATA: parm index
132
133
OP_POSTIT_NOTE_CREATED
,
// A post it note was created within the network
134
OP_POSTIT_NOTE_DELETED
,
// A post it note was removed from the network
135
OP_POSTIT_NOTE_CHANGED
,
// The contents of a post it note have changed
136
OP_POSTIT_NOTE_STOWED
,
// An OP_PostIt has been stowed, similar to
137
// OP_NODE_STOWED
138
OP_UI_POSTIT_MOVED
,
139
140
OP_UI_REFRESH_EXPOSED
,
// Send after an event that could have changed
141
// exposed flags in a network.
142
143
OP_PARM_VISIBLE_CHANGED
,
// Parms' visible state changed.
144
// -- DATA: parm index
145
146
OP_CUSTOM_DATA_CHANGED
,
// Some custom data held on the node changed.
147
// -- DATA: node-specific enum indicating
148
// exactly which bit of custom data changed
149
150
OP_WORK_ITEM_SELECTION_CHANGED
,
// The selected work item was changed
151
// -- DATA: work item ID, unique to the
152
// TOP network that the event was emitted
153
// from
154
155
OP_EVENT_TYPE_COUNT
// sentinel
156
157
}
OP_EventType
;
158
159
typedef
void
(*
OP_EventMethod
)(
OP_Node
*caller,
void
*callee,
160
OP_EventType
type
,
void
*
data
);
161
162
OP_API
extern
const
char
*
OPeventToString
(
OP_EventType
type
);
163
164
// UTformat support.
165
static
inline
size_t
166
format
(
char
*
buffer
,
size_t
buffer_size,
const
OP_EventType
&
v
)
167
{
168
UT_WorkBuffer
eventtext;
169
eventtext.
sprintf
(
"%s (%d)"
,
OPeventToString
(v), (
int
)(v));
170
if
(!buffer)
171
return
eventtext.
length
();
172
else
173
{
174
size_t
len
=
std::min
(
size_t
(eventtext.
length
()), buffer_size);
175
::memcpy(buffer, eventtext.
buffer
(),
len
);
176
return
len
;
177
}
178
}
179
class
OP_API
OP_Value
180
{
181
public
:
182
OP_Value
(
OP_Node
*owner);
183
~
OP_Value
();
184
185
int
hasOpInterest (
void
*
data
,
OP_EventMethod
eventHandler)
const
;
186
void
addOpInterest (
void
*data,
OP_EventMethod
eventHandler);
187
void
removeOpInterest(
void
*data,
OP_EventMethod
eventHandler);
188
void
changed (
OP_EventType
type
,
void
*data=0)
const
;
189
190
unsigned
numInterests()
const
;
191
192
int64
getMemoryUsage(
bool
inclusive)
const
;
193
194
private
:
195
UT_ValArray<OP_EventHandler *>
myHandlers;
196
OP_Node
*myOwner;
197
};
198
199
#endif
detail::type
type
Definition:
core.h:977
OP_NETWORKBOX_CREATED
Definition:
OP_Value.h:117
OP_INDIRECT_DELETED
Definition:
OP_Value.h:79
OP_UI_EDIT_CURRENT_CHANGED
Definition:
OP_Value.h:62
OP_CHGROUP_CHANGED
Definition:
OP_Value.h:99
UT_WorkBuffer::length
SYS_FORCE_INLINE exint length() const
Definition:
UT_WorkBuffer.h:393
UT_WorkBuffer
Definition:
UT_WorkBuffer.h:63
OP_UI_CHANGED
Definition:
OP_Value.h:58
void
void
Definition:
png.h:1083
OP_UI_POSTIT_MOVED
Definition:
OP_Value.h:138
OP_OUTPUT_CHANGED
Definition:
OP_Value.h:69
OP_UI_CURRENT_CHANGED
Definition:
OP_Value.h:60
OP_MULTIPARM_MODIFIED
Definition:
OP_Value.h:128
OP_NODE_DELETED
Definition:
OP_Value.h:28
UT_WorkBuffer::buffer
SYS_FORCE_INLINE const char * buffer() const
Definition:
UT_WorkBuffer.h:151
OP_OUTPUT_CHANGED_FOR_COOK_TYPE
Definition:
OP_Value.h:70
OP_Value
Definition:
OP_Value.h:179
OP_CHILD_CREATED
Definition:
OP_Value.h:24
OP_API.h
UT_ValArray< OP_EventHandler * >
buffer
GLuint buffer
Definition:
glcorearb.h:659
OP_EVENT_TYPE_COUNT
Definition:
OP_Value.h:155
OP_NODE_HIDDEN
Definition:
OP_Value.h:34
OP_CUSTOM_DATA_CHANGED
Definition:
OP_Value.h:146
OP_SPAREPARM_MODIFIED
Definition:
OP_Value.h:126
OP_CHSCOPESELECTION_CHANGED
Definition:
OP_Value.h:106
OP_GROUP_CREATED
Definition:
OP_Value.h:83
OP_POSTIT_NOTE_CHANGED
Definition:
OP_Value.h:135
OP_CHSCOPE_DISPLAY_CHANGED
Definition:
OP_Value.h:108
type
GLint GLint GLsizei GLint GLenum GLenum type
Definition:
glcorearb.h:107
ImageBufAlgo::min
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
OP_PARM_UICHANGED
Definition:
OP_Value.h:50
OP_Node
Definition:
OP_Node.h:497
UT_WorkBuffer.h
OP_CHSCOPE_GRAPH_SELECTION_CHANGED
Definition:
OP_Value.h:110
OP_CHGROUP_CURCHANGED
Definition:
OP_Value.h:98
UT_ValArray.h
OP_EventMethod
void(* OP_EventMethod)(OP_Node *caller, void *callee, OP_EventType type, void *data)
Definition:
OP_Value.h:159
len
GLenum GLsizei len
Definition:
glew.h:7782
OP_POSTIT_NOTE_DELETED
Definition:
OP_Value.h:134
OP_NAME_CHANGED
Definition:
OP_Value.h:40
OP_CHSCOPE_CHANGED
Definition:
OP_Value.h:104
v
const GLdouble * v
Definition:
glcorearb.h:836
OP_CHILD_REVEALED
Definition:
OP_Value.h:35
OP_INPUT_RENAMED
Definition:
OP_Value.h:102
OP_WORK_ITEM_SELECTION_CHANGED
Definition:
OP_Value.h:150
int64
long long int64
Definition:
SYS_Types.h:116
OP_CHILD_REORDERED
Definition:
OP_Value.h:25
OP_NODE_STOWED
Definition:
OP_Value.h:32
OP_PARM_VISIBLE_CHANGED
Definition:
OP_Value.h:143
OP_PARM_ANIMATED
Definition:
OP_Value.h:53
OP_DATA_USERSELECTION_CHANGED
Definition:
OP_Value.h:89
OP_UI_MOVED
Definition:
OP_Value.h:68
OP_UI_REFRESH_EXPOSED
Definition:
OP_Value.h:140
OP_NETWORKBOX_DELETED
Definition:
OP_Value.h:119
OP_UI_EDIT_NETWORK
Definition:
OP_Value.h:65
OP_CHGROUP_RENAMED
Definition:
OP_Value.h:95
UT_WorkBuffer::sprintf
int sprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
OP_NODE_PREDELETE
Definition:
OP_Value.h:115
data
GLboolean * data
Definition:
glcorearb.h:130
OP_PARM_CHANNELS
Definition:
OP_Value.h:55
format
GLint GLint GLsizei GLint GLenum format
Definition:
glcorearb.h:107
OP_CHSCOPEPIN_CHANGED
Definition:
OP_Value.h:105
OP_CHGROUP_REMOVED
Definition:
OP_Value.h:94
OP_CHILD_DELETED
Definition:
OP_Value.h:29
OP_CHILD_PICK_CHANGED
Definition:
OP_Value.h:113
OP_COOKING_CHANGED
Definition:
OP_Value.h:81
OP_CHILD_UNSTOWED
Definition:
OP_Value.h:31
OP_API
#define OP_API
Definition:
OP_API.h:10
OP_INDIRECT_CREATED
Definition:
OP_Value.h:78
OP_CHGROUP_MOVED
Definition:
OP_Value.h:96
OP_EventType
OP_EventType
Definition:
OP_Value.h:22
OP_DATA_COOKSELECTION_CHANGED
Definition:
OP_Value.h:88
OP_FLAG_CHANGED
Definition:
OP_Value.h:46
OP_PARM_ENABLE_CHANGED
Definition:
OP_Value.h:130
OP_POSTIT_NOTE_STOWED
Definition:
OP_Value.h:136
OP_NETWORKBOX_CHANGED
Definition:
OP_Value.h:121
OP_POSTIT_NOTE_CREATED
Definition:
OP_Value.h:133
OP_PARM_CHANGED
Definition:
OP_Value.h:52
OP_GROUP_DELETED
Definition:
OP_Value.h:84
OP_CHGROUP_CREATED
Definition:
OP_Value.h:93
OP_GROUP_CHANGED
Definition:
OP_Value.h:85
OP_INPUT_CHANGED
Definition:
OP_Value.h:45
OPeventToString
OP_API const char * OPeventToString(OP_EventType type)
OP_CHILD_SWITCHED
Definition:
OP_Value.h:38
OP_NETWORKBOX_STOWED
Definition:
OP_Value.h:123
OP_INPUT_REWIRED
Definition:
OP_Value.h:43
OP_CHILD_HIDDEN
Definition:
OP_Value.h:36
OP_GROUPLIST_CHANGED
Definition:
OP_Value.h:77
OP_CHGROUP_SELCHANGED
Definition:
OP_Value.h:97
OP
OP_Value.h
Generated on Wed May 25 2022 03:23:15 for HDK by
1.8.6