HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MOT_CloneMessage.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: MOT_CloneMessage.h
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef __MOT_CLONEMESSAGE_H__
13 #define __MOT_CLONEMESSAGE_H__
14 
15 #include <OP/OP_DataTypes.h>
16 #include <CH/CH_ExprLanguage.h>
17 #include <UT/UT_Options.h>
18 #include <UT/UT_Rect.h>
19 #include <UT/UT_StringHolder.h>
21 #include <UT/UT_Vector2.h>
22 #include <optional>
23 
24 class MOT_Director;
25 class LOP_Node;
26 class PXL_Raster;
27 
29 #define MOT_CLONE_MESSAGE_INVALID_ID -1
30 
32 {
33 public:
35  MOT_CloneMessage(const UT_StringRef &msg);
36  virtual ~MOT_CloneMessage();
37 
38  const UT_Options &options() const
39  { return myOptions; }
41  { return myOptions; }
42  const UT_StringHolder &extraData() const
43  { return myExtraData; }
45  { return myExtraData; }
47  { return myUniqueId; }
48  void fillWorkBuffer(UT_WorkBuffer &buf) const;
49 
50  static const UT_StringHolder &schemaKey();
51  static const UT_StringHolder &uniqueIdKey();
52 
53 protected:
57 };
58 
59 template<class SchemaClass>
61 {
62 public:
64  : myMsg(rmsg)
65  { }
67  { }
68 
69  bool isValid() const
70  {
71  UT_StringHolder schema =
74  return schema == SchemaClass::schemaName();
75  }
76 
77 protected:
78  static void createMessage(MOT_CloneMessage &rmsg)
79  {
80  rmsg.options().setOptionS(
82  SchemaClass::schemaName());
83  rmsg.options().setOptionI(
85  rmsg.uniqueId());
86  }
87 
89 };
90 
92  public MOT_SchemaMessage<MOT_ScriptMessage>
93 {
94 public:
96  : MOT_SchemaMessage(rmsg)
97  { }
98 
99  static const UT_StringHolder &schemaName();
100  static void createMessage(MOT_CloneMessage &rmsg,
101  const UT_StringRef &script,
102  CH_ScriptLanguage lang);
103 
104  bool runScript() const;
105 };
106 
108  public MOT_SchemaMessage<MOT_RemoteExecMessage>
109 {
110 public:
112  : MOT_SchemaMessage(rmsg)
113  { }
114 
115  static const UT_StringHolder &schemaName();
116  static void createMessage(MOT_CloneMessage &rmsg,
117  const UT_StringHolder &functionname,
118  const UT_Options &parameters);
119 
120  void execute() const;
121 };
122 
124  public MOT_SchemaMessage<MOT_ConfigureMessage>
125 {
126 public:
128  : MOT_SchemaMessage(rmsg)
129  { }
130 
131  static const UT_StringHolder &schemaName();
132  static void createMessage(MOT_CloneMessage &rmsg,
133  const UT_StringRef &lopnodepath,
134  const UT_StringRef &cameraprimpath,
135  const UT_StringRef &renderer,
136  const UT_StringRef &rendersettings,
137  const UT_StringRef &displayaov,
138  int width,
139  int height);
140 
141  LOP_Node *getLopNode() const;
146  int getWidth() const;
147  int getHeight() const;
148 };
149 
151  public MOT_SchemaMessage<MOT_FrameMessage>
152 {
153 public:
155  : MOT_SchemaMessage(rmsg)
156  { }
157 
158  static const UT_StringHolder &schemaName();
159  static void createMessage(MOT_CloneMessage &rmsg,
160  fpreal frame);
161 
162  fpreal getFrame() const;
163 };
164 
166  public MOT_SchemaMessage<MOT_ProcessUpdatesMessage>
167 {
168 public:
170  : MOT_SchemaMessage(rmsg)
171  { }
172 
173  static const UT_StringHolder &schemaName();
174  static void createMessage(MOT_CloneMessage &rmsg,
175  bool process_updates);
176 
177  bool getProcessUpdates() const;
178 };
179 
181  public MOT_SchemaMessage<MOT_HipFileMessage>
182 {
183 public:
185  : MOT_SchemaMessage(rmsg)
186  { }
187 
188  static const UT_StringHolder &schemaName();
189  static void createMessage(MOT_CloneMessage &rmsg);
190 
191  bool setEnvVars() const;
192  bool loadHipFile() const;
193 };
194 
196  public MOT_SchemaMessage<MOT_SaveItemsMessage>
197 {
198 public:
200  : MOT_SchemaMessage(rmsg)
201  { }
202 
203  static const UT_StringHolder &schemaName();
204  static void createMessage(MOT_CloneMessage &rmsg,
205  const OP_NetworkBoxItemList &items);
206  static void createMessage(MOT_CloneMessage &rmsg,
207  OP_NetworkBoxItem *item);
208 
209  bool load() const;
210 };
211 
213  public MOT_SchemaMessage<MOT_LogEntriesMessage>
214 {
215 public:
217  : MOT_SchemaMessage(rmsg)
218  { }
219 
220  static const UT_StringHolder &schemaName();
221  static void createMessage(MOT_CloneMessage &rmsg,
223  log_entries);
224 
226  log_entries) const;
227 };
228 
230  public MOT_SchemaMessage<MOT_SocketErrorMessage>
231 {
232 public:
234  : MOT_SchemaMessage(rmsg)
235  { }
236 
237  static const UT_StringHolder &schemaName();
238  static void createMessage(MOT_CloneMessage &rmsg,
239  const UT_StringRef &err);
240 
242 };
243 
245  public MOT_SchemaMessage<MOT_ImageMessage>
246 {
247 public:
249  : MOT_SchemaMessage(rmsg)
250  { }
251 
252  static const UT_StringHolder &schemaName();
253  static void createMessage(MOT_CloneMessage &rmsg,
254  const PXL_Raster *raster,
255  const UT_StringHolder &imageaov,
256  const UT_StringArray &availableaovs,
257  const UT_Options &stats,
258  const UT_Vector2i &fullres,
259  const UT_DimRect &datawindow);
260 
261  PXL_Raster *createImage() const;
262  UT_StringHolder imageAov() const;
264  UT_Options stats() const;
265  std::optional<UT_Vector2i> fullRes() const;
266  std::optional<UT_DimRect> dataWindow() const;
267 };
268 
270  public MOT_SchemaMessage<MOT_AckMessage>
271 {
272 public:
274  : MOT_SchemaMessage(rmsg)
275  { }
276 
277  static const UT_StringHolder &schemaName();
278  static void createMessage(MOT_CloneMessage &rmsg,
279  MOT_CloneMessageId ackedid);
280 
282 };
283 
284 #endif // __MOT_CLONEMESSAGE_H__
285 
UT_StringHolder imageAov() const
MOT_CloneMessageId uniqueId() const
MOT_FrameMessage(const MOT_CloneMessage &rmsg)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
static const UT_StringHolder & schemaName()
const UT_Options & options() const
bool loadLogEntries(UT_UniversalLogEntryArray &log_entries) const
UT_StringHolder myExtraData
static void createMessage(MOT_CloneMessage &rmsg, bool process_updates)
static void createMessage(MOT_CloneMessage &rmsg, const UT_StringHolder &functionname, const UT_Options &parameters)
static const UT_StringHolder & schemaName()
static void createMessage(MOT_CloneMessage &rmsg, const UT_UniversalLogEntryArray &log_entries)
MOT_ScriptMessage(const MOT_CloneMessage &rmsg)
MOT_RemoteExecMessage(const MOT_CloneMessage &rmsg)
PXL_Raster * createImage() const
const MOT_CloneMessage & myMsg
MOT_ConfigureMessage(const MOT_CloneMessage &rmsg)
MOT_SaveItemsMessage(const MOT_CloneMessage &rmsg)
static void createMessage(MOT_CloneMessage &rmsg)
static const UT_StringHolder & schemaName()
UT_Options & options()
MOT_ProcessUpdatesMessage(const MOT_CloneMessage &rmsg)
int getWidth() const
MOT_LogEntriesMessage(const MOT_CloneMessage &rmsg)
static void createMessage(MOT_CloneMessage &rmsg, const PXL_Raster *raster, const UT_StringHolder &imageaov, const UT_StringArray &availableaovs, const UT_Options &stats, const UT_Vector2i &fullres, const UT_DimRect &datawindow)
static const UT_StringHolder & schemaName()
static const UT_StringHolder & uniqueIdKey()
UT_StringHolder getRenderer() const
bool load() const
static void createMessage(MOT_CloneMessage &rmsg, MOT_CloneMessageId ackedid)
fpreal getFrame() const
UT_StringHolder getDisplayAov() const
bool loadHipFile() const
GLint GLsizei GLsizei height
Definition: glcorearb.h:103
MOT_SocketErrorMessage(const MOT_CloneMessage &rmsg)
int64 MOT_CloneMessageId
UT_Options & setOptionI(const UT_StringHolder &name, int64 value)
std::optional< UT_DimRect > dataWindow() const
UT_StringHolder & extraData()
UT_StringArray availableAovs() const
MOT_CloneMessageId ackedUniqueId() const
MOT_CloneMessageId myUniqueId
MOT_SchemaMessage(const MOT_CloneMessage &rmsg)
LOP_Node * getLopNode() const
static const UT_StringHolder & schemaKey()
bool getProcessUpdates() const
MOT_ImageMessage(const MOT_CloneMessage &rmsg)
MOT_AckMessage(const MOT_CloneMessage &rmsg)
HUSD_API const char * raster()
long long int64
Definition: SYS_Types.h:116
static const UT_StringHolder & schemaName()
static void createMessage(MOT_CloneMessage &rmsg, const OP_NetworkBoxItemList &items)
UT_StringHolder errorMessage() const
static void createMessage(MOT_CloneMessage &rmsg, const UT_StringRef &lopnodepath, const UT_StringRef &cameraprimpath, const UT_StringRef &renderer, const UT_StringRef &rendersettings, const UT_StringRef &displayaov, int width, int height)
static void createMessage(MOT_CloneMessage &rmsg, const UT_StringRef &script, CH_ScriptLanguage lang)
A map of string to various well defined value types.
Definition: UT_Options.h:84
static const UT_StringHolder & schemaName()
bool setEnvVars() const
fpreal64 fpreal
Definition: SYS_Types.h:277
static const UT_StringHolder & schemaName()
UT_Options & setOptionS(const UT_StringHolder &name, const UT_StringHolder &value)
virtual ~MOT_CloneMessage()
static const UT_StringHolder & schemaName()
const UT_StringHolder & extraData() const
GLint GLsizei width
Definition: glcorearb.h:103
UT_Options stats() const
static void createMessage(MOT_CloneMessage &rmsg)
std::optional< UT_Vector2i > fullRes() const
void execute() const
int getHeight() const
UT_StringHolder getCameraPrimPath() const
static const UT_StringHolder & schemaName()
static const UT_StringHolder & schemaName()
UT_StringHolder getRenderSettings() const
UT_Options myOptions
bool isValid() const
virtual ~MOT_SchemaMessage()
void fillWorkBuffer(UT_WorkBuffer &buf) const
MOT_HipFileMessage(const MOT_CloneMessage &rmsg)
bool runScript() const
static void createMessage(MOT_CloneMessage &rmsg, fpreal frame)
static void createMessage(MOT_CloneMessage &rmsg, const UT_StringRef &err)
CH_ScriptLanguage
static const UT_StringHolder & schemaName()
const UT_StringHolder & getOptionS(const UT_StringRef &name) const