HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VEX_GeoCommand.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: VEX_GeoCommand.h ( VEX Library, C++)
7  *
8  * COMMENTS: Generic commands and queues to store geometry
9  * edit operations
10  */
11 
12 #ifndef __VEX_GeoCommand__
13 #define __VEX_GeoCommand__
14 
15 #include "VEX_API.h"
16 
17 #include "VEX_Types.h"
18 
19 #include <UT/UT_Array.h>
20 #include <UT/UT_SharedString.h>
21 #include <UT/UT_StringHolder.h>
22 #include <UT/UT_StringSet.h>
23 #include <UT/UT_Vector3.h>
24 #include <UT/UT_VectorTypes.h>
25 #include <UT/UT_IntArray.h>
26 #include <UT/UT_PageArray.h>
27 
28 #include <hboost/variant.hpp>
29 
30 // Do NOT use VEX_API here for template classes with all code in the header!
31 
32 enum class VEX_GeoMode
33 {
34  SET,
35  ADD,
36  MAX,
37  MIN,
38  MULTIPLY,
39  TOGGLE,
40  APPEND,
41 
42  INVALID
43 };
44 enum class VEX_GeoPrimType
45 {
46  POLY_OPEN,
48  TET,
49  SPHERE,
50  CIRCLE,
51  TUBE,
52  METABALL,
53  METASQUAD,
55  PACKEDDISK,
56 
57  INVALID
58 };
59 enum class VEX_GeoDictType
60 {
61  DETAIL,
63  PRIM,
65  PRIMGROUP,
66  POINT,
67  POINTGROUP,
68  VERTEX,
70 
71  INVALID
72 };
73 enum class VEX_GeoTypeInfo
74 {
75  NOCHANGE = -1,
76  NONE = 0,
77  POINT,
78  HPOINT,
79  VECTOR,
80  NORMAL,
81  COLOR,
82  TRANSFORM,
83  QUATERNION,
84  INDEXPAIR,
88 };
89 
90 
91 namespace VEX_Geo
92 {
93  VEX_API VEX_GeoMode modeFromString(const char*);
97 
98 } // namespace VEX_Geo
99 
101 {
102 public:
103  VEX_GeoCommand(exint srcelem) { mySourceElem = srcelem; }
104  VEX_GeoCommand(): mySourceElem(-1) {}
105 
106  exint elem() const { return mySourceElem; }
107 
108 protected:
110 };
111 
112 template <VEX_Precision PREC>
114 {
115 public:
117  : VEX_GeoCommand(srcelem)
118  , myType(primtype)
119  {
120  }
122 
123  VEX_GeoPrimType type() const { return myType; }
124 
125 protected:
127 };
128 
129 template <VEX_Precision PREC>
131 {
132 public:
134  : VEX_GeoCommand(srcelem)
135  , myPos(pos)
136  , mySrcPt(-1)
137  {
138  }
140  : VEX_GeoCommand(srcelem)
141  , myPos(0.0, 0.0, 0.0)
142  , mySrcPt(srcpt)
143  {
144  }
146 
147  VEXvec3<PREC> pos() const { return myPos; }
148  VEXint<PREC> srcpt() const { return mySrcPt; }
149 
150 protected:
151  // Ideally we'd union, but C++ makes this frustrating.
154 };
155 
156 template <VEX_Precision PREC>
158 {
159 public:
162  : VEX_GeoCommand(srcelem)
163  , myPrimNum(primnum)
164  , myPtNum(ptnum)
165  {
166  }
168 
169  VEXint<PREC> primnum() const { return myPrimNum; }
170  VEXint<PREC> ptnum() const { return myPtNum; }
171 
172 protected:
175 };
176 
177 template <VEX_Precision PREC>
179 {
180 public:
182  : VEX_GeoCommand(srcelem)
183  , myObjID(obj_id)
184  {
185  }
187 
188  VEXint<PREC> objID() const { return myObjID; }
189 
190 protected:
192 };
193 
194 namespace VEX_DataObjID
195 {
196  static SYS_FORCE_INLINE void initID(int32 &id) { id = -1; }
197  static SYS_FORCE_INLINE bool isValidID(int32 id) { return id >= 0; }
198 
199  static SYS_FORCE_INLINE void initID(int64 &id) { id = -1; }
200  static SYS_FORCE_INLINE bool isValidID(int64 id) { return id >= 0; }
201 
202  static SYS_FORCE_INLINE void initID(UT_StringHolder &id) { id.clear(); }
203  static SYS_FORCE_INLINE bool isValidID(const UT_StringHolder &id)
204  { return id.isstring(); }
205 
206  static SYS_FORCE_INLINE void initID(UT_OptionsHolder &id) { id.clear(); }
207  static SYS_FORCE_INLINE bool isValidID(const UT_OptionsHolder &id)
208  { return !id.isEmpty(); }
209 };
210 
211 template <VEX_Precision PREC, typename OBJ_ID, typename SEC_ID, typename T>
213 {
214 public:
216  exint srcelem, const OBJ_ID &obj_id, const SEC_ID &sec_id,
218  : VEX_GeoCommand(srcelem)
219  , myObjID(obj_id)
220  , mySecID(sec_id)
221  , myMode(mode)
222  , myData(data)
223  {
224  }
226  : mySecID(-1)
228  , myData(T())
229  {
230  VEX_DataObjID::initID(myObjID);
231  }
232 
233  const OBJ_ID & objID() const { return myObjID; }
234  const SEC_ID & secID() const { return mySecID; }
235  VEX_GeoMode mode() const { return myMode; }
236  T data() const { return myData; }
237 
238 protected:
239  OBJ_ID myObjID;
240  SEC_ID mySecID;
243 };
244 
245 template <VEX_Precision PREC, typename T>
248 template <VEX_Precision PREC, typename T>
251 
252 template <VEX_Precision PREC>
254 {
255 public:
257  exint srcelem, VEXint<PREC> primnum,
258  VEXint<PREC> vtxidx, VEXint<PREC> newptnum)
259  : VEX_GeoCommand(srcelem)
260  , myPrimNum(primnum)
261  , myVtxIdx(vtxidx)
262  , myPtNum(newptnum)
263  {
264  }
266 
267  // -1 for primnum implies a linear vertex
268  VEXint<PREC> primnum() const { return myPrimNum; }
269  VEXint<PREC> vtxidx() const { return myVtxIdx; }
270  VEXint<PREC> ptnum() const { return myPtNum; }
271 
272 protected:
273  VEXint<PREC> myPrimNum, myVtxIdx, myPtNum;
274 };
275 
276 template <VEX_Precision PREC>
278 {
279 public:
281  const VEXfloat<PREC> &value,
282  VEXint<PREC> channelidx)
283  : VEX_GeoCommand(srcelem),
284  myPrimNum(primnum),
285  myValue(value),
286  myChannelIdx(channelidx)
287  {
288  }
289 
291  : myPrimNum(-1), myValue(0.0), myChannelIdx(-1)
292  {
293  }
294 
295  VEXint<PREC> primnum() const { return myPrimNum; }
296  VEXfloat<PREC> value() const { return myValue; }
297  VEXint<PREC> channelIdx() const { return myChannelIdx; }
298 
299 private:
300  VEXint<PREC> myPrimNum;
301  VEXfloat<PREC> myValue;
302  VEXint<PREC> myChannelIdx;
303 };
304 
305 template <VEX_Precision PREC>
307 {
308 public:
310  const VEXmat4<PREC> &xform, VEXint<PREC> xformidx, bool worldspace)
311  : VEX_GeoCommand(srcelem),
312  myPrimNum(primnum),
313  myData(SingleEdit(xform, xformidx)),
314  myWorldSpace(worldspace)
315  {
316  }
318  const UT_Array<VEXmat4<PREC>> &xforms, bool worldspace)
319  : VEX_GeoCommand(srcelem),
320  myPrimNum(primnum),
322  myWorldSpace(worldspace)
323  {
324  }
326 
327  VEXint<PREC> primnum() const { return myPrimNum; }
328  const VEXmat4<PREC> &xform() const
329  {
330  UT_ASSERT(myData.which() == 0);
331  return hboost::get<SingleEdit>(myData).first;
332  }
333  VEXint<PREC> xformidx() const
334  {
335  UT_ASSERT(myData.which() == 0);
336  return hboost::get<SingleEdit>(myData).second;
337  }
339  {
340  UT_ASSERT(myData.which() == 1);
341  return hboost::get<FullEdit>(myData);
342  }
343  bool worldspace() const { return myWorldSpace; }
344 
345  bool isSingleEdit() const { return myData.which() == 0; }
346 
347 protected:
348  typedef std::pair<VEXmat4<PREC>,VEXint<PREC>> SingleEdit;
350 
351  VEXint<PREC> myPrimNum;
352  // Allow setting a single transform or setting all of them
353  hboost::variant<SingleEdit, FullEdit> myData;
355 };
356 
357 template <VEX_Precision PREC>
359 {
360 public:
362  const UT_StringArray &clipnames,
366  const UT_Array<VEXint<PREC>> &cliplayerids,
367  const UT_Array<VEXint<PREC>> &cliplayermodes,
369  const UT_Array<VEXint<PREC>> &cliplayerparents)
370  : VEX_GeoCommand(srcelem),
371  myPrimNum(primnum),
372  myClipNames(clipnames),
375  myClipXformGroups(clipxformgroups),
380  {
381  }
382 
383  VEX_GeoCommandAgentClipEdit() = default;
388 
389  const VEXint<PREC> primnum() const { return myPrimNum; }
390  const UT_StringArray &clipnames() const { return myClipNames; }
391  const UT_Array<VEXfloat<PREC>> &cliptimes() const { return myClipTimes; }
398 
399 protected:
400  VEXint<PREC> myPrimNum;
409 };
410 
411 class CL_Clip;
412 
413 template <VEX_Precision PREC>
415 {
416 public:
418  exint srcelem,
419  VEXint<PREC> primnum,
420  const UT_StringHolder &clip_name,
421  const UT_StringHolder &clip_path,
422  bool keep_ref)
423  : VEX_GeoCommand(srcelem)
424  , myPrimNum(primnum)
425  , myClipName(clip_name)
426  , myClipPath(clip_path)
427  , myKeepRef(keep_ref)
428  {
429  }
431  : VEX_GeoCommand()
432  , myPrimNum(-1)
433  , myClipName()
434  , myClipPath()
435  , myKeepRef(true)
436  {
437  }
438 
439  VEXint<PREC> primnum() const { return myPrimNum; }
440 
441  VEXint<PREC> myPrimNum;
444  bool myKeepRef;
445 };
446 
447 template <VEX_Precision PREC, typename OBJ_ID, typename SEC_ID>
449 {
450 public:
451  //
452  // A variant of all VEXint,VEXfloat,VEXvecN,VEXmatN types
454  {
455  public:
456  DefaultValue() { memset(f, 0, sizeof(VEXfloat<PREC>)*16); i = 0; }
457 
458  void set(VEXint<PREC> v) { i = v; }
459  void set(VEXfloat<PREC> v) { f[0] = v; }
460  void set(VEXvec2<PREC> v) { memcpy(f, &v, sizeof(v)); }
461  void set(VEXvec3<PREC> v) { memcpy(f, &v, sizeof(v)); }
462  void set(VEXvec4<PREC> v) { memcpy(f, &v, sizeof(v)); }
463  void set(VEXmat2<PREC> v) { memcpy(f, &v, sizeof(v)); }
464  void set(VEXmat3<PREC> v) { memcpy(f, &v, sizeof(v)); }
465  void set(VEXmat4<PREC> v) { memcpy(f, &v, sizeof(v)); }
466 
468  VEXint<PREC> i;
469  };
470 
471  VEX_AttribEdit(VEX_GeoDictType dict, const char *name);
472  ~VEX_AttribEdit();
473  void setTypeInfo(exint srcelem,
474  const char *typeinfo);
475 
476  void addAttribute(exint srcelem,
477  VEX_Type type,
478  bool isarray,
479  const DefaultValue &value);
480 
481  void appendEdit(exint srcelem,
482  const OBJ_ID &obj_id,
483  const SEC_ID &sec_id,
486  void appendEdit(exint srcelem,
487  const OBJ_ID &obj_id,
488  const SEC_ID &sec_id,
490  VEXint<PREC> data);
491  void appendEdit(exint srcelem,
492  const OBJ_ID &obj_id,
493  const SEC_ID &sec_id,
496  void appendEdit(exint srcelem,
497  const OBJ_ID &obj_id,
498  const SEC_ID &sec_id,
501  void appendEdit(exint srcelem,
502  const OBJ_ID &obj_id,
503  const SEC_ID &sec_id,
506  void appendEdit(exint srcelem,
507  const OBJ_ID &obj_id,
508  const SEC_ID &sec_id,
511  void appendEdit(exint srcelem,
512  const OBJ_ID &obj_id,
513  const SEC_ID &sec_id,
516  void appendEdit(exint srcelem,
517  const OBJ_ID &obj_id,
518  const SEC_ID &sec_id,
521  void appendEdit(exint srcelem,
522  const OBJ_ID &obj_id,
523  const SEC_ID &sec_id,
525  const char *data);
526  void appendEdit(exint srcelem,
527  const OBJ_ID &obj_id,
528  const SEC_ID &sec_id,
530  UT_OptionsHolder dict);
531  void appendEdit(exint srcelem,
532  const OBJ_ID &obj_id,
533  const SEC_ID &sec_id,
535  const UT_Array<VEXfloat<PREC>> *data);
536  void appendEdit(exint srcelem,
537  const OBJ_ID &obj_id,
538  const SEC_ID &sec_id,
540  const UT_Array<VEXvec2<PREC>> *data);
541  void appendEdit(exint srcelem,
542  const OBJ_ID &obj_id,
543  const SEC_ID &sec_id,
545  const UT_Array<VEXvec3<PREC>> *data);
546  void appendEdit(exint srcelem,
547  const OBJ_ID &obj_id,
548  const SEC_ID &sec_id,
550  const UT_Array<VEXvec4<PREC>> *data);
551  void appendEdit(exint srcelem,
552  const OBJ_ID &obj_id,
553  const SEC_ID &sec_id,
555  const UT_Array<VEXmat2<PREC>> *data);
556  void appendEdit(exint srcelem,
557  const OBJ_ID &obj_id,
558  const SEC_ID &sec_id,
560  const UT_Array<VEXmat3<PREC>> *data);
561  void appendEdit(exint srcelem,
562  const OBJ_ID &obj_id,
563  const SEC_ID &sec_id,
565  const UT_Array<VEXmat4<PREC>> *data);
566  void appendEdit(exint srcelem,
567  const OBJ_ID &obj_id,
568  const SEC_ID &sec_id,
570  const UT_Array<VEXint<PREC>> *data);
571  void appendEdit(exint srcelem,
572  const OBJ_ID &obj_id,
573  const SEC_ID &sec_id,
576  void appendEdit(exint srcelem,
577  const OBJ_ID &obj_id,
578  const SEC_ID &sec_id,
581 
582 
583  // This may steal the command list from the source!
584  void merge(VEX_AttribEdit &src);
585 
586  void sort();
587 
588  void clear();
589 
590  // These convert our command list to the specified type.
591  //
592  // If the stored VEX_Type matches the return type, the result will be
593  // valid. Otherwise nullptr is returned.
594 
595  // Functions:
596  // fCmd, iCmd, v2Cmd, v3Cmd, v4Cmd, m2Cmd, m3Cmd, m4Cmd, sCmd, dCmd
597  // afCmd, aiCmd, av2Cmd, av3Cmd, av4Cmd, am2Cmd, am3Cmd, am4Cmd, asCmd, adCmd
598 #define VEX_GEOATTRIBEDIT_CASE(vtype, type, name, isarray) \
599  UT_Array<VEX_DataCommandAttribEdit<PREC, OBJ_ID, SEC_ID, type>> * \
600  name##Cmd() \
601  {\
602  if (myType == vtype && myIsArray == isarray)\
603  return (UT_Array<VEX_DataCommandAttribEdit<PREC, OBJ_ID, SEC_ID, type>>*) myCmdList;\
604  return nullptr;\
605  }
606 #define VEX_GEOATTRIBEDIT_CASE_DIRECT(ty, name) \
607  VEX_GEOATTRIBEDIT_CASE(VEX_VexTypeResolver<VEX##ty<PREC>>::type,VEX##ty<PREC>,name,false)
608 #define VEX_GEOATTRIBEDIT_CASE_ARRAY(ty, name) \
609  VEX_GEOATTRIBEDIT_CASE(VEX_VexTypeResolver<VEX##ty<PREC>>::type,const UT_Array<VEX##ty<PREC>>*,name,true)
610 
619 
622 
631 
632  VEX_GEOATTRIBEDIT_CASE(VEX_TYPE_STRING, const UT_Array<const char*>*, as, true)
633  VEX_GEOATTRIBEDIT_CASE(VEX_TYPE_DICT, const UT_Array<UT_OptionsHolder>*, ad, true)
634 
635 #undef VEX_GEOATTRIBEDIT_CASE_ARRAY
636 #undef VEX_GEOATTRIBEDIT_CASE_DIRECT
637 #undef VEX_GEOATTRIBEDIT_CASE
638 
639  VEX_GeoDictType dict() const { return myDict; }
640  const char *name() const { return myName; }
641  VEX_Type type() const { return myType; }
642  bool isArray() const { return myIsArray; }
643  bool shouldcreate() const { return myDoCreate; }
644  VEX_GeoTypeInfo typeinfo() const { return myTypeInfo; }
645  const DefaultValue &defaultValue() const { return myDefValue; }
646 
647 protected:
648  // The earliest proc that refered to us.
653  bool myIsArray;
654  // The proc that set the typeinfo.
655  // Because we are logically overwriting, it makes sense for this
656  // to be the last person to set it!
659 
660  void *myCmdList;
661  // The proc that marked us for creation
664  DefaultValue myDefValue;
665 };
666 
667 template <VEX_Precision PREC>
669 template <VEX_Precision PREC>
671 
672 template <VEX_Precision PREC>
674 {
675 public:
677  exint srcelem,
678  VEXint<PREC> ptnum0, VEXint<PREC> ptnum1,
679  VEXint<PREC> data)
680  : VEX_GeoCommand(srcelem)
681  , myPtNum0(ptnum0)
682  , myPtNum1(ptnum1)
683  , myData(data)
684  {
685  }
687  : VEX_GeoCommand(), myPtNum0(-1) , myPtNum1(-1), myData(-1)
688  {}
689 
690  VEXint<PREC> ptNum0() const { return myPtNum0; }
691  VEXint<PREC> ptNum1() const { return myPtNum1; }
692  VEXint<PREC> data() const { return myData; }
693 
694 protected:
695  VEXint<PREC> myPtNum0;
696  VEXint<PREC> myPtNum1;
697  VEXint<PREC> myData;
698 };
699 
700 template <VEX_Precision PREC>
702 {
703 public:
704  VEX_GeoEdgeGroupEdit(const UT_StringHolder &groupname): myGroupName(groupname) {}
705 
706  const UT_StringHolder &groupName() const { return myGroupName; }
707 
708  const UT_Array<VEX_GeoCommandEdgeGroupEdit<PREC>> &cmd() const { return myCmdList; }
709 
710  void appendEdit(exint srcelem,
711  VEXint<PREC> ptnum0,
712  VEXint<PREC> ptnum1,
713  VEXint<PREC> data);
714 
715  void merge(VEX_GeoEdgeGroupEdit &src);
716 
717  void sort();
718 
719 protected:
722 };
723 
724 template <VEX_Precision PREC>
726 {
727 public:
730 
731  // Converts the given string to one in our string table, ensuring
732  // the pointer remains valid and avoids duplication.
733  const char *hardenString(const char *str);
734 
735  // Creates a new array which is owned by this queue. Does
736  // not de-duplicate, but will return 0 for empty lists.
737  const UT_Array<VEXfloat<PREC>> *hardenArray(const UT_Array<VEXfloat<PREC>> &arr);
738  const UT_Array<VEXvec2<PREC>> *hardenArray(const UT_Array<VEXvec2<PREC>> &arr);
739  const UT_Array<VEXvec3<PREC>> *hardenArray(const UT_Array<VEXvec3<PREC>> &arr);
740  const UT_Array<VEXvec4<PREC>> *hardenArray(const UT_Array<VEXvec4<PREC>> &arr);
741  const UT_Array<VEXmat2<PREC>> *hardenArray(const UT_Array<VEXmat2<PREC>> &arr);
742  const UT_Array<VEXmat3<PREC>> *hardenArray(const UT_Array<VEXmat3<PREC>> &arr);
743  const UT_Array<VEXmat4<PREC>> *hardenArray(const UT_Array<VEXmat4<PREC>> &arr);
744  const UT_Array<VEXint<PREC>> *hardenArray(const UT_Array<VEXint<PREC>> &arr);
745  // ALSO hardens the contents:
746  const UT_Array<const char *> *hardenArray(const UT_Array<const char *> &arr);
747 
748  const UT_Array<UT_OptionsHolder> *hardenArray(const UT_Array<UT_OptionsHolder> &arr);
749 
750  // Merges the src into us. Note that the result may still
751  // reference strings in the stringtable of src, so src must *not*
752  // be deleted until the queue is processed!
753  // This also may destroy src in the merging if stealing is more
754  // efficient.
755  void merge(VEX_GeoCommandQueue &src);
756  // Ensure our commands are in srcelem order.
757  void sort();
758 
759  bool isEmpty() const
760  {
761  return myPointAdd.isEmpty() &&
762  myPrimAdd.isEmpty() &&
763  myVertexAdd.isEmpty() &&
764  myVertexRewire.isEmpty() &&
765  myAttribEdit.isEmpty() &&
766  myUsdAttribEdit.isEmpty() &&
767  myEdgeGroupEdit.isEmpty() &&
768  myAgentChannelEdit.isEmpty() &&
769  myAgentXformEdit.isEmpty() &&
770  myAgentClipEdit.isEmpty() &&
771  myAgentAddClip.isEmpty() &&
772  myPointRemove.isEmpty() &&
773  myPointWithPrimRemove.isEmpty() &&
774  myPrimRemove.isEmpty() &&
775  myPrimWithPointRemove.isEmpty() &&
776  myVertexRemove.isEmpty() &&
777  myLocalVariables.empty() &&
778  !myNewVisualizers;
779  }
780 
781  // These return the new element number *relative* to the srcelem!
782  VEXint<PREC> addPrim(exint srcelem, VEX_GeoPrimType primtype);
783  VEXint<PREC> addPoint(exint srcelem, VEXvec3<PREC> pos);
784  VEXint<PREC> addPoint(exint srcelem, VEXint<PREC> srcpt);
785  VEXint<PREC> addVertex(exint srcelem, VEXint<PREC> primnum,
786  VEXint<PREC> ptnum);
787 
788  void setEdgeGroup(
789  exint srcelem,
790  const UT_StringHolder &groupname,
791  VEXint<PREC> ptnum0, VEXint<PREC> ptnum1,
792  VEXint<PREC> data);
793 
794  void addLocalVariable(exint srcelem, const char *attrib, const char *local);
795  void addVisualizer(const UT_StringHolder &visualizer);
796 
797  // If the given primnum is -1, it will treat vtxidx as a linear vertex
798  void rewireVertex( exint srcelem, VEXint<PREC> primum,
799  VEXint<PREC> vtxidx, VEXint<PREC> ptnum);
800 
801  void removePoint(exint srcelem, VEXint<PREC> ptnum, bool includeprims);
802  void removePrim(exint srcelem, VEXint<PREC> primnum, bool includepoints);
803  void removeVertex(exint srcelem, VEXint<PREC> primnum);
804 
805  void setAgentChannelValue(exint srcelem, VEXint<PREC> primnum,
807  VEXint<PREC> channelidx);
808 
809  void setAgentTransform(exint srcelem, VEXint<PREC> primnum,
810  const VEXmat4<PREC> &xform, VEXint<PREC> xformidx,
811  bool worldspace);
812 
813  void setAgentTransforms(exint srcelem, VEXint<PREC> primnum,
814  const UT_Array<VEXmat4<PREC>> &xforms,
815  bool worldspace);
816 
817  void setAgentClips(exint srcelem, VEXint<PREC> primnum,
818  const UT_StringArray &clipnames,
819  const UT_Array<VEXfloat<PREC>> &cliptimes,
820  const UT_Array<VEXfloat<PREC>> &clipweights,
821  const UT_StringArray &clipxformgroups,
822  const UT_Array<VEXint<PREC>> &cliplayerids,
823  const UT_Array<VEXint<PREC>> &cliplayermodes,
824  const UT_Array<VEXfloat<PREC>> &cliplayerweights,
825  const UT_Array<VEXint<PREC>> &cliplayerparents);
826 
827  void agentAddClip(
828  exint srcelem,
829  VEXint<PREC> primnum,
830  const UT_StringHolder &clip_name,
831  const UT_StringHolder &clip,
832  const bool keep_ref);
833 
834  VEX_GeoAttribEdit<PREC> *findEdit( VEX_GeoDictType dict, const char *name);
835  VEX_GeoAttribEdit<PREC> *findOrCreateEdit( VEX_GeoDictType dict,
836  const char *name);
837 
838  VEX_UsdAttribEdit<PREC> *findUsdEdit( VEX_GeoDictType dict,
839  const char *name);
840  VEX_UsdAttribEdit<PREC> *findOrCreateUsdEdit( VEX_GeoDictType dict,
841  const char *name);
842 
843  VEX_GeoEdgeGroupEdit<PREC> *findOrCreateEdgeGroupEdit(
844  const UT_StringHolder &groupname);
845 
846  // Creators
850  // Requested local variables.
852  {
854  const char *local; // hardened!
855  };
857 
859 
860  // Edits
869 
870  // Destructors
871  // Note we don't have to sort these. We do need to track
872  // the source element to be able to lookup the relevant point
873  // or primitive number, however.
879 
880  typedef UT_PageArray<
881  /* DATA_T */ VEXint<PREC>,
882  /* TSIZE */ 1,
883  /* TABLEHARDENED (owns its data) */ true,
884  /* PAGESHARDENED */ false,
885  /* THEPAGEBITS (2^10 tuples/page) */ 10,
886  /* INDEX_T */ exint
891 
892  exint myNumPrim, myNumPoint, myNumVertex;
893 
894 private:
895  UT_SharedString *myStrings;
896  UT_Array< UT_Array<VEXint<PREC>> *> myIntArrays;
897  UT_Array< UT_Array<VEXfloat<PREC>> *> myFloatArrays;
898  UT_Array< UT_Array<VEXvec2<PREC>> *> myV2Arrays;
899  UT_Array< UT_Array<VEXvec3<PREC>> *> myV3Arrays;
900  UT_Array< UT_Array<VEXvec4<PREC>> *> myV4Arrays;
901  UT_Array< UT_Array<VEXmat2<PREC>> *> myM2Arrays;
902  UT_Array< UT_Array<VEXmat3<PREC>> *> myM3Arrays;
903  UT_Array< UT_Array<VEXmat4<PREC>> *> myM4Arrays;
904  UT_Array< UT_Array<const char *> *> myCstArrays;
905  UT_Array< UT_Array<UT_OptionsHolder> *> myDictArrays;
906 };
907 
913 
919 
920 #endif
GLdouble s
Definition: glew.h:1390
exint elem() const
VEX_GeoCommandAgentAddClip(exint srcelem, VEXint< PREC > primnum, const UT_StringHolder &clip_name, const UT_StringHolder &clip_path, bool keep_ref)
const char * name() const
VEX_Type
VEX variable types.
Definition: VEX_VexTypes.h:18
UT_Array< VEX_GeoCommandPrimAdd< PREC > > myPrimAdd
const UT_Array< VEXfloat< PREC > > & clipweights() const
#define VEX_GEOATTRIBEDIT_CASE_ARRAY(ty, name)
UT_Array< VEX_GeoCommandAgentXformEdit< PREC > > myAgentXformEdit
const char * local
void set(VEXmat3< PREC > v)
GLenum src
Definition: glew.h:2410
int int32
Definition: SYS_Types.h:39
VEXint< PREC > primnum() const
GLuint const GLchar * name
Definition: glew.h:1814
VEX_GeoCommandAgentXformEdit(exint srcelem, VEXint< PREC > primnum, const UT_Array< VEXmat4< PREC >> &xforms, bool worldspace)
UT_StringMap< VariableEntry > myLocalVariables
UT_Array< VEX_GeoEdgeGroupEdit< PREC > * > myEdgeGroupEdit
const UT_Array< VEXint< PREC > > & cliplayerids() const
void set(VEXint< PREC > v)
GLenum mode
Definition: glew.h:2163
const SEC_ID & secID() const
BlockArray myNetVertices
UT_PageArray< VEXint< PREC >, 1, true, false, 10, exint > BlockArray
const OBJ_ID & objID() const
std::pair< VEXmat4< PREC >, VEXint< PREC > > SingleEdit
VEXint< PREC > primnum() const
VEX_Type type() const
VEXint< PREC > primnum() const
VEX_GeoEdgeGroupEdit(const UT_StringHolder &groupname)
UT_Array< VEX_GeoCommandEdgeGroupEdit< PREC > > myCmdList
UT_StringSet * myNewVisualizers
int64 exint
Definition: SYS_Types.h:125
constexpr VEX_Precision VEX_64
Definition: VEX_PodTypes.h:31
UT_Array< VEXfloat< PREC > > myClipTimes
VEX_API VEX_GeoPrimType typeFromString(const char *)
UT_Array< VEXint< PREC > > myClipLayerIds
VEX_GeoCommandPrimAdd(exint srcelem, VEX_GeoPrimType primtype)
VEXint< PREC > ptnum() const
const GLint * first
Definition: glew.h:1528
VEX_GeoCommandPointAdd(exint srcelem, VEXint< PREC > srcpt)
UT_Array< VEX_GeoCommandAgentChannelEdit< PREC > > myAgentChannelEdit
#define VEX_GEOATTRIBEDIT_CASE_DIRECT(ty, name)
const GLdouble * v
Definition: glew.h:1391
#define VEX_API
Definition: VEX_API.h:13
format_arg_store< context, Args...> as
Definition: printf.h:632
const UT_StringHolder & groupName() const
VEX_GeoDictType dict() const
VEX_GeoCommandAgentChannelEdit(exint srcelem, VEXint< PREC > primnum, const VEXfloat< PREC > &value, VEXint< PREC > channelidx)
typename VEX_PrecisionResolver< P >::vec3_type VEXvec3
Definition: VEX_PodTypes.h:70
exint elem
VEX_GeoTypeInfo typeinfo() const
UT_Array< VEX_GeoCommandObjectRemove< PREC > > myPrimRemove
UT_Array< VEX_UsdAttribEdit< PREC > * > myUsdAttribEdit
VEXint< PREC > primnum() const
#define VEX_GEOATTRIBEDIT_CASE(vtype, type, name, isarray)
void set(VEXmat4< PREC > v)
VEXint< PREC > data() const
UT_Array< VEXmat4< PREC > > FullEdit
UT_Array< VEXint< PREC > > myClipLayerParents
bool isEmpty() const
VEX_GeoDictType
UT_Array< VEX_GeoCommandAgentClipEdit< PREC > > myAgentClipEdit
void set(VEXfloat< PREC > v)
VEX_GeoCommandEdgeGroupEdit(exint srcelem, VEXint< PREC > ptnum0, VEXint< PREC > ptnum1, VEXint< PREC > data)
VEX_GeoTypeInfo
GLfloat GLfloat GLfloat v2
Definition: glew.h:1856
VEXint< PREC > xformidx() const
UT_StringHolder myGroupName
GLclampf f
Definition: glew.h:3499
const UT_Array< VEX_GeoCommandEdgeGroupEdit< PREC > > & cmd() const
VEXfloat< PREC > value() const
DefaultValue myDefValue
VEX_GeoCommand(exint srcelem)
bool shouldcreate() const
VEX_GeoCommandAgentXformEdit(exint srcelem, VEXint< PREC > primnum, const VEXmat4< PREC > &xform, VEXint< PREC > xformidx, bool worldspace)
VEX_GeoCommandObjectRemove(exint srcelem, VEXint< PREC > obj_id)
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
typename VEX_PrecisionResolver< P >::float_type VEXfloat
Definition: VEX_PodTypes.h:67
void set(VEXmat2< PREC > v)
UT_String myName
VEX_GeoMode
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
VEXint< PREC > myPrimNum
VEX_GeoDictType myDict
UT_Array< VEX_GeoCommandPointAdd< PREC > > myPointAdd
long long int64
Definition: SYS_Types.h:116
VEXint< PREC > srcpt() const
VEX_GeoPrimType myType
constexpr VEX_Precision VEX_32
Definition: VEX_PodTypes.h:30
typename VEX_PrecisionResolver< P >::mat4_type VEXmat4
Definition: VEX_PodTypes.h:74
const VEXmat4< PREC > & xform() const
hboost::variant< SingleEdit, FullEdit > myData
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1253
VEXint< PREC > ptNum0() const
void set(VEXvec2< PREC > v)
VEXint< PREC > ptNum1() const
UT_Array< VEX_GeoCommandObjectRemove< PREC > > myVertexRemove
const UT_Array< VEXint< PREC > > & cliplayermodes() const
VEX_DataCommandAttribEdit(exint srcelem, const OBJ_ID &obj_id, const SEC_ID &sec_id, VEX_GeoMode mode, T data)
VEX_EXTERN_TEMPLATE(VEX_AttribEdit< VEX_32, VEXint< VEX_32 >, VEXint< VEX_32 >>)
VEX_API VEX_GeoMode modeFromString(const char *)
const UT_StringArray & clipnames() const
typename VEX_PrecisionResolver< P >::mat2_type VEXmat2
Definition: VEX_PodTypes.h:72
VEXint< PREC > primnum() const
VEX_GeoCommandAgentClipEdit(exint srcelem, VEXint< PREC > primnum, const UT_StringArray &clipnames, const UT_Array< VEXfloat< PREC >> &cliptimes, const UT_Array< VEXfloat< PREC >> &clipweights, const UT_StringArray &clipxformgroups, const UT_Array< VEXint< PREC >> &cliplayerids, const UT_Array< VEXint< PREC >> &cliplayermodes, const UT_Array< VEXfloat< PREC >> &cliplayerweights, const UT_Array< VEXint< PREC >> &cliplayerparents)
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER T clip(const T &p, const Box< T > &box)
Definition: ImathBoxAlgo.h:89
VEX_GeoTypeInfo myTypeInfo
typename VEX_PrecisionResolver< P >::vec2_type VEXvec2
Definition: VEX_PodTypes.h:69
VEX_GeoCommandPointAdd(exint srcelem, VEXvec3< PREC > pos)
const UT_Array< VEXfloat< PREC > > & cliplayerweights() const
VEXint< PREC > ptnum() const
UT_Array< VEX_GeoCommandVertexAdd< PREC > > myVertexAdd
UT_Array< VEXint< PREC > > myClipLayerModes
UT_Array< VEXfloat< PREC > > myClipLayerWeights
const UT_Array< VEXmat4< PREC > > & xforms() const
UT_Array< VEX_GeoCommandObjectRemove< PREC > > myPointWithPrimRemove
VEXvec3< PREC > myPos
VEX_GeoPrimType type() const
UT_Array< VEX_GeoCommandVertexRewire< PREC > > myVertexRewire
VEXint< PREC > mySrcPt
UT_Array< VEX_GeoCommandObjectRemove< PREC > > myPrimWithPointRemove
typename VEX_PrecisionResolver< P >::vec4_type VEXvec4
Definition: VEX_PodTypes.h:71
VEXint< PREC > channelIdx() const
UT_Array< VEXfloat< PREC > > myClipWeights
typename VEX_PrecisionResolver< P >::int_type VEXint
Definition: VEX_PodTypes.h:68
VEXint< PREC > vtxidx() const
VEX_API VEX_GeoDictType dictFromString(const char *)
VEX_GeoCommandVertexAdd(exint srcelem, VEXint< PREC > primnum, VEXint< PREC > ptnum)
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:135
const VEXint< PREC > primnum() const
VEX_GeoPrimType
const UT_Array< VEXfloat< PREC > > & cliptimes() const
UT_Array< VEX_GeoCommandAgentAddClip< PREC > > myAgentAddClip
#define const
Definition: zconf.h:214
const DefaultValue & defaultValue() const
void set(VEXvec4< PREC > v)
bool isArray() const
const UT_Array< VEXint< PREC > > & cliplayerparents() const
typename VEX_PrecisionResolver< P >::mat3_type VEXmat3
Definition: VEX_PodTypes.h:73
GLsizei const GLfloat * value
Definition: glew.h:1849
void sort(I begin, I end, const Pred &pred)
Definition: pugixml.cpp:7334
VEXvec3< PREC > pos() const
UT_Array< VEX_GeoAttribEdit< PREC > * > myAttribEdit
UT_Array< VEX_GeoCommandObjectRemove< PREC > > myPointRemove
GLfloat GLfloat GLfloat GLfloat v3
Definition: glew.h:1860
VEX_GeoMode mode() const
VEX_GeoCommandAgentClipEdit & operator=(const VEX_GeoCommandAgentClipEdit &)=default
VEX_GeoCommandVertexRewire(exint srcelem, VEXint< PREC > primnum, VEXint< PREC > vtxidx, VEXint< PREC > newptnum)
void set(VEXvec3< PREC > v)
const UT_StringArray & clipxformgroups() const
UT_StringArray myClipXformGroups
VEXint< PREC > objID() const
VEX_API VEX_GeoTypeInfo typeinfoFromString(const char *)