HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GAS_ParticleSeparate.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_ParticleSeparate.h ( GAS Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GAS_ParticleSeparate__
12 #define __GAS_ParticleSeparate__
13 
14 #include "GAS_API.h"
15 
16 #include "GAS_SubSolver.h"
17 #include "GAS_Utils.h"
18 #include <GU/GU_Detail.h>
19 #include <GA/GA_SplittableRange.h>
21 #include <UT/UT_HashGrid.h>
23 
24 class GU_Detail;
25 
27 {
28 public:
29  GET_DATA_FUNC_S(GAS_NAME_GEOMETRY, GeometryName);
30  GET_DATA_FUNC_I("iter", Iterations);
31  GET_DATA_FUNC_F("amount", Amount);
32  GET_DATA_FUNC_F("searchscale", SearchScale);
33  GET_DATA_FUNC_F("distscale", DistScale);
34  GET_DATA_FUNC_B("uniformradius", UniformRadius);
35 
36 protected:
37  explicit GAS_ParticleSeparate(const SIM_DataFactory *factory);
38  virtual ~GAS_ParticleSeparate();
39 
40  /// Moves the fields given by FieldName by the given velocity
41  /// field. Moves the points given by GeometryName likewise.
42  virtual bool solveGasSubclass(SIM_Engine &engine,
43  SIM_Object *obj,
44  SIM_Time time,
45  SIM_Time timestep);
46 
47  bool shouldMultiThread() { return true; }
48 
49 protected:
50  THREADED_METHOD7(GAS_ParticleSeparate, shouldMultiThread(),
51  separateParticles,
52  GU_Detail *, gdp,
53  const GA_SplittableRange &, range,
54  const UT_HashGrid<GA_Offset> &, grid,
55  fpreal, amount,
56  fpreal, searchscale,
57  fpreal, distscale,
58  const UT_FloatArray &, radlist)
59  void separateParticlesPartial(GU_Detail *gdp,
62  fpreal amount,
63  fpreal searchscale,
64  fpreal distscale,
65  const UT_FloatArray &radlist,
66  const UT_JobInfo &info);
67 
68  THREADED_METHOD8(GAS_ParticleSeparate, range.canMultiThread(),
69  separateParticlesUniform,
70  GU_Detail *, gdp,
71  const GA_SplittableRange &, range,
72  const openvdb::tools::PointIndexGrid *, ptgrid,
73  fpreal, amount,
74  fpreal, searchscale,
75  fpreal, distscale,
76  float, rad,
77  const UT_Vector3Array &, curpos)
78  void separateParticlesUniformPartial(GU_Detail *gdp,
79  const GA_SplittableRange &range,
80  const openvdb::tools::PointIndexGrid *ptgrid,
81  fpreal amount,
82  fpreal searchscale,
83  fpreal distscale,
84  float rad,
85  const UT_Vector3Array &curpos,
86  const UT_JobInfo &info);
87 
88  bool separateUniform(SIM_Object *obj, GU_Detail *gdp,
89  const GA_PointGroup *ptgrp,
90  GA_ROHandleF &rad_h);
91 private:
92  static const SIM_DopDescription *getDopDescription();
93 
95  DECLARE_DATAFACTORY(GAS_ParticleSeparate,
97  "Gas Particle Separate",
98  getDopDescription());
99 };
100 
101 #endif
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:45
#define THREADED_METHOD7(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5, PARMTYPE6, PARMNAME6, PARMTYPE7, PARMNAME7)
GLenum GLint * range
Definition: glcorearb.h:1924
#define GAS_NAME_GEOMETRY
Definition: GAS_Utils.h:28
#define THREADED_METHOD8(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5, PARMTYPE6, PARMNAME6, PARMTYPE7, PARMNAME7, PARMTYPE8, PARMNAME8)
#define GAS_API
Definition: GAS_API.h:10
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
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:58
GA_Size GA_Offset
Definition: GA_Types.h:617
#define GET_DATA_FUNC_I(DataName, FuncName)
double fpreal
Definition: SYS_Types.h:269
Grid< PointIndexTree > PointIndexGrid
Point index grid.
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 const
Definition: zconf.h:214
#define GET_DATA_FUNC_S(DataName, FuncName)