HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SIM_Guide.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_Guide_h__
9 #define __SIM_Guide_h__
10 
11 #include "SIM_API.h"
12 #include <SYS/SYS_Types.h>
13 #include <UT/UT_VectorTypes.h>
14 #include <GU/GU_DetailHandle.h>
15 
16 class SIM_Time;
17 class SIM_Data;
18 class SIM_RootData;
19 
20 #include <DEP/DEP_MicroNode.h>
21 
22 /// This class provides an interface between a SIM_Data and its guide
23 /// geometry. It decides when it is necessary to actually build the
24 /// geometry.
26 {
27 public:
28  /// Constructor which takes a const SIM_Data as our owner.
29  explicit SIM_Guide(const SIM_Data *owner);
30  /// Destructor for this class.
31  virtual ~SIM_Guide();
32 
33  /// This function retrieves some guide geometry and a transform.
34  /// getGuideGeometrySubclass() does all the real work.
35  GU_ConstDetailHandle getGuideGeometry(const SIM_RootData &root,
36  UT_DMatrix4 &xform,
37  const SIM_Time &t);
38 
39  /// Returns the amount of memory used by this guide object. This function
40  /// calls getMemorySizeSubclass().
41  int64 getMemorySize() const;
42 
43  /// This function clears all guide geometry information. It calls
44  /// clearSubclass() to do the actual work.
45  void clear();
46 
47  /// Sets the version parms value of our creator node at the time the
48  /// guide geometry was created.
49  void setParmVersion(long version);
50  /// Gets the version parms value that was set when this object was
51  /// created.
52  long getParmVersion() const;
53 
55  { return myMicroNode; }
57  { return myMicroNode; }
58 
59 protected:
60  /// Returns our owner data.
61  const SIM_Data &getOwner() const;
62  /// Returns the current simulation time.
63  const SIM_Time &getSimulationTime() const;
64  /// Calls SIM_Data::buildGuideGeometry() on the owner data.
65  bool buildGuideGeometry(const SIM_RootData &root,
66  const GU_DetailHandle &gdh,
67  UT_DMatrix4 *xform,
68  const SIM_Time &t) const;
69 
70  /// Override this function to customize how guide geometry is
71  /// created or retrieved. Implementing this function is the whole
72  /// point of this class. This function may build geometry, fetch
73  /// existing geometry, modify existing geometry, or whatever else
74  /// it sees fit.
75  virtual GU_ConstDetailHandle getGuideGeometrySubclass(
76  const SIM_RootData &root,
77  UT_DMatrix4 &xform,
78  const SIM_Time &t);
79  /// Override this to report the amount of memory used by this object.
80  /// Call the base class implementation as well and add that to the
81  /// subclass-specific memory size.
82  virtual int64 getMemorySizeSubclass() const;
83  /// Override this function to clear any data create by this class.
84  virtual void clearSubclass();
85 
86 private:
87  const SIM_Data *myOwner;
88  long myParmVersion;
89  DEP_MicroNode myMicroNode;
90 };
91 
92 #endif
93 
long long int64
Definition: SYS_Types.h:106
const DEP_MicroNode & guideMicroNode() const
Definition: SIM_Guide.h:56
DEP_MicroNode & guideMicroNode()
Definition: SIM_Guide.h:54
#define SIM_API
Definition: SIM_API.h:10