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("guideremapsmoke", GuideRemapSmoke, false);
42  GET_GUIDE_FUNC_F("guidesmokedensity", GuideSmokeDensity, 10.0);
43  GET_GUIDE_FUNC_B("usebox", UseBox, false);
44  GET_GUIDE_FUNC_B("useboxhash", UseBoxHash, false);
45 
46  GET_GUIDE_FUNC_B("guideuseplane", GuideUsePlane, false);
47  GET_GUIDE_FUNC_I("guideplane", GuidePlane, 0);
48  GET_GUIDE_FUNC_I("guidevismode", GuideVisMode, 0);
49  GET_GUIDE_FUNC_I("guidevisdensitymode", GuideVisDensityMode, 0);
50  GET_GUIDE_FUNC_V2("guiderange", GuideRange, (0, 1));
51  GET_GUIDE_FUNC_F("guideplaneval", GuidePlaneVal, 0);
52 
53  GET_GUIDE_FUNC_B("guiderangemode", GuideRangeMode, false);
54  GET_GUIDE_FUNC_F("guiderangecenter", GuideRangeCenter, 0.5);
55  GET_GUIDE_FUNC_F("guiderangesize", GuideRangeSize, 1);
56 
57  /// Adds a wire frame bounding box of the specified dimensions and
58  /// with colour set to the given offset.
59  /// If xdiv..zdiv are non-zero, the box will be hatched accordingly.
60  static void createBoundingBoxGuide(GU_Detail *gdp,
61  const UT_BoundingBox &bbox,
62  int xdiv, int ydiv, int zdiv,
63  const UT_Vector3 &color,
64  const GA_RWHandleV3 &primclrh,
65  const GA_RWHandleV3 &ptclrh);
66 
67 protected:
68  explicit SIM_ScalarFieldVisualization(const SIM_DataFactory *factory);
70 
71  /// Overrides to properly implement this class as a SIM_Data.
72  virtual void initializeSubclass();
73 
74  virtual bool getIsAlternateRepresentationSubclass() const;
75  virtual void initAlternateRepresentationSubclass(const SIM_Data &);
76  virtual SIM_Guide *createGuideObjectSubclass() const;
77  virtual void buildGuideGeometrySubclass(const SIM_RootData &root,
78  const SIM_Options &options,
79  const GU_DetailHandle &gdh,
80  UT_DMatrix4 *xform,
81  const SIM_Time &t) const;
82 
83 private:
84  bool shouldMultiThread() const { return true; }
85  THREADED_METHOD1_CONST(SIM_ScalarFieldVisualization, shouldMultiThread(), findSurfaceCells, simFindSurfaceCellsArgs *, args);
86  void findSurfaceCellsPartial(simFindSurfaceCellsArgs *args, const UT_JobInfo &info) const;
87  static const SIM_DopDescription *getScalarFieldVisualizationDopDescription();
88 
89  const SIM_ScalarField *myScalarField;
90 
92 
94  SIM_Data,
95  "ScalarFieldVisualization",
96  getScalarFieldVisualizationDopDescription());
97 };
98 
99 #endif
#define SIM_NAME_SHOWGUIDE
Definition: SIM_Names.h:185
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:45
#define GET_GUIDE_FUNC_I(DataName, FuncName, Default)
virtual bool getIsAlternateRepresentationSubclass() const
GLuint color
Definition: glcorearb.h:1260
#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:58
This class holds a signed distance function representing a GU_Detail.
#define GET_GUIDE_FUNC_V2(DataName, FuncName, Default)
#define THREADED_METHOD1_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1)
#define SIM_API
Definition: SIM_API.h:10
virtual void initAlternateRepresentationSubclass(const SIM_Data &)
This class holds a three dimensional scalar field.
#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()