00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _OP_Input_h_
00020 #define _OP_Input_h_
00021
00022 #include "OP_API.h"
00023 #include <UT/UT_Defines.h>
00024 #include <UT/UT_String.h>
00025
00026 class OP_Node;
00027 class OP_Network;
00028 class OP_InputIndirect;
00029
00030 class OP_API OP_Input
00031 {
00032 public:
00033 OP_Input(OP_Node *owner);
00034 virtual ~OP_Input();
00035
00036 virtual int save(ostream &os, int bin);
00037 virtual bool load(UT_IStream &is, const char *path=0);
00038
00039
00040 void resolveReference();
00041
00042 const char * getNodeReference() const { return myNodeReference; }
00043
00044
00045 OP_Node *getNode();
00046 unsigned getNodeOutputIndex();
00047
00048
00049 int isNull() const;
00050 int isIndirect() const { return myIndirectFlag; }
00051 OP_InputIndirect *getIndirect();
00052
00053 virtual int64 getMemUsage(UT_Bool onlythis) const;
00054
00055 protected:
00056
00057
00058 void setInput(OP_Node *myNode, unsigned outputIdx);
00059 void setInputReference(const char *label,
00060 unsigned outputIdx);
00061
00062
00063 virtual void setMyNode(OP_Node *input_node, unsigned outputIdx);
00064
00065 OP_Node *myNode;
00066 OP_Node *myOwner;
00067 unsigned myNodeOutputIdx;
00068
00069
00070 friend class OP_Node;
00071
00072 friend ostream &operator<<(ostream &os, OP_Input &d)
00073 {
00074 d.save(os, 0);
00075 return os;
00076 }
00077 private:
00078 void setIndirectInput(OP_InputIndirect *input);
00079
00080 OP_InputIndirect *myIndirectInput;
00081 char *myNodeReference;
00082
00083 unsigned myIndirectFlag:1,
00084 extra:31;
00085 };
00086
00087 #endif