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 setPARMSTORAGE(
int type);
156 virtual void PARMMENUOPTION(
UT_String &str)
const;
157 virtual void setPARMMENUOPTION(
const UT_String &menu_option);
164 virtual bool isParmVisible()
const = 0;
171 virtual void copyDefaultValuesFrom(
179 const char * getParameterDefaultValueParmName();
184 virtual bool evalIntegerValue(
int &
value);
194 bool shouldCheckSecondaryDefinerInput(
198 static void findAllShaderParmDefiners(
217 void recalculateShaderParmDefiner(
bool sendchangeevents);
218 void recalculateSubnetParmDefiner(
bool sendchangeevents);
239 bool usesTempOutputVar()
const;
242 bool getParameterDeclarationHelper(
UT_String &parmdecl,
248 virtual void getParmDeclarationCode(
UT_String &parm_decl,
251 bool export_parms=
false);
255 virtual bool USEASPARMDEFINER()
const = 0;
256 virtual bool USEOWNEXPORTCONTEXT()
const;
257 virtual bool SHOULDHAVECORRESPONDINGCONNECTOR()
const;
258 virtual int UNIFORM()
const= 0;
259 virtual int USEBOUND()
const;
260 virtual int EXPORTPARM()
const;
261 virtual void EXPORTSHADERCONTEXTS(
263 virtual void MENUCHOICES(
UT_String &str)
const;
264 virtual void MENUSCRIPT(
UT_String &str)
const;
267 virtual bool needsInput() = 0;
271 virtual void getUnboundCode(
UT_String &codestr,
276 virtual void handleParmNameChange(
282 virtual bool getParmCanAffectParmName(
int pidx)
const = 0;
294 int useBound()
const;
295 bool shouldHaveCorrespondingConnector()
const;
296 int exportParm(
bool check_connected =
true)
const;
297 void exportShaderContexts(
299 int getParmTypeIndex();
300 void getParmTypeName(
UT_String &type_name);
301 void getMenuOption(
UT_String &menu_option);
305 bool conditioned =
true,
312 bool just_value =
true);
319 static void sendChangesForAllParmsDefinedBy(
338 mutable OP_VERSION myCachedIsShaderParmVersion;
339 mutable bool myCachedIsShaderParm;
340 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
GLint GLint GLsizei GLint GLenum GLenum type
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.
GLsizei const GLfloat * value
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.
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 *)