HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GVEX_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: GVEX_GeoCommand.h ( GVEX Library, C++)
7  *
8  * COMMENTS: Applies VEX_GeoCommands to GDPs
9  */
10 
11 #ifndef __GVEX_GeoCommand__
12 #define __GVEX_GeoCommand__
13 
14 #include "GVEX_API.h"
15 
16 #include <GU/GU_Detail.h>
17 #include <VEX/VEX_GeoCommand.h>
19 
20 class GU_Agent;
21 class GU_PrimChannel;
22 class GU_PrimPacked;
23 
24 template <VEX_Precision PREC>
26 {
27 public:
29  ~GVEX_GeoCommand();
30 
31  // WARNING: Because of shared string tables, the provided geocmd
32  // must remain live until after this is applied!
33  void appendQueue(VEX_GeoCommandQueue<PREC> &geocmd);
34  void appendQueues(UT_Array<VEX_GeoCommandQueue<PREC>> &geocmds);
35 
36  // Used by apply() to resolve relative op: paths
37  void setCwdOpId(int op_id)
38  { myCwdOpId = op_id; }
39 
40  void apply(GU_Detail *gdp);
41 
42 public:
43  GA_Offset pointOffset(const GU_Detail *gdp, exint elem, exint pointidx) const;
44  GA_Offset primitiveOffset(const GU_Detail *gdp, exint elem, exint primitiveidx) const;
45  GA_Offset vertexOffset(const GU_Detail *gdp, exint elem, exint vertexidx) const;
46  GA_Offset vertexOffset(const GU_Detail *gdp, exint elem, exint primidx, exint vertexidx) const;
47 
48  GA_Offset dictOffset(const GU_Detail *gdp, GA_AttributeOwner owner, exint elem, exint objidx, exint secidx) const;
49 
50 protected:
51  void applyAttribCreate(GU_Detail *gdp, GA_AttributeOwner owner, VEX_GeoAttribEdit<PREC> *edit) const;
52  void applyAttribTypeInfo(GU_Detail *gdp, GA_AttributeOwner owner, VEX_GeoAttribEdit<PREC> *edit) const;
53  void applyAttribEdit(GU_Detail *gdp, GA_AttributeOwner owner, VEX_GeoAttribEdit<PREC> *edit, bool alreadybumpingid) const;
54  void applyGroupCreate(GU_Detail *gdp, GA_AttributeOwner owner, VEX_GeoAttribEdit<PREC> *edit) const;
55  void applyGroupEdit(GU_Detail *gdp, GA_AttributeOwner owner, VEX_GeoAttribEdit<PREC> *edit, bool alreadybumpingid) const;
56  void applyIntrinsicEdit(GU_Detail *gdp, VEX_GeoAttribEdit<PREC> *edit) const;
57  void applyDetailIntrinsicEdit(GU_Detail *gdp, VEX_GeoAttribEdit<PREC> *edit) const;
58 
59  THREADED_METHOD2(GVEX_GeoCommand, myGeoCmd.myPointAdd.entries() > 8*1024,
60  setNewPointPos,
61  GU_Detail *, gdp,
62  bool *, hasclone);
63  void setNewPointPosPartial(GU_Detail *gdp,
64  bool *hasclone,
65  const UT_JobInfo &info);
66 
67 private:
68  template <typename GeoCmdT>
69  GU_Agent * getAgent(GU_Detail *gdp, const GeoCmdT &cmd,
70  bool all_agents, GU_PrimPacked *&packed_prim);
71 
72  template <typename GeoCmdT>
73  GU_PrimChannel *getPrimChannel(GU_Detail *gdp, const GeoCmdT &cmd,
74  bool all_chprims);
75 
76 private:
77  bool mySorted;
79 
80  UT_IntArray myNetPrimIndex;
81  UT_IntArray myNetPointIndex;
82  UT_IntArray myNetVertexIndex;
83 
84  int myCwdOpId;
85 };
86 
89 
90 #endif
#define GVEX_API
Definition: GVEX_API.h:12
int64 exint
Definition: SYS_Types.h:125
GA_Size GA_Offset
Definition: GA_Types.h:646
#define THREADED_METHOD2(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2)
void setCwdOpId(int op_id)
GA_AttributeOwner
Definition: GA_Types.h:35
GVEX_EXTERN_TEMPLATE(GVEX_GeoCommand< VEX_32 >)