HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GAS_SurfaceSnap.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_SurfaceSnap.h ( GAS Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GAS_SurfaceSnap__
12 #define __GAS_SurfaceSnap__
13 
14 #include "GAS_API.h"
15 
16 #include "GAS_SubSolver.h"
17 #include "GAS_Utils.h"
19 
20 class SIM_VectorField;
21 class SIM_ScalarField;
22 
24 {
25 public:
26  GET_DATA_FUNC_S(GAS_NAME_COLLISION, CollisionName);
27  GET_DATA_FUNC_S(GAS_NAME_SURFACE, SurfaceName);
28 
29  GETSET_DATA_FUNCS_F("snapdist", SnapDist);
30  GETSET_DATA_FUNCS_F("snapangle", SnapAngle);
31 
32 protected:
33  explicit GAS_SurfaceSnap(const SIM_DataFactory *factory);
34  ~GAS_SurfaceSnap() override;
35 
36  /// Applies a force to the velocity field proportional
37  /// to the vorticle values.
38  bool solveGasSubclass(SIM_Engine &engine,
39  SIM_Object *obj,
40  SIM_Time time,
41  SIM_Time timestep) override;
42 
43  bool shouldMultiThread(const UT_VoxelArrayF *field) const
44  { return field->numTiles() > 1; }
45 
46  void applySurfaceSnap(SIM_ScalarField *surface,
47  const SIM_ScalarField *collision);
48 
50  shouldMultiThread(surface->field()),
51  doSurfaceSnap,
53  const SIM_RawField *, collision,
54  float, snapdist,
55  float, snapangle);
56  void doSurfaceSnapPartial(SIM_RawField *surface,
57  const SIM_RawField *collision,
58  float snapdist,
59  float snapangle,
60  const UT_JobInfo &info) const;
61 
62 private:
63  static const SIM_DopDescription *getDopDescription();
64 
68  "Gas Surface Snap",
69  getDopDescription());
70 };
71 
72 #endif
73 
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:50
#define THREADED_METHOD4_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4)
GT_API const UT_StringHolder time
#define GAS_API
Definition: GAS_API.h:10
#define GAS_NAME_COLLISION
Definition: GAS_Utils.h:21
virtual bool solveGasSubclass(SIM_Engine &engine, SIM_Object *obj, SIM_Time time, SIM_Time timestep)=0
#define GETSET_DATA_FUNCS_F(DataName, FuncName)
bool shouldMultiThread(const UT_VoxelArrayF *field) const
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:63
int numTiles() const
This class holds a three dimensional scalar field.
#define GAS_NAME_SURFACE
Definition: GAS_Utils.h:38
This class holds a three dimensional vector field.
#define GET_DATA_FUNC_S(DataName, FuncName)