00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef _hyp_file_implx_h_
00033 #define _hyp_file_implx_h_
00034
00035
00045 class CXImplFile :
00046 public CImplBase,
00047 public ID3DMeshObject,
00048 hyp_ker::CUnknown
00049 {
00050 public:
00052 CXImplFile(hyp_ker::IUnknown*);
00053 virtual ~CXImplFile();
00054 hyp_DECLARE_IUNKNOWN
00055 virtual hyp_ker::com_result NondelegatingQueryInterface(const hyp_ker::hypIID&,void**);
00056 static hyp_ker::com_result CreateInstance(hyp_ker::IUnknown* ,hyp_ker::CUnknown**);
00057 hyp_ker::com_result Init(void);
00058 void FinalRelease(void);
00060
00064 virtual void SetObject(hyp_ker::IUnknown* pObject) {
00065 CImplBase::SetObject(pObject);
00066 }
00068
00072 virtual void InitializeD3DMeshBuilder(LPDIRECT3DRMMESHBUILDER3);
00073 virtual void SaveD3DMeshBuilder(const std::string&);
00074 virtual void SaveD3DHypMesh(const std::string&);
00075 virtual void LoadD3DHypMesh(const std::string&);
00077
00078 class CXOF {
00079 CXImplFile* m_pImplFile;
00080 protected:
00081 CXOF(CXImplFile* impl_file) : m_pImplFile(impl_file) { }
00082 inline hyp_ker::IUnknown* GetMeshUnknown(void) {
00083 return m_pImplFile->m_spUnknownMesh;
00084 }
00085 inline LPDIRECTXFILE GetXOFile(void) {
00086 return m_pImplFile->m_spDXFile;
00087 }
00088
00089 DWORD GetVertexProperties(const CMeshData::SVertex&);
00090 DWORD GetVertexDOF(const CMeshData::SVertex&);
00091 void SetVertexDOF(const CFlag&,hyp_fem::IFEOBoundaryConditions*);
00092 void SetVertexProperties(const CFlag&,hyp_fem::IGeometricVertex*);
00093 };
00094
00095 class CXOFSave :
00096 protected CXOF {
00097 public:
00098 CXOFSave(CXImplFile*, const std::string&);
00099 ~CXOFSave();
00100
00101 void SaveMesh(void);
00102 void SaveMatrix(void);
00103 void SaveGeometry(void);
00104
00105 private:
00106 void CreateDataObject(REFGUID, LPCSTR,const GUID*,DWORD,LPVOID);
00107 LPDIRECTXFILESAVEOBJECT m_pXOFSave;
00108 };
00109
00110 class CXOFLoad :
00111 protected CXOF {
00112 public:
00113 CXOFLoad(CXImplFile*,const std::string&);
00114 ~CXOFLoad();
00115 void Load(void);
00116 void LoadMesh(LPDIRECTXFILEDATA);
00117 void LoadMatrix(LPDIRECTXFILEDATA);
00118
00119 private:
00120 LPDIRECTXFILEENUMOBJECT m_pXOFEnum;
00121 };
00122
00123
00124
00125 private:
00126 hyp_ker::CSmartInterface<IDirectXFile> m_spDXFile;
00127
00128 friend CXOF;
00129 };
00130
00131
00132 #endif