HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SHOP_Output.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: SHOP_Output.h ( SHOP Library, C++)
7  *
8  * COMMENTS: Output nodes for SHOPs. This probably doesn't have to be
9  * sub-classed off of SHOP_VariableInput since the number of inputs is
10  * fixed. However, since it hides its unconnected inputs, it does a lot
11  * of the things that the variable input needs to do when the inputs
12  * change.
13  */
14 
15 #ifndef __SHOP_Output__
16 #define __SHOP_Output__
17 
18 #include "SHOP_API.h"
19 #include "SHOP_VariableInput.h"
20 
22 {
23 public:
24  SHOP_Output(OP_Network *dad, const char *name,
25  OP_Operator *entry, SHOP_TYPE shader_type=SHOP_MUTABLE)
26  : SHOP_VariableInput(dad, name, entry, shader_type)
27  {
28  }
29  ~SHOP_Output() override;
30 
31  // Number of outputs in the output SHOP
32  static const int theMaxInputSize;
33 
34  static OP_Node *myConstructor(OP_Network *net,
35  const char *name,
36  OP_Operator *entry);
37  static PRM_Template myTemplateList[];
38 
40  const UT_Options *options) override;
42  SHOP_TYPE shop_type, fpreal now,
43  const UT_Options *options) override;
44 
45  unsigned getNumVisibleInputs() const override;
46  unsigned maxInputs() const override;
47  void getInputName(UT_String &name, int idx) const override;
48  SHOP_TYPE getInputType(int idx) const override;
50  const OP_ConnectorId& input_name
51  ) const override;
52  OP_ERROR setInput(unsigned idx, OP_Node *op,
53  unsigned outputIdx=0) override;
54 
56  const OP_ConnectorId& input_name, OP_Node *op,
57  const OP_ConnectorId* output_name = nullptr
58  ) override;
59 
60  int getInputTileLOD() const override;
61  bool isInputVisible(int idx) const override;
62 
63  static int getMaterialOutputCount();
64 
65 protected:
66  void updateVisibleInputsAndOutputs() override;
67  void preOpChanged(OP_EventType Reason, void *data) override;
68  SHOP_Node * getInputShop(SHOP_TYPE type);
69 };
70 
71 #endif
SHOP_Output(OP_Network *dad, const char *name, OP_Operator *entry, SHOP_TYPE shader_type=SHOP_MUTABLE)
Definition: SHOP_Output.h:24
virtual unsigned maxInputs() const
Maximum inputs that can be connected to a node.
UT_ErrorSeverity
Definition: UT_Error.h:25
virtual void updateVisibleInputsAndOutputs()
virtual SHOP_TYPE getInputType(int idx) const
static const int theMaxInputSize
Definition: SHOP_Output.h:32
virtual void preOpChanged(OP_EventType, void *)
#define SHOP_API
Definition: SHOP_API.h:10
virtual OP_ERROR setInput(unsigned idx, OP_Node *op, unsigned outputIdx=0)
Sets a given input to connect to an output of a particular node.
SHOP_TYPE
virtual OP_ERROR setNamedInput(const OP_ConnectorId &input_name, OP_Node *op, const OP_ConnectorId *output_name=nullptr)
New input functions that use names instead of indices.
GLuint const GLchar * name
Definition: glcorearb.h:786
void getInputName(UT_String &name, int idx) const override
virtual int getInputTileLOD() const
virtual bool isInputVisible(int idx) const
A map of string to various well defined value types.
Definition: UT_Options.h:84
virtual int collectShaders(UT_ValArray< SHOP_Node * > &list, SHOP_TYPE shop_type, fpreal now, const UT_Options *options)
fpreal64 fpreal
Definition: SYS_Types.h:277
virtual SHOP_Node * findShader(SHOP_TYPE shop_type, fpreal now, const UT_Options *options)
OP_EventType
Definition: OP_Value.h:22
virtual SHOP_TYPE getNamedInputType(const OP_ConnectorId &input_name) const
unsigned getNumVisibleInputs() const override
type
Definition: core.h:1059
Definition: format.h:895