00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef __VOPNET_Node_h__
00015 #define __VOPNET_Node_h__
00016
00017 #include "VOPNET_API.h"
00018 #include <OP/OP_Network.h>
00019 #include "VOPNET_Error.h"
00020
00021 class VOP_CodeGenerator;
00022
00023 class VOPNET_API VOPNET_Node : public OP_Network
00024 {
00025 public:
00026 static CH_LocalVariable myVariableList[];
00027 static OP_Node *myConstructor(OP_Network* net,
00028 const char* name,
00029 OP_Operator* entry);
00030
00031 virtual OP_OperatorFilter *getOperatorFilter();
00032 virtual VOP_CodeGenerator *getVopCodeGenerator();
00033
00034 virtual const char *getChildType() const;
00035 virtual const char *getOpType() const;
00036
00037 virtual OP_OpTypeId getChildTypeID() const;
00038 virtual OP_OpTypeId getOpTypeID() const;
00039
00040 virtual void opChanged(OP_EventType reason, void *data=0);
00041
00042
00043 virtual void getVariableString(int index, UT_String &value,
00044 int thread);
00045
00046 virtual const char *getInternalOpTable() const;
00047 const char *getInternalIndexFile() const;
00048 bool getShowOpInTabMenuFlag();
00049
00050 virtual OP_Operator *getInternalOperator() const;
00051 void setInternalOperator(OP_Operator *op);
00052 const UT_String &getOperatorName() const;
00053
00054
00055
00056 virtual bool canDestroyNode();
00057
00058
00059 virtual unsigned maxOutputs() const { return 0; }
00060
00061 virtual fpreal getW() const;
00062
00063 virtual fpreal getH() const;
00064
00065
00066
00067 virtual void resolveObsoleteParms(PRM_ParmList *obsolete_parms);
00068
00069
00070 static OP_Operator *getManagementOperator();
00071 static OP_Operator *getSOPManagementOperator();
00072 static OP_Operator *getPOPManagementOperator();
00073 static OP_Operator *getCHOPManagementOperator();
00074 static OP_Operator *getCOP2FilterManagementOperator();
00075 static OP_Operator *getCOP2GenManagementOperator();
00076 static void addSHOPManagementOperators(OP_OperatorTable *table);
00077
00078 static void buildOperatorTable (OP_OperatorTable &table);
00079
00080 protected:
00081 VOPNET_Node(OP_Network* parent, const char* name,
00082 OP_Operator* op);
00083 virtual ~VOPNET_Node(void);
00084
00085 virtual void getNodeSpecificInfoText(OP_Context &context,
00086 int verbose,
00087 UT_WorkBuffer &text);
00088 virtual void finishedLoadingNetwork();
00089 virtual void addNode(OP_Node *node, int notify=1, int explicitly=1);
00090
00091 virtual OP_ERROR cookMe (OP_Context &context);
00092 virtual OP_ERROR bypassMe(OP_Context &context, int &copied_input);
00093
00094 virtual OP_DATA_TYPE getCookedDataType (void) const;
00095 virtual void* getCookedData (OP_Context &);
00096 virtual void deleteCookedData (void);
00097 virtual int saveCookedData (const char *, OP_Context &);
00098 virtual int saveCookedData (ostream &, OP_Context &, int bin = 0);
00099
00100 virtual const char *getFileExtension (int binary) const;
00101
00102 void addError(VOPNET_ErrorCodes code, const char *msg=0)
00103 { UTaddError("VOPNET", code, msg); }
00104 void addMessage(VOPNET_ErrorCodes code, const char *msg=0)
00105 { UTaddMessage("VOPNET", code, msg); }
00106 void addWarning(VOPNET_ErrorCodes code, const char *msg=0)
00107 { UTaddWarning("VOPNET", code, msg); }
00108 void addFatal(VOPNET_ErrorCodes code, const char *msg=0)
00109 { UTaddFatal("VOPNET", code, msg); }
00110
00111 OP_Operator *myInternalOperator;
00112 VOP_CodeGenerator *myCodeGenerator;
00113 UT_String myObsoleteParmOrder;
00114 };
00115
00116 #endif