00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __VOP_SubnetOutput_h__
00018 #define __VOP_SubnetOutput_h__
00019
00020 #include "VOP_API.h"
00021 #include <UT/UT_StringArray.h>
00022 #include "VOP_Node.h"
00023
00024 class VOP_API VOP_SubnetOutput : public VOP_Node, public VOP_OutputNameEditorSource
00025 {
00026 public:
00027 static OP_Node *myConstructor(OP_Network *net,
00028 const char *name,
00029 OP_Operator *entry);
00030 static PRM_Template myTemplateList[];
00031
00032 virtual void getCode(UT_String &codestr);
00033
00034 virtual const char *inputLabel(unsigned idx) const;
00035
00036 virtual unsigned getNumVisibleInputs() const;
00037
00038 virtual bool forceCodeGenerationOfInputs() const;
00039
00040
00041
00042
00043
00044 virtual void moveInput(int srcidx, int dstidx,
00045 bool forcesubnet = false);
00046
00047
00048
00049
00050 void moveInputInternal(int srcidx, int dstidx,
00051 bool forcesubnet);
00052 virtual OP_ERROR setInput(unsigned idx, OP_Node *op,
00053 unsigned outputIdx = 0);
00054 virtual OP_ERROR setInputReference(unsigned idx,
00055 const char *label,
00056 int keeppos,
00057 unsigned outputIdx = 0);
00058
00059
00060 virtual VOP_OutputNameEditorSource *getOutputNameEditorSource()
00061 { return this; }
00062
00063
00064
00065 virtual int getNumInputsFromParent() const;
00066 virtual void NAMEFROMPARM(UT_String &str, int idx) const;
00067 virtual void LABELFROMPARM(UT_String &str, int idx) const;
00068 virtual void setNAMEFROMPARM(UT_String &str, int idx);
00069 virtual void setLABELFROMPARM(UT_String &str, int idx);
00070
00071 void beginWiring();
00072 void endWiring();
00073
00074 protected:
00075 VOP_SubnetOutput(OP_Network *parent, const char *name, OP_Operator *entry);
00076 virtual ~VOP_SubnetOutput();
00077
00078 virtual void preOpChanged(OP_EventType reason, void *data);
00079
00080 virtual void getInputNameSubclass(UT_String &in, int idx) const;
00081 virtual int getInputFromNameSubclass(const UT_String &in) const;
00082 virtual VOP_Type getInputTypeSubclass(int idx);
00083 virtual void getAllowedInputTypesSubclass(unsigned idx, VOP_VopTypeArray &voptypes);
00084
00085 private:
00086 void adjustParentForInputChange(int idx, bool inputnull);
00087 void getInternalInputName(UT_String &in, int idx) const;
00088 void findSafeBase(UT_String &in) const;
00089
00090 UT_StringArray myInputNames;
00091 int myWiringDepth;
00092 };
00093
00094 #endif