RixPattern.h Source File

RixPattern.h
1 #ifndef RixPattern_h
2 #define RixPattern_h
3 /* $Revision: #3 $ $Date: 2015/10/30 $
4 # ------------------------------------------------------------------------------
5 #
6 # Copyright (c) 2013 Pixar Animation Studios. All rights reserved.
7 #
8 # The information in this file (the "Software") is provided for the
9 # exclusive use of the software licensees of Pixar. Licensees have
10 # the right to incorporate the Software into other products for use
11 # by other authorized software licensees of Pixar, without fee.
12 # Except as expressly permitted herein, the Software may not be
13 # disclosed to third parties, copied or duplicated in any form, in
14 # whole or in part, without the prior written permission of
15 # Pixar Animation Studios.
16 #
17 # The copyright notices in the Software and this entire statement,
18 # including the above license grant, this restriction and the
19 # following disclaimer, must be included in all copies of the
20 # Software, in whole or in part, and all permitted derivative works of
21 # the Software, unless such copies or derivative works are solely
22 # in the form of machine-executable object code generated by a
23 # source language processor.
24 #
25 # PIXAR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
26 # ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
27 # SHALL PIXAR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
28 # OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
29 # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
30 # ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
31 # SOFTWARE.
32 #
33 # Pixar
34 # 1200 Park Ave
35 # Emeryville CA 94608
36 #
37 # ------------------------------------------------------------------------------
38 */
39 
40 #include "RixShading.h"
41 
52 {
53 public:
54  virtual int GetInterface() const { return k_RixPattern; }
55  virtual int Init(RixContext &ctx, char const *pluginPath) = 0;
56  virtual RixSCParamInfo const *GetParamTable() = 0;
64  virtual RixSCParamInfo const *GetInstanceParamTable(char const *handle,
65  RtConstPointer instancedata,
66  RixParameterList const *)
67  { return NULL; }
68 
69  virtual void Finalize(RixContext &ctx) = 0;
70 
80  struct OutputSpec
81  {
82  RtInt paramId;
83  RixSCDetail detail;
84  RtConstPointer value;
85  };
86  virtual int ComputeOutputParams(RixShadingContext const *sCtx,
87  RtInt *n, OutputSpec **outputs,
88  RtConstPointer instanceData,
89  RixSCParamInfo const *instanceTable) = 0;
90 
91 protected:
92  RixPattern() : RixShadingPlugin(k_RixShadingVersion) {}
93  virtual ~RixPattern() {}
94 };
95 
96 #define RIX_PATTERNCREATE \
97  extern "C" PRMANEXPORT RixPattern *CreateRixPattern(const char *hint)
98 
99 #define RIX_PATTERNDESTROY \
100  extern "C" PRMANEXPORT void DestroyRixPattern(RixPattern *pattern)
101 
102 #endif