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_AutoLockInputs.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_AutoLockInputs.h ( OP Library, C++)
7
*
8
* COMMENTS: Lock and automatically unlock inputs when cooking an operator.
9
*/
10
11
#ifndef __OP_AutoLockInputs__
12
#define __OP_AutoLockInputs__
13
14
#include "
OP_API.h
"
15
#include "
OP_Error.h
"
16
#include <
UT/UT_BitArray.h
>
17
#include <
SYS/SYS_Types.h
>
18
19
class
OP_Context
;
20
class
OP_Node
;
21
22
class
OP_API
OP_AutoLockInputs
23
{
24
public
:
25
/// Constructor accepting a node.
26
/// NOTE: This does *NOT* lock the inputs! Call lock().
27
/// Must call setNode() before locking if NULL.
28
OP_AutoLockInputs
(
OP_Node
*node = NULL)
29
{
30
myNode = node;
31
}
32
33
/// Destructor unlocks any locked inputs.
34
~OP_AutoLockInputs
()
35
{
36
unlock();
37
}
38
39
/// Unlocks any locked inputs and sets the node.
40
void
setNode
(
OP_Node
*node)
41
{
42
unlock();
43
myNode = node;
44
if
(myLockedInputs.size() > 0)
45
myLockedInputs.setSize(0);
46
}
47
48
/// Locks all inputs
49
OP_ERROR
lock(
OP_Context
&context);
50
51
/// Locks a single input
52
OP_ERROR
lockInput(
exint
input,
OP_Context
&context);
53
54
/// Returns the node associated with this auto-unlocker.
55
OP_Node
*
getLockedNode
()
const
56
{
return
myNode; }
57
58
/// Returns a bit array of successfully locked inputs.
59
const
UT_BitArray
&
getLockedInputs
()
const
60
{
return
myLockedInputs; }
61
62
/// Explicitly unlock all locked inputs.
63
/// NOTE: Only call this directly if you need to unlock early!
64
void
unlock();
65
66
/// Explicitly unlock the specified locked input.
67
/// NOTE: Only call this directly if you need to unlock early!
68
void
unlockInput(
exint
input);
69
70
/// Explicilty marks the given input as unlocked. This is used
71
/// if another function outside of the auto-lock has explicilty
72
/// unlocked that input.
73
void
markInputUnlocked(
exint
input);
74
75
private
:
76
OP_Node
*myNode;
77
UT_BitArray
myLockedInputs;
78
};
79
80
#endif
OP_Error.h
UT_BitArray
Definition:
UT_BitArray.h:29
OP_AutoLockInputs::getLockedInputs
const UT_BitArray & getLockedInputs() const
Returns a bit array of successfully locked inputs.
Definition:
OP_AutoLockInputs.h:59
OP_AutoLockInputs::getLockedNode
OP_Node * getLockedNode() const
Returns the node associated with this auto-unlocker.
Definition:
OP_AutoLockInputs.h:55
exint
int64 exint
Definition:
SYS_Types.h:125
UT_ErrorSeverity
UT_ErrorSeverity
Definition:
UT_Error.h:25
OP_API.h
OP_AutoLockInputs::OP_AutoLockInputs
OP_AutoLockInputs(OP_Node *node=NULL)
Definition:
OP_AutoLockInputs.h:28
OP_Context
Definition:
OP_Context.h:44
SYS_Types.h
OP_AutoLockInputs
Definition:
OP_AutoLockInputs.h:22
UT_BitArray.h
OP_Node
Definition:
OP_Node.h:503
OP_AutoLockInputs::~OP_AutoLockInputs
~OP_AutoLockInputs()
Destructor unlocks any locked inputs.
Definition:
OP_AutoLockInputs.h:34
OP_API
#define OP_API
Definition:
OP_API.h:10
OP_AutoLockInputs::setNode
void setNode(OP_Node *node)
Unlocks any locked inputs and sets the node.
Definition:
OP_AutoLockInputs.h:40
OP
OP_AutoLockInputs.h
Generated on Thu Nov 7 2024 03:01:03 for HDK by
1.8.6