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>
20 #include <UT/UT_StringMap.h>
22 #include <UT/UT_Vector2.h>
23 #include <optional>
24 
25 class MOT_Director;
26 class LOP_Node;
27 class PXL_Raster;
28 
30 #define MOT_CLONE_MESSAGE_INVALID_ID -1
31 #define MOT_MAX_MESSAGE_LENGTH_HEADER "SetMaxMessageLength"
32 #define MOT_MAX_MESSAGE_LENGTH_DEFAULT (1024 * 1024 * 64)
33 
35 {
36 public:
38  MOT_CloneMessage(const UT_StringRef &msg);
39  virtual ~MOT_CloneMessage();
40 
41  const UT_Options &options() const
42  { return myOptions; }
44  { return myOptions; }
45  const UT_StringHolder &extraData() const
46  { return myExtraData; }
48  { return myExtraData; }
50  { return myUniqueId; }
51  void fillWorkBuffer(UT_WorkBuffer &buf) const;
52 
53  static const UT_StringHolder &schemaKey();
54  static const UT_StringHolder &uniqueIdKey();
55 
56 protected:
60 };
61 
62 template<class SchemaClass>
64 {
65 public:
67  : myMsg(rmsg)
68  { }
70  { }
71 
72  bool isValid() const
73  {
74  UT_StringHolder schema =
77  return schema == SchemaClass::schemaName();
78  }
79 
80 protected:
81  static void createMessage(MOT_CloneMessage &rmsg)
82  {
83  rmsg.options().setOptionS(
85  SchemaClass::schemaName());
86  rmsg.options().setOptionI(
88  rmsg.uniqueId());
89  }
90 
92 };
93 
95  public MOT_SchemaMessage<MOT_ScriptMessage>
96 {
97 public:
99  : MOT_SchemaMessage(rmsg)
100  { }
101 
102  static const UT_StringHolder &schemaName();
103  static void createMessage(MOT_CloneMessage &rmsg,
104  const UT_StringRef &script,
105  CH_ScriptLanguage lang);
106 
107  bool runScript() const;
108 };
109 
111  public MOT_SchemaMessage<MOT_RemoteExecMessage>
112 {
113 public:
115  : MOT_SchemaMessage(rmsg)
116  { }
117 
118  static const UT_StringHolder &schemaName();
119  static void createMessage(MOT_CloneMessage &rmsg,
120  const UT_StringHolder &functionname,
121  const UT_Options &parameters);
122 
123  void execute() const;
124 };
125 
127  public MOT_SchemaMessage<MOT_ConfigureMessage>
128 {
129 public:
131  : MOT_SchemaMessage(rmsg)
132  { }
133 
134  static const UT_StringHolder &schemaName();
135  static void createMessage(MOT_CloneMessage &rmsg,
136  const UT_StringRef &lopnodepath,
137  const UT_StringRef &cameraprimpath,
138  const UT_StringRef &renderer,
139  const UT_StringRef &rendersettings,
140  const UT_StringRef &renderpass,
141  const UT_StringRef &displayaov,
142  fpreal resscale,
143  int width,
144  int height,
145  const UT_Vector4F &renderregion);
146 
147  LOP_Node *getLopNode() const;
153  fpreal getResScale() const;
154  int getWidth() const;
155  int getHeight() const;
157 };
158 
160  public MOT_SchemaMessage<MOT_FrameMessage>
161 {
162 public:
164  : MOT_SchemaMessage(rmsg)
165  { }
166 
167  static const UT_StringHolder &schemaName();
168  static void createMessage(MOT_CloneMessage &rmsg,
169  fpreal frame);
170 
171  fpreal getFrame() const;
172 };
173 
175  public MOT_SchemaMessage<MOT_ProcessUpdatesMessage>
176 {
177 public:
179  : MOT_SchemaMessage(rmsg)
180  { }
181 
182  static const UT_StringHolder &schemaName();
183  static void createMessage(MOT_CloneMessage &rmsg,
184  bool process_updates);
185 
186  bool getProcessUpdates() const;
187 };
188 
190  public MOT_SchemaMessage<MOT_HipFileMessage>
191 {
192 public:
194  : MOT_SchemaMessage(rmsg)
195  { }
196 
197  static const UT_StringHolder &schemaName();
198  static void createMessage(MOT_CloneMessage &rmsg);
199 
200  bool setEnvVars() const;
201  bool loadHipFile() const;
202 };
203 
205  public MOT_SchemaMessage<MOT_SaveItemsMessage>
206 {
207 public:
209  : MOT_SchemaMessage(rmsg)
210  { }
211 
212  static const UT_StringHolder &schemaName();
213  static void createMessage(MOT_CloneMessage &rmsg,
214  const OP_NetworkBoxItemList &items);
215  static void createMessage(MOT_CloneMessage &rmsg,
216  OP_NetworkBoxItem *item);
217 
218  bool load() const;
219 };
220 
222  public MOT_SchemaMessage<MOT_LogEntriesMessage>
223 {
224 public:
226  : MOT_SchemaMessage(rmsg)
227  { }
228 
229  static const UT_StringHolder &schemaName();
230  static void createMessage(MOT_CloneMessage &rmsg,
232  log_entries);
233 
235  log_entries) const;
236 };
237 
239  public MOT_SchemaMessage<MOT_SocketErrorMessage>
240 {
241 public:
243  : MOT_SchemaMessage(rmsg)
244  { }
245 
246  static const UT_StringHolder &schemaName();
247  static void createMessage(MOT_CloneMessage &rmsg,
248  const UT_StringRef &err);
249 
251 };
252 
254  public MOT_SchemaMessage<MOT_ImageMessage>
255 {
256 public:
258  : MOT_SchemaMessage(rmsg)
259  { }
260 
261  static const UT_StringHolder &schemaName();
262  static void createMessage(MOT_CloneMessage &rmsg,
263  const UT_StringMap<UT_UniquePtr<PXL_Raster>> &rasters,
264  const UT_StringArray &availableaovs,
265  const UT_Options &stats,
266  const UT_Vector2i &fullres,
267  const UT_DimRect &datawindow);
268 
271  UT_Options stats() const;
272  std::optional<UT_Vector2i> fullRes() const;
273  std::optional<UT_DimRect> dataWindow() const;
274  int skippedRasters() const;
275 };
276 
278  public MOT_SchemaMessage<MOT_AckMessage>
279 {
280 public:
282  : MOT_SchemaMessage(rmsg)
283  { }
284 
285  static const UT_StringHolder &schemaName();
286  static void createMessage(MOT_CloneMessage &rmsg,
287  MOT_CloneMessageId ackedid);
288 
290 };
291 
292 #endif // __MOT_CLONEMESSAGE_H__
293 
MOT_CloneMessageId uniqueId() const
UT_StringHolder getRenderPass() 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)
int skippedRasters() 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 const UT_StringHolder & schemaName()
static const UT_StringHolder & uniqueIdKey()
UT_StringHolder getRenderer() const
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
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)
long long int64
Definition: SYS_Types.h:116
UT_Vector4F getRenderRegion() const
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 &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:278
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 void createMessage(MOT_CloneMessage &rmsg, const UT_StringMap< UT_UniquePtr< PXL_Raster >> &rasters, const UT_StringArray &availableaovs, const UT_Options &stats, const UT_Vector2i &fullres, const UT_DimRect &datawindow)
fpreal getResScale() const
UT_StringMap< UT_UniquePtr< PXL_Raster > > createImages() const
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)
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 &renderpass, const UT_StringRef &displayaov, fpreal resscale, int width, int height, const UT_Vector4F &renderregion)
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