12 #ifndef __VOP_ParmGenerator_h__
13 #define __VOP_ParmGenerator_h__
35 bool check_shader_context
38 const char *
outputLabel(
unsigned idx)
const override;
56 void *
data =
nullptr)
override;
64 bool isSubnetParameterDefiner(
VOP_Node *subnet =
nullptr)
const;
65 bool isSubnetInputOrOutputDefiner(
VOP_Node *subnet =
nullptr)
const;
66 bool isSubnetInputDefiner(
VOP_Node *subnet =
nullptr,
67 bool allow_search =
false)
const;
68 bool isSubnetOutputDefiner(
VOP_Node *subnet =
nullptr,
69 bool allow_search =
false)
const;
70 bool isSubnetInputParm()
const;
71 bool isSubnetOutputParm()
const;
81 bool isShaderParm()
const;
82 bool isClassMemberParm()
const;
88 bool isInsideShaderOfType(
VOP_Type shader_type );
105 void recalculateParmDefiner(
bool sendchangeevents);
109 void cacheParmName();
113 {
return myParmNameCache; }
124 {
return exportParm(); }
129 bool for_shader)
const;
139 unsigned nInputs()
const override;
143 virtual void PARMSCOPE(
UT_String &str)
const;
144 virtual void setPARMSCOPE(
const char *str);
145 virtual void PARMACCESS(
UT_String &str)
const;
146 virtual void PARMNAME(
UT_String &str)
const = 0;
147 virtual void setPARMNAME(
const UT_String &str);
148 virtual void PARMPREFIX(
UT_String &str)
const;
149 virtual void PARMPOSTFIX(
UT_String &str)
const;
150 virtual void PARMLABEL(
UT_String &str)
const = 0;
151 virtual void PARMCOMMENT(
UT_String &str)
const;
152 virtual int PARMTYPEINDEX()
const = 0;
153 virtual void setPARMTYPEINDEX(
int type);
154 virtual void PARMTYPENAME(
UT_String &type_name)
const;
155 virtual void setPARMTYPENAME(
const UT_StringRef &type_name);
156 virtual void setPARMSTORAGE(
int type);
157 virtual void PARMMENUOPTION(
UT_String &str)
const;
158 virtual void setPARMMENUOPTION(
const UT_String &menu_option);
166 virtual bool isParmVisible()
const = 0;
173 virtual void copyDefaultValuesFrom(
181 const char * getParameterDefaultValueParmName();
186 virtual bool evalIntegerValue(
int &
value);
196 bool shouldCheckSecondaryDefinerInput(
200 static void findAllShaderParmDefiners(
208 {
return myParmMicroNode; }
225 void recalculateShaderParmDefiner(
bool sendchangeevents);
226 void recalculateSubnetParmDefiner(
bool sendchangeevents);
247 bool usesTempOutputVar()
const;
250 bool getParameterDeclarationHelper(
UT_String &parmdecl,
256 virtual void getParmDeclarationCode(
UT_String &parm_decl,
259 bool export_parms=
false);
263 virtual bool USEASPARMDEFINER()
const = 0;
264 virtual bool USEOWNEXPORTCONTEXT()
const;
265 virtual bool SHOULDHAVECORRESPONDINGCONNECTOR()
const;
266 virtual int UNIFORM()
const= 0;
267 virtual int USEBOUND()
const;
268 virtual int EXPORTPARM()
const;
269 virtual void EXPORTSHADERCONTEXTS(
271 virtual void MENUCHOICES(
UT_String &str)
const;
272 virtual void MENUSCRIPT(
UT_String &str)
const;
275 virtual bool needsInput() = 0;
279 virtual void getUnboundCode(
UT_String &codestr,
284 virtual void handleParmNameChange(
290 virtual bool getParmCanAffectParmName(
int pidx)
const = 0;
302 int useBound()
const;
303 bool shouldHaveCorrespondingConnector()
const;
304 int exportParm(
bool check_connected =
true)
const;
305 void exportShaderContexts(
307 int getParmTypeIndex();
308 void getParmTypeName(
UT_String &type_name);
309 void getMenuOption(
UT_String &menu_option);
313 bool conditioned =
true,
320 bool just_value =
true);
327 static void sendChangesForAllParmsDefinedBy(
351 const char *className()
const override
352 {
return "vop_ParmMicroNode"; }
357 vop_ParmMicroNode myParmMicroNode;
358 mutable OP_VERSION myCachedIsShaderParmVersion;
359 mutable bool myCachedIsShaderParm;
360 bool myIsAlwaysUsedAsShaderParm;
virtual int getInputFromNameSubclass(const UT_String &in) const
Reprsents a language for which VOPs can generate source code.
virtual void getContextsForCodeGeneration(UT_StringArray &context_names) const
virtual bool areOutputVariablesFixed(const VOP_CodeGenContext &ctx)
virtual bool forceCodeGenerationOfInputs(const VOP_CodeGenContext &context, bool check_shader_context) const
virtual unsigned getNumVisibleInputs() const
const UT_StringHolder & getParmNameCache() const
Parameters for OP_Node::getInfoText()/OP_Node::getNodeSpecificInfoText()
static const char *const MENU_SCRIPT
Menu options for this parameter.
GLuint const GLchar * name
virtual void getFixedOutputVariable(UT_String &var, int idx)
static const char *const SCOPE_METHOD
Obtains the scope for this parameter.
virtual unsigned nInputs() const
static PRM_Default theParmscopeDefault
Scope menu helpers for subclasses.
void getNodeSpecificInfoText(OP_Context &context, OP_NodeInfoParms &iparms) override
static const char *const MENU_ITEMS
Menu options for this parameter.
virtual void getOutputVariableName(UT_String &var, int idx) const
virtual void getDescriptiveName(UT_String &str) const
virtual bool isSubnetInput() const
Returns true if the node is considered a subnet's input node.
static const char *const NO_MENU
Menu options for this parameter.
VOP_ParmGenerator * castToParmGenerator() override
const VOP_ParmGenerator * castToParmGenerator() const override
static const char *const SCOPE_SUBNET
Obtains the scope for this parameter.
virtual void initializeNode()
GLuint GLint GLboolean GLint GLenum access
static PRM_ChoiceList theParmscopeMenu
Scope menu helpers for subclasses.
virtual void getCode(UT_String &codestr, const VOP_CodeGenContext &context)
Get the code fragment to be included in the shader code.
Parameters for OP_Node::fillInfoTree()/OP_Node::fillInfoTreeNodeSpecific()
virtual const char * outputLabel(unsigned idx) const
virtual void getOutputTypeInfoSubclass(VOP_TypeInfo &type_info, int idx)
virtual void getOutputNameSubclass(UT_String &out, int idx) const
static const char *const SCOPE_SHADER
Obtains the scope for this parameter.
bool isExportParm() const
Returns true if it's an exported parameter.
virtual void getInputNameSubclass(UT_String &in, int idx) const
virtual VOP_Node * getRealDefinition()
virtual bool getIsParmGenerator() const
Returns true if this VOP is a VOP_ParmGenerator or subclass.
GLenum GLsizei GLenum GLenum const void * table
void fillInfoTreeNodeSpecific(UT_InfoTree &tree, const OP_NodeInfoTreeParms &parms) override
static const char *const SCOPE_CLASS
Obtains the scope for this parameter.
const OP_DataMicroNode & parmListMicroNodeConst() const override
void opChanged(OP_EventType reason, void *data=0) override
ImageBuf OIIO_API channels(const ImageBuf &src, int nchannels, cspan< int > channelorder, cspan< float > channelvalues={}, cspan< std::string > newchannelnames={}, bool shuffle_channel_names=false, int nthreads=0)
virtual void postOpChanged(OP_EventType, void *)