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 &displayaov,
141  fpreal resscale,
142  int width,
143  int height);
144 
145  LOP_Node *getLopNode() const;
150  fpreal getResScale() const;
151  int getWidth() const;
152  int getHeight() const;
153 };
154 
156  public MOT_SchemaMessage<MOT_FrameMessage>
157 {
158 public:
160  : MOT_SchemaMessage(rmsg)
161  { }
162 
163  static const UT_StringHolder &schemaName();
164  static void createMessage(MOT_CloneMessage &rmsg,
165  fpreal frame);
166 
167  fpreal getFrame() const;
168 };
169 
171  public MOT_SchemaMessage<MOT_ProcessUpdatesMessage>
172 {
173 public:
175  : MOT_SchemaMessage(rmsg)
176  { }
177 
178  static const UT_StringHolder &schemaName();
179  static void createMessage(MOT_CloneMessage &rmsg,
180  bool process_updates);
181 
182  bool getProcessUpdates() const;
183 };
184 
186  public MOT_SchemaMessage<MOT_HipFileMessage>
187 {
188 public:
190  : MOT_SchemaMessage(rmsg)
191  { }
192 
193  static const UT_StringHolder &schemaName();
194  static void createMessage(MOT_CloneMessage &rmsg);
195 
196  bool setEnvVars() const;
197  bool loadHipFile() const;
198 };
199 
201  public MOT_SchemaMessage<MOT_SaveItemsMessage>
202 {
203 public:
205  : MOT_SchemaMessage(rmsg)
206  { }
207 
208  static const UT_StringHolder &schemaName();
209  static void createMessage(MOT_CloneMessage &rmsg,
210  const OP_NetworkBoxItemList &items);
211  static void createMessage(MOT_CloneMessage &rmsg,
212  OP_NetworkBoxItem *item);
213 
214  bool load() const;
215 };
216 
218  public MOT_SchemaMessage<MOT_LogEntriesMessage>
219 {
220 public:
222  : MOT_SchemaMessage(rmsg)
223  { }
224 
225  static const UT_StringHolder &schemaName();
226  static void createMessage(MOT_CloneMessage &rmsg,
228  log_entries);
229 
231  log_entries) const;
232 };
233 
235  public MOT_SchemaMessage<MOT_SocketErrorMessage>
236 {
237 public:
239  : MOT_SchemaMessage(rmsg)
240  { }
241 
242  static const UT_StringHolder &schemaName();
243  static void createMessage(MOT_CloneMessage &rmsg,
244  const UT_StringRef &err);
245 
247 };
248 
250  public MOT_SchemaMessage<MOT_ImageMessage>
251 {
252 public:
254  : MOT_SchemaMessage(rmsg)
255  { }
256 
257  static const UT_StringHolder &schemaName();
258  static void createMessage(MOT_CloneMessage &rmsg,
259  const UT_StringMap<UT_UniquePtr<PXL_Raster>> &rasters,
260  const UT_StringArray &availableaovs,
261  const UT_Options &stats,
262  const UT_Vector2i &fullres,
263  const UT_DimRect &datawindow);
264 
267  UT_Options stats() const;
268  std::optional<UT_Vector2i> fullRes() const;
269  std::optional<UT_DimRect> dataWindow() const;
270  int skippedRasters() const;
271 };
272 
274  public MOT_SchemaMessage<MOT_AckMessage>
275 {
276 public:
278  : MOT_SchemaMessage(rmsg)
279  { }
280 
281  static const UT_StringHolder &schemaName();
282  static void createMessage(MOT_CloneMessage &rmsg,
283  MOT_CloneMessageId ackedid);
284 
286 };
287 
288 #endif // __MOT_CLONEMESSAGE_H__
289 
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)
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
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: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 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
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, fpreal resscale, int width, int height)
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