HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GAS_AdjustParticleCoordinates.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_AdjustElasticity.h ( GAS Library, C++)
7  *
8  * COMMENTS: This node is used to adjust and reinitialize
9  * a coordinate system attached to the particles
10  * in a particle fluid simulation.
11  *
12  */
13 
14 #ifndef __GAS_AdjustParticleCoordinates__
15 #define __GAS_AdjustParticleCoordinates__
16 
17 #include "GAS_API.h"
18 
19 #include "GAS_SubSolver.h"
20 #include "GAS_Utils.h"
21 #include <GA/GA_Handle.h>
22 #include <UT/UT_BoundingBox.h>
23 
24 class GU_Detail;
25 
27 {
28 public:
29  GET_DATA_FUNC_S(GAS_NAME_GEOMETRY, GeometryName);
30 
31 protected:
32  explicit GAS_AdjustParticleCoordinates(const SIM_DataFactory *factory);
34 
35  /// Performs any necessary adjustments to the coordinate
36  /// system attached to the fluid particles.
37  bool solveGasSubclass(SIM_Engine &engine,
38  SIM_Object *obj,
39  SIM_Time time,
40  SIM_Time timestep) override;
41 
42 private:
43  /// Populates the provided attribute handles, and returns
44  /// false if any attribute does not exist.
45  bool getAttributes(GU_Detail *gdp,
46  GA_ROHandleV3 &bboxminh,
47  GA_ROHandleV3 &bboxmaxh,
48  GA_ROHandleV3 &coordinatescaleh,
49  GA_RWHandleF &transitionstateh,
50  GA_ROHandleF &periodh,
51  GA_ROHandleF &transitionlengthh,
52  GA_RWHandleV3 &coordinate1attrib,
53  GA_RWHandleV3 &coordinate2attrib,
54  GA_RWHandleR &lastadjusth);
55 
56  /// Initializes a new coordinate system for the fluid.
57  void initNewCoordinates(GA_Detail *gdp,
58  const UT_BoundingBox &bbox,
59  const UT_Vector3 &coordinateScales,
60  const GA_RWHandleV3 &coordinateGah);
61 
62  /// Swaps the coordinate systems.
63  void swapCoordinates(GA_Detail *gdp,
64  const GA_RWHandleV3 &coordinate1Gah,
65  const GA_ROHandleV3 &coordinate2Gah);
66 
67  static const SIM_DopDescription *getDopDescription();
68 
72  "Gas Adjust Particle Coordinates",
73  getDopDescription());
74 };
75 
76 #endif
#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_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
Container class for all geometry.
Definition: GA_Detail.h:96
#define GET_DATA_FUNC_S(DataName, FuncName)