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