HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SIM_VectorFieldVisualization.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_VectorFieldVisualization.h ( SIM Library, C++)
7  *
8  * COMMENTS:
9  * This simple procedure allows for intersection with signed
10  * distance functions.
11  */
12 
13 #ifndef __SIM_VectorFieldVisualization_H__
14 #define __SIM_VectorFieldVisualization_H__
15 
16 #include "SIM_API.h"
17 #include <UT/UT_Vector2.h>
18 #include <UT/UT_Vector3.h>
19 
20 #include "SIM_Names.h"
21 #include "SIM_OptionsUser.h"
22 #include "SIM_DataUtils.h"
23 
24 class UT_IStream;
25 class SIM_Geometry;
26 class SIM_VectorField;
27 
28 /// This class holds a signed distance function representing a GU_Detail.
30  public SIM_OptionsUser
31 {
32 public:
33  GET_GUIDE_FUNC_B(SIM_NAME_SHOWGUIDE, ShowGuide, true);
35 
36  GET_GUIDE_FUNC_B("guideusesmoke", GuideUseSmoke, false);
37  GET_GUIDE_FUNC_B("guideusebox", GuideUseBox, false);
38  GET_GUIDE_FUNC_B("guideuseboxhash", GuideUseBoxHash, false);
39  GET_GUIDE_FUNC_F("guidescale", GuideScale, 1.0);
40  GET_GUIDE_FUNC_I("guidevistype", GuideVisType, 0);
41  GET_GUIDE_FUNC_I("guidevismode", GuideVisMode, 0);
42  GET_GUIDE_FUNC_F("guidevisscale", GuideVisScale, 1.0);
43  GET_GUIDE_FUNC_V2("guiderange", GuideRange, (0, 1));
44 
45  GET_GUIDE_FUNC_B("guideoverridediv", GuideOverrideDiv, false);
46  GET_GUIDE_FUNC_V3("guidediv", GuideDiv, (10, 10, 10));
47 
48  GET_GUIDE_FUNC_B("guideusestreamers", GuideUseStreamers, false);
49  GET_GUIDE_FUNC_B("guideuseplane", GuideUsePlane, false);
50  GET_GUIDE_FUNC_I("guideplane", GuidePlane, 0);
51  GET_GUIDE_FUNC_F("guideplaneval", GuidePlaneVal, 0);
52  GET_GUIDE_FUNC_F("guidestreamerlen", GuideStreamerLen, 1);
53  GET_GUIDE_FUNC_F("guidestreamerminspeed", GuideStreamerMinSpeed, 0);
54 
55  GET_GUIDE_FUNC_B("guidebarbs", GuideBarbs, true);
56  GET_GUIDE_FUNC_B("guidepercomp", GuidePerComp, false);
57 
58  /// Adds to the gdp a simple vector starting at pos and in direction
59  /// vel.
60  static void createVectorGuide(GU_Detail *gdp,
61  const UT_Vector3 &pos,
62  const UT_Vector3 &vel,
63  const GA_RWHandleV3 &clrh,
64  const UT_Vector3 &clr,
65  bool usebarbs);
66 protected:
67  explicit SIM_VectorFieldVisualization(const SIM_DataFactory *factory);
69 
70  /// Overrides to properly implement this class as a SIM_Data.
71  virtual void initializeSubclass();
72 
73  virtual bool getIsAlternateRepresentationSubclass() const;
74  virtual void initAlternateRepresentationSubclass(const SIM_Data &);
75  virtual SIM_Guide *createGuideObjectSubclass() const;
76  virtual void buildGuideGeometrySubclass(const SIM_RootData &root,
77  const SIM_Options &options,
78  const GU_DetailHandle &gdh,
79  UT_DMatrix4 *xform,
80  const SIM_Time &t) const;
81 
82 private:
83  UT_Vector3 getColorFromDir(UT_Vector3 dir) const;
84 
85  static const SIM_DopDescription *getVectorFieldVisualizationDopDescription();
86 
87  const SIM_VectorField *myVectorField;
88 
89  // Used to build an isosurface:
90  static float pointDensity(const UT_Vector3 &pos);
91  static const SIM_VectorField*theCurrentField;
92 
94 
96  SIM_Data,
97  "VectorFieldVisualization",
98  getVectorFieldVisualizationDopDescription());
99 };
100 
101 #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
#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
#define GET_GUIDE_FUNC_V2(DataName, FuncName, Default)
This class holds a signed distance function representing a GU_Detail.
#define SIM_API
Definition: SIM_API.h:10
virtual void initAlternateRepresentationSubclass(const SIM_Data &)
#define SIM_NAME_COLOR
Definition: SIM_Names.h:87
This class holds a three dimensional vector field.
#define GET_GUIDE_FUNC_B(DataName, FuncName, Default)
virtual SIM_Guide * createGuideObjectSubclass() const
virtual void initializeSubclass()