HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GAS_ParticleToField.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_ParticleToField.h ( GAS Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GAS_ParticleToField__
12 #define __GAS_ParticleToField__
13 
14 #include "GAS_API.h"
15 
16 #include "GAS_SubSolver.h"
17 #include "GAS_Utils.h"
18 
19 #include <SIM/SIM_RawField.h>
20 
21 #include <GEO/GEO_PointTree.h>
22 
24 
26 
27 class SIM_RawIndexField;
28 
30 {
31 public:
32  GET_DATA_FUNC_S(GAS_NAME_FIELD, FieldName);
33  GET_DATA_FUNC_S(GAS_NAME_GEOMETRY, GeometryName);
34 
35  GET_DATA_FUNC_B("useattrib", UseAttribute);
36  GET_DATA_FUNC_S("attrib", Attribute);
37  GET_DATA_FUNC_B("useaffine", UseAffine);
38  GET_DATA_FUNC_S("affine", Affine);
39  GET_DATA_FUNC_F("threshold", Threshold);
40  GET_DATA_FUNC_B("accumulate", Accumulate);
41  GET_DATA_FUNC_B("scalebyvolume", ScaleByVoxelVolume);
42  GET_DATA_FUNC_B("extrapolate", Extrapolate);
43  GET_DATA_FUNC_B("usemaxextrapolate", UseMaxExtrapolate);
44  GET_DATA_FUNC_F("maxextrapolate", MaxExtrapolate);
45  GET_DATA_FUNC_B("usemaxextrapolatedist", UseMaxExtrapolateDist);
46  GET_DATA_FUNC_F("maxextrapolatedist", MaxExtrapolateDist);
47  GET_DATA_FUNC_F("bandwidth", Bandwidth);
48  GET_DATA_FUNC_B("uniformradius", UniformRadius);
49 
50  GET_DATA_FUNC_I("calculationtype", CalculationType);
51  GET_DATA_FUNC_F("dstpreadd", DstPreAdd);
52  GET_DATA_FUNC_F("dstpremul", DstPreMul);
53  GET_DATA_FUNC_F("srcpreadd", SrcPreAdd);
54  GET_DATA_FUNC_F("srcpremul", SrcPreMul);
55  GET_DATA_FUNC_F("postadd", PostAdd);
56  GET_DATA_FUNC_F("postmul", PostMul);
57 
58  GET_DATA_FUNC_I("srctimescale", SrcTimeScale);
59  GET_DATA_FUNC_I("dsttimescale", DstTimeScale);
60  GET_DATA_FUNC_I("posttimescale", PostTimeScale);
61 
64 
65 protected:
66  explicit GAS_ParticleToField(const SIM_DataFactory *factory);
67  ~GAS_ParticleToField() override;
68 
69  /// Transfers the values of an attribute from the particle
70  /// geometry onto the field.
71  bool solveGasSubclass(SIM_Engine &engine,
72  SIM_Object *obj,
73  SIM_Time time,
74  SIM_Time timestep) override;
75 
76  void particleToField(SIM_Object *obj,
77  SIM_RawField *destfield,
78  const SIM_RawIndexField *altclosept,
79  const GU_Detail *particles,
80  const GA_PointGroup *ptgrp,
81  GEO_PointTreeGAOffset *&pointtree,
82  openvdb::tools::PointIndexGrid::ConstPtr &ptgridvdb,
83  fpreal timestep,
84  const char *attributename,
85  int offset,
86  const UT_DMatrix4 &xform,
87  const UT_Vector3 &orig,
88  const UT_Vector3 &size,
89  int xres, int yres, int zres);
90 
92  dst->shouldMultiThread(),
93  applyUniformParticles,
94  const GU_Detail *, particles,
95  SIM_RawField *, dst,
96  const openvdb::tools::PointIndexGrid *, grid,
98  SIM_RawIndexField *, closestpt)
99  void applyUniformParticlesPartial(
100  const GU_Detail *particles,
102  const openvdb::tools::PointIndexGrid *grid,
104  SIM_RawIndexField *closestpt,
105  const UT_JobInfo &info);
106 
107 private:
108  static const SIM_DopDescription *getDopDescription();
109 
113  "Gas Particle To Field",
114  getDopDescription());
115 };
116 
117 #endif
118 
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:50
#define GAS_NAME_GEOMETRY
Definition: GAS_Utils.h:30
GT_API const UT_StringHolder time
#define GAS_NAME_USETIMESTEP
Definition: GAS_Utils.h:39
#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 DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:63
#define GAS_NAME_FIELD
Definition: GAS_Utils.h:27
#define GET_DATA_FUNC_I(DataName, FuncName)
GLintptr offset
Definition: glcorearb.h:665
#define THREADED_METHOD5(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5)
GLsizeiptr size
Definition: glcorearb.h:664
GLenum GLenum dst
Definition: glcorearb.h:1793
Grid< PointIndexTree > PointIndexGrid
Point index grid.
fpreal64 fpreal
Definition: SYS_Types.h:277
Space-partitioning acceleration structure for points. Partitions the points into voxels to accelerate...
#define GET_DATA_FUNC_B(DataName, FuncName)
#define GET_DATA_FUNC_F(DataName, FuncName)
#define GAS_NAME_TIMESCALE
Definition: GAS_Utils.h:40
#define GET_DATA_FUNC_S(DataName, FuncName)