00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Side Effects Software Inc. 00008 * 477 Richmond Street West, Suite 1001 00009 * Toronto, Ontario 00010 * Canada M5V 3E7 00011 * 416-504-9876 00012 */ 00013 00014 #ifndef __SIM_Guide_h__ 00015 #define __SIM_Guide_h__ 00016 00017 #include "SIM_API.h" 00018 #include <SYS/SYS_Types.h> 00019 #include <GU/GU_DetailHandle.h> 00020 00021 class UT_DMatrix4; 00022 class SIM_Time; 00023 class SIM_Data; 00024 class SIM_RootData; 00025 00026 /// This class provides an interface between a SIM_Data and its guide 00027 /// geometry. It decides when it is necessary to actually build the 00028 /// geometry. 00029 class SIM_API SIM_Guide 00030 { 00031 public: 00032 /// Constructor which takes a const SIM_Data as our owner. 00033 explicit SIM_Guide(const SIM_Data *owner); 00034 /// Destructor for this class. 00035 virtual ~SIM_Guide(); 00036 00037 /// This function retrieves some guide geometry and a transform. 00038 /// getGuideGeometrySubclass() does all the real work. 00039 GU_ConstDetailHandle getGuideGeometry(const SIM_RootData &root, 00040 UT_DMatrix4 &xform, 00041 const SIM_Time &t); 00042 00043 /// Returns the amount of memory used by this guide object. This function 00044 /// calls getMemorySizeSubclass(). 00045 int64 getMemorySize() const; 00046 00047 /// This function clears all guide geometry information. It calls 00048 /// clearSubclass() to do the actual work. 00049 void clear(); 00050 00051 /// Sets the version parms value of our creator node at the time the 00052 /// guide geometry was created. 00053 void setParmVersion(long version); 00054 /// Gets the version parms value that was set when this object was 00055 /// created. 00056 long getParmVersion() const; 00057 00058 protected: 00059 /// Returns our owner data. 00060 const SIM_Data &getOwner() const; 00061 /// Returns the current simulation time. 00062 const SIM_Time &getSimulationTime() const; 00063 /// Calls SIM_Data::buildGuideGeometry() on the owner data. 00064 bool buildGuideGeometry(const SIM_RootData &root, 00065 const GU_DetailHandle &gdh, 00066 UT_DMatrix4 *xform, 00067 const SIM_Time &t) const; 00068 00069 /// Override this function to customize how guide geometry is 00070 /// created or retrieved. Implementing this function is the whole 00071 /// point of this class. This function may build geometry, fetch 00072 /// existing geometry, modify existing geometry, or whatever else 00073 /// it sees fit. 00074 virtual GU_ConstDetailHandle getGuideGeometrySubclass( 00075 const SIM_RootData &root, 00076 UT_DMatrix4 &xform, 00077 const SIM_Time &t); 00078 /// Override this to report the amount of memory used by this object. 00079 /// Call the base class implementation as well and add that to the 00080 /// subclass-specific memory size. 00081 virtual int64 getMemorySizeSubclass() const; 00082 /// Override this function to clear any data create by this class. 00083 virtual void clearSubclass(); 00084 00085 private: 00086 const SIM_Data *myOwner; 00087 long myParmVersion; 00088 }; 00089 00090 #endif 00091
1.5.9