RenderManAPI  24.0
RifPlugin.h
Go to the documentation of this file.
1 /*
2 # ------------------------------------------------------------------------------
3 #
4 # Copyright (c) 2020 Pixar. All rights reserved.
5 #
6 # The information in this file (the "Software") is provided for the exclusive
7 # use of the software licensees of Pixar ("Licensees"). Licensees have the
8 # right to incorporate the Software into other products for use by other
9 # authorized software licensees of Pixar, without fee. Except as expressly
10 # permitted herein, the Software may not be disclosed to third parties, copied
11 # or duplicated in any form, in whole or in part, without the prior written
12 # permission of Pixar.
13 #
14 # The copyright notices in the Software and this entire statement, including the
15 # above license grant, this restriction and the following disclaimer, must be
16 # included in all copies of the Software, in whole or in part, and all permitted
17 # derivative works of the Software, unless such copies or derivative works are
18 # solely in the form of machine-executable object code generated by a source
19 # language processor.
20 #
21 # PIXAR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL PIXAR BE
23 # LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
24 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
25 # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
26 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. IN NO CASE WILL
27 # PIXAR'S TOTAL LIABILITY FOR ALL DAMAGES ARISING OUT OF OR IN CONNECTION WITH
28 # THE USE OR PERFORMANCE OF THIS SOFTWARE EXCEED $50.
29 #
30 # Pixar
31 # 1200 Park Ave
32 # Emeryville CA 94608
33 #
34 # ------------------------------------------------------------------------------
35 */
36 
37 #ifndef RifPlugin_h
38 #define RifPlugin_h
39 
40 #include "prmanapi.h" // for PRMANAPI, PRMANEXPORT
41 #include "ri.h" // for RtToken
42 
43 /*
44  * RifPlugin.h represents the public interface to Ri Filter support.
45  * Plug-in Ri Filter developers should include this file
46  * and implement the RifManufactureFilter call. Note
47  * that this file requires c++.
48  */
49 
50 /* required of a Ri Filter plug-in *---------------------------------*/
51 #ifdef __cplusplus
52 #include "RifFilter.h" // IWYU pragma: export
53 /*
54  * RifPlugin:
55 * all plug-in Ri Filters must subclass
56 * this pure-virtual class. Your subclass
57 * can have any number of RifFilter objects
58 * and can choose which to return based
59 * on its own state.
60 */
61 class RifPlugin
62 {
63 public:
64  virtual ~RifPlugin() {} /* virtual destructor */
65  virtual RifFilter& GetFilter() = 0;
66 };
67 #else
68 typedef void RifPlugin;
69 #endif
70 
71 #ifdef __cplusplus
72 extern "C" {
73 #endif
74 /* RifPluginManufacture :
75 * Filter plugin-ins must implement
76 * the RifPluginManufacture procedure.
77 * This procedure constructs an instance
78 * of a RifPlugin subclass.
79 */
80 PRMANEXPORT RifPlugin* RifPluginManufacture(int argc, char** argv);
81 
82 /* runtime services available to Ri Filter plug-ins----------------------*/
83 /*
84  * These entrypoints are available to
85  * Filters to access server functionality
86  * and state.
87  */
88 typedef enum
89 {
93 } RifParseMode;
94 PRMANAPI void RifParseFile(const char* filename, RifParseMode m);
95 PRMANAPI void RifParseBuffer(const char* buf, unsigned size, RifParseMode m);
96 typedef enum
97 {
108 } RifTokenType;
109 typedef enum
110 {
117 
119  RtToken nm, RifTokenType*, RifTokenDetail*, int* arraylen);
120 
121 typedef enum
122 {
125 } RifEmbedding;
127 PRMANAPI void RifGetCurrentBasisSteps(int* usteps, int* vstep);
128 PRMANAPI void RifGetChainInfo(int* current, int* total);
130 
132  const char* pluginpath, int argc, char const* argv[]);
133 PRMANAPI void RifInit(int nplugins, RifPlugin* plugins[]);
134 PRMANAPI void RifGetChain(RifPlugin* chaincopy[], int* count);
135 PRMANAPI void RifSetChain(RifPlugin* newchain[], int count);
136 PRMANAPI void RifPushChain();
137 PRMANAPI void RifPopChain();
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 #endif
Definition: RifPlugin.h:105
Definition: RifPlugin.h:123
Definition: RifPlugin.h:90
Definition: RifPlugin.h:114
RifTokenDetail
Definition: RifPlugin.h:109
Definition: RifPlugin.h:124
#define PRMANAPI
Definition: prmanapi.h:124
Definition: RifPlugin.h:91
PRMANAPI void RifPushChain()
PRMANAPI void RifInit(int nplugins, RifPlugin *plugins[])
PRMANAPI void RifGetChainInfo(int *current, int *total)
PRMANAPI void RifSetChain(RifPlugin *newchain[], int count)
PRMANAPI RifEmbedding RifGetEmbedding()
#define PRMANEXPORT
Definition: prmanapi.h:94
PRMANAPI void RifPopChain()
Definition: RifFilter.h:63
Definition: RifPlugin.h:101
PRMANAPI void RifParseFile(const char *filename, RifParseMode m)
Definition: RifPlugin.h:98
Definition: RifPlugin.h:92
Definition: RifPlugin.h:99
PRMANAPI void RifParseBuffer(const char *buf, unsigned size, RifParseMode m)
PRMANAPI int RifGetDeclaration(RtToken nm, RifTokenType *, RifTokenDetail *, int *arraylen)
Definition: RifPlugin.h:104
PRMANAPI RifPlugin * RifGetCurrentPlugin()
PRMANAPI RifPlugin * RifLoadPlugin(const char *pluginpath, int argc, char const *argv[])
Definition: RifPlugin.h:111
virtual RifFilter & GetFilter()=0
Definition: RifPlugin.h:106
Definition: RifPlugin.h:103
virtual ~RifPlugin()
Definition: RifPlugin.h:64
Definition: RifPlugin.h:112
Definition: RifPlugin.h:100
Definition: RifPlugin.h:107
Definition: RifPlugin.h:115
PRMANAPI void RifGetChain(RifPlugin *chaincopy[], int *count)
RifParseMode
Definition: RifPlugin.h:88
const char * RtToken
Definition: ri.h:67
Definition: RifPlugin.h:61
Definition: RifPlugin.h:113
RifEmbedding
Definition: RifPlugin.h:121
PRMANEXPORT RifPlugin * RifPluginManufacture(int argc, char **argv)
PRMANAPI void RifGetCurrentBasisSteps(int *usteps, int *vstep)
Definition: RifPlugin.h:102
RifTokenType
Definition: RifPlugin.h:96