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