HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GAS_NetSliceExchange.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: GAS_NetSliceExchange.h ( GAS Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GAS_NetSliceExchange__
12 #define __GAS_NetSliceExchange__
13 
14 #include "GAS_API.h"
15 
16 #include "GAS_SubSolver.h"
17 #include "GAS_Utils.h"
18 
19 #include <SIM/SIM_Slice.h>
20 
21 class SIM_GeometryCopy;
22 class GU_Detail;
23 
25 {
26 public:
27  GET_DATA_FUNC_S(GAS_NAME_GEOMETRY, GeometryName);
28 
29  GET_DATA_FUNC_S(GAS_NAME_TRACKERADDR, TrackerAddress);
32  GET_DATA_FUNC_I("slice", Slice);
33 
34  GET_DATA_FUNC_B("assignslice", AssignSlice);
35  GET_DATA_FUNC_B("transferpoints", TransferPoints);
36  GET_DATA_FUNC_B("exchangeattribs", ExchangeAttribs);
37  GET_DATA_FUNC_B("deleteexternal", DeleteExternal);
38  GET_DATA_FUNC_B("computeslicedist", ComputeSliceDistance);
39  GET_DATA_FUNC_B("normalizeslicedist", NormalizeSliceDistance);
40 
41  GET_DATA_FUNC_I("blend", Blend);
42  GET_DATA_FUNC_S("id", Id);
43  GET_DATA_FUNC_S("sliceattr", SliceAttr);
44  GET_DATA_FUNC_S("attrib", Attrib);
45  GET_DATA_FUNC_S("sliceroot", SliceRoot);
46 
47  GET_DATA_FUNC_F("overlap", Overlap);
48  GET_DATA_FUNC_F("overlappscale", OverlapPscale);
49 
50 protected:
51  explicit GAS_NetSliceExchange(const SIM_DataFactory *factory);
52  ~GAS_NetSliceExchange() override;
53 
54  /// Moves the fields given by FieldName by the given velocity
55  /// field. Moves the points given by GeometryName likewise.
56  bool solveGasSubclass(SIM_Engine &engine,
57  SIM_Object *obj,
58  SIM_Time time,
59  SIM_Time timestep) override;
60 
61 private:
62  void doNetExchange(SIM_GeometryCopy *geo,
64  const char *address,
65  int port,
66  const char *jobname,
67  int blendmode);
68 
69  void buildAttribPacket(std::ostream &os,
70  GU_Detail *gdp,
71  UT_Array<GA_Offset> &ptlist,
72  GA_ROHandleI &idh,
73  const char *attribstring);
74 
75 
76  void applyAttribPacket(UT_IStream &is,
77  GU_Detail *gdp, const UT_Map<int, GA_Offset> &idlut);
78 
79  THREADED_METHOD3(GAS_NetSliceExchange, gdp->getNumPoints() > 2048, assignSlices,
80  GU_Detail *, gdp,
81  const char *, slicename,
82  const SIM_SliceSearchTable &, slicetable)
83  void assignSlicesPartial(GU_Detail *gdp,
84  const char *slicename,
85  const SIM_SliceSearchTable &slicetable,
86  const UT_JobInfo &info);
87 
88  THREADED_METHOD5(GAS_NetSliceExchange, gdp->getNumPoints() > 2048, computeSliceDist,
89  GU_Detail *, gdp,
90  const SIM_SliceSearchList &, slicelist,
91  float, overlap,
92  float, overlapscale,
93  bool, normalize)
94  void computeSliceDistPartial(GU_Detail *gdp,
95  const SIM_SliceSearchList &slicelist,
96  float overlap,
97  float overlapscale,
98  bool normalize,
99  const UT_JobInfo &info);
100 
101  static const SIM_DopDescription *getDopDescription();
102 
106  "Gas Net Slice Exchange",
107  getDopDescription());
108 };
109 
110 #endif
111 
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:50
Unsorted map container.
Definition: UT_Map.h:107
#define GAS_NAME_GEOMETRY
Definition: GAS_Utils.h:30
GT_API const UT_StringHolder time
#define GAS_API
Definition: GAS_API.h:10
virtual bool solveGasSubclass(SIM_Engine &engine, SIM_Object *obj, SIM_Time time, SIM_Time timestep)=0
#define THREADED_METHOD3(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3)
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:63
#define GET_DATA_FUNC_I(DataName, FuncName)
#define GAS_NAME_TRACKERADDR
Definition: GAS_Utils.h:43
#define GAS_NAME_TRACKERPORT
Definition: GAS_Utils.h:44
#define THREADED_METHOD5(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5)
GLenum GLenum GLsizei void * table
Definition: glad.h:5129
#define GAS_NAME_JOBNAME
Definition: GAS_Utils.h:45
#define GET_DATA_FUNC_B(DataName, FuncName)
#define GET_DATA_FUNC_F(DataName, FuncName)
#define GET_DATA_FUNC_S(DataName, FuncName)
constexpr T normalize(UT_FixedVector< T, D > &a) noexcept
SYS_FORCE_INLINE GA_Size getNumPoints() const
Return the number of points.
Definition: GA_Detail.h:334
This implements a SIM_Geometry that copies the source geometry.