![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2003 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: paperMapFactory.h,v $ $Revision: 1.9 $ $State: Exp $ 00007 *******************************************************************************/ 00008 #ifndef paperMapFactory_H_ 00009 #define paperMapFactory_H_ 00010 00011 // 00012 // \file papermapFactory.h 00013 // \brief Contains the DtPaperMapFactory class declaration. 00014 // 00015 00016 #include "terrainDbFactory/terrainDbFactoryDefines.h" 00017 #include <vlutil/vlFilename.h> 00018 #include <vlutil/vlList.h> 00019 #include <map> 00020 00021 class DtPaperMapDatabase; 00022 class DtPaperMap; 00023 class DtTerrainDatabase; 00024 class DtTdbMetafileFactory; 00025 00026 // 00027 // class DtPaperMapFactory: 00028 // 00029 // DtPaperMapFactory has a hashlist of DtPaperMapFactoryEntry 00030 // indexed by the DtString type that represents the type of file able to load. 00031 // 00032 00033 class DT_DLL_terrainDbFactory DtPaperMapFactory 00034 { 00035 public: 00036 00037 typedef DtPaperMap* (*DtPaperMapCreator)(); 00038 typedef std::map<DtString, DtPaperMapCreator> DtPaperMapCreatorContainer; 00039 00040 // constructor 00041 DtPaperMapFactory(DtTdbMetafileFactory* factory); 00042 00043 // copy constructor 00044 DtPaperMapFactory(const DtPaperMapFactory& orig); 00045 00046 // assignment operator 00047 const DtPaperMapFactory& operator=( 00048 const DtPaperMapFactory& orig); 00049 00050 // Destructor: deletes factory and any entries on the factory. 00051 virtual ~DtPaperMapFactory(); 00052 00053 // Registers all the default creators with the factory. 00054 virtual void init(); 00055 00056 virtual void setMetafileFactory(DtTdbMetafileFactory* factory); 00057 virtual DtTdbMetafileFactory* metafileFactory(); 00058 virtual const DtTdbMetafileFactory* metafileFactory() const; 00059 00060 // Register a creator with the factory. 00061 virtual void registerPaperMapCreator(const DtString &type, DtPaperMapCreator fcn); 00062 00063 // creator functions callers 00064 virtual DtPaperMap* createPaperMap(const DtString &type); 00065 00066 00067 // loading functions 00068 virtual bool loadPaperMap(const DtFilename& fileName, DtTerrainDatabase* terrain, 00069 DtPaperMapDatabase*& paperMapDatabase, const DtList& searchPaths); 00070 00071 static DtPaperMapFactory* create(); 00072 00073 protected: 00074 00075 DtPaperMapFactory(); 00076 00077 virtual bool loadPaperMap(const DtFilename& fileName, 00078 DtTerrainDatabase* terrain, DtPaperMapDatabase*& paperMapDatabase); 00079 00080 DtPaperMapCreatorContainer myPaperMapCreators; 00081 DtTdbMetafileFactory* myTdbMetafileFactory; 00082 }; 00083 00084 #endif 00085 00086