00001 // 00002 // Copyright (c) 2000 by Tech Soft 3D, LLC. 00003 // The information contained herein is confidential and proprietary to 00004 // Tech Soft 3D, LLC., and considered a trade secret as defined under 00005 // civil and criminal statutes. Tech Soft 3D shall pursue its civil 00006 // and criminal remedies in the event of unauthorized use or misappropriation 00007 // of its trade secrets. Use of this information by anyone other than 00008 // authorized employees of Tech Soft 3D, LLC. is granted only under a 00009 // written non-disclosure agreement, expressly prescribing the scope and 00010 // manner of such use. 00011 // 00012 // $Id$ 00013 // 00014 00015 #ifndef _HBASEMODEL_H 00016 #define _HBASEMODEL_H 00017 00018 #ifdef H_PACK_8 00019 #pragma pack(push) 00020 #pragma pack(8) 00021 #endif 00022 00023 #include "HTools.h" 00024 00025 00026 class HDB; 00027 class HBaseView; 00028 class HModelInfo; 00029 class HStreamFileToolkit; 00030 class HShellVertexData; 00031 class HBhvBehaviorManager; 00032 class HEventManager; 00033 class HOutputHandlerOptions; 00034 class HInputHandlerOptions; 00035 class HBhvKeyframeGenerator; 00036 class HBhvSegmentTracker; 00037 #ifndef SWIG 00038 class TK_Dispatch_XML; 00039 #endif 00040 00042 00052 class MVO_API HBaseModel 00053 { 00054 00055 public: 00056 00058 HBaseModel(char const * model = 0); 00059 00061 virtual ~HBaseModel(); 00062 00064 virtual void Init(); 00065 00067 virtual void Flush(); 00068 00070 bool GetFileLoadComplete() const {return m_bFileLoadComplete;}; 00072 void SetFileLoadComplete(bool value, HBaseView * pHView=0); 00073 00075 bool GetObjectCheck() const {return m_bObjectCheck;}; 00077 void SetObjectCheck(bool value) {m_bObjectCheck=value;}; 00078 00080 void SetStaticModel(bool value); 00082 bool GetStaticModel() const; 00084 bool GetStaticModelOn() const; 00085 00087 void SetLMVModel(bool value); 00089 bool GetLMVModel() const; 00090 00092 bool GetFirstFitComplete() const {return m_bFirstFitComplete;}; 00094 void SetFirstFitComplete(bool value) {m_bFirstFitComplete=value;}; 00095 00096 00097 00098 00111 virtual HFileInputResult Read(const __wchar_t * FileName, HBaseView * pHView=0, bool clean_include=true, HInputHandlerOptions * options = 0); 00112 #ifdef H_USHORT_OVERLOAD 00113 virtual HFileInputResult Read(const unsigned short * FileName, HBaseView * pHView=0, bool clean_include=true, HInputHandlerOptions * options = 0){ 00114 H_UTF16 utf16; 00115 utf16.encodedText((utf16_char*)FileName); 00116 return Read((__wchar_t*)H_WCS(utf16).encodedText(), pHView, clean_include, options); 00117 } 00118 #endif 00119 virtual HFileInputResult Read(const char * FileName, HBaseView * pHView=0, bool clean_include=true, HInputHandlerOptions * options = 0){ 00120 return Read((__wchar_t*)H_WCS(FileName).encodedText(), pHView, clean_include, options); 00121 } 00122 00134 virtual HFileOutputResult WriteWithOptions(const __wchar_t * FileName, HBaseView * pHView=0, HOutputHandlerOptions * options = 0); 00135 #ifdef H_USHORT_OVERLOAD 00136 virtual HFileOutputResult WriteWithOptions(const unsigned short * FileName, HBaseView * pHView=0, HOutputHandlerOptions * options = 0){ 00137 return WriteWithOptions((__wchar_t*)H_WCS(FileName).encodedText(), pHView, options); 00138 } 00139 #endif 00140 virtual HFileOutputResult WriteWithOptions(const char * FileName, HBaseView * pHView=0, HOutputHandlerOptions * options = 0){ 00141 return WriteWithOptions((__wchar_t*)H_WCS(FileName).encodedText(), pHView, options); 00142 } 00143 00157 virtual HFileOutputResult Write(const __wchar_t * FileName, HBaseView * pHView=0, float width = 0, float height = 0); 00158 #ifdef H_USHORT_OVERLOAD 00159 virtual HFileOutputResult Write(const unsigned short * FileName, HBaseView * pHView=0, float width = 0, float height = 0){ 00160 return Write((__wchar_t*)H_WCS(FileName).encodedText(), pHView, width, height); 00161 } 00162 #endif 00163 virtual HFileOutputResult Write(const char * FileName, HBaseView * pHView=0, float width = 0, float height = 0){ 00164 return Write((__wchar_t*)H_WCS(FileName).encodedText(), pHView, width, height); 00165 } 00166 00168 HModelInfo * GetHModelInfo() const; 00169 00171 virtual HStreamFileToolkit *GetStreamFileTK() const { return m_pHFile; } 00172 00174 virtual HC_KEY GetModelKey() const { return m_ModelKey; } 00175 00177 virtual HC_KEY GetModelIncludeKey() const { return m_ModelIncludeKey; } 00178 00180 virtual HC_KEY GetBBoxKey() const { return m_BBoxKey; } 00181 00188 virtual bool IsBRepGeometry() const {return m_bBRepGeometry;}; 00190 virtual void SetBRepGeometry(bool brep){m_bBRepGeometry = brep;}; 00191 00193 virtual bool IsFEAGeometry() const {return m_bFEAGeometry;}; 00195 virtual void SetFEAGeometry(bool fea){m_bFEAGeometry = fea;}; 00196 00198 virtual bool IsVectorGeometry() const {return m_bVectorGeometry;}; 00200 virtual void SetVectorGeometry(bool vector){m_bVectorGeometry = vector;}; 00201 00203 virtual void CleanIncludes(); 00204 00206 virtual void DeleteIncludedSegments(); 00207 00209 virtual HBhvBehaviorManager * GetBhvBehaviorManager(); 00210 00212 void SetBhvBehaviorManager( HBhvBehaviorManager* BehaviorManager ); 00213 00215 HEventManager *GetEventManager(); 00216 00221 void Update(bool antialias = false, bool forceUpdate = false); 00222 00223 void MakeAnimationSnapshot(int tick); 00224 virtual HFileOutputResult WriteWithAnimation(const __wchar_t * FileName, HBaseView * pHView=0, float width = 0, float height = 0); 00225 #ifdef H_USHORT_OVERLOAD 00226 virtual HFileOutputResult WriteWithAnimation(const unsigned short * FileName, HBaseView * pHView=0, float width = 0, float height = 0){ 00227 return WriteWithAnimation((__wchar_t*)H_WCS(FileName).encodedText(), pHView, width, height); 00228 } 00229 #endif 00230 virtual HFileOutputResult WriteWithAnimation(const char * FileName, HBaseView * pHView=0, float width = 0, float height = 0){ 00231 return WriteWithAnimation((__wchar_t*)H_WCS(FileName).encodedText(), pHView, width, height); 00232 } 00233 00234 virtual void CreateIncludeSegment(); 00235 00237 TK_Dispatch_XML * GetDispatchXML(); 00238 00239 protected: 00240 00241 HC_KEY m_ModelKey; 00242 HC_KEY m_ModelIncludeKey; 00243 HC_KEY m_BBoxKey; 00247 HStreamFileToolkit * m_pHFile; 00248 00250 mutable HModelInfo * m_pModelInfo; 00251 00252 bool m_bBRepGeometry; 00253 bool m_bFEAGeometry; 00254 bool m_bVectorGeometry; 00255 bool m_bNeedsStencilBuffer; 00259 bool m_bFileLoadComplete; 00260 00262 bool m_bObjectCheck; 00263 00264 00267 bool m_bFirstFitComplete; 00268 00270 HBhvBehaviorManager * m_pBhvBehaviorManager; 00271 00273 HEventManager * m_pEventManager; 00274 00275 #ifndef SWIG 00276 00277 TK_Dispatch_XML *m_pDispatchXML; 00278 #endif 00279 00280 HBhvKeyframeGenerator *m_pKeyframeGenerator; 00281 HBhvSegmentTracker *m_pSegmentTracker; 00282 }; 00283 00284 00285 #ifdef H_PACK_8 00286 #pragma pack(pop) 00287 #endif 00288 00289 #endif