HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GAS_Limit.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_Limit.h ( GAS Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GAS_Limit__
12 #define __GAS_Limit__
13 
14 #include "GAS_API.h"
15 
17 #include <UT/UT_VoxelArray.h>
18 #include <GU/GU_Detail.h>
19 
20 #include <SIM/SIM_RawField.h>
21 
22 #include "GAS_SubSolver.h"
23 #include "GAS_Utils.h"
24 
25 class GU_Detail;
26 
28 {
29 public:
30  bool shouldMultiThread(const UT_VoxelArrayF *field) const
31  { return field->numTiles() > 1; }
32 
33  GET_DATA_FUNC_I("minchoice", MinChoice);
34  GET_DATA_FUNC_I("maxchoice", MaxChoice);
35  GET_DATA_FUNC_I("revertchoice", RevertChoice);
36  GET_DATA_FUNC_V3("minvalue", MinValue);
37  GET_DATA_FUNC_V3("maxvalue", MaxValue);
38  GET_DATA_FUNC_V3("revertvalue", RevertValue);
39  GET_DATA_FUNC_F("blendwidth", Blendwidth);
40 
41  struct gas_limitsrc
42  {
44  float val;
45  bool usefield;
46  };
47 
48 protected:
49  explicit GAS_Limit(const SIM_DataFactory *factory);
50  virtual ~GAS_Limit();
51 
52  /// Limits scalar fields by moving along curvature or performing
53  /// relaxation steps.
54  virtual bool solveGasSubclass(SIM_Engine &engine,
55  SIM_Object *obj,
56  SIM_Time time,
57  SIM_Time timestep);
58 
59  void doLimit(SIM_RawField *dstfield,
60  const gas_limitsrc &minsrc,
61  const gas_limitsrc &maxsrc,
62  const gas_limitsrc &revertsrc,
63  float blendwidth);
64 
65  THREADED_METHOD5_CONST(GAS_Limit, shouldMultiThread(dstfield->field()),
66  limit,
67  SIM_RawField *, dstfield,
68  const gas_limitsrc &, minsrc,
69  const gas_limitsrc &, maxsrc,
70  const gas_limitsrc &, revertsrc,
71  float, blendwidth);
72  void limitPartial(SIM_RawField *dstfield,
73  const gas_limitsrc &minsrc,
74  const gas_limitsrc &maxsrc,
75  const gas_limitsrc &revertsrc,
76  float blendwidth,
77  const UT_JobInfo &jobinfo) const;
78 
79  gas_limitsrc buildLimitSrc(SIM_Object *obj, int i, int j,
80  int choice,
81  const char *parmname,
82  UT_Vector3 val);
83 private:
84  static const SIM_DopDescription *getDopDescription();
85 
89  "Gas Limit",
90  getDopDescription());
91 };
92 
93 #endif
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:45
#define GET_DATA_FUNC_V3(DataName, FuncName)
#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_METHOD5_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5)
png_uint_32 i
Definition: png.h:2877
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:58
bool shouldMultiThread(const UT_VoxelArrayF *field) const
Definition: GAS_Limit.h:30
#define GET_DATA_FUNC_I(DataName, FuncName)
const SIM_RawField * field
Definition: GAS_Limit.h:43
int numTiles() const
#define GET_DATA_FUNC_F(DataName, FuncName)
GLuint GLfloat * val
Definition: glcorearb.h:1607