HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_ScalarFieldVisualization.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: SIM_ScalarFieldVisualization.h ( SIM Library, C++)
7  *
8  * COMMENTS:
9  * This simple procedure allows for intersection with signed
10  * distance functions.
11  */
12 
13 #ifndef __SIM_ScalarFieldVisualization_H__
14 #define __SIM_ScalarFieldVisualization_H__
15 
16 #include "SIM_API.h"
17 #include <UT/UT_Vector2.h>
18 #include <UT/UT_Vector3.h>
20 
21 #include "SIM_Names.h"
22 #include "SIM_OptionsUser.h"
23 #include "SIM_DataUtils.h"
24 
25 class UT_IStream;
26 class SIM_Geometry;
27 class SIM_ScalarField;
28 
29 struct simFindSurfaceCellsArgs;
30 
31 /// This class holds a signed distance function representing a GU_Detail.
33  public SIM_OptionsUser
34 {
35 public:
36  GET_GUIDE_FUNC_B(SIM_NAME_SHOWGUIDE, ShowGuide, true);
38  GET_GUIDE_FUNC_F("guideiso", GuideIso, 0.0);
39  GET_GUIDE_FUNC_B("guideinvert", GuideInvert, false);
40  GET_GUIDE_FUNC_B("usesmoke", UseSmoke, false);
41  GET_GUIDE_FUNC_B("wiresmoke", WireframeSmoke, false);
42  GET_GUIDE_FUNC_B("guideremapsmoke", GuideRemapSmoke, false);
43  GET_GUIDE_FUNC_F("guidesmokedensity", GuideSmokeDensity, 10.0);
44  GET_GUIDE_FUNC_B("usebox", UseBox, false);
45  GET_GUIDE_FUNC_B("useboxhash", UseBoxHash, false);
46 
47  GET_GUIDE_FUNC_B("guideuseplane", GuideUsePlane, false);
48  GET_GUIDE_FUNC_I("guideplane", GuidePlane, 0);
49  GET_GUIDE_FUNC_I("guidevismode", GuideVisMode, 0);
50  GET_GUIDE_FUNC_I("guidevisdensitymode", GuideVisDensityMode, 0);
51  GET_GUIDE_FUNC_V2("guiderange", GuideRange, (0, 1));
52  GET_GUIDE_FUNC_F("guideplaneval", GuidePlaneVal, 0);
53 
54  GET_GUIDE_FUNC_B("guiderangemode", GuideRangeMode, false);
55  GET_GUIDE_FUNC_F("guiderangecenter", GuideRangeCenter, 0.5);
56  GET_GUIDE_FUNC_F("guiderangesize", GuideRangeSize, 1);
57 
58  /// Adds a wire frame bounding box of the specified dimensions and
59  /// with colour set to the given offset.
60  /// If xdiv..zdiv are non-zero, the box will be hatched accordingly.
61  static void createBoundingBoxGuide(GU_Detail *gdp,
62  const UT_BoundingBox &bbox,
63  int xdiv, int ydiv, int zdiv,
64  const UT_Vector3 &color,
65  const GA_RWHandleV3 &primclrh,
66  const GA_RWHandleV3 &ptclrh);
67 
68 protected:
69  explicit SIM_ScalarFieldVisualization(const SIM_DataFactory *factory);
70  ~SIM_ScalarFieldVisualization() override;
71 
72  /// Overrides to properly implement this class as a SIM_Data.
73  void initializeSubclass() override;
74 
75  bool getIsAlternateRepresentationSubclass() const override;
77  const SIM_Data &) override;
78  SIM_Guide *createGuideObjectSubclass() const override;
80  const SIM_RootData &root,
81  const SIM_Options &options,
82  const GU_DetailHandle &gdh,
83  UT_DMatrix4 *xform,
84  const SIM_Time &t) const override;
85 
86 private:
87  bool shouldMultiThread() const { return true; }
88  THREADED_METHOD1_CONST(SIM_ScalarFieldVisualization, shouldMultiThread(), findSurfaceCells, simFindSurfaceCellsArgs *, args);
89  void findSurfaceCellsPartial(simFindSurfaceCellsArgs *args, const UT_JobInfo &info) const;
90  static const SIM_DopDescription *getScalarFieldVisualizationDopDescription();
91 
92  const SIM_ScalarField *myScalarField;
93 
95 
97  SIM_Data,
98  "ScalarFieldVisualization",
99  getScalarFieldVisualizationDopDescription());
100 };
101 
102 #endif
#define SIM_NAME_SHOWGUIDE
Definition: SIM_Names.h:186
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:50
#define GET_GUIDE_FUNC_I(DataName, FuncName, Default)
virtual bool getIsAlternateRepresentationSubclass() const
#define GET_GUIDE_FUNC_V3(DataName, FuncName, Default)
#define GET_GUIDE_FUNC_F(DataName, FuncName, Default)
virtual void buildGuideGeometrySubclass(const SIM_RootData &root, const SIM_Options &options, const GU_DetailHandle &gdh, UT_DMatrix4 *xform, const SIM_Time &t) const
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:63
This class holds a signed distance function representing a GU_Detail.
#define GET_GUIDE_FUNC_V2(DataName, FuncName, Default)
GLdouble t
Definition: glad.h:2397
#define THREADED_METHOD1_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1)
GLuint color
Definition: glcorearb.h:1261
#define SIM_API
Definition: SIM_API.h:12
virtual void initAlternateRepresentationSubclass(const SIM_Data &)
This class holds a three dimensional scalar field.
**If you just want to fire and args
Definition: thread.h:609
#define SIM_NAME_COLOR
Definition: SIM_Names.h:87
#define GET_GUIDE_FUNC_B(DataName, FuncName, Default)
virtual SIM_Guide * createGuideObjectSubclass() const
virtual void initializeSubclass()