HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_Visualization.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  */
7 
8 #ifndef __SIM_Visualization_h__
9 #define __SIM_Visualization_h__
10 
11 #include "SIM_API.h"
12 #include "SIM_DataUtils.h"
13 #include "SIM_OptionsUser.h"
14 
15 #include <UT/UT_Array.h>
16 #include <UT/UT_IntArray.h>
17 #include <GU/GU_Detail.h>
18 #include <GA/GA_Handle.h>
19 
20 template<typename T>
22 {
26 };
27 
28 /// Class for inspecting the state of a simulation.
29 /// Using prim/point/vertex attributes on the cloth geometry, it generates
30 /// guide geometry showing internal forces, energy and impacts.
32 {
33 protected:
34  explicit SIM_Visualization(const SIM_DataFactory *factory);
35  ~SIM_Visualization() override;
36 
37  // render point attributes
38  virtual void renderPointAttribs() const;
39  virtual void getPointVectorAttribs(
40  UT_Array<simVisualizationItem<UT_Vector3> > & /*data*/) const {}
43  UT_Vector3Array & /* axis */) const {}
44 
45  // render primitive attributes
46  virtual void renderPrimAttribs() const;
47  virtual void getPrimFloatAttribs(
48  UT_Array<simVisualizationItem<float> > & /*data*/) const {}
49 
50  // render vertex (edge) attributes
51  virtual void renderVertexAttribs() const;
52  virtual void getEdgeFloatAttribs(
53  UT_Array<simVisualizationItem<float> > & /*data*/) const {}
54  virtual void highlightEdge(const GEO_PrimPoly & /*inPoly*/,
55  int /*v*/,
56  const UT_Vector3 &/*color*/) const {}
57 
58  // render custom subclass
59  virtual void renderCustomSubclass() const {}
60 
61  // render impacts
62  virtual void renderImpacts() const;
63  virtual bool getShowImpacts() const { return false; }
64  virtual UT_Vector3 getImpactColor() const { return UT_Vector3(0, 0, 0); }
65  virtual fpreal getImpactScale() const { return 1; }
66  virtual bool getImpactScaleByImpulse() const { return true; }
67  virtual bool getImpactShowAsVector() const { return false; }
68  virtual bool getShowSubstepImpacts() const { return false; }
69 
70  SIM_Guide *createGuideObjectSubclass() const override;
72  const SIM_RootData &root,
73  const SIM_Options &options,
74  const GU_DetailHandle &gdh,
75  UT_DMatrix4 *xform,
76  const SIM_Time &t) const override;
77 
78  mutable const SIM_Options *myOptions;
79  mutable const GU_Detail *myInGdp;
80  mutable GU_Detail *myOutGdp;
82  //mutable GA_RWHandleF myAttOutAlpha;
83  mutable const SIM_Object *myObject;
85  mutable const SIM_Time *myTime;
86 };
87 #endif
88 
virtual UT_Vector3 getImpactColor() const
const SIM_Time * myTime
UT_Vector3T< float > UT_Vector3
virtual bool getImpactScaleByImpulse() const
const GU_Detail * myInGdp
const SIM_Object * myObject
virtual bool getShowImpacts() const
virtual void buildGuideGeometrySubclass(const SIM_RootData &root, const SIM_Options &options, const GU_DetailHandle &gdh, UT_DMatrix4 *xform, const SIM_Time &t) const
UT_Array< GA_ROHandleT< T > > myAttributes
UT_DMatrix4 * myOutXform
virtual fpreal getImpactScale() const
virtual void highlightEdge(const GEO_PrimPoly &, int, const UT_Vector3 &) const
virtual void renderCustomSubclass() const
virtual void getPointVectorAttribs(UT_Array< simVisualizationItem< UT_Vector3 > > &) const
GLdouble t
Definition: glad.h:2397
virtual bool getImpactShowAsVector() const
virtual void getPointQuaternionAttribs(UT_Array< simVisualizationItem< UT_Quaternion > > &, UT_Vector3Array &) const
fpreal64 fpreal
Definition: SYS_Types.h:277
const SIM_Options * myOptions
virtual void getPrimFloatAttribs(UT_Array< simVisualizationItem< float > > &) const
virtual bool getShowSubstepImpacts() const
#define SIM_API
Definition: SIM_API.h:12
virtual void getEdgeFloatAttribs(UT_Array< simVisualizationItem< float > > &) const
GA_RWHandleV3 myAttOutCd
virtual SIM_Guide * createGuideObjectSubclass() const